diff --git a/Makefile b/Makefile index 2f11644ad0..c117f0edd2 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ MAKE = make CPPFLAGS += -P ifeq ($(OS),Windows_NT) - $(error Native Windows builds not yet supported. Please use WSL, Docker or a Linux VM) + DETECTED_OS=windows else UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) diff --git a/README.md b/README.md index 755b2ee9a2..b642c4d5a3 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,25 @@ For Windows 10, install WSL and a distribution by following this [Windows Subsystem for Linux Installation Guide](https://docs.microsoft.com/en-us/windows/wsl/install-win10). We recommend using Debian or Ubuntu 18.04 Linux distributions. -For older versions of Windows, install a Linux VM or refer to [Docker](#Docker) instructions. +For older versions of Windows, install a Linux VM or refer to either [Docker](#Docker) or [Cygwin](#Cygwin) instructions. + +### Cygwin + +If you want to use Cygwin, you will need to: +- Download and install [Git Bash](https://git-scm.com/download/win). +- Download and install [Cygwin](https://cygwin.com). +- [Build and install mips-linux-binutils](docs/BUILDING_BINUTILS_CYGWIN.md). + +Once mips-linux-binutils is installed you will need to install the following packages using Cygwin's installer: +- python3 +- libiconv +- dos2unix + +Now before you try to build anything, if you cloned the repository in windows you will need fix the file line endings: +```bash +dos2unix fixle.sh +./fixle.sh +``` ### macOS diff --git a/asm/non_matchings/code/audio_heap/func_800DFBF8.s b/asm/non_matchings/code/audio_heap/func_800DFBF8.s deleted file mode 100644 index 8f79f84a2e..0000000000 --- a/asm/non_matchings/code/audio_heap/func_800DFBF8.s +++ /dev/null @@ -1,607 +0,0 @@ -.late_rodata -glabel D_80149410 - .float 2880000 - -.text -glabel func_800DFBF8 -/* B56D98 800DFBF8 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* B56D9C 800DFBFC AFB60030 */ sw $s6, 0x30($sp) -/* B56DA0 800DFC00 3C168017 */ lui $s6, %hi(gAudioContext) # $s6, 0x8017 -/* B56DA4 800DFC04 26D6F180 */ addiu $s6, %lo(gAudioContext) # addiu $s6, $s6, -0xe80 -/* B56DA8 800DFC08 92CE3519 */ lbu $t6, 0x3519($s6) -/* B56DAC 800DFC0C 3C188013 */ lui $t8, %hi(gAudioSessionPresets) # $t8, 0x8013 -/* B56DB0 800DFC10 271837C8 */ addiu $t8, %lo(gAudioSessionPresets) # addiu $t8, $t8, 0x37c8 -/* B56DB4 800DFC14 000E78C0 */ sll $t7, $t6, 3 -/* B56DB8 800DFC18 01EE7823 */ subu $t7, $t7, $t6 -/* B56DBC 800DFC1C 000F78C0 */ sll $t7, $t7, 3 -/* B56DC0 800DFC20 AFBF003C */ sw $ra, 0x3c($sp) -/* B56DC4 800DFC24 AFBE0038 */ sw $fp, 0x38($sp) -/* B56DC8 800DFC28 AFB70034 */ sw $s7, 0x34($sp) -/* B56DCC 800DFC2C AFB5002C */ sw $s5, 0x2c($sp) -/* B56DD0 800DFC30 AFB40028 */ sw $s4, 0x28($sp) -/* B56DD4 800DFC34 AFB30024 */ sw $s3, 0x24($sp) -/* B56DD8 800DFC38 AFB20020 */ sw $s2, 0x20($sp) -/* B56DDC 800DFC3C AFB1001C */ sw $s1, 0x1c($sp) -/* B56DE0 800DFC40 AFB00018 */ sw $s0, 0x18($sp) -/* B56DE4 800DFC44 01F81021 */ addu $v0, $t7, $t8 -/* B56DE8 800DFC48 AEC02620 */ sw $zero, 0x2620($s6) -/* B56DEC 800DFC4C 8C590000 */ lw $t9, ($v0) -/* B56DF0 800DFC50 AFA20068 */ sw $v0, 0x68($sp) -/* B56DF4 800DFC54 A6D9284A */ sh $t9, 0x284a($s6) -/* B56DF8 800DFC58 0C040FFC */ jal osAiSetFrequency -/* B56DFC 800DFC5C 3324FFFF */ andi $a0, $t9, 0xffff -/* B56E00 800DFC60 96C3284A */ lhu $v1, 0x284a($s6) -/* B56E04 800DFC64 8EC92964 */ lw $t1, 0x2964($s6) -/* B56E08 800DFC68 8FA80068 */ lw $t0, 0x68($sp) -/* B56E0C 800DFC6C 44833000 */ mtc1 $v1, $f6 -/* B56E10 800DFC70 0069001A */ div $zero, $v1, $t1 -/* B56E14 800DFC74 00005012 */ mflo $t2 -/* B56E18 800DFC78 254B000F */ addiu $t3, $t2, 0xf -/* B56E1C 800DFC7C 316CFFF0 */ andi $t4, $t3, 0xfff0 -/* B56E20 800DFC80 A6CC284E */ sh $t4, 0x284e($s6) -/* B56E24 800DFC84 86C6284E */ lh $a2, 0x284e($s6) -/* B56E28 800DFC88 46803220 */ cvt.s.w $f8, $f6 -/* B56E2C 800DFC8C A6C2284C */ sh $v0, 0x284c($s6) -/* B56E30 800DFC90 15200002 */ bnez $t1, .L800DFC9C -/* B56E34 800DFC94 00000000 */ nop -/* B56E38 800DFC98 0007000D */ break 7 -.L800DFC9C: -/* B56E3C 800DFC9C 2401FFFF */ li $at, -1 -/* B56E40 800DFCA0 15210004 */ bne $t1, $at, .L800DFCB4 -/* B56E44 800DFCA4 3C018000 */ lui $at, 0x8000 -/* B56E48 800DFCA8 14610002 */ bne $v1, $at, .L800DFCB4 -/* B56E4C 800DFCAC 00000000 */ nop -/* B56E50 800DFCB0 0006000D */ break 6 -.L800DFCB4: -/* B56E54 800DFCB4 240100D0 */ li $at, 208 -/* B56E58 800DFCB8 24C40010 */ addiu $a0, $a2, 0x10 -/* B56E5C 800DFCBC 0081001A */ div $zero, $a0, $at -/* B56E60 800DFCC0 00007012 */ mflo $t6 -/* B56E64 800DFCC4 25CF0001 */ addiu $t7, $t6, 1 -/* B56E68 800DFCC8 A6CF2854 */ sh $t7, 0x2854($s6) -/* B56E6C 800DFCCC 86C72854 */ lh $a3, 0x2854($s6) -/* B56E70 800DFCD0 24CDFFF0 */ addiu $t5, $a2, -0x10 -/* B56E74 800DFCD4 A6CD2852 */ sh $t5, 0x2852($s6) -/* B56E78 800DFCD8 00C7001A */ div $zero, $a2, $a3 -/* B56E7C 800DFCDC 0000C012 */ mflo $t8 -/* B56E80 800DFCE0 44878000 */ mtc1 $a3, $f16 -/* B56E84 800DFCE4 A6C42850 */ sh $a0, 0x2850($s6) -/* B56E88 800DFCE8 14E00002 */ bnez $a3, .L800DFCF4 -/* B56E8C 800DFCEC 00000000 */ nop -/* B56E90 800DFCF0 0007000D */ break 7 -.L800DFCF4: -/* B56E94 800DFCF4 2401FFFF */ li $at, -1 -/* B56E98 800DFCF8 14E10004 */ bne $a3, $at, .L800DFD0C -/* B56E9C 800DFCFC 3C018000 */ lui $at, 0x8000 -/* B56EA0 800DFD00 14C10002 */ bne $a2, $at, .L800DFD0C -/* B56EA4 800DFD04 00000000 */ nop -/* B56EA8 800DFD08 0006000D */ break 6 -.L800DFD0C: -/* B56EAC 800DFD0C 2401FFF8 */ li $at, -8 -/* B56EB0 800DFD10 0301C824 */ and $t9, $t8, $at -/* B56EB4 800DFD14 3C0146FA */ li $at, 0x46FA0000 # 0.000000 -/* B56EB8 800DFD18 44812000 */ mtc1 $at, $f4 -/* B56EBC 800DFD1C 3C013B80 */ li $at, 0x3B800000 # 0.000000 -/* B56EC0 800DFD20 46808020 */ cvt.s.w $f0, $f16 -/* B56EC4 800DFD24 44819000 */ mtc1 $at, $f18 -/* B56EC8 800DFD28 3C013E80 */ li $at, 0x3E800000 # 0.000000 -/* B56ECC 800DFD2C A6D92856 */ sh $t9, 0x2856($s6) -/* B56ED0 800DFD30 86C52856 */ lh $a1, 0x2856($s6) -/* B56ED4 800DFD34 46082283 */ div.s $f10, $f4, $f8 -/* B56ED8 800DFD38 44812000 */ mtc1 $at, $f4 -/* B56EDC 800DFD3C 3C013F80 */ lui $at, 0x3f80 -/* B56EE0 800DFD40 24AA0008 */ addiu $t2, $a1, 8 -/* B56EE4 800DFD44 46040202 */ mul.s $f8, $f0, $f4 -/* B56EE8 800DFD48 24ABFFF8 */ addiu $t3, $a1, -8 -/* B56EEC 800DFD4C A6CA2858 */ sh $t2, 0x2858($s6) -/* B56EF0 800DFD50 A6CB285A */ sh $t3, 0x285a($s6) -/* B56EF4 800DFD54 3C048017 */ lui $a0, %hi(gAudioContext+0x3408) -/* B56EF8 800DFD58 24842588 */ addiu $a0, %lo(gAudioContext+0x3408) # addiu $a0, $a0, 0x2588 -/* B56EFC 800DFD5C E6C8286C */ swc1 $f8, 0x286c($s6) -/* B56F00 800DFD60 46009183 */ div.s $f6, $f18, $f0 -/* B56F04 800DFD64 E6CA2860 */ swc1 $f10, 0x2860($s6) -/* B56F08 800DFD68 44815000 */ mtc1 $at, $f10 -/* B56F0C 800DFD6C 00000000 */ nop -/* B56F10 800DFD70 46005403 */ div.s $f16, $f10, $f0 -/* B56F14 800DFD74 E6C62868 */ swc1 $f6, 0x2868($s6) -/* B56F18 800DFD78 E6D02864 */ swc1 $f16, 0x2864($s6) -/* B56F1C 800DFD7C 950C0010 */ lhu $t4, 0x10($t0) -/* B56F20 800DFD80 AECC2874 */ sw $t4, 0x2874($s6) -/* B56F24 800DFD84 950D0012 */ lhu $t5, 0x12($t0) -/* B56F28 800DFD88 AECD2878 */ sw $t5, 0x2878($s6) -/* B56F2C 800DFD8C 910E0005 */ lbu $t6, 5($t0) -/* B56F30 800DFD90 AECE2894 */ sw $t6, 0x2894($s6) -/* B56F34 800DFD94 910F0006 */ lbu $t7, 6($t0) -/* B56F38 800DFD98 A6CF285C */ sh $t7, 0x285c($s6) -/* B56F3C 800DFD9C 86D8285C */ lh $t8, 0x285c($s6) -/* B56F40 800DFDA0 2B010005 */ slti $at, $t8, 5 -/* B56F44 800DFDA4 14200002 */ bnez $at, .L800DFDB0 -/* B56F48 800DFDA8 24190004 */ li $t9, 4 -/* B56F4C 800DFDAC A6D9285C */ sh $t9, 0x285c($s6) -.L800DFDB0: -/* B56F50 800DFDB0 950A0014 */ lhu $t2, 0x14($t0) -/* B56F54 800DFDB4 3C0B8015 */ lui $t3, %hi(gTatumsPerBeat) # $t3, 0x8015 -/* B56F58 800DFDB8 3C018015 */ lui $at, %hi(D_80149410) -/* B56F5C 800DFDBC A6CA0002 */ sh $t2, 2($s6) -/* B56F60 800DFDC0 856BA6C2 */ lh $t3, %lo(gTatumsPerBeat)($t3) -/* B56F64 800DFDC4 C4329410 */ lwc1 $f18, %lo(D_80149410)($at) -/* B56F68 800DFDC8 C6D02960 */ lwc1 $f16, 0x2960($s6) -/* B56F6C 800DFDCC 448B2000 */ mtc1 $t3, $f4 -/* B56F70 800DFDD0 46120182 */ mul.s $f6, $f0, $f18 -/* B56F74 800DFDD4 240D0001 */ li $t5, 1 -/* B56F78 800DFDD8 46802220 */ cvt.s.w $f8, $f4 -/* B56F7C 800DFDDC 46083283 */ div.s $f10, $f6, $f8 -/* B56F80 800DFDE0 46105483 */ div.s $f18, $f10, $f16 -/* B56F84 800DFDE4 444CF800 */ cfc1 $t4, $31 -/* B56F88 800DFDE8 44CDF800 */ ctc1 $t5, $31 -/* B56F8C 800DFDEC 00000000 */ nop -/* B56F90 800DFDF0 46009124 */ cvt.w.s $f4, $f18 -/* B56F94 800DFDF4 444DF800 */ cfc1 $t5, $31 -/* B56F98 800DFDF8 00000000 */ nop -/* B56F9C 800DFDFC 31AD0078 */ andi $t5, $t5, 0x78 -/* B56FA0 800DFE00 11A00012 */ beqz $t5, .L800DFE4C -/* B56FA4 800DFE04 3C014F00 */ li $at, 0x4F000000 # 0.000000 -/* B56FA8 800DFE08 44812000 */ mtc1 $at, $f4 -/* B56FAC 800DFE0C 240D0001 */ li $t5, 1 -/* B56FB0 800DFE10 46049101 */ sub.s $f4, $f18, $f4 -/* B56FB4 800DFE14 44CDF800 */ ctc1 $t5, $31 -/* B56FB8 800DFE18 00000000 */ nop -/* B56FBC 800DFE1C 46002124 */ cvt.w.s $f4, $f4 -/* B56FC0 800DFE20 444DF800 */ cfc1 $t5, $31 -/* B56FC4 800DFE24 00000000 */ nop -/* B56FC8 800DFE28 31AD0078 */ andi $t5, $t5, 0x78 -/* B56FCC 800DFE2C 15A00005 */ bnez $t5, .L800DFE44 -/* B56FD0 800DFE30 00000000 */ nop -/* B56FD4 800DFE34 440D2000 */ mfc1 $t5, $f4 -/* B56FD8 800DFE38 3C018000 */ li $at, 0x80000000 # 0.000000 -/* B56FDC 800DFE3C 10000007 */ b .L800DFE5C -/* B56FE0 800DFE40 01A16825 */ or $t5, $t5, $at -.L800DFE44: -/* B56FE4 800DFE44 10000005 */ b .L800DFE5C -/* B56FE8 800DFE48 240DFFFF */ li $t5, -1 -.L800DFE4C: -/* B56FEC 800DFE4C 440D2000 */ mfc1 $t5, $f4 -/* B56FF0 800DFE50 00000000 */ nop -/* B56FF4 800DFE54 05A0FFFB */ bltz $t5, .L800DFE44 -/* B56FF8 800DFE58 00000000 */ nop -.L800DFE5C: -/* B56FFC 800DFE5C 44CCF800 */ ctc1 $t4, $31 -/* B57000 800DFE60 44893000 */ mtc1 $t1, $f6 -/* B57004 800DFE64 96CE284C */ lhu $t6, 0x284c($s6) -/* B57008 800DFE68 A6CD2898 */ sh $t5, 0x2898($s6) -/* B5700C 800DFE6C 46803220 */ cvt.s.w $f8, $f6 -/* B57010 800DFE70 448E2000 */ mtc1 $t6, $f4 -/* B57014 800DFE74 00000000 */ nop -/* B57018 800DFE78 468021A0 */ cvt.s.w $f6, $f4 -/* B5701C 800DFE7C E6C82870 */ swc1 $f8, 0x2870($s6) -/* B57020 800DFE80 C6CA2870 */ lwc1 $f10, 0x2870($s6) -/* B57024 800DFE84 46005402 */ mul.s $f16, $f10, $f0 -/* B57028 800DFE88 E6D02870 */ swc1 $f16, 0x2870($s6) -/* B5702C 800DFE8C 05C10005 */ bgez $t6, .L800DFEA4 -/* B57030 800DFE90 C6D22870 */ lwc1 $f18, 0x2870($s6) -/* B57034 800DFE94 3C014F80 */ li $at, 0x4F800000 # 0.000000 -/* B57038 800DFE98 44814000 */ mtc1 $at, $f8 -/* B5703C 800DFE9C 00000000 */ nop -/* B57040 800DFEA0 46083180 */ add.s $f6, $f6, $f8 -.L800DFEA4: -/* B57044 800DFEA4 46069283 */ div.s $f10, $f18, $f6 -/* B57048 800DFEA8 86CF2898 */ lh $t7, 0x2898($s6) -/* B5704C 800DFEAC 86CA2850 */ lh $t2, 0x2850($s6) -/* B57050 800DFEB0 86CC2852 */ lh $t4, 0x2852($s6) -/* B57054 800DFEB4 448F2000 */ mtc1 $t7, $f4 -/* B57058 800DFEB8 00000000 */ nop -/* B5705C 800DFEBC 46802220 */ cvt.s.w $f8, $f4 -/* B57060 800DFEC0 E6CA2870 */ swc1 $f10, 0x2870($s6) -/* B57064 800DFEC4 C6D02870 */ lwc1 $f16, 0x2870($s6) -/* B57068 800DFEC8 46088483 */ div.s $f18, $f16, $f8 -/* B5706C 800DFECC E6D22870 */ swc1 $f18, 0x2870($s6) -/* B57070 800DFED0 91180004 */ lbu $t8, 4($t0) -/* B57074 800DFED4 A6D82848 */ sh $t8, 0x2848($s6) -/* B57078 800DFED8 86C22848 */ lh $v0, 0x2848($s6) -/* B5707C 800DFEDC 00C20019 */ multu $a2, $v0 -/* B57080 800DFEE0 28410002 */ slti $at, $v0, 2 -/* B57084 800DFEE4 0000C812 */ mflo $t9 -/* B57088 800DFEE8 A6D9284E */ sh $t9, 0x284e($s6) -/* B5708C 800DFEEC 00000000 */ nop -/* B57090 800DFEF0 01420019 */ multu $t2, $v0 -/* B57094 800DFEF4 00005812 */ mflo $t3 -/* B57098 800DFEF8 A6CB2850 */ sh $t3, 0x2850($s6) -/* B5709C 800DFEFC 00000000 */ nop -/* B570A0 800DFF00 01820019 */ multu $t4, $v0 -/* B570A4 800DFF04 00006812 */ mflo $t5 -/* B570A8 800DFF08 A6CD2852 */ sh $t5, 0x2852($s6) -/* B570AC 800DFF0C 00000000 */ nop -/* B570B0 800DFF10 00E20019 */ multu $a3, $v0 -/* B570B4 800DFF14 00007012 */ mflo $t6 -/* B570B8 800DFF18 A6CE2854 */ sh $t6, 0x2854($s6) -/* B570BC 800DFF1C 54200005 */ bnezl $at, .L800DFF34 -/* B570C0 800DFF20 8ED92894 */ lw $t9, 0x2894($s6) -/* B570C4 800DFF24 86CF2850 */ lh $t7, 0x2850($s6) -/* B570C8 800DFF28 25F8FFF0 */ addiu $t8, $t7, -0x10 -/* B570CC 800DFF2C A6D82850 */ sh $t8, 0x2850($s6) -/* B570D0 800DFF30 8ED92894 */ lw $t9, 0x2894($s6) -.L800DFF34: -/* B570D4 800DFF34 86CB2854 */ lh $t3, 0x2854($s6) -/* B570D8 800DFF38 910D0009 */ lbu $t5, 9($t0) -/* B570DC 800DFF3C 00195100 */ sll $t2, $t9, 4 -/* B570E0 800DFF40 014B0019 */ multu $t2, $t3 -/* B570E4 800DFF44 000D7080 */ sll $t6, $t5, 2 -/* B570E8 800DFF48 01CD7023 */ subu $t6, $t6, $t5 -/* B570EC 800DFF4C 000E70C0 */ sll $t6, $t6, 3 -/* B570F0 800DFF50 8EC329A0 */ lw $v1, 0x29a0($s6) -/* B570F4 800DFF54 3C018017 */ lui $at, %hi(gAudioContext+0x3414) # $at, 0x8017 -/* B570F8 800DFF58 00006012 */ mflo $t4 -/* B570FC 800DFF5C 018E7821 */ addu $t7, $t4, $t6 -/* B57100 800DFF60 25F80140 */ addiu $t8, $t7, 0x140 -/* B57104 800DFF64 AED82890 */ sw $t8, 0x2890($s6) -/* B57108 800DFF68 8D0A001C */ lw $t2, 0x1c($t0) -/* B5710C 800DFF6C 8D190018 */ lw $t9, 0x18($t0) -/* B57110 800DFF70 8D0E0028 */ lw $t6, 0x28($t0) -/* B57114 800DFF74 8D0C0024 */ lw $t4, 0x24($t0) -/* B57118 800DFF78 8D0D0020 */ lw $t5, 0x20($t0) -/* B5711C 800DFF7C 8D18002C */ lw $t8, 0x2c($t0) -/* B57120 800DFF80 032A5821 */ addu $t3, $t9, $t2 -/* B57124 800DFF84 018E7821 */ addu $t7, $t4, $t6 -/* B57128 800DFF88 8ED92998 */ lw $t9, 0x2998($s6) -/* B5712C 800DFF8C 016D8021 */ addu $s0, $t3, $t5 -/* B57130 800DFF90 01F88821 */ addu $s1, $t7, $t8 -/* B57134 800DFF94 26100010 */ addiu $s0, $s0, 0x10 -/* B57138 800DFF98 26310010 */ addiu $s1, $s1, 0x10 -/* B5713C 800DFF9C 02111021 */ addu $v0, $s0, $s1 -/* B57140 800DFFA0 03222823 */ subu $a1, $t9, $v0 -/* B57144 800DFFA4 10600002 */ beqz $v1, .L800DFFB0 -/* B57148 800DFFA8 24A5FF00 */ addiu $a1, $a1, -0x100 -/* B5714C 800DFFAC AEC329A4 */ sw $v1, 0x29a4($s6) -.L800DFFB0: -/* B57150 800DFFB0 AEC53408 */ sw $a1, 0x3408($s6) -/* B57154 800DFFB4 0C037994 */ jal Audio_SessionPoolsInit -/* B57158 800DFFB8 AC222594 */ sw $v0, %lo(gAudioContext+0x3414)($at) -/* B5715C 800DFFBC 3C048017 */ lui $a0, %hi(gAudioContext+0x3418) # $a0, 0x8017 -/* B57160 800DFFC0 AED03418 */ sw $s0, 0x3418($s6) -/* B57164 800DFFC4 AED1341C */ sw $s1, 0x341c($s6) -/* B57168 800DFFC8 0C0379B5 */ jal Audio_SeqAndBankPoolInit -/* B5716C 800DFFCC 24842598 */ addiu $a0, %lo(gAudioContext+0x3418) # addiu $a0, $a0, 0x2598 -/* B57170 800DFFD0 8FA20068 */ lw $v0, 0x68($sp) -/* B57174 800DFFD4 3C048017 */ lui $a0, %hi(gAudioContext+0x3420) # $a0, 0x8017 -/* B57178 800DFFD8 248425A0 */ addiu $a0, %lo(gAudioContext+0x3420) # addiu $a0, $a0, 0x25a0 -/* B5717C 800DFFDC 8C4A0018 */ lw $t2, 0x18($v0) -/* B57180 800DFFE0 AECA3420 */ sw $t2, 0x3420($s6) -/* B57184 800DFFE4 8C4B001C */ lw $t3, 0x1c($v0) -/* B57188 800DFFE8 AECB3424 */ sw $t3, 0x3424($s6) -/* B5718C 800DFFEC 8C4D0020 */ lw $t5, 0x20($v0) -/* B57190 800DFFF0 0C0379D6 */ jal Audio_PersistentPoolsInit -/* B57194 800DFFF4 AECD3428 */ sw $t5, 0x3428($s6) -/* B57198 800DFFF8 8FA20068 */ lw $v0, 0x68($sp) -/* B5719C 800DFFFC 3C048017 */ lui $a0, %hi(gAudioContext+0x342c) # $a0, 0x8017 -/* B571A0 800E0000 248425AC */ addiu $a0, %lo(gAudioContext+0x342c) # addiu $a0, $a0, 0x25ac -/* B571A4 800E0004 8C4C0024 */ lw $t4, 0x24($v0) -/* B571A8 800E0008 AECC342C */ sw $t4, 0x342c($s6) -/* B571AC 800E000C 8C4E0028 */ lw $t6, 0x28($v0) -/* B571B0 800E0010 AECE3430 */ sw $t6, 0x3430($s6) -/* B571B4 800E0014 8C4F002C */ lw $t7, 0x2c($v0) -/* B571B8 800E0018 0C037A07 */ jal Audio_TemporaryPoolsInit -/* B571BC 800E001C AECF3434 */ sw $t7, 0x3434($s6) -/* B571C0 800E0020 0C0377E0 */ jal Audio_ResetLoadStatus -/* B571C4 800E0024 00000000 */ nop -/* B571C8 800E0028 8EC52894 */ lw $a1, 0x2894($s6) -/* B571CC 800E002C 3C138017 */ lui $s3, %hi(gAudioContext+0x29c0) # $s3, 0x8017 -/* B571D0 800E0030 26731B40 */ addiu $s3, %lo(gAudioContext+0x29c0) # addiu $s3, $s3, 0x1b40 -/* B571D4 800E0034 00A00821 */ addu $at, $a1, $zero -/* B571D8 800E0038 000528C0 */ sll $a1, $a1, 3 -/* B571DC 800E003C 00A12823 */ subu $a1, $a1, $at -/* B571E0 800E0040 00052940 */ sll $a1, $a1, 5 -/* B571E4 800E0044 0C0378E0 */ jal Audio_AllocZeroed -/* B571E8 800E0048 02602025 */ move $a0, $s3 -/* B571EC 800E004C 0C03A1E2 */ jal Audio_NoteInitAll -/* B571F0 800E0050 AEC2352C */ sw $v0, 0x352c($s6) -/* B571F4 800E0054 0C039F57 */ jal Audio_InitNoteFreeList -/* B571F8 800E0058 00000000 */ nop -/* B571FC 800E005C 86D82854 */ lh $t8, 0x2854($s6) -/* B57200 800E0060 8ED92894 */ lw $t9, 0x2894($s6) -/* B57204 800E0064 02602025 */ move $a0, $s3 -/* B57208 800E0068 03190019 */ multu $t8, $t9 -/* B5720C 800E006C 00002812 */ mflo $a1 -/* B57210 800E0070 00052940 */ sll $a1, $a1, 5 -/* B57214 800E0074 0C0378E0 */ jal Audio_AllocZeroed -/* B57218 800E0078 00000000 */ nop -/* B5721C 800E007C 3C108017 */ lui $s0, %hi(gAudioContext) # $s0, 0x8017 -/* B57220 800E0080 3C118017 */ lui $s1, %hi(gAudioContext+0x8) # $s1, 0x8017 -/* B57224 800E0084 AEC20014 */ sw $v0, 0x14($s6) -/* B57228 800E0088 2631F188 */ addiu $s1, %lo(gAudioContext+0x8) # addiu $s1, $s1, -0xe78 -/* B5722C 800E008C 2610F180 */ addiu $s0, %lo(gAudioContext) # addiu $s0, $s0, -0xe80 -.L800E0090: -/* B57230 800E0090 8EC52890 */ lw $a1, 0x2890($s6) -/* B57234 800E0094 02602025 */ move $a0, $s3 -/* B57238 800E0098 0C0378D1 */ jal Audio_AllocDmaMemoryZeroed -/* B5723C 800E009C 000528C0 */ sll $a1, $a1, 3 -/* B57240 800E00A0 26100004 */ addiu $s0, $s0, 4 -/* B57244 800E00A4 1611FFFA */ bne $s0, $s1, .L800E0090 -/* B57248 800E00A8 AE0228A8 */ sw $v0, 0x28a8($s0) -/* B5724C 800E00AC 02602025 */ move $a0, $s3 -/* B57250 800E00B0 0C0378F7 */ jal Audio_Alloc -/* B57254 800E00B4 24050400 */ li $a1, 1024 -/* B57258 800E00B8 0C03778F */ jal func_800DDE3C -/* B5725C 800E00BC AEC23520 */ sw $v0, 0x3520($s6) -/* B57260 800E00C0 3C148017 */ lui $s4, %hi(gAudioContext) # $s4, 0x8017 -/* B57264 800E00C4 3C028017 */ lui $v0, %hi(gAudioContext+0xb20) # $v0, 0x8017 -/* B57268 800E00C8 2442FCA0 */ addiu $v0, %lo(gAudioContext+0xb20) # addiu $v0, $v0, -0x360 -/* B5726C 800E00CC 2694F180 */ addiu $s4, %lo(gAudioContext) # addiu $s4, $s4, -0xe80 -.L800E00D0: -/* B57270 800E00D0 269402C8 */ addiu $s4, $s4, 0x2c8 -/* B57274 800E00D4 0282082B */ sltu $at, $s4, $v0 -/* B57278 800E00D8 1420FFFD */ bnez $at, .L800E00D0 -/* B5727C 800E00DC A280FD51 */ sb $zero, -0x2af($s4) -/* B57280 800E00E0 8FA20068 */ lw $v0, 0x68($sp) -/* B57284 800E00E4 904A0009 */ lbu $t2, 9($v0) -/* B57288 800E00E8 AFA00074 */ sw $zero, 0x74($sp) -/* B5728C 800E00EC A2CA0001 */ sb $t2, 1($s6) -/* B57290 800E00F0 82CB0001 */ lb $t3, 1($s6) -/* B57294 800E00F4 196000CA */ blez $t3, .L800E0420 -/* B57298 800E00F8 3C0D8017 */ lui $t5, %hi(gAudioContext+0x2b0) # $t5, 0x8017 -/* B5729C 800E00FC 25ADF430 */ addiu $t5, %lo(gAudioContext+0x2b0) # addiu $t5, $t5, -0xbd0 -/* B572A0 800E0100 3C148017 */ lui $s4, %hi(gAudioContext) # $s4, 0x8017 -/* B572A4 800E0104 3C128017 */ lui $s2, %hi(gAudioContext+0x18) # $s2, 0x8017 -/* B572A8 800E0108 3C1E8017 */ lui $fp, %hi(gAudioContext+0x2a0) # $fp, 0x8017 -/* B572AC 800E010C 27DEF420 */ addiu $fp, %lo(gAudioContext+0x2a0) # addiu $fp, $fp, -0xbe0 -/* B572B0 800E0110 2652F198 */ addiu $s2, %lo(gAudioContext+0x18) # addiu $s2, $s2, -0xe68 -/* B572B4 800E0114 2694F180 */ addiu $s4, %lo(gAudioContext) # addiu $s4, $s4, -0xe80 -/* B572B8 800E0118 AFAD0044 */ sw $t5, 0x44($sp) -/* B572BC 800E011C 0000B825 */ move $s7, $zero -.L800E0120: -/* B572C0 800E0120 8FA20068 */ lw $v0, 0x68($sp) -/* B572C4 800E0124 02602025 */ move $a0, $s3 -/* B572C8 800E0128 8C4C000C */ lw $t4, 0xc($v0) -/* B572CC 800E012C 0197A821 */ addu $s5, $t4, $s7 -/* B572D0 800E0130 92AE0000 */ lbu $t6, ($s5) -/* B572D4 800E0134 A28E001C */ sb $t6, 0x1c($s4) -/* B572D8 800E0138 96AF0002 */ lhu $t7, 2($s5) -/* B572DC 800E013C 31CA00FF */ andi $t2, $t6, 0xff -/* B572E0 800E0140 000FC180 */ sll $t8, $t7, 6 -/* B572E4 800E0144 3319FFFF */ andi $t9, $t8, 0xffff -/* B572E8 800E0148 032A001A */ div $zero, $t9, $t2 -/* B572EC 800E014C A698001E */ sh $t8, 0x1e($s4) -/* B572F0 800E0150 00005812 */ mflo $t3 -/* B572F4 800E0154 A68B001E */ sh $t3, 0x1e($s4) -/* B572F8 800E0158 96AD0004 */ lhu $t5, 4($s5) -/* B572FC 800E015C 15400002 */ bnez $t2, .L800E0168 -/* B57300 800E0160 00000000 */ nop -/* B57304 800E0164 0007000D */ break 7 -.L800E0168: -/* B57308 800E0168 2401FFFF */ li $at, -1 -/* B5730C 800E016C 15410004 */ bne $t2, $at, .L800E0180 -/* B57310 800E0170 3C018000 */ lui $at, 0x8000 -/* B57314 800E0174 17210002 */ bne $t9, $at, .L800E0180 -/* B57318 800E0178 00000000 */ nop -/* B5731C 800E017C 0006000D */ break 6 -.L800E0180: -/* B57320 800E0180 A68D0024 */ sh $t5, 0x24($s4) -/* B57324 800E0184 96AC000A */ lhu $t4, 0xa($s5) -/* B57328 800E0188 9685001E */ lhu $a1, 0x1e($s4) -/* B5732C 800E018C A68C0022 */ sh $t4, 0x22($s4) -/* B57330 800E0190 96AE0006 */ lhu $t6, 6($s5) -/* B57334 800E0194 240C0008 */ li $t4, 8 -/* B57338 800E0198 00052840 */ sll $a1, $a1, 1 -/* B5733C 800E019C 000E7980 */ sll $t7, $t6, 6 -/* B57340 800E01A0 A68F002C */ sh $t7, 0x2c($s4) -/* B57344 800E01A4 96B80008 */ lhu $t8, 8($s5) -/* B57348 800E01A8 A2800030 */ sb $zero, 0x30($s4) -/* B5734C 800E01AC A698002E */ sh $t8, 0x2e($s4) -/* B57350 800E01B0 96B9000C */ lhu $t9, 0xc($s5) -/* B57354 800E01B4 A6990028 */ sh $t9, 0x28($s4) -/* B57358 800E01B8 96AA000E */ lhu $t2, 0xe($s5) -/* B5735C 800E01BC A68A002A */ sh $t2, 0x2a($s4) -/* B57360 800E01C0 82AB0010 */ lb $t3, 0x10($s5) -/* B57364 800E01C4 A28B001D */ sb $t3, 0x1d($s4) -/* B57368 800E01C8 96AD0012 */ lhu $t5, 0x12($s5) -/* B5736C 800E01CC A28C0019 */ sb $t4, 0x19($s4) -/* B57370 800E01D0 0C037896 */ jal func_800DE258 -/* B57374 800E01D4 A68D0020 */ sh $t5, 0x20($s4) -/* B57378 800E01D8 96450006 */ lhu $a1, 6($s2) -/* B5737C 800E01DC AE420028 */ sw $v0, 0x28($s2) -/* B57380 800E01E0 02602025 */ move $a0, $s3 -/* B57384 800E01E4 0C037896 */ jal func_800DE258 -/* B57388 800E01E8 00052840 */ sll $a1, $a1, 1 -/* B5738C 800E01EC 92590288 */ lbu $t9, 0x288($s2) -/* B57390 800E01F0 96450006 */ lhu $a1, 6($s2) -/* B57394 800E01F4 240E0002 */ li $t6, 2 -/* B57398 800E01F8 240F0001 */ li $t7, 1 -/* B5739C 800E01FC 332AFF0F */ andi $t2, $t9, 0xff0f -/* B573A0 800E0200 AE42002C */ sw $v0, 0x2c($s2) -/* B573A4 800E0204 AE40001C */ sw $zero, 0x1c($s2) -/* B573A8 800E0208 AE400020 */ sw $zero, 0x20($s2) -/* B573AC 800E020C A2400003 */ sb $zero, 3($s2) -/* B573B0 800E0210 A24E0002 */ sb $t6, 2($s2) -/* B573B4 800E0214 A24F0000 */ sb $t7, ($s2) -/* B573B8 800E0218 AE5E0280 */ sw $fp, 0x280($s2) -/* B573BC 800E021C 354D0040 */ ori $t5, $t2, 0x40 -/* B573C0 800E0220 AE450024 */ sw $a1, 0x24($s2) -/* B573C4 800E0224 8FB80044 */ lw $t8, 0x44($sp) -/* B573C8 800E0228 3C013F80 */ li $at, 0x3F800000 # 0.000000 -/* B573CC 800E022C A24D0288 */ sb $t5, 0x288($s2) -/* B573D0 800E0230 31AC00F3 */ andi $t4, $t5, 0xf3 -/* B573D4 800E0234 44813000 */ mtc1 $at, $f6 -/* B573D8 800E0238 A24C0288 */ sb $t4, 0x288($s2) -/* B573DC 800E023C 8E440288 */ lw $a0, 0x288($s2) -/* B573E0 800E0240 3C0100FF */ lui $at, (0x00FFFFFF >> 16) # lui $at, 0xff -/* B573E4 800E0244 3421FFFF */ ori $at, (0x00FFFFFF & 0xFFFF) # ori $at, $at, 0xffff -/* B573E8 800E0248 00057040 */ sll $t6, $a1, 1 -/* B573EC 800E024C 01C17824 */ and $t7, $t6, $at -/* B573F0 800E0250 AE580290 */ sw $t8, 0x290($s2) -/* B573F4 800E0254 01E4C026 */ xor $t8, $t7, $a0 -/* B573F8 800E0258 92420004 */ lbu $v0, 4($s2) -/* B573FC 800E025C 0018CA00 */ sll $t9, $t8, 8 -/* B57400 800E0260 8E4D0028 */ lw $t5, 0x28($s2) -/* B57404 800E0264 00195202 */ srl $t2, $t9, 8 -/* B57408 800E0268 240C0001 */ li $t4, 1 -/* B5740C 800E026C 24010001 */ li $at, 1 -/* B57410 800E0270 01445826 */ xor $t3, $t2, $a0 -/* B57414 800E0274 AE4B0288 */ sw $t3, 0x288($s2) -/* B57418 800E0278 AE400298 */ sw $zero, 0x298($s2) -/* B5741C 800E027C AE4C02A0 */ sw $t4, 0x2a0($s2) -/* B57420 800E0280 00A01825 */ move $v1, $a1 -/* B57424 800E0284 AE45029C */ sw $a1, 0x29c($s2) -/* B57428 800E0288 E6460284 */ swc1 $f6, 0x284($s2) -/* B5742C 800E028C 10410035 */ beq $v0, $at, .L800E0364 -/* B57430 800E0290 AE4D028C */ sw $t5, 0x28c($s2) -/* B57434 800E0294 340E8000 */ li $t6, 32768 -/* B57438 800E0298 01C2001A */ div $zero, $t6, $v0 -/* B5743C 800E029C 00007812 */ mflo $t7 -/* B57440 800E02A0 A64F000E */ sh $t7, 0xe($s2) -/* B57444 800E02A4 14400002 */ bnez $v0, .L800E02B0 -/* B57448 800E02A8 00000000 */ nop -/* B5744C 800E02AC 0007000D */ break 7 -.L800E02B0: -/* B57450 800E02B0 2401FFFF */ li $at, -1 -/* B57454 800E02B4 14410004 */ bne $v0, $at, .L800E02C8 -/* B57458 800E02B8 3C018000 */ lui $at, 0x8000 -/* B5745C 800E02BC 15C10002 */ bne $t6, $at, .L800E02C8 -/* B57460 800E02C0 00000000 */ nop -/* B57464 800E02C4 0006000D */ break 6 -.L800E02C8: -/* B57468 800E02C8 02602025 */ move $a0, $s3 -/* B5746C 800E02CC 24050020 */ li $a1, 32 -/* B57470 800E02D0 0C0378E0 */ jal Audio_AllocZeroed -/* B57474 800E02D4 00008825 */ move $s1, $zero -/* B57478 800E02D8 AE420030 */ sw $v0, 0x30($s2) -/* B5747C 800E02DC 02602025 */ move $a0, $s3 -/* B57480 800E02E0 0C0378E0 */ jal Audio_AllocZeroed -/* B57484 800E02E4 24050020 */ li $a1, 32 -/* B57488 800E02E8 AE420034 */ sw $v0, 0x34($s2) -/* B5748C 800E02EC 02602025 */ move $a0, $s3 -/* B57490 800E02F0 0C0378E0 */ jal Audio_AllocZeroed -/* B57494 800E02F4 24050020 */ li $a1, 32 -/* B57498 800E02F8 AE420038 */ sw $v0, 0x38($s2) -/* B5749C 800E02FC 02602025 */ move $a0, $s3 -/* B574A0 800E0300 0C0378E0 */ jal Audio_AllocZeroed -/* B574A4 800E0304 24050020 */ li $a1, 32 -/* B574A8 800E0308 AE42003C */ sw $v0, 0x3c($s2) -/* B574AC 800E030C 86D82854 */ lh $t8, 0x2854($s6) -/* B574B0 800E0310 5B000015 */ blezl $t8, .L800E0368 -/* B574B4 800E0314 86AD0014 */ lh $t5, 0x14($s5) -/* B574B8 800E0318 02408025 */ move $s0, $s2 -/* B574BC 800E031C 02602025 */ move $a0, $s3 -.L800E0320: -/* B574C0 800E0320 0C037896 */ jal func_800DE258 -/* B574C4 800E0324 24050340 */ li $a1, 832 -/* B574C8 800E0328 245901A0 */ addiu $t9, $v0, 0x1a0 -/* B574CC 800E032C AE020044 */ sw $v0, 0x44($s0) -/* B574D0 800E0330 AE190048 */ sw $t9, 0x48($s0) -/* B574D4 800E0334 02602025 */ move $a0, $s3 -/* B574D8 800E0338 0C037896 */ jal func_800DE258 -/* B574DC 800E033C 24050340 */ li $a1, 832 -/* B574E0 800E0340 244A01A0 */ addiu $t2, $v0, 0x1a0 -/* B574E4 800E0344 AE0200D0 */ sw $v0, 0xd0($s0) -/* B574E8 800E0348 AE0A00D4 */ sw $t2, 0xd4($s0) -/* B574EC 800E034C 86CB2854 */ lh $t3, 0x2854($s6) -/* B574F0 800E0350 26310001 */ addiu $s1, $s1, 1 -/* B574F4 800E0354 2610001C */ addiu $s0, $s0, 0x1c -/* B574F8 800E0358 022B082A */ slt $at, $s1, $t3 -/* B574FC 800E035C 5420FFF0 */ bnezl $at, .L800E0320 -/* B57500 800E0360 02602025 */ move $a0, $s3 -.L800E0364: -/* B57504 800E0364 86AD0014 */ lh $t5, 0x14($s5) -.L800E0368: -/* B57508 800E0368 51A0000F */ beql $t5, $zero, .L800E03A8 -/* B5750C 800E036C AE400270 */ sw $zero, 0x270($s2) -/* B57510 800E0370 02602025 */ move $a0, $s3 -/* B57514 800E0374 0C0378D1 */ jal Audio_AllocDmaMemoryZeroed -/* B57518 800E0378 24050040 */ li $a1, 64 -/* B5751C 800E037C AE420278 */ sw $v0, 0x278($s2) -/* B57520 800E0380 02602025 */ move $a0, $s3 -/* B57524 800E0384 0C0378C2 */ jal Audio_AllocDmaMemory -/* B57528 800E0388 24050010 */ li $a1, 16 -/* B5752C 800E038C AE420270 */ sw $v0, 0x270($s2) -/* B57530 800E0390 86A50014 */ lh $a1, 0x14($s5) -/* B57534 800E0394 0C037D77 */ jal func_800DF5DC -/* B57538 800E0398 00402025 */ move $a0, $v0 -/* B5753C 800E039C 10000003 */ b .L800E03AC -/* B57540 800E03A0 86AC0016 */ lh $t4, 0x16($s5) -/* B57544 800E03A4 AE400270 */ sw $zero, 0x270($s2) -.L800E03A8: -/* B57548 800E03A8 86AC0016 */ lh $t4, 0x16($s5) -.L800E03AC: -/* B5754C 800E03AC 5180000F */ beql $t4, $zero, .L800E03EC -/* B57550 800E03B0 AE400274 */ sw $zero, 0x274($s2) -/* B57554 800E03B4 02602025 */ move $a0, $s3 -/* B57558 800E03B8 0C0378D1 */ jal Audio_AllocDmaMemoryZeroed -/* B5755C 800E03BC 24050040 */ li $a1, 64 -/* B57560 800E03C0 AE42027C */ sw $v0, 0x27c($s2) -/* B57564 800E03C4 02602025 */ move $a0, $s3 -/* B57568 800E03C8 0C0378C2 */ jal Audio_AllocDmaMemory -/* B5756C 800E03CC 24050010 */ li $a1, 16 -/* B57570 800E03D0 AE420274 */ sw $v0, 0x274($s2) -/* B57574 800E03D4 86A50016 */ lh $a1, 0x16($s5) -/* B57578 800E03D8 0C037D77 */ jal func_800DF5DC -/* B5757C 800E03DC 00402025 */ move $a0, $v0 -/* B57580 800E03E0 10000003 */ b .L800E03F0 -/* B57584 800E03E4 8FA20074 */ lw $v0, 0x74($sp) -/* B57588 800E03E8 AE400274 */ sw $zero, 0x274($s2) -.L800E03EC: -/* B5758C 800E03EC 8FA20074 */ lw $v0, 0x74($sp) -.L800E03F0: -/* B57590 800E03F0 8FAE0044 */ lw $t6, 0x44($sp) -/* B57594 800E03F4 82D80001 */ lb $t8, 1($s6) -/* B57598 800E03F8 24420001 */ addiu $v0, $v0, 1 -/* B5759C 800E03FC 25CF02C8 */ addiu $t7, $t6, 0x2c8 -/* B575A0 800E0400 0058082A */ slt $at, $v0, $t8 -/* B575A4 800E0404 AFAF0044 */ sw $t7, 0x44($sp) -/* B575A8 800E0408 AFA20074 */ sw $v0, 0x74($sp) -/* B575AC 800E040C 269402C8 */ addiu $s4, $s4, 0x2c8 -/* B575B0 800E0410 26F70018 */ addiu $s7, $s7, 0x18 -/* B575B4 800E0414 265202C8 */ addiu $s2, $s2, 0x2c8 -/* B575B8 800E0418 1420FF41 */ bnez $at, .L800E0120 -/* B575BC 800E041C 27DE02C8 */ addiu $fp, $fp, 0x2c8 -.L800E0420: -/* B575C0 800E0420 0C03B237 */ jal Audio_InitSequencePlayers -/* B575C4 800E0424 00008825 */ move $s1, $zero -/* B575C8 800E0428 86D9285C */ lh $t9, 0x285c($s6) -/* B575CC 800E042C 3C108017 */ lui $s0, %hi(gAudioContext+0x3530) # $s0, 0x8017 -/* B575D0 800E0430 261026B0 */ addiu $s0, %lo(gAudioContext+0x3530) # addiu $s0, $s0, 0x26b0 -/* B575D4 800E0434 5B20000C */ blezl $t9, .L800E0468 -/* B575D8 800E0438 8FAB0068 */ lw $t3, 0x68($sp) -.L800E043C: -/* B575DC 800E043C 0C03B1CD */ jal func_800EC734 -/* B575E0 800E0440 02202025 */ move $a0, $s1 -/* B575E4 800E0444 0C03B19A */ jal Audio_ResetSequencePlayer -/* B575E8 800E0448 02002025 */ move $a0, $s0 -/* B575EC 800E044C 86CA285C */ lh $t2, 0x285c($s6) -/* B575F0 800E0450 26310001 */ addiu $s1, $s1, 1 -/* B575F4 800E0454 26100160 */ addiu $s0, $s0, 0x160 -/* B575F8 800E0458 022A082A */ slt $at, $s1, $t2 -/* B575FC 800E045C 1420FFF7 */ bnez $at, .L800E043C -/* B57600 800E0460 00000000 */ nop -/* B57604 800E0464 8FAB0068 */ lw $t3, 0x68($sp) -.L800E0468: -/* B57608 800E0468 8D640030 */ lw $a0, 0x30($t3) -/* B5760C 800E046C 0C03818D */ jal func_800E0634 -/* B57610 800E0470 8D650034 */ lw $a1, 0x34($t3) -/* B57614 800E0474 0C038586 */ jal func_800E1618 -/* B57618 800E0478 8EC42894 */ lw $a0, 0x2894($s6) -/* B5761C 800E047C 0C038D00 */ jal func_800E3400 -/* B57620 800E0480 AEC0176C */ sw $zero, 0x176c($s6) -/* B57624 800E0484 0C0393EC */ jal func_800E4FB0 -/* B57628 800E0488 00000000 */ nop -/* B5762C 800E048C 0C038E85 */ jal func_800E3A14 -/* B57630 800E0490 00000000 */ nop -/* B57634 800E0494 240D1000 */ li $t5, 4096 -/* B57638 800E0498 0C039365 */ jal func_800E4D94 -/* B5763C 800E049C A6CD0004 */ sh $t5, 4($s6) -/* B57640 800E04A0 0C0013D0 */ jal osSetIntMask -/* B57644 800E04A4 24040001 */ li $a0, 1 -/* B57648 800E04A8 0C041924 */ jal osWritebackDCacheAll -/* B5764C 800E04AC 00408025 */ move $s0, $v0 -/* B57650 800E04B0 0C0013D0 */ jal osSetIntMask -/* B57654 800E04B4 02002025 */ move $a0, $s0 -/* B57658 800E04B8 8FBF003C */ lw $ra, 0x3c($sp) -/* B5765C 800E04BC 8FB00018 */ lw $s0, 0x18($sp) -/* B57660 800E04C0 8FB1001C */ lw $s1, 0x1c($sp) -/* B57664 800E04C4 8FB20020 */ lw $s2, 0x20($sp) -/* B57668 800E04C8 8FB30024 */ lw $s3, 0x24($sp) -/* B5766C 800E04CC 8FB40028 */ lw $s4, 0x28($sp) -/* B57670 800E04D0 8FB5002C */ lw $s5, 0x2c($sp) -/* B57674 800E04D4 8FB60030 */ lw $s6, 0x30($sp) -/* B57678 800E04D8 8FB70034 */ lw $s7, 0x34($sp) -/* B5767C 800E04DC 8FBE0038 */ lw $fp, 0x38($sp) -/* B57680 800E04E0 03E00008 */ jr $ra -/* B57684 800E04E4 27BD00A0 */ addiu $sp, $sp, 0xa0 - diff --git a/asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s b/asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s similarity index 98% rename from asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s rename to asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s index 11b39f0082..b781a086c9 100644 --- a/asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s +++ b/asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s @@ -21,7 +21,7 @@ glabel D_80136AE8 .float 0.014285714 .text -glabel ActorShadow_DrawFunc_Teardrop +glabel ActorShadow_DrawFeet /* AA2A64 8002B8C4 27BDFEC8 */ addiu $sp, $sp, -0x138 /* AA2A68 8002B8C8 AFBF007C */ sw $ra, 0x7c($sp) /* AA2A6C 8002B8CC AFBE0078 */ sw $fp, 0x78($sp) @@ -119,7 +119,7 @@ glabel ActorShadow_DrawFunc_Teardrop .L8002BA2C: /* AA2BCC 8002BA2C 44CEF800 */ ctc1 $t6, $31 /* AA2BD0 8002BA30 A3CF00C8 */ sb $t7, 0xc8($fp) -/* AA2BD4 8002BA34 0C00AD7B */ jal ActorShadow_DrawFunc_Circle +/* AA2BD4 8002BA34 0C00AD7B */ jal ActorShadow_DrawCircle /* AA2BD8 8002BA38 8FA5013C */ lw $a1, 0x13c($sp) /* AA2BDC 8002BA3C E7D600C4 */ swc1 $f22, 0xc4($fp) /* AA2BE0 8002BA40 A3D000C8 */ sb $s0, 0xc8($fp) @@ -260,7 +260,7 @@ glabel ActorShadow_DrawFunc_Teardrop /* AA2DDC 8002BC3C 02479021 */ addu $s2, $s2, $a3 /* AA2DE0 8002BC40 E7B80010 */ swc1 $f24, 0x10($sp) /* AA2DE4 8002BC44 E7B60014 */ swc1 $f22, 0x14($sp) -/* AA2DE8 8002BC48 0C00AD9B */ jal func_8002B66C +/* AA2DE8 8002BC48 0C00AD9B */ jal ActorShadow_DrawFoot /* AA2DEC 8002BC4C E7B40018 */ swc1 $f20, 0x18($sp) /* AA2DF0 8002BC50 26310001 */ addiu $s1, $s1, 1 .L8002BC54: @@ -292,7 +292,7 @@ glabel ActorShadow_DrawFunc_Teardrop /* AA2E4C 8002BCAC 02802025 */ move $a0, $s4 /* AA2E50 8002BCB0 E7B80010 */ swc1 $f24, 0x10($sp) /* AA2E54 8002BCB4 E7B60014 */ swc1 $f22, 0x14($sp) -/* AA2E58 8002BCB8 0C00AD9B */ jal func_8002B66C +/* AA2E58 8002BCB8 0C00AD9B */ jal ActorShadow_DrawFoot /* AA2E5C 8002BCBC E7B40018 */ swc1 $f20, 0x18($sp) .L8002BCC0: /* AA2E60 8002BCC0 26310001 */ addiu $s1, $s1, 1 diff --git a/asm/non_matchings/code/z_onepointdemo/func_8007C850.s b/asm/non_matchings/code/z_onepointdemo/func_8007C850.s index 5847a33b1f..1960b9e683 100644 --- a/asm/non_matchings/code/z_onepointdemo/func_8007C850.s +++ b/asm/non_matchings/code/z_onepointdemo/func_8007C850.s @@ -1673,7 +1673,7 @@ glabel func_8007C850 /* AF49CC 8007D82C 27B000A0 */ addiu $s0, $sp, 0xa0 .L8007D830: /* AF49D0 8007D830 02002025 */ move $a0, $s0 -/* AF49D4 8007D834 0C00BBB9 */ jal func_8002EEE4 +/* AF49D4 8007D834 0C00BBB9 */ jal Actor_GetFocus /* AF49D8 8007D838 02202825 */ move $a1, $s1 /* AF49DC 8007D83C 8E190000 */ lw $t9, ($s0) /* AF49E0 8007D840 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2067,7 +2067,7 @@ glabel L8007DDF8 /* AF4FB4 8007DE14 02202825 */ move $a1, $s1 /* AF4FB8 8007DE18 E7B000B8 */ swc1 $f16, 0xb8($sp) /* AF4FBC 8007DE1C E7A600BC */ swc1 $f6, 0xbc($sp) -/* AF4FC0 8007DE20 0C00BBB9 */ jal func_8002EEE4 +/* AF4FC0 8007DE20 0C00BBB9 */ jal Actor_GetFocus /* AF4FC4 8007DE24 E7A400B4 */ swc1 $f4, 0xb4($sp) /* AF4FC8 8007DE28 8E0D0000 */ lw $t5, ($s0) /* AF4FCC 8007DE2C 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2412,7 +2412,7 @@ glabel L8007E340 /* AF54E0 8007E340 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF54E4 8007E344 02002025 */ move $a0, $s0 /* AF54E8 8007E348 02202825 */ move $a1, $s1 -/* AF54EC 8007E34C 0C00BBC5 */ jal func_8002EF14 +/* AF54EC 8007E34C 0C00BBC5 */ jal Actor_GetWorld /* AF54F0 8007E350 AFB100F4 */ sw $s1, 0xf4($sp) /* AF54F4 8007E354 8E0E0000 */ lw $t6, ($s0) /* AF54F8 8007E358 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2432,7 +2432,7 @@ glabel L8007E340 /* AF5530 8007E390 02002025 */ move $a0, $s0 /* AF5534 8007E394 E7A600C4 */ swc1 $f6, 0xc4($sp) /* AF5538 8007E398 02802825 */ move $a1, $s4 -/* AF553C 8007E39C 0C00BBC5 */ jal func_8002EF14 +/* AF553C 8007E39C 0C00BBC5 */ jal Actor_GetWorld /* AF5540 8007E3A0 E7A800D0 */ swc1 $f8, 0xd0($sp) /* AF5544 8007E3A4 02202025 */ move $a0, $s1 /* AF5548 8007E3A8 0C01F1C1 */ jal func_8007C704 @@ -2473,7 +2473,7 @@ glabel L8007E340 glabel L8007E434 /* AF55D4 8007E434 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF55D8 8007E438 02002025 */ move $a0, $s0 -/* AF55DC 8007E43C 0C00BBC5 */ jal func_8002EF14 +/* AF55DC 8007E43C 0C00BBC5 */ jal Actor_GetWorld /* AF55E0 8007E440 02202825 */ move $a1, $s1 /* AF55E4 8007E444 8E0E0000 */ lw $t6, ($s0) /* AF55E8 8007E448 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2517,7 +2517,7 @@ glabel L8007E4DC /* AF567C 8007E4DC 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5680 8007E4E0 02002025 */ move $a0, $s0 /* AF5684 8007E4E4 02202825 */ move $a1, $s1 -/* AF5688 8007E4E8 0C00BBD1 */ jal func_8002EF44 +/* AF5688 8007E4E8 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF568C 8007E4EC AFB100F4 */ sw $s1, 0xf4($sp) /* AF5690 8007E4F0 8E190000 */ lw $t9, ($s0) /* AF5694 8007E4F4 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2622,11 +2622,11 @@ glabel L8007E5DC /* AF5818 8007E678 E66400FC */ swc1 $f4, 0xfc($s3) /* AF581C 8007E67C 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5820 8007E680 02002025 */ move $a0, $s0 -/* AF5824 8007E684 0C00BBD1 */ jal func_8002EF44 +/* AF5824 8007E684 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF5828 8007E688 8FA500F4 */ lw $a1, 0xf4($sp) /* AF582C 8007E68C 27B5008C */ addiu $s5, $sp, 0x8c /* AF5830 8007E690 02A02025 */ move $a0, $s5 -/* AF5834 8007E694 0C00BBB9 */ jal func_8002EEE4 +/* AF5834 8007E694 0C00BBB9 */ jal Actor_GetFocus /* AF5838 8007E698 02802825 */ move $a1, $s4 /* AF583C 8007E69C 3C01428C */ li $at, 0x428C0000 # 0.000000 /* AF5840 8007E6A0 44814000 */ mtc1 $at, $f8 @@ -2681,7 +2681,7 @@ glabel L8007E5DC .L8007E764: /* AF5904 8007E764 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5908 8007E768 02002025 */ move $a0, $s0 -/* AF590C 8007E76C 0C00BBC5 */ jal func_8002EF14 +/* AF590C 8007E76C 0C00BBC5 */ jal Actor_GetWorld /* AF5910 8007E770 02202825 */ move $a1, $s1 /* AF5914 8007E774 8E0D0000 */ lw $t5, ($s0) /* AF5918 8007E778 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2730,7 +2730,7 @@ glabel L8007E5DC glabel L8007E824 /* AF59C4 8007E824 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF59C8 8007E828 02002025 */ move $a0, $s0 -/* AF59CC 8007E82C 0C00BBB9 */ jal func_8002EEE4 +/* AF59CC 8007E82C 0C00BBB9 */ jal Actor_GetFocus /* AF59D0 8007E830 02202825 */ move $a1, $s1 /* AF59D4 8007E834 8E190000 */ lw $t9, ($s0) /* AF59D8 8007E838 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2746,7 +2746,7 @@ glabel L8007E824 /* AF5A00 8007E860 0C030202 */ jal func_800C0808 /* AF5A04 8007E864 AE390008 */ sw $t9, 8($s1) /* AF5A08 8007E868 02002025 */ move $a0, $s0 -/* AF5A0C 8007E86C 0C00BBC5 */ jal func_8002EF14 +/* AF5A0C 8007E86C 0C00BBC5 */ jal Actor_GetWorld /* AF5A10 8007E870 02802825 */ move $a1, $s4 /* AF5A14 8007E874 27A400D0 */ addiu $a0, $sp, 0xd0 /* AF5A18 8007E878 02202825 */ move $a1, $s1 @@ -2821,7 +2821,7 @@ glabel L8007E914 /* AF5B24 8007E984 0C00B7D5 */ jal func_8002DF54 /* AF5B28 8007E988 24060008 */ li $a2, 8 /* AF5B2C 8007E98C 27A400A0 */ addiu $a0, $sp, 0xa0 -/* AF5B30 8007E990 0C00BBC5 */ jal func_8002EF14 +/* AF5B30 8007E990 0C00BBC5 */ jal Actor_GetWorld /* AF5B34 8007E994 8FA500F4 */ lw $a1, 0xf4($sp) /* AF5B38 8007E998 3C018014 */ lui $at, %hi(D_8013D6CC) /* AF5B3C 8007E99C C42AD6CC */ lwc1 $f10, %lo(D_8013D6CC)($at) @@ -3033,7 +3033,7 @@ glabel L8007EC78 /* AF5E5C 8007ECBC 8E5900E8 */ lw $t9, 0xe8($s2) /* AF5E60 8007ECC0 ADF90008 */ sw $t9, 8($t7) /* AF5E64 8007ECC4 C65000D0 */ lwc1 $f16, 0xd0($s2) -/* AF5E68 8007ECC8 0C00BBB9 */ jal func_8002EEE4 +/* AF5E68 8007ECC8 0C00BBB9 */ jal Actor_GetFocus /* AF5E6C 8007ECCC E4301F24 */ swc1 $f16, %lo(D_80121F24)($at) /* AF5E70 8007ECD0 87AD00AE */ lh $t5, 0xae($sp) /* AF5E74 8007ECD4 3C0E8012 */ lui $t6, %hi(D_80121F1C) # $t6, 0x8012 @@ -3756,10 +3756,10 @@ glabel L8007F6E8 /* AF693C 8007F79C 8FBF0044 */ lw $ra, 0x44($sp) .L8007F7A0: /* AF6940 8007F7A0 27A400A0 */ addiu $a0, $sp, 0xa0 -/* AF6944 8007F7A4 0C00BBB9 */ jal func_8002EEE4 +/* AF6944 8007F7A4 0C00BBB9 */ jal Actor_GetFocus /* AF6948 8007F7A8 02202825 */ move $a1, $s1 /* AF694C 8007F7AC 27A4008C */ addiu $a0, $sp, 0x8c -/* AF6950 8007F7B0 0C00BBB9 */ jal func_8002EEE4 +/* AF6950 8007F7B0 0C00BBB9 */ jal Actor_GetFocus /* AF6954 8007F7B4 02802825 */ move $a1, $s4 /* AF6958 8007F7B8 C7A600A4 */ lwc1 $f6, 0xa4($sp) /* AF695C 8007F7BC C7A80090 */ lwc1 $f8, 0x90($sp) @@ -3907,7 +3907,7 @@ glabel L8007F6E8 /* AF6B6C 8007F9CC 27B000A0 */ addiu $s0, $sp, 0xa0 .L8007F9D0: /* AF6B70 8007F9D0 02002025 */ move $a0, $s0 -/* AF6B74 8007F9D4 0C00BBD1 */ jal func_8002EF44 +/* AF6B74 8007F9D4 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF6B78 8007F9D8 02802825 */ move $a1, $s4 /* AF6B7C 8007F9DC 8FA600DC */ lw $a2, 0xdc($sp) /* AF6B80 8007F9E0 27A400D0 */ addiu $a0, $sp, 0xd0 diff --git a/asm/non_matchings/code/z_play/Gameplay_Update.s b/asm/non_matchings/code/z_play/Gameplay_Update.s index 66651a4360..d98bf97397 100644 --- a/asm/non_matchings/code/z_play/Gameplay_Update.s +++ b/asm/non_matchings/code/z_play/Gameplay_Update.s @@ -1588,7 +1588,7 @@ glabel L800BE148 /* B35624 800BE484 34211E60 */ ori $at, (0x00011E60 & 0xFFFF) # ori $at, $at, 0x1e60 /* B35628 800BE488 02012821 */ addu $a1, $s0, $at /* B3562C 800BE48C AFA50038 */ sw $a1, 0x38($sp) -/* B35630 800BE490 0C0184E7 */ jal func_8006139C +/* B35630 800BE490 0C0184E7 */ jal CollisionCheck_AT /* B35634 800BE494 02002025 */ move $a0, $s0 /* B35638 800BE498 3C188016 */ lui $t8, %hi(gGameInfo) # $t8, 0x8016 /* B3563C 800BE49C 8F18FA90 */ lw $t8, %lo(gGameInfo)($t8) @@ -1620,7 +1620,7 @@ glabel L800BE148 /* B356A0 800BE500 24050001 */ li $a1, 1 .L800BE504: /* B356A4 800BE504 02002025 */ move $a0, $s0 -/* B356A8 800BE508 0C0188B9 */ jal func_800622E4 +/* B356A8 800BE508 0C0188B9 */ jal CollisionCheck_Damage /* B356AC 800BE50C 8FA50038 */ lw $a1, 0x38($sp) /* B356B0 800BE510 3C0B8016 */ lui $t3, %hi(gGameInfo) # $t3, 0x8016 /* B356B4 800BE514 8D6BFA90 */ lw $t3, %lo(gGameInfo)($t3) @@ -1636,7 +1636,7 @@ glabel L800BE148 /* B356DC 800BE53C 24050001 */ li $a1, 1 .L800BE540: /* B356E0 800BE540 02002025 */ move $a0, $s0 -/* B356E4 800BE544 0C017503 */ jal CollisionCheck_InitContext +/* B356E4 800BE544 0C017503 */ jal CollisionCheck_ClearContext /* B356E8 800BE548 8FA50038 */ lw $a1, 0x38($sp) /* B356EC 800BE54C 3C0D8016 */ lui $t5, %hi(gGameInfo) # $t5, 0x8016 /* B356F0 800BE550 8DADFA90 */ lw $t5, %lo(gGameInfo)($t5) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s index 41617cdf21..fdde2f2b1c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s @@ -80,7 +80,7 @@ glabel func_808705D8 /* 00AF4 808706D4 02002025 */ or $a0, $s0, $zero ## $a0 = 0000016C /* 00AF8 808706D8 27A5004C */ addiu $a1, $sp, 0x004C ## $a1 = FFFFFFAC /* 00AFC 808706DC 27A60058 */ addiu $a2, $sp, 0x0058 ## $a2 = FFFFFFB8 -/* 00B00 808706E0 0C0189CD */ jal func_80062734 +/* 00B00 808706E0 0C0189CD */ jal Collider_SetQuadVertices /* 00B04 808706E4 27A70064 */ addiu $a3, $sp, 0x0064 ## $a3 = FFFFFFC4 /* 00B08 808706E8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 00B0C 808706EC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s index ce8391cdad..a4f2832e8d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s @@ -135,7 +135,7 @@ glabel BgDyYoseizo_Update /* 022D8 80874B08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 022DC 80874B0C 46083002 */ mul.s $f0, $f6, $f8 /* 022E0 80874B10 44050000 */ mfc1 $a1, $f0 -/* 022E4 80874B14 0C00B56E */ jal Actor_SetHeight +/* 022E4 80874B14 0C00B56E */ jal Actor_SetFocus /* 022E8 80874B18 E6000328 */ swc1 $f0, 0x0328($s0) ## 00000328 /* 022EC 80874B1C C60A0328 */ lwc1 $f10, 0x0328($s0) ## 00000328 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Destroy.s deleted file mode 100644 index 69fd5d8505..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Destroy.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel BgHakaZou_Destroy -/* 002E4 808828A4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 002E8 808828A8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 002EC 808828AC AFA5001C */ sw $a1, 0x001C($sp) -/* 002F0 808828B0 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 002F4 808828B4 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 002F8 808828B8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 002FC 808828BC 11C10009 */ beq $t6, $at, .L808828E4 -/* 00300 808828C0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00304 808828C4 8CE6014C */ lw $a2, 0x014C($a3) ## 0000014C -/* 00308 808828C8 AFA70018 */ sw $a3, 0x0018($sp) -/* 0030C 808828CC 0C00FB56 */ jal DynaPoly_DeleteBgActor - ## DynaPoly_DeleteBgActor -/* 00310 808828D0 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 00314 808828D4 8FA70018 */ lw $a3, 0x0018($sp) -/* 00318 808828D8 8FA4001C */ lw $a0, 0x001C($sp) -/* 0031C 808828DC 0C0170EB */ jal Collider_DestroyCylinder - -/* 00320 808828E0 24E5016C */ addiu $a1, $a3, 0x016C ## $a1 = 0000016C -.L808828E4: -/* 00324 808828E4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00328 808828E8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0032C 808828EC 03E00008 */ jr $ra -/* 00330 808828F0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s deleted file mode 100644 index dde017b3ba..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s +++ /dev/null @@ -1,224 +0,0 @@ -.late_rodata -glabel D_80883660 - .float 0.005 -glabel D_80883664 - .float 0.025 -glabel D_80883668 - .float 3000 - -.text -glabel BgHakaZou_Init -/* 00000 808825C0 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00004 808825C4 AFA5003C */ sw $a1, 0x003C($sp) -/* 00008 808825C8 AFBF001C */ sw $ra, 0x001C($sp) -/* 0000C 808825CC AFB00018 */ sw $s0, 0x0018($sp) -/* 00010 808825D0 3C058088 */ lui $a1, %hi(D_80883648) ## $a1 = 80880000 -/* 00014 808825D4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00018 808825D8 0C01E037 */ jal Actor_ProcessInitChain - -/* 0001C 808825DC 24A53648 */ addiu $a1, $a1, %lo(D_80883648) ## $a1 = 80883648 -/* 00020 808825E0 8619001C */ lh $t9, 0x001C($s0) ## 0000001C -/* 00024 808825E4 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 00028 808825E8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 0002C 808825EC 332800FF */ andi $t0, $t9, 0x00FF ## $t0 = 00000000 -/* 00030 808825F0 A608001C */ sh $t0, 0x001C($s0) ## 0000001C -/* 00034 808825F4 8609001C */ lh $t1, 0x001C($s0) ## 0000001C -/* 00038 808825F8 000EC203 */ sra $t8, $t6, 8 -/* 0003C 808825FC A2180169 */ sb $t8, 0x0169($s0) ## 00000169 -/* 00040 80882600 15210052 */ bne $t1, $at, .L8088274C -/* 00044 80882604 8FA4003C */ lw $a0, 0x003C($sp) -/* 00048 80882608 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 0004C 8088260C 00000000 */ nop -/* 00050 80882610 3C018088 */ lui $at, %hi(D_80883660) ## $at = 80880000 -/* 00054 80882614 C4243660 */ lwc1 $f4, %lo(D_80883660)($at) -/* 00058 80882618 3C018088 */ lui $at, %hi(D_80883664) ## $at = 80880000 -/* 0005C 8088261C C4283664 */ lwc1 $f8, %lo(D_80883664)($at) -/* 00060 80882620 46040182 */ mul.s $f6, $f0, $f4 -/* 00064 80882624 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00068 80882628 46083280 */ add.s $f10, $f6, $f8 -/* 0006C 8088262C 44055000 */ mfc1 $a1, $f10 -/* 00070 80882630 0C00B58B */ jal Actor_SetScale - -/* 00074 80882634 00000000 */ nop -/* 00078 80882638 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 0007C 8088263C 00000000 */ nop -/* 00080 80882640 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00084 80882644 E6000068 */ swc1 $f0, 0x0068($s0) ## 00000068 -/* 00088 80882648 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 0008C 8088264C 44818000 */ mtc1 $at, $f16 ## $f16 = 0.50 -/* 00090 80882650 3C014580 */ lui $at, 0x4580 ## $at = 45800000 -/* 00094 80882654 44816000 */ mtc1 $at, $f12 ## $f12 = 4096.00 -/* 00098 80882658 4610003C */ c.lt.s $f0, $f16 -/* 0009C 8088265C 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 000A0 80882660 45000003 */ bc1f .L80882670 -/* 000A4 80882664 00000000 */ nop -/* 000A8 80882668 10000001 */ beq $zero, $zero, .L80882670 -/* 000AC 8088266C 2403FFFF */ addiu $v1, $zero, 0xFFFF ## $v1 = FFFFFFFF -.L80882670: -/* 000B0 80882670 0C00CFC8 */ jal Rand_CenteredFloat - -/* 000B4 80882674 AFA30028 */ sw $v1, 0x0028($sp) -/* 000B8 80882678 8FA30028 */ lw $v1, 0x0028($sp) -/* 000BC 8088267C 860A00B6 */ lh $t2, 0x00B6($s0) ## 000000B6 -/* 000C0 80882680 240E0014 */ addiu $t6, $zero, 0x0014 ## $t6 = 00000014 -/* 000C4 80882684 A60E016A */ sh $t6, 0x016A($s0) ## 0000016A -/* 000C8 80882688 01430019 */ multu $t2, $v1 -/* 000CC 8088268C 24040100 */ addiu $a0, $zero, 0x0100 ## $a0 = 00000100 -/* 000D0 80882690 24050300 */ addiu $a1, $zero, 0x0300 ## $a1 = 00000300 -/* 000D4 80882694 00005812 */ mflo $t3 -/* 000D8 80882698 448B9000 */ mtc1 $t3, $f18 ## $f18 = 0.00 -/* 000DC 8088269C 00000000 */ nop -/* 000E0 808826A0 46809120 */ cvt.s.w $f4, $f18 -/* 000E4 808826A4 46040180 */ add.s $f6, $f0, $f4 -/* 000E8 808826A8 4600320D */ trunc.w.s $f8, $f6 -/* 000EC 808826AC 440D4000 */ mfc1 $t5, $f8 -/* 000F0 808826B0 0C01DF64 */ jal Rand_S16Offset - -/* 000F4 808826B4 A60D0032 */ sh $t5, 0x0032($s0) ## 00000032 -/* 000F8 808826B8 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 000FC 808826BC A7A20026 */ sh $v0, 0x0026($sp) -/* 00100 808826C0 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00104 808826C4 44815000 */ mtc1 $at, $f10 ## $f10 = 0.50 -/* 00108 808826C8 87AF0026 */ lh $t7, 0x0026($sp) -/* 0010C 808826CC 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 00110 808826D0 460A003C */ c.lt.s $f0, $f10 -/* 00114 808826D4 00000000 */ nop -/* 00118 808826D8 45000003 */ bc1f .L808826E8 -/* 0011C 808826DC 00000000 */ nop -/* 00120 808826E0 10000001 */ beq $zero, $zero, .L808826E8 -/* 00124 808826E4 2403FFFF */ addiu $v1, $zero, 0xFFFF ## $v1 = FFFFFFFF -.L808826E8: -/* 00128 808826E8 006F0019 */ multu $v1, $t7 -/* 0012C 808826EC 24040400 */ addiu $a0, $zero, 0x0400 ## $a0 = 00000400 -/* 00130 808826F0 24050800 */ addiu $a1, $zero, 0x0800 ## $a1 = 00000800 -/* 00134 808826F4 0000C012 */ mflo $t8 -/* 00138 808826F8 A6180030 */ sh $t8, 0x0030($s0) ## 00000030 -/* 0013C 808826FC 0C01DF64 */ jal Rand_S16Offset - -/* 00140 80882700 00000000 */ nop -/* 00144 80882704 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00148 80882708 A7A20026 */ sh $v0, 0x0026($sp) -/* 0014C 8088270C 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00150 80882710 44818000 */ mtc1 $at, $f16 ## $f16 = 0.50 -/* 00154 80882714 87B90026 */ lh $t9, 0x0026($sp) -/* 00158 80882718 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 0015C 8088271C 4610003C */ c.lt.s $f0, $f16 -/* 00160 80882720 00000000 */ nop -/* 00164 80882724 45000003 */ bc1f .L80882734 -/* 00168 80882728 00000000 */ nop -/* 0016C 8088272C 10000001 */ beq $zero, $zero, .L80882734 -/* 00170 80882730 2403FFFF */ addiu $v1, $zero, 0xFFFF ## $v1 = FFFFFFFF -.L80882734: -/* 00174 80882734 00790019 */ multu $v1, $t9 -/* 00178 80882738 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 0017C 8088273C 00004012 */ mflo $t0 -/* 00180 80882740 A6080034 */ sh $t0, 0x0034($s0) ## 00000034 -/* 00184 80882744 1000001C */ beq $zero, $zero, .L808827B8 -/* 00188 80882748 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -.L8088274C: -/* 0018C 8088274C 2605016C */ addiu $a1, $s0, 0x016C ## $a1 = 0000016C -/* 00190 80882750 0C0170D9 */ jal Collider_InitCylinder - -/* 00194 80882754 AFA50020 */ sw $a1, 0x0020($sp) -/* 00198 80882758 3C078088 */ lui $a3, %hi(D_808835F0) ## $a3 = 80880000 -/* 0019C 8088275C 24E735F0 */ addiu $a3, $a3, %lo(D_808835F0) ## $a3 = 808835F0 -/* 001A0 80882760 8FA4003C */ lw $a0, 0x003C($sp) -/* 001A4 80882764 8FA50020 */ lw $a1, 0x0020($sp) -/* 001A8 80882768 0C01712B */ jal Collider_SetCylinder - -/* 001AC 8088276C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 001B0 80882770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B4 80882774 0C0189B7 */ jal Collider_CylinderUpdate - -/* 001B8 80882778 8FA50020 */ lw $a1, 0x0020($sp) -/* 001BC 8088277C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001C0 80882780 0C010D20 */ jal DynaPolyActor_Init - -/* 001C4 80882784 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 001C8 80882788 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 001CC 8088278C 3C018088 */ lui $at, %hi(D_80883668) ## $at = 80880000 -/* 001D0 80882790 54400009 */ bnel $v0, $zero, .L808827B8 -/* 001D4 80882794 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 001D8 80882798 C4203668 */ lwc1 $f0, %lo(D_80883668)($at) -/* 001DC 8088279C 3C0144FA */ lui $at, 0x44FA ## $at = 44FA0000 -/* 001E0 808827A0 44819000 */ mtc1 $at, $f18 ## $f18 = 2000.00 -/* 001E4 808827A4 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 001E8 808827A8 E60000F8 */ swc1 $f0, 0x00F8($s0) ## 000000F8 -/* 001EC 808827AC E60000FC */ swc1 $f0, 0x00FC($s0) ## 000000FC -/* 001F0 808827B0 E61200F4 */ swc1 $f18, 0x00F4($s0) ## 000000F4 -/* 001F4 808827B4 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -.L808827B8: -/* 001F8 808827B8 14410009 */ bne $v0, $at, .L808827E0 -/* 001FC 808827BC 8FA4003C */ lw $a0, 0x003C($sp) -/* 00200 808827C0 8FA4003C */ lw $a0, 0x003C($sp) -/* 00204 808827C4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00208 808827C8 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 0020C 808827CC 2405008D */ addiu $a1, $zero, 0x008D ## $a1 = 0000008D -/* 00210 808827D0 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00214 808827D4 00812021 */ addu $a0, $a0, $at -/* 00218 808827D8 10000007 */ beq $zero, $zero, .L808827F8 -/* 0021C 808827DC A2020168 */ sb $v0, 0x0168($s0) ## 00000168 -.L808827E0: -/* 00220 808827E0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00224 808827E4 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 00228 808827E8 00812021 */ addu $a0, $a0, $at -/* 0022C 808827EC 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00230 808827F0 24050069 */ addiu $a1, $zero, 0x0069 ## $a1 = 00000069 -/* 00234 808827F4 A2020168 */ sb $v0, 0x0168($s0) ## 00000168 -.L808827F8: -/* 00238 808827F8 82090168 */ lb $t1, 0x0168($s0) ## 00000168 -/* 0023C 808827FC 05230006 */ bgezl $t1, .L80882818 -/* 00240 80882800 860A001C */ lh $t2, 0x001C($s0) ## 0000001C -/* 00244 80882804 0C00B55C */ jal Actor_Kill - -/* 00248 80882808 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0024C 8088280C 1000001D */ beq $zero, $zero, .L80882884 -/* 00250 80882810 00000000 */ nop -/* 00254 80882814 860A001C */ lh $t2, 0x001C($s0) ## 0000001C -.L80882818: -/* 00258 80882818 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 0025C 8088281C 8FA4003C */ lw $a0, 0x003C($sp) -/* 00260 80882820 11410018 */ beq $t2, $at, .L80882884 -/* 00264 80882824 00000000 */ nop -/* 00268 80882828 0C00B2D0 */ jal Flags_GetSwitch - -/* 0026C 8088282C 92050169 */ lbu $a1, 0x0169($s0) ## 00000169 -/* 00270 80882830 10400014 */ beq $v0, $zero, .L80882884 -/* 00274 80882834 00000000 */ nop -/* 00278 80882838 860B001C */ lh $t3, 0x001C($s0) ## 0000001C -/* 0027C 8088283C 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 -/* 00280 80882840 51600006 */ beql $t3, $zero, .L8088285C -/* 00284 80882844 44813000 */ mtc1 $at, $f6 ## $f6 = 80.00 -/* 00288 80882848 0C00B55C */ jal Actor_Kill - -/* 0028C 8088284C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00290 80882850 1000000C */ beq $zero, $zero, .L80882884 -/* 00294 80882854 00000000 */ nop -/* 00298 80882858 44813000 */ mtc1 $at, $f6 ## $f6 = 0.00 -.L8088285C: -/* 0029C 8088285C 3C014258 */ lui $at, 0x4258 ## $at = 42580000 -/* 002A0 80882860 C604002C */ lwc1 $f4, 0x002C($s0) ## 0000002C -/* 002A4 80882864 44818000 */ mtc1 $at, $f16 ## $f16 = 54.00 -/* 002A8 80882868 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 002AC 8088286C 46062201 */ sub.s $f8, $f4, $f6 -/* 002B0 80882870 240CC000 */ addiu $t4, $zero, 0xC000 ## $t4 = FFFFC000 -/* 002B4 80882874 A60C00B4 */ sh $t4, 0x00B4($s0) ## 000000B4 -/* 002B8 80882878 46105481 */ sub.s $f18, $f10, $f16 -/* 002BC 8088287C E608002C */ swc1 $f8, 0x002C($s0) ## 0000002C -/* 002C0 80882880 E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028 -.L80882884: -/* 002C4 80882884 3C0D8088 */ lui $t5, %hi(func_80882A70) ## $t5 = 80880000 -/* 002C8 80882888 25AD2A70 */ addiu $t5, $t5, %lo(func_80882A70) ## $t5 = 80882A70 -/* 002CC 8088288C AE0D0164 */ sw $t5, 0x0164($s0) ## 00000164 -/* 002D0 80882890 8FBF001C */ lw $ra, 0x001C($sp) -/* 002D4 80882894 8FB00018 */ lw $s0, 0x0018($sp) -/* 002D8 80882898 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 002DC 8088289C 03E00008 */ jr $ra -/* 002E0 808828A0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Update.s deleted file mode 100644 index e7b65c63c9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Update.s +++ /dev/null @@ -1,20 +0,0 @@ -glabel BgHakaZou_Update -/* 00FB4 80883574 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00FB8 80883578 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00FBC 8088357C AFA40018 */ sw $a0, 0x0018($sp) -/* 00FC0 80883580 8C990164 */ lw $t9, 0x0164($a0) ## 00000164 -/* 00FC4 80883584 0320F809 */ jalr $ra, $t9 -/* 00FC8 80883588 00000000 */ nop -/* 00FCC 8088358C 8FA40018 */ lw $a0, 0x0018($sp) -/* 00FD0 80883590 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00FD4 80883594 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 00FD8 80883598 55C10004 */ bnel $t6, $at, .L808835AC -/* 00FDC 8088359C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00FE0 808835A0 0C00B638 */ jal Actor_MoveForward - -/* 00FE4 808835A4 00000000 */ nop -/* 00FE8 808835A8 8FBF0014 */ lw $ra, 0x0014($sp) -.L808835AC: -/* 00FEC 808835AC 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00FF0 808835B0 03E00008 */ jr $ra -/* 00FF4 808835B4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808828F4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808828F4.s deleted file mode 100644 index 9599b0a5c6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808828F4.s +++ /dev/null @@ -1,103 +0,0 @@ -glabel func_808828F4 -/* 00334 808828F4 27BDFF70 */ addiu $sp, $sp, 0xFF70 ## $sp = FFFFFF70 -/* 00338 808828F8 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 0033C 808828FC 44813000 */ mtc1 $at, $f6 ## $f6 = 1.00 -/* 00340 80882900 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 00344 80882904 44814000 */ mtc1 $at, $f8 ## $f8 = 2.00 -/* 00348 80882908 F7BC0040 */ sdc1 $f28, 0x0040($sp) -/* 0034C 8088290C 3C01447A */ lui $at, 0x447A ## $at = 447A0000 -/* 00350 80882910 4481E000 */ mtc1 $at, $f28 ## $f28 = 1000.00 -/* 00354 80882914 F7BA0038 */ sdc1 $f26, 0x0038($sp) -/* 00358 80882918 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 0035C 8088291C 4481D000 */ mtc1 $at, $f26 ## $f26 = 200.00 -/* 00360 80882920 F7B80030 */ sdc1 $f24, 0x0030($sp) -/* 00364 80882924 3C014270 */ lui $at, 0x4270 ## $at = 42700000 -/* 00368 80882928 4481C000 */ mtc1 $at, $f24 ## $f24 = 60.00 -/* 0036C 8088292C F7B60028 */ sdc1 $f22, 0x0028($sp) -/* 00370 80882930 3C0142E0 */ lui $at, 0x42E0 ## $at = 42E00000 -/* 00374 80882934 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 00378 80882938 4481B000 */ mtc1 $at, $f22 ## $f22 = 112.00 -/* 0037C 8088293C AFB40058 */ sw $s4, 0x0058($sp) -/* 00380 80882940 F7B40020 */ sdc1 $f20, 0x0020($sp) -/* 00384 80882944 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00388 80882948 AFB60060 */ sw $s6, 0x0060($sp) -/* 0038C 8088294C AFB5005C */ sw $s5, 0x005C($sp) -/* 00390 80882950 AFB30054 */ sw $s3, 0x0054($sp) -/* 00394 80882954 AFB20050 */ sw $s2, 0x0050($sp) -/* 00398 80882958 AFB1004C */ sw $s1, 0x004C($sp) -/* 0039C 8088295C AFB00048 */ sw $s0, 0x0048($sp) -/* 003A0 80882960 3C148088 */ lui $s4, %hi(D_8088361C) ## $s4 = 80880000 -/* 003A4 80882964 4481A000 */ mtc1 $at, $f20 ## $f20 = 10.00 -/* 003A8 80882968 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 003AC 8088296C 00A0B025 */ or $s6, $a1, $zero ## $s6 = 00000000 -/* 003B0 80882970 AFBF0064 */ sw $ra, 0x0064($sp) -/* 003B4 80882974 2694361C */ addiu $s4, $s4, %lo(D_8088361C) ## $s4 = 8088361C -/* 003B8 80882978 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 003BC 8088297C 27B20084 */ addiu $s2, $sp, 0x0084 ## $s2 = FFFFFFF4 -/* 003C0 80882980 27B30078 */ addiu $s3, $sp, 0x0078 ## $s3 = FFFFFFE8 -/* 003C4 80882984 24150002 */ addiu $s5, $zero, 0x0002 ## $s5 = 00000002 -/* 003C8 80882988 E7A6007C */ swc1 $f6, 0x007C($sp) -/* 003CC 8088298C E7A80080 */ swc1 $f8, 0x0080($sp) -/* 003D0 80882990 E7A40078 */ swc1 $f4, 0x0078($sp) -.L80882994: -/* 003D4 80882994 16000008 */ bne $s0, $zero, .L808829B8 -/* 003D8 80882998 00000000 */ nop -/* 003DC 8088299C 0C00CFC8 */ jal Rand_CenteredFloat - -/* 003E0 808829A0 4600A306 */ mov.s $f12, $f20 -/* 003E4 808829A4 46160400 */ add.s $f16, $f0, $f22 -/* 003E8 808829A8 C62A0024 */ lwc1 $f10, 0x0024($s1) ## 00000024 -/* 003EC 808829AC 46105481 */ sub.s $f18, $f10, $f16 -/* 003F0 808829B0 10000006 */ beq $zero, $zero, .L808829CC -/* 003F4 808829B4 E7B20084 */ swc1 $f18, 0x0084($sp) -.L808829B8: -/* 003F8 808829B8 0C00CFC8 */ jal Rand_CenteredFloat - -/* 003FC 808829BC 4600A306 */ mov.s $f12, $f20 -/* 00400 808829C0 C6240024 */ lwc1 $f4, 0x0024($s1) ## 00000024 -/* 00404 808829C4 46040180 */ add.s $f6, $f0, $f4 -/* 00408 808829C8 E7A60084 */ swc1 $f6, 0x0084($sp) -.L808829CC: -/* 0040C 808829CC 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00410 808829D0 00000000 */ nop -/* 00414 808829D4 4600C282 */ mul.s $f10, $f24, $f0 -/* 00418 808829D8 C6280028 */ lwc1 $f8, 0x0028($s1) ## 00000028 -/* 0041C 808829DC 4600B102 */ mul.s $f4, $f22, $f0 -/* 00420 808829E0 460A4400 */ add.s $f16, $f8, $f10 -/* 00424 808829E4 E7B00088 */ swc1 $f16, 0x0088($sp) -/* 00428 808829E8 C632002C */ lwc1 $f18, 0x002C($s1) ## 0000002C -/* 0042C 808829EC 46049180 */ add.s $f6, $f18, $f4 -/* 00430 808829F0 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00434 808829F4 E7A6008C */ swc1 $f6, 0x008C($sp) -/* 00438 808829F8 461A0202 */ mul.s $f8, $f0, $f26 -/* 0043C 808829FC 24180064 */ addiu $t8, $zero, 0x0064 ## $t8 = 00000064 -/* 00440 80882A00 AFB80014 */ sw $t8, 0x0014($sp) -/* 00444 80882A04 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 -/* 00448 80882A08 02402825 */ or $a1, $s2, $zero ## $a1 = FFFFFFF4 -/* 0044C 80882A0C 02603025 */ or $a2, $s3, $zero ## $a2 = FFFFFFE8 -/* 00450 80882A10 02803825 */ or $a3, $s4, $zero ## $a3 = 8088361C -/* 00454 80882A14 461C4280 */ add.s $f10, $f8, $f28 -/* 00458 80882A18 4600540D */ trunc.w.s $f16, $f10 -/* 0045C 80882A1C 440F8000 */ mfc1 $t7, $f16 -/* 00460 80882A20 0C00A1B3 */ jal func_800286CC -/* 00464 80882A24 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00468 80882A28 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 0046C 80882A2C 1615FFD9 */ bne $s0, $s5, .L80882994 -/* 00470 80882A30 00000000 */ nop -/* 00474 80882A34 8FBF0064 */ lw $ra, 0x0064($sp) -/* 00478 80882A38 D7B40020 */ ldc1 $f20, 0x0020($sp) -/* 0047C 80882A3C D7B60028 */ ldc1 $f22, 0x0028($sp) -/* 00480 80882A40 D7B80030 */ ldc1 $f24, 0x0030($sp) -/* 00484 80882A44 D7BA0038 */ ldc1 $f26, 0x0038($sp) -/* 00488 80882A48 D7BC0040 */ ldc1 $f28, 0x0040($sp) -/* 0048C 80882A4C 8FB00048 */ lw $s0, 0x0048($sp) -/* 00490 80882A50 8FB1004C */ lw $s1, 0x004C($sp) -/* 00494 80882A54 8FB20050 */ lw $s2, 0x0050($sp) -/* 00498 80882A58 8FB30054 */ lw $s3, 0x0054($sp) -/* 0049C 80882A5C 8FB40058 */ lw $s4, 0x0058($sp) -/* 004A0 80882A60 8FB5005C */ lw $s5, 0x005C($sp) -/* 004A4 80882A64 8FB60060 */ lw $s6, 0x0060($sp) -/* 004A8 80882A68 03E00008 */ jr $ra -/* 004AC 80882A6C 27BD0090 */ addiu $sp, $sp, 0x0090 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882A70.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882A70.s deleted file mode 100644 index d0d3c49c49..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882A70.s +++ /dev/null @@ -1,110 +0,0 @@ -.late_rodata -glabel D_8088366C - .float 1500.0 - -.text -glabel func_80882A70 -/* 004B0 80882A70 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 004B4 80882A74 AFB00018 */ sw $s0, 0x0018($sp) -/* 004B8 80882A78 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 004BC 80882A7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 004C0 80882A80 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 004C4 80882A84 AFBF001C */ sw $ra, 0x001C($sp) -/* 004C8 80882A88 AFA5002C */ sw $a1, 0x002C($sp) -/* 004CC 80882A8C 00A12021 */ addu $a0, $a1, $at -/* 004D0 80882A90 0C026062 */ jal Object_IsLoaded - -/* 004D4 80882A94 82050168 */ lb $a1, 0x0168($s0) ## 00000168 -/* 004D8 80882A98 1040004B */ beq $v0, $zero, .L80882BC8 -/* 004DC 80882A9C 3C0F8088 */ lui $t7, %hi(func_808835B8) ## $t7 = 80880000 -/* 004E0 80882AA0 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 004E4 80882AA4 820E0168 */ lb $t6, 0x0168($s0) ## 00000168 -/* 004E8 80882AA8 25EF35B8 */ addiu $t7, $t7, %lo(func_808835B8) ## $t7 = 808835B8 -/* 004EC 80882AAC 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 004F0 80882AB0 AE0F0134 */ sw $t7, 0x0134($s0) ## 00000134 -/* 004F4 80882AB4 17010005 */ bne $t8, $at, .L80882ACC -/* 004F8 80882AB8 A20E001E */ sb $t6, 0x001E($s0) ## 0000001E -/* 004FC 80882ABC 3C198088 */ lui $t9, %hi(func_80882BDC) ## $t9 = 80880000 -/* 00500 80882AC0 27392BDC */ addiu $t9, $t9, %lo(func_80882BDC) ## $t9 = 80882BDC -/* 00504 80882AC4 10000040 */ beq $zero, $zero, .L80882BC8 -/* 00508 80882AC8 AE190164 */ sw $t9, 0x0164($s0) ## 00000164 -.L80882ACC: -/* 0050C 80882ACC 8FA4002C */ lw $a0, 0x002C($sp) -/* 00510 80882AD0 0C00B591 */ jal Actor_SetObjectDependency - -/* 00514 80882AD4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00518 80882AD8 AFA00024 */ sw $zero, 0x0024($sp) -/* 0051C 80882ADC 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 00520 80882AE0 3C040600 */ lui $a0, %hi(D_06006F70) ## $a0 = 06000000 -/* 00524 80882AE4 24846F70 */ addiu $a0, $a0, %lo(D_06006F70) ## $a0 = 06006F70 -/* 00528 80882AE8 14400013 */ bne $v0, $zero, .L80882B38 -/* 0052C 80882AEC 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00530 80882AF0 0C010620 */ jal CollisionHeader_GetVirtual - -/* 00534 80882AF4 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFFC -/* 00538 80882AF8 860B01B2 */ lh $t3, 0x01B2($s0) ## 000001B2 -/* 0053C 80882AFC 860D01B6 */ lh $t5, 0x01B6($s0) ## 000001B6 -/* 00540 80882B00 24080050 */ addiu $t0, $zero, 0x0050 ## $t0 = 00000050 -/* 00544 80882B04 24090064 */ addiu $t1, $zero, 0x0064 ## $t1 = 00000064 -/* 00548 80882B08 240AFFE2 */ addiu $t2, $zero, 0xFFE2 ## $t2 = FFFFFFE2 -/* 0054C 80882B0C 256CFFC8 */ addiu $t4, $t3, 0xFFC8 ## $t4 = FFFFFFC8 -/* 00550 80882B10 25AE0038 */ addiu $t6, $t5, 0x0038 ## $t6 = 00000038 -/* 00554 80882B14 A60801AC */ sh $t0, 0x01AC($s0) ## 000001AC -/* 00558 80882B18 A60901AE */ sh $t1, 0x01AE($s0) ## 000001AE -/* 0055C 80882B1C A60A01B0 */ sh $t2, 0x01B0($s0) ## 000001B0 -/* 00560 80882B20 A60C01B2 */ sh $t4, 0x01B2($s0) ## 000001B2 -/* 00564 80882B24 A60E01B6 */ sh $t6, 0x01B6($s0) ## 000001B6 -/* 00568 80882B28 3C018088 */ lui $at, %hi(D_8088366C) ## $at = 80880000 -/* 0056C 80882B2C C424366C */ lwc1 $f4, %lo(D_8088366C)($at) -/* 00570 80882B30 10000011 */ beq $zero, $zero, .L80882B78 -/* 00574 80882B34 E60400F8 */ swc1 $f4, 0x00F8($s0) ## 000000F8 -.L80882B38: -/* 00578 80882B38 14410008 */ bne $v0, $at, .L80882B5C -/* 0057C 80882B3C 3C040600 */ lui $a0, 0x0600 ## $a0 = 06000000 -/* 00580 80882B40 3C040600 */ lui $a0, %hi(D_06005E30) ## $a0 = 06000000 -/* 00584 80882B44 24845E30 */ addiu $a0, $a0, %lo(D_06005E30) ## $a0 = 06005E30 -/* 00588 80882B48 0C010620 */ jal CollisionHeader_GetVirtual - -/* 0058C 80882B4C 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFFC -/* 00590 80882B50 240FFFCE */ addiu $t7, $zero, 0xFFCE ## $t7 = FFFFFFCE -/* 00594 80882B54 10000008 */ beq $zero, $zero, .L80882B78 -/* 00598 80882B58 A60F01B0 */ sh $t7, 0x01B0($s0) ## 000001B0 -.L80882B5C: -/* 0059C 80882B5C 24840C2C */ addiu $a0, $a0, 0x0C2C ## $a0 = 00000C2C -/* 005A0 80882B60 0C010620 */ jal CollisionHeader_GetVirtual - -/* 005A4 80882B64 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFFC -/* 005A8 80882B68 24180037 */ addiu $t8, $zero, 0x0037 ## $t8 = 00000037 -/* 005AC 80882B6C 24190014 */ addiu $t9, $zero, 0x0014 ## $t9 = 00000014 -/* 005B0 80882B70 A61801AC */ sh $t8, 0x01AC($s0) ## 000001AC -/* 005B4 80882B74 A61901AE */ sh $t9, 0x01AE($s0) ## 000001AE -.L80882B78: -/* 005B8 80882B78 8FA4002C */ lw $a0, 0x002C($sp) -/* 005BC 80882B7C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 005C0 80882B80 8FA70024 */ lw $a3, 0x0024($sp) -/* 005C4 80882B84 0C00FA9D */ jal DynaPoly_SetBgActor - ## DynaPoly_SetBgActor -/* 005C8 80882B88 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 005CC 80882B8C 8608001C */ lh $t0, 0x001C($s0) ## 0000001C -/* 005D0 80882B90 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 005D4 80882B94 8FA4002C */ lw $a0, 0x002C($sp) -/* 005D8 80882B98 15000008 */ bne $t0, $zero, .L80882BBC -/* 005DC 80882B9C 00000000 */ nop -/* 005E0 80882BA0 0C00B2D0 */ jal Flags_GetSwitch - -/* 005E4 80882BA4 92050169 */ lbu $a1, 0x0169($s0) ## 00000169 -/* 005E8 80882BA8 10400004 */ beq $v0, $zero, .L80882BBC -/* 005EC 80882BAC 3C098088 */ lui $t1, %hi(func_80883568) ## $t1 = 80880000 -/* 005F0 80882BB0 25293568 */ addiu $t1, $t1, %lo(func_80883568) ## $t1 = 80883568 -/* 005F4 80882BB4 10000004 */ beq $zero, $zero, .L80882BC8 -/* 005F8 80882BB8 AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -.L80882BBC: -/* 005FC 80882BBC 3C0A8088 */ lui $t2, %hi(func_80883000) ## $t2 = 80880000 -/* 00600 80882BC0 254A3000 */ addiu $t2, $t2, %lo(func_80883000) ## $t2 = 80883000 -/* 00604 80882BC4 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164 -.L80882BC8: -/* 00608 80882BC8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0060C 80882BCC 8FB00018 */ lw $s0, 0x0018($sp) -/* 00610 80882BD0 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00614 80882BD4 03E00008 */ jr $ra -/* 00618 80882BD8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882BDC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882BDC.s deleted file mode 100644 index 31886d8e20..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882BDC.s +++ /dev/null @@ -1,71 +0,0 @@ -.late_rodata -glabel D_80883670 - .float -0.6 - -.text -glabel func_80882BDC -/* 0061C 80882BDC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00620 80882BE0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00624 80882BE4 AFA5001C */ sw $a1, 0x001C($sp) -/* 00628 80882BE8 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 0062C 80882BEC 3C01C100 */ lui $at, 0xC100 ## $at = C1000000 -/* 00630 80882BF0 10400002 */ beq $v0, $zero, .L80882BFC -/* 00634 80882BF4 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00638 80882BF8 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -.L80882BFC: -/* 0063C 80882BFC 848F00B4 */ lh $t7, 0x00B4($a0) ## 000000B4 -/* 00640 80882C00 84980030 */ lh $t8, 0x0030($a0) ## 00000030 -/* 00644 80882C04 848800B8 */ lh $t0, 0x00B8($a0) ## 000000B8 -/* 00648 80882C08 84890034 */ lh $t1, 0x0034($a0) ## 00000034 -/* 0064C 80882C0C 948B0088 */ lhu $t3, 0x0088($a0) ## 00000088 -/* 00650 80882C10 01F8C821 */ addu $t9, $t7, $t8 -/* 00654 80882C14 01095021 */ addu $t2, $t0, $t1 -/* 00658 80882C18 316C0002 */ andi $t4, $t3, 0x0002 ## $t4 = 00000000 -/* 0065C 80882C1C A49900B4 */ sh $t9, 0x00B4($a0) ## 000000B4 -/* 00660 80882C20 1180001F */ beq $t4, $zero, .L80882CA0 -/* 00664 80882C24 A48A00B8 */ sh $t2, 0x00B8($a0) ## 000000B8 -/* 00668 80882C28 C4800060 */ lwc1 $f0, 0x0060($a0) ## 00000060 -/* 0066C 80882C2C 44812000 */ mtc1 $at, $f4 ## $f4 = -8.00 -/* 00670 80882C30 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00674 80882C34 4604003C */ c.lt.s $f0, $f4 -/* 00678 80882C38 00000000 */ nop -/* 0067C 80882C3C 45000015 */ bc1f .L80882C94 -/* 00680 80882C40 00000000 */ nop -/* 00684 80882C44 44811000 */ mtc1 $at, $f2 ## $f2 = 10.00 -/* 00688 80882C48 3C018088 */ lui $at, %hi(D_80883670) ## $at = 80880000 -/* 0068C 80882C4C C4263670 */ lwc1 $f6, %lo(D_80883670)($at) -/* 00690 80882C50 46060202 */ mul.s $f8, $f0, $f6 -/* 00694 80882C54 E4880060 */ swc1 $f8, 0x0060($a0) ## 00000060 -/* 00698 80882C58 C4800060 */ lwc1 $f0, 0x0060($a0) ## 00000060 -/* 0069C 80882C5C 4600103C */ c.lt.s $f2, $f0 -/* 006A0 80882C60 00000000 */ nop -/* 006A4 80882C64 45020004 */ bc1fl .L80882C78 -/* 006A8 80882C68 E4800060 */ swc1 $f0, 0x0060($a0) ## 00000060 -/* 006AC 80882C6C 10000002 */ beq $zero, $zero, .L80882C78 -/* 006B0 80882C70 E4820060 */ swc1 $f2, 0x0060($a0) ## 00000060 -/* 006B4 80882C74 E4800060 */ swc1 $f0, 0x0060($a0) ## 00000060 -.L80882C78: -/* 006B8 80882C78 948D0088 */ lhu $t5, 0x0088($a0) ## 00000088 -/* 006BC 80882C7C 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 006C0 80882C80 44815000 */ mtc1 $at, $f10 ## $f10 = 2.00 -/* 006C4 80882C84 31AEFFFC */ andi $t6, $t5, 0xFFFC ## $t6 = 00000000 -/* 006C8 80882C88 A48E0088 */ sh $t6, 0x0088($a0) ## 00000088 -/* 006CC 80882C8C 10000004 */ beq $zero, $zero, .L80882CA0 -/* 006D0 80882C90 E48A0068 */ swc1 $f10, 0x0068($a0) ## 00000068 -.L80882C94: -/* 006D4 80882C94 0C00B55C */ jal Actor_Kill - -/* 006D8 80882C98 AFA40018 */ sw $a0, 0x0018($sp) -/* 006DC 80882C9C 8FA40018 */ lw $a0, 0x0018($sp) -.L80882CA0: -/* 006E0 80882CA0 848F016A */ lh $t7, 0x016A($a0) ## 0000016A -/* 006E4 80882CA4 55E00004 */ bnel $t7, $zero, .L80882CB8 -/* 006E8 80882CA8 8FBF0014 */ lw $ra, 0x0014($sp) -/* 006EC 80882CAC 0C00B55C */ jal Actor_Kill - -/* 006F0 80882CB0 00000000 */ nop -/* 006F4 80882CB4 8FBF0014 */ lw $ra, 0x0014($sp) -.L80882CB8: -/* 006F8 80882CB8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 006FC 80882CBC 03E00008 */ jr $ra -/* 00700 80882CC0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882CC4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882CC4.s deleted file mode 100644 index 20d50f8905..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882CC4.s +++ /dev/null @@ -1,106 +0,0 @@ -glabel func_80882CC4 -/* 00704 80882CC4 27BDFF60 */ addiu $sp, $sp, 0xFF60 ## $sp = FFFFFF60 -/* 00708 80882CC8 AFB1004C */ sw $s1, 0x004C($sp) -/* 0070C 80882CCC 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 00710 80882CD0 AFBF006C */ sw $ra, 0x006C($sp) -/* 00714 80882CD4 AFBE0068 */ sw $s8, 0x0068($sp) -/* 00718 80882CD8 AFB70064 */ sw $s7, 0x0064($sp) -/* 0071C 80882CDC AFB60060 */ sw $s6, 0x0060($sp) -/* 00720 80882CE0 AFB5005C */ sw $s5, 0x005C($sp) -/* 00724 80882CE4 AFB40058 */ sw $s4, 0x0058($sp) -/* 00728 80882CE8 AFB30054 */ sw $s3, 0x0054($sp) -/* 0072C 80882CEC AFB20050 */ sw $s2, 0x0050($sp) -/* 00730 80882CF0 AFB00048 */ sw $s0, 0x0048($sp) -/* 00734 80882CF4 F7B80040 */ sdc1 $f24, 0x0040($sp) -/* 00738 80882CF8 F7B60038 */ sdc1 $f22, 0x0038($sp) -/* 0073C 80882CFC F7B40030 */ sdc1 $f20, 0x0030($sp) -/* 00740 80882D00 848400B6 */ lh $a0, 0x00B6($a0) ## 000000B6 -/* 00744 80882D04 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 00748 80882D08 2484C000 */ addiu $a0, $a0, 0xC000 ## $a0 = FFFFC000 -/* 0074C 80882D0C 00042400 */ sll $a0, $a0, 16 -/* 00750 80882D10 0C01DE1C */ jal Math_SinS - ## sins? -/* 00754 80882D14 00042403 */ sra $a0, $a0, 16 -/* 00758 80882D18 862400B6 */ lh $a0, 0x00B6($s1) ## 000000B6 -/* 0075C 80882D1C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 00760 80882D20 4481A000 */ mtc1 $at, $f20 ## $f20 = 40.00 -/* 00764 80882D24 2484C000 */ addiu $a0, $a0, 0xC000 ## $a0 = FFFFC000 -/* 00768 80882D28 00042400 */ sll $a0, $a0, 16 -/* 0076C 80882D2C 46140582 */ mul.s $f22, $f0, $f20 -/* 00770 80882D30 0C01DE0D */ jal Math_CosS - ## coss? -/* 00774 80882D34 00042403 */ sra $a0, $a0, 16 -/* 00778 80882D38 3C138088 */ lui $s3, %hi(D_8088361C) ## $s3 = 80880000 -/* 0077C 80882D3C 46140602 */ mul.s $f24, $f0, $f20 -/* 00780 80882D40 2673361C */ addiu $s3, $s3, %lo(D_8088361C) ## $s3 = 8088361C -/* 00784 80882D44 2417FFC9 */ addiu $s7, $zero, 0xFFC9 ## $s7 = FFFFFFC9 -/* 00788 80882D48 26541C24 */ addiu $s4, $s2, 0x1C24 ## $s4 = 00001C24 -/* 0078C 80882D4C 241E006E */ addiu $s8, $zero, 0x006E ## $s8 = 0000006E -/* 00790 80882D50 24160003 */ addiu $s6, $zero, 0x0003 ## $s6 = 00000003 -/* 00794 80882D54 27B5008C */ addiu $s5, $sp, 0x008C ## $s5 = FFFFFFEC -/* 00798 80882D58 44972000 */ mtc1 $s7, $f4 ## $f4 = NaN -.L80882D5C: -/* 0079C 80882D5C 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 007A0 80882D60 46802520 */ cvt.s.w $f20, $f4 -/* 007A4 80882D64 260EFFFF */ addiu $t6, $s0, 0xFFFF ## $t6 = FFFFFFFF -.L80882D68: -/* 007A8 80882D68 448E3000 */ mtc1 $t6, $f6 ## $f6 = NaN -/* 007AC 80882D6C C6280024 */ lwc1 $f8, 0x0024($s1) ## 00000024 -/* 007B0 80882D70 02802025 */ or $a0, $s4, $zero ## $a0 = 00001C24 -/* 007B4 80882D74 46803020 */ cvt.s.w $f0, $f6 -/* 007B8 80882D78 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 -/* 007BC 80882D7C 240600BE */ addiu $a2, $zero, 0x00BE ## $a2 = 000000BE -/* 007C0 80882D80 46160282 */ mul.s $f10, $f0, $f22 -/* 007C4 80882D84 460A4400 */ add.s $f16, $f8, $f10 -/* 007C8 80882D88 46180102 */ mul.s $f4, $f0, $f24 -/* 007CC 80882D8C E7B0008C */ swc1 $f16, 0x008C($sp) -/* 007D0 80882D90 C632002C */ lwc1 $f18, 0x002C($s1) ## 0000002C -/* 007D4 80882D94 8FA7008C */ lw $a3, 0x008C($sp) -/* 007D8 80882D98 46049180 */ add.s $f6, $f18, $f4 -/* 007DC 80882D9C E7A60094 */ swc1 $f6, 0x0094($sp) -/* 007E0 80882DA0 C6280028 */ lwc1 $f8, 0x0028($s1) ## 00000028 -/* 007E4 80882DA4 C7B20094 */ lwc1 $f18, 0x0094($sp) -/* 007E8 80882DA8 AFA00018 */ sw $zero, 0x0018($sp) -/* 007EC 80882DAC 46144280 */ add.s $f10, $f8, $f20 -/* 007F0 80882DB0 E7B20014 */ swc1 $f18, 0x0014($sp) -/* 007F4 80882DB4 E7AA0090 */ swc1 $f10, 0x0090($sp) -/* 007F8 80882DB8 C7B00090 */ lwc1 $f16, 0x0090($sp) -/* 007FC 80882DBC E7B00010 */ swc1 $f16, 0x0010($sp) -/* 00800 80882DC0 862F00B6 */ lh $t7, 0x00B6($s1) ## 000000B6 -/* 00804 80882DC4 AFA00020 */ sw $zero, 0x0020($sp) -/* 00808 80882DC8 AFAF001C */ sw $t7, 0x001C($sp) -/* 0080C 80882DCC 8638001C */ lh $t8, 0x001C($s1) ## 0000001C -/* 00810 80882DD0 27190002 */ addiu $t9, $t8, 0x0002 ## $t9 = 00000002 -/* 00814 80882DD4 0C00C7D4 */ jal Actor_Spawn - ## ActorSpawn -/* 00818 80882DD8 AFB90024 */ sw $t9, 0x0024($sp) -/* 0081C 80882DDC 240803E8 */ addiu $t0, $zero, 0x03E8 ## $t0 = 000003E8 -/* 00820 80882DE0 24090032 */ addiu $t1, $zero, 0x0032 ## $t1 = 00000032 -/* 00824 80882DE4 AFA90014 */ sw $t1, 0x0014($sp) -/* 00828 80882DE8 AFA80010 */ sw $t0, 0x0010($sp) -/* 0082C 80882DEC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00830 80882DF0 02A02825 */ or $a1, $s5, $zero ## $a1 = FFFFFFEC -/* 00834 80882DF4 02603025 */ or $a2, $s3, $zero ## $a2 = 8088361C -/* 00838 80882DF8 0C00A1B3 */ jal func_800286CC -/* 0083C 80882DFC 02603825 */ or $a3, $s3, $zero ## $a3 = 8088361C -/* 00840 80882E00 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 00844 80882E04 5616FFD8 */ bnel $s0, $s6, .L80882D68 -/* 00848 80882E08 260EFFFF */ addiu $t6, $s0, 0xFFFF ## $t6 = 00000000 -/* 0084C 80882E0C 26F70037 */ addiu $s7, $s7, 0x0037 ## $s7 = 00000000 -/* 00850 80882E10 56FEFFD2 */ bnel $s7, $s8, .L80882D5C -/* 00854 80882E14 44972000 */ mtc1 $s7, $f4 ## $f4 = 0.00 -/* 00858 80882E18 8FBF006C */ lw $ra, 0x006C($sp) -/* 0085C 80882E1C D7B40030 */ ldc1 $f20, 0x0030($sp) -/* 00860 80882E20 D7B60038 */ ldc1 $f22, 0x0038($sp) -/* 00864 80882E24 D7B80040 */ ldc1 $f24, 0x0040($sp) -/* 00868 80882E28 8FB00048 */ lw $s0, 0x0048($sp) -/* 0086C 80882E2C 8FB1004C */ lw $s1, 0x004C($sp) -/* 00870 80882E30 8FB20050 */ lw $s2, 0x0050($sp) -/* 00874 80882E34 8FB30054 */ lw $s3, 0x0054($sp) -/* 00878 80882E38 8FB40058 */ lw $s4, 0x0058($sp) -/* 0087C 80882E3C 8FB5005C */ lw $s5, 0x005C($sp) -/* 00880 80882E40 8FB60060 */ lw $s6, 0x0060($sp) -/* 00884 80882E44 8FB70064 */ lw $s7, 0x0064($sp) -/* 00888 80882E48 8FBE0068 */ lw $s8, 0x0068($sp) -/* 0088C 80882E4C 03E00008 */ jr $ra -/* 00890 80882E50 27BD00A0 */ addiu $sp, $sp, 0x00A0 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882E54.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882E54.s deleted file mode 100644 index bd4a043195..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882E54.s +++ /dev/null @@ -1,110 +0,0 @@ -glabel func_80882E54 -/* 00894 80882E54 27BDFF80 */ addiu $sp, $sp, 0xFF80 ## $sp = FFFFFF80 -/* 00898 80882E58 AFBF005C */ sw $ra, 0x005C($sp) -/* 0089C 80882E5C AFBE0058 */ sw $s8, 0x0058($sp) -/* 008A0 80882E60 AFB70054 */ sw $s7, 0x0054($sp) -/* 008A4 80882E64 AFB60050 */ sw $s6, 0x0050($sp) -/* 008A8 80882E68 AFB5004C */ sw $s5, 0x004C($sp) -/* 008AC 80882E6C AFB40048 */ sw $s4, 0x0048($sp) -/* 008B0 80882E70 AFB30044 */ sw $s3, 0x0044($sp) -/* 008B4 80882E74 AFB20040 */ sw $s2, 0x0040($sp) -/* 008B8 80882E78 AFB1003C */ sw $s1, 0x003C($sp) -/* 008BC 80882E7C AFB00038 */ sw $s0, 0x0038($sp) -/* 008C0 80882E80 F7B40030 */ sdc1 $f20, 0x0030($sp) -/* 008C4 80882E84 848E01B2 */ lh $t6, 0x01B2($a0) ## 000001B2 -/* 008C8 80882E88 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 008CC 80882E8C 4481A000 */ mtc1 $at, $f20 ## $f20 = 10.00 -/* 008D0 80882E90 448E2000 */ mtc1 $t6, $f4 ## $f4 = 0.00 -/* 008D4 80882E94 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 008D8 80882E98 3C160600 */ lui $s6, %hi(D_06000A10) ## $s6 = 06000000 -/* 008DC 80882E9C 468021A0 */ cvt.s.w $f6, $f4 -/* 008E0 80882EA0 26D60A10 */ addiu $s6, $s6, %lo(D_06000A10) ## $s6 = 06000A10 -/* 008E4 80882EA4 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 008E8 80882EA8 27B30074 */ addiu $s3, $sp, 0x0074 ## $s3 = FFFFFFF4 -/* 008EC 80882EAC 2419000A */ addiu $t9, $zero, 0x000A ## $t9 = 0000000A -/* 008F0 80882EB0 2408000A */ addiu $t0, $zero, 0x000A ## $t0 = 0000000A -/* 008F4 80882EB4 E7A60074 */ swc1 $f6, 0x0074($sp) -/* 008F8 80882EB8 848F01B4 */ lh $t7, 0x01B4($a0) ## 000001B4 -/* 008FC 80882EBC 24090004 */ addiu $t1, $zero, 0x0004 ## $t1 = 00000004 -/* 00900 80882EC0 240A008D */ addiu $t2, $zero, 0x008D ## $t2 = 0000008D -/* 00904 80882EC4 448F4000 */ mtc1 $t7, $f8 ## $f8 = 0.00 -/* 00908 80882EC8 240B0028 */ addiu $t3, $zero, 0x0028 ## $t3 = 00000028 -/* 0090C 80882ECC 4406A000 */ mfc1 $a2, $f20 -/* 00910 80882ED0 468042A0 */ cvt.s.w $f10, $f8 -/* 00914 80882ED4 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00918 80882ED8 E7AA0078 */ swc1 $f10, 0x0078($sp) -/* 0091C 80882EDC 849801B6 */ lh $t8, 0x01B6($a0) ## 000001B6 -/* 00920 80882EE0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00924 80882EE4 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFF4 -/* 00928 80882EE8 44988000 */ mtc1 $t8, $f16 ## $f16 = 0.00 -/* 0092C 80882EEC AFB60024 */ sw $s6, 0x0024($sp) -/* 00930 80882EF0 AFAB0020 */ sw $t3, 0x0020($sp) -/* 00934 80882EF4 468084A0 */ cvt.s.w $f18, $f16 -/* 00938 80882EF8 AFAA001C */ sw $t2, 0x001C($sp) -/* 0093C 80882EFC AFA90018 */ sw $t1, 0x0018($sp) -/* 00940 80882F00 AFA80014 */ sw $t0, 0x0014($sp) -/* 00944 80882F04 AFB90010 */ sw $t9, 0x0010($sp) -/* 00948 80882F08 0C00A5E9 */ jal EffectSsHahen_SpawnBurst -/* 0094C 80882F0C E7B2007C */ swc1 $f18, 0x007C($sp) -/* 00950 80882F10 3C148088 */ lui $s4, %hi(D_8088361C) ## $s4 = 80880000 -/* 00954 80882F14 2694361C */ addiu $s4, $s4, %lo(D_8088361C) ## $s4 = 8088361C -/* 00958 80882F18 2415FFE7 */ addiu $s5, $zero, 0xFFE7 ## $s5 = FFFFFFE7 -/* 0095C 80882F1C 241E004B */ addiu $s8, $zero, 0x004B ## $s8 = 0000004B -/* 00960 80882F20 2417004B */ addiu $s7, $zero, 0x004B ## $s7 = 0000004B -/* 00964 80882F24 2410FFE7 */ addiu $s0, $zero, 0xFFE7 ## $s0 = FFFFFFE7 -.L80882F28: -/* 00968 80882F28 862C01B2 */ lh $t4, 0x01B2($s1) ## 000001B2 -.L80882F2C: -/* 0096C 80882F2C 4406A000 */ mfc1 $a2, $f20 -/* 00970 80882F30 2418000A */ addiu $t8, $zero, 0x000A ## $t8 = 0000000A -/* 00974 80882F34 01906821 */ addu $t5, $t4, $s0 -/* 00978 80882F38 448D2000 */ mtc1 $t5, $f4 ## $f4 = 0.00 -/* 0097C 80882F3C 2419000A */ addiu $t9, $zero, 0x000A ## $t9 = 0000000A -/* 00980 80882F40 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 -/* 00984 80882F44 468021A0 */ cvt.s.w $f6, $f4 -/* 00988 80882F48 2409008D */ addiu $t1, $zero, 0x008D ## $t1 = 0000008D -/* 0098C 80882F4C 240A0028 */ addiu $t2, $zero, 0x0028 ## $t2 = 00000028 -/* 00990 80882F50 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00994 80882F54 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFF4 -/* 00998 80882F58 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 0099C 80882F5C E7A60074 */ swc1 $f6, 0x0074($sp) -/* 009A0 80882F60 862E01B6 */ lh $t6, 0x01B6($s1) ## 000001B6 -/* 009A4 80882F64 AFB60024 */ sw $s6, 0x0024($sp) -/* 009A8 80882F68 AFAA0020 */ sw $t2, 0x0020($sp) -/* 009AC 80882F6C 01D57821 */ addu $t7, $t6, $s5 -/* 009B0 80882F70 448F4000 */ mtc1 $t7, $f8 ## $f8 = 0.00 -/* 009B4 80882F74 AFA9001C */ sw $t1, 0x001C($sp) -/* 009B8 80882F78 AFA80018 */ sw $t0, 0x0018($sp) -/* 009BC 80882F7C 468042A0 */ cvt.s.w $f10, $f8 -/* 009C0 80882F80 AFB90014 */ sw $t9, 0x0014($sp) -/* 009C4 80882F84 AFB80010 */ sw $t8, 0x0010($sp) -/* 009C8 80882F88 0C00A5E9 */ jal EffectSsHahen_SpawnBurst -/* 009CC 80882F8C E7AA007C */ swc1 $f10, 0x007C($sp) -/* 009D0 80882F90 240B03E8 */ addiu $t3, $zero, 0x03E8 ## $t3 = 000003E8 -/* 009D4 80882F94 240C0032 */ addiu $t4, $zero, 0x0032 ## $t4 = 00000032 -/* 009D8 80882F98 AFAC0014 */ sw $t4, 0x0014($sp) -/* 009DC 80882F9C AFAB0010 */ sw $t3, 0x0010($sp) -/* 009E0 80882FA0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 009E4 80882FA4 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFF4 -/* 009E8 80882FA8 02803025 */ or $a2, $s4, $zero ## $a2 = 8088361C -/* 009EC 80882FAC 0C00A1B3 */ jal func_800286CC -/* 009F0 80882FB0 02803825 */ or $a3, $s4, $zero ## $a3 = 8088361C -/* 009F4 80882FB4 26100032 */ addiu $s0, $s0, 0x0032 ## $s0 = 00000019 -/* 009F8 80882FB8 5617FFDC */ bnel $s0, $s7, .L80882F2C -/* 009FC 80882FBC 862C01B2 */ lh $t4, 0x01B2($s1) ## 000001B2 -/* 00A00 80882FC0 26B50032 */ addiu $s5, $s5, 0x0032 ## $s5 = 00000019 -/* 00A04 80882FC4 56BEFFD8 */ bnel $s5, $s8, .L80882F28 -/* 00A08 80882FC8 2410FFE7 */ addiu $s0, $zero, 0xFFE7 ## $s0 = FFFFFFE7 -/* 00A0C 80882FCC 8FBF005C */ lw $ra, 0x005C($sp) -/* 00A10 80882FD0 D7B40030 */ ldc1 $f20, 0x0030($sp) -/* 00A14 80882FD4 8FB00038 */ lw $s0, 0x0038($sp) -/* 00A18 80882FD8 8FB1003C */ lw $s1, 0x003C($sp) -/* 00A1C 80882FDC 8FB20040 */ lw $s2, 0x0040($sp) -/* 00A20 80882FE0 8FB30044 */ lw $s3, 0x0044($sp) -/* 00A24 80882FE4 8FB40048 */ lw $s4, 0x0048($sp) -/* 00A28 80882FE8 8FB5004C */ lw $s5, 0x004C($sp) -/* 00A2C 80882FEC 8FB60050 */ lw $s6, 0x0050($sp) -/* 00A30 80882FF0 8FB70054 */ lw $s7, 0x0054($sp) -/* 00A34 80882FF4 8FBE0058 */ lw $s8, 0x0058($sp) -/* 00A38 80882FF8 03E00008 */ jr $ra -/* 00A3C 80882FFC 27BD0080 */ addiu $sp, $sp, 0x0080 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883000.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883000.s deleted file mode 100644 index b34a4bf3f1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883000.s +++ /dev/null @@ -1,75 +0,0 @@ -glabel func_80883000 -/* 00A40 80883000 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00A44 80883004 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00A48 80883008 AFB10020 */ sw $s1, 0x0020($sp) -/* 00A4C 8088300C AFB0001C */ sw $s0, 0x001C($sp) -/* 00A50 80883010 908E017D */ lbu $t6, 0x017D($a0) ## 0000017D -/* 00A54 80883014 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00A58 80883018 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 00A5C 8088301C 31CF0002 */ andi $t7, $t6, 0x0002 ## $t7 = 00000000 -/* 00A60 80883020 11E0002E */ beq $t7, $zero, .L808830DC -/* 00A64 80883024 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00A68 80883028 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00A6C 8088302C 0C00B2DD */ jal Flags_SetSwitch - -/* 00A70 80883030 92050169 */ lbu $a1, 0x0169($s0) ## 00000169 -/* 00A74 80883034 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 00A78 80883038 24180014 */ addiu $t8, $zero, 0x0014 ## $t8 = 00000014 -/* 00A7C 8088303C 3C198088 */ lui $t9, %hi(func_80883144) ## $t9 = 80880000 -/* 00A80 80883040 1440000C */ bne $v0, $zero, .L80883074 -/* 00A84 80883044 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00A88 80883048 27393144 */ addiu $t9, $t9, %lo(func_80883144) ## $t9 = 80883144 -/* 00A8C 8088304C A618016A */ sh $t8, 0x016A($s0) ## 0000016A -/* 00A90 80883050 AE190164 */ sw $t9, 0x0164($s0) ## 00000164 -/* 00A94 80883054 AFA00010 */ sw $zero, 0x0010($sp) -/* 00A98 80883058 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00A9C 8088305C 24050D48 */ addiu $a1, $zero, 0x0D48 ## $a1 = 00000D48 -/* 00AA0 80883060 240603E7 */ addiu $a2, $zero, 0x03E7 ## $a2 = 000003E7 -/* 00AA4 80883064 0C02003E */ jal func_800800F8 -/* 00AA8 80883068 02003825 */ or $a3, $s0, $zero ## $a3 = 00000000 -/* 00AAC 8088306C 10000021 */ beq $zero, $zero, .L808830F4 -/* 00AB0 80883070 8FBF0024 */ lw $ra, 0x0024($sp) -.L80883074: -/* 00AB4 80883074 1441000E */ bne $v0, $at, .L808830B0 -/* 00AB8 80883078 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00ABC 8088307C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00AC0 80883080 0C220B95 */ jal func_80882E54 -/* 00AC4 80883084 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00AC8 80883088 24080001 */ addiu $t0, $zero, 0x0001 ## $t0 = 00000001 -/* 00ACC 8088308C AE000134 */ sw $zero, 0x0134($s0) ## 00000134 -/* 00AD0 80883090 A608016A */ sh $t0, 0x016A($s0) ## 0000016A -/* 00AD4 80883094 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00AD8 80883098 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00ADC 8088309C 24052802 */ addiu $a1, $zero, 0x2802 ## $a1 = 00002802 -/* 00AE0 808830A0 3C098088 */ lui $t1, %hi(func_80883104) ## $t1 = 80880000 -/* 00AE4 808830A4 25293104 */ addiu $t1, $t1, %lo(func_80883104) ## $t1 = 80883104 -/* 00AE8 808830A8 10000011 */ beq $zero, $zero, .L808830F0 -/* 00AEC 808830AC AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -.L808830B0: -/* 00AF0 808830B0 0C220B31 */ jal func_80882CC4 -/* 00AF4 808830B4 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00AF8 808830B8 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00AFC 808830BC A60A016A */ sh $t2, 0x016A($s0) ## 0000016A -/* 00B00 808830C0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00B04 808830C4 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00B08 808830C8 24052810 */ addiu $a1, $zero, 0x2810 ## $a1 = 00002810 -/* 00B0C 808830CC 3C0B8088 */ lui $t3, %hi(func_80883104) ## $t3 = 80880000 -/* 00B10 808830D0 256B3104 */ addiu $t3, $t3, %lo(func_80883104) ## $t3 = 80883104 -/* 00B14 808830D4 10000006 */ beq $zero, $zero, .L808830F0 -/* 00B18 808830D8 AE0B0164 */ sw $t3, 0x0164($s0) ## 00000164 -.L808830DC: -/* 00B1C 808830DC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00B20 808830E0 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00B24 808830E4 02212821 */ addu $a1, $s1, $at -/* 00B28 808830E8 0C01767D */ jal CollisionCheck_SetAC - ## CollisionCheck_setAC -/* 00B2C 808830EC 2606016C */ addiu $a2, $s0, 0x016C ## $a2 = 0000016C -.L808830F0: -/* 00B30 808830F0 8FBF0024 */ lw $ra, 0x0024($sp) -.L808830F4: -/* 00B34 808830F4 8FB0001C */ lw $s0, 0x001C($sp) -/* 00B38 808830F8 8FB10020 */ lw $s1, 0x0020($sp) -/* 00B3C 808830FC 03E00008 */ jr $ra -/* 00B40 80883100 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883104.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883104.s deleted file mode 100644 index 5c3c6baa55..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883104.s +++ /dev/null @@ -1,20 +0,0 @@ -glabel func_80883104 -/* 00B44 80883104 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00B48 80883108 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00B4C 8088310C AFA5001C */ sw $a1, 0x001C($sp) -/* 00B50 80883110 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 00B54 80883114 10400003 */ beq $v0, $zero, .L80883124 -/* 00B58 80883118 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00B5C 8088311C A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -/* 00B60 80883120 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -.L80883124: -/* 00B64 80883124 54400004 */ bnel $v0, $zero, .L80883138 -/* 00B68 80883128 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00B6C 8088312C 0C00B55C */ jal Actor_Kill - -/* 00B70 80883130 00000000 */ nop -/* 00B74 80883134 8FBF0014 */ lw $ra, 0x0014($sp) -.L80883138: -/* 00B78 80883138 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00B7C 8088313C 03E00008 */ jr $ra -/* 00B80 80883140 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883144.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883144.s deleted file mode 100644 index cd6566c4c5..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883144.s +++ /dev/null @@ -1,77 +0,0 @@ -glabel func_80883144 -/* 00B84 80883144 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00B88 80883148 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00B8C 8088314C AFB00020 */ sw $s0, 0x0020($sp) -/* 00B90 80883150 AFA5003C */ sw $a1, 0x003C($sp) -/* 00B94 80883154 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 00B98 80883158 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00B9C 8088315C 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 00BA0 80883160 10400003 */ beq $v0, $zero, .L80883170 -/* 00BA4 80883164 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00BA8 80883168 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -/* 00BAC 8088316C 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -.L80883170: -/* 00BB0 80883170 04410004 */ bgez $v0, .L80883184 -/* 00BB4 80883174 304F0003 */ andi $t7, $v0, 0x0003 ## $t7 = 00000000 -/* 00BB8 80883178 11E00002 */ beq $t7, $zero, .L80883184 -/* 00BBC 8088317C 00000000 */ nop -/* 00BC0 80883180 25EFFFFC */ addiu $t7, $t7, 0xFFFC ## $t7 = FFFFFFFC -.L80883184: -/* 00BC4 80883184 15E00028 */ bne $t7, $zero, .L80883228 -/* 00BC8 80883188 00000000 */ nop -/* 00BCC 8088318C 44816000 */ mtc1 $at, $f12 ## $f12 = 200.00 -/* 00BD0 80883190 0C00CFC8 */ jal Rand_CenteredFloat - -/* 00BD4 80883194 00000000 */ nop -/* 00BD8 80883198 3C014260 */ lui $at, 0x4260 ## $at = 42600000 -/* 00BDC 8088319C 44813000 */ mtc1 $at, $f6 ## $f6 = 56.00 -/* 00BE0 808831A0 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 00BE4 808831A4 46062201 */ sub.s $f8, $f4, $f6 -/* 00BE8 808831A8 46080280 */ add.s $f10, $f0, $f8 -/* 00BEC 808831AC 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00BF0 808831B0 E7AA002C */ swc1 $f10, 0x002C($sp) -/* 00BF4 808831B4 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 -/* 00BF8 808831B8 44818000 */ mtc1 $at, $f16 ## $f16 = 80.00 -/* 00BFC 808831BC C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -/* 00C00 808831C0 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 00C04 808831C4 46100482 */ mul.s $f18, $f0, $f16 -/* 00C08 808831C8 44816000 */ mtc1 $at, $f12 ## $f12 = 200.00 -/* 00C0C 808831CC 46049180 */ add.s $f6, $f18, $f4 -/* 00C10 808831D0 0C00CFC8 */ jal Rand_CenteredFloat - -/* 00C14 808831D4 E7A60030 */ swc1 $f6, 0x0030($sp) -/* 00C18 808831D8 3C014260 */ lui $at, 0x4260 ## $at = 42600000 -/* 00C1C 808831DC 44815000 */ mtc1 $at, $f10 ## $f10 = 56.00 -/* 00C20 808831E0 C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00C24 808831E4 3C068088 */ lui $a2, %hi(D_8088361C) ## $a2 = 80880000 -/* 00C28 808831E8 24C6361C */ addiu $a2, $a2, %lo(D_8088361C) ## $a2 = 8088361C -/* 00C2C 808831EC 460A4400 */ add.s $f16, $f8, $f10 -/* 00C30 808831F0 24180096 */ addiu $t8, $zero, 0x0096 ## $t8 = 00000096 -/* 00C34 808831F4 24190046 */ addiu $t9, $zero, 0x0046 ## $t9 = 00000046 -/* 00C38 808831F8 AFB90014 */ sw $t9, 0x0014($sp) -/* 00C3C 808831FC 46100480 */ add.s $f18, $f0, $f16 -/* 00C40 80883200 AFB80010 */ sw $t8, 0x0010($sp) -/* 00C44 80883204 00C03825 */ or $a3, $a2, $zero ## $a3 = 8088361C -/* 00C48 80883208 8FA4003C */ lw $a0, 0x003C($sp) -/* 00C4C 8088320C E7B20034 */ swc1 $f18, 0x0034($sp) -/* 00C50 80883210 0C00A3A1 */ jal EffectSsBomb2_SpawnLayered -/* 00C54 80883214 27A5002C */ addiu $a1, $sp, 0x002C ## $a1 = FFFFFFF4 -/* 00C58 80883218 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00C5C 8088321C 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00C60 80883220 2405180E */ addiu $a1, $zero, 0x180E ## $a1 = 0000180E -/* 00C64 80883224 8602016A */ lh $v0, 0x016A($s0) ## 0000016A -.L80883228: -/* 00C68 80883228 14400005 */ bne $v0, $zero, .L80883240 -/* 00C6C 8088322C 24080014 */ addiu $t0, $zero, 0x0014 ## $t0 = 00000014 -/* 00C70 80883230 3C098088 */ lui $t1, %hi(func_80883254) ## $t1 = 80880000 -/* 00C74 80883234 25293254 */ addiu $t1, $t1, %lo(func_80883254) ## $t1 = 80883254 -/* 00C78 80883238 A608016A */ sh $t0, 0x016A($s0) ## 0000016A -/* 00C7C 8088323C AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -.L80883240: -/* 00C80 80883240 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00C84 80883244 8FB00020 */ lw $s0, 0x0020($sp) -/* 00C88 80883248 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00C8C 8088324C 03E00008 */ jr $ra -/* 00C90 80883250 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883254.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883254.s deleted file mode 100644 index 694b5b9d32..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883254.s +++ /dev/null @@ -1,60 +0,0 @@ -glabel func_80883254 -/* 00C94 80883254 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00C98 80883258 AFBF001C */ sw $ra, 0x001C($sp) -/* 00C9C 8088325C AFB00018 */ sw $s0, 0x0018($sp) -/* 00CA0 80883260 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00CA4 80883264 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00CA8 80883268 AFA5002C */ sw $a1, 0x002C($sp) -/* 00CAC 8088326C 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00CB0 80883270 44816000 */ mtc1 $at, $f12 ## $f12 = 0.50 -/* 00CB4 80883274 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 -/* 00CB8 80883278 44814000 */ mtc1 $at, $f8 ## $f8 = 80.00 -/* 00CBC 8088327C 460C0102 */ mul.s $f4, $f0, $f12 -/* 00CC0 80883280 2604002C */ addiu $a0, $s0, 0x002C ## $a0 = 0000002C -/* 00CC4 80883284 460C2080 */ add.s $f2, $f4, $f12 -/* 00CC8 80883288 E7A20024 */ swc1 $f2, 0x0024($sp) -/* 00CCC 8088328C C6060010 */ lwc1 $f6, 0x0010($s0) ## 00000010 -/* 00CD0 80883290 46021400 */ add.s $f16, $f2, $f2 -/* 00CD4 80883294 46083281 */ sub.s $f10, $f6, $f8 -/* 00CD8 80883298 44068000 */ mfc1 $a2, $f16 -/* 00CDC 8088329C 44055000 */ mfc1 $a1, $f10 -/* 00CE0 808832A0 0C01DE80 */ jal Math_StepToF - -/* 00CE4 808832A4 00000000 */ nop -/* 00CE8 808832A8 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 00CEC 808832AC 44812000 */ mtc1 $at, $f4 ## $f4 = 40.00 -/* 00CF0 808832B0 C612000C */ lwc1 $f18, 0x000C($s0) ## 0000000C -/* 00CF4 808832B4 26040028 */ addiu $a0, $s0, 0x0028 ## $a0 = 00000028 -/* 00CF8 808832B8 8FA60024 */ lw $a2, 0x0024($sp) -/* 00CFC 808832BC 46049181 */ sub.s $f6, $f18, $f4 -/* 00D00 808832C0 44053000 */ mfc1 $a1, $f6 -/* 00D04 808832C4 0C01DE80 */ jal Math_StepToF - -/* 00D08 808832C8 00000000 */ nop -/* 00D0C 808832CC 1040000F */ beq $v0, $zero, .L8088330C -/* 00D10 808832D0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00D14 808832D4 8602016A */ lh $v0, 0x016A($s0) ## 0000016A -/* 00D18 808832D8 240F003C */ addiu $t7, $zero, 0x003C ## $t7 = 0000003C -/* 00D1C 808832DC 24180008 */ addiu $t8, $zero, 0x0008 ## $t8 = 00000008 -/* 00D20 808832E0 10400003 */ beq $v0, $zero, .L808832F0 -/* 00D24 808832E4 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00D28 808832E8 A60E016A */ sh $t6, 0x016A($s0) ## 0000016A -/* 00D2C 808832EC 8602016A */ lh $v0, 0x016A($s0) ## 0000016A -.L808832F0: -/* 00D30 808832F0 14400008 */ bne $v0, $zero, .L80883314 -/* 00D34 808832F4 3C198088 */ lui $t9, %hi(func_80883328) ## $t9 = 80880000 -/* 00D38 808832F8 27393328 */ addiu $t9, $t9, %lo(func_80883328) ## $t9 = 80883328 -/* 00D3C 808832FC A60F016A */ sh $t7, 0x016A($s0) ## 0000016A -/* 00D40 80883300 A6180030 */ sh $t8, 0x0030($s0) ## 00000030 -/* 00D44 80883304 10000003 */ beq $zero, $zero, .L80883314 -/* 00D48 80883308 AE190164 */ sw $t9, 0x0164($s0) ## 00000164 -.L8088330C: -/* 00D4C 8088330C 0C220A3D */ jal func_808828F4 -/* 00D50 80883310 8FA5002C */ lw $a1, 0x002C($sp) -.L80883314: -/* 00D54 80883314 8FBF001C */ lw $ra, 0x001C($sp) -/* 00D58 80883318 8FB00018 */ lw $s0, 0x0018($sp) -/* 00D5C 8088331C 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00D60 80883320 03E00008 */ jr $ra -/* 00D64 80883324 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883328.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883328.s deleted file mode 100644 index 58c26ec044..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883328.s +++ /dev/null @@ -1,122 +0,0 @@ -.late_rodata -glabel D_80883674 - .float 550.0 - -.text -glabel func_80883328 -/* 00D68 80883328 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78 -/* 00D6C 8088332C AFBF0064 */ sw $ra, 0x0064($sp) -/* 00D70 80883330 AFB70060 */ sw $s7, 0x0060($sp) -/* 00D74 80883334 AFB6005C */ sw $s6, 0x005C($sp) -/* 00D78 80883338 AFB50058 */ sw $s5, 0x0058($sp) -/* 00D7C 8088333C AFB40054 */ sw $s4, 0x0054($sp) -/* 00D80 80883340 AFB30050 */ sw $s3, 0x0050($sp) -/* 00D84 80883344 AFB2004C */ sw $s2, 0x004C($sp) -/* 00D88 80883348 AFB10048 */ sw $s1, 0x0048($sp) -/* 00D8C 8088334C AFB00044 */ sw $s0, 0x0044($sp) -/* 00D90 80883350 F7BC0038 */ sdc1 $f28, 0x0038($sp) -/* 00D94 80883354 F7BA0030 */ sdc1 $f26, 0x0030($sp) -/* 00D98 80883358 F7B80028 */ sdc1 $f24, 0x0028($sp) -/* 00D9C 8088335C F7B60020 */ sdc1 $f22, 0x0020($sp) -/* 00DA0 80883360 F7B40018 */ sdc1 $f20, 0x0018($sp) -/* 00DA4 80883364 848E0030 */ lh $t6, 0x0030($a0) ## 00000030 -/* 00DA8 80883368 3C013E00 */ lui $at, 0x3E00 ## $at = 3E000000 -/* 00DAC 8088336C 44813000 */ mtc1 $at, $f6 ## $f6 = 0.12 -/* 00DB0 80883370 448E2000 */ mtc1 $t6, $f4 ## $f4 = 0.00 -/* 00DB4 80883374 00A0A825 */ or $s5, $a1, $zero ## $s5 = 00000000 -/* 00DB8 80883378 0080B825 */ or $s7, $a0, $zero ## $s7 = 00000000 -/* 00DBC 8088337C 46802020 */ cvt.s.w $f0, $f4 -/* 00DC0 80883380 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 -/* 00DC4 80883384 2405C000 */ addiu $a1, $zero, 0xC000 ## $a1 = FFFFC000 -/* 00DC8 80883388 46060202 */ mul.s $f8, $f0, $f6 -/* 00DCC 8088338C 46080280 */ add.s $f10, $f0, $f8 -/* 00DD0 80883390 4600540D */ trunc.w.s $f16, $f10 -/* 00DD4 80883394 44188000 */ mfc1 $t8, $f16 -/* 00DD8 80883398 00000000 */ nop -/* 00DDC 8088339C A498FF7C */ sh $t8, -0x0084($a0) ## 00000030 -/* 00DE0 808833A0 0C01DE2B */ jal Math_ScaledStepToS - -/* 00DE4 808833A4 86E60030 */ lh $a2, 0x0030($s7) ## 00000030 -/* 00DE8 808833A8 1040003B */ beq $v0, $zero, .L80883498 -/* 00DEC 808833AC 0000B025 */ or $s6, $zero, $zero ## $s6 = 00000000 -/* 00DF0 808833B0 3C0142E0 */ lui $at, 0x42E0 ## $at = 42E00000 -/* 00DF4 808833B4 4481E000 */ mtc1 $at, $f28 ## $f28 = 112.00 -/* 00DF8 808833B8 C6F20024 */ lwc1 $f18, 0x0024($s7) ## 00000024 -/* 00DFC 808833BC 3C014248 */ lui $at, 0x4248 ## $at = 42480000 -/* 00E00 808833C0 4481D000 */ mtc1 $at, $f26 ## $f26 = 50.00 -/* 00E04 808833C4 3C01447A */ lui $at, 0x447A ## $at = 447A0000 -/* 00E08 808833C8 4481C000 */ mtc1 $at, $f24 ## $f24 = 1000.00 -/* 00E0C 808833CC E7B2007C */ swc1 $f18, 0x007C($sp) -/* 00E10 808833D0 C6E40028 */ lwc1 $f4, 0x0028($s7) ## 00000028 -/* 00E14 808833D4 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 00E18 808833D8 4481B000 */ mtc1 $at, $f22 ## $f22 = 200.00 -/* 00E1C 808833DC 3C018088 */ lui $at, %hi(D_80883674) ## $at = 80880000 -/* 00E20 808833E0 3C118088 */ lui $s1, %hi(D_8088361C) ## $s1 = 80880000 -/* 00E24 808833E4 2631361C */ addiu $s1, $s1, %lo(D_8088361C) ## $s1 = 8088361C -/* 00E28 808833E8 C4343674 */ lwc1 $f20, %lo(D_80883674)($at) -/* 00E2C 808833EC 24140004 */ addiu $s4, $zero, 0x0004 ## $s4 = 00000004 -/* 00E30 808833F0 27B3007C */ addiu $s3, $sp, 0x007C ## $s3 = FFFFFFF4 -/* 00E34 808833F4 24120002 */ addiu $s2, $zero, 0x0002 ## $s2 = 00000002 -/* 00E38 808833F8 E7A40080 */ swc1 $f4, 0x0080($sp) -.L808833FC: -/* 00E3C 808833FC C6E6002C */ lwc1 $f6, 0x002C($s7) ## 0000002C -/* 00E40 80883400 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 00E44 80883404 E7A60084 */ swc1 $f6, 0x0084($sp) -.L80883408: -/* 00E48 80883408 16120003 */ bne $s0, $s2, .L80883418 -/* 00E4C 8088340C C7A80084 */ lwc1 $f8, 0x0084($sp) -/* 00E50 80883410 10000002 */ beq $zero, $zero, .L8088341C -/* 00E54 80883414 4600A006 */ mov.s $f0, $f20 -.L80883418: -/* 00E58 80883418 4600D006 */ mov.s $f0, $f26 -.L8088341C: -/* 00E5C 8088341C 46004281 */ sub.s $f10, $f8, $f0 -/* 00E60 80883420 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00E64 80883424 E7AA0084 */ swc1 $f10, 0x0084($sp) -/* 00E68 80883428 46160402 */ mul.s $f16, $f0, $f22 -/* 00E6C 8088342C 240900C8 */ addiu $t1, $zero, 0x00C8 ## $t1 = 000000C8 -/* 00E70 80883430 AFA90014 */ sw $t1, 0x0014($sp) -/* 00E74 80883434 02A02025 */ or $a0, $s5, $zero ## $a0 = 00000000 -/* 00E78 80883438 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFF4 -/* 00E7C 8088343C 02203025 */ or $a2, $s1, $zero ## $a2 = 8088361C -/* 00E80 80883440 02203825 */ or $a3, $s1, $zero ## $a3 = 8088361C -/* 00E84 80883444 46188480 */ add.s $f18, $f16, $f24 -/* 00E88 80883448 4600910D */ trunc.w.s $f4, $f18 -/* 00E8C 8088344C 44082000 */ mfc1 $t0, $f4 -/* 00E90 80883450 0C00A1B3 */ jal func_800286CC -/* 00E94 80883454 AFA80010 */ sw $t0, 0x0010($sp) -/* 00E98 80883458 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 00E9C 8088345C 1614FFEA */ bne $s0, $s4, .L80883408 -/* 00EA0 80883460 00000000 */ nop -/* 00EA4 80883464 C7A6007C */ lwc1 $f6, 0x007C($sp) -/* 00EA8 80883468 26D60001 */ addiu $s6, $s6, 0x0001 ## $s6 = 00000001 -/* 00EAC 8088346C 461C3201 */ sub.s $f8, $f6, $f28 -/* 00EB0 80883470 16D2FFE2 */ bne $s6, $s2, .L808833FC -/* 00EB4 80883474 E7A8007C */ swc1 $f8, 0x007C($sp) -/* 00EB8 80883478 02E02025 */ or $a0, $s7, $zero ## $a0 = 00000000 -/* 00EBC 8088347C 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00EC0 80883480 2405281D */ addiu $a1, $zero, 0x281D ## $a1 = 0000281D -/* 00EC4 80883484 3C0B8088 */ lui $t3, %hi(func_808834D8) ## $t3 = 80880000 -/* 00EC8 80883488 240A0019 */ addiu $t2, $zero, 0x0019 ## $t2 = 00000019 -/* 00ECC 8088348C 256B34D8 */ addiu $t3, $t3, %lo(func_808834D8) ## $t3 = 808834D8 -/* 00ED0 80883490 A6EA016A */ sh $t2, 0x016A($s7) ## 0000016A -/* 00ED4 80883494 AEEB0164 */ sw $t3, 0x0164($s7) ## 00000164 -.L80883498: -/* 00ED8 80883498 8FBF0064 */ lw $ra, 0x0064($sp) -/* 00EDC 8088349C D7B40018 */ ldc1 $f20, 0x0018($sp) -/* 00EE0 808834A0 D7B60020 */ ldc1 $f22, 0x0020($sp) -/* 00EE4 808834A4 D7B80028 */ ldc1 $f24, 0x0028($sp) -/* 00EE8 808834A8 D7BA0030 */ ldc1 $f26, 0x0030($sp) -/* 00EEC 808834AC D7BC0038 */ ldc1 $f28, 0x0038($sp) -/* 00EF0 808834B0 8FB00044 */ lw $s0, 0x0044($sp) -/* 00EF4 808834B4 8FB10048 */ lw $s1, 0x0048($sp) -/* 00EF8 808834B8 8FB2004C */ lw $s2, 0x004C($sp) -/* 00EFC 808834BC 8FB30050 */ lw $s3, 0x0050($sp) -/* 00F00 808834C0 8FB40054 */ lw $s4, 0x0054($sp) -/* 00F04 808834C4 8FB50058 */ lw $s5, 0x0058($sp) -/* 00F08 808834C8 8FB6005C */ lw $s6, 0x005C($sp) -/* 00F0C 808834CC 8FB70060 */ lw $s7, 0x0060($sp) -/* 00F10 808834D0 03E00008 */ jr $ra -/* 00F14 808834D4 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808834D8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808834D8.s deleted file mode 100644 index a3875f6d94..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808834D8.s +++ /dev/null @@ -1,47 +0,0 @@ -.late_rodata -glabel D_80883678 - .float 0.04 - -.text -glabel func_808834D8 -/* 00F18 808834D8 AFA50004 */ sw $a1, 0x0004($sp) -/* 00F1C 808834DC 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 00F20 808834E0 3C01C170 */ lui $at, 0xC170 ## $at = C1700000 -/* 00F24 808834E4 3C198088 */ lui $t9, %hi(func_80883568) ## $t9 = 80880000 -/* 00F28 808834E8 10400003 */ beq $v0, $zero, .L808834F8 -/* 00F2C 808834EC 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00F30 808834F0 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -/* 00F34 808834F4 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -.L808834F8: -/* 00F38 808834F8 04410004 */ bgez $v0, .L8088350C -/* 00F3C 808834FC 304F0001 */ andi $t7, $v0, 0x0001 ## $t7 = 00000000 -/* 00F40 80883500 11E00002 */ beq $t7, $zero, .L8088350C -/* 00F44 80883504 00000000 */ nop -/* 00F48 80883508 25EFFFFE */ addiu $t7, $t7, 0xFFFE ## $t7 = FFFFFFFE -.L8088350C: -/* 00F4C 8088350C 11E00005 */ beq $t7, $zero, .L80883524 -/* 00F50 80883510 305800FE */ andi $t8, $v0, 0x00FE ## $t8 = 00000000 -/* 00F54 80883514 3C014170 */ lui $at, 0x4170 ## $at = 41700000 -/* 00F58 80883518 44810000 */ mtc1 $at, $f0 ## $f0 = 15.00 -/* 00F5C 8088351C 10000004 */ beq $zero, $zero, .L80883530 -/* 00F60 80883520 44982000 */ mtc1 $t8, $f4 ## $f4 = 0.00 -.L80883524: -/* 00F64 80883524 44810000 */ mtc1 $at, $f0 ## $f0 = 15.00 -/* 00F68 80883528 00000000 */ nop -/* 00F6C 8088352C 44982000 */ mtc1 $t8, $f4 ## $f4 = 0.00 -.L80883530: -/* 00F70 80883530 3C018088 */ lui $at, %hi(D_80883678) ## $at = 80880000 -/* 00F74 80883534 C4283678 */ lwc1 $f8, %lo(D_80883678)($at) -/* 00F78 80883538 468021A0 */ cvt.s.w $f6, $f4 -/* 00F7C 8088353C C4920028 */ lwc1 $f18, 0x0028($a0) ## 00000028 -/* 00F80 80883540 27393568 */ addiu $t9, $t9, %lo(func_80883568) ## $t9 = 80883568 -/* 00F84 80883544 46083282 */ mul.s $f10, $f6, $f8 -/* 00F88 80883548 00000000 */ nop -/* 00F8C 8088354C 46005402 */ mul.s $f16, $f10, $f0 -/* 00F90 80883550 46109100 */ add.s $f4, $f18, $f16 -/* 00F94 80883554 14400002 */ bne $v0, $zero, .L80883560 -/* 00F98 80883558 E4840028 */ swc1 $f4, 0x0028($a0) ## 00000028 -/* 00F9C 8088355C AC990164 */ sw $t9, 0x0164($a0) ## 00000164 -.L80883560: -/* 00FA0 80883560 03E00008 */ jr $ra -/* 00FA4 80883564 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883568.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883568.s deleted file mode 100644 index f63b1f67a4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883568.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80883568 -/* 00FA8 80883568 AFA40000 */ sw $a0, 0x0000($sp) -/* 00FAC 8088356C 03E00008 */ jr $ra -/* 00FB0 80883570 AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808835B8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808835B8.s deleted file mode 100644 index 26a5c0b585..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808835B8.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_808835B8 -/* 00FF8 808835B8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00FFC 808835BC AFBF0014 */ sw $ra, 0x0014($sp) -/* 01000 808835C0 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 01004 808835C4 84EE001C */ lh $t6, 0x001C($a3) ## 0000001C -/* 01008 808835C8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0100C 808835CC 3C058088 */ lui $a1, %hi(D_80883650) ## $a1 = 80880000 -/* 01010 808835D0 000E7880 */ sll $t7, $t6, 2 -/* 01014 808835D4 00AF2821 */ addu $a1, $a1, $t7 -/* 01018 808835D8 0C00D498 */ jal Gfx_DrawDListOpa - -/* 0101C 808835DC 8CA53650 */ lw $a1, %lo(D_80883650)($a1) -/* 01020 808835E0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01024 808835E4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 01028 808835E8 03E00008 */ jr $ra -/* 0102C 808835EC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s index 861bc885f7..0470a3272a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s @@ -132,7 +132,7 @@ glabel BgHidanHrock_Init /* 001CC 808892FC 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 001D0 80889300 02803025 */ or $a2, $s4, $zero ## $a2 = FFFFFFD4 /* 001D4 80889304 02A03825 */ or $a3, $s5, $zero ## $a3 = FFFFFFE0 -/* 001D8 80889308 0C0189E8 */ jal func_800627A0 +/* 001D8 80889308 0C0189E8 */ jal Collider_SetTrisVertices /* 001DC 8088930C AFB60010 */ sw $s6, 0x0010($sp) /* 001E0 80889310 26520001 */ addiu $s2, $s2, 0x0001 ## $s2 = 00000001 /* 001E4 80889314 1657FFC5 */ bne $s2, $s7, .L8088922C diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s index 5fedd34664..3992df9872 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s @@ -22,7 +22,7 @@ glabel BgHidanRock_Update /* 00B44 8088BBC4 44070000 */ mfc1 $a3, $f0 /* 00B48 8088BBC8 8FA4002C */ lw $a0, 0x002C($sp) /* 00B4C 8088BBCC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00B50 8088BBD0 0C00B92D */ jal func_8002E4B4 +/* 00B50 8088BBD0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B54 8088BBD4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00B58 8088BBD8 C600016C */ lwc1 $f0, 0x016C($s0) ## 0000016C .L8088BBDC: diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s index c825af4a91..d2727a0643 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s @@ -93,7 +93,7 @@ glabel BgHidanSekizou_Init /* 00500 8088D3C0 AE22014C */ sw $v0, 0x014C($s1) ## 0000014C /* 00504 8088D3C4 24C6E268 */ addiu $a2, $a2, %lo(D_8088E268) ## $a2 = 8088E268 /* 00508 8088D3C8 26240098 */ addiu $a0, $s1, 0x0098 ## $a0 = 00000098 -/* 0050C 8088D3CC 0C0187B5 */ jal func_80061ED4 +/* 0050C 8088D3CC 0C0187B5 */ jal CollisionCheck_SetInfo /* 00510 8088D3D0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00514 8088D3D4 8FBF002C */ lw $ra, 0x002C($sp) /* 00518 8088D3D8 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s index 2e8485e85a..8a1b3451e9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s @@ -46,7 +46,7 @@ glabel BgHidanSekizou_Update /* 00A98 8088D958 8FA50024 */ lw $a1, 0x0024($sp) /* 00A9C 8088D95C 8FA60020 */ lw $a2, 0x0020($sp) /* 00AA0 8088D960 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00AA4 8088D964 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00AA8 8088D968 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00AAC 8088D96C 0C00BE5D */ jal func_8002F974 @@ -78,7 +78,7 @@ glabel BgHidanSekizou_Update /* 00B04 8088D9C4 8FA50024 */ lw $a1, 0x0024($sp) /* 00B08 8088D9C8 8FA60020 */ lw $a2, 0x0020($sp) /* 00B0C 8088D9CC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B10 8088D9D0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00B14 8088D9D4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00B18 8088D9D8 0C00BE5D */ jal func_8002F974 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s index 9ce206762f..dc52557477 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s @@ -21,7 +21,7 @@ glabel func_80890740 /* 00048 80890788 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 0004C 8089078C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00050 80890790 0C0189B7 */ jal Collider_CylinderUpdate +/* 00050 80890790 0C0189B7 */ jal Collider_UpdateCylinder /* 00054 80890794 8FA5002C */ lw $a1, 0x002C($sp) /* 00058 80890798 8FA40030 */ lw $a0, 0x0030($sp) @@ -59,7 +59,7 @@ glabel func_80890740 /* 000D0 80890810 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000D4 80890814 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000D8 80890818 0C0189B7 */ jal Collider_CylinderUpdate +/* 000D8 80890818 0C0189B7 */ jal Collider_UpdateCylinder /* 000DC 8089081C 8FA50024 */ lw $a1, 0x0024($sp) /* 000E0 80890820 8FAD002C */ lw $t5, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s index fdca12e33b..d83ba6e43d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s @@ -70,7 +70,7 @@ glabel func_8089107C /* 00A34 80891174 AFA50028 */ sw $a1, 0x0028($sp) /* 00A38 80891178 00E03025 */ or $a2, $a3, $zero ## $a2 = 00000168 /* 00A3C 8089117C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A40 80891180 AFA70024 */ sw $a3, 0x0024($sp) /* 00A44 80891184 8FA50028 */ lw $a1, 0x0028($sp) /* 00A48 80891188 8FA4003C */ lw $a0, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s index 0201a22353..37769d2413 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s @@ -64,7 +64,7 @@ glabel func_808911D4 /* 00B64 808912A4 AFA5002C */ sw $a1, 0x002C($sp) /* 00B68 808912A8 26060168 */ addiu $a2, $s0, 0x0168 ## $a2 = 00000168 /* 00B6C 808912AC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B70 808912B0 AFA30028 */ sw $v1, 0x0028($sp) /* 00B74 808912B4 8FA5002C */ lw $a1, 0x002C($sp) /* 00B78 808912B8 8FA40044 */ lw $a0, 0x0044($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Destroy.s deleted file mode 100644 index dca637e780..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Destroy.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel BgJyaCobra_Destroy -/* 00FF8 808968E8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00FFC 808968EC AFA40018 */ sw $a0, 0x0018($sp) -/* 01000 808968F0 8FAE0018 */ lw $t6, 0x0018($sp) -/* 01004 808968F4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01008 808968F8 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0100C 808968FC 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810 -/* 01010 80896900 0C00FB56 */ jal DynaPoly_DeleteBgActor - ## DynaPoly_DeleteBgActor -/* 01014 80896904 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C -/* 01018 80896908 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0101C 8089690C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 01020 80896910 03E00008 */ jr $ra -/* 01024 80896914 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Draw.s deleted file mode 100644 index 37cd050882..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Draw.s +++ /dev/null @@ -1,56 +0,0 @@ -glabel BgJyaCobra_Draw -/* 018B8 808971A8 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 018BC 808971AC AFB00014 */ sw $s0, 0x0014($sp) -/* 018C0 808971B0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 018C4 808971B4 AFBF001C */ sw $ra, 0x001C($sp) -/* 018C8 808971B8 AFB10018 */ sw $s1, 0x0018($sp) -/* 018CC 808971BC 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 018D0 808971C0 0C225B2D */ jal func_80896CB4 -/* 018D4 808971C4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 018D8 808971C8 3C050601 */ lui $a1, %hi(D_06010790) ## $a1 = 06010000 -/* 018DC 808971CC 24A50790 */ addiu $a1, $a1, %lo(D_06010790) ## $a1 = 06010790 -/* 018E0 808971D0 0C00D498 */ jal Gfx_DrawDListOpa - -/* 018E4 808971D4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 018E8 808971D8 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 018EC 808971DC C606018C */ lwc1 $f6, 0x018C($s0) ## 0000018C -/* 018F0 808971E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018F4 808971E4 4606203C */ c.lt.s $f4, $f6 -/* 018F8 808971E8 00000000 */ nop -/* 018FC 808971EC 45020004 */ bc1fl .L80897200 -/* 01900 808971F0 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 01904 808971F4 0C225B5E */ jal func_80896D78 -/* 01908 808971F8 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 0190C 808971FC 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -.L80897200: -/* 01910 80897200 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 01914 80897204 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01918 80897208 31CF0003 */ andi $t7, $t6, 0x0003 ## $t7 = 00000000 -/* 0191C 8089720C 15E1000E */ bne $t7, $at, .L80897248 -/* 01920 80897210 00000000 */ nop -/* 01924 80897214 8E020118 */ lw $v0, 0x0118($s0) ## 00000118 -/* 01928 80897218 5040000E */ beql $v0, $zero, .L80897254 -/* 0192C 8089721C 8FBF001C */ lw $ra, 0x001C($sp) -/* 01930 80897220 9043015C */ lbu $v1, 0x015C($v0) ## 0000015C -/* 01934 80897224 30780004 */ andi $t8, $v1, 0x0004 ## $t8 = 00000000 -/* 01938 80897228 13000009 */ beq $t8, $zero, .L80897250 -/* 0193C 8089722C 30790001 */ andi $t9, $v1, 0x0001 ## $t9 = 00000000 -/* 01940 80897230 13200007 */ beq $t9, $zero, .L80897250 -/* 01944 80897234 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01948 80897238 0C225BB9 */ jal func_80896EE4 -/* 0194C 8089723C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 01950 80897240 10000004 */ beq $zero, $zero, .L80897254 -/* 01954 80897244 8FBF001C */ lw $ra, 0x001C($sp) -.L80897248: -/* 01958 80897248 0C225BB9 */ jal func_80896EE4 -/* 0195C 8089724C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -.L80897250: -/* 01960 80897250 8FBF001C */ lw $ra, 0x001C($sp) -.L80897254: -/* 01964 80897254 8FB00014 */ lw $s0, 0x0014($sp) -/* 01968 80897258 8FB10018 */ lw $s1, 0x0018($sp) -/* 0196C 8089725C 03E00008 */ jr $ra -/* 01970 80897260 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 01974 80897264 00000000 */ nop -/* 01978 80897268 00000000 */ nop -/* 0197C 8089726C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Init.s deleted file mode 100644 index 9baf301628..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Init.s +++ /dev/null @@ -1,85 +0,0 @@ -.rdata -glabel D_8089760C - .asciz "(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n" - .balign 4 - -.text -glabel BgJyaCobra_Init -/* 00EE4 808967D4 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00EE8 808967D8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00EEC 808967DC AFB0001C */ sw $s0, 0x001C($sp) -/* 00EF0 808967E0 3C060601 */ lui $a2, %hi(D_0601167C) ## $a2 = 06010000 -/* 00EF4 808967E4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00EF8 808967E8 AFB10020 */ sw $s1, 0x0020($sp) -/* 00EFC 808967EC AFA5002C */ sw $a1, 0x002C($sp) -/* 00F00 808967F0 24C6167C */ addiu $a2, $a2, %lo(D_0601167C) ## $a2 = 0601167C -/* 00F04 808967F4 0C22564F */ jal func_8089593C -/* 00F08 808967F8 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00F0C 808967FC 3C058089 */ lui $a1, %hi(D_80897528) ## $a1 = 80890000 -/* 00F10 80896800 24A57528 */ addiu $a1, $a1, %lo(D_80897528) ## $a1 = 80897528 -/* 00F14 80896804 0C01E037 */ jal Actor_ProcessInitChain - -/* 00F18 80896808 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F1C 8089680C 8611001C */ lh $s1, 0x001C($s0) ## 0000001C -/* 00F20 80896810 8FA4002C */ lw $a0, 0x002C($sp) -/* 00F24 80896814 322E0003 */ andi $t6, $s1, 0x0003 ## $t6 = 00000000 -/* 00F28 80896818 15C00009 */ bne $t6, $zero, .L80896840 -/* 00F2C 8089681C 00112A03 */ sra $a1, $s1, 8 -/* 00F30 80896820 0C00B2D0 */ jal Flags_GetSwitch - -/* 00F34 80896824 30A5003F */ andi $a1, $a1, 0x003F ## $a1 = 00000000 -/* 00F38 80896828 50400006 */ beql $v0, $zero, .L80896844 -/* 00F3C 8089682C 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 00F40 80896830 A60000B6 */ sh $zero, 0x00B6($s0) ## 000000B6 -/* 00F44 80896834 860200B6 */ lh $v0, 0x00B6($s0) ## 000000B6 -/* 00F48 80896838 A6020016 */ sh $v0, 0x0016($s0) ## 00000016 -/* 00F4C 8089683C A6020032 */ sh $v0, 0x0032($s0) ## 00000032 -.L80896840: -/* 00F50 80896840 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -.L80896844: -/* 00F54 80896844 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F58 80896848 31F80003 */ andi $t8, $t7, 0x0003 ## $t8 = 00000000 -/* 00F5C 8089684C 57000004 */ bnel $t8, $zero, .L80896860 -/* 00F60 80896850 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F64 80896854 0C225671 */ jal func_808959C4 -/* 00F68 80896858 8FA5002C */ lw $a1, 0x002C($sp) -/* 00F6C 8089685C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80896860: -/* 00F70 80896860 0C225A46 */ jal func_80896918 -/* 00F74 80896864 8FA5002C */ lw $a1, 0x002C($sp) -/* 00F78 80896868 8611001C */ lh $s1, 0x001C($s0) ## 0000001C -/* 00F7C 8089686C 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 00F80 80896870 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00F84 80896874 32220003 */ andi $v0, $s1, 0x0003 ## $v0 = 00000000 -/* 00F88 80896878 50620004 */ beql $v1, $v0, .L8089688C -/* 00F8C 8089687C 8611001C */ lh $s1, 0x001C($s0) ## 0000001C -/* 00F90 80896880 14410005 */ bne $v0, $at, .L80896898 -/* 00F94 80896884 00000000 */ nop -/* 00F98 80896888 8611001C */ lh $s1, 0x001C($s0) ## 0000001C -.L8089688C: -/* 00F9C 8089688C 2419FFFF */ addiu $t9, $zero, 0xFFFF ## $t9 = FFFFFFFF -/* 00FA0 80896890 A2190003 */ sb $t9, 0x0003($s0) ## 00000003 -/* 00FA4 80896894 32220003 */ andi $v0, $s1, 0x0003 ## $v0 = 00000000 -.L80896898: -/* 00FA8 80896898 54620005 */ bnel $v1, $v0, .L808968B0 -/* 00FAC 8089689C 260801A3 */ addiu $t0, $s0, 0x01A3 ## $t0 = 000001A3 -/* 00FB0 808968A0 0C225946 */ jal func_80896518 -/* 00FB4 808968A4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00FB8 808968A8 8611001C */ lh $s1, 0x001C($s0) ## 0000001C -/* 00FBC 808968AC 260801A3 */ addiu $t0, $s0, 0x01A3 ## $t0 = 000001A3 -.L808968B0: -/* 00FC0 808968B0 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 00FC4 808968B4 01014824 */ and $t1, $t0, $at -/* 00FC8 808968B8 3C048089 */ lui $a0, %hi(D_8089760C) ## $a0 = 80890000 -/* 00FCC 808968BC 2484760C */ addiu $a0, $a0, %lo(D_8089760C) ## $a0 = 8089760C -/* 00FD0 808968C0 AFA90010 */ sw $t1, 0x0010($sp) -/* 00FD4 808968C4 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 00FD8 808968C8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00FDC 808968CC 0C00084C */ jal osSyncPrintf - -/* 00FE0 808968D0 26070194 */ addiu $a3, $s0, 0x0194 ## $a3 = 00000194 -/* 00FE4 808968D4 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00FE8 808968D8 8FB0001C */ lw $s0, 0x001C($sp) -/* 00FEC 808968DC 8FB10020 */ lw $s1, 0x0020($sp) -/* 00FF0 808968E0 03E00008 */ jr $ra -/* 00FF4 808968E4 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Update.s deleted file mode 100644 index 7d2cb19949..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Update.s +++ /dev/null @@ -1,30 +0,0 @@ -glabel BgJyaCobra_Update -/* 01358 80896C48 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 0135C 80896C4C AFB00018 */ sw $s0, 0x0018($sp) -/* 01360 80896C50 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01364 80896C54 AFBF001C */ sw $ra, 0x001C($sp) -/* 01368 80896C58 AFA50024 */ sw $a1, 0x0024($sp) -/* 0136C 80896C5C 8E190164 */ lw $t9, 0x0164($s0) ## 00000164 -/* 01370 80896C60 0320F809 */ jalr $ra, $t9 -/* 01374 80896C64 00000000 */ nop -/* 01378 80896C68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0137C 80896C6C 0C22571D */ jal func_80895C74 -/* 01380 80896C70 8FA50024 */ lw $a1, 0x0024($sp) -/* 01384 80896C74 0C22569C */ jal func_80895A70 -/* 01388 80896C78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0138C 80896C7C 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 01390 80896C80 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 01394 80896C84 30420003 */ andi $v0, $v0, 0x0003 ## $v0 = 00000000 -/* 01398 80896C88 10400003 */ beq $v0, $zero, .L80896C98 -/* 0139C 80896C8C 00000000 */ nop -/* 013A0 80896C90 54410004 */ bnel $v0, $at, .L80896CA4 -/* 013A4 80896C94 8FBF001C */ lw $ra, 0x001C($sp) -.L80896C98: -/* 013A8 80896C98 0C2257BC */ jal func_80895EF0 -/* 013AC 80896C9C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 013B0 80896CA0 8FBF001C */ lw $ra, 0x001C($sp) -.L80896CA4: -/* 013B4 80896CA4 8FB00018 */ lw $s0, 0x0018($sp) -/* 013B8 80896CA8 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 013BC 80896CAC 03E00008 */ jr $ra -/* 013C0 80896CB0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895EF0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s similarity index 98% rename from asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895EF0.s rename to asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s index 7f762425c5..4fd48eeb43 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895EF0.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s @@ -13,7 +13,7 @@ glabel D_80897730 .float 0.2 .text -glabel func_80895EF0 +glabel BgJyaCobra_UpdateShadowFromSide /* 00600 80895EF0 27BDFF20 */ addiu $sp, $sp, 0xFF20 ## $sp = FFFFFF20 /* 00604 80895EF4 AFB20048 */ sw $s2, 0x0048($sp) /* 00608 80895EF8 AFB00040 */ sw $s0, 0x0040($sp) @@ -82,10 +82,10 @@ glabel func_80895EF0 /* 006F8 80895FE8 4481B000 */ mtc1 $at, $f22 ## $f22 = 0.50 /* 006FC 80895FEC 3C018089 */ lui $at, %hi(D_8089772C) ## $at = 80890000 /* 00700 80895FF0 3C148089 */ lui $s4, %hi(D_808973A4) ## $s4 = 80890000 -/* 00704 80895FF4 3C178089 */ lui $s7, %hi(D_808973B0) ## $s7 = 80890000 +/* 00704 80895FF4 3C178089 */ lui $s7, %hi(D_808973A4 + 0xC) ## $s7 = 80890000 /* 00708 80895FF8 3C108089 */ lui $s0, %hi(D_8089731C) ## $s0 = 80890000 /* 0070C 80895FFC 2610731C */ addiu $s0, $s0, %lo(D_8089731C) ## $s0 = 8089731C -/* 00710 80896000 26F773B0 */ addiu $s7, $s7, %lo(D_808973B0) ## $s7 = 808973B0 +/* 00710 80896000 26F773B0 */ addiu $s7, $s7, %lo(D_808973A4 + 0xC) ## $s7 = 808973B0 /* 00714 80896004 269473A4 */ addiu $s4, $s4, %lo(D_808973A4) ## $s4 = 808973A4 /* 00718 80896008 C434772C */ lwc1 $f20, %lo(D_8089772C)($at) /* 0071C 8089600C 27BE00C8 */ addiu $s8, $sp, 0x00C8 ## $s8 = FFFFFFE8 @@ -283,14 +283,14 @@ glabel func_80895EF0 /* 009E8 808962D8 1420FF50 */ bne $at, $zero, .L8089601C /* 009EC 808962DC 2694000C */ addiu $s4, $s4, 0x000C ## $s4 = 808973B0 /* 009F0 808962E0 3C158089 */ lui $s5, %hi(D_808974DC) ## $s5 = 80890000 -/* 009F4 808962E4 3C148089 */ lui $s4, %hi(D_808974E8) ## $s4 = 80890000 +/* 009F4 808962E4 3C148089 */ lui $s4, %hi(D_808974DC + 0xC) ## $s4 = 80890000 /* 009F8 808962E8 3C018089 */ lui $at, %hi(D_80897730) ## $at = 80890000 /* 009FC 808962EC 3C178089 */ lui $s7, %hi(D_80897518) ## $s7 = 80890000 /* 00A00 808962F0 3C138089 */ lui $s3, %hi(D_80897398) ## $s3 = 80890000 /* 00A04 808962F4 26737398 */ addiu $s3, $s3, %lo(D_80897398) ## $s3 = 80897398 /* 00A08 808962F8 26F77518 */ addiu $s7, $s7, %lo(D_80897518) ## $s7 = 80897518 /* 00A0C 808962FC C43C7730 */ lwc1 $f28, %lo(D_80897730)($at) -/* 00A10 80896300 269474E8 */ addiu $s4, $s4, %lo(D_808974E8) ## $s4 = 808974E8 +/* 00A10 80896300 269474E8 */ addiu $s4, $s4, %lo(D_808974DC + 0xC) ## $s4 = 808974E8 /* 00A14 80896304 26B574DC */ addiu $s5, $s5, %lo(D_808974DC) ## $s5 = 808974DC /* 00A18 80896308 24100003 */ addiu $s0, $zero, 0x0003 ## $s0 = 00000003 .L8089630C: diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896518.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s similarity index 99% rename from asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896518.s rename to asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s index b598caf749..90ed4c1da6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896518.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s @@ -1,4 +1,4 @@ -glabel func_80896518 +glabel BgJyaCobra_UpdateShadowFromTop /* 00C28 80896518 27BDFEA8 */ addiu $sp, $sp, 0xFEA8 ## $sp = FFFFFEA8 /* 00C2C 8089651C 3C0141FC */ lui $at, 0x41FC ## $at = 41FC0000 /* 00C30 80896520 44811000 */ mtc1 $at, $f2 ## $f2 = 31.50 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808958F0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808958F0.s deleted file mode 100644 index 8d91ce645c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808958F0.s +++ /dev/null @@ -1,20 +0,0 @@ -glabel func_808958F0 -/* 00000 808958F0 44866000 */ mtc1 $a2, $f12 ## $f12 = 0.00 -/* 00004 808958F4 C4A40008 */ lwc1 $f4, 0x0008($a1) ## 00000008 -/* 00008 808958F8 44877000 */ mtc1 $a3, $f14 ## $f14 = 0.00 -/* 0000C 808958FC C4A80000 */ lwc1 $f8, 0x0000($a1) ## 00000000 -/* 00010 80895900 460C2182 */ mul.s $f6, $f4, $f12 -/* 00014 80895904 00000000 */ nop -/* 00018 80895908 460E4282 */ mul.s $f10, $f8, $f14 -/* 0001C 8089590C 460A3400 */ add.s $f16, $f6, $f10 -/* 00020 80895910 E4900000 */ swc1 $f16, 0x0000($a0) ## 00000000 -/* 00024 80895914 C4B20004 */ lwc1 $f18, 0x0004($a1) ## 00000004 -/* 00028 80895918 E4920004 */ swc1 $f18, 0x0004($a0) ## 00000004 -/* 0002C 8089591C C4A40008 */ lwc1 $f4, 0x0008($a1) ## 00000008 -/* 00030 80895920 C4A60000 */ lwc1 $f6, 0x0000($a1) ## 00000000 -/* 00034 80895924 460E2202 */ mul.s $f8, $f4, $f14 -/* 00038 80895928 00000000 */ nop -/* 0003C 8089592C 460C3282 */ mul.s $f10, $f6, $f12 -/* 00040 80895930 460A4401 */ sub.s $f16, $f8, $f10 -/* 00044 80895934 03E00008 */ jr $ra -/* 00048 80895938 E4900008 */ swc1 $f16, 0x0008($a0) ## 00000008 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_8089593C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_8089593C.s deleted file mode 100644 index c5c02992e0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_8089593C.s +++ /dev/null @@ -1,50 +0,0 @@ -.rdata -glabel D_80897570 - .asciz "Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n" - .balign 4 - -glabel D_808975B0 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -.text -glabel func_8089593C -/* 0004C 8089593C 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 00050 80895940 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00054 80895944 AFB00020 */ sw $s0, 0x0020($sp) -/* 00058 80895948 AFA5003C */ sw $a1, 0x003C($sp) -/* 0005C 8089594C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00060 80895950 AFA60040 */ sw $a2, 0x0040($sp) -/* 00064 80895954 AFA00030 */ sw $zero, 0x0030($sp) -/* 00068 80895958 0C010D20 */ jal DynaPolyActor_Init - -/* 0006C 8089595C 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 00070 80895960 8FA40040 */ lw $a0, 0x0040($sp) -/* 00074 80895964 0C010620 */ jal CollisionHeader_GetVirtual - -/* 00078 80895968 27A50030 */ addiu $a1, $sp, 0x0030 ## $a1 = FFFFFFF8 -/* 0007C 8089596C 8FA4003C */ lw $a0, 0x003C($sp) -/* 00080 80895970 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00084 80895974 8FA70030 */ lw $a3, 0x0030($sp) -/* 00088 80895978 0C00FA9D */ jal DynaPoly_SetBgActor - ## DynaPoly_SetBgActor -/* 0008C 8089597C 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00090 80895980 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -/* 00094 80895984 1441000A */ bne $v0, $at, .L808959B0 -/* 00098 80895988 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 0009C 8089598C 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 000A0 80895990 3C048089 */ lui $a0, %hi(D_80897570) ## $a0 = 80890000 -/* 000A4 80895994 3C058089 */ lui $a1, %hi(D_808975B0) ## $a1 = 80890000 -/* 000A8 80895998 86070000 */ lh $a3, 0x0000($s0) ## 00000000 -/* 000AC 8089599C 24A575B0 */ addiu $a1, $a1, %lo(D_808975B0) ## $a1 = 808975B0 -/* 000B0 808959A0 24847570 */ addiu $a0, $a0, %lo(D_80897570) ## $a0 = 80897570 -/* 000B4 808959A4 240600F7 */ addiu $a2, $zero, 0x00F7 ## $a2 = 000000F7 -/* 000B8 808959A8 0C00084C */ jal osSyncPrintf - -/* 000BC 808959AC AFAE0010 */ sw $t6, 0x0010($sp) -.L808959B0: -/* 000C0 808959B0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 000C4 808959B4 8FB00020 */ lw $s0, 0x0020($sp) -/* 000C8 808959B8 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 000CC 808959BC 03E00008 */ jr $ra -/* 000D0 808959C0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808959C4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808959C4.s deleted file mode 100644 index 2b1d80e558..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808959C4.s +++ /dev/null @@ -1,67 +0,0 @@ -.rdata -glabel D_808975C4 - .asciz "\x1b[31m" - .balign 4 - -glabel D_808975CC - .asciz "Error : Mir Ray 発生失敗 (%s %d)\n" - .balign 4 - -glabel D_808975F4 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_80897608 - .asciz "\x1b[m" - .balign 4 - -.text -glabel func_808959C4 -/* 000D4 808959C4 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 000D8 808959C8 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 000DC 808959CC 00802825 */ or $a1, $a0, $zero ## $a1 = 00000000 -/* 000E0 808959D0 AFBF0034 */ sw $ra, 0x0034($sp) -/* 000E4 808959D4 AFA40038 */ sw $a0, 0x0038($sp) -/* 000E8 808959D8 C4A40024 */ lwc1 $f4, 0x0024($a1) ## 00000024 -/* 000EC 808959DC 3C014264 */ lui $at, 0x4264 ## $at = 42640000 -/* 000F0 808959E0 44814000 */ mtc1 $at, $f8 ## $f8 = 57.00 -/* 000F4 808959E4 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 000F8 808959E8 C4A60028 */ lwc1 $f6, 0x0028($a1) ## 00000028 -/* 000FC 808959EC 240E0006 */ addiu $t6, $zero, 0x0006 ## $t6 = 00000006 -/* 00100 808959F0 24C41C24 */ addiu $a0, $a2, 0x1C24 ## $a0 = 00001C24 -/* 00104 808959F4 46083280 */ add.s $f10, $f6, $f8 -/* 00108 808959F8 240700B7 */ addiu $a3, $zero, 0x00B7 ## $a3 = 000000B7 -/* 0010C 808959FC E7AA0014 */ swc1 $f10, 0x0014($sp) -/* 00110 80895A00 C4B0002C */ lwc1 $f16, 0x002C($a1) ## 0000002C -/* 00114 80895A04 AFA50038 */ sw $a1, 0x0038($sp) -/* 00118 80895A08 AFAE0028 */ sw $t6, 0x0028($sp) -/* 0011C 80895A0C AFA00024 */ sw $zero, 0x0024($sp) -/* 00120 80895A10 AFA00020 */ sw $zero, 0x0020($sp) -/* 00124 80895A14 AFA0001C */ sw $zero, 0x001C($sp) -/* 00128 80895A18 0C00C916 */ jal Actor_SpawnAsChild - -/* 0012C 80895A1C E7B00018 */ swc1 $f16, 0x0018($sp) -/* 00130 80895A20 8FA50038 */ lw $a1, 0x0038($sp) -/* 00134 80895A24 3C048089 */ lui $a0, %hi(D_808975C4) ## $a0 = 80890000 -/* 00138 80895A28 8CAF011C */ lw $t7, 0x011C($a1) ## 0000011C -/* 0013C 80895A2C 55E0000D */ bnel $t7, $zero, .L80895A64 -/* 00140 80895A30 8FBF0034 */ lw $ra, 0x0034($sp) -/* 00144 80895A34 0C00084C */ jal osSyncPrintf - -/* 00148 80895A38 248475C4 */ addiu $a0, $a0, %lo(D_808975C4) ## $a0 = 808975C4 -/* 0014C 80895A3C 3C048089 */ lui $a0, %hi(D_808975CC) ## $a0 = 80890000 -/* 00150 80895A40 3C058089 */ lui $a1, %hi(D_808975F4) ## $a1 = 80890000 -/* 00154 80895A44 24A575F4 */ addiu $a1, $a1, %lo(D_808975F4) ## $a1 = 808975F4 -/* 00158 80895A48 248475CC */ addiu $a0, $a0, %lo(D_808975CC) ## $a0 = 808975CC -/* 0015C 80895A4C 0C00084C */ jal osSyncPrintf - -/* 00160 80895A50 2406010E */ addiu $a2, $zero, 0x010E ## $a2 = 0000010E -/* 00164 80895A54 3C048089 */ lui $a0, %hi(D_80897608) ## $a0 = 80890000 -/* 00168 80895A58 0C00084C */ jal osSyncPrintf - -/* 0016C 80895A5C 24847608 */ addiu $a0, $a0, %lo(D_80897608) ## $a0 = 80897608 -/* 00170 80895A60 8FBF0034 */ lw $ra, 0x0034($sp) -.L80895A64: -/* 00174 80895A64 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 00178 80895A68 03E00008 */ jr $ra -/* 0017C 80895A6C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895BEC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895BEC.s deleted file mode 100644 index 716f9432d9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895BEC.s +++ /dev/null @@ -1,37 +0,0 @@ -glabel func_80895BEC -/* 002FC 80895BEC 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00300 80895BF0 AFBF001C */ sw $ra, 0x001C($sp) -/* 00304 80895BF4 AFB00018 */ sw $s0, 0x0018($sp) -/* 00308 80895BF8 8CAE1C44 */ lw $t6, 0x1C44($a1) ## 00001C44 -/* 0030C 80895BFC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00310 80895C00 AFAE003C */ sw $t6, 0x003C($sp) -/* 00314 80895C04 0C01DE1C */ jal Math_SinS - ## sins? -/* 00318 80895C08 84840170 */ lh $a0, 0x0170($a0) ## 00000170 -/* 0031C 80895C0C E7A00024 */ swc1 $f0, 0x0024($sp) -/* 00320 80895C10 0C01DE0D */ jal Math_CosS - ## coss? -/* 00324 80895C14 86040170 */ lh $a0, 0x0170($s0) ## 00000170 -/* 00328 80895C18 44070000 */ mfc1 $a3, $f0 -/* 0032C 80895C1C 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFEC -/* 00330 80895C20 26050174 */ addiu $a1, $s0, 0x0174 ## $a1 = 00000174 -/* 00334 80895C24 0C22563C */ jal func_808958F0 -/* 00338 80895C28 8FA60024 */ lw $a2, 0x0024($sp) -/* 0033C 80895C2C C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 00340 80895C30 C7A6002C */ lwc1 $f6, 0x002C($sp) -/* 00344 80895C34 8FA2003C */ lw $v0, 0x003C($sp) -/* 00348 80895C38 46062200 */ add.s $f8, $f4, $f6 -/* 0034C 80895C3C E4480024 */ swc1 $f8, 0x0024($v0) ## 00000024 -/* 00350 80895C40 C7B00030 */ lwc1 $f16, 0x0030($sp) -/* 00354 80895C44 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 00358 80895C48 46105480 */ add.s $f18, $f10, $f16 -/* 0035C 80895C4C E4520028 */ swc1 $f18, 0x0028($v0) ## 00000028 -/* 00360 80895C50 C7A60034 */ lwc1 $f6, 0x0034($sp) -/* 00364 80895C54 C604002C */ lwc1 $f4, 0x002C($s0) ## 0000002C -/* 00368 80895C58 46062200 */ add.s $f8, $f4, $f6 -/* 0036C 80895C5C E448002C */ swc1 $f8, 0x002C($v0) ## 0000002C -/* 00370 80895C60 8FBF001C */ lw $ra, 0x001C($sp) -/* 00374 80895C64 8FB00018 */ lw $s0, 0x0018($sp) -/* 00378 80895C68 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 0037C 80895C6C 03E00008 */ jr $ra -/* 00380 80895C70 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896918.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896918.s deleted file mode 100644 index 81156ad6ce..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896918.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80896918 -/* 01028 80896918 AFA50004 */ sw $a1, 0x0004($sp) -/* 0102C 8089691C 848F016C */ lh $t7, 0x016C($a0) ## 0000016C -/* 01030 80896920 84990016 */ lh $t9, 0x0016($a0) ## 00000016 -/* 01034 80896924 3C0E8089 */ lui $t6, %hi(func_80896950) ## $t6 = 80890000 -/* 01038 80896928 000FC340 */ sll $t8, $t7, 13 -/* 0103C 8089692C 03191021 */ addu $v0, $t8, $t9 -/* 01040 80896930 00021400 */ sll $v0, $v0, 16 -/* 01044 80896934 25CE6950 */ addiu $t6, $t6, %lo(func_80896950) ## $t6 = 80896950 -/* 01048 80896938 00021403 */ sra $v0, $v0, 16 -/* 0104C 8089693C AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -/* 01050 80896940 A4800168 */ sh $zero, 0x0168($a0) ## 00000168 -/* 01054 80896944 A4820032 */ sh $v0, 0x0032($a0) ## 00000032 -/* 01058 80896948 03E00008 */ jr $ra -/* 0105C 8089694C A48200B6 */ sh $v0, 0x00B6($a0) ## 000000B6 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896950.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896950.s deleted file mode 100644 index bacf4bb63c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896950.s +++ /dev/null @@ -1,54 +0,0 @@ -.late_rodata -glabel D_80897734 - .float 0.001 - -glabel D_80897738 - .float 0.001 - -.text -glabel func_80896950 -/* 01060 80896950 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 01064 80896954 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01068 80896958 3C018089 */ lui $at, %hi(D_80897734) ## $at = 80890000 -/* 0106C 8089695C C4247734 */ lwc1 $f4, %lo(D_80897734)($at) -/* 01070 80896960 C4860150 */ lwc1 $f6, 0x0150($a0) ## 00000150 -/* 01074 80896964 8CA21C44 */ lw $v0, 0x1C44($a1) ## 00001C44 -/* 01078 80896968 4606203C */ c.lt.s $f4, $f6 -/* 0107C 8089696C 00000000 */ nop -/* 01080 80896970 4502000F */ bc1fl .L808969B0 -/* 01084 80896974 A4800168 */ sh $zero, 0x0168($a0) ## 00000168 -/* 01088 80896978 848E0168 */ lh $t6, 0x0168($a0) ## 00000168 -/* 0108C 8089697C 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 01090 80896980 A48F0168 */ sh $t7, 0x0168($a0) ## 00000168 -/* 01094 80896984 84980168 */ lh $t8, 0x0168($a0) ## 00000168 -/* 01098 80896988 2B01000F */ slti $at, $t8, 0x000F -/* 0109C 8089698C 54200009 */ bnel $at, $zero, .L808969B4 -/* 010A0 80896990 C4800150 */ lwc1 $f0, 0x0150($a0) ## 00000150 -/* 010A4 80896994 AFA2001C */ sw $v0, 0x001C($sp) -/* 010A8 80896998 0C225A7E */ jal func_808969F8 -/* 010AC 8089699C AFA40020 */ sw $a0, 0x0020($sp) -/* 010B0 808969A0 8FA2001C */ lw $v0, 0x001C($sp) -/* 010B4 808969A4 10000002 */ beq $zero, $zero, .L808969B0 -/* 010B8 808969A8 8FA40020 */ lw $a0, 0x0020($sp) -/* 010BC 808969AC A4800168 */ sh $zero, 0x0168($a0) ## 00000168 -.L808969B0: -/* 010C0 808969B0 C4800150 */ lwc1 $f0, 0x0150($a0) ## 00000150 -.L808969B4: -/* 010C4 808969B4 3C018089 */ lui $at, %hi(D_80897738) ## $at = 80890000 -/* 010C8 808969B8 C4287738 */ lwc1 $f8, %lo(D_80897738)($at) -/* 010CC 808969BC 46000005 */ abs.s $f0, $f0 -/* 010D0 808969C0 4600403C */ c.lt.s $f8, $f0 -/* 010D4 808969C4 00000000 */ nop -/* 010D8 808969C8 45020008 */ bc1fl .L808969EC -/* 010DC 808969CC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 010E0 808969D0 44805000 */ mtc1 $zero, $f10 ## $f10 = 0.00 -/* 010E4 808969D4 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 010E8 808969D8 E48A0150 */ swc1 $f10, 0x0150($a0) ## 00000150 -/* 010EC 808969DC 8C590680 */ lw $t9, 0x0680($v0) ## 00000680 -/* 010F0 808969E0 03214024 */ and $t0, $t9, $at -/* 010F4 808969E4 AC480680 */ sw $t0, 0x0680($v0) ## 00000680 -/* 010F8 808969E8 8FBF0014 */ lw $ra, 0x0014($sp) -.L808969EC: -/* 010FC 808969EC 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 01100 808969F0 03E00008 */ jr $ra -/* 01104 808969F4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808969F8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808969F8.s deleted file mode 100644 index ad81fe3ee1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808969F8.s +++ /dev/null @@ -1,55 +0,0 @@ -glabel func_808969F8 -/* 01108 808969F8 848600B6 */ lh $a2, 0x00B6($a0) ## 000000B6 -/* 0110C 808969FC 84980158 */ lh $t8, 0x0158($a0) ## 00000158 -/* 01110 80896A00 848F008A */ lh $t7, 0x008A($a0) ## 0000008A -/* 01114 80896A04 3C0E8089 */ lui $t6, %hi(func_80896ABC) ## $t6 = 80890000 -/* 01118 80896A08 00D83823 */ subu $a3, $a2, $t8 -/* 0111C 80896A0C 00073C00 */ sll $a3, $a3, 16 -/* 01120 80896A10 01E61823 */ subu $v1, $t7, $a2 -/* 01124 80896A14 8CA21C44 */ lw $v0, 0x1C44($a1) ## 00001C44 -/* 01128 80896A18 25CE6ABC */ addiu $t6, $t6, %lo(func_80896ABC) ## $t6 = 80896ABC -/* 0112C 80896A1C 00031C00 */ sll $v1, $v1, 16 -/* 01130 80896A20 00073C03 */ sra $a3, $a3, 16 -/* 01134 80896A24 AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -/* 01138 80896A28 04E10002 */ bgez $a3, .L80896A34 -/* 0113C 80896A2C 00031C03 */ sra $v1, $v1, 16 -/* 01140 80896A30 00073823 */ subu $a3, $zero, $a3 -.L80896A34: -/* 01144 80896A34 18600009 */ blez $v1, .L80896A5C -/* 01148 80896A38 28E14001 */ slti $at, $a3, 0x4001 -/* 0114C 80896A3C 28E14001 */ slti $at, $a3, 0x4001 -/* 01150 80896A40 14200004 */ bne $at, $zero, .L80896A54 -/* 01154 80896A44 2408FFFF */ addiu $t0, $zero, 0xFFFF ## $t0 = FFFFFFFF -/* 01158 80896A48 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 0115C 80896A4C 10000009 */ beq $zero, $zero, .L80896A74 -/* 01160 80896A50 A499016A */ sh $t9, 0x016A($a0) ## 0000016A -.L80896A54: -/* 01164 80896A54 10000007 */ beq $zero, $zero, .L80896A74 -/* 01168 80896A58 A488016A */ sh $t0, 0x016A($a0) ## 0000016A -.L80896A5C: -/* 0116C 80896A5C 14200004 */ bne $at, $zero, .L80896A70 -/* 01170 80896A60 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 01174 80896A64 2409FFFF */ addiu $t1, $zero, 0xFFFF ## $t1 = FFFFFFFF -/* 01178 80896A68 10000002 */ beq $zero, $zero, .L80896A74 -/* 0117C 80896A6C A489016A */ sh $t1, 0x016A($a0) ## 0000016A -.L80896A70: -/* 01180 80896A70 A48A016A */ sh $t2, 0x016A($a0) ## 0000016A -.L80896A74: -/* 01184 80896A74 C4440024 */ lwc1 $f4, 0x0024($v0) ## 00000024 -/* 01188 80896A78 C4860024 */ lwc1 $f6, 0x0024($a0) ## 00000024 -/* 0118C 80896A7C C4900028 */ lwc1 $f16, 0x0028($a0) ## 00000028 -/* 01190 80896A80 240C0001 */ addiu $t4, $zero, 0x0001 ## $t4 = 00000001 -/* 01194 80896A84 46062201 */ sub.s $f8, $f4, $f6 -/* 01198 80896A88 C486002C */ lwc1 $f6, 0x002C($a0) ## 0000002C -/* 0119C 80896A8C E4880174 */ swc1 $f8, 0x0174($a0) ## 00000174 -/* 011A0 80896A90 C44A0028 */ lwc1 $f10, 0x0028($v0) ## 00000028 -/* 011A4 80896A94 46105481 */ sub.s $f18, $f10, $f16 -/* 011A8 80896A98 E4920178 */ swc1 $f18, 0x0178($a0) ## 00000178 -/* 011AC 80896A9C C444002C */ lwc1 $f4, 0x002C($v0) ## 0000002C -/* 011B0 80896AA0 A480016E */ sh $zero, 0x016E($a0) ## 0000016E -/* 011B4 80896AA4 848B016E */ lh $t3, 0x016E($a0) ## 0000016E -/* 011B8 80896AA8 46062201 */ sub.s $f8, $f4, $f6 -/* 011BC 80896AAC A08C0172 */ sb $t4, 0x0172($a0) ## 00000172 -/* 011C0 80896AB0 A48B0170 */ sh $t3, 0x0170($a0) ## 00000170 -/* 011C4 80896AB4 03E00008 */ jr $ra -/* 011C8 80896AB8 E488017C */ swc1 $f8, 0x017C($a0) ## 0000017C diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896ABC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896ABC.s deleted file mode 100644 index 61a132dc08..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896ABC.s +++ /dev/null @@ -1,115 +0,0 @@ -.late_rodata -glabel D_8089773C - .float 0.001 - -.text -glabel func_80896ABC -/* 011CC 80896ABC 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 011D0 80896AC0 AFBF001C */ sw $ra, 0x001C($sp) -/* 011D4 80896AC4 AFB00018 */ sw $s0, 0x0018($sp) -/* 011D8 80896AC8 AFA5002C */ sw $a1, 0x002C($sp) -/* 011DC 80896ACC 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 -/* 011E0 80896AD0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 011E4 80896AD4 24050015 */ addiu $a1, $zero, 0x0015 ## $a1 = 00000015 -/* 011E8 80896AD8 AFAF0020 */ sw $t7, 0x0020($sp) -/* 011EC 80896ADC 8498016C */ lh $t8, 0x016C($a0) ## 0000016C -/* 011F0 80896AE0 84880016 */ lh $t0, 0x0016($a0) ## 00000016 -/* 011F4 80896AE4 848C0032 */ lh $t4, 0x0032($a0) ## 00000032 -/* 011F8 80896AE8 0018CB40 */ sll $t9, $t8, 13 -/* 011FC 80896AEC 03285821 */ addu $t3, $t9, $t0 -/* 01200 80896AF0 016C1023 */ subu $v0, $t3, $t4 -/* 01204 80896AF4 00021400 */ sll $v0, $v0, 16 -/* 01208 80896AF8 00021403 */ sra $v0, $v0, 16 -/* 0120C 80896AFC 04400003 */ bltz $v0, .L80896B0C -/* 01210 80896B00 00021823 */ subu $v1, $zero, $v0 -/* 01214 80896B04 10000001 */ beq $zero, $zero, .L80896B0C -/* 01218 80896B08 00401825 */ or $v1, $v0, $zero ## $v1 = 00000000 -.L80896B0C: -/* 0121C 80896B0C 28611D00 */ slti $at, $v1, 0x1D00 -/* 01220 80896B10 10200007 */ beq $at, $zero, .L80896B30 -/* 01224 80896B14 2604016E */ addiu $a0, $s0, 0x016E ## $a0 = 0000016E -/* 01228 80896B18 2604016E */ addiu $a0, $s0, 0x016E ## $a0 = 0000016E -/* 0122C 80896B1C 2405006A */ addiu $a1, $zero, 0x006A ## $a1 = 0000006A -/* 01230 80896B20 0C01DE5F */ jal Math_StepToS - -/* 01234 80896B24 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 01238 80896B28 10000004 */ beq $zero, $zero, .L80896B3C -/* 0123C 80896B2C 8605016A */ lh $a1, 0x016A($s0) ## 0000016A -.L80896B30: -/* 01240 80896B30 0C01DE5F */ jal Math_StepToS - -/* 01244 80896B34 2406000A */ addiu $a2, $zero, 0x000A ## $a2 = 0000000A -/* 01248 80896B38 8605016A */ lh $a1, 0x016A($s0) ## 0000016A -.L80896B3C: -/* 0124C 80896B3C 26040170 */ addiu $a0, $s0, 0x0170 ## $a0 = 00000170 -/* 01250 80896B40 8606016E */ lh $a2, 0x016E($s0) ## 0000016E -/* 01254 80896B44 00052B40 */ sll $a1, $a1, 13 -/* 01258 80896B48 00052C00 */ sll $a1, $a1, 16 -/* 0125C 80896B4C 0C01DE2B */ jal Math_ScaledStepToS - -/* 01260 80896B50 00052C03 */ sra $a1, $a1, 16 -/* 01264 80896B54 50400013 */ beql $v0, $zero, .L80896BA4 -/* 01268 80896B58 8609016C */ lh $t1, 0x016C($s0) ## 0000016C -/* 0126C 80896B5C 860D016C */ lh $t5, 0x016C($s0) ## 0000016C -/* 01270 80896B60 860E016A */ lh $t6, 0x016A($s0) ## 0000016A -/* 01274 80896B64 8FA20020 */ lw $v0, 0x0020($sp) -/* 01278 80896B68 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 0127C 80896B6C 01AE7821 */ addu $t7, $t5, $t6 -/* 01280 80896B70 31F80007 */ andi $t8, $t7, 0x0007 ## $t8 = 00000000 -/* 01284 80896B74 A618016C */ sh $t8, 0x016C($s0) ## 0000016C -/* 01288 80896B78 8C590680 */ lw $t9, 0x0680($v0) ## 00000680 -/* 0128C 80896B7C 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 01290 80896B80 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01294 80896B84 03214024 */ and $t0, $t9, $at -/* 01298 80896B88 AC480680 */ sw $t0, 0x0680($v0) ## 00000680 -/* 0129C 80896B8C E6040150 */ swc1 $f4, 0x0150($s0) ## 00000150 -/* 012A0 80896B90 0C225A46 */ jal func_80896918 -/* 012A4 80896B94 8FA5002C */ lw $a1, 0x002C($sp) -/* 012A8 80896B98 1000000C */ beq $zero, $zero, .L80896BCC -/* 012AC 80896B9C 8FAE0020 */ lw $t6, 0x0020($sp) -/* 012B0 80896BA0 8609016C */ lh $t1, 0x016C($s0) ## 0000016C -.L80896BA4: -/* 012B4 80896BA4 860B0016 */ lh $t3, 0x0016($s0) ## 00000016 -/* 012B8 80896BA8 860D0170 */ lh $t5, 0x0170($s0) ## 00000170 -/* 012BC 80896BAC 00095340 */ sll $t2, $t1, 13 -/* 012C0 80896BB0 014B6021 */ addu $t4, $t2, $t3 -/* 012C4 80896BB4 018D1021 */ addu $v0, $t4, $t5 -/* 012C8 80896BB8 00021400 */ sll $v0, $v0, 16 -/* 012CC 80896BBC 00021403 */ sra $v0, $v0, 16 -/* 012D0 80896BC0 A6020032 */ sh $v0, 0x0032($s0) ## 00000032 -/* 012D4 80896BC4 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 -/* 012D8 80896BC8 8FAE0020 */ lw $t6, 0x0020($sp) -.L80896BCC: -/* 012DC 80896BCC 8DCF0680 */ lw $t7, 0x0680($t6) ## 00000680 -/* 012E0 80896BD0 31F80010 */ andi $t8, $t7, 0x0010 ## $t8 = 00000000 -/* 012E4 80896BD4 5300000A */ beql $t8, $zero, .L80896C00 -/* 012E8 80896BD8 C6000150 */ lwc1 $f0, 0x0150($s0) ## 00000150 -/* 012EC 80896BDC 92190172 */ lbu $t9, 0x0172($s0) ## 00000172 -/* 012F0 80896BE0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 012F4 80896BE4 5320000F */ beql $t9, $zero, .L80896C24 -/* 012F8 80896BE8 44804000 */ mtc1 $zero, $f8 ## $f8 = 0.00 -/* 012FC 80896BEC 0C2256FB */ jal func_80895BEC -/* 01300 80896BF0 8FA5002C */ lw $a1, 0x002C($sp) -/* 01304 80896BF4 1000000B */ beq $zero, $zero, .L80896C24 -/* 01308 80896BF8 44804000 */ mtc1 $zero, $f8 ## $f8 = 0.00 -/* 0130C 80896BFC C6000150 */ lwc1 $f0, 0x0150($s0) ## 00000150 -.L80896C00: -/* 01310 80896C00 3C018089 */ lui $at, %hi(D_8089773C) ## $at = 80890000 -/* 01314 80896C04 C426773C */ lwc1 $f6, %lo(D_8089773C)($at) -/* 01318 80896C08 46000005 */ abs.s $f0, $f0 -/* 0131C 80896C0C 4606003C */ c.lt.s $f0, $f6 -/* 01320 80896C10 00000000 */ nop -/* 01324 80896C14 45020003 */ bc1fl .L80896C24 -/* 01328 80896C18 44804000 */ mtc1 $zero, $f8 ## $f8 = 0.00 -/* 0132C 80896C1C A2000172 */ sb $zero, 0x0172($s0) ## 00000172 -/* 01330 80896C20 44804000 */ mtc1 $zero, $f8 ## $f8 = 0.00 -.L80896C24: -/* 01334 80896C24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01338 80896C28 2405200A */ addiu $a1, $zero, 0x200A ## $a1 = 0000200A -/* 0133C 80896C2C 0C00BE5D */ jal func_8002F974 -/* 01340 80896C30 E6080150 */ swc1 $f8, 0x0150($s0) ## 00000150 -/* 01344 80896C34 8FBF001C */ lw $ra, 0x001C($sp) -/* 01348 80896C38 8FB00018 */ lw $s0, 0x0018($sp) -/* 0134C 80896C3C 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 01350 80896C40 03E00008 */ jr $ra -/* 01354 80896C44 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896CB4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896CB4.s deleted file mode 100644 index 0105883b8b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896CB4.s +++ /dev/null @@ -1,64 +0,0 @@ -.rdata -glabel D_80897648 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_8089765C - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_80897670 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -.text -glabel func_80896CB4 -/* 013C4 80896CB4 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 013C8 80896CB8 AFBF001C */ sw $ra, 0x001C($sp) -/* 013CC 80896CBC AFB00018 */ sw $s0, 0x0018($sp) -/* 013D0 80896CC0 AFA40040 */ sw $a0, 0x0040($sp) -/* 013D4 80896CC4 8C850000 */ lw $a1, 0x0000($a0) ## 00000000 -/* 013D8 80896CC8 3C068089 */ lui $a2, %hi(D_80897648) ## $a2 = 80890000 -/* 013DC 80896CCC 24C67648 */ addiu $a2, $a2, %lo(D_80897648) ## $a2 = 80897648 -/* 013E0 80896CD0 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFEC -/* 013E4 80896CD4 24070360 */ addiu $a3, $zero, 0x0360 ## $a3 = 00000360 -/* 013E8 80896CD8 0C031AB1 */ jal Graph_OpenDisps -/* 013EC 80896CDC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 013F0 80896CE0 8FAF0040 */ lw $t7, 0x0040($sp) -/* 013F4 80896CE4 0C024F61 */ jal func_80093D84 -/* 013F8 80896CE8 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 013FC 80896CEC 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 01400 80896CF0 3C19DA38 */ lui $t9, 0xDA38 ## $t9 = DA380000 -/* 01404 80896CF4 37390003 */ ori $t9, $t9, 0x0003 ## $t9 = DA380003 -/* 01408 80896CF8 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 0140C 80896CFC AE1802D0 */ sw $t8, 0x02D0($s0) ## 000002D0 -/* 01410 80896D00 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 01414 80896D04 8FA80040 */ lw $t0, 0x0040($sp) -/* 01418 80896D08 3C058089 */ lui $a1, %hi(D_8089765C) ## $a1 = 80890000 -/* 0141C 80896D0C 24A5765C */ addiu $a1, $a1, %lo(D_8089765C) ## $a1 = 8089765C -/* 01420 80896D10 8D040000 */ lw $a0, 0x0000($t0) ## 00000000 -/* 01424 80896D14 24060363 */ addiu $a2, $zero, 0x0363 ## $a2 = 00000363 -/* 01428 80896D18 0C0346A2 */ jal Matrix_NewMtx -/* 0142C 80896D1C AFA20028 */ sw $v0, 0x0028($sp) -/* 01430 80896D20 8FA30028 */ lw $v1, 0x0028($sp) -/* 01434 80896D24 3C0B0601 */ lui $t3, %hi(D_06010C20) ## $t3 = 06010000 -/* 01438 80896D28 256B0C20 */ addiu $t3, $t3, %lo(D_06010C20) ## $t3 = 06010C20 -/* 0143C 80896D2C AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 01440 80896D30 8E0202D0 */ lw $v0, 0x02D0($s0) ## 000002D0 -/* 01444 80896D34 3C0ADE00 */ lui $t2, 0xDE00 ## $t2 = DE000000 -/* 01448 80896D38 3C068089 */ lui $a2, %hi(D_80897670) ## $a2 = 80890000 -/* 0144C 80896D3C 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 01450 80896D40 AE0902D0 */ sw $t1, 0x02D0($s0) ## 000002D0 -/* 01454 80896D44 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004 -/* 01458 80896D48 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000 -/* 0145C 80896D4C 8FAC0040 */ lw $t4, 0x0040($sp) -/* 01460 80896D50 24C67670 */ addiu $a2, $a2, %lo(D_80897670) ## $a2 = 80897670 -/* 01464 80896D54 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFEC -/* 01468 80896D58 24070368 */ addiu $a3, $zero, 0x0368 ## $a3 = 00000368 -/* 0146C 80896D5C 0C031AD5 */ jal Graph_CloseDisps -/* 01470 80896D60 8D850000 */ lw $a1, 0x0000($t4) ## 00000000 -/* 01474 80896D64 8FBF001C */ lw $ra, 0x001C($sp) -/* 01478 80896D68 8FB00018 */ lw $s0, 0x0018($sp) -/* 0147C 80896D6C 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 01480 80896D70 03E00008 */ jr $ra -/* 01484 80896D74 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896D78.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896D78.s deleted file mode 100644 index 25fc3813e8..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896D78.s +++ /dev/null @@ -1,110 +0,0 @@ -.rdata -glabel D_80897684 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_80897698 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_808976AC - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -.late_rodata -glabel D_80897740 - .float 0.1 - -.text -glabel func_80896D78 -/* 01488 80896D78 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 0148C 80896D7C AFBF001C */ sw $ra, 0x001C($sp) -/* 01490 80896D80 AFB10018 */ sw $s1, 0x0018($sp) -/* 01494 80896D84 AFB00014 */ sw $s0, 0x0014($sp) -/* 01498 80896D88 AFA50054 */ sw $a1, 0x0054($sp) -/* 0149C 80896D8C 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 014A0 80896D90 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 014A4 80896D94 3C068089 */ lui $a2, %hi(D_80897684) ## $a2 = 80890000 -/* 014A8 80896D98 24C67684 */ addiu $a2, $a2, %lo(D_80897684) ## $a2 = 80897684 -/* 014AC 80896D9C 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE0 -/* 014B0 80896DA0 2407039C */ addiu $a3, $zero, 0x039C ## $a3 = 0000039C -/* 014B4 80896DA4 0C031AB1 */ jal Graph_OpenDisps -/* 014B8 80896DA8 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 014BC 80896DAC 8FAF0054 */ lw $t7, 0x0054($sp) -/* 014C0 80896DB0 0C024F61 */ jal func_80093D84 -/* 014C4 80896DB4 8DE40000 */ lw $a0, 0x0000($t7) ## 00000000 -/* 014C8 80896DB8 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 014CC 80896DBC 3C098089 */ lui $t1, %hi(D_80897308) ## $t1 = 80890000 -/* 014D0 80896DC0 860A00B4 */ lh $t2, 0x00B4($s0) ## 000000B4 -/* 014D4 80896DC4 33190003 */ andi $t9, $t8, 0x0003 ## $t9 = 00000000 -/* 014D8 80896DC8 00194040 */ sll $t0, $t9, 1 -/* 014DC 80896DCC 01284821 */ addu $t1, $t1, $t0 -/* 014E0 80896DD0 85297308 */ lh $t1, %lo(D_80897308)($t1) -/* 014E4 80896DD4 27A70044 */ addiu $a3, $sp, 0x0044 ## $a3 = FFFFFFF4 -/* 014E8 80896DD8 012A5821 */ addu $t3, $t1, $t2 -/* 014EC 80896DDC A7AB0044 */ sh $t3, 0x0044($sp) -/* 014F0 80896DE0 860C00B6 */ lh $t4, 0x00B6($s0) ## 000000B6 -/* 014F4 80896DE4 A7AC0046 */ sh $t4, 0x0046($sp) -/* 014F8 80896DE8 860D00B8 */ lh $t5, 0x00B8($s0) ## 000000B8 -/* 014FC 80896DEC A7AD0048 */ sh $t5, 0x0048($sp) -/* 01500 80896DF0 8E060188 */ lw $a2, 0x0188($s0) ## 00000188 -/* 01504 80896DF4 C60E0184 */ lwc1 $f14, 0x0184($s0) ## 00000184 -/* 01508 80896DF8 0C0345A5 */ jal func_800D1694 -/* 0150C 80896DFC C60C0180 */ lwc1 $f12, 0x0180($s0) ## 00000180 -/* 01510 80896E00 3C018089 */ lui $at, %hi(D_80897740) ## $at = 80890000 -/* 01514 80896E04 C42C7740 */ lwc1 $f12, %lo(D_80897740)($at) -/* 01518 80896E08 8E060190 */ lw $a2, 0x0190($s0) ## 00000190 -/* 0151C 80896E0C 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 01520 80896E10 0C0342A3 */ jal Matrix_Scale -/* 01524 80896E14 46006386 */ mov.s $f14, $f12 -/* 01528 80896E18 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 0152C 80896E1C 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000 -/* 01530 80896E20 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003 -/* 01534 80896E24 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 01538 80896E28 AE2E02D0 */ sw $t6, 0x02D0($s1) ## 000002D0 -/* 0153C 80896E2C AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 01540 80896E30 8FB80054 */ lw $t8, 0x0054($sp) -/* 01544 80896E34 3C058089 */ lui $a1, %hi(D_80897698) ## $a1 = 80890000 -/* 01548 80896E38 24A57698 */ addiu $a1, $a1, %lo(D_80897698) ## $a1 = 80897698 -/* 0154C 80896E3C 8F040000 */ lw $a0, 0x0000($t8) ## 00000000 -/* 01550 80896E40 240603AB */ addiu $a2, $zero, 0x03AB ## $a2 = 000003AB -/* 01554 80896E44 0C0346A2 */ jal Matrix_NewMtx -/* 01558 80896E48 AFA2002C */ sw $v0, 0x002C($sp) -/* 0155C 80896E4C 8FA3002C */ lw $v1, 0x002C($sp) -/* 01560 80896E50 3C08FA00 */ lui $t0, 0xFA00 ## $t0 = FA000000 -/* 01564 80896E54 3C01430C */ lui $at, 0x430C ## $at = 430C0000 -/* 01568 80896E58 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 0156C 80896E5C 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 01570 80896E60 44813000 */ mtc1 $at, $f6 ## $f6 = 140.00 -/* 01574 80896E64 2401FF00 */ addiu $at, $zero, 0xFF00 ## $at = FFFFFF00 -/* 01578 80896E68 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008 -/* 0157C 80896E6C AE3902D0 */ sw $t9, 0x02D0($s1) ## 000002D0 -/* 01580 80896E70 AC480000 */ sw $t0, 0x0000($v0) ## 00000000 -/* 01584 80896E74 C604018C */ lwc1 $f4, 0x018C($s0) ## 0000018C -/* 01588 80896E78 3C0F0601 */ lui $t7, %hi(D_060117D0) ## $t7 = 06010000 -/* 0158C 80896E7C 25EF17D0 */ addiu $t7, $t7, %lo(D_060117D0) ## $t7 = 060117D0 -/* 01590 80896E80 46062202 */ mul.s $f8, $f4, $f6 -/* 01594 80896E84 3C0EDE00 */ lui $t6, 0xDE00 ## $t6 = DE000000 -/* 01598 80896E88 3C068089 */ lui $a2, %hi(D_808976AC) ## $a2 = 80890000 -/* 0159C 80896E8C 24C676AC */ addiu $a2, $a2, %lo(D_808976AC) ## $a2 = 808976AC -/* 015A0 80896E90 27A40030 */ addiu $a0, $sp, 0x0030 ## $a0 = FFFFFFE0 -/* 015A4 80896E94 240703B3 */ addiu $a3, $zero, 0x03B3 ## $a3 = 000003B3 -/* 015A8 80896E98 4600428D */ trunc.w.s $f10, $f8 -/* 015AC 80896E9C 440A5000 */ mfc1 $t2, $f10 -/* 015B0 80896EA0 00000000 */ nop -/* 015B4 80896EA4 314B00FF */ andi $t3, $t2, 0x00FF ## $t3 = 00000000 -/* 015B8 80896EA8 01616025 */ or $t4, $t3, $at ## $t4 = FFFFFF00 -/* 015BC 80896EAC AC4C0004 */ sw $t4, 0x0004($v0) ## 00000004 -/* 015C0 80896EB0 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 015C4 80896EB4 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 015C8 80896EB8 AE2D02D0 */ sw $t5, 0x02D0($s1) ## 000002D0 -/* 015CC 80896EBC AC4F0004 */ sw $t7, 0x0004($v0) ## 00000004 -/* 015D0 80896EC0 AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 015D4 80896EC4 8FB80054 */ lw $t8, 0x0054($sp) -/* 015D8 80896EC8 0C031AD5 */ jal Graph_CloseDisps -/* 015DC 80896ECC 8F050000 */ lw $a1, 0x0000($t8) ## 00000000 -/* 015E0 80896ED0 8FBF001C */ lw $ra, 0x001C($sp) -/* 015E4 80896ED4 8FB00014 */ lw $s0, 0x0014($sp) -/* 015E8 80896ED8 8FB10018 */ lw $s1, 0x0018($sp) -/* 015EC 80896EDC 03E00008 */ jr $ra -/* 015F0 80896EE0 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896EE4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896EE4.s deleted file mode 100644 index 45ece79032..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896EE4.s +++ /dev/null @@ -1,196 +0,0 @@ -.rdata -glabel D_808976C0 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_808976D4 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -glabel D_808976E8 - .asciz "../z_bg_jya_cobra.c" - .balign 4 - -.text -glabel func_80896EE4 -/* 015F4 80896EE4 27BDFF88 */ addiu $sp, $sp, 0xFF88 ## $sp = FFFFFF88 -/* 015F8 80896EE8 AFBF001C */ sw $ra, 0x001C($sp) -/* 015FC 80896EEC AFB00018 */ sw $s0, 0x0018($sp) -/* 01600 80896EF0 AFA5007C */ sw $a1, 0x007C($sp) -/* 01604 80896EF4 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 01608 80896EF8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0160C 80896EFC 3C068089 */ lui $a2, %hi(D_808976C0) ## $a2 = 80890000 -/* 01610 80896F00 31CF0003 */ andi $t7, $t6, 0x0003 ## $t7 = 00000000 -/* 01614 80896F04 A7AF0072 */ sh $t7, 0x0072($sp) -/* 01618 80896F08 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 0161C 80896F0C 24C676C0 */ addiu $a2, $a2, %lo(D_808976C0) ## $a2 = 808976C0 -/* 01620 80896F10 27A4004C */ addiu $a0, $sp, 0x004C ## $a0 = FFFFFFD4 -/* 01624 80896F14 240703C6 */ addiu $a3, $zero, 0x03C6 ## $a3 = 000003C6 -/* 01628 80896F18 0C031AB1 */ jal Graph_OpenDisps -/* 0162C 80896F1C AFA5005C */ sw $a1, 0x005C($sp) -/* 01630 80896F20 8FB9007C */ lw $t9, 0x007C($sp) -/* 01634 80896F24 0C025011 */ jal func_80094044 -/* 01638 80896F28 8F240000 */ lw $a0, 0x0000($t9) ## 00000000 -/* 0163C 80896F2C 87A90072 */ lh $t1, 0x0072($sp) -/* 01640 80896F30 8FA8005C */ lw $t0, 0x005C($sp) -/* 01644 80896F34 87AA0072 */ lh $t2, 0x0072($sp) -/* 01648 80896F38 1520000D */ bne $t1, $zero, .L80896F70 -/* 0164C 80896F3C 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 01650 80896F40 3C014248 */ lui $at, 0x4248 ## $at = 42480000 -/* 01654 80896F44 44813000 */ mtc1 $at, $f6 ## $f6 = 50.00 -/* 01658 80896F48 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 0165C 80896F4C 3C078089 */ lui $a3, %hi(D_80897538) ## $a3 = 80890000 -/* 01660 80896F50 24E77538 */ addiu $a3, $a3, %lo(D_80897538) ## $a3 = 80897538 -/* 01664 80896F54 46062201 */ sub.s $f8, $f4, $f6 -/* 01668 80896F58 E7A80064 */ swc1 $f8, 0x0064($sp) -/* 0166C 80896F5C C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 01670 80896F60 E7AA0068 */ swc1 $f10, 0x0068($sp) -/* 01674 80896F64 C610002C */ lwc1 $f16, 0x002C($s0) ## 0000002C -/* 01678 80896F68 10000016 */ beq $zero, $zero, .L80896FC4 -/* 0167C 80896F6C E7B0006C */ swc1 $f16, 0x006C($sp) -.L80896F70: -/* 01680 80896F70 1541000D */ bne $t2, $at, .L80896FA8 -/* 01684 80896F74 260700B4 */ addiu $a3, $s0, 0x00B4 ## $a3 = 000000B4 -/* 01688 80896F78 3C01428C */ lui $at, 0x428C ## $at = 428C0000 -/* 0168C 80896F7C 44812000 */ mtc1 $at, $f4 ## $f4 = 70.00 -/* 01690 80896F80 C6120024 */ lwc1 $f18, 0x0024($s0) ## 00000024 -/* 01694 80896F84 3C078089 */ lui $a3, %hi(D_80897540) ## $a3 = 80890000 -/* 01698 80896F88 24E77540 */ addiu $a3, $a3, %lo(D_80897540) ## $a3 = 80897540 -/* 0169C 80896F8C 46049180 */ add.s $f6, $f18, $f4 -/* 016A0 80896F90 E7A60064 */ swc1 $f6, 0x0064($sp) -/* 016A4 80896F94 C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 016A8 80896F98 E7A80068 */ swc1 $f8, 0x0068($sp) -/* 016AC 80896F9C C60A002C */ lwc1 $f10, 0x002C($s0) ## 0000002C -/* 016B0 80896FA0 10000008 */ beq $zero, $zero, .L80896FC4 -/* 016B4 80896FA4 E7AA006C */ swc1 $f10, 0x006C($sp) -.L80896FA8: -/* 016B8 80896FA8 27A40064 */ addiu $a0, $sp, 0x0064 ## $a0 = FFFFFFEC -/* 016BC 80896FAC 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 -/* 016C0 80896FB0 AFA70060 */ sw $a3, 0x0060($sp) -/* 016C4 80896FB4 0C01DF90 */ jal Math_Vec3f_Copy - ## Vec3f_Copy -/* 016C8 80896FB8 AFA8005C */ sw $t0, 0x005C($sp) -/* 016CC 80896FBC 8FA70060 */ lw $a3, 0x0060($sp) -/* 016D0 80896FC0 8FA8005C */ lw $t0, 0x005C($sp) -.L80896FC4: -/* 016D4 80896FC4 C7AC0064 */ lwc1 $f12, 0x0064($sp) -/* 016D8 80896FC8 C7AE0068 */ lwc1 $f14, 0x0068($sp) -/* 016DC 80896FCC 8FA6006C */ lw $a2, 0x006C($sp) -/* 016E0 80896FD0 0C0345A5 */ jal func_800D1694 -/* 016E4 80896FD4 AFA8005C */ sw $t0, 0x005C($sp) -/* 016E8 80896FD8 87AB0072 */ lh $t3, 0x0072($sp) -/* 016EC 80896FDC 3C0D8089 */ lui $t5, %hi(D_80897548) ## $t5 = 80890000 -/* 016F0 80896FE0 25AD7548 */ addiu $t5, $t5, %lo(D_80897548) ## $t5 = 80897548 -/* 016F4 80896FE4 000B6080 */ sll $t4, $t3, 2 -/* 016F8 80896FE8 018B6023 */ subu $t4, $t4, $t3 -/* 016FC 80896FEC 000C6080 */ sll $t4, $t4, 2 -/* 01700 80896FF0 018D1021 */ addu $v0, $t4, $t5 -/* 01704 80896FF4 C44C0000 */ lwc1 $f12, 0x0000($v0) ## 00000000 -/* 01708 80896FF8 C44E0004 */ lwc1 $f14, 0x0004($v0) ## 00000004 -/* 0170C 80896FFC 8C460008 */ lw $a2, 0x0008($v0) ## 00000008 -/* 01710 80897000 0C0342A3 */ jal Matrix_Scale -/* 01714 80897004 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 01718 80897008 44806000 */ mtc1 $zero, $f12 ## $f12 = 0.00 -/* 0171C 8089700C 3C064220 */ lui $a2, 0x4220 ## $a2 = 42200000 -/* 01720 80897010 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 01724 80897014 0C034261 */ jal Matrix_Translate -/* 01728 80897018 46006386 */ mov.s $f14, $f12 -/* 0172C 8089701C 8FA8005C */ lw $t0, 0x005C($sp) -/* 01730 80897020 3C0FFA00 */ lui $t7, 0xFA00 ## $t7 = FA000000 -/* 01734 80897024 24180078 */ addiu $t8, $zero, 0x0078 ## $t8 = 00000078 -/* 01738 80897028 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 0173C 8089702C 3C09DA38 */ lui $t1, 0xDA38 ## $t1 = DA380000 -/* 01740 80897030 35290003 */ ori $t1, $t1, 0x0003 ## $t1 = DA380003 -/* 01744 80897034 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 01748 80897038 AD0E02D0 */ sw $t6, 0x02D0($t0) ## 000002D0 -/* 0174C 8089703C AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 01750 80897040 AC580004 */ sw $t8, 0x0004($v0) ## 00000004 -/* 01754 80897044 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 01758 80897048 3C058089 */ lui $a1, %hi(D_808976D4) ## $a1 = 80890000 -/* 0175C 8089704C 24A576D4 */ addiu $a1, $a1, %lo(D_808976D4) ## $a1 = 808976D4 -/* 01760 80897050 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008 -/* 01764 80897054 AD1902D0 */ sw $t9, 0x02D0($t0) ## 000002D0 -/* 01768 80897058 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -/* 0176C 8089705C 8FAA007C */ lw $t2, 0x007C($sp) -/* 01770 80897060 240603E2 */ addiu $a2, $zero, 0x03E2 ## $a2 = 000003E2 -/* 01774 80897064 8D440000 */ lw $a0, 0x0000($t2) ## 00000000 -/* 01778 80897068 AFA8005C */ sw $t0, 0x005C($sp) -/* 0177C 8089706C 0C0346A2 */ jal Matrix_NewMtx -/* 01780 80897070 AFA20044 */ sw $v0, 0x0044($sp) -/* 01784 80897074 8FA30044 */ lw $v1, 0x0044($sp) -/* 01788 80897078 8FA8005C */ lw $t0, 0x005C($sp) -/* 0178C 8089707C 260D01A3 */ addiu $t5, $s0, 0x01A3 ## $t5 = 000001A3 -/* 01790 80897080 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 01794 80897084 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 01798 80897088 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 0179C 8089708C 01A17024 */ and $t6, $t5, $at -/* 017A0 80897090 244B0008 */ addiu $t3, $v0, 0x0008 ## $t3 = 00000008 -/* 017A4 80897094 AD0B02D0 */ sw $t3, 0x02D0($t0) ## 000002D0 -/* 017A8 80897098 3C0CFD90 */ lui $t4, 0xFD90 ## $t4 = FD900000 -/* 017AC 8089709C AC4C0000 */ sw $t4, 0x0000($v0) ## 00000000 -/* 017B0 808970A0 AC4E0004 */ sw $t6, 0x0004($v0) ## 00000004 -/* 017B4 808970A4 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 017B8 808970A8 3C190708 */ lui $t9, 0x0708 ## $t9 = 07080000 -/* 017BC 808970AC 37390200 */ ori $t9, $t9, 0x0200 ## $t9 = 07080200 -/* 017C0 808970B0 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 017C4 808970B4 AD0F02D0 */ sw $t7, 0x02D0($t0) ## 000002D0 -/* 017C8 808970B8 3C18F590 */ lui $t8, 0xF590 ## $t8 = F5900000 -/* 017CC 808970BC AC580000 */ sw $t8, 0x0000($v0) ## 00000000 -/* 017D0 808970C0 AC590004 */ sw $t9, 0x0004($v0) ## 00000004 -/* 017D4 808970C4 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 017D8 808970C8 3C0AE600 */ lui $t2, 0xE600 ## $t2 = E6000000 -/* 017DC 808970CC 3C0D077F */ lui $t5, 0x077F ## $t5 = 077F0000 -/* 017E0 808970D0 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 017E4 808970D4 AD0902D0 */ sw $t1, 0x02D0($t0) ## 000002D0 -/* 017E8 808970D8 AC400004 */ sw $zero, 0x0004($v0) ## 00000004 -/* 017EC 808970DC AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000 -/* 017F0 808970E0 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 017F4 808970E4 35ADF100 */ ori $t5, $t5, 0xF100 ## $t5 = 077FF100 -/* 017F8 808970E8 3C0CF300 */ lui $t4, 0xF300 ## $t4 = F3000000 -/* 017FC 808970EC 244B0008 */ addiu $t3, $v0, 0x0008 ## $t3 = 00000008 -/* 01800 808970F0 AD0B02D0 */ sw $t3, 0x02D0($t0) ## 000002D0 -/* 01804 808970F4 AC4D0004 */ sw $t5, 0x0004($v0) ## 00000004 -/* 01808 808970F8 AC4C0000 */ sw $t4, 0x0000($v0) ## 00000000 -/* 0180C 808970FC 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 01810 80897100 3C0FE700 */ lui $t7, 0xE700 ## $t7 = E7000000 -/* 01814 80897104 3C090008 */ lui $t1, 0x0008 ## $t1 = 00080000 -/* 01818 80897108 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 0181C 8089710C AD0E02D0 */ sw $t6, 0x02D0($t0) ## 000002D0 -/* 01820 80897110 AC400004 */ sw $zero, 0x0004($v0) ## 00000004 -/* 01824 80897114 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 01828 80897118 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 0182C 8089711C 3C19F588 */ lui $t9, 0xF588 ## $t9 = F5880000 -/* 01830 80897120 37391000 */ ori $t9, $t9, 0x1000 ## $t9 = F5881000 -/* 01834 80897124 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 01838 80897128 AD1802D0 */ sw $t8, 0x02D0($t0) ## 000002D0 -/* 0183C 8089712C 35290200 */ ori $t1, $t1, 0x0200 ## $t1 = 00080200 -/* 01840 80897130 AC490004 */ sw $t1, 0x0004($v0) ## 00000004 -/* 01844 80897134 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 01848 80897138 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 0184C 8089713C 3C0C000F */ lui $t4, 0x000F ## $t4 = 000F0000 -/* 01850 80897140 358CC0FC */ ori $t4, $t4, 0xC0FC ## $t4 = 000FC0FC -/* 01854 80897144 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008 -/* 01858 80897148 AD0A02D0 */ sw $t2, 0x02D0($t0) ## 000002D0 -/* 0185C 8089714C 3C0BF200 */ lui $t3, 0xF200 ## $t3 = F2000000 -/* 01860 80897150 AC4B0000 */ sw $t3, 0x0000($v0) ## 00000000 -/* 01864 80897154 AC4C0004 */ sw $t4, 0x0004($v0) ## 00000004 -/* 01868 80897158 8D0202D0 */ lw $v0, 0x02D0($t0) ## 000002D0 -/* 0186C 8089715C 3C0F8089 */ lui $t7, %hi(D_808972B0) ## $t7 = 80890000 -/* 01870 80897160 25EF72B0 */ addiu $t7, $t7, %lo(D_808972B0) ## $t7 = 808972B0 -/* 01874 80897164 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 01878 80897168 AD0D02D0 */ sw $t5, 0x02D0($t0) ## 000002D0 -/* 0187C 8089716C 3C0EDE00 */ lui $t6, 0xDE00 ## $t6 = DE000000 -/* 01880 80897170 AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 01884 80897174 AC4F0004 */ sw $t7, 0x0004($v0) ## 00000004 -/* 01888 80897178 8FB8007C */ lw $t8, 0x007C($sp) -/* 0188C 8089717C 3C068089 */ lui $a2, %hi(D_808976E8) ## $a2 = 80890000 -/* 01890 80897180 24C676E8 */ addiu $a2, $a2, %lo(D_808976E8) ## $a2 = 808976E8 -/* 01894 80897184 27A4004C */ addiu $a0, $sp, 0x004C ## $a0 = FFFFFFD4 -/* 01898 80897188 240703EE */ addiu $a3, $zero, 0x03EE ## $a3 = 000003EE -/* 0189C 8089718C 0C031AD5 */ jal Graph_CloseDisps -/* 018A0 80897190 8F050000 */ lw $a1, 0x0000($t8) ## 00000008 -/* 018A4 80897194 8FBF001C */ lw $ra, 0x001C($sp) -/* 018A8 80897198 8FB00018 */ lw $s0, 0x0018($sp) -/* 018AC 8089719C 27BD0078 */ addiu $sp, $sp, 0x0078 ## $sp = 00000000 -/* 018B0 808971A0 03E00008 */ jr $ra -/* 018B4 808971A4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s index 9fd98be316..ac6be37c72 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s @@ -28,7 +28,7 @@ glabel func_808988A0 /* 00060 80898900 A4D801A8 */ sh $t8, 0x01A8($a2) ## 000001A8 /* 00064 80898904 A4D901AA */ sh $t9, 0x01AA($a2) ## 000001AA .L80898908: -/* 00068 80898908 0C0189B7 */ jal Collider_CylinderUpdate +/* 00068 80898908 0C0189B7 */ jal Collider_UpdateCylinder /* 0006C 8089890C 8FA50018 */ lw $a1, 0x0018($sp) /* 00070 80898910 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s index 6469b43717..0318629b3e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s @@ -64,7 +64,7 @@ glabel func_80898920 /* 00104 808989A4 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 /* 00108 808989A8 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 -/* 0010C 808989AC 0C00B69E */ jal func_8002DA78 +/* 0010C 808989AC 0C00B69E */ jal Actor_WorldYawTowardActor /* 00110 808989B0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00114 808989B4 820E02FF */ lb $t6, 0x02FF($s0) ## 000002FF /* 00118 808989B8 3C014120 */ lui $at, 0x4120 ## $at = 41200000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s index 1fa84454c2..425b2651f6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s @@ -64,7 +64,7 @@ glabel func_80898DB4 /* 00598 80898E38 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 /* 0059C 80898E3C 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 -/* 005A0 80898E40 0C00B69E */ jal func_8002DA78 +/* 005A0 80898E40 0C00B69E */ jal Actor_WorldYawTowardActor /* 005A4 80898E44 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 005A8 80898E48 820E02FF */ lb $t6, 0x02FF($s0) ## 000002FF /* 005AC 80898E4C 3C0140C0 */ lui $at, 0x40C0 ## $at = 40C00000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s index 454f8d3efe..2f9603b7ef 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s @@ -29,7 +29,7 @@ glabel func_8089E650 /* 00A78 8089E6A8 0C227842 */ jal func_8089E108 /* 00A7C 8089E6AC AFA30028 */ sw $v1, 0x0028($sp) /* 00A80 8089E6B0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A84 8089E6B4 0C00B6DB */ jal func_8002DB6C +/* 00A84 8089E6B4 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 00A88 8089E6B8 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 /* 00A8C 8089E6BC C6120068 */ lwc1 $f18, 0x0068($s0) ## 00000068 /* 00A90 8089E6C0 26040024 */ addiu $a0, $s0, 0x0024 ## $a0 = 00000024 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s index a820eb3c06..12e1727508 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s @@ -145,7 +145,7 @@ glabel L808AC824 /* 001C8 808AC828 8FA40034 */ lw $a0, 0x0034($sp) /* 001CC 808AC82C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 001D0 808AC830 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 001D4 808AC834 0C00CDD2 */ jal Actor_ChangeType +/* 001D4 808AC834 0C00CDD2 */ jal Actor_ChangeCategory /* 001D8 808AC838 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 001DC 808AC83C 3C19808B */ lui $t9, %hi(func_808ACC34) ## $t9 = 808B0000 @@ -173,7 +173,7 @@ glabel L808AC87C /* 0022C 808AC88C 8FA40034 */ lw $a0, 0x0034($sp) /* 00230 808AC890 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00234 808AC894 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 00238 808AC898 0C00CDD2 */ jal Actor_ChangeType +/* 00238 808AC898 0C00CDD2 */ jal Actor_ChangeCategory /* 0023C 808AC89C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00240 808AC8A0 3C0E808B */ lui $t6, %hi(func_808AD3D4) ## $t6 = 808B0000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s index f3f30a28c1..87c7963dbe 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s @@ -10,7 +10,7 @@ glabel func_808ACAFC /* 004B8 808ACB18 91C5016B */ lbu $a1, 0x016B($t6) ## 0000016B /* 004BC 808ACB1C 1040000A */ beq $v0, $zero, .L808ACB48 /* 004C0 808ACB20 8FA40018 */ lw $a0, 0x0018($sp) -/* 004C4 808ACB24 0C00B56E */ jal Actor_SetHeight +/* 004C4 808ACB24 0C00B56E */ jal Actor_SetFocus /* 004C8 808ACB28 3C054270 */ lui $a1, 0x4270 ## $a1 = 42700000 /* 004CC 808ACB2C 8FA4001C */ lw $a0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Destroy.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Destroy.s deleted file mode 100644 index 6787e1b5c5..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Destroy.s +++ /dev/null @@ -1,31 +0,0 @@ -glabel BgSpot06Objects_Destroy -/* 003DC 808AEB5C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 003E0 808AEB60 AFBF0014 */ sw $ra, 0x0014($sp) -/* 003E4 808AEB64 AFA5001C */ sw $a1, 0x001C($sp) -/* 003E8 808AEB68 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 003EC 808AEB6C 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 003F0 808AEB70 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 003F4 808AEB74 10400007 */ beq $v0, $zero, .L808AEB94 -/* 003F8 808AEB78 8FA4001C */ lw $a0, 0x001C($sp) -/* 003FC 808AEB7C 1041000A */ beq $v0, $at, .L808AEBA8 -/* 00400 808AEB80 24E50170 */ addiu $a1, $a3, 0x0170 ## $a1 = 00000170 -/* 00404 808AEB84 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00408 808AEB88 10410009 */ beq $v0, $at, .L808AEBB0 -/* 0040C 808AEB8C 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00410 808AEB90 14410007 */ bne $v0, $at, .L808AEBB0 -.L808AEB94: -/* 00414 808AEB94 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 00418 808AEB98 0C00FB56 */ jal DynaPoly_DeleteBgActor - ## DynaPoly_DeleteBgActor -/* 0041C 808AEB9C 8CE6014C */ lw $a2, 0x014C($a3) ## 0000014C -/* 00420 808AEBA0 10000004 */ beq $zero, $zero, .L808AEBB4 -/* 00424 808AEBA4 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AEBA8: -/* 00428 808AEBA8 0C016F32 */ jal Collider_DestroyJntSph -/* 0042C 808AEBAC 8FA4001C */ lw $a0, 0x001C($sp) -.L808AEBB0: -/* 00430 808AEBB0 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AEBB4: -/* 00434 808AEBB4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00438 808AEBB8 03E00008 */ jr $ra -/* 0043C 808AEBBC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s deleted file mode 100644 index 085f95bde1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s +++ /dev/null @@ -1,58 +0,0 @@ -glabel BgSpot06Objects_Draw -/* 00FB8 808AF738 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00FBC 808AF73C AFBF0014 */ sw $ra, 0x0014($sp) -/* 00FC0 808AF740 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 00FC4 808AF744 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00FC8 808AF748 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000 -/* 00FCC 808AF74C 1040000C */ beq $v0, $zero, .L808AF780 -/* 00FD0 808AF750 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00FD4 808AF754 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00FD8 808AF758 1041000E */ beq $v0, $at, .L808AF794 -/* 00FDC 808AF75C 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00FE0 808AF760 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00FE4 808AF764 1041001A */ beq $v0, $at, .L808AF7D0 -/* 00FE8 808AF768 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 -/* 00FEC 808AF76C 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00FF0 808AF770 1041001B */ beq $v0, $at, .L808AF7E0 -/* 00FF4 808AF774 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00FF8 808AF778 1000001D */ beq $zero, $zero, .L808AF7F0 -/* 00FFC 808AF77C 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AF780: -/* 01000 808AF780 3C050600 */ lui $a1, %hi(D_06000E10) ## $a1 = 06000000 -/* 01004 808AF784 0C00D498 */ jal Gfx_DrawDListOpa - -/* 01008 808AF788 24A50E10 */ addiu $a1, $a1, %lo(D_06000E10) ## $a1 = 06000E10 -/* 0100C 808AF78C 10000018 */ beq $zero, $zero, .L808AF7F0 -/* 01010 808AF790 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AF794: -/* 01014 808AF794 3C050600 */ lui $a1, %hi(D_06002490) ## $a1 = 06000000 -/* 01018 808AF798 24A52490 */ addiu $a1, $a1, %lo(D_06002490) ## $a1 = 06002490 -/* 0101C 808AF79C 0C00D498 */ jal Gfx_DrawDListOpa - -/* 01020 808AF7A0 AFA60018 */ sw $a2, 0x0018($sp) -/* 01024 808AF7A4 8FA60018 */ lw $a2, 0x0018($sp) -/* 01028 808AF7A8 3C0E808B */ lui $t6, %hi(func_808AF1D8) ## $t6 = 808B0000 -/* 0102C 808AF7AC 25CEF1D8 */ addiu $t6, $t6, %lo(func_808AF1D8) ## $t6 = 808AF1D8 -/* 01030 808AF7B0 8CCF0164 */ lw $t7, 0x0164($a2) ## 00000164 -/* 01034 808AF7B4 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 01038 808AF7B8 55CF000D */ bnel $t6, $t7, .L808AF7F0 -/* 0103C 808AF7BC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01040 808AF7C0 0C018A29 */ jal func_800628A4 -/* 01044 808AF7C4 24C50170 */ addiu $a1, $a2, 0x0170 ## $a1 = 00000170 -/* 01048 808AF7C8 10000009 */ beq $zero, $zero, .L808AF7F0 -/* 0104C 808AF7CC 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AF7D0: -/* 01050 808AF7D0 0C22BD49 */ jal func_808AF524 -/* 01054 808AF7D4 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 01058 808AF7D8 10000005 */ beq $zero, $zero, .L808AF7F0 -/* 0105C 808AF7DC 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AF7E0: -/* 01060 808AF7E0 3C050600 */ lui $a1, %hi(D_06001160) ## $a1 = 06000000 -/* 01064 808AF7E4 0C00D498 */ jal Gfx_DrawDListOpa - -/* 01068 808AF7E8 24A51160 */ addiu $a1, $a1, %lo(D_06001160) ## $a1 = 06001160 -/* 0106C 808AF7EC 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AF7F0: -/* 01070 808AF7F0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 01074 808AF7F4 03E00008 */ jr $ra -/* 01078 808AF7F8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Init.s deleted file mode 100644 index fe3dc00e73..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Init.s +++ /dev/null @@ -1,294 +0,0 @@ -.rdata -glabel D_808AF970 - .asciz "spot06 obj nthisx->arg_data=[%d]" - .balign 4 - -.late_rodata -glabel D_808AF9E8 - .word 0xC4F92000 -glabel D_808AF9EC - .word 0xC4A42000 -glabel D_808AF9F0 - .word 0xC42A4000 -glabel D_808AF9F4 - .word 0xC42A4000 -glabel D_808AF9F8 - .word 0xC4A42000 - -.text -glabel BgSpot06Objects_Init -/* 00000 808AE780 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00004 808AE784 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00008 808AE788 AFB00020 */ sw $s0, 0x0020($sp) -/* 0000C 808AE78C AFA50044 */ sw $a1, 0x0044($sp) -/* 00010 808AE790 AFA00034 */ sw $zero, 0x0034($sp) -/* 00014 808AE794 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 00018 808AE798 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0001C 808AE79C 00027A03 */ sra $t7, $v0, 8 -/* 00020 808AE7A0 31F800FF */ andi $t8, $t7, 0x00FF ## $t8 = 00000000 -/* 00024 808AE7A4 304E00FF */ andi $t6, $v0, 0x00FF ## $t6 = 00000000 -/* 00028 808AE7A8 A48E0168 */ sh $t6, 0x0168($a0) ## 00000168 -/* 0002C 808AE7AC A498001C */ sh $t8, 0x001C($a0) ## 0000001C -/* 00030 808AE7B0 3C04808B */ lui $a0, %hi(D_808AF970) ## $a0 = 808B0000 -/* 00034 808AE7B4 2484F970 */ addiu $a0, $a0, %lo(D_808AF970) ## $a0 = 808AF970 -/* 00038 808AE7B8 0C00084C */ jal osSyncPrintf - -/* 0003C 808AE7BC 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 00040 808AE7C0 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 00044 808AE7C4 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00048 808AE7C8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0004C 808AE7CC 1040000B */ beq $v0, $zero, .L808AE7FC -/* 00050 808AE7D0 3C05808B */ lui $a1, %hi(D_808AF964) ## $a1 = 808B0000 -/* 00054 808AE7D4 1041002E */ beq $v0, $at, .L808AE890 -/* 00058 808AE7D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0005C 808AE7DC 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 00060 808AE7E0 10410085 */ beq $v0, $at, .L808AE9F8 -/* 00064 808AE7E4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00068 808AE7E8 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 0006C 808AE7EC 104100BC */ beq $v0, $at, .L808AEAE0 -/* 00070 808AE7F0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00074 808AE7F4 100000D5 */ beq $zero, $zero, .L808AEB4C -/* 00078 808AE7F8 8FBF0024 */ lw $ra, 0x0024($sp) -.L808AE7FC: -/* 0007C 808AE7FC 0C01E037 */ jal Actor_ProcessInitChain - -/* 00080 808AE800 24A5F964 */ addiu $a1, $a1, %lo(D_808AF964) ## $a1 = 808AF964 -/* 00084 808AE804 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00088 808AE808 0C010D20 */ jal DynaPolyActor_Init - -/* 0008C 808AE80C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00090 808AE810 3C040600 */ lui $a0, %hi(D_06000EE8) ## $a0 = 06000000 -/* 00094 808AE814 24840EE8 */ addiu $a0, $a0, %lo(D_06000EE8) ## $a0 = 06000EE8 -/* 00098 808AE818 0C010620 */ jal CollisionHeader_GetVirtual - -/* 0009C 808AE81C 27A50034 */ addiu $a1, $sp, 0x0034 ## $a1 = FFFFFFF4 -/* 000A0 808AE820 8FA40044 */ lw $a0, 0x0044($sp) -/* 000A4 808AE824 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 000A8 808AE828 8FA70034 */ lw $a3, 0x0034($sp) -/* 000AC 808AE82C 0C00FA9D */ jal DynaPoly_SetBgActor - ## DynaPoly_SetBgActor -/* 000B0 808AE830 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 000B4 808AE834 3C038016 */ lui $v1, %hi(gSaveContext) -/* 000B8 808AE838 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 000BC 808AE83C AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 000C0 808AE840 8C790004 */ lw $t9, 0x0004($v1) ## 8015E664 -/* 000C4 808AE844 8FA40044 */ lw $a0, 0x0044($sp) -/* 000C8 808AE848 1720000D */ bne $t9, $zero, .L808AE880 -/* 000CC 808AE84C 00000000 */ nop -/* 000D0 808AE850 0C00B2D0 */ jal Flags_GetSwitch - -/* 000D4 808AE854 86050168 */ lh $a1, 0x0168($s0) ## 00000168 -/* 000D8 808AE858 10400009 */ beq $v0, $zero, .L808AE880 -/* 000DC 808AE85C 3C0142F0 */ lui $at, 0x42F0 ## $at = 42F00000 -/* 000E0 808AE860 C604000C */ lwc1 $f4, 0x000C($s0) ## 0000000C -/* 000E4 808AE864 44813000 */ mtc1 $at, $f6 ## $f6 = 120.00 -/* 000E8 808AE868 3C08808B */ lui $t0, %hi(func_808AEE00) ## $t0 = 808B0000 -/* 000EC 808AE86C 2508EE00 */ addiu $t0, $t0, %lo(func_808AEE00) ## $t0 = 808AEE00 -/* 000F0 808AE870 46062200 */ add.s $f8, $f4, $f6 -/* 000F4 808AE874 AE080164 */ sw $t0, 0x0164($s0) ## 00000164 -/* 000F8 808AE878 100000B3 */ beq $zero, $zero, .L808AEB48 -/* 000FC 808AE87C E6080028 */ swc1 $f8, 0x0028($s0) ## 00000028 -.L808AE880: -/* 00100 808AE880 3C09808B */ lui $t1, %hi(func_808AECB4) ## $t1 = 808B0000 -/* 00104 808AE884 2529ECB4 */ addiu $t1, $t1, %lo(func_808AECB4) ## $t1 = 808AECB4 -/* 00108 808AE888 100000AF */ beq $zero, $zero, .L808AEB48 -/* 0010C 808AE88C AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -.L808AE890: -/* 00110 808AE890 3C05808B */ lui $a1, %hi(D_808AF964) ## $a1 = 808B0000 -/* 00114 808AE894 0C01E037 */ jal Actor_ProcessInitChain - -/* 00118 808AE898 24A5F964 */ addiu $a1, $a1, %lo(D_808AF964) ## $a1 = 808AF964 -/* 0011C 808AE89C 26050170 */ addiu $a1, $s0, 0x0170 ## $a1 = 00000170 -/* 00120 808AE8A0 AFA5002C */ sw $a1, 0x002C($sp) -/* 00124 808AE8A4 0C016EFE */ jal Collider_InitJntSph -/* 00128 808AE8A8 8FA40044 */ lw $a0, 0x0044($sp) -/* 0012C 808AE8AC 3C07808B */ lui $a3, %hi(D_808AF954) ## $a3 = 808B0000 -/* 00130 808AE8B0 260A0190 */ addiu $t2, $s0, 0x0190 ## $t2 = 00000190 -/* 00134 808AE8B4 8FA5002C */ lw $a1, 0x002C($sp) -/* 00138 808AE8B8 AFAA0010 */ sw $t2, 0x0010($sp) -/* 0013C 808AE8BC 24E7F954 */ addiu $a3, $a3, %lo(D_808AF954) ## $a3 = 808AF954 -/* 00140 808AE8C0 8FA40044 */ lw $a0, 0x0044($sp) -/* 00144 808AE8C4 0C017014 */ jal Collider_SetJntSph -/* 00148 808AE8C8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 0014C 808AE8CC 3C038016 */ lui $v1, %hi(gSaveContext) -/* 00150 808AE8D0 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 00154 808AE8D4 8C6B0004 */ lw $t3, 0x0004($v1) ## 8015E664 -/* 00158 808AE8D8 8FA40044 */ lw $a0, 0x0044($sp) -/* 0015C 808AE8DC 5560002C */ bnel $t3, $zero, .L808AE990 -/* 00160 808AE8E0 8E02018C */ lw $v0, 0x018C($s0) ## 0000018C -/* 00164 808AE8E4 0C00B2D0 */ jal Flags_GetSwitch - -/* 00168 808AE8E8 86050168 */ lh $a1, 0x0168($s0) ## 00000168 -/* 0016C 808AE8EC 3C038016 */ lui $v1, %hi(gSaveContext) -/* 00170 808AE8F0 10400026 */ beq $v0, $zero, .L808AE98C -/* 00174 808AE8F4 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 00178 808AE8F8 946C0EE0 */ lhu $t4, 0x0EE0($v1) ## 8015F540 -/* 0017C 808AE8FC 3C01808B */ lui $at, %hi(D_808AF9EC) ## $at = 808B0000 -/* 00180 808AE900 318D0200 */ andi $t5, $t4, 0x0200 ## $t5 = 00000000 -/* 00184 808AE904 15A00006 */ bne $t5, $zero, .L808AE920 -/* 00188 808AE908 00000000 */ nop -/* 0018C 808AE90C 3C01808B */ lui $at, %hi(D_808AF9E8) ## $at = 808B0000 -/* 00190 808AE910 C420F9E8 */ lwc1 $f0, %lo(D_808AF9E8)($at) -/* 00194 808AE914 E6000028 */ swc1 $f0, 0x0028($s0) ## 00000028 -/* 00198 808AE918 10000004 */ beq $zero, $zero, .L808AE92C -/* 0019C 808AE91C E600000C */ swc1 $f0, 0x000C($s0) ## 0000000C -.L808AE920: -/* 001A0 808AE920 C422F9EC */ lwc1 $f2, %lo(D_808AF9EC)($at) -/* 001A4 808AE924 E6020028 */ swc1 $f2, 0x0028($s0) ## 00000028 -/* 001A8 808AE928 E602000C */ swc1 $f2, 0x000C($s0) ## 0000000C -.L808AE92C: -/* 001AC 808AE92C 3C014180 */ lui $at, 0x4180 ## $at = 41800000 -/* 001B0 808AE930 44810000 */ mtc1 $at, $f0 ## $f0 = 16.00 -/* 001B4 808AE934 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 001B8 808AE938 44818000 */ mtc1 $at, $f16 ## $f16 = 100.00 -/* 001BC 808AE93C C60A002C */ lwc1 $f10, 0x002C($s0) ## 0000002C -/* 001C0 808AE940 8E02018C */ lw $v0, 0x018C($s0) ## 0000018C -/* 001C4 808AE944 3C0E808B */ lui $t6, %hi(func_808AF450) ## $t6 = 808B0000 -/* 001C8 808AE948 46105481 */ sub.s $f18, $f10, $f16 -/* 001CC 808AE94C 25CEF450 */ addiu $t6, $t6, %lo(func_808AF450) ## $t6 = 808AF450 -/* 001D0 808AE950 AE0E0164 */ sw $t6, 0x0164($s0) ## 00000164 -/* 001D4 808AE954 E612002C */ swc1 $f18, 0x002C($s0) ## 0000002C -/* 001D8 808AE958 C604002C */ lwc1 $f4, 0x002C($s0) ## 0000002C -/* 001DC 808AE95C 46002180 */ add.s $f6, $f4, $f0 -/* 001E0 808AE960 E6060010 */ swc1 $f6, 0x0010($s0) ## 00000010 -/* 001E4 808AE964 844F002E */ lh $t7, 0x002E($v0) ## 0000002E -/* 001E8 808AE968 000FC040 */ sll $t8, $t7, 1 -/* 001EC 808AE96C A4580036 */ sh $t8, 0x0036($v0) ## 00000036 -/* 001F0 808AE970 C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 001F4 808AE974 8E09018C */ lw $t1, 0x018C($s0) ## 0000018C -/* 001F8 808AE978 46004280 */ add.s $f10, $f8, $f0 -/* 001FC 808AE97C 4600540D */ trunc.w.s $f16, $f10 -/* 00200 808AE980 44088000 */ mfc1 $t0, $f16 -/* 00204 808AE984 1000000D */ beq $zero, $zero, .L808AE9BC -/* 00208 808AE988 A5280034 */ sh $t0, 0x0034($t1) ## 00000034 -.L808AE98C: -/* 0020C 808AE98C 8E02018C */ lw $v0, 0x018C($s0) ## 0000018C -.L808AE990: -/* 00210 808AE990 3C0A808B */ lui $t2, %hi(func_808AEEFC) ## $t2 = 808B0000 -/* 00214 808AE994 254AEEFC */ addiu $t2, $t2, %lo(func_808AEEFC) ## $t2 = 808AEEFC -/* 00218 808AE998 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164 -/* 0021C 808AE99C 844B002E */ lh $t3, 0x002E($v0) ## 0000002E -/* 00220 808AE9A0 A44B0036 */ sh $t3, 0x0036($v0) ## 00000036 -/* 00224 808AE9A4 C612002C */ lwc1 $f18, 0x002C($s0) ## 0000002C -/* 00228 808AE9A8 8E0E018C */ lw $t6, 0x018C($s0) ## 0000018C -/* 0022C 808AE9AC 4600910D */ trunc.w.s $f4, $f18 -/* 00230 808AE9B0 440D2000 */ mfc1 $t5, $f4 -/* 00234 808AE9B4 00000000 */ nop -/* 00238 808AE9B8 A5CD0034 */ sh $t5, 0x0034($t6) ## 808AF484 -.L808AE9BC: -/* 0023C 808AE9BC C6060024 */ lwc1 $f6, 0x0024($s0) ## 00000024 -/* 00240 808AE9C0 8E19018C */ lw $t9, 0x018C($s0) ## 0000018C -/* 00244 808AE9C4 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF -/* 00248 808AE9C8 4600320D */ trunc.w.s $f8, $f6 -/* 0024C 808AE9CC 44184000 */ mfc1 $t8, $f8 -/* 00250 808AE9D0 00000000 */ nop -/* 00254 808AE9D4 A7380030 */ sh $t8, 0x0030($t9) ## 00000030 -/* 00258 808AE9D8 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 0025C 808AE9DC 8E0A018C */ lw $t2, 0x018C($s0) ## 0000018C -/* 00260 808AE9E0 4600540D */ trunc.w.s $f16, $f10 -/* 00264 808AE9E4 44098000 */ mfc1 $t1, $f16 -/* 00268 808AE9E8 00000000 */ nop -/* 0026C 808AE9EC A5490032 */ sh $t1, 0x0032($t2) ## 808AEF2E -/* 00270 808AE9F0 10000055 */ beq $zero, $zero, .L808AEB48 -/* 00274 808AE9F4 A20B00AE */ sb $t3, 0x00AE($s0) ## 000000AE -.L808AE9F8: -/* 00278 808AE9F8 3C05808B */ lui $a1, %hi(D_808AF968) ## $a1 = 808B0000 -/* 0027C 808AE9FC 0C01E037 */ jal Actor_ProcessInitChain - -/* 00280 808AEA00 24A5F968 */ addiu $a1, $a1, %lo(D_808AF968) ## $a1 = 808AF968 -/* 00284 808AEA04 3C038016 */ lui $v1, %hi(gSaveContext) -/* 00288 808AEA08 240C0030 */ addiu $t4, $zero, 0x0030 ## $t4 = 00000030 -/* 0028C 808AEA0C 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 00290 808AEA10 AE0C0004 */ sw $t4, 0x0004($s0) ## 00000004 -/* 00294 808AEA14 8C6D0004 */ lw $t5, 0x0004($v1) ## 8015E664 -/* 00298 808AEA18 3C09808B */ lui $t1, %hi(func_808AEE00) ## $t1 = 808B0000 -/* 0029C 808AEA1C 2529EE00 */ addiu $t1, $t1, %lo(func_808AEE00) ## $t1 = 808AEE00 -/* 002A0 808AEA20 55A0002C */ bnel $t5, $zero, .L808AEAD4 -/* 002A4 808AEA24 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 002A8 808AEA28 946E0EE0 */ lhu $t6, 0x0EE0($v1) ## 8015F540 -/* 002AC 808AEA2C 31CF0200 */ andi $t7, $t6, 0x0200 ## $t7 = 00000000 -/* 002B0 808AEA30 55E00028 */ bnel $t7, $zero, .L808AEAD4 -/* 002B4 808AEA34 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 002B8 808AEA38 8C781360 */ lw $t8, 0x1360($v1) ## 8015F9C0 -/* 002BC 808AEA3C 2B010004 */ slti $at, $t8, 0x0004 -/* 002C0 808AEA40 10200018 */ beq $at, $zero, .L808AEAA4 -/* 002C4 808AEA44 3C01808B */ lui $at, %hi(D_808AF9F0) ## $at = 808B0000 -/* 002C8 808AEA48 C420F9F0 */ lwc1 $f0, %lo(D_808AF9F0)($at) -/* 002CC 808AEA4C 8FA30044 */ lw $v1, 0x0044($sp) -/* 002D0 808AEA50 2419FB57 */ addiu $t9, $zero, 0xFB57 ## $t9 = FFFFFB57 -/* 002D4 808AEA54 E600016C */ swc1 $f0, 0x016C($s0) ## 0000016C -/* 002D8 808AEA58 8C6807C0 */ lw $t0, 0x07C0($v1) ## 8015EE20 -/* 002DC 808AEA5C 2404F837 */ addiu $a0, $zero, 0xF837 ## $a0 = FFFFF837 -/* 002E0 808AEA60 8D090028 */ lw $t1, 0x0028($t0) ## 00000028 -/* 002E4 808AEA64 3C08808B */ lui $t0, %hi(func_808AEE00) ## $t0 = 808B0000 -/* 002E8 808AEA68 2508EE00 */ addiu $t0, $t0, %lo(func_808AEE00) ## $t0 = 808AEE00 -/* 002EC 808AEA6C A5390012 */ sh $t9, 0x0012($t1) ## 808AEE12 -/* 002F0 808AEA70 8C6A07C0 */ lw $t2, 0x07C0($v1) ## 8015EE20 -/* 002F4 808AEA74 8D420028 */ lw $v0, 0x0028($t2) ## 00000028 -/* 002F8 808AEA78 844B0014 */ lh $t3, 0x0014($v0) ## 00000014 -/* 002FC 808AEA7C 256CFFCE */ addiu $t4, $t3, 0xFFCE ## $t4 = FFFFFFCE -/* 00300 808AEA80 A44C0014 */ sh $t4, 0x0014($v0) ## 00000014 -/* 00304 808AEA84 8C6D07C0 */ lw $t5, 0x07C0($v1) ## 8015EE20 -/* 00308 808AEA88 8DAE0028 */ lw $t6, 0x0028($t5) ## 00000028 -/* 0030C 808AEA8C A5C40022 */ sh $a0, 0x0022($t6) ## 00000022 -/* 00310 808AEA90 8C6F07C0 */ lw $t7, 0x07C0($v1) ## 8015EE20 -/* 00314 808AEA94 8DF80028 */ lw $t8, 0x0028($t7) ## 00000028 -/* 00318 808AEA98 A7040032 */ sh $a0, 0x0032($t8) ## 00000032 -/* 0031C 808AEA9C 1000002A */ beq $zero, $zero, .L808AEB48 -/* 00320 808AEAA0 AE080164 */ sw $t0, 0x0164($s0) ## 00000164 -.L808AEAA4: -/* 00324 808AEAA4 3C01808B */ lui $at, %hi(D_808AF9F4) ## $at = 808B0000 -/* 00328 808AEAA8 C420F9F4 */ lwc1 $f0, %lo(D_808AF9F4)($at) -/* 0032C 808AEAAC 3C01808B */ lui $at, %hi(D_808AF9F8) ## $at = 808B0000 -/* 00330 808AEAB0 C422F9F8 */ lwc1 $f2, %lo(D_808AF9F8)($at) -/* 00334 808AEAB4 3C19808B */ lui $t9, %hi(func_808AF7FC) ## $t9 = 808B0000 -/* 00338 808AEAB8 2739F7FC */ addiu $t9, $t9, %lo(func_808AF7FC) ## $t9 = 808AF7FC -/* 0033C 808AEABC 46020480 */ add.s $f18, $f0, $f2 -/* 00340 808AEAC0 AE190164 */ sw $t9, 0x0164($s0) ## 00000164 -/* 00344 808AEAC4 E600016C */ swc1 $f0, 0x016C($s0) ## 0000016C -/* 00348 808AEAC8 1000001F */ beq $zero, $zero, .L808AEB48 -/* 0034C 808AEACC E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028 -/* 00350 808AEAD0 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -.L808AEAD4: -/* 00354 808AEAD4 AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -/* 00358 808AEAD8 1000001B */ beq $zero, $zero, .L808AEB48 -/* 0035C 808AEADC E604016C */ swc1 $f4, 0x016C($s0) ## 0000016C -.L808AEAE0: -/* 00360 808AEAE0 3C05808B */ lui $a1, %hi(D_808AF964) ## $a1 = 808B0000 -/* 00364 808AEAE4 0C01E037 */ jal Actor_ProcessInitChain - -/* 00368 808AEAE8 24A5F964 */ addiu $a1, $a1, %lo(D_808AF964) ## $a1 = 808AF964 -/* 0036C 808AEAEC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00370 808AEAF0 0C010D20 */ jal DynaPolyActor_Init - -/* 00374 808AEAF4 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00378 808AEAF8 3C040600 */ lui $a0, %hi(D_06001238) ## $a0 = 06000000 -/* 0037C 808AEAFC 24841238 */ addiu $a0, $a0, %lo(D_06001238) ## $a0 = 06001238 -/* 00380 808AEB00 0C010620 */ jal CollisionHeader_GetVirtual - -/* 00384 808AEB04 27A50034 */ addiu $a1, $sp, 0x0034 ## $a1 = FFFFFFF4 -/* 00388 808AEB08 8FA40044 */ lw $a0, 0x0044($sp) -/* 0038C 808AEB0C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00390 808AEB10 8FA70034 */ lw $a3, 0x0034($sp) -/* 00394 808AEB14 0C00FA9D */ jal DynaPoly_SetBgActor - ## DynaPoly_SetBgActor -/* 00398 808AEB18 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810 -/* 0039C 808AEB1C 3C0A808B */ lui $t2, %hi(func_808AEE00) ## $t2 = 808B0000 -/* 003A0 808AEB20 3C038016 */ lui $v1, %hi(gSaveContext) -/* 003A4 808AEB24 254AEE00 */ addiu $t2, $t2, %lo(func_808AEE00) ## $t2 = 808AEE00 -/* 003A8 808AEB28 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 003AC 808AEB2C AE02014C */ sw $v0, 0x014C($s0) ## 0000014C -/* 003B0 808AEB30 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164 -/* 003B4 808AEB34 8C6B0004 */ lw $t3, 0x0004($v1) ## 8015E664 -/* 003B8 808AEB38 51600004 */ beql $t3, $zero, .L808AEB4C -/* 003BC 808AEB3C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 003C0 808AEB40 0C00B55C */ jal Actor_Kill - -/* 003C4 808AEB44 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L808AEB48: -/* 003C8 808AEB48 8FBF0024 */ lw $ra, 0x0024($sp) -.L808AEB4C: -/* 003CC 808AEB4C 8FB00020 */ lw $s0, 0x0020($sp) -/* 003D0 808AEB50 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 003D4 808AEB54 03E00008 */ jr $ra -/* 003D8 808AEB58 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s deleted file mode 100644 index 5880ef3a7c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s +++ /dev/null @@ -1,24 +0,0 @@ -glabel BgSpot06Objects_Update -/* 00D50 808AF4D0 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00D54 808AF4D4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00D58 808AF4D8 AFA5001C */ sw $a1, 0x001C($sp) -/* 00D5C 808AF4DC AFA40018 */ sw $a0, 0x0018($sp) -/* 00D60 808AF4E0 8C990164 */ lw $t9, 0x0164($a0) ## 00000164 -/* 00D64 808AF4E4 0320F809 */ jalr $ra, $t9 -/* 00D68 808AF4E8 00000000 */ nop -/* 00D6C 808AF4EC 8FA70018 */ lw $a3, 0x0018($sp) -/* 00D70 808AF4F0 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00D74 808AF4F4 8FA4001C */ lw $a0, 0x001C($sp) -/* 00D78 808AF4F8 84EE001C */ lh $t6, 0x001C($a3) ## 0000001C -/* 00D7C 808AF4FC 24E60170 */ addiu $a2, $a3, 0x0170 ## $a2 = 00000170 -/* 00D80 808AF500 15C10004 */ bne $t6, $at, .L808AF514 -/* 00D84 808AF504 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00D88 808AF508 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00D8C 808AF50C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 00D90 808AF510 00812821 */ addu $a1, $a0, $at -.L808AF514: -/* 00D94 808AF514 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00D98 808AF518 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00D9C 808AF51C 03E00008 */ jr $ra -/* 00DA0 808AF520 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEBC0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEBC0.s deleted file mode 100644 index 813620f3cf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEBC0.s +++ /dev/null @@ -1,75 +0,0 @@ -.late_rodata -glabel D_808AF9FC - .float 0.05 - -glabel D_808AFA00 - .word 0x3E333333 - -.text -glabel func_808AEBC0 -/* 00440 808AEBC0 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 00444 808AEBC4 3C0F0001 */ lui $t7, 0x0001 ## $t7 = 00010000 -/* 00448 808AEBC8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 0044C 808AEBCC AFB00020 */ sw $s0, 0x0020($sp) -/* 00450 808AEBD0 AFA50044 */ sw $a1, 0x0044($sp) -/* 00454 808AEBD4 01E57821 */ addu $t7, $t7, $a1 -/* 00458 808AEBD8 8DEF1DE4 */ lw $t7, 0x1DE4($t7) ## 00011DE4 -/* 0045C 808AEBDC 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 00460 808AEBE0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00464 808AEBE4 01E1001B */ divu $zero, $t7, $at -/* 00468 808AEBE8 0000C010 */ mfhi $t8 -/* 0046C 808AEBEC 3C014320 */ lui $at, 0x4320 ## $at = 43200000 -/* 00470 808AEBF0 5700002C */ bnel $t8, $zero, .L808AECA4 -/* 00474 808AEBF4 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00478 808AEBF8 44816000 */ mtc1 $at, $f12 ## $f12 = 160.00 -/* 0047C 808AEBFC 0C00CFC8 */ jal Rand_CenteredFloat - -/* 00480 808AEC00 00000000 */ nop -/* 00484 808AEC04 E7A00030 */ swc1 $f0, 0x0030($sp) -/* 00488 808AEC08 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 0048C 808AEC0C 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 00490 808AEC10 00042400 */ sll $a0, $a0, 16 -/* 00494 808AEC14 0C01DE1C */ jal Math_SinS - ## sins? -/* 00498 808AEC18 00042403 */ sra $a0, $a0, 16 -/* 0049C 808AEC1C C7A40030 */ lwc1 $f4, 0x0030($sp) -/* 004A0 808AEC20 C6080024 */ lwc1 $f8, 0x0024($s0) ## 00000024 -/* 004A4 808AEC24 46040182 */ mul.s $f6, $f0, $f4 -/* 004A8 808AEC28 46083280 */ add.s $f10, $f6, $f8 -/* 004AC 808AEC2C E7AA0034 */ swc1 $f10, 0x0034($sp) -/* 004B0 808AEC30 C6100028 */ lwc1 $f16, 0x0028($s0) ## 00000028 -/* 004B4 808AEC34 E7B00038 */ swc1 $f16, 0x0038($sp) -/* 004B8 808AEC38 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 004BC 808AEC3C 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 004C0 808AEC40 00042400 */ sll $a0, $a0, 16 -/* 004C4 808AEC44 0C01DE0D */ jal Math_CosS - ## coss? -/* 004C8 808AEC48 00042403 */ sra $a0, $a0, 16 -/* 004CC 808AEC4C C7B20030 */ lwc1 $f18, 0x0030($sp) -/* 004D0 808AEC50 C606002C */ lwc1 $f6, 0x002C($s0) ## 0000002C -/* 004D4 808AEC54 46120102 */ mul.s $f4, $f0, $f18 -/* 004D8 808AEC58 46062200 */ add.s $f8, $f4, $f6 -/* 004DC 808AEC5C 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 004E0 808AEC60 E7A8003C */ swc1 $f8, 0x003C($sp) -/* 004E4 808AEC64 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 004E8 808AEC68 44815000 */ mtc1 $at, $f10 ## $f10 = 10.00 -/* 004EC 808AEC6C 3C01808B */ lui $at, %hi(D_808AF9FC) ## $at = 808B0000 -/* 004F0 808AEC70 C430F9FC */ lwc1 $f16, %lo(D_808AF9FC)($at) -/* 004F4 808AEC74 3C01808B */ lui $at, %hi(D_808AFA00) ## $at = 808B0000 -/* 004F8 808AEC78 C424FA00 */ lwc1 $f4, %lo(D_808AFA00)($at) -/* 004FC 808AEC7C 46100482 */ mul.s $f18, $f0, $f16 -/* 00500 808AEC80 8FA40044 */ lw $a0, 0x0044($sp) -/* 00504 808AEC84 27A50034 */ addiu $a1, $sp, 0x0034 ## $a1 = FFFFFFF4 -/* 00508 808AEC88 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 -/* 0050C 808AEC8C 3C07428C */ lui $a3, 0x428C ## $a3 = 428C0000 -/* 00510 808AEC90 E7AA0010 */ swc1 $f10, 0x0010($sp) -/* 00514 808AEC94 46049180 */ add.s $f6, $f18, $f4 -/* 00518 808AEC98 0C00A4F9 */ jal EffectSsBubble_Spawn -/* 0051C 808AEC9C E7A60014 */ swc1 $f6, 0x0014($sp) -/* 00520 808AECA0 8FBF0024 */ lw $ra, 0x0024($sp) -.L808AECA4: -/* 00524 808AECA4 8FB00020 */ lw $s0, 0x0020($sp) -/* 00528 808AECA8 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 0052C 808AECAC 03E00008 */ jr $ra -/* 00530 808AECB0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AECB4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AECB4.s deleted file mode 100644 index c1ecfa15ca..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AECB4.s +++ /dev/null @@ -1,41 +0,0 @@ -glabel func_808AECB4 -/* 00534 808AECB4 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00538 808AECB8 AFB10018 */ sw $s1, 0x0018($sp) -/* 0053C 808AECBC 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 00540 808AECC0 AFB2001C */ sw $s2, 0x001C($sp) -/* 00544 808AECC4 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 00548 808AECC8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 0054C 808AECCC AFB30020 */ sw $s3, 0x0020($sp) -/* 00550 808AECD0 AFB00014 */ sw $s0, 0x0014($sp) -/* 00554 808AECD4 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00558 808AECD8 0C00B2D0 */ jal Flags_GetSwitch - -/* 0055C 808AECDC 86250168 */ lh $a1, 0x0168($s1) ## 00000168 -/* 00560 808AECE0 10400012 */ beq $v0, $zero, .L808AED2C -/* 00564 808AECE4 240E0064 */ addiu $t6, $zero, 0x0064 ## $t6 = 00000064 -/* 00568 808AECE8 3C014040 */ lui $at, 0x4040 ## $at = 40400000 -/* 0056C 808AECEC 44813000 */ mtc1 $at, $f6 ## $f6 = 3.00 -/* 00570 808AECF0 C6240028 */ lwc1 $f4, 0x0028($s1) ## 00000028 -/* 00574 808AECF4 3C0F808B */ lui $t7, %hi(func_808AED48) ## $t7 = 808B0000 -/* 00578 808AECF8 25EFED48 */ addiu $t7, $t7, %lo(func_808AED48) ## $t7 = 808AED48 -/* 0057C 808AECFC 46062200 */ add.s $f8, $f4, $f6 -/* 00580 808AED00 A62E016A */ sh $t6, 0x016A($s1) ## 0000016A -/* 00584 808AED04 AE2F0164 */ sw $t7, 0x0164($s1) ## 00000164 -/* 00588 808AED08 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 0058C 808AED0C E6280028 */ swc1 $f8, 0x0028($s1) ## 00000028 -/* 00590 808AED10 2413000F */ addiu $s3, $zero, 0x000F ## $s3 = 0000000F -/* 00594 808AED14 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -.L808AED18: -/* 00598 808AED18 0C22BAF0 */ jal func_808AEBC0 -/* 0059C 808AED1C 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 -/* 005A0 808AED20 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 005A4 808AED24 5613FFFC */ bnel $s0, $s3, .L808AED18 -/* 005A8 808AED28 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -.L808AED2C: -/* 005AC 808AED2C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 005B0 808AED30 8FB00014 */ lw $s0, 0x0014($sp) -/* 005B4 808AED34 8FB10018 */ lw $s1, 0x0018($sp) -/* 005B8 808AED38 8FB2001C */ lw $s2, 0x001C($sp) -/* 005BC 808AED3C 8FB30020 */ lw $s3, 0x0020($sp) -/* 005C0 808AED40 03E00008 */ jr $ra -/* 005C4 808AED44 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED48.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED48.s deleted file mode 100644 index d21f343dac..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED48.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_808AED48 -/* 005C8 808AED48 AFA50004 */ sw $a1, 0x0004($sp) -/* 005CC 808AED4C 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 005D0 808AED50 3C0F808B */ lui $t7, %hi(func_808AED7C) ## $t7 = 808B0000 -/* 005D4 808AED54 25EFED7C */ addiu $t7, $t7, %lo(func_808AED7C) ## $t7 = 808AED7C -/* 005D8 808AED58 10400003 */ beq $v0, $zero, .L808AED68 -/* 005DC 808AED5C 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 005E0 808AED60 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -/* 005E4 808AED64 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -.L808AED68: -/* 005E8 808AED68 14400002 */ bne $v0, $zero, .L808AED74 -/* 005EC 808AED6C 00000000 */ nop -/* 005F0 808AED70 AC8F0164 */ sw $t7, 0x0164($a0) ## 00000164 -.L808AED74: -/* 005F4 808AED74 03E00008 */ jr $ra -/* 005F8 808AED78 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED7C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED7C.s deleted file mode 100644 index d4b3571a10..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED7C.s +++ /dev/null @@ -1,38 +0,0 @@ -glabel func_808AED7C -/* 005FC 808AED7C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00600 808AED80 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00604 808AED84 0C22BAF0 */ jal func_808AEBC0 -/* 00608 808AED88 AFA40018 */ sw $a0, 0x0018($sp) -/* 0060C 808AED8C 8FA70018 */ lw $a3, 0x0018($sp) -/* 00610 808AED90 3C0142F0 */ lui $at, 0x42F0 ## $at = 42F00000 -/* 00614 808AED94 44813000 */ mtc1 $at, $f6 ## $f6 = 120.00 -/* 00618 808AED98 C4E4000C */ lwc1 $f4, 0x000C($a3) ## 0000000C -/* 0061C 808AED9C 3C063F19 */ lui $a2, 0x3F19 ## $a2 = 3F190000 -/* 00620 808AEDA0 34C6999A */ ori $a2, $a2, 0x999A ## $a2 = 3F19999A -/* 00624 808AEDA4 46062200 */ add.s $f8, $f4, $f6 -/* 00628 808AEDA8 24E40028 */ addiu $a0, $a3, 0x0028 ## $a0 = 00000028 -/* 0062C 808AEDAC 44054000 */ mfc1 $a1, $f8 -/* 00630 808AEDB0 0C01DE80 */ jal Math_StepToF - -/* 00634 808AEDB4 00000000 */ nop -/* 00638 808AEDB8 1040000A */ beq $v0, $zero, .L808AEDE4 -/* 0063C 808AEDBC 8FA70018 */ lw $a3, 0x0018($sp) -/* 00640 808AEDC0 3C0E808B */ lui $t6, %hi(func_808AEE00) ## $t6 = 808B0000 -/* 00644 808AEDC4 25CEEE00 */ addiu $t6, $t6, %lo(func_808AEE00) ## $t6 = 808AEE00 -/* 00648 808AEDC8 ACEE0164 */ sw $t6, 0x0164($a3) ## 00000164 -/* 0064C 808AEDCC A4E0016A */ sh $zero, 0x016A($a3) ## 0000016A -/* 00650 808AEDD0 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00654 808AEDD4 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 00658 808AEDD8 24052837 */ addiu $a1, $zero, 0x2837 ## $a1 = 00002837 -/* 0065C 808AEDDC 10000005 */ beq $zero, $zero, .L808AEDF4 -/* 00660 808AEDE0 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AEDE4: -/* 00664 808AEDE4 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00668 808AEDE8 0C00BE5D */ jal func_8002F974 -/* 0066C 808AEDEC 24052036 */ addiu $a1, $zero, 0x2036 ## $a1 = 00002036 -/* 00670 808AEDF0 8FBF0014 */ lw $ra, 0x0014($sp) -.L808AEDF4: -/* 00674 808AEDF4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00678 808AEDF8 03E00008 */ jr $ra -/* 0067C 808AEDFC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE00.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE00.s deleted file mode 100644 index 3b4a0ab336..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE00.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_808AEE00 -/* 00680 808AEE00 AFA40000 */ sw $a0, 0x0000($sp) -/* 00684 808AEE04 03E00008 */ jr $ra -/* 00688 808AEE08 AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE0C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE0C.s deleted file mode 100644 index 9f8c7f003e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE0C.s +++ /dev/null @@ -1,27 +0,0 @@ -glabel func_808AEE0C -/* 0068C 808AEE0C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00690 808AEE10 AFBF001C */ sw $ra, 0x001C($sp) -/* 00694 808AEE14 AFA40020 */ sw $a0, 0x0020($sp) -/* 00698 808AEE18 14C00009 */ bne $a2, $zero, .L808AEE40 -/* 0069C 808AEE1C AFA50024 */ sw $a1, 0x0024($sp) -/* 006A0 808AEE20 3C0F0001 */ lui $t7, 0x0001 ## $t7 = 00010000 -/* 006A4 808AEE24 01E57821 */ addu $t7, $t7, $a1 -/* 006A8 808AEE28 8DEF1DE4 */ lw $t7, 0x1DE4($t7) ## 00011DE4 -/* 006AC 808AEE2C 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 -/* 006B0 808AEE30 01E1001B */ divu $zero, $t7, $at -/* 006B4 808AEE34 0000C010 */ mfhi $t8 -/* 006B8 808AEE38 57000009 */ bnel $t8, $zero, .L808AEE60 -/* 006BC 808AEE3C 8FBF001C */ lw $ra, 0x001C($sp) -.L808AEE40: -/* 006C0 808AEE40 8FA50020 */ lw $a1, 0x0020($sp) -/* 006C4 808AEE44 8FA40024 */ lw $a0, 0x0024($sp) -/* 006C8 808AEE48 2406012C */ addiu $a2, $zero, 0x012C ## $a2 = 0000012C -/* 006CC 808AEE4C 240702BC */ addiu $a3, $zero, 0x02BC ## $a3 = 000002BC -/* 006D0 808AEE50 AFA00010 */ sw $zero, 0x0010($sp) -/* 006D4 808AEE54 0C00A511 */ jal EffectSsGRipple_Spawn -/* 006D8 808AEE58 24A50008 */ addiu $a1, $a1, 0x0008 ## $a1 = 00000008 -/* 006DC 808AEE5C 8FBF001C */ lw $ra, 0x001C($sp) -.L808AEE60: -/* 006E0 808AEE60 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 006E4 808AEE64 03E00008 */ jr $ra -/* 006E8 808AEE68 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE6C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE6C.s deleted file mode 100644 index c039a546a8..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE6C.s +++ /dev/null @@ -1,48 +0,0 @@ -.late_rodata -glabel D_808AFA04 - .float 0.05 - -glabel D_808AFA08 - .word 0x3E333333 - -.text -glabel func_808AEE6C -/* 006EC 808AEE6C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 006F0 808AEE70 3C0F0001 */ lui $t7, 0x0001 ## $t7 = 00010000 -/* 006F4 808AEE74 AFBF001C */ sw $ra, 0x001C($sp) -/* 006F8 808AEE78 AFA40020 */ sw $a0, 0x0020($sp) -/* 006FC 808AEE7C AFA50024 */ sw $a1, 0x0024($sp) -/* 00700 808AEE80 01E57821 */ addu $t7, $t7, $a1 -/* 00704 808AEE84 8DEF1DE4 */ lw $t7, 0x1DE4($t7) ## 00011DE4 -/* 00708 808AEE88 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 -/* 0070C 808AEE8C 01E1001B */ divu $zero, $t7, $at -/* 00710 808AEE90 0000C010 */ mfhi $t8 -/* 00714 808AEE94 13000003 */ beq $t8, $zero, .L808AEEA4 -/* 00718 808AEE98 00000000 */ nop -/* 0071C 808AEE9C 50C00014 */ beql $a2, $zero, .L808AEEF0 -/* 00720 808AEEA0 8FBF001C */ lw $ra, 0x001C($sp) -.L808AEEA4: -/* 00724 808AEEA4 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00728 808AEEA8 00000000 */ nop -/* 0072C 808AEEAC 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 -/* 00730 808AEEB0 44812000 */ mtc1 $at, $f4 ## $f4 = 30.00 -/* 00734 808AEEB4 3C01808B */ lui $at, %hi(D_808AFA04) ## $at = 808B0000 -/* 00738 808AEEB8 C426FA04 */ lwc1 $f6, %lo(D_808AFA04)($at) -/* 0073C 808AEEBC 3C01808B */ lui $at, %hi(D_808AFA08) ## $at = 808B0000 -/* 00740 808AEEC0 C42AFA08 */ lwc1 $f10, %lo(D_808AFA08)($at) -/* 00744 808AEEC4 46060202 */ mul.s $f8, $f0, $f6 -/* 00748 808AEEC8 8FA50020 */ lw $a1, 0x0020($sp) -/* 0074C 808AEECC 8FA40024 */ lw $a0, 0x0024($sp) -/* 00750 808AEED0 24060000 */ addiu $a2, $zero, 0x0000 ## $a2 = 00000000 -/* 00754 808AEED4 3C074220 */ lui $a3, 0x4220 ## $a3 = 42200000 -/* 00758 808AEED8 E7A40010 */ swc1 $f4, 0x0010($sp) -/* 0075C 808AEEDC 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 00000024 -/* 00760 808AEEE0 460A4400 */ add.s $f16, $f8, $f10 -/* 00764 808AEEE4 0C00A4F9 */ jal EffectSsBubble_Spawn -/* 00768 808AEEE8 E7B00014 */ swc1 $f16, 0x0014($sp) -/* 0076C 808AEEEC 8FBF001C */ lw $ra, 0x001C($sp) -.L808AEEF0: -/* 00770 808AEEF0 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00774 808AEEF4 03E00008 */ jr $ra -/* 00778 808AEEF8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEEFC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEEFC.s deleted file mode 100644 index 56710e0d0c..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEEFC.s +++ /dev/null @@ -1,156 +0,0 @@ -.late_rodata -glabel D_808AFA0C - .float 0.7 - -glabel D_808AFA10 - .float 0.1 - -.text -glabel func_808AEEFC -/* 0077C 808AEEFC 27BDFF80 */ addiu $sp, $sp, 0xFF80 ## $sp = FFFFFF80 -/* 00780 808AEF00 AFBF0054 */ sw $ra, 0x0054($sp) -/* 00784 808AEF04 AFB40050 */ sw $s4, 0x0050($sp) -/* 00788 808AEF08 AFB3004C */ sw $s3, 0x004C($sp) -/* 0078C 808AEF0C AFB20048 */ sw $s2, 0x0048($sp) -/* 00790 808AEF10 AFB10044 */ sw $s1, 0x0044($sp) -/* 00794 808AEF14 AFB00040 */ sw $s0, 0x0040($sp) -/* 00798 808AEF18 F7BA0038 */ sdc1 $f26, 0x0038($sp) -/* 0079C 808AEF1C F7B80030 */ sdc1 $f24, 0x0030($sp) -/* 007A0 808AEF20 F7B60028 */ sdc1 $f22, 0x0028($sp) -/* 007A4 808AEF24 F7B40020 */ sdc1 $f20, 0x0020($sp) -/* 007A8 808AEF28 908E0181 */ lbu $t6, 0x0181($a0) ## 00000181 -/* 007AC 808AEF2C 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000 -/* 007B0 808AEF30 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 007B4 808AEF34 31CF0002 */ andi $t7, $t6, 0x0002 ## $t7 = 00000000 -/* 007B8 808AEF38 11E00068 */ beq $t7, $zero, .L808AF0DC -/* 007BC 808AEF3C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 007C0 808AEF40 8C990004 */ lw $t9, 0x0004($a0) ## 00000004 -/* 007C4 808AEF44 24180082 */ addiu $t8, $zero, 0x0082 ## $t8 = 00000082 -/* 007C8 808AEF48 A498016A */ sh $t8, 0x016A($a0) ## 0000016A -/* 007CC 808AEF4C 37280010 */ ori $t0, $t9, 0x0010 ## $t0 = 00000010 -/* 007D0 808AEF50 AC880004 */ sw $t0, 0x0004($a0) ## 00000004 -/* 007D4 808AEF54 0C01DE1C */ jal Math_SinS - ## sins? -/* 007D8 808AEF58 84840032 */ lh $a0, 0x0032($a0) ## 00000032 -/* 007DC 808AEF5C 46000506 */ mov.s $f20, $f0 -/* 007E0 808AEF60 0C01DE0D */ jal Math_CosS - ## coss? -/* 007E4 808AEF64 86240032 */ lh $a0, 0x0032($s1) ## 00000032 -/* 007E8 808AEF68 3C014040 */ lui $at, 0x4040 ## $at = 40400000 -/* 007EC 808AEF6C 44811000 */ mtc1 $at, $f2 ## $f2 = 3.00 -/* 007F0 808AEF70 C6240024 */ lwc1 $f4, 0x0024($s1) ## 00000024 -/* 007F4 808AEF74 C62A002C */ lwc1 $f10, 0x002C($s1) ## 0000002C -/* 007F8 808AEF78 46141182 */ mul.s $f6, $f2, $f20 -/* 007FC 808AEF7C 46000586 */ mov.s $f22, $f0 -/* 00800 808AEF80 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 00804 808AEF84 46001402 */ mul.s $f16, $f2, $f0 -/* 00808 808AEF88 46062200 */ add.s $f8, $f4, $f6 -/* 0080C 808AEF8C 46105480 */ add.s $f18, $f10, $f16 -/* 00810 808AEF90 E6280024 */ swc1 $f8, 0x0024($s1) ## 00000024 -/* 00814 808AEF94 E632002C */ swc1 $f18, 0x002C($s1) ## 0000002C -/* 00818 808AEF98 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -.L808AEF9C: -/* 0081C 808AEF9C 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 -/* 00820 808AEFA0 0C22BB9B */ jal func_808AEE6C -/* 00824 808AEFA4 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 00828 808AEFA8 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 0082C 808AEFAC 2A010014 */ slti $at, $s0, 0x0014 -/* 00830 808AEFB0 5420FFFA */ bnel $at, $zero, .L808AEF9C -/* 00834 808AEFB4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00838 808AEFB8 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 -/* 0083C 808AEFBC 44810000 */ mtc1 $at, $f0 ## $f0 = 5.00 -/* 00840 808AEFC0 C6240024 */ lwc1 $f4, 0x0024($s1) ## 00000024 -/* 00844 808AEFC4 3C01808B */ lui $at, %hi(D_808AFA0C) ## $at = 808B0000 -/* 00848 808AEFC8 46140182 */ mul.s $f6, $f0, $f20 -/* 0084C 808AEFCC C43AFA0C */ lwc1 $f26, %lo(D_808AFA0C)($at) -/* 00850 808AEFD0 3C01808B */ lui $at, %hi(D_808AFA10) ## $at = 808B0000 -/* 00854 808AEFD4 46160482 */ mul.s $f18, $f0, $f22 -/* 00858 808AEFD8 C438FA10 */ lwc1 $f24, %lo(D_808AFA10)($at) -/* 0085C 808AEFDC 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 00860 808AEFE0 4481A000 */ mtc1 $at, $f20 ## $f20 = 20.00 -/* 00864 808AEFE4 4480B000 */ mtc1 $zero, $f22 ## $f22 = 0.00 -/* 00868 808AEFE8 46062200 */ add.s $f8, $f4, $f6 -/* 0086C 808AEFEC 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 -/* 00870 808AEFF0 24140003 */ addiu $s4, $zero, 0x0003 ## $s4 = 00000003 -/* 00874 808AEFF4 27B30068 */ addiu $s3, $sp, 0x0068 ## $s3 = FFFFFFE8 -/* 00878 808AEFF8 E7A80068 */ swc1 $f8, 0x0068($sp) -/* 0087C 808AEFFC C62A0028 */ lwc1 $f10, 0x0028($s1) ## 00000028 -/* 00880 808AF000 E7AA006C */ swc1 $f10, 0x006C($sp) -/* 00884 808AF004 C630002C */ lwc1 $f16, 0x002C($s1) ## 0000002C -/* 00888 808AF008 46128100 */ add.s $f4, $f16, $f18 -/* 0088C 808AF00C E7A40070 */ swc1 $f4, 0x0070($sp) -.L808AF010: -/* 00890 808AF010 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 00894 808AF014 00000000 */ nop -/* 00898 808AF018 46180182 */ mul.s $f6, $f0, $f24 -/* 0089C 808AF01C 4406B000 */ mfc1 $a2, $f22 -/* 008A0 808AF020 4407A000 */ mfc1 $a3, $f20 -/* 008A4 808AF024 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 008A8 808AF028 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFE8 -/* 008AC 808AF02C E7B40010 */ swc1 $f20, 0x0010($sp) -/* 008B0 808AF030 461A3200 */ add.s $f8, $f6, $f26 -/* 008B4 808AF034 0C00A4F9 */ jal EffectSsBubble_Spawn -/* 008B8 808AF038 E7A80014 */ swc1 $f8, 0x0014($sp) -/* 008BC 808AF03C 26100001 */ addiu $s0, $s0, 0x0001 ## $s0 = 00000001 -/* 008C0 808AF040 1614FFF3 */ bne $s0, $s4, .L808AF010 -/* 008C4 808AF044 00000000 */ nop -/* 008C8 808AF048 24090001 */ addiu $t1, $zero, 0x0001 ## $t1 = 00000001 -/* 008CC 808AF04C 240A02BC */ addiu $t2, $zero, 0x02BC ## $t2 = 000002BC -/* 008D0 808AF050 AFAA0014 */ sw $t2, 0x0014($sp) -/* 008D4 808AF054 AFA90010 */ sw $t1, 0x0010($sp) -/* 008D8 808AF058 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 008DC 808AF05C 26250024 */ addiu $a1, $s1, 0x0024 ## $a1 = 00000024 -/* 008E0 808AF060 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 008E4 808AF064 0C00A527 */ jal EffectSsGSplash_Spawn -/* 008E8 808AF068 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 008EC 808AF06C 8E2C018C */ lw $t4, 0x018C($s1) ## 0000018C -/* 008F0 808AF070 240B002D */ addiu $t3, $zero, 0x002D ## $t3 = 0000002D -/* 008F4 808AF074 3C0D808B */ lui $t5, %hi(func_808AF120) ## $t5 = 808B0000 -/* 008F8 808AF078 3C078013 */ lui $a3, %hi(D_801333E0) -/* 008FC 808AF07C 25ADF120 */ addiu $t5, $t5, %lo(func_808AF120) ## $t5 = 808AF120 -/* 00900 808AF080 3C0E8013 */ lui $t6, %hi(D_801333E8) -/* 00904 808AF084 A58B0036 */ sh $t3, 0x0036($t4) ## 00000036 -/* 00908 808AF088 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 0090C 808AF08C AE2D0164 */ sw $t5, 0x0164($s1) ## 00000164 -/* 00910 808AF090 25CE33E8 */ addiu $t6, %lo(D_801333E8) -/* 00914 808AF094 3C058013 */ lui $a1, %hi(D_801333D4) -/* 00918 808AF098 24A533D4 */ addiu $a1, %lo(D_801333D4) -/* 0091C 808AF09C AFAE0014 */ sw $t6, 0x0014($sp) -/* 00920 808AF0A0 AFA70010 */ sw $a3, 0x0010($sp) -/* 00924 808AF0A4 24044802 */ addiu $a0, $zero, 0x4802 ## $a0 = 00004802 -/* 00928 808AF0A8 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 0092C 808AF0AC 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00930 808AF0B0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00934 808AF0B4 0C00B2DD */ jal Flags_SetSwitch - -/* 00938 808AF0B8 86250168 */ lh $a1, 0x0168($s1) ## 00000168 -/* 0093C 808AF0BC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00940 808AF0C0 24051018 */ addiu $a1, $zero, 0x1018 ## $a1 = 00001018 -/* 00944 808AF0C4 240600AA */ addiu $a2, $zero, 0x00AA ## $a2 = 000000AA -/* 00948 808AF0C8 02203825 */ or $a3, $s1, $zero ## $a3 = 00000000 -/* 0094C 808AF0CC 0C02003E */ jal func_800800F8 -/* 00950 808AF0D0 AFA00010 */ sw $zero, 0x0010($sp) -/* 00954 808AF0D4 10000007 */ beq $zero, $zero, .L808AF0F4 -/* 00958 808AF0D8 8FBF0054 */ lw $ra, 0x0054($sp) -.L808AF0DC: -/* 0095C 808AF0DC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00001E60 -/* 00960 808AF0E0 02412821 */ addu $a1, $s2, $at -/* 00964 808AF0E4 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00968 808AF0E8 0C01767D */ jal CollisionCheck_SetAC - ## CollisionCheck_setAC -/* 0096C 808AF0EC 26260170 */ addiu $a2, $s1, 0x0170 ## $a2 = 00000170 -/* 00970 808AF0F0 8FBF0054 */ lw $ra, 0x0054($sp) -.L808AF0F4: -/* 00974 808AF0F4 D7B40020 */ ldc1 $f20, 0x0020($sp) -/* 00978 808AF0F8 D7B60028 */ ldc1 $f22, 0x0028($sp) -/* 0097C 808AF0FC D7B80030 */ ldc1 $f24, 0x0030($sp) -/* 00980 808AF100 D7BA0038 */ ldc1 $f26, 0x0038($sp) -/* 00984 808AF104 8FB00040 */ lw $s0, 0x0040($sp) -/* 00988 808AF108 8FB10044 */ lw $s1, 0x0044($sp) -/* 0098C 808AF10C 8FB20048 */ lw $s2, 0x0048($sp) -/* 00990 808AF110 8FB3004C */ lw $s3, 0x004C($sp) -/* 00994 808AF114 8FB40050 */ lw $s4, 0x0050($sp) -/* 00998 808AF118 03E00008 */ jr $ra -/* 0099C 808AF11C 27BD0080 */ addiu $sp, $sp, 0x0080 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF120.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF120.s deleted file mode 100644 index f3709e001e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF120.s +++ /dev/null @@ -1,59 +0,0 @@ -.late_rodata -glabel D_808AFA14 - .float 0.3 - -glabel D_808AFA18 - .float 0.3 - -.text -glabel func_808AF120 -/* 009A0 808AF120 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 009A4 808AF124 AFBF001C */ sw $ra, 0x001C($sp) -/* 009A8 808AF128 AFB00018 */ sw $s0, 0x0018($sp) -/* 009AC 808AF12C AFA50024 */ sw $a1, 0x0024($sp) -/* 009B0 808AF130 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 009B4 808AF134 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 009B8 808AF138 10400002 */ beq $v0, $zero, .L808AF144 -/* 009BC 808AF13C 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 009C0 808AF140 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -.L808AF144: -/* 009C4 808AF144 0C01DE1C */ jal Math_SinS - ## sins? -/* 009C8 808AF148 86040032 */ lh $a0, 0x0032($s0) ## 00000032 -/* 009CC 808AF14C 3C01808B */ lui $at, %hi(D_808AFA14) ## $at = 808B0000 -/* 009D0 808AF150 C426FA14 */ lwc1 $f6, %lo(D_808AFA14)($at) -/* 009D4 808AF154 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 009D8 808AF158 86040032 */ lh $a0, 0x0032($s0) ## 00000032 -/* 009DC 808AF15C 46003202 */ mul.s $f8, $f6, $f0 -/* 009E0 808AF160 46082280 */ add.s $f10, $f4, $f8 -/* 009E4 808AF164 0C01DE0D */ jal Math_CosS - ## coss? -/* 009E8 808AF168 E60A0024 */ swc1 $f10, 0x0024($s0) ## 00000024 -/* 009EC 808AF16C 3C01808B */ lui $at, %hi(D_808AFA18) ## $at = 808B0000 -/* 009F0 808AF170 C432FA18 */ lwc1 $f18, %lo(D_808AFA18)($at) -/* 009F4 808AF174 C610002C */ lwc1 $f16, 0x002C($s0) ## 0000002C -/* 009F8 808AF178 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 009FC 808AF17C 46009182 */ mul.s $f6, $f18, $f0 -/* 00A00 808AF180 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00A04 808AF184 46068100 */ add.s $f4, $f16, $f6 -/* 00A08 808AF188 E604002C */ swc1 $f4, 0x002C($s0) ## 0000002C -/* 00A0C 808AF18C 0C22BB9B */ jal func_808AEE6C -/* 00A10 808AF190 8FA50024 */ lw $a1, 0x0024($sp) -/* 00A14 808AF194 860F016A */ lh $t7, 0x016A($s0) ## 0000016A -/* 00A18 808AF198 3C08808B */ lui $t0, %hi(func_808AF1D8) ## $t0 = 808B0000 -/* 00A1C 808AF19C 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 00A20 808AF1A0 15E00008 */ bne $t7, $zero, .L808AF1C4 -/* 00A24 808AF1A4 2508F1D8 */ addiu $t0, $t0, %lo(func_808AF1D8) ## $t0 = 808AF1D8 -/* 00A28 808AF1A8 44814000 */ mtc1 $at, $f8 ## $f8 = 0.50 -/* 00A2C 808AF1AC 8E180004 */ lw $t8, 0x0004($s0) ## 00000004 -/* 00A30 808AF1B0 2401DFFF */ addiu $at, $zero, 0xDFFF ## $at = FFFFDFFF -/* 00A34 808AF1B4 AE080164 */ sw $t0, 0x0164($s0) ## 00000164 -/* 00A38 808AF1B8 0301C824 */ and $t9, $t8, $at -/* 00A3C 808AF1BC AE190004 */ sw $t9, 0x0004($s0) ## 00000004 -/* 00A40 808AF1C0 E6080060 */ swc1 $f8, 0x0060($s0) ## 00000060 -.L808AF1C4: -/* 00A44 808AF1C4 8FBF001C */ lw $ra, 0x001C($sp) -/* 00A48 808AF1C8 8FB00018 */ lw $s0, 0x0018($sp) -/* 00A4C 808AF1CC 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00A50 808AF1D0 03E00008 */ jr $ra -/* 00A54 808AF1D4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF1D8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF1D8.s deleted file mode 100644 index fabf9b4293..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF1D8.s +++ /dev/null @@ -1,192 +0,0 @@ -.late_rodata -glabel D_808AFA1C - .word 0x4089999A -glabel D_808AFA20 - .float 1.3 - -glabel D_808AFA24 - .word 0xC4F92000 -glabel D_808AFA28 - .word 0xC4F6A000 -glabel D_808AFA2C - .float 0.02 - -glabel D_808AFA30 - .word 0xC4F92000 - -.text -glabel func_808AF1D8 -/* 00A58 808AF1D8 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00A5C 808AF1DC AFBF0024 */ sw $ra, 0x0024($sp) -/* 00A60 808AF1E0 AFB00020 */ sw $s0, 0x0020($sp) -/* 00A64 808AF1E4 AFA50034 */ sw $a1, 0x0034($sp) -/* 00A68 808AF1E8 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00A6C 808AF1EC C4820060 */ lwc1 $f2, 0x0060($a0) ## 00000060 -/* 00A70 808AF1F0 C4840028 */ lwc1 $f4, 0x0028($a0) ## 00000028 -/* 00A74 808AF1F4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00A78 808AF1F8 4600103E */ c.le.s $f2, $f0 -/* 00A7C 808AF1FC 3C01808B */ lui $at, %hi(D_808AFA28) ## $at = 808B0000 -/* 00A80 808AF200 46022180 */ add.s $f6, $f4, $f2 -/* 00A84 808AF204 45000045 */ bc1f .L808AF31C -/* 00A88 808AF208 E4860028 */ swc1 $f6, 0x0028($a0) ## 00000028 -/* 00A8C 808AF20C 0C01DE0D */ jal Math_CosS - ## coss? -/* 00A90 808AF210 848400B4 */ lh $a0, 0x00B4($a0) ## 000000B4 -/* 00A94 808AF214 3C01808B */ lui $at, %hi(D_808AFA1C) ## $at = 808B0000 -/* 00A98 808AF218 C428FA1C */ lwc1 $f8, %lo(D_808AFA1C)($at) -/* 00A9C 808AF21C 46080282 */ mul.s $f10, $f0, $f8 -/* 00AA0 808AF220 E7AA002C */ swc1 $f10, 0x002C($sp) -/* 00AA4 808AF224 0C01DE1C */ jal Math_SinS - ## sins? -/* 00AA8 808AF228 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00AAC 808AF22C C7B2002C */ lwc1 $f18, 0x002C($sp) -/* 00AB0 808AF230 C6100024 */ lwc1 $f16, 0x0024($s0) ## 00000024 -/* 00AB4 808AF234 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00AB8 808AF238 46009102 */ mul.s $f4, $f18, $f0 -/* 00ABC 808AF23C 46048180 */ add.s $f6, $f16, $f4 -/* 00AC0 808AF240 0C01DE0D */ jal Math_CosS - ## coss? -/* 00AC4 808AF244 E6060024 */ swc1 $f6, 0x0024($s0) ## 00000024 -/* 00AC8 808AF248 C7AA002C */ lwc1 $f10, 0x002C($sp) -/* 00ACC 808AF24C C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00AD0 808AF250 3C01808B */ lui $at, %hi(D_808AFA20) ## $at = 808B0000 -/* 00AD4 808AF254 46005482 */ mul.s $f18, $f10, $f0 -/* 00AD8 808AF258 C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -/* 00ADC 808AF25C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00AE0 808AF260 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00AE4 808AF264 46124400 */ add.s $f16, $f8, $f18 -/* 00AE8 808AF268 E610002C */ swc1 $f16, 0x002C($s0) ## 0000002C -/* 00AEC 808AF26C C426FA20 */ lwc1 $f6, %lo(D_808AFA20)($at) -/* 00AF0 808AF270 46062281 */ sub.s $f10, $f4, $f6 -/* 00AF4 808AF274 E60A0028 */ swc1 $f10, 0x0028($s0) ## 00000028 -/* 00AF8 808AF278 0C22BB83 */ jal func_808AEE0C -/* 00AFC 808AF27C 8FA50034 */ lw $a1, 0x0034($sp) -/* 00B00 808AF280 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 00B04 808AF284 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00B08 808AF288 0C01DE2B */ jal Math_ScaledStepToS - -/* 00B0C 808AF28C 24060260 */ addiu $a2, $zero, 0x0260 ## $a2 = 00000260 -/* 00B10 808AF290 5040006B */ beql $v0, $zero, .L808AF440 -/* 00B14 808AF294 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00B18 808AF298 0C01DE1C */ jal Math_SinS - ## sins? -/* 00B1C 808AF29C 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00B20 808AF2A0 3C014180 */ lui $at, 0x4180 ## $at = 41800000 -/* 00B24 808AF2A4 44819000 */ mtc1 $at, $f18 ## $f18 = 16.00 -/* 00B28 808AF2A8 C6080024 */ lwc1 $f8, 0x0024($s0) ## 00000024 -/* 00B2C 808AF2AC 860400B6 */ lh $a0, 0x00B6($s0) ## 000000B6 -/* 00B30 808AF2B0 46120402 */ mul.s $f16, $f0, $f18 -/* 00B34 808AF2B4 46104101 */ sub.s $f4, $f8, $f16 -/* 00B38 808AF2B8 0C01DE0D */ jal Math_CosS - ## coss? -/* 00B3C 808AF2BC E6040008 */ swc1 $f4, 0x0008($s0) ## 00000008 -/* 00B40 808AF2C0 3C014180 */ lui $at, 0x4180 ## $at = 41800000 -/* 00B44 808AF2C4 44815000 */ mtc1 $at, $f10 ## $f10 = 16.00 -/* 00B48 808AF2C8 C606002C */ lwc1 $f6, 0x002C($s0) ## 0000002C -/* 00B4C 808AF2CC 3C01808B */ lui $at, %hi(D_808AFA24) ## $at = 808B0000 -/* 00B50 808AF2D0 460A0482 */ mul.s $f18, $f0, $f10 -/* 00B54 808AF2D4 8E0F0004 */ lw $t7, 0x0004($s0) ## 00000004 -/* 00B58 808AF2D8 8E02018C */ lw $v0, 0x018C($s0) ## 0000018C -/* 00B5C 808AF2DC 240E0020 */ addiu $t6, $zero, 0x0020 ## $t6 = 00000020 -/* 00B60 808AF2E0 3C09808B */ lui $t1, %hi(func_808AF450) ## $t1 = 808B0000 -/* 00B64 808AF2E4 2529F450 */ addiu $t1, $t1, %lo(func_808AF450) ## $t1 = 808AF450 -/* 00B68 808AF2E8 46123201 */ sub.s $f8, $f6, $f18 -/* 00B6C 808AF2EC E6080010 */ swc1 $f8, 0x0010($s0) ## 00000010 -/* 00B70 808AF2F0 C430FA24 */ lwc1 $f16, %lo(D_808AFA24)($at) -/* 00B74 808AF2F4 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 00B78 808AF2F8 01E1C024 */ and $t8, $t7, $at -/* 00B7C 808AF2FC A60E016A */ sh $t6, 0x016A($s0) ## 0000016A -/* 00B80 808AF300 AE180004 */ sw $t8, 0x0004($s0) ## 00000004 -/* 00B84 808AF304 E6100028 */ swc1 $f16, 0x0028($s0) ## 00000028 -/* 00B88 808AF308 8459002E */ lh $t9, 0x002E($v0) ## 0000002E -/* 00B8C 808AF30C 00194040 */ sll $t0, $t9, 1 -/* 00B90 808AF310 A4480036 */ sh $t0, 0x0036($v0) ## 00000036 -/* 00B94 808AF314 10000049 */ beq $zero, $zero, .L808AF43C -/* 00B98 808AF318 AE090164 */ sw $t1, 0x0164($s0) ## 00000164 -.L808AF31C: -/* 00B9C 808AF31C C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -/* 00BA0 808AF320 C42AFA28 */ lwc1 $f10, %lo(D_808AFA28)($at) -/* 00BA4 808AF324 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00BA8 808AF328 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 00BAC 808AF32C 4604503E */ c.le.s $f10, $f4 -/* 00BB0 808AF330 00000000 */ nop -/* 00BB4 808AF334 45020010 */ bc1fl .L808AF378 -/* 00BB8 808AF338 860C00B4 */ lh $t4, 0x00B4($s0) ## 000000B4 -/* 00BBC 808AF33C E6000060 */ swc1 $f0, 0x0060($s0) ## 00000060 -/* 00BC0 808AF340 0C22BB83 */ jal func_808AEE0C -/* 00BC4 808AF344 8FA50034 */ lw $a1, 0x0034($sp) -/* 00BC8 808AF348 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00BCC 808AF34C 240B02BC */ addiu $t3, $zero, 0x02BC ## $t3 = 000002BC -/* 00BD0 808AF350 AFAB0014 */ sw $t3, 0x0014($sp) -/* 00BD4 808AF354 AFAA0010 */ sw $t2, 0x0010($sp) -/* 00BD8 808AF358 8FA40034 */ lw $a0, 0x0034($sp) -/* 00BDC 808AF35C 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 -/* 00BE0 808AF360 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00BE4 808AF364 0C00A527 */ jal EffectSsGSplash_Spawn -/* 00BE8 808AF368 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00BEC 808AF36C 10000034 */ beq $zero, $zero, .L808AF440 -/* 00BF0 808AF370 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00BF4 808AF374 860C00B4 */ lh $t4, 0x00B4($s0) ## 000000B4 -.L808AF378: -/* 00BF8 808AF378 2401C000 */ addiu $at, $zero, 0xC000 ## $at = FFFFC000 -/* 00BFC 808AF37C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00C00 808AF380 1581001F */ bne $t4, $at, .L808AF400 -/* 00C04 808AF384 8FA50034 */ lw $a1, 0x0034($sp) -/* 00C08 808AF388 3C01808B */ lui $at, %hi(D_808AFA2C) ## $at = 808B0000 -/* 00C0C 808AF38C C426FA2C */ lwc1 $f6, %lo(D_808AFA2C)($at) -/* 00C10 808AF390 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00C14 808AF394 44816000 */ mtc1 $at, $f12 ## $f12 = 1.00 -/* 00C18 808AF398 46061480 */ add.s $f18, $f2, $f6 -/* 00C1C 808AF39C 0C00CFC8 */ jal Rand_CenteredFloat - -/* 00C20 808AF3A0 E6120060 */ swc1 $f18, 0x0060($s0) ## 00000060 -/* 00C24 808AF3A4 C6080008 */ lwc1 $f8, 0x0008($s0) ## 00000008 -/* 00C28 808AF3A8 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00C2C 808AF3AC 44816000 */ mtc1 $at, $f12 ## $f12 = 1.00 -/* 00C30 808AF3B0 46080400 */ add.s $f16, $f0, $f8 -/* 00C34 808AF3B4 0C00CFC8 */ jal Rand_CenteredFloat - -/* 00C38 808AF3B8 E6100024 */ swc1 $f16, 0x0024($s0) ## 00000024 -/* 00C3C 808AF3BC 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00C40 808AF3C0 44816000 */ mtc1 $at, $f12 ## $f12 = 10.00 -/* 00C44 808AF3C4 C6020060 */ lwc1 $f2, 0x0060($s0) ## 00000060 -/* 00C48 808AF3C8 C6040010 */ lwc1 $f4, 0x0010($s0) ## 00000010 -/* 00C4C 808AF3CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00C50 808AF3D0 4602603C */ c.lt.s $f12, $f2 -/* 00C54 808AF3D4 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00C58 808AF3D8 46040280 */ add.s $f10, $f0, $f4 -/* 00C5C 808AF3DC 45000003 */ bc1f .L808AF3EC -/* 00C60 808AF3E0 E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C -/* 00C64 808AF3E4 10000002 */ beq $zero, $zero, .L808AF3F0 -/* 00C68 808AF3E8 E60C0060 */ swc1 $f12, 0x0060($s0) ## 00000060 -.L808AF3EC: -/* 00C6C 808AF3EC E6020060 */ swc1 $f2, 0x0060($s0) ## 00000060 -.L808AF3F0: -/* 00C70 808AF3F0 0C22BB9B */ jal func_808AEE6C -/* 00C74 808AF3F4 8FA50034 */ lw $a1, 0x0034($sp) -/* 00C78 808AF3F8 10000011 */ beq $zero, $zero, .L808AF440 -/* 00C7C 808AF3FC 8FBF0024 */ lw $ra, 0x0024($sp) -.L808AF400: -/* 00C80 808AF400 0C22BB9B */ jal func_808AEE6C -/* 00C84 808AF404 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00C88 808AF408 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 00C8C 808AF40C 2405C000 */ addiu $a1, $zero, 0xC000 ## $a1 = FFFFC000 -/* 00C90 808AF410 0C01DE2B */ jal Math_ScaledStepToS - -/* 00C94 808AF414 24060030 */ addiu $a2, $zero, 0x0030 ## $a2 = 00000030 -/* 00C98 808AF418 50400009 */ beql $v0, $zero, .L808AF440 -/* 00C9C 808AF41C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00CA0 808AF420 C6060024 */ lwc1 $f6, 0x0024($s0) ## 00000024 -/* 00CA4 808AF424 3C01808B */ lui $at, %hi(D_808AFA30) ## $at = 808B0000 -/* 00CA8 808AF428 C608002C */ lwc1 $f8, 0x002C($s0) ## 0000002C -/* 00CAC 808AF42C E6060008 */ swc1 $f6, 0x0008($s0) ## 00000008 -/* 00CB0 808AF430 C432FA30 */ lwc1 $f18, %lo(D_808AFA30)($at) -/* 00CB4 808AF434 E6080010 */ swc1 $f8, 0x0010($s0) ## 00000010 -/* 00CB8 808AF438 E612000C */ swc1 $f18, 0x000C($s0) ## 0000000C -.L808AF43C: -/* 00CBC 808AF43C 8FBF0024 */ lw $ra, 0x0024($sp) -.L808AF440: -/* 00CC0 808AF440 8FB00020 */ lw $s0, 0x0020($sp) -/* 00CC4 808AF444 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 00CC8 808AF448 03E00008 */ jr $ra -/* 00CCC 808AF44C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF450.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF450.s deleted file mode 100644 index 60facbf1b0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF450.s +++ /dev/null @@ -1,41 +0,0 @@ -.late_rodata -glabel D_808AFA34 - .word 0x3E490FDB - -.text -glabel func_808AF450 -/* 00CD0 808AF450 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00CD4 808AF454 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00CD8 808AF458 AFA40018 */ sw $a0, 0x0018($sp) -/* 00CDC 808AF45C 0C22BB83 */ jal func_808AEE0C -/* 00CE0 808AF460 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00CE4 808AF464 8FA40018 */ lw $a0, 0x0018($sp) -/* 00CE8 808AF468 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -/* 00CEC 808AF46C 10400003 */ beq $v0, $zero, .L808AF47C -/* 00CF0 808AF470 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 00CF4 808AF474 A48E016A */ sh $t6, 0x016A($a0) ## 0000016A -/* 00CF8 808AF478 8482016A */ lh $v0, 0x016A($a0) ## 0000016A -.L808AF47C: -/* 00CFC 808AF47C 44822000 */ mtc1 $v0, $f4 ## $f4 = 0.00 -/* 00D00 808AF480 3C01808B */ lui $at, %hi(D_808AFA34) ## $at = 808B0000 -/* 00D04 808AF484 C428FA34 */ lwc1 $f8, %lo(D_808AFA34)($at) -/* 00D08 808AF488 468021A0 */ cvt.s.w $f6, $f4 -/* 00D0C 808AF48C AFA40018 */ sw $a0, 0x0018($sp) -/* 00D10 808AF490 46083302 */ mul.s $f12, $f6, $f8 -/* 00D14 808AF494 0C0400A4 */ jal sinf - -/* 00D18 808AF498 00000000 */ nop -/* 00D1C 808AF49C 8FA40018 */ lw $a0, 0x0018($sp) -/* 00D20 808AF4A0 46000280 */ add.s $f10, $f0, $f0 -/* 00D24 808AF4A4 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 00D28 808AF4A8 C490000C */ lwc1 $f16, 0x000C($a0) ## 0000000C -/* 00D2C 808AF4AC 848F016A */ lh $t7, 0x016A($a0) ## 0000016A -/* 00D30 808AF4B0 46105480 */ add.s $f18, $f10, $f16 -/* 00D34 808AF4B4 15E00002 */ bne $t7, $zero, .L808AF4C0 -/* 00D38 808AF4B8 E4920028 */ swc1 $f18, 0x0028($a0) ## 00000028 -/* 00D3C 808AF4BC A498016A */ sh $t8, 0x016A($a0) ## 0000016A -.L808AF4C0: -/* 00D40 808AF4C0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00D44 808AF4C4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 00D48 808AF4C8 03E00008 */ jr $ra -/* 00D4C 808AF4CC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF524.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF524.s deleted file mode 100644 index 3e945922b9..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF524.s +++ /dev/null @@ -1,150 +0,0 @@ -.rdata -glabel D_808AF994 - .asciz "../z_bg_spot06_objects.c" - .balign 4 - -glabel D_808AF9B0 - .asciz "../z_bg_spot06_objects.c" - .balign 4 - -glabel D_808AF9CC - .asciz "../z_bg_spot06_objects.c" - .balign 4 - -.text -glabel func_808AF524 -/* 00DA4 808AF524 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78 -/* 00DA8 808AF528 AFB20040 */ sw $s2, 0x0040($sp) -/* 00DAC 808AF52C 00A09025 */ or $s2, $a1, $zero ## $s2 = 00000000 -/* 00DB0 808AF530 AFBF0044 */ sw $ra, 0x0044($sp) -/* 00DB4 808AF534 AFB1003C */ sw $s1, 0x003C($sp) -/* 00DB8 808AF538 AFB00038 */ sw $s0, 0x0038($sp) -/* 00DBC 808AF53C AFA40088 */ sw $a0, 0x0088($sp) -/* 00DC0 808AF540 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 00DC4 808AF544 3C06808B */ lui $a2, %hi(D_808AF994) ## $a2 = 808B0000 -/* 00DC8 808AF548 24C6F994 */ addiu $a2, $a2, %lo(D_808AF994) ## $a2 = 808AF994 -/* 00DCC 808AF54C 27A4006C */ addiu $a0, $sp, 0x006C ## $a0 = FFFFFFE4 -/* 00DD0 808AF550 2407034C */ addiu $a3, $zero, 0x034C ## $a3 = 0000034C -/* 00DD4 808AF554 0C031AB1 */ jal Graph_OpenDisps -/* 00DD8 808AF558 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 00DDC 808AF55C 0C024F61 */ jal func_80093D84 -/* 00DE0 808AF560 8E440000 */ lw $a0, 0x0000($s2) ## 00000000 -/* 00DE4 808AF564 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00DE8 808AF568 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000 -/* 00DEC 808AF56C 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003 -/* 00DF0 808AF570 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008 -/* 00DF4 808AF574 AE2E02D0 */ sw $t6, 0x02D0($s1) ## 000002D0 -/* 00DF8 808AF578 3C05808B */ lui $a1, %hi(D_808AF9B0) ## $a1 = 808B0000 -/* 00DFC 808AF57C AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 -/* 00E00 808AF580 8E440000 */ lw $a0, 0x0000($s2) ## 00000000 -/* 00E04 808AF584 24A5F9B0 */ addiu $a1, $a1, %lo(D_808AF9B0) ## $a1 = 808AF9B0 -/* 00E08 808AF588 24060352 */ addiu $a2, $zero, 0x0352 ## $a2 = 00000352 -/* 00E0C 808AF58C 0C0346A2 */ jal Matrix_NewMtx -/* 00E10 808AF590 00408025 */ or $s0, $v0, $zero ## $s0 = 00000000 -/* 00E14 808AF594 AE020004 */ sw $v0, 0x0004($s0) ## 00000004 -/* 00E18 808AF598 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00E1C 808AF59C 8E50009C */ lw $s0, 0x009C($s2) ## 0000009C -/* 00E20 808AF5A0 3C19DB06 */ lui $t9, 0xDB06 ## $t9 = DB060000 -/* 00E24 808AF5A4 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008 -/* 00E28 808AF5A8 AE3802D0 */ sw $t8, 0x02D0($s1) ## 000002D0 -/* 00E2C 808AF5AC 37390020 */ ori $t9, $t9, 0x0020 ## $t9 = DB060020 -/* 00E30 808AF5B0 AC590000 */ sw $t9, 0x0000($v0) ## 00000000 -/* 00E34 808AF5B4 8E440000 */ lw $a0, 0x0000($s2) ## 00000000 -/* 00E38 808AF5B8 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 00E3C 808AF5BC 24090020 */ addiu $t1, $zero, 0x0020 ## $t1 = 00000020 -/* 00E40 808AF5C0 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00E44 808AF5C4 240B0020 */ addiu $t3, $zero, 0x0020 ## $t3 = 00000020 -/* 00E48 808AF5C8 240C0020 */ addiu $t4, $zero, 0x0020 ## $t4 = 00000020 -/* 00E4C 808AF5CC 00103023 */ subu $a2, $zero, $s0 -/* 00E50 808AF5D0 AFA60050 */ sw $a2, 0x0050($sp) -/* 00E54 808AF5D4 AFAC0028 */ sw $t4, 0x0028($sp) -/* 00E58 808AF5D8 AFAB0024 */ sw $t3, 0x0024($sp) -/* 00E5C 808AF5DC AFAA0018 */ sw $t2, 0x0018($sp) -/* 00E60 808AF5E0 AFA90014 */ sw $t1, 0x0014($sp) -/* 00E64 808AF5E4 AFA80010 */ sw $t0, 0x0010($sp) -/* 00E68 808AF5E8 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00E6C 808AF5EC AFA20064 */ sw $v0, 0x0064($sp) -/* 00E70 808AF5F0 AFB00020 */ sw $s0, 0x0020($sp) -/* 00E74 808AF5F4 AFB0001C */ sw $s0, 0x001C($sp) -/* 00E78 808AF5F8 0C0253D0 */ jal Gfx_TwoTexScroll -/* 00E7C 808AF5FC 02003825 */ or $a3, $s0, $zero ## $a3 = 00000000 -/* 00E80 808AF600 8FA30064 */ lw $v1, 0x0064($sp) -/* 00E84 808AF604 8FA60050 */ lw $a2, 0x0050($sp) -/* 00E88 808AF608 3C0EDB06 */ lui $t6, 0xDB06 ## $t6 = DB060000 -/* 00E8C 808AF60C AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00E90 808AF610 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00E94 808AF614 35CE0024 */ ori $t6, $t6, 0x0024 ## $t6 = DB060024 -/* 00E98 808AF618 00103880 */ sll $a3, $s0, 2 -/* 00E9C 808AF61C 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008 -/* 00EA0 808AF620 AE2D02D0 */ sw $t5, 0x02D0($s1) ## 000002D0 -/* 00EA4 808AF624 AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 00EA8 808AF628 8E440000 */ lw $a0, 0x0000($s2) ## 00000000 -/* 00EAC 808AF62C 00F03823 */ subu $a3, $a3, $s0 -/* 00EB0 808AF630 00073840 */ sll $a3, $a3, 1 -/* 00EB4 808AF634 240F0020 */ addiu $t7, $zero, 0x0020 ## $t7 = 00000020 -/* 00EB8 808AF638 24180020 */ addiu $t8, $zero, 0x0020 ## $t8 = 00000020 -/* 00EBC 808AF63C 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 00EC0 808AF640 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 00EC4 808AF644 24090020 */ addiu $t1, $zero, 0x0020 ## $t1 = 00000020 -/* 00EC8 808AF648 AFA90028 */ sw $t1, 0x0028($sp) -/* 00ECC 808AF64C AFA80024 */ sw $t0, 0x0024($sp) -/* 00ED0 808AF650 AFB90018 */ sw $t9, 0x0018($sp) -/* 00ED4 808AF654 AFB80014 */ sw $t8, 0x0014($sp) -/* 00ED8 808AF658 AFAF0010 */ sw $t7, 0x0010($sp) -/* 00EDC 808AF65C AFA70020 */ sw $a3, 0x0020($sp) -/* 00EE0 808AF660 AFB0001C */ sw $s0, 0x001C($sp) -/* 00EE4 808AF664 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 00EE8 808AF668 0C0253D0 */ jal Gfx_TwoTexScroll -/* 00EEC 808AF66C AFA20060 */ sw $v0, 0x0060($sp) -/* 00EF0 808AF670 8FA30060 */ lw $v1, 0x0060($sp) -/* 00EF4 808AF674 3C0BFB00 */ lui $t3, 0xFB00 ## $t3 = FB000000 -/* 00EF8 808AF678 240CFF80 */ addiu $t4, $zero, 0xFF80 ## $t4 = FFFFFF80 -/* 00EFC 808AF67C AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 00F00 808AF680 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00F04 808AF684 3C01C42A */ lui $at, 0xC42A ## $at = C42A0000 -/* 00F08 808AF688 44813000 */ mtc1 $at, $f6 ## $f6 = -680.00 -/* 00F0C 808AF68C 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008 -/* 00F10 808AF690 AE2A02D0 */ sw $t2, 0x02D0($s1) ## 000002D0 -/* 00F14 808AF694 AC4C0004 */ sw $t4, 0x0004($v0) ## 00000004 -/* 00F18 808AF698 AC4B0000 */ sw $t3, 0x0000($v0) ## 00000000 -/* 00F1C 808AF69C 8FAD0088 */ lw $t5, 0x0088($sp) -/* 00F20 808AF6A0 3C06808B */ lui $a2, %hi(D_808AF9CC) ## $a2 = 808B0000 -/* 00F24 808AF6A4 3C0E8016 */ lui $t6, %hi(gSaveContext+0x1360) -/* 00F28 808AF6A8 C5A4016C */ lwc1 $f4, 0x016C($t5) ## 0000016C -/* 00F2C 808AF6AC 3C09DE00 */ lui $t1, 0xDE00 ## $t1 = DE000000 -/* 00F30 808AF6B0 24C6F9CC */ addiu $a2, $a2, %lo(D_808AF9CC) ## $a2 = 808AF9CC -/* 00F34 808AF6B4 4606203C */ c.lt.s $f4, $f6 -/* 00F38 808AF6B8 27A4006C */ addiu $a0, $sp, 0x006C ## $a0 = FFFFFFE4 -/* 00F3C 808AF6BC 2407036F */ addiu $a3, $zero, 0x036F ## $a3 = 0000036F -/* 00F40 808AF6C0 4502000F */ bc1fl .L808AF700 -/* 00F44 808AF6C4 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00F48 808AF6C8 8DCEF9C0 */ lw $t6, %lo(gSaveContext+0x1360)($t6) -/* 00F4C 808AF6CC 3C18DE00 */ lui $t8, 0xDE00 ## $t8 = DE000000 -/* 00F50 808AF6D0 29C10004 */ slti $at, $t6, 0x0004 -/* 00F54 808AF6D4 5020000A */ beql $at, $zero, .L808AF700 -/* 00F58 808AF6D8 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00F5C 808AF6DC 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -/* 00F60 808AF6E0 3C190600 */ lui $t9, %hi(D_06000120) ## $t9 = 06000000 -/* 00F64 808AF6E4 27390120 */ addiu $t9, $t9, %lo(D_06000120) ## $t9 = 06000120 -/* 00F68 808AF6E8 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 00F6C 808AF6EC AE2F02D0 */ sw $t7, 0x02D0($s1) ## 000002D0 -/* 00F70 808AF6F0 AC590004 */ sw $t9, 0x0004($v0) ## 00000004 -/* 00F74 808AF6F4 10000008 */ beq $zero, $zero, .L808AF718 -/* 00F78 808AF6F8 AC580000 */ sw $t8, 0x0000($v0) ## 00000000 -/* 00F7C 808AF6FC 8E2202D0 */ lw $v0, 0x02D0($s1) ## 000002D0 -.L808AF700: -/* 00F80 808AF700 3C0A0600 */ lui $t2, %hi(D_06000470) ## $t2 = 06000000 -/* 00F84 808AF704 254A0470 */ addiu $t2, $t2, %lo(D_06000470) ## $t2 = 06000470 -/* 00F88 808AF708 24480008 */ addiu $t0, $v0, 0x0008 ## $t0 = 00000008 -/* 00F8C 808AF70C AE2802D0 */ sw $t0, 0x02D0($s1) ## 000002D0 -/* 00F90 808AF710 AC4A0004 */ sw $t2, 0x0004($v0) ## 00000004 -/* 00F94 808AF714 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 -.L808AF718: -/* 00F98 808AF718 0C031AD5 */ jal Graph_CloseDisps -/* 00F9C 808AF71C 8E450000 */ lw $a1, 0x0000($s2) ## 00000000 -/* 00FA0 808AF720 8FBF0044 */ lw $ra, 0x0044($sp) -/* 00FA4 808AF724 8FB00038 */ lw $s0, 0x0038($sp) -/* 00FA8 808AF728 8FB1003C */ lw $s1, 0x003C($sp) -/* 00FAC 808AF72C 8FB20040 */ lw $s2, 0x0040($sp) -/* 00FB0 808AF730 03E00008 */ jr $ra -/* 00FB4 808AF734 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF7FC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF7FC.s deleted file mode 100644 index 9ec3390a04..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF7FC.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel func_808AF7FC -/* 0107C 808AF7FC 3C0E8016 */ lui $t6, %hi(gSaveContext+0xee0) -/* 01080 808AF800 95CEF540 */ lhu $t6, %lo(gSaveContext+0xee0)($t6) -/* 01084 808AF804 3C18808B */ lui $t8, %hi(func_808AF824) ## $t8 = 808B0000 -/* 01088 808AF808 AFA50004 */ sw $a1, 0x0004($sp) -/* 0108C 808AF80C 31CF0200 */ andi $t7, $t6, 0x0200 ## $t7 = 00000000 -/* 01090 808AF810 11E00002 */ beq $t7, $zero, .L808AF81C -/* 01094 808AF814 2718F824 */ addiu $t8, $t8, %lo(func_808AF824) ## $t8 = 808AF824 -/* 01098 808AF818 AC980164 */ sw $t8, 0x0164($a0) ## 00000164 -.L808AF81C: -/* 0109C 808AF81C 03E00008 */ jr $ra -/* 010A0 808AF820 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF824.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF824.s deleted file mode 100644 index b006e8ba39..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF824.s +++ /dev/null @@ -1,72 +0,0 @@ -.late_rodata -glabel D_808AFA38 - .word 0xC4A42000 -glabel D_808AFA3C - .word 0x38D1B717 -glabel D_808AFA40 - .float 0.001 - -.text -glabel func_808AF824 -/* 010A4 808AF824 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 010A8 808AF828 AFBF0024 */ sw $ra, 0x0024($sp) -/* 010AC 808AF82C AFB00020 */ sw $s0, 0x0020($sp) -/* 010B0 808AF830 AFA5002C */ sw $a1, 0x002C($sp) -/* 010B4 808AF834 3C01808B */ lui $at, %hi(D_808AFA38) ## $at = 808B0000 -/* 010B8 808AF838 C422FA38 */ lwc1 $f2, %lo(D_808AFA38)($at) -/* 010BC 808AF83C C480016C */ lwc1 $f0, 0x016C($a0) ## 0000016C -/* 010C0 808AF840 3C01808B */ lui $at, %hi(D_808AFA3C) ## $at = 808B0000 -/* 010C4 808AF844 3C0E808B */ lui $t6, %hi(func_808AEE00) ## $t6 = 808B0000 -/* 010C8 808AF848 46020100 */ add.s $f4, $f0, $f2 -/* 010CC 808AF84C 3C063DCC */ lui $a2, 0x3DCC ## $a2 = 3DCC0000 -/* 010D0 808AF850 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 010D4 808AF854 25CEEE00 */ addiu $t6, $t6, %lo(func_808AEE00) ## $t6 = 808AEE00 -/* 010D8 808AF858 E4840028 */ swc1 $f4, 0x0028($a0) ## 00000028 -/* 010DC 808AF85C C426FA3C */ lwc1 $f6, %lo(D_808AFA3C)($at) -/* 010E0 808AF860 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 010E4 808AF864 34C6CCCD */ ori $a2, $a2, 0xCCCD ## $a2 = 3DCCCCCD -/* 010E8 808AF868 4600303E */ c.le.s $f6, $f0 -/* 010EC 808AF86C 00000000 */ nop -/* 010F0 808AF870 45020005 */ bc1fl .L808AF888 -/* 010F4 808AF874 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00 -/* 010F8 808AF878 E4820028 */ swc1 $f2, 0x0028($a0) ## 00000028 -/* 010FC 808AF87C 1000001C */ beq $zero, $zero, .L808AF8F0 -/* 01100 808AF880 AC8E0164 */ sw $t6, 0x0164($a0) ## 00000164 -/* 01104 808AF884 44810000 */ mtc1 $at, $f0 ## $f0 = 1.00 -.L808AF888: -/* 01108 808AF888 3C01808B */ lui $at, %hi(D_808AFA40) ## $at = 808B0000 -/* 0110C 808AF88C C428FA40 */ lwc1 $f8, %lo(D_808AFA40)($at) -/* 01110 808AF890 44050000 */ mfc1 $a1, $f0 -/* 01114 808AF894 44070000 */ mfc1 $a3, $f0 -/* 01118 808AF898 2604016C */ addiu $a0, $s0, 0x016C ## $a0 = 0000016C -/* 0111C 808AF89C 0C01E0C4 */ jal Math_SmoothStepToF - -/* 01120 808AF8A0 E7A80010 */ swc1 $f8, 0x0010($sp) -/* 01124 808AF8A4 8FA2002C */ lw $v0, 0x002C($sp) -/* 01128 808AF8A8 240FFB57 */ addiu $t7, $zero, 0xFB57 ## $t7 = FFFFFB57 -/* 0112C 808AF8AC 8C5807C0 */ lw $t8, 0x07C0($v0) ## 000007C0 -/* 01130 808AF8B0 8F190028 */ lw $t9, 0x0028($t8) ## 00000028 -/* 01134 808AF8B4 A72F0012 */ sh $t7, 0x0012($t9) ## 00000012 -/* 01138 808AF8B8 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028 -/* 0113C 808AF8BC 8C4A07C0 */ lw $t2, 0x07C0($v0) ## 000007C0 -/* 01140 808AF8C0 4600540D */ trunc.w.s $f16, $f10 -/* 01144 808AF8C4 8D4B0028 */ lw $t3, 0x0028($t2) ## 00000028 -/* 01148 808AF8C8 44098000 */ mfc1 $t1, $f16 -/* 0114C 808AF8CC 00000000 */ nop -/* 01150 808AF8D0 A5690022 */ sh $t1, 0x0022($t3) ## 00000022 -/* 01154 808AF8D4 C6120028 */ lwc1 $f18, 0x0028($s0) ## 00000028 -/* 01158 808AF8D8 8C4E07C0 */ lw $t6, 0x07C0($v0) ## 000007C0 -/* 0115C 808AF8DC 4600910D */ trunc.w.s $f4, $f18 -/* 01160 808AF8E0 8DD80028 */ lw $t8, 0x0028($t6) ## 00000028 -/* 01164 808AF8E4 440D2000 */ mfc1 $t5, $f4 -/* 01168 808AF8E8 00000000 */ nop -/* 0116C 808AF8EC A70D0032 */ sh $t5, 0x0032($t8) ## 00000032 -.L808AF8F0: -/* 01170 808AF8F0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01174 808AF8F4 0C00BE52 */ jal func_8002F948 -/* 01178 808AF8F8 2405205E */ addiu $a1, $zero, 0x205E ## $a1 = 0000205E -/* 0117C 808AF8FC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01180 808AF900 8FB00020 */ lw $s0, 0x0020($sp) -/* 01184 808AF904 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 01188 808AF908 03E00008 */ jr $ra -/* 0118C 808AF90C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s index e3fbd6a6f5..d1bdc3fd77 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s @@ -146,7 +146,7 @@ glabel BgSstFloor_Update /* 00290 808B9BA0 00000000 */ nop /* 00294 808B9BA4 4502001A */ bc1fl .L808B9C10 /* 00298 808B9BA8 8E100124 */ lw $s0, 0x0124($s0) ## 00000124 -/* 0029C 808B9BAC 0C00B6E3 */ jal func_8002DB8C +/* 0029C 808B9BAC 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 002A0 808B9BB0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 002A4 808B9BB4 3C0143AF */ lui $at, 0x43AF ## $at = 43AF0000 /* 002A8 808B9BB8 44817000 */ mtc1 $at, $f14 ## $f14 = 350.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s index ca529d7535..00d4d9e99c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s @@ -91,7 +91,7 @@ glabel BgYdanSp_Init /* 00150 808BF560 8FA40030 */ lw $a0, 0x0030($sp) /* 00154 808BF564 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00158 808BF568 27A60054 */ addiu $a2, $sp, 0x0054 ## $a2 = FFFFFFD4 -/* 0015C 808BF56C 0C0189E8 */ jal func_800627A0 +/* 0015C 808BF56C 0C0189E8 */ jal Collider_SetTrisVertices /* 00160 808BF570 27A70060 */ addiu $a3, $sp, 0x0060 ## $a3 = FFFFFFE0 /* 00164 808BF574 C7B20054 */ lwc1 $f18, 0x0054($sp) /* 00168 808BF578 C7A40074 */ lwc1 $f4, 0x0074($sp) @@ -102,7 +102,7 @@ glabel BgYdanSp_Init /* 0017C 808BF58C 27A60054 */ addiu $a2, $sp, 0x0054 ## $a2 = FFFFFFD4 /* 00180 808BF590 27A7006C */ addiu $a3, $sp, 0x006C ## $a3 = FFFFFFEC /* 00184 808BF594 E7B20060 */ swc1 $f18, 0x0060($sp) -/* 00188 808BF598 0C0189E8 */ jal func_800627A0 +/* 00188 808BF598 0C0189E8 */ jal Collider_SetTrisVertices /* 0018C 808BF59C E7A40068 */ swc1 $f4, 0x0068($sp) /* 00190 808BF5A0 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 /* 00194 808BF5A4 10000080 */ beq $zero, $zero, .L808BF7A8 @@ -115,7 +115,7 @@ glabel BgYdanSp_Init /* 001A8 808BF5B8 27390464 */ addiu $t9, $t9, %lo(func_808C0464) ## $t9 = 808C0464 /* 001AC 808BF5BC AE190164 */ sw $t9, 0x0164($s0) ## 00000164 /* 001B0 808BF5C0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B4 808BF5C4 0C00B56E */ jal Actor_SetHeight +/* 001B4 808BF5C4 0C00B56E */ jal Actor_SetFocus /* 001B8 808BF5C8 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 001BC 808BF5CC 0C01DE1C */ jal Math_SinS @@ -207,7 +207,7 @@ glabel BgYdanSp_Init /* 002FC 808BF70C E7A20040 */ swc1 $f2, 0x0040($sp) /* 00300 808BF710 E7AC0044 */ swc1 $f12, 0x0044($sp) /* 00304 808BF714 E7AE0038 */ swc1 $f14, 0x0038($sp) -/* 00308 808BF718 0C0189E8 */ jal func_800627A0 +/* 00308 808BF718 0C0189E8 */ jal Collider_SetTrisVertices /* 0030C 808BF71C E7B0003C */ swc1 $f16, 0x003C($sp) /* 00310 808BF720 3C01808C */ lui $at, %hi(D_808C0984) ## $at = 808C0000 /* 00314 808BF724 C7AC0044 */ lwc1 $f12, 0x0044($sp) @@ -241,7 +241,7 @@ glabel BgYdanSp_Init /* 00384 808BF794 46122201 */ sub.s $f8, $f4, $f18 /* 00388 808BF798 460E3102 */ mul.s $f4, $f6, $f14 /* 0038C 808BF79C 46082480 */ add.s $f18, $f4, $f8 -/* 00390 808BF7A0 0C0189E8 */ jal func_800627A0 +/* 00390 808BF7A0 0C0189E8 */ jal Collider_SetTrisVertices /* 00394 808BF7A4 E7B20068 */ swc1 $f18, 0x0068($sp) .L808BF7A8: /* 00398 808BF7A8 8FA40084 */ lw $a0, 0x0084($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s index b748eb1cff..d0a2739dbd 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s @@ -37,8 +37,8 @@ glabel BossDodongo_Init /* 00818 808C19A8 24A5A3C8 */ addiu $a1, $a1, %lo(D_808CA3C8) ## $a1 = 808CA3C8 /* 0081C 808C19AC 3C05460F */ lui $a1, 0x460F ## $a1 = 460F0000 -/* 00820 808C19B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00824 808C19B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00820 808C19B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00824 808C19B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00828 808C19B8 34A5C000 */ ori $a1, $a1, 0xC000 ## $a1 = 460FC000 /* 0082C 808C19BC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00830 808C19C0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s index 297422f801..538beafa3d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s @@ -155,7 +155,7 @@ glabel BossDodongo_Update /* 02AD8 808C3C68 AFAB0014 */ sw $t3, 0x0014($sp) /* 02ADC 808C3C6C 8FA400B4 */ lw $a0, 0x00B4($sp) /* 02AE0 808C3C70 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 02AE4 808C3C74 0C00B92D */ jal func_8002E4B4 +/* 02AE4 808C3C74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02AE8 808C3C78 E7B20010 */ swc1 $f18, 0x0010($sp) /* 02AEC 808C3C7C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 02AF0 808C3C80 3C073A83 */ lui $a3, 0x3A83 ## $a3 = 3A830000 @@ -933,7 +933,7 @@ glabel BossDodongo_Update /* 035C8 808C4758 00818021 */ addu $s0, $a0, $at /* 035CC 808C475C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 035D0 808C4760 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 035D4 808C4764 AFA60034 */ sw $a2, 0x0034($sp) /* 035D8 808C4768 8E2F0190 */ lw $t7, 0x0190($s1) ## 00000190 /* 035DC 808C476C 3C03808C */ lui $v1, %hi(func_808C3704) ## $v1 = 808C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s index b9e2ecfbae..d15d1042b2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s @@ -53,7 +53,7 @@ glabel func_808C4B90 /* 03AC0 808C4C50 8FA50028 */ lw $a1, 0x0028($sp) .L808C4C54: /* 03AC4 808C4C54 8FA4001C */ lw $a0, 0x001C($sp) -/* 03AC8 808C4C58 0C018A29 */ jal func_800628A4 +/* 03AC8 808C4C58 0C018A29 */ jal Collider_UpdateSpheres /* 03ACC 808C4C5C 24A50440 */ addiu $a1, $a1, 0x0440 ## $a1 = 00000440 /* 03AD0 808C4C60 8FBF0014 */ lw $ra, 0x0014($sp) /* 03AD4 808C4C64 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s index 59fe13b8d7..c929ca7d09 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s @@ -2,7 +2,7 @@ glabel func_808C51F4 /* 04064 808C51F4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 /* 04068 808C51F8 AFBF0014 */ sw $ra, 0x0014($sp) /* 0406C 808C51FC 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 -/* 04070 808C5200 0C00B69E */ jal func_8002DA78 +/* 04070 808C5200 0C00B69E */ jal Actor_WorldYawTowardActor /* 04074 808C5204 AFA40018 */ sw $a0, 0x0018($sp) /* 04078 808C5208 8FA40018 */ lw $a0, 0x0018($sp) /* 0407C 808C520C 848E0032 */ lh $t6, 0x0032($a0) ## 00000032 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s index 5008b4e2f9..43e664e823 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s @@ -76,7 +76,7 @@ glabel func_808C5354 /* 042D8 808C5468 55620011 */ bnel $t3, $v0, .L808C54B0 /* 042DC 808C546C 8FBF001C */ lw $ra, 0x001C($sp) .L808C5470: -/* 042E0 808C5470 0C018D74 */ jal func_800635D0 +/* 042E0 808C5470 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 042E4 808C5474 8CA40000 */ lw $a0, 0x0000($a1) ## 00000000 /* 042E8 808C5478 1040000C */ beq $v0, $zero, .L808C54AC /* 042EC 808C547C A3A20027 */ sb $v0, 0x0027($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s index 5d7fa1d9d7..b0c70d03e7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s @@ -1537,7 +1537,7 @@ glabel L808CC944 /* 01D64 808CCB24 8FA401D4 */ lw $a0, 0x01D4($sp) .L808CCB28: /* 01D68 808CCB28 E7BC0010 */ swc1 $f28, 0x0010($sp) -/* 01D6C 808CCB2C 0C00B92D */ jal func_8002E4B4 +/* 01D6C 808CCB2C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D70 808CCB30 AFAE0014 */ sw $t6, 0x0014($sp) /* 01D74 808CCB34 86CF024A */ lh $t7, 0x024A($s6) ## 0000024A /* 01D78 808CCB38 26C4027C */ addiu $a0, $s6, 0x027C ## $a0 = 0000027C diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s index ecf0915c70..e3bd7684b9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s @@ -572,7 +572,7 @@ glabel func_808D08F8 .L808D1084: /* 062C4 808D1084 1A200003 */ blez $s1, .L808D1094 /* 062C8 808D1088 26240001 */ addiu $a0, $s1, 0x0001 ## $a0 = 00000001 -/* 062CC 808D108C 0C018A29 */ jal func_800628A4 +/* 062CC 808D108C 0C018A29 */ jal Collider_UpdateSpheres /* 062D0 808D1090 8FA5007C */ lw $a1, 0x007C($sp) .L808D1094: /* 062D4 808D1094 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000001 @@ -680,7 +680,7 @@ glabel func_808D08F8 /* 06460 808D1220 24841E1C */ addiu $a0, $a0, %lo(D_808D1E1C) ## $a0 = 808D1E1C /* 06464 808D1224 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 06468 808D1228 0C018A29 */ jal func_800628A4 +/* 06468 808D1228 0C018A29 */ jal Collider_UpdateSpheres /* 0646C 808D122C 8FA5007C */ lw $a1, 0x007C($sp) /* 06470 808D1230 0C034221 */ jal Matrix_Pull /* 06474 808D1234 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s index 8b84ca3ca6..e925f1ac9c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s @@ -77,7 +77,7 @@ glabel BossFd2_Update /* 0285C 808D4ECC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02860 808D4ED0 8FA50028 */ lw $a1, 0x0028($sp) /* 02864 808D4ED4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02868 808D4ED8 8FA60024 */ lw $a2, 0x0024($sp) /* 0286C 808D4EDC 92180194 */ lbu $t8, 0x0194($s0) ## 00000194 /* 02870 808D4EE0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s index d04b572182..34ee0abe0d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s @@ -190,7 +190,7 @@ glabel func_808D4790 /* 02394 808D4A04 1000008F */ beq $zero, $zero, .L808D4C44 /* 02398 808D4A08 8FBF003C */ lw $ra, 0x003C($sp) .L808D4A0C: -/* 0239C 808D4A0C 0C018D74 */ jal func_800635D0 +/* 0239C 808D4A0C 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 023A0 808D4A10 8E040000 */ lw $a0, 0x0000($s0) ## 00000001 /* 023A4 808D4A14 14400009 */ bne $v0, $zero, .L808D4A3C /* 023A8 808D4A18 305100FF */ andi $s1, $v0, 0x00FF ## $s1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s index 24ac52bfca..ac6316735e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s @@ -35,7 +35,7 @@ glabel func_808D5228 .L808D52AC: /* 02C3C 808D52AC 8FA50028 */ lw $a1, 0x0028($sp) /* 02C40 808D52B0 8FA4001C */ lw $a0, 0x001C($sp) -/* 02C44 808D52B4 0C018A29 */ jal func_800628A4 +/* 02C44 808D52B4 0C018A29 */ jal Collider_UpdateSpheres /* 02C48 808D52B8 24A5141C */ addiu $a1, $a1, 0x141C ## $a1 = 0000141C /* 02C4C 808D52BC 8FBF0014 */ lw $ra, 0x0014($sp) /* 02C50 808D52C0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s index da22cddc4a..a08fabd5b7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s @@ -157,7 +157,7 @@ glabel BossGanon_Init /* 00B20 808D7390 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00B24 808D7394 8FA50044 */ lw $a1, 0x0044($sp) /* 00B28 808D7398 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00B2C 808D739C 0C00CDD2 */ jal Actor_ChangeType +/* 00B2C 808D739C 0C00CDD2 */ jal Actor_ChangeCategory /* 00B30 808D73A0 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00B34 808D73A4 100000E0 */ beq $zero, $zero, .L808D7728 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s index d75e569966..3fd4f6ab3f 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s @@ -300,7 +300,7 @@ glabel BossGanon_Update /* 0707C 808DD8EC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000001 /* 07080 808DD8F0 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 /* 07084 808DD8F4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07088 808DD8F8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000610 /* 0708C 808DD8FC 86AA02D4 */ lh $t2, 0x02D4($s5) ## 000002D4 /* 07090 808DD900 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s index c73341b403..6651b8c379 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s @@ -94,7 +94,7 @@ glabel func_808DD20C /* 06AEC 808DD35C 2A41001E */ slti $at, $s2, 0x001E /* 06AF0 808DD360 1420FFE3 */ bne $at, $zero, .L808DD2F0 /* 06AF4 808DD364 00000000 */ nop -/* 06AF8 808DD368 0C018D74 */ jal func_800635D0 +/* 06AF8 808DD368 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 06AFC 808DD36C 8E640000 */ lw $a0, 0x0000($s3) ## 00000000 /* 06B00 808DD370 14400003 */ bne $v0, $zero, .L808DD380 /* 06B04 808DD374 304300FF */ andi $v1, $v0, 0x00FF ## $v1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s index 751cb07450..8cb04a6d6c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s @@ -568,7 +568,7 @@ glabel L808E176C .L808E17B4: /* 0AF44 808E17B4 26300610 */ addiu $s0, $s1, 0x0610 ## $s0 = 00000610 /* 0AF48 808E17B8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000610 -/* 0AF4C 808E17BC 0C0189B7 */ jal Collider_CylinderUpdate +/* 0AF4C 808E17BC 0C0189B7 */ jal Collider_UpdateCylinder /* 0AF50 808E17C0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0AF54 808E17C4 862F01B8 */ lh $t7, 0x01B8($s1) ## 000001B8 @@ -647,7 +647,7 @@ glabel L808E176C /* 0B05C 808E18CC 44812000 */ mtc1 $at, $f4 ## $f4 = 20.00 /* 0B060 808E18D0 4406A000 */ mfc1 $a2, $f20 /* 0B064 808E18D4 AFA90014 */ sw $t1, 0x0014($sp) -/* 0B068 808E18D8 0C00B92D */ jal func_8002E4B4 +/* 0B068 808E18D8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0B06C 808E18DC E7A40010 */ swc1 $f4, 0x0010($sp) /* 0B070 808E18E0 C6200024 */ lwc1 $f0, 0x0024($s1) ## 00000024 .L808E18E4: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s index f422673edc..58ac37c053 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s @@ -585,7 +585,7 @@ glabel L808E29A8 /* 0C4BC 808E2D2C 26300610 */ addiu $s0, $s1, 0x0610 ## $s0 = 00000610 .L808E2D30: /* 0C4C0 808E2D30 02002825 */ or $a1, $s0, $zero ## $a1 = 00000610 -/* 0C4C4 808E2D34 0C0189B7 */ jal Collider_CylinderUpdate +/* 0C4C4 808E2D34 0C0189B7 */ jal Collider_UpdateCylinder /* 0C4C8 808E2D38 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0C4CC 808E2D3C 862A01B8 */ lh $t2, 0x01B8($s1) ## 000001B8 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s index 3ab0675942..5d92c3d055 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s @@ -174,7 +174,7 @@ glabel BossGanon2_Update /* 05A40 80902980 44070000 */ mfc1 $a3, $f0 /* 05A44 80902984 AFB80014 */ sw $t8, 0x0014($sp) /* 05A48 80902988 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 05A4C 8090298C 0C00B92D */ jal func_8002E4B4 +/* 05A4C 8090298C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 05A50 80902990 E7A40010 */ swc1 $f4, 0x0010($sp) /* 05A54 80902994 96290088 */ lhu $t1, 0x0088($s1) ## 00000088 /* 05A58 80902998 3C01C0A0 */ lui $at, 0xC0A0 ## $at = C0A00000 @@ -471,7 +471,7 @@ glabel BossGanon2_Update /* 05E64 80902DA4 AFA60034 */ sw $a2, 0x0034($sp) /* 05E68 80902DA8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 05E6C 80902DAC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 05E70 80902DB0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05E74 80902DB4 8E380190 */ lw $t8, 0x0190($s1) ## 00000190 /* 05E78 80902DB8 3C0B8090 */ lui $t3, %hi(func_8090120C) ## $t3 = 80900000 @@ -490,7 +490,7 @@ glabel BossGanon2_Update /* 05EA8 80902DE8 AFA60034 */ sw $a2, 0x0034($sp) /* 05EAC 80902DEC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05EB0 80902DF0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 05EB4 80902DF4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 05EB8 80902DF8 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05EBC 80902DFC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s index d4102f115b..e11cfca9de 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s @@ -131,7 +131,7 @@ glabel func_80905DA8 /* 09004 80905F44 0C01E221 */ jal func_80078884 /* 09008 80905F48 E7A6007C */ swc1 $f6, 0x007C($sp) /* 0900C 80905F4C 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 -/* 09010 80905F50 0C018B58 */ jal func_80062D60 +/* 09010 80905F50 0C018B58 */ jal CollisionCheck_SpawnShieldParticlesMetal /* 09014 80905F54 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFD8 /* 09018 80905F58 E6140014 */ swc1 $f20, 0x0014($s0) ## 00010014 .L80905F5C: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s index 72bc2fe1d1..0837f26248 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s @@ -144,7 +144,7 @@ glabel BossGanondrof_Update /* 039E8 80914028 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 039EC 8091402C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 039F0 80914030 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 039F4 80914034 8FA6003C */ lw $a2, 0x003C($sp) /* 039F8 80914038 1000001A */ beq $zero, $zero, .L809140A4 /* 039FC 8091403C 8FAC0038 */ lw $t4, 0x0038($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s index 624354b897..2757e727ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s @@ -81,7 +81,7 @@ glabel func_80913C54 /* 03718 80913D58 55000048 */ bnel $t0, $zero, .L80913E7C /* 0371C 80913D5C 8FBF001C */ lw $ra, 0x001C($sp) /* 03720 80913D60 A3A00022 */ sb $zero, 0x0022($sp) -/* 03724 80913D64 0C018D74 */ jal func_800635D0 +/* 03724 80913D64 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 03728 80913D68 AFA70028 */ sw $a3, 0x0028($sp) /* 0372C 80913D6C 93A50022 */ lbu $a1, 0x0022($sp) /* 03730 80913D70 8FA70028 */ lw $a3, 0x0028($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s index b59df05fe2..a850e2324e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s @@ -9,8 +9,8 @@ glabel BossGoma_Init /* 00250 80915C60 0C01E037 */ jal Actor_ProcessInitChain /* 00254 80915C64 24A5B2A8 */ addiu $a1, $a1, %lo(D_8091B2A8) ## $a1 = 8091B2A8 -/* 00258 80915C68 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0025C 80915C6C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00258 80915C68 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0025C 80915C6C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00260 80915C70 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00264 80915C74 3C05457A */ lui $a1, 0x457A ## $a1 = 457A0000 /* 00268 80915C78 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s index 1665c30fc4..c36c70c353 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s @@ -61,7 +61,7 @@ glabel BossGoma_Update /* 04A54 8091A464 8FA4003C */ lw $a0, 0x003C($sp) /* 04A58 8091A468 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 04A5C 8091A46C AFAC0014 */ sw $t4, 0x0014($sp) -/* 04A60 8091A470 0C00B92D */ jal func_8002E4B4 +/* 04A60 8091A470 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04A64 8091A474 E7A80010 */ swc1 $f8, 0x0010($sp) /* 04A68 8091A478 10000009 */ beq $zero, $zero, .L8091A4A0 /* 04A6C 8091A47C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -71,7 +71,7 @@ glabel BossGoma_Update /* 04A78 8091A488 44815000 */ mtc1 $at, $f10 ## $f10 = 80.00 /* 04A7C 8091A48C 44070000 */ mfc1 $a3, $f0 /* 04A80 8091A490 AFAD0014 */ sw $t5, 0x0014($sp) -/* 04A84 8091A494 0C00B92D */ jal func_8002E4B4 +/* 04A84 8091A494 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04A88 8091A498 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 04A8C 8091A49C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L8091A4A0: @@ -101,7 +101,7 @@ glabel BossGoma_Update /* 04AE8 8091A4F8 8FA4003C */ lw $a0, 0x003C($sp) /* 04AEC 8091A4FC 8FA5002C */ lw $a1, 0x002C($sp) /* 04AF0 8091A500 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 04AF4 8091A504 8FA60028 */ lw $a2, 0x0028($sp) /* 04AF8 8091A508 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 /* 04AFC 8091A50C 3C0F8092 */ lui $t7, %hi(func_80919150) ## $t7 = 80920000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s index 9e8836f197..c7d21835d3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s @@ -76,7 +76,7 @@ glabel func_80916AEC /* 011F8 80916C08 E646002C */ swc1 $f6, 0x002C($s2) ## 0000002C /* 011FC 80916C0C A6490032 */ sh $t1, 0x0032($s2) ## 00000032 /* 01200 80916C10 8E251C44 */ lw $a1, 0x1C44($s1) ## 00001C44 -/* 01204 80916C14 0C00B69E */ jal func_8002DA78 +/* 01204 80916C14 0C00B69E */ jal Actor_WorldYawTowardActor /* 01208 80916C18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0120C 80916C1C 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 01210 80916C20 00415021 */ addu $t2, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s index 300caba856..4052058453 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s @@ -449,7 +449,7 @@ glabel L809171FC /* 01888 80917298 8FA40048 */ lw $a0, 0x0048($sp) /* 0188C 8091729C 8FB8006C */ lw $t8, 0x006C($sp) /* 01890 809172A0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01894 809172A4 0C00B69E */ jal func_8002DA78 +/* 01894 809172A4 0C00B69E */ jal Actor_WorldYawTowardActor /* 01898 809172A8 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 0189C 809172AC 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 018A0 809172B0 00412821 */ addu $a1, $v0, $at @@ -849,7 +849,7 @@ glabel L80917738 /* 01E2C 8091783C 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 01E30 80917840 8FAB006C */ lw $t3, 0x006C($sp) /* 01E34 80917844 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01E38 80917848 0C00B69E */ jal func_8002DA78 +/* 01E38 80917848 0C00B69E */ jal Actor_WorldYawTowardActor /* 01E3C 8091784C 8D651C44 */ lw $a1, 0x1C44($t3) ## 00001C44 /* 01E40 80917850 00022C00 */ sll $a1, $v0, 16 /* 01E44 80917854 00052C03 */ sra $a1, $a1, 16 @@ -969,7 +969,7 @@ glabel L80917738 /* 01FE8 809179F8 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 01FEC 809179FC 8FA8006C */ lw $t0, 0x006C($sp) /* 01FF0 80917A00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01FF4 80917A04 0C00B69E */ jal func_8002DA78 +/* 01FF4 80917A04 0C00B69E */ jal Actor_WorldYawTowardActor /* 01FF8 80917A08 8D051C44 */ lw $a1, 0x1C44($t0) ## 00001C44 /* 01FFC 80917A0C 00022C00 */ sll $a1, $v0, 16 /* 02000 80917A10 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s index ac6c524837..99c0e223da 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s @@ -32,7 +32,7 @@ glabel func_80918C08 /* 03254 80918C64 00000000 */ nop /* 03258 80918C68 45000009 */ bc1f .L80918C90 /* 0325C 80918C6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03260 80918C70 0C00B69E */ jal func_8002DA78 +/* 03260 80918C70 0C00B69E */ jal Actor_WorldYawTowardActor /* 03264 80918C74 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 03268 80918C78 00022C00 */ sll $a1, $v0, 16 /* 0326C 80918C7C 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s index 46bcb88401..c9dc60f0d3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s @@ -15,7 +15,7 @@ glabel func_80919278 /* 03894 809192A4 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 03898 809192A8 8FAE0024 */ lw $t6, 0x0024($sp) /* 0389C 809192AC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 038A0 809192B0 0C00B69E */ jal func_8002DA78 +/* 038A0 809192B0 0C00B69E */ jal Actor_WorldYawTowardActor /* 038A4 809192B4 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 038A8 809192B8 00022C00 */ sll $a1, $v0, 16 /* 038AC 809192BC 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s index 58b9615fd0..c7c42113fb 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s @@ -15,7 +15,7 @@ glabel func_8091932C /* 03948 80919358 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 0394C 8091935C 8FAE0024 */ lw $t6, 0x0024($sp) /* 03950 80919360 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03954 80919364 0C00B69E */ jal func_8002DA78 +/* 03954 80919364 0C00B69E */ jal Actor_WorldYawTowardActor /* 03958 80919368 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 0395C 8091936C 00022C00 */ sll $a1, $v0, 16 /* 03960 80919370 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s index 9a9327a8fa..314e9cff35 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s @@ -75,7 +75,7 @@ glabel func_80919704 /* 03DF0 80919800 8FAB002C */ lw $t3, 0x002C($sp) /* 03DF4 80919804 15400042 */ bne $t2, $zero, .L80919910 /* 03DF8 80919808 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03DFC 8091980C 0C00B69E */ jal func_8002DA78 +/* 03DFC 8091980C 0C00B69E */ jal Actor_WorldYawTowardActor /* 03E00 80919810 8D651C44 */ lw $a1, 0x1C44($t3) ## 00001C44 /* 03E04 80919814 A7A20026 */ sh $v0, 0x0026($sp) /* 03E08 80919818 86030196 */ lh $v1, 0x0196($s0) ## 00000196 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s index ae1a3ea8b1..20f2187dbc 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s @@ -91,14 +91,14 @@ glabel func_80919C38 /* 04348 80919D58 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 0434C 80919D5C 8FAA002C */ lw $t2, 0x002C($sp) /* 04350 80919D60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04354 80919D64 0C00B69E */ jal func_8002DA78 +/* 04354 80919D64 0C00B69E */ jal Actor_WorldYawTowardActor /* 04358 80919D68 8D451C44 */ lw $a1, 0x1C44($t2) ## 00001C44 /* 0435C 80919D6C 860B00B6 */ lh $t3, 0x00B6($s0) ## 000000B6 /* 04360 80919D70 8FAD002C */ lw $t5, 0x002C($sp) /* 04364 80919D74 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04368 80919D78 004B6023 */ subu $t4, $v0, $t3 /* 0436C 80919D7C A7AC0024 */ sh $t4, 0x0024($sp) -/* 04370 80919D80 0C00B6B8 */ jal func_8002DAE0 +/* 04370 80919D80 0C00B6B8 */ jal Actor_WorldPitchTowardActor /* 04374 80919D84 8DA51C44 */ lw $a1, 0x1C44($t5) ## 00001C44 /* 04378 80919D88 860300B4 */ lh $v1, 0x00B4($s0) ## 000000B4 /* 0437C 80919D8C 87A50024 */ lh $a1, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s index 3fb9c3493e..1c6c8ba420 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s @@ -51,7 +51,7 @@ glabel func_80919F8C /* 04630 8091A040 1462001F */ bne $v1, $v0, .L8091A0C0 /* 04634 8091A044 8FAE002C */ lw $t6, 0x002C($sp) /* 04638 8091A048 8DC40000 */ lw $a0, 0x0000($t6) ## 00000000 -/* 0463C 8091A04C 0C018D74 */ jal func_800635D0 +/* 0463C 8091A04C 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 04640 8091A050 AFA30024 */ sw $v1, 0x0024($sp) /* 04644 8091A054 1040001A */ beq $v0, $zero, .L8091A0C0 /* 04648 8091A058 8FA30024 */ lw $v1, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s index c585ebe972..2e3b648b4e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s @@ -137,7 +137,7 @@ glabel func_8091A9E8 .L8091ABC8: /* 051B8 8091ABC8 8FA300B8 */ lw $v1, 0x00B8($sp) /* 051BC 8091ABCC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 051C0 8091ABD0 0C018A29 */ jal func_800628A4 +/* 051C0 8091ABD0 0C018A29 */ jal Collider_UpdateSpheres /* 051C4 8091ABD4 246507BC */ addiu $a1, $v1, 0x07BC ## $a1 = 000007BC /* 051C8 8091ABD8 8FBF003C */ lw $ra, 0x003C($sp) /* 051CC 8091ABDC 8FB00038 */ lw $s0, 0x0038($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s index fa3dabf8cf..3fc1c16c85 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s @@ -199,7 +199,7 @@ glabel BossMo_Init /* 00884 8091C384 8FA50048 */ lw $a1, 0x0048($sp) /* 00888 8091C388 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0088C 8091C38C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00890 8091C390 0C00CDD2 */ jal Actor_ChangeType +/* 00890 8091C390 0C00CDD2 */ jal Actor_ChangeCategory /* 00894 8091C394 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00898 8091C398 1000003A */ beq $zero, $zero, .L8091C484 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s index d56ff5abfb..292eebdc5b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s @@ -560,7 +560,7 @@ glabel BossMo_Update /* 07C14 80923714 2651101C */ addiu $s1, $s2, 0x101C ## $s1 = 0000101C /* 07C18 80923718 02203025 */ or $a2, $s1, $zero ## $a2 = 0000101C /* 07C1C 8092371C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07C20 80923720 02002825 */ or $a1, $s0, $zero ## $a1 = 00000024 /* 07C24 80923724 8FA400BC */ lw $a0, 0x00BC($sp) /* 07C28 80923728 02002825 */ or $a1, $s0, $zero ## $a1 = 00000024 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s index 79e234d632..62f11a64f8 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s @@ -103,7 +103,7 @@ glabel func_80921280 /* 05864 80921364 862A0160 */ lh $t2, 0x0160($s1) ## 00000160 /* 05868 80921368 154000CC */ bne $t2, $zero, .L8092169C /* 0586C 8092136C 00000000 */ nop -/* 05870 80921370 0C018D74 */ jal func_800635D0 +/* 05870 80921370 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 05874 80921374 8E040000 */ lw $a0, 0x0000($s0) ## 00000000 /* 05878 80921378 10400057 */ beq $v0, $zero, .L809214D8 /* 0587C 8092137C A3A20063 */ sb $v0, 0x0063($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s index bca7c4aa08..15a3928082 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s @@ -765,7 +765,7 @@ glabel L80921B08 /* 06564 80922064 8FA400EC */ lw $a0, 0x00EC($sp) /* 06568 80922068 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 0656C 8092206C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 06570 80922070 0C00B92D */ jal func_8002E4B4 +/* 06570 80922070 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 06574 80922074 E7A80010 */ swc1 $f8, 0x0010($sp) /* 06578 80922078 8FB800EC */ lw $t8, 0x00EC($sp) /* 0657C 8092207C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -1315,7 +1315,7 @@ glabel L80921B08 /* 06D5C 8092285C E6320028 */ swc1 $f18, 0x0028($s1) ## 00000028 /* 06D60 80922860 AFA20014 */ sw $v0, 0x0014($sp) /* 06D64 80922864 8FA400EC */ lw $a0, 0x00EC($sp) -/* 06D68 80922868 0C00B92D */ jal func_8002E4B4 +/* 06D68 80922868 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 06D6C 8092286C E7A80010 */ swc1 $f8, 0x0010($sp) /* 06D70 80922870 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 /* 06D74 80922874 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s index f875872ef4..c820f1ceda 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s @@ -108,7 +108,7 @@ glabel func_80922D30 /* 073A4 80922EA4 260614FC */ addiu $a2, $s0, 0x14FC ## $a2 = 000014FC /* 073A8 80922EA8 00C02825 */ or $a1, $a2, $zero ## $a1 = 000014FC /* 073AC 80922EAC AFA60020 */ sw $a2, 0x0020($sp) -/* 073B0 80922EB0 0C0189B7 */ jal Collider_CylinderUpdate +/* 073B0 80922EB0 0C0189B7 */ jal Collider_UpdateCylinder /* 073B4 80922EB4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 073B8 80922EB8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -143,7 +143,7 @@ glabel func_80922D30 /* 07420 80922F20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80922F24: /* 07424 80922F24 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07428 80922F28 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0742C 80922F2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80922F30: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s index ca64aff3fe..c1b9ba9d15 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s @@ -31,7 +31,7 @@ glabel BossSst_Init /* 00048 8092C618 3C068093 */ lui $a2, %hi(D_80937824) ## $a2 = 80930000 /* 0004C 8092C61C 24C67824 */ addiu $a2, $a2, %lo(D_80937824) ## $a2 = 80937824 /* 00050 8092C620 24A5782C */ addiu $a1, $a1, %lo(D_8093782C) ## $a1 = 8093782C -/* 00054 8092C624 0C0187B5 */ jal func_80061ED4 +/* 00054 8092C624 0C0187B5 */ jal CollisionCheck_SetInfo /* 00058 8092C628 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 0005C 8092C62C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00060 8092C630 0C00B2DD */ jal Flags_SetSwitch @@ -75,8 +75,8 @@ glabel BossSst_Init /* 000F0 8092C6C0 0C0291BE */ jal SkelAnime_InitFlex /* 000F4 8092C6C4 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C /* 000F8 8092C6C8 3C054788 */ lui $a1, 0x4788 ## $a1 = 47880000 -/* 000FC 8092C6CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00100 8092C6D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000FC 8092C6CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00100 8092C6D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00104 8092C6D4 34A5B800 */ ori $a1, $a1, 0xB800 ## $a1 = 4788B800 /* 00108 8092C6D8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0010C 8092C6DC 0C00AC78 */ jal ActorShape_Init @@ -233,7 +233,7 @@ glabel BossSst_Init /* 00344 8092C914 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00348 8092C918 8FA5003C */ lw $a1, 0x003C($sp) /* 0034C 8092C91C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00350 8092C920 0C00CDD2 */ jal Actor_ChangeType +/* 00350 8092C920 0C00CDD2 */ jal Actor_ChangeCategory /* 00354 8092C924 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00358 8092C928 10000046 */ beq $zero, $zero, .L8092CA44 @@ -293,8 +293,8 @@ glabel BossSst_Init /* 00424 8092C9F4 240D0001 */ addiu $t5, $zero, 0x0001 ## $t5 = 00000001 /* 00428 8092C9F8 A20D0194 */ sb $t5, 0x0194($s0) ## 00000194 .L8092C9FC: -/* 0042C 8092C9FC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00430 8092CA00 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0042C 8092C9FC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00430 8092CA00 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00434 8092CA04 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00438 8092CA08 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0043C 8092CA0C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s index abfed3a9ce..1f9815fe7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s @@ -79,10 +79,10 @@ glabel BossSst_Update /* 07B68 80934138 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 07B6C 8093413C 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 07B70 80934140 3C074302 */ lui $a3, 0x4302 ## $a3 = 43020000 -/* 07B74 80934144 0C00B92D */ jal func_8002E4B4 +/* 07B74 80934144 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 07B78 80934148 E7A80010 */ swc1 $f8, 0x0010($sp) /* 07B7C 8093414C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 07B80 80934150 0C00B56E */ jal Actor_SetHeight +/* 07B80 80934150 0C00B56E */ jal Actor_SetFocus /* 07B84 80934154 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 07B88 80934158 920E03E4 */ lbu $t6, 0x03E4($s0) ## 000003E4 @@ -127,7 +127,7 @@ glabel BossSst_Update /* 07C10 809341E0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 07C14 809341E4 02212821 */ addu $a1, $s1, $at /* 07C18 809341E8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07C1C 809341EC 260603D4 */ addiu $a2, $s0, 0x03D4 ## $a2 = 000003D4 .L809341F0: /* 07C20 809341F0 920D06C4 */ lbu $t5, 0x06C4($s0) ## 000006C4 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s index f8b403940b..47de679f4d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s @@ -88,7 +88,7 @@ glabel func_8092DB4C /* 016B4 8092DC84 10000014 */ beq $zero, $zero, .L8092DCD8 /* 016B8 8092DC88 A6090198 */ sh $t1, 0x0198($s0) ## 00000198 .L8092DC8C: -/* 016BC 8092DC8C 0C00B6B0 */ jal func_8002DAC0 +/* 016BC 8092DC8C 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 016C0 8092DC90 8CC41C44 */ lw $a0, 0x1C44($a2) ## 00001C44 /* 016C4 8092DC94 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 016C8 8092DC98 00412821 */ addu $a1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s index d1ec87e7ba..426c1767c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s @@ -10,7 +10,7 @@ glabel func_8092E25C /* 01CAC 8092E27C 3C06C1A0 */ lui $a2, 0xC1A0 ## $a2 = C1A00000 /* 01CB0 8092E280 3C058093 */ lui $a1, %hi(D_80937340) ## $a1 = 80930000 /* 01CB4 8092E284 8FA40018 */ lw $a0, 0x0018($sp) -/* 01CB8 8092E288 0C00B6B0 */ jal func_8002DAC0 +/* 01CB8 8092E288 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01CBC 8092E28C 24A57340 */ addiu $a1, $a1, %lo(D_80937340) ## $a1 = 80937340 /* 01CC0 8092E290 8FA70018 */ lw $a3, 0x0018($sp) /* 01CC4 8092E294 3C01BF80 */ lui $at, 0xBF80 ## $at = BF800000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s index ae642a2143..047e9f9f4a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s @@ -103,7 +103,7 @@ glabel func_8092F0BC /* 02C44 8092F214 8FA40024 */ lw $a0, 0x0024($sp) /* 02C48 8092F218 46085180 */ add.s $f6, $f10, $f8 /* 02C4C 8092F21C 46043481 */ sub.s $f18, $f6, $f4 -/* 02C50 8092F220 0C00B6B0 */ jal func_8002DAC0 +/* 02C50 8092F220 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 02C54 8092F224 E492002C */ swc1 $f18, 0x002C($a0) ## 0000002C /* 02C58 8092F228 8FB90024 */ lw $t9, 0x0024($sp) /* 02C5C 8092F22C 3C058093 */ lui $a1, %hi(D_80937358) ## $a1 = 80930000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s index fdd3801550..8cf00e7a7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s @@ -81,7 +81,7 @@ glabel func_80930934 /* 04478 80930A48 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0447C 80930A4C 260506B4 */ addiu $a1, $s0, 0x06B4 ## $a1 = 000006B4 /* 04480 80930A50 358D0001 */ ori $t5, $t4, 0x0001 ## $t5 = 00000001 -/* 04484 80930A54 0C0189B7 */ jal Collider_CylinderUpdate +/* 04484 80930A54 0C0189B7 */ jal Collider_UpdateCylinder /* 04488 80930A58 A20D06C4 */ sb $t5, 0x06C4($s0) ## 000006C4 /* 0448C 80930A5C 3C0E8093 */ lui $t6, %hi(D_80937818) ## $t6 = 80930000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s index ecd298bf8e..06bd919677 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s @@ -20,12 +20,12 @@ glabel func_80930B18 /* 04590 80930B60 3C058094 */ lui $a1, %hi(D_80938C90) ## $a1 = 80940000 /* 04594 80930B64 8CA58C90 */ lw $a1, %lo(D_80938C90)($a1) /* 04598 80930B68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0459C 80930B6C 0C00B6EC */ jal func_8002DBB0 +/* 0459C 80930B6C 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 045A0 80930B70 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 80940024 /* 045A4 80930B74 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 045A8 80930B78 3C048094 */ lui $a0, %hi(D_80938C90) ## $a0 = 80940000 /* 045AC 80930B7C 8C848C90 */ lw $a0, %lo(D_80938C90)($a0) -/* 045B0 80930B80 0C00B6B0 */ jal func_8002DAC0 +/* 045B0 80930B80 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 045B4 80930B84 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 /* 045B8 80930B88 820A0194 */ lb $t2, 0x0194($s0) ## 00000194 /* 045BC 80930B8C 86090016 */ lh $t1, 0x0016($s0) ## 00000016 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s index f01330850e..3084f5a6bd 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s @@ -31,12 +31,12 @@ glabel func_80931210 /* 04CB0 80931280 3C058094 */ lui $a1, %hi(D_80938C90) ## $a1 = 80940000 /* 04CB4 80931284 8CA58C90 */ lw $a1, %lo(D_80938C90)($a1) /* 04CB8 80931288 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04CBC 8093128C 0C00B6EC */ jal func_8002DBB0 +/* 04CBC 8093128C 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 04CC0 80931290 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 80940024 /* 04CC4 80931294 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 04CC8 80931298 3C048094 */ lui $a0, %hi(D_80938C90) ## $a0 = 80940000 /* 04CCC 8093129C 8C848C90 */ lw $a0, %lo(D_80938C90)($a0) -/* 04CD0 809312A0 0C00B6B0 */ jal func_8002DAC0 +/* 04CD0 809312A0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 04CD4 809312A4 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 /* 04CD8 809312A8 82030194 */ lb $v1, 0x0194($s0) ## 00000194 /* 04CDC 809312AC 860D0016 */ lh $t5, 0x0016($s0) ## 00000016 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s index 31a64940f3..e82059160e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s @@ -26,12 +26,12 @@ glabel func_80933554 .L809335B4: /* 06FE4 809335B4 8E05011C */ lw $a1, 0x011C($s0) ## 0000011C /* 06FE8 809335B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 06FEC 809335BC 0C00B6EC */ jal func_8002DBB0 +/* 06FEC 809335BC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 06FF0 809335C0 24A503C8 */ addiu $a1, $a1, 0x03C8 ## $a1 = 000003C8 /* 06FF4 809335C4 8E05011C */ lw $a1, 0x011C($s0) ## 0000011C /* 06FF8 809335C8 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 06FFC 809335CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 07000 809335D0 0C00B6B0 */ jal func_8002DAC0 +/* 07000 809335D0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 07004 809335D4 24A503C8 */ addiu $a1, $a1, 0x03C8 ## $a1 = 000003C8 /* 07008 809335D8 A60201A4 */ sh $v0, 0x01A4($s0) ## 000001A4 /* 0700C 809335DC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s index e71239139f..8a9d95f49b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s @@ -109,7 +109,7 @@ glabel func_80934338 /* 07EEC 809344BC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 07EF0 809344C0 02212821 */ addu $a1, $s1, $at /* 07EF4 809344C4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07EF8 809344C8 260603D4 */ addiu $a2, $s0, 0x03D4 ## $a2 = 000003D4 .L809344CC: /* 07EFC 809344CC 0C24CE7E */ jal func_809339F8 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s index 8a990d258c..c8406438da 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s @@ -7,7 +7,7 @@ glabel func_809345F0 /* 08034 80934604 AFBF0014 */ sw $ra, 0x0014($sp) /* 08038 80934608 AFA60020 */ sw $a2, 0x0020($sp) /* 0803C 8093460C AFA70024 */ sw $a3, 0x0024($sp) -/* 08040 80934610 0C018A29 */ jal func_800628A4 +/* 08040 80934610 0C018A29 */ jal Collider_UpdateSpheres /* 08044 80934614 24A503D4 */ addiu $a1, $a1, 0x03D4 ## $a1 = 000003D4 /* 08048 80934618 8FBF0014 */ lw $ra, 0x0014($sp) /* 0804C 8093461C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s index c9203029a3..e12489cf2f 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s @@ -35,7 +35,7 @@ glabel func_80935238 .L809352BC: /* 08CEC 809352BC 8FA20038 */ lw $v0, 0x0038($sp) /* 08CF0 809352C0 8FA4002C */ lw $a0, 0x002C($sp) -/* 08CF4 809352C4 0C018A29 */ jal func_800628A4 +/* 08CF4 809352C4 0C018A29 */ jal Collider_UpdateSpheres /* 08CF8 809352C8 244503D4 */ addiu $a1, $v0, 0x03D4 ## $a1 = 000003D4 /* 08CFC 809352CC 8FBF0014 */ lw $ra, 0x0014($sp) /* 08D00 809352D0 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s index a9cc2f774e..bd991d09a2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s @@ -207,7 +207,7 @@ glabel BossTw_Update /* 07CC4 80940994 3048FFFD */ andi $t0, $v0, 0xFFFD ## $t0 = 00000000 /* 07CC8 80940998 A22805BD */ sb $t0, 0x05BD($s1) ## 000005BD .L8094099C: -/* 07CCC 8094099C 0C0189B7 */ jal Collider_CylinderUpdate +/* 07CCC 8094099C 0C0189B7 */ jal Collider_UpdateCylinder /* 07CD0 809409A0 02002825 */ or $a1, $s0, $zero ## $a1 = 000005AC /* 07CD4 809409A4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s index 1acaafcdd7..af4a25acb0 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s @@ -155,7 +155,7 @@ glabel func_8093C2C4 /* 03808 8093C4D8 AFA90014 */ sw $t1, 0x0014($sp) /* 0380C 8093C4DC 8FA4006C */ lw $a0, 0x006C($sp) /* 03810 8093C4E0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 03814 8093C4E4 0C00B92D */ jal func_8002E4B4 +/* 03814 8093C4E4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 03818 8093C4E8 E7B20010 */ swc1 $f18, 0x0010($sp) /* 0381C 8093C4EC 3C014248 */ lui $at, 0x4248 ## $at = 42480000 /* 03820 8093C4F0 44813000 */ mtc1 $at, $f6 ## $f6 = 50.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s index ae8c140e03..61531005a7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s @@ -432,7 +432,7 @@ glabel func_80940D48 /* 08614 809412E4 A64E05F0 */ sh $t6, 0x05F0($s2) ## 000005F0 /* 08618 809412E8 264505AC */ addiu $a1, $s2, 0x05AC ## $a1 = 000005AC /* 0861C 809412EC AFA5004C */ sw $a1, 0x004C($sp) -/* 08620 809412F0 0C0189B7 */ jal Collider_CylinderUpdate +/* 08620 809412F0 0C0189B7 */ jal Collider_UpdateCylinder /* 08624 809412F4 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 08628 809412F8 8648015A */ lh $t0, 0x015A($s2) ## 0000015A @@ -482,7 +482,7 @@ glabel func_80940D48 /* 086CC 8094139C 8E5005E8 */ lw $s0, 0x05E8($s2) ## 000005E8 /* 086D0 809413A0 A24805BD */ sb $t0, 0x05BD($s2) ## 000005BD /* 086D4 809413A4 00008825 */ or $s1, $zero, $zero ## $s1 = 00000000 -/* 086D8 809413A8 0C018D74 */ jal func_800635D0 +/* 086D8 809413A8 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 086DC 809413AC 8E040000 */ lw $a0, 0x0000($s0) ## 00000001 /* 086E0 809413B0 14400003 */ bne $v0, $zero, .L809413C0 /* 086E4 809413B4 304600FF */ andi $a2, $v0, 0x00FF ## $a2 = 00000000 @@ -523,7 +523,7 @@ glabel func_80940D48 /* 08754 80941424 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 08758 80941428 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 0875C 8094142C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 08760 80941430 8FA6004C */ lw $a2, 0x004C($sp) /* 08764 80941434 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 08768 80941438 24100002 */ addiu $s0, $zero, 0x0002 ## $s0 = 00000002 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s index 4c729cdedb..6e27a95db9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s @@ -70,7 +70,7 @@ glabel func_80946B00 /* 0DF2C 80946BFC AE09003C */ sw $t1, 0x003C($s0) ## 0000003C /* 0DF30 80946C00 8CCA0008 */ lw $t2, 0x0008($a2) ## 00000008 /* 0DF34 80946C04 AE0A0040 */ sw $t2, 0x0040($s0) ## 00000040 -/* 0DF38 80946C08 0C0189B7 */ jal Collider_CylinderUpdate +/* 0DF38 80946C08 0C0189B7 */ jal Collider_UpdateCylinder /* 0DF3C 80946C0C AFA50024 */ sw $a1, 0x0024($sp) /* 0DF40 80946C10 920B0565 */ lbu $t3, 0x0565($s0) ## 00000565 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s index 13bcdd1853..6a89d2f197 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s @@ -126,7 +126,7 @@ glabel func_80949E10 /* 112F0 80949FC0 AFA80014 */ sw $t0, 0x0014($sp) /* 112F4 80949FC4 8FA4006C */ lw $a0, 0x006C($sp) /* 112F8 80949FC8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 112FC 80949FCC 0C00B92D */ jal func_8002E4B4 +/* 112FC 80949FCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 11300 80949FD0 E7B20010 */ swc1 $f18, 0x0010($sp) /* 11304 80949FD4 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 /* 11308 80949FD8 44813000 */ mtc1 $at, $f6 ## $f6 = 30.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s index 6016e68832..c2ae831de1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s @@ -294,7 +294,7 @@ glabel L80959578 /* 0A2E4 809595A4 AFAA0010 */ sw $t2, 0x0010($sp) /* 0A2E8 809595A8 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 0A2EC 809595AC 0C018A29 */ jal func_800628A4 +/* 0A2EC 809595AC 0C018A29 */ jal Collider_UpdateSpheres /* 0A2F0 809595B0 260502D8 */ addiu $a1, $s0, 0x02D8 ## $a1 = 000002D8 /* 0A2F4 809595B4 3C0B8096 */ lui $t3, %hi(D_809668D2) ## $t3 = 80960000 /* 0A2F8 809595B8 816B68D2 */ lb $t3, %lo(D_809668D2)($t3) @@ -375,7 +375,7 @@ glabel L80959578 /* 0A41C 809596DC 26040338 */ addiu $a0, $s0, 0x0338 ## $a0 = 00000338 /* 0A420 809596E0 8FA5004C */ lw $a1, 0x004C($sp) /* 0A424 809596E4 8FA60048 */ lw $a2, 0x0048($sp) -/* 0A428 809596E8 0C0189CD */ jal func_80062734 +/* 0A428 809596E8 0C0189CD */ jal Collider_SetQuadVertices /* 0A42C 809596EC AFAE0010 */ sw $t6, 0x0010($sp) /* 0A430 809596F0 0C034221 */ jal Matrix_Pull /* 0A434 809596F4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s index 0d698484b9..2144ffc036 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s @@ -169,7 +169,7 @@ glabel func_80951844 /* 027B8 80951A78 2605028C */ addiu $a1, $s0, 0x028C ## $a1 = 0000028C .L80951A7C: /* 027BC 80951A7C AFA50040 */ sw $a1, 0x0040($sp) -/* 027C0 80951A80 0C0189B7 */ jal Collider_CylinderUpdate +/* 027C0 80951A80 0C0189B7 */ jal Collider_UpdateCylinder /* 027C4 80951A84 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 027C8 80951A88 8FA4004C */ lw $a0, 0x004C($sp) @@ -178,7 +178,7 @@ glabel func_80951844 /* 027D4 80951A94 00812821 */ addu $a1, $a0, $at /* 027D8 80951A98 AFA5003C */ sw $a1, 0x003C($sp) /* 027DC 80951A9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 027E0 80951AA0 8FA60040 */ lw $a2, 0x0040($sp) /* 027E4 80951AA4 8FA5003C */ lw $a1, 0x003C($sp) /* 027E8 80951AA8 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s index fc8c3b588d..36068f118d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s @@ -313,7 +313,7 @@ glabel func_80951C04 /* 02D80 80952040 46109180 */ add.s $f6, $f18, $f16 /* 02D84 80952044 AE0D0040 */ sw $t5, 0x0040($s0) ## 00000040 /* 02D88 80952048 E606003C */ swc1 $f6, 0x003C($s0) ## 0000003C -/* 02D8C 8095204C 0C0189B7 */ jal Collider_CylinderUpdate +/* 02D8C 8095204C 0C0189B7 */ jal Collider_UpdateCylinder /* 02D90 80952050 AFA50040 */ sw $a1, 0x0040($sp) /* 02D94 80952054 8FA4005C */ lw $a0, 0x005C($sp) @@ -322,7 +322,7 @@ glabel func_80951C04 /* 02DA0 80952060 00812821 */ addu $a1, $a0, $at /* 02DA4 80952064 AFA5003C */ sw $a1, 0x003C($sp) /* 02DA8 80952068 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02DAC 8095206C 8FA60040 */ lw $a2, 0x0040($sp) /* 02DB0 80952070 92030114 */ lbu $v1, 0x0114($s0) ## 00000114 /* 02DB4 80952074 8FA4005C */ lw $a0, 0x005C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s index b218e7499a..f6c539d5fe 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s @@ -427,7 +427,7 @@ glabel func_8095213C /* 03434 809526F4 2670028C */ addiu $s0, $s3, 0x028C ## $s0 = 0000028C .L809526F8: /* 03438 809526F8 02002825 */ or $a1, $s0, $zero ## $a1 = 0000028C -/* 0343C 809526FC 0C0189B7 */ jal Collider_CylinderUpdate +/* 0343C 809526FC 0C0189B7 */ jal Collider_UpdateCylinder /* 03440 80952700 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 03444 80952704 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -436,7 +436,7 @@ glabel func_8095213C /* 03450 80952710 02202825 */ or $a1, $s1, $zero ## $a1 = 8095C1D0 /* 03454 80952714 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 03458 80952718 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0345C 8095271C 02003025 */ or $a2, $s0, $zero ## $a2 = 0000028C /* 03460 80952720 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 03464 80952724 02202825 */ or $a1, $s1, $zero ## $a1 = 8095C1D0 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s index 2cca440846..9976b2bfda 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s @@ -714,11 +714,11 @@ glabel func_80952858 /* 03F78 80953238 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 03F7C 8095323C 3C0641F0 */ lui $a2, 0x41F0 ## $a2 = 41F00000 /* 03F80 80953240 3C07428C */ lui $a3, 0x428C ## $a3 = 428C0000 -/* 03F84 80953244 0C00B92D */ jal func_8002E4B4 +/* 03F84 80953244 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 03F88 80953248 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 03F8C 8095324C 2605028C */ addiu $a1, $s0, 0x028C ## $a1 = 0000028C /* 03F90 80953250 AFA5003C */ sw $a1, 0x003C($sp) -/* 03F94 80953254 0C0189B7 */ jal Collider_CylinderUpdate +/* 03F94 80953254 0C0189B7 */ jal Collider_UpdateCylinder /* 03F98 80953258 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03F9C 8095325C 8FA4005C */ lw $a0, 0x005C($sp) @@ -727,7 +727,7 @@ glabel func_80952858 /* 03FA8 80953268 00812821 */ addu $a1, $a0, $at /* 03FAC 8095326C AFA50038 */ sw $a1, 0x0038($sp) /* 03FB0 80953270 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 03FB4 80953274 8FA6003C */ lw $a2, 0x003C($sp) /* 03FB8 80953278 820B0196 */ lb $t3, 0x0196($s0) ## 00000196 /* 03FBC 8095327C 8FA4005C */ lw $a0, 0x005C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s index 1f76ab9c2d..4da2bb9058 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s @@ -35,7 +35,7 @@ glabel func_809586E4 /* 094A4 80958764 24C50038 */ addiu $a1, $a2, 0x0038 ## $a1 = 00000038 /* 094A8 80958768 8FA60040 */ lw $a2, 0x0040($sp) /* 094AC 8095876C 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 094B0 80958770 0C018A29 */ jal func_800628A4 +/* 094B0 80958770 0C018A29 */ jal Collider_UpdateSpheres /* 094B4 80958774 24C502D8 */ addiu $a1, $a2, 0x02D8 ## $a1 = 000002D8 /* 094B8 80958778 1000006B */ beq $zero, $zero, .L80958928 /* 094BC 8095877C 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s index 323fd3cc0a..a15a3212de 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s @@ -281,7 +281,7 @@ glabel func_80958B0C /* 09C7C 80958F3C 26040338 */ addiu $a0, $s0, 0x0338 ## $a0 = 00000338 /* 09C80 80958F40 8FA50034 */ lw $a1, 0x0034($sp) /* 09C84 80958F44 8FA60030 */ lw $a2, 0x0030($sp) -/* 09C88 80958F48 0C0189CD */ jal func_80062734 +/* 09C88 80958F48 0C0189CD */ jal Collider_SetQuadVertices /* 09C8C 80958F4C AFAB0010 */ sw $t3, 0x0010($sp) /* 09C90 80958F50 0C034221 */ jal Matrix_Pull /* 09C94 80958F54 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s index 9553545fa2..b92fede292 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s @@ -242,7 +242,7 @@ glabel L80966BCC /* 002A8 80966BF8 8FA40054 */ lw $a0, 0x0054($sp) /* 002AC 80966BFC 02203025 */ or $a2, $s1, $zero ## $a2 = 00000000 /* 002B0 80966C00 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 002B4 80966C04 0C00CDD2 */ jal Actor_ChangeType +/* 002B4 80966C04 0C00CDD2 */ jal Actor_ChangeCategory /* 002B8 80966C08 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002BC 80966C0C 10000029 */ beq $zero, $zero, .L80966CB4 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s index 73c8c73945..f0bac4d3c9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s @@ -4,8 +4,8 @@ glabel DemoDu_Init /* 023E8 8096BEB8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 023EC 8096BEBC AFBF001C */ sw $ra, 0x001C($sp) /* 023F0 8096BEC0 AFA50024 */ sw $a1, 0x0024($sp) -/* 023F4 8096BEC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 023F8 8096BEC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 023F4 8096BEC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 023F8 8096BEC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 023FC 8096BECC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02400 8096BED0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 02404 8096BED4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s b/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s index 259d74804b..302c8b3a50 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s @@ -11,7 +11,7 @@ glabel func_80969C58 /* 001AC 80969C7C AFAE0014 */ sw $t6, 0x0014($sp) /* 001B0 80969C80 8FA40024 */ lw $a0, 0x0024($sp) /* 001B4 80969C84 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 001B8 80969C88 0C00B92D */ jal func_8002E4B4 +/* 001B8 80969C88 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001BC 80969C8C E7A00010 */ swc1 $f0, 0x0010($sp) /* 001C0 80969C90 8FBF001C */ lw $ra, 0x001C($sp) /* 001C4 80969C94 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s index db52e93959..9a87f698c1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s @@ -12,7 +12,7 @@ glabel func_8097895C /* 00050 80978980 8FA4001C */ lw $a0, 0x001C($sp) /* 00054 80978984 8FA50020 */ lw $a1, 0x0020($sp) /* 00058 80978988 8FA60018 */ lw $a2, 0x0018($sp) -/* 0005C 8097898C 0C017114 */ jal Collider_SetCylinder_Set3 +/* 0005C 8097898C 0C017114 */ jal Collider_SetCylinderType1 /* 00060 80978990 8FA70024 */ lw $a3, 0x0024($sp) /* 00064 80978994 8FBF0014 */ lw $ra, 0x0014($sp) /* 00068 80978998 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s index ced127babf..746b943215 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s @@ -68,7 +68,7 @@ glabel func_8097BA48 .L8097BB3C: /* 0320C 8097BB3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L8097BB40: -/* 03210 8097BB40 0C0189B7 */ jal Collider_CylinderUpdate +/* 03210 8097BB40 0C0189B7 */ jal Collider_UpdateCylinder /* 03214 8097BB44 02402825 */ or $a1, $s2, $zero ## $a1 = 00000184 /* 03218 8097BB48 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s index 337d754c1e..eab685dcfa 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s @@ -11,7 +11,7 @@ glabel func_8098330C /* 00030 80983330 AFAE0014 */ sw $t6, 0x0014($sp) /* 00034 80983334 8FA40024 */ lw $a0, 0x0024($sp) /* 00038 80983338 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 0003C 8098333C 0C00B92D */ jal func_8002E4B4 +/* 0003C 8098333C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00040 80983340 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00044 80983344 8FBF001C */ lw $ra, 0x001C($sp) /* 00048 80983348 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s index 758d0331cf..1de5ea38d5 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s @@ -39,11 +39,11 @@ glabel func_80983820 /* 005A8 809838A8 AFB80048 */ sw $t8, 0x0048($sp) /* 005AC 809838AC 2631035C */ addiu $s1, $s1, %lo(D_0600035C) ## $s1 = 0600035C .L809838B0: -/* 005B0 809838B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 005B0 809838B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 005B4 809838B4 44070000 */ mfc1 $a3, $f0 /* 005B8 809838B8 0C00AC78 */ jal ActorShape_Init -/* 005BC 809838BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 005BC 809838BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 005C0 809838C0 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C /* 005C4 809838C4 26190190 */ addiu $t9, $s0, 0x0190 ## $t9 = 00000190 /* 005C8 809838C8 2608019C */ addiu $t0, $s0, 0x019C ## $t0 = 0000019C diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s index 7e0b811a88..63904794a1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s @@ -259,7 +259,7 @@ glabel L80989190 /* 00310 80989190 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00314 80989194 26051C24 */ addiu $a1, $s0, 0x1C24 ## $a1 = 00001C24 /* 00318 80989198 02603025 */ or $a2, $s3, $zero ## $a2 = 00000000 -/* 0031C 8098919C 0C00CDD2 */ jal Actor_ChangeType +/* 0031C 8098919C 0C00CDD2 */ jal Actor_ChangeCategory /* 00320 809891A0 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 /* 00324 809891A4 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s index 7a7cd59d00..b3664e676e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s @@ -231,7 +231,7 @@ glabel func_8098ABC0 .L8098AEBC: /* 0203C 8098AEBC 27A400B8 */ addiu $a0, $sp, 0x00B8 ## $a0 = FFFFFFC0 .L8098AEC0: -/* 02040 8098AEC0 0C00BBC5 */ jal func_8002EF14 +/* 02040 8098AEC0 0C00BBC5 */ jal Actor_GetWorld /* 02044 8098AEC4 8FA500E4 */ lw $a1, 0x00E4($sp) /* 02048 8098AEC8 3C068099 */ lui $a2, %hi(D_8098CF98) ## $a2 = 80990000 /* 0204C 8098AECC 24C6CF98 */ addiu $a2, $a2, %lo(D_8098CF98) ## $a2 = 8098CF98 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s index fa2b2d8c49..33db118e8a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s @@ -170,7 +170,7 @@ glabel func_8098B354 /* 026F4 8098B574 258D0001 */ addiu $t5, $t4, 0x0001 ## $t5 = 00000001 /* 026F8 8098B578 A20D0172 */ sb $t5, 0x0172($s0) ## 00000172 .L8098B57C: -/* 026FC 8098B57C 0C00BBC5 */ jal func_8002EF14 +/* 026FC 8098B57C 0C00BBC5 */ jal Actor_GetWorld /* 02700 8098B580 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 /* 02704 8098B584 3C068099 */ lui $a2, %hi(D_8098CFB8) ## $a2 = 80990000 /* 02708 8098B588 24C6CFB8 */ addiu $a2, $a2, %lo(D_8098CFB8) ## $a2 = 8098CFB8 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s index 7cabb0a268..bdb5fc0ab2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s @@ -54,11 +54,11 @@ glabel DemoKekkai_Init /* 000C8 8098D098 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000CC 8098D09C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000D0 8098D0A0 0C0189B7 */ jal Collider_CylinderUpdate +/* 000D0 8098D0A0 0C0189B7 */ jal Collider_UpdateCylinder /* 000D4 8098D0A4 8FA50020 */ lw $a1, 0x0020($sp) /* 000D8 8098D0A8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000DC 8098D0AC 0C0189B7 */ jal Collider_CylinderUpdate +/* 000DC 8098D0AC 0C0189B7 */ jal Collider_UpdateCylinder /* 000E0 8098D0B0 8FA50024 */ lw $a1, 0x0024($sp) /* 000E4 8098D0B4 8604001C */ lh $a0, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s index bea5bcbd42..530774a1bf 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s @@ -48,7 +48,7 @@ glabel DemoKekkai_Update /* 006B8 8098D688 8FA60030 */ lw $a2, 0x0030($sp) /* 006BC 8098D68C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 006C0 8098D690 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 006C4 8098D694 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 006C8 8098D698 26060198 */ addiu $a2, $s0, 0x0198 ## $a2 = 00000198 /* 006CC 8098D69C AFA60030 */ sw $a2, 0x0030($sp) @@ -59,7 +59,7 @@ glabel DemoKekkai_Update /* 006DC 8098D6AC 8FA60030 */ lw $a2, 0x0030($sp) /* 006E0 8098D6B0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 006E4 8098D6B4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 006E8 8098D6B8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 006EC 8098D6BC 8E1901F8 */ lw $t9, 0x01F8($s0) ## 000001F8 .L8098D6C0: diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s index 95667f0d8a..fb26e35f1e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s @@ -43,7 +43,7 @@ glabel func_8098D87C /* 00910 8098D8E0 8FA60028 */ lw $a2, 0x0028($sp) /* 00914 8098D8E4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00918 8098D8E8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0091C 8098D8EC 8FA5002C */ lw $a1, 0x002C($sp) /* 00920 8098D8F0 921801A9 */ lbu $t8, 0x01A9($s0) ## 000001A9 /* 00924 8098D8F4 33190002 */ andi $t9, $t8, 0x0002 ## $t9 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s b/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s index 863005637f..91d86301b6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s +++ b/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s @@ -5,7 +5,7 @@ glabel func_809952B8 /* 00674 809952C4 248601C8 */ addiu $a2, $a0, 0x01C8 ## $a2 = 000001C8 /* 00678 809952C8 00C02825 */ or $a1, $a2, $zero ## $a1 = 000001C8 /* 0067C 809952CC AFA6001C */ sw $a2, 0x001C($sp) -/* 00680 809952D0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00680 809952D0 0C0189B7 */ jal Collider_UpdateCylinder /* 00684 809952D4 AFA40020 */ sw $a0, 0x0020($sp) /* 00688 809952D8 8FA40024 */ lw $a0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s b/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s index fea0293dd5..527e005963 100644 --- a/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s +++ b/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s @@ -215,7 +215,7 @@ glabel L80998B6C /* 00490 80998C10 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00494 80998C14 8FA40034 */ lw $a0, 0x0034($sp) .L80998C18: -/* 00498 80998C18 0C00B6E3 */ jal func_8002DB8C +/* 00498 80998C18 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 0049C 80998C1C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 004A0 80998C20 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 004A4 80998C24 44814000 */ mtc1 $at, $f8 ## $f8 = 100.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s index 46dff8f6e2..fafefa2ede 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s @@ -10,8 +10,8 @@ glabel EnAm_Init /* 00150 809AE070 0C01E037 */ jal Actor_ProcessInitChain /* 00154 809AE074 24A50048 */ addiu $a1, $a1, %lo(D_809B0048) ## $a1 = 809B0048 -/* 00158 809AE078 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0015C 809AE07C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00158 809AE078 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0015C 809AE07C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00160 809AE080 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00164 809AE084 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00168 809AE088 0C00AC78 */ jal ActorShape_Init @@ -90,7 +90,7 @@ glabel EnAm_Init /* 00264 809AE184 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00268 809AE188 26251C24 */ addiu $a1, $s1, 0x1C24 ## $a1 = 00001C24 /* 0026C 809AE18C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00270 809AE190 0C00CDD2 */ jal Actor_ChangeType +/* 00270 809AE190 0C00CDD2 */ jal Actor_ChangeCategory /* 00274 809AE194 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 00278 809AE198 0C26B92A */ jal func_809AE4A8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s index 59e320b6ea..6d314f49d5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s @@ -167,17 +167,17 @@ glabel EnAm_Update /* 01D20 809AFC40 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 01D24 809AFC44 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 01D28 809AFC48 3C0741E0 */ lui $a3, 0x41E0 ## $a3 = 41E00000 -/* 01D2C 809AFC4C 0C00B92D */ jal func_8002E4B4 +/* 01D2C 809AFC4C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D30 809AFC50 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 01D34 809AFC54 26510274 */ addiu $s1, $s2, 0x0274 ## $s1 = 00000274 .L809AFC58: /* 01D38 809AFC58 02202825 */ or $a1, $s1, $zero ## $a1 = 00000274 -/* 01D3C 809AFC5C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D3C 809AFC5C 0C0189B7 */ jal Collider_UpdateCylinder /* 01D40 809AFC60 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D44 809AFC64 265002C0 */ addiu $s0, $s2, 0x02C0 ## $s0 = 000002C0 /* 01D48 809AFC68 02002825 */ or $a1, $s0, $zero ## $a1 = 000002C0 -/* 01D4C 809AFC6C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D4C 809AFC6C 0C0189B7 */ jal Collider_UpdateCylinder /* 01D50 809AFC70 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D54 809AFC74 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -186,7 +186,7 @@ glabel EnAm_Update /* 01D60 809AFC80 AFA5005C */ sw $a1, 0x005C($sp) /* 01D64 809AFC84 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 01D68 809AFC88 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01D6C 809AFC8C 02203025 */ or $a2, $s1, $zero ## $a2 = 00000274 /* 01D70 809AFC90 864A001C */ lh $t2, 0x001C($s2) ## 0000001C /* 01D74 809AFC94 3C01809B */ lui $at, %hi(D_809B0180) ## $at = 809B0000 @@ -198,7 +198,7 @@ glabel EnAm_Update /* 01D8C 809AFCAC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D90 809AFCB0 46062202 */ mul.s $f8, $f4, $f6 /* 01D94 809AFCB4 44054000 */ mfc1 $a1, $f8 -/* 01D98 809AFCB8 0C00B56E */ jal Actor_SetHeight +/* 01D98 809AFCB8 0C00B56E */ jal Actor_SetFocus /* 01D9C 809AFCBC 00000000 */ nop /* 01DA0 809AFCC0 924B0114 */ lbu $t3, 0x0114($s2) ## 00000114 @@ -254,7 +254,7 @@ glabel EnAm_Update /* 01E4C 809AFD6C 8FBF004C */ lw $ra, 0x004C($sp) .L809AFD70: /* 01E50 809AFD70 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01E54 809AFD74 02003025 */ or $a2, $s0, $zero ## $a2 = 000002C0 /* 01E58 809AFD78 8FBF004C */ lw $ra, 0x004C($sp) .L809AFD7C: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s index 572a9a305c..87f5822c5c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s @@ -42,7 +42,7 @@ glabel func_809ADF28 /* 000A0 809ADFC0 E608002C */ swc1 $f8, 0x002C($s0) ## 0000002C /* 000A4 809ADFC4 AFA80014 */ sw $t0, 0x0014($sp) /* 000A8 809ADFC8 8FA4004C */ lw $a0, 0x004C($sp) -/* 000AC 809ADFCC 0C00B92D */ jal func_8002E4B4 +/* 000AC 809ADFCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 000B0 809ADFD0 E7A20010 */ swc1 $f2, 0x0010($sp) /* 000B4 809ADFD4 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = FFFFFFE8 /* 000B8 809ADFD8 8D4C0000 */ lw $t4, 0x0000($t2) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s index 26ea0e76dd..1f91231d90 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s @@ -63,7 +63,7 @@ glabel func_809AED8C /* 00F4C 809AEE6C 0C26B89C */ jal func_809AE270 /* 00F50 809AEE70 8FA50034 */ lw $a1, 0x0034($sp) /* 00F54 809AEE74 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F58 809AEE78 0C00B6DB */ jal func_8002DB6C +/* 00F58 809AEE78 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 00F5C 809AEE7C 8FA50028 */ lw $a1, 0x0028($sp) /* 00F60 809AEE80 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00F64 809AEE84 44812000 */ mtc1 $at, $f4 ## $f4 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s index a01539fedc..341a529721 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s @@ -78,7 +78,7 @@ glabel func_809AF0DC /* 012D4 809AF1F4 0C26B89C */ jal func_809AE270 /* 012D8 809AF1F8 8FA5002C */ lw $a1, 0x002C($sp) /* 012DC 809AF1FC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 012E0 809AF200 0C00B6EC */ jal func_8002DBB0 +/* 012E0 809AF200 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 012E4 809AF204 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 012E8 809AF208 3C014370 */ lui $at, 0x4370 ## $at = 43700000 /* 012EC 809AF20C 44815000 */ mtc1 $at, $f10 ## $f10 = 240.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s index d60f94fa59..71de0a96fc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s @@ -30,7 +30,7 @@ glabel func_809AF7CC /* 0191C 809AF83C 2604030C */ addiu $a0, $s0, 0x030C ## $a0 = 0000030C /* 01920 809AF840 8FA50034 */ lw $a1, 0x0034($sp) /* 01924 809AF844 8FA60038 */ lw $a2, 0x0038($sp) -/* 01928 809AF848 0C0189CD */ jal func_80062734 +/* 01928 809AF848 0C0189CD */ jal Collider_SetQuadVertices /* 0192C 809AF84C AFAE0010 */ sw $t6, 0x0010($sp) /* 01930 809AF850 8FBF0024 */ lw $ra, 0x0024($sp) /* 01934 809AF854 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s index 8101dcc6dd..a74687c6af 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s @@ -83,7 +83,7 @@ glabel func_809AF864 /* 01A78 809AF998 ACB80008 */ sw $t8, 0x0008($a1) ## FFFFFFF8 /* 01A7C 809AF99C C7A40024 */ lwc1 $f4, 0x0024($sp) /* 01A80 809AF9A0 46062200 */ add.s $f8, $f4, $f6 -/* 01A84 809AF9A4 0C018B58 */ jal func_80062D60 +/* 01A84 809AF9A4 0C018B58 */ jal CollisionCheck_SpawnShieldParticlesMetal /* 01A88 809AF9A8 E7A80024 */ swc1 $f8, 0x0024($sp) /* 01A8C 809AF9AC 10000010 */ beq $zero, $zero, .L809AF9F0 /* 01A90 809AF9B0 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s index 3534e8669a..38cf5d1f60 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s @@ -18,8 +18,8 @@ glabel EnAnubice_Init /* 0018C 809B12AC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00190 809B12B0 AFBF002C */ sw $ra, 0x002C($sp) /* 00194 809B12B4 AFA5003C */ sw $a1, 0x003C($sp) -/* 00198 809B12B8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0019C 809B12BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00198 809B12B8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0019C 809B12BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001A0 809B12C0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 001A4 809B12C4 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 001A8 809B12C8 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s index 4a5490bf61..be841328b3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s @@ -58,7 +58,7 @@ glabel EnAnubice_Update /* 00CB0 809B1DD0 8FA40064 */ lw $a0, 0x0064($sp) /* 00CB4 809B1DD4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00CB8 809B1DD8 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00CBC 809B1DDC 0C00CDD2 */ jal Actor_ChangeType +/* 00CBC 809B1DDC 0C00CDD2 */ jal Actor_ChangeCategory /* 00CC0 809B1DE0 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C28 /* 00CC4 809B1DE4 8E190004 */ lw $t9, 0x0004($s0) ## 00000004 @@ -90,7 +90,7 @@ glabel EnAnubice_Update /* 00D24 809B1E44 8FA40064 */ lw $a0, 0x0064($sp) /* 00D28 809B1E48 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00D2C 809B1E4C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00D30 809B1E50 0C00CDD2 */ jal Actor_ChangeType +/* 00D30 809B1E50 0C00CDD2 */ jal Actor_ChangeCategory /* 00D34 809B1E54 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00D38 809B1E58 8E0D0004 */ lw $t5, 0x0004($s0) ## 00000004 @@ -223,7 +223,7 @@ glabel EnAnubice_Update /* 00F08 809B2028 AFA90014 */ sw $t1, 0x0014($sp) /* 00F0C 809B202C 8FA40064 */ lw $a0, 0x0064($sp) /* 00F10 809B2030 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00F14 809B2034 0C00B92D */ jal func_8002E4B4 +/* 00F14 809B2034 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F18 809B2038 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 00F1C 809B203C 1000000B */ beq $zero, $zero, .L809B206C /* 00F20 809B2040 8E020250 */ lw $v0, 0x0250($s0) ## 00000250 @@ -235,7 +235,7 @@ glabel EnAnubice_Update /* 00F34 809B2054 44060000 */ mfc1 $a2, $f0 /* 00F38 809B2058 44070000 */ mfc1 $a3, $f0 /* 00F3C 809B205C AFAA0014 */ sw $t2, 0x0014($sp) -/* 00F40 809B2060 0C00B92D */ jal func_8002E4B4 +/* 00F40 809B2060 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F44 809B2064 E7B00010 */ swc1 $f16, 0x0010($sp) /* 00F48 809B2068 8E020250 */ lw $v0, 0x0250($s0) ## 00000250 .L809B206C: @@ -246,12 +246,12 @@ glabel EnAnubice_Update /* 00F5C 809B207C 8FBF0024 */ lw $ra, 0x0024($sp) /* 00F60 809B2080 1182001B */ beq $t4, $v0, .L809B20F0 /* 00F64 809B2084 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F68 809B2088 0C00B56E */ jal Actor_SetHeight +/* 00F68 809B2088 0C00B56E */ jal Actor_SetFocus /* 00F6C 809B208C 8E05027C */ lw $a1, 0x027C($s0) ## 0000027C /* 00F70 809B2090 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 /* 00F74 809B2094 AFA50030 */ sw $a1, 0x0030($sp) -/* 00F78 809B2098 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F78 809B2098 0C0189B7 */ jal Collider_UpdateCylinder /* 00F7C 809B209C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00F80 809B20A0 8FA40064 */ lw $a0, 0x0064($sp) @@ -260,7 +260,7 @@ glabel EnAnubice_Update /* 00F8C 809B20AC 00812821 */ addu $a1, $a0, $at /* 00F90 809B20B0 AFA50034 */ sw $a1, 0x0034($sp) /* 00F94 809B20B4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F98 809B20B8 8FA60030 */ lw $a2, 0x0030($sp) /* 00F9C 809B20BC 860D0262 */ lh $t5, 0x0262($s0) ## 00000262 /* 00FA0 809B20C0 8FA50034 */ lw $a1, 0x0034($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s index ad89c1e682..960fed7dd8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s @@ -62,7 +62,7 @@ glabel EnAnubiceFire_Update /* 00820 809B2DC0 8FA4004C */ lw $a0, 0x004C($sp) /* 00824 809B2DC4 E7A40010 */ swc1 $f4, 0x0010($sp) /* 00828 809B2DC8 AFAC0014 */ sw $t4, 0x0014($sp) -/* 0082C 809B2DCC 0C00B92D */ jal func_8002E4B4 +/* 0082C 809B2DCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00830 809B2DD0 AFA8002C */ sw $t0, 0x002C($sp) /* 00834 809B2DD4 3C01809B */ lui $at, %hi(D_809B32E8) ## $at = 809B0000 /* 00838 809B2DD8 C42632E8 */ lwc1 $f6, %lo(D_809B32E8)($at) @@ -100,7 +100,7 @@ glabel EnAnubiceFire_Update /* 008B8 809B2E58 44189000 */ mfc1 $t8, $f18 /* 008BC 809B2E5C 1120000E */ beq $t1, $zero, .L809B2E98 /* 008C0 809B2E60 A61801EC */ sh $t8, 0x01EC($s0) ## 000001EC -/* 008C4 809B2E64 0C0189B7 */ jal Collider_CylinderUpdate +/* 008C4 809B2E64 0C0189B7 */ jal Collider_UpdateCylinder /* 008C8 809B2E68 AFA50028 */ sw $a1, 0x0028($sp) /* 008CC 809B2E6C 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s index f8ec9eeb7b..465f1fc888 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s @@ -167,7 +167,7 @@ glabel EnBa_Draw /* 01B08 809B7E58 16350006 */ bne $s1, $s5, .L809B7E74 /* 01B0C 809B7E5C 26500320 */ addiu $s0, $s2, 0x0320 ## $s0 = 00000320 /* 01B10 809B7E60 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 01B14 809B7E64 0C018A29 */ jal func_800628A4 +/* 01B14 809B7E64 0C018A29 */ jal Collider_UpdateSpheres /* 01B18 809B7E68 02002825 */ or $a1, $s0, $zero ## $a1 = 00000320 /* 01B1C 809B7E6C 10000009 */ beq $zero, $zero, .L809B7E94 /* 01B20 809B7E70 00000000 */ nop @@ -178,7 +178,7 @@ glabel EnBa_Draw /* 01B30 809B7E80 0C0342A3 */ jal Matrix_Scale /* 01B34 809B7E84 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 01B38 809B7E88 24040008 */ addiu $a0, $zero, 0x0008 ## $a0 = 00000008 -/* 01B3C 809B7E8C 0C018A29 */ jal func_800628A4 +/* 01B3C 809B7E8C 0C018A29 */ jal Collider_UpdateSpheres /* 01B40 809B7E90 02002825 */ or $a1, $s0, $zero ## $a1 = 00000320 .L809B7E94: /* 01B44 809B7E94 3C05809C */ lui $a1, %hi(D_809B8140) ## $a1 = 809C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s index 4b5d0ec76a..f9bc640244 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s @@ -86,8 +86,8 @@ glabel EnBa_Init /* 00148 809B6498 10000025 */ beq $zero, $zero, .L809B6530 /* 0014C 809B649C 8FBF0024 */ lw $ra, 0x0024($sp) .L809B64A0: -/* 00150 809B64A0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00154 809B64A4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00150 809B64A0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00154 809B64A4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00158 809B64A8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0015C 809B64AC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s index 0944f0e6d0..d6528c0220 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s @@ -50,7 +50,7 @@ glabel func_809B6A44 /* 0078C 809B6ADC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00790 809B6AE0 3C0641F0 */ lui $a2, 0x41F0 ## $a2 = 41F00000 /* 00794 809B6AE4 3C0741E0 */ lui $a3, 0x41E0 ## $a3 = 41E00000 -/* 00798 809B6AE8 0C00B92D */ jal func_8002E4B4 +/* 00798 809B6AE8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0079C 809B6AEC E7A60010 */ swc1 $f6, 0x0010($sp) .L809B6AF0: /* 007A0 809B6AF0 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s index 628b7db595..36e70ff1a3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s @@ -77,8 +77,8 @@ glabel EnBdfire_Init /* 000F8 809BC128 0C26F00C */ jal func_809BC030 /* 000FC 809BC12C 24A5C598 */ addiu $a1, $a1, %lo(func_809BC598) ## $a1 = FFFFC598 /* 00100 809BC130 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00104 809BC134 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00108 809BC138 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00104 809BC134 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00108 809BC138 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0010C 809BC13C 44050000 */ mfc1 $a1, $f0 /* 00110 809BC140 44070000 */ mfc1 $a3, $f0 /* 00114 809BC144 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s index a747f63b6e..a6092f133c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s @@ -68,7 +68,7 @@ glabel EnBigokuta_Init /* 000E4 809BCD44 3C06809C */ lui $a2, %hi(D_809BF460) ## $a2 = 809C0000 /* 000E8 809BCD48 24C6F460 */ addiu $a2, $a2, %lo(D_809BF460) ## $a2 = 809BF460 /* 000EC 809BCD4C 24A5F468 */ addiu $a1, $a1, %lo(D_809BF468) ## $a1 = 809BF468 -/* 000F0 809BCD50 0C0187B5 */ jal func_80061ED4 +/* 000F0 809BCD50 0C0187B5 */ jal CollisionCheck_SetInfo /* 000F4 809BCD54 26440098 */ addiu $a0, $s2, 0x0098 ## $a0 = 00000098 /* 000F8 809BCD58 8649001C */ lh $t1, 0x001C($s2) ## 0000001C /* 000FC 809BCD5C 24100001 */ addiu $s0, $zero, 0x0001 ## $s0 = 00000001 @@ -77,7 +77,7 @@ glabel EnBigokuta_Init /* 00108 809BCD68 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0010C 809BCD6C 26651C24 */ addiu $a1, $s3, 0x1C24 ## $a1 = 00001C24 /* 00110 809BCD70 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 00114 809BCD74 0C00CDD2 */ jal Actor_ChangeType +/* 00114 809BCD74 0C00CDD2 */ jal Actor_ChangeCategory /* 00118 809BCD78 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 /* 0011C 809BCD7C 0C26F4C6 */ jal func_809BD318 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s index 62b3f6ac46..e1f1338844 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s @@ -67,7 +67,7 @@ glabel EnBigokuta_Update /* 01E60 809BEAC0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01E64 809BEAC4 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 01E68 809BEAC8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01E6C 809BEACC 02203025 */ or $a2, $s1, $zero ## $a2 = 000002EC /* 01E70 809BEAD0 2610004C */ addiu $s0, $s0, 0x004C ## $s0 = 00000098 /* 01E74 809BEAD4 1615FFFA */ bne $s0, $s5, .L809BEAC0 @@ -104,7 +104,7 @@ glabel EnBigokuta_Update /* 01EDC 809BEB3C 2686028C */ addiu $a2, $s4, 0x028C ## $a2 = 0000028C /* 01EE0 809BEB40 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01EE4 809BEB44 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01EE8 809BEB48 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 01EEC 809BEB4C 10000005 */ beq $zero, $zero, .L809BEB64 /* 01EF0 809BEB50 3C0141C8 */ lui $at, 0x41C8 ## $at = 41C80000 @@ -123,7 +123,7 @@ glabel EnBigokuta_Update /* 01F18 809BEB78 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 01F1C 809BEB7C 460A4402 */ mul.s $f16, $f8, $f10 /* 01F20 809BEB80 44058000 */ mfc1 $a1, $f16 -/* 01F24 809BEB84 0C00B56E */ jal Actor_SetHeight +/* 01F24 809BEB84 0C00B56E */ jal Actor_SetFocus /* 01F28 809BEB88 00000000 */ nop /* 01F2C 809BEB8C 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s index e665a6cabc..4022cc9260 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s @@ -4,7 +4,7 @@ glabel func_809BD7F0 /* 00B98 809BD7F8 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 /* 00B9C 809BD7FC 8CA41C44 */ lw $a0, 0x1C44($a1) ## 00001C44 /* 00BA0 809BD800 AFA60018 */ sw $a2, 0x0018($sp) -/* 00BA4 809BD804 0C00B6B0 */ jal func_8002DAC0 +/* 00BA4 809BD804 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00BA8 809BD808 24C50008 */ addiu $a1, $a2, 0x0008 ## $a1 = 00000008 /* 00BAC 809BD80C 8FA40018 */ lw $a0, 0x0018($sp) /* 00BB0 809BD810 808F0194 */ lb $t7, 0x0194($a0) ## 00000194 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s index e3c3e98f05..b9d367f237 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s @@ -29,7 +29,7 @@ glabel func_809BDAE8 /* 00EEC 809BDB4C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00EF0 809BDB50 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 /* 00EF4 809BDB54 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 -/* 00EF8 809BDB58 0C00CDD2 */ jal Actor_ChangeType +/* 00EF8 809BDB58 0C00CDD2 */ jal Actor_ChangeCategory /* 00EFC 809BDB5C E604000C */ swc1 $f4, 0x000C($s0) ## 0000000C /* 00F00 809BDB60 240F0002 */ addiu $t7, $zero, 0x0002 ## $t7 = 00000002 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s index 03960b0136..181f57d9ad 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s @@ -57,7 +57,7 @@ glabel func_809BDC08 /* 01044 809BDCA4 1000009F */ beq $zero, $zero, .L809BDF24 /* 01048 809BDCA8 8FBF001C */ lw $ra, 0x001C($sp) .L809BDCAC: -/* 0104C 809BDCAC 0C00B6EC */ jal func_8002DBB0 +/* 0104C 809BDCAC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 01050 809BDCB0 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 01054 809BDCB4 3C014334 */ lui $at, 0x4334 ## $at = 43340000 /* 01058 809BDCB8 44812000 */ mtc1 $at, $f4 ## $f4 = 180.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s index b16da98f67..5fbbe15366 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s @@ -8,8 +8,8 @@ glabel EnBili_Init /* 00018 809BF8B8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 809BF8BC 24A51698 */ addiu $a1, $a1, %lo(D_809C1698) ## $a1 = 809C1698 -/* 00020 809BF8C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 809BF8C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 809BF8C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 809BF8C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809BF8C8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809BF8CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00030 809BF8D0 0C00AC78 */ jal ActorShape_Init @@ -47,7 +47,7 @@ glabel EnBili_Init /* 000A0 809BF940 3C06809C */ lui $a2, %hi(D_809C166C) ## $a2 = 809C0000 /* 000A4 809BF944 24C6166C */ addiu $a2, $a2, %lo(D_809C166C) ## $a2 = 809C166C /* 000A8 809BF948 24A51678 */ addiu $a1, $a1, %lo(D_809C1678) ## $a1 = 809C1678 -/* 000AC 809BF94C 0C0187BF */ jal func_80061EFC +/* 000AC 809BF94C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 000B0 809BF950 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000B4 809BF954 8608001C */ lh $t0, 0x001C($s0) ## 0000001C /* 000B8 809BF958 2401FFFF */ addiu $at, $zero, 0xFFFF ## $at = FFFFFFFF diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s index 4cfcaf322f..a4a18aa4af 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s @@ -86,11 +86,11 @@ glabel EnBili_Update /* 014C8 809C0D68 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 014CC 809C0D6C 46803220 */ cvt.s.w $f8, $f6 /* 014D0 809C0D70 44072000 */ mfc1 $a3, $f4 -/* 014D4 809C0D74 0C00B92D */ jal func_8002E4B4 +/* 014D4 809C0D74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 014D8 809C0D78 E7A80010 */ swc1 $f8, 0x0010($sp) /* 014DC 809C0D7C 260501D4 */ addiu $a1, $s0, 0x01D4 ## $a1 = 000001D4 /* 014E0 809C0D80 AFA50028 */ sw $a1, 0x0028($sp) -/* 014E4 809C0D84 0C0189B7 */ jal Collider_CylinderUpdate +/* 014E4 809C0D84 0C0189B7 */ jal Collider_UpdateCylinder /* 014E8 809C0D88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 014EC 809C0D8C 920A01E4 */ lbu $t2, 0x01E4($s0) ## 000001E4 @@ -119,10 +119,10 @@ glabel EnBili_Update .L809C0DDC: /* 0153C 809C0DDC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01540 809C0DE0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01544 809C0DE4 8FA60028 */ lw $a2, 0x0028($sp) /* 01548 809C0DE8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0154C 809C0DEC 0C00B56E */ jal Actor_SetHeight +/* 0154C 809C0DEC 0C00B56E */ jal Actor_SetFocus /* 01550 809C0DF0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 01554 809C0DF4 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s index 338471e990..a57378e1a9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s @@ -12,14 +12,14 @@ glabel func_809BFBC4 .L809BFBEC: /* 0034C 809BFBEC 8E0501DC */ lw $a1, 0x01DC($s0) ## 000001DC /* 00350 809BFBF0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00354 809BFBF4 0C00B6B0 */ jal func_8002DAC0 +/* 00354 809BFBF4 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00358 809BFBF8 24A50100 */ addiu $a1, $a1, 0x0100 ## $a1 = 00000100 /* 0035C 809BFBFC 8E0501DC */ lw $a1, 0x01DC($s0) ## 000001DC /* 00360 809BFC00 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 00364 809BFC04 00417821 */ addu $t7, $v0, $at /* 00368 809BFC08 A60F0032 */ sh $t7, 0x0032($s0) ## 00000032 /* 0036C 809BFC0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00370 809BFC10 0C00B6CA */ jal func_8002DB28 +/* 00370 809BFC10 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00374 809BFC14 24A50100 */ addiu $a1, $a1, 0x0100 ## $a1 = 00000100 /* 00378 809BFC18 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 /* 0037C 809BFC1C 44812000 */ mtc1 $at, $f4 ## $f4 = 5.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s index 92deb175b6..fca7a5e528 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s @@ -106,11 +106,11 @@ glabel EnBomChu_Update /* 00F30 809C6760 13380003 */ beq $t9, $t8, .L809C6770 /* 00F34 809C6764 8FA6002C */ lw $a2, 0x002C($sp) /* 00F38 809C6768 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F3C 809C676C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 .L809C6770: /* 00F40 809C6770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F44 809C6774 0C00B56E */ jal Actor_SetHeight +/* 00F44 809C6774 0C00B56E */ jal Actor_SetFocus /* 00F48 809C6778 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00F4C 809C677C 8E09014C */ lw $t1, 0x014C($s0) ## 0000014C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s index 70b1bcc5cf..4ae510cf57 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s @@ -39,7 +39,7 @@ glabel func_809C5DDC /* 00638 809C5E68 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 0063C 809C5E6C AE08002C */ sw $t0, 0x002C($s0) ## 0000002C /* 00640 809C5E70 AFA90014 */ sw $t1, 0x0014($sp) -/* 00644 809C5E74 0C00B92D */ jal func_8002E4B4 +/* 00644 809C5E74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00648 809C5E78 E7B40010 */ swc1 $f20, 0x0010($sp) /* 0064C 809C5E7C 8FAA0034 */ lw $t2, 0x0034($sp) /* 00650 809C5E80 854B00B6 */ lh $t3, 0x00B6($t2) ## 000000B6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s index 9c158ffe08..5ba28599ae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s @@ -71,7 +71,7 @@ glabel EnBrob_Init /* 000D4 809CABE4 3C06809D */ lui $a2, %hi(D_809CBAAC) ## $a2 = 809D0000 /* 000D8 809CABE8 24C6BAAC */ addiu $a2, $a2, %lo(D_809CBAAC) ## $a2 = 809CBAAC /* 000DC 809CABEC 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 000E0 809CABF0 0C0187B5 */ jal func_80061ED4 +/* 000E0 809CABF0 0C0187B5 */ jal CollisionCheck_SetInfo /* 000E4 809CABF4 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 000E8 809CABF8 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 000EC 809CABFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s index d293c91dbd..8fd43d8a16 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s @@ -173,12 +173,12 @@ glabel EnBrob_Update /* 00DC8 809CB8D8 AFA50034 */ sw $a1, 0x0034($sp) /* 00DCC 809CB8DC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00DD0 809CB8E0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00DD4 809CB8E4 26060228 */ addiu $a2, $s0, 0x0228 ## $a2 = 00000228 /* 00DD8 809CB8E8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00DDC 809CB8EC 8FA50034 */ lw $a1, 0x0034($sp) /* 00DE0 809CB8F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00DE4 809CB8F4 8FA60030 */ lw $a2, 0x0030($sp) .L809CB8F8: /* 00DE8 809CB8F8 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s index 2b55bed368..a42b19297d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s @@ -573,7 +573,7 @@ glabel EnClearTag_Update /* 00E0C 809D43BC 0C00B5FB */ jal func_8002D7EC /* 00E10 809D43C0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00E14 809D43C4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00E18 809D43C8 0C00B56E */ jal Actor_SetHeight +/* 00E18 809D43C8 0C00B56E */ jal Actor_SetFocus /* 00E1C 809D43CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00E20 809D43D0 240F0014 */ addiu $t7, $zero, 0x0014 ## $t7 = 00000014 @@ -584,7 +584,7 @@ glabel EnClearTag_Update /* 00E34 809D43E4 A63801D6 */ sh $t8, 0x01D6($s1) ## 000001D6 /* 00E38 809D43E8 A63901D8 */ sh $t9, 0x01D8($s1) ## 000001D8 /* 00E3C 809D43EC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000194 -/* 00E40 809D43F0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00E40 809D43F0 0C0189B7 */ jal Collider_UpdateCylinder /* 00E44 809D43F4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00E48 809D43F8 8FA400CC */ lw $a0, 0x00CC($sp) @@ -610,7 +610,7 @@ glabel EnClearTag_Update /* 00E90 809D4440 240A0005 */ addiu $t2, $zero, 0x0005 ## $t2 = 00000005 /* 00E94 809D4444 AFAA0014 */ sw $t2, 0x0014($sp) /* 00E98 809D4448 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 00E9C 809D444C 0C00B92D */ jal func_8002E4B4 +/* 00E9C 809D444C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00EA0 809D4450 E7A80010 */ swc1 $f8, 0x0010($sp) /* 00EA4 809D4454 0C274EE0 */ jal func_809D3B80 /* 00EA8 809D4458 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 @@ -680,7 +680,7 @@ glabel EnClearTag_Update /* 00F8C 809D453C A63801D6 */ sh $t8, 0x01D6($s1) ## 000001D6 /* 00F90 809D4540 A63901D8 */ sh $t9, 0x01D8($s1) ## 000001D8 /* 00F94 809D4544 02002825 */ or $a1, $s0, $zero ## $a1 = 00000194 -/* 00F98 809D4548 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F98 809D4548 0C0189B7 */ jal Collider_UpdateCylinder /* 00F9C 809D454C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00FA0 809D4550 8FA400CC */ lw $a0, 0x00CC($sp) @@ -698,7 +698,7 @@ glabel EnClearTag_Update /* 00FCC 809D457C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 /* 00FD0 809D4580 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 00FD4 809D4584 3C0742A0 */ lui $a3, 0x42A0 ## $a3 = 42A00000 -/* 00FD8 809D4588 0C00B92D */ jal func_8002E4B4 +/* 00FD8 809D4588 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00FDC 809D458C E7AA0010 */ swc1 $f10, 0x0010($sp) /* 00FE0 809D4590 962A0088 */ lhu $t2, 0x0088($s1) ## 00000088 /* 00FE4 809D4594 93AC00C7 */ lbu $t4, 0x00C7($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s index 194b9d50af..ae3dc0d7ea 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s @@ -13,8 +13,8 @@ glabel EnCs_Init /* 00148 809E19F8 10000056 */ beq $zero, $zero, .L809E1B54 /* 0014C 809E19FC 8FBF002C */ lw $ra, 0x002C($sp) .L809E1A00: -/* 00150 809E1A00 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00154 809E1A04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00150 809E1A00 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00154 809E1A04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00158 809E1A08 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0015C 809E1A0C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00160 809E1A10 0C00AC78 */ jal ActorShape_Init @@ -49,7 +49,7 @@ glabel EnCs_Init /* 001C8 809E1A78 3C06809E */ lui $a2, %hi(D_809E28EC) ## $a2 = 809E0000 /* 001CC 809E1A7C 24C628EC */ addiu $a2, $a2, %lo(D_809E28EC) ## $a2 = 809E28EC /* 001D0 809E1A80 24A528F8 */ addiu $a1, $a1, %lo(D_809E28F8) ## $a1 = 809E28F8 -/* 001D4 809E1A84 0C0187BF */ jal func_80061EFC +/* 001D4 809E1A84 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001D8 809E1A88 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001DC 809E1A8C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001E0 809E1A90 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 @@ -58,7 +58,7 @@ glabel EnCs_Init /* 001EC 809E1A9C 44070000 */ mfc1 $a3, $f0 /* 001F0 809E1AA0 8FA4004C */ lw $a0, 0x004C($sp) /* 001F4 809E1AA4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001F8 809E1AA8 0C00B92D */ jal func_8002E4B4 +/* 001F8 809E1AA8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001FC 809E1AAC E7A00010 */ swc1 $f0, 0x0010($sp) /* 00200 809E1AB0 3C03809E */ lui $v1, %hi(D_809E2918) ## $v1 = 809E0000 /* 00204 809E1AB4 24632918 */ addiu $v1, $v1, %lo(D_809E2918) ## $v1 = 809E2918 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s index ef0765d552..825c164cae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s @@ -62,7 +62,7 @@ glabel EnCs_Update .L809E24F8: /* 00C48 809E24F8 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00C4C 809E24FC AFA60024 */ sw $a2, 0x0024($sp) -/* 00C50 809E2500 0C0189B7 */ jal Collider_CylinderUpdate +/* 00C50 809E2500 0C0189B7 */ jal Collider_UpdateCylinder /* 00C54 809E2504 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00C58 809E2508 8FA40034 */ lw $a0, 0x0034($sp) @@ -70,7 +70,7 @@ glabel EnCs_Update /* 00C60 809E2510 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00C64 809E2514 8FA60024 */ lw $a2, 0x0024($sp) /* 00C68 809E2518 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C6C 809E251C 00812821 */ addu $a1, $a0, $at /* 00C70 809E2520 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00C74 809E2524 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s index be2f0ef4c5..4343d83d13 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s @@ -132,7 +132,7 @@ glabel func_809E1F20 /* 00844 809E20F4 44070000 */ mfc1 $a3, $f0 /* 00848 809E20F8 8FA4007C */ lw $a0, 0x007C($sp) /* 0084C 809E20FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00850 809E2100 0C00B92D */ jal func_8002E4B4 +/* 00850 809E2100 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00854 809E2104 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00858 809E2108 8FBF004C */ lw $ra, 0x004C($sp) /* 0085C 809E210C D7B40020 */ ldc1 $f20, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s index 39e6be0370..ac0f2634ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s @@ -74,8 +74,8 @@ glabel EnDaikuKakariko_Init /* 001B0 809E44D0 35AE0008 */ ori $t6, $t5, 0x0008 ## $t6 = 00000008 /* 001B4 809E44D4 A60E0200 */ sh $t6, 0x0200($s0) ## 00000200 .L809E44D8: -/* 001B8 809E44D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001BC 809E44DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001B8 809E44D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001BC 809E44DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001C0 809E44E0 0C00AC78 */ jal ActorShape_Init /* 001C4 809E44E4 3C074220 */ lui $a3, 0x4220 ## $a3 = 42200000 @@ -108,7 +108,7 @@ glabel EnDaikuKakariko_Init /* 00228 809E4548 3C06809E */ lui $a2, %hi(D_809E54DC) ## $a2 = 809E0000 /* 0022C 809E454C 24C654DC */ addiu $a2, $a2, %lo(D_809E54DC) ## $a2 = 809E54DC /* 00230 809E4550 24A554E8 */ addiu $a1, $a1, %lo(D_809E54E8) ## $a1 = 809E54E8 -/* 00234 809E4554 0C0187BF */ jal func_80061EFC +/* 00234 809E4554 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00238 809E4558 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 0023C 809E455C 3C03809E */ lui $v1, %hi(D_809E5508) ## $v1 = 809E0000 /* 00240 809E4560 24635508 */ addiu $v1, $v1, %lo(D_809E5508) ## $v1 = 809E5508 @@ -137,7 +137,7 @@ glabel EnDaikuKakariko_Init /* 00294 809E45B4 44070000 */ mfc1 $a3, $f0 /* 00298 809E45B8 8FA4004C */ lw $a0, 0x004C($sp) /* 0029C 809E45BC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 002A0 809E45C0 0C00B92D */ jal func_8002E4B4 +/* 002A0 809E45C0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 002A4 809E45C4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 002A8 809E45C8 3C014040 */ lui $at, 0x4040 ## $at = 40400000 /* 002AC 809E45CC 44818000 */ mtc1 $at, $f16 ## $f16 = 3.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s index 82792e9788..52444c1cfd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s @@ -28,7 +28,7 @@ glabel EnDaikuKakariko_Update .L809E4FA0: /* 00C80 809E4FA0 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00C84 809E4FA4 AFA6002C */ sw $a2, 0x002C($sp) -/* 00C88 809E4FA8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00C88 809E4FA8 0C0189B7 */ jal Collider_UpdateCylinder /* 00C8C 809E4FAC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00C90 809E4FB0 96080200 */ lhu $t0, 0x0200($s0) ## 00000200 @@ -48,7 +48,7 @@ glabel EnDaikuKakariko_Update /* 00CC4 809E4FE4 8FA40044 */ lw $a0, 0x0044($sp) /* 00CC8 809E4FE8 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00CCC 809E4FEC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00CD0 809E4FF0 00812821 */ addu $a1, $a0, $at /* 00CD4 809E4FF4 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00CD8 809E4FF8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s index 866d39163e..64d02f9a83 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s @@ -186,7 +186,7 @@ glabel func_809E4BC4 /* 00B40 809E4E60 4407A000 */ mfc1 $a3, $f20 /* 00B44 809E4E64 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 /* 00B48 809E4E68 AFA80014 */ sw $t0, 0x0014($sp) -/* 00B4C 809E4E6C 0C00B92D */ jal func_8002E4B4 +/* 00B4C 809E4E6C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B50 809E4E70 E7B40010 */ swc1 $f20, 0x0010($sp) /* 00B54 809E4E74 10000017 */ beq $zero, $zero, .L809E4ED4 /* 00B58 809E4E78 00000000 */ nop @@ -209,7 +209,7 @@ glabel func_809E4BC4 /* 00B94 809E4EB4 4406A000 */ mfc1 $a2, $f20 /* 00B98 809E4EB8 4407A000 */ mfc1 $a3, $f20 /* 00B9C 809E4EBC E7B40010 */ swc1 $f20, 0x0010($sp) -/* 00BA0 809E4EC0 0C00B92D */ jal func_8002E4B4 +/* 00BA0 809E4EC0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00BA4 809E4EC4 AFAF0014 */ sw $t7, 0x0014($sp) /* 00BA8 809E4EC8 96190202 */ lhu $t9, 0x0202($s0) ## 00000202 /* 00BAC 809E4ECC 332EFFFE */ andi $t6, $t9, 0xFFFE ## $t6 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s index a6783ae65e..55ab2e3983 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s @@ -8,8 +8,8 @@ glabel EnDekubaba_Init /* 00018 809E57E8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 809E57EC 24A59020 */ addiu $a1, $a1, %lo(D_809E9020) ## $a1 = 809E9020 -/* 00020 809E57F0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 809E57F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 809E57F0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 809E57F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809E57F8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809E57FC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00030 809E5800 0C00AC78 */ jal ActorShape_Init @@ -92,7 +92,7 @@ glabel EnDekubaba_Init /* 00154 809E5924 3C01809F */ lui $at, %hi(D_809E9000+0x1B) ## $at = 809F0000 /* 00158 809E5928 A028901B */ sb $t0, %lo(D_809E9000+0x1B)($at) .L809E592C: -/* 0015C 809E592C 0C0187B5 */ jal func_80061ED4 +/* 0015C 809E592C 0C0187B5 */ jal CollisionCheck_SetInfo /* 00160 809E5930 24A59000 */ addiu $a1, $a1, %lo(D_809E9000) ## $a1 = 809E9000 /* 00164 809E5934 24090004 */ addiu $t1, $zero, 0x0004 ## $t1 = 00000004 /* 00168 809E5938 240A0008 */ addiu $t2, $zero, 0x0008 ## $t2 = 00000008 @@ -132,7 +132,7 @@ glabel EnDekubaba_Init /* 001E4 809E59B4 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001E8 809E59B8 A0398FFB */ sb $t9, %lo(D_809E8FE0+0x1B)($at) .L809E59BC: -/* 001EC 809E59BC 0C0187B5 */ jal func_80061ED4 +/* 001EC 809E59BC 0C0187B5 */ jal CollisionCheck_SetInfo /* 001F0 809E59C0 24C68FD8 */ addiu $a2, $a2, %lo(D_809E8FD8) ## $a2 = 809E8FD8 /* 001F4 809E59C4 24080007 */ addiu $t0, $zero, 0x0007 ## $t0 = 00000007 /* 001F8 809E59C8 24090001 */ addiu $t1, $zero, 0x0001 ## $t1 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s index 1eaa28382f..1196648f6e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s @@ -41,7 +41,7 @@ glabel EnDekubaba_Update /* 02CB4 809E8484 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02CB8 809E8488 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02CBC 809E848C 44074000 */ mfc1 $a3, $f8 -/* 02CC0 809E8490 0C00B92D */ jal func_8002E4B4 +/* 02CC0 809E8490 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02CC4 809E8494 00000000 */ nop /* 02CC8 809E8498 3C03809F */ lui $v1, %hi(func_809E80D8) ## $v1 = 809F0000 /* 02CCC 809E849C 10000013 */ beq $zero, $zero, .L809E84EC @@ -57,7 +57,7 @@ glabel EnDekubaba_Update /* 02CF0 809E84C0 44070000 */ mfc1 $a3, $f0 /* 02CF4 809E84C4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02CF8 809E84C8 AFA3002C */ sw $v1, 0x002C($sp) -/* 02CFC 809E84CC 0C00B92D */ jal func_8002E4B4 +/* 02CFC 809E84CC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02D00 809E84D0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02D04 809E84D4 8E0A0234 */ lw $t2, 0x0234($s0) ## 00000234 /* 02D08 809E84D8 8FA3002C */ lw $v1, 0x002C($sp) @@ -105,7 +105,7 @@ glabel EnDekubaba_Update /* 02D98 809E8568 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02D9C 809E856C 02212821 */ addu $a1, $s1, $at /* 02DA0 809E8570 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02DA4 809E8574 26060238 */ addiu $a2, $s0, 0x0238 ## $a2 = 00000238 .L809E8578: /* 02DA8 809E8578 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s index bb7da8cd72..de15b64a7a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s @@ -22,7 +22,7 @@ glabel func_809E645C /* 00CD8 809E64A8 E4C400BC */ swc1 $f4, 0x00BC($a2) ## 000000BC /* 00CDC 809E64AC E4C0006C */ swc1 $f0, 0x006C($a2) ## 0000006C /* 00CE0 809E64B0 E4C00060 */ swc1 $f0, 0x0060($a2) ## 00000060 -/* 00CE4 809E64B4 0C00CDD2 */ jal Actor_ChangeType +/* 00CE4 809E64B4 0C00CDD2 */ jal Actor_ChangeCategory /* 00CE8 809E64B8 E4C600C4 */ swc1 $f6, 0x00C4($a2) ## 000000C4 /* 00CEC 809E64BC 8FA60018 */ lw $a2, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s index 46a3529b8c..886116dbac 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s @@ -78,7 +78,7 @@ glabel func_809E858C /* 02EA4 809E8674 AE2802C0 */ sw $t0, 0x02C0($s1) ## 000002C0 /* 02EA8 809E8678 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02EAC 809E867C AC4A0004 */ sw $t2, 0x0004($v0) ## 00000004 -/* 02EB0 809E8680 0C00B56E */ jal Actor_SetHeight +/* 02EB0 809E8680 0C00B56E */ jal Actor_SetFocus /* 02EB4 809E8684 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 /* 02EB8 809E8688 8FAB004C */ lw $t3, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s index 47821fe53a..e859fdc542 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s @@ -157,10 +157,10 @@ glabel func_809E86B8 /* 030EC 809E88BC AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 /* 030F0 809E88C0 8EB80000 */ lw $t8, 0x0000($s5) ## 809E902C /* 030F4 809E88C4 03C02825 */ or $a1, $s8, $zero ## $a1 = 00000238 -/* 030F8 809E88C8 0C018A29 */ jal func_800628A4 +/* 030F8 809E88C8 0C018A29 */ jal Collider_UpdateSpheres /* 030FC 809E88CC AC580004 */ sw $t8, 0x0004($v0) ## 00000004 /* 03100 809E88D0 02E02025 */ or $a0, $s7, $zero ## $a0 = 00000034 -/* 03104 809E88D4 0C018A29 */ jal func_800628A4 +/* 03104 809E88D4 0C018A29 */ jal Collider_UpdateSpheres /* 03108 809E88D8 03C02825 */ or $a1, $s8, $zero ## $a1 = 00000238 /* 0310C 809E88DC 16400015 */ bne $s2, $zero, .L809E8934 /* 03110 809E88E0 2A410002 */ slti $at, $s2, 0x0002 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s index cefec32a76..70bb6d5eae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s @@ -57,10 +57,10 @@ glabel func_809E89E4 /* 032B8 809E8A88 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 /* 032BC 809E8A8C 8FB00040 */ lw $s0, 0x0040($sp) /* 032C0 809E8A90 26100238 */ addiu $s0, $s0, 0x0238 ## $s0 = 00000238 -/* 032C4 809E8A94 0C018A29 */ jal func_800628A4 +/* 032C4 809E8A94 0C018A29 */ jal Collider_UpdateSpheres /* 032C8 809E8A98 02002825 */ or $a1, $s0, $zero ## $a1 = 00000238 /* 032CC 809E8A9C 24040038 */ addiu $a0, $zero, 0x0038 ## $a0 = 00000038 -/* 032D0 809E8AA0 0C018A29 */ jal func_800628A4 +/* 032D0 809E8AA0 0C018A29 */ jal Collider_UpdateSpheres /* 032D4 809E8AA4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000238 /* 032D8 809E8AA8 8FAB0044 */ lw $t3, 0x0044($sp) /* 032DC 809E8AAC 3C06809F */ lui $a2, %hi(D_809E90E0) ## $a2 = 809F0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s index 1b5746ae94..48305b615c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s @@ -8,7 +8,7 @@ glabel func_809E8C0C /* 03454 809E8C24 14A10004 */ bne $a1, $at, .L809E8C38 /* 03458 809E8C28 AFA70024 */ sw $a3, 0x0024($sp) /* 0345C 809E8C2C 8FA50028 */ lw $a1, 0x0028($sp) -/* 03460 809E8C30 0C018A29 */ jal func_800628A4 +/* 03460 809E8C30 0C018A29 */ jal Collider_UpdateSpheres /* 03464 809E8C34 24A50238 */ addiu $a1, $a1, 0x0238 ## $a1 = 00000238 .L809E8C38: /* 03468 809E8C38 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s index e8de6a162c..06baad4492 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s @@ -20,8 +20,8 @@ glabel EnDekunuts_Init /* 00044 809E95A4 10000043 */ beq $zero, $zero, .L809E96B4 /* 00048 809E95A8 AE180004 */ sw $t8, 0x0004($s0) ## 00000004 .L809E95AC: -/* 0004C 809E95AC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00050 809E95B0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0004C 809E95AC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00050 809E95B0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00054 809E95B4 0C00AC78 */ jal ActorShape_Init /* 00058 809E95B8 3C07420C */ lui $a3, 0x420C ## $a3 = 420C0000 @@ -55,7 +55,7 @@ glabel EnDekunuts_Init /* 000BC 809E961C 3C06809F */ lui $a2, %hi(D_809EAB7C) ## $a2 = 809F0000 /* 000C0 809E9620 24C6AB7C */ addiu $a2, $a2, %lo(D_809EAB7C) ## $a2 = 809EAB7C /* 000C4 809E9624 24A5AB84 */ addiu $a1, $a1, %lo(D_809EAB84) ## $a1 = 809EAB84 -/* 000C8 809E9628 0C0187B5 */ jal func_80061ED4 +/* 000C8 809E9628 0C0187B5 */ jal CollisionCheck_SetInfo /* 000CC 809E962C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000D0 809E9630 860A001C */ lh $t2, 0x001C($s0) ## 0000001C /* 000D4 809E9634 860D001C */ lh $t5, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s index e410fde47c..547fba78a4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s @@ -30,11 +30,11 @@ glabel EnDekunuts_Update /* 01338 809EA898 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 0133C 809EA89C 46803220 */ cvt.s.w $f8, $f6 /* 01340 809EA8A0 44072000 */ mfc1 $a3, $f4 -/* 01344 809EA8A4 0C00B92D */ jal func_8002E4B4 +/* 01344 809EA8A4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01348 809EA8A8 E7A80010 */ swc1 $f8, 0x0010($sp) /* 0134C 809EA8AC 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 /* 01350 809EA8B0 AFA50028 */ sw $a1, 0x0028($sp) -/* 01354 809EA8B4 0C0189B7 */ jal Collider_CylinderUpdate +/* 01354 809EA8B4 0C0189B7 */ jal Collider_UpdateCylinder /* 01358 809EA8B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0135C 809EA8BC 920902D9 */ lbu $t1, 0x02D9($s0) ## 000002D9 @@ -53,7 +53,7 @@ glabel EnDekunuts_Update /* 01388 809EA8E8 02212821 */ addu $a1, $s1, $at /* 0138C 809EA8EC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01390 809EA8F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01394 809EA8F4 8FA60028 */ lw $a2, 0x0028($sp) /* 01398 809EA8F8 8E030190 */ lw $v1, 0x0190($s0) ## 00000190 /* 0139C 809EA8FC 3C0B809F */ lui $t3, %hi(func_809E9B98) ## $t3 = 809F0000 @@ -61,7 +61,7 @@ glabel EnDekunuts_Update /* 013A4 809EA904 15630006 */ bne $t3, $v1, .L809EA920 /* 013A8 809EA908 3C0C809F */ lui $t4, %hi(func_809EA0C4) ## $t4 = 809F0000 /* 013AC 809EA90C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 013B0 809EA910 0C00B56E */ jal Actor_SetHeight +/* 013B0 809EA910 0C00B56E */ jal Actor_SetFocus /* 013B4 809EA914 8E050164 */ lw $a1, 0x0164($s0) ## 00000164 /* 013B8 809EA918 10000018 */ beq $zero, $zero, .L809EA97C @@ -84,13 +84,13 @@ glabel EnDekunuts_Update /* 013F4 809EA954 46048183 */ div.s $f6, $f16, $f4 /* 013F8 809EA958 46060201 */ sub.s $f8, $f0, $f6 /* 013FC 809EA95C 44054000 */ mfc1 $a1, $f8 -/* 01400 809EA960 0C00B56E */ jal Actor_SetHeight +/* 01400 809EA960 0C00B56E */ jal Actor_SetFocus /* 01404 809EA964 00000000 */ nop /* 01408 809EA968 10000004 */ beq $zero, $zero, .L809EA97C /* 0140C 809EA96C 8FBF0024 */ lw $ra, 0x0024($sp) .L809EA970: -/* 01410 809EA970 0C00B56E */ jal Actor_SetHeight +/* 01410 809EA970 0C00B56E */ jal Actor_SetFocus /* 01414 809EA974 3C0541A0 */ lui $a1, 0x41A0 ## $a1 = 41A00000 .L809EA978: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s index dca6af31ec..caff6840be 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s @@ -21,7 +21,7 @@ glabel func_809E99D8 /* 004C4 809E9A24 10000006 */ beq $zero, $zero, .L809E9A40 /* 004C8 809E9A28 A6080032 */ sh $t0, 0x0032($s0) ## 00000032 .L809E9A2C: -/* 004CC 809E9A2C 0C00B69E */ jal func_8002DA78 +/* 004CC 809E9A2C 0C00B69E */ jal Actor_WorldYawTowardActor /* 004D0 809E9A30 8E0502D0 */ lw $a1, 0x02D0($s0) ## 000002D0 /* 004D4 809E9A34 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 004D8 809E9A38 00414821 */ addu $t1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s index 1bac1b0133..d663dbe4f9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s @@ -49,7 +49,7 @@ glabel func_809EA240 /* 00D84 809EA2E4 30480020 */ andi $t0, $v0, 0x0020 ## $t0 = 00000000 /* 00D88 809EA2E8 11000005 */ beq $t0, $zero, .L809EA300 /* 00D8C 809EA2EC 30490008 */ andi $t1, $v0, 0x0008 ## $t1 = 00000000 -/* 00D90 809EA2F0 0C00B6B0 */ jal func_8002DAC0 +/* 00D90 809EA2F0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00D94 809EA2F4 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00D98 809EA2F8 10000035 */ beq $zero, $zero, .L809EA3D0 /* 00D9C 809EA2FC A6020198 */ sh $v0, 0x0198($s0) ## 00000198 @@ -64,7 +64,7 @@ glabel func_809EA240 /* 00DB8 809EA318 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00DBC 809EA31C 55600029 */ bnel $t3, $zero, .L809EA3C4 /* 00DC0 809EA320 860E008A */ lh $t6, 0x008A($s0) ## 0000008A -/* 00DC4 809EA324 0C00B6B0 */ jal func_8002DAC0 +/* 00DC4 809EA324 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00DC8 809EA328 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00DCC 809EA32C 8605008A */ lh $a1, 0x008A($s0) ## 0000008A /* 00DD0 809EA330 00451823 */ subu $v1, $v0, $a1 @@ -121,7 +121,7 @@ glabel func_809EA240 /* 00E80 809EA3E0 1500001D */ bne $t0, $zero, .L809EA458 /* 00E84 809EA3E4 A61900B6 */ sh $t9, 0x00B6($s0) ## 000000B6 /* 00E88 809EA3E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00E8C 809EA3EC 0C00B6EC */ jal func_8002DBB0 +/* 00E8C 809EA3EC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 00E90 809EA3F0 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00E94 809EA3F4 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 /* 00E98 809EA3F8 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s index 096d15ddfc..6aaab0d8c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s @@ -79,7 +79,7 @@ glabel func_809EA5B0 /* 0117C 809EA6DC 26251C24 */ addiu $a1, $s1, 0x1C24 ## $a1 = 00001C24 /* 01180 809EA6E0 10C00003 */ beq $a2, $zero, .L809EA6F0 /* 01184 809EA6E4 00000000 */ nop -/* 01188 809EA6E8 0C00CDD2 */ jal Actor_ChangeType +/* 01188 809EA6E8 0C00CDD2 */ jal Actor_ChangeCategory /* 0118C 809EA6EC 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 .L809EA6F0: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s index 03b7295e32..3770cd772c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s @@ -29,8 +29,8 @@ glabel EnDivingGame_Init /* 00010 809ED880 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 809ED884 AFBF002C */ sw $ra, 0x002C($sp) /* 00018 809ED888 AFA5003C */ sw $a1, 0x003C($sp) -/* 0001C 809ED88C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00020 809ED890 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0001C 809ED88C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00020 809ED890 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00024 809ED894 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00028 809ED898 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809ED89C 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s index 6dae03039f..9b845e993b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s @@ -63,7 +63,7 @@ glabel EnDivingGame_Update /* 013F4 809EEC64 0320F809 */ jalr $ra, $t9 /* 013F8 809EEC68 00000000 */ nop /* 013FC 809EEC6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01400 809EEC70 0C00B56E */ jal Actor_SetHeight +/* 01400 809EEC70 0C00B56E */ jal Actor_SetFocus /* 01404 809EEC74 3C0542A0 */ lui $a1, 0x42A0 ## $a1 = 42A00000 /* 01408 809EEC78 8FAB003C */ lw $t3, 0x003C($sp) @@ -129,12 +129,12 @@ glabel EnDivingGame_Update /* 014F4 809EED64 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 014F8 809EED68 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 014FC 809EED6C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 01500 809EED70 0C00B92D */ jal func_8002E4B4 +/* 01500 809EED70 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01504 809EED74 E7B20010 */ swc1 $f18, 0x0010($sp) /* 01508 809EED78 2606034C */ addiu $a2, $s0, 0x034C ## $a2 = 0000034C /* 0150C 809EED7C 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000034C /* 01510 809EED80 AFA6002C */ sw $a2, 0x002C($sp) -/* 01514 809EED84 0C0189B7 */ jal Collider_CylinderUpdate +/* 01514 809EED84 0C0189B7 */ jal Collider_UpdateCylinder /* 01518 809EED88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0151C 809EED8C 8FA4004C */ lw $a0, 0x004C($sp) @@ -142,7 +142,7 @@ glabel EnDivingGame_Update /* 01524 809EED94 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01528 809EED98 8FA6002C */ lw $a2, 0x002C($sp) /* 0152C 809EED9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01530 809EEDA0 00812821 */ addu $a1, $a0, $at /* 01534 809EEDA4 8FBF0024 */ lw $ra, 0x0024($sp) /* 01538 809EEDA8 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s index ab11f08aa4..103d6b1225 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s @@ -15,10 +15,10 @@ glabel EnDntJiji_Init /* 0000C 809F1AEC AFA5003C */ sw $a1, 0x003C($sp) /* 00010 809F1AF0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 809F1AF4 AFBF002C */ sw $ra, 0x002C($sp) -/* 00018 809F1AF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00018 809F1AF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0001C 809F1AFC 44050000 */ mfc1 $a1, $f0 /* 00020 809F1B00 44070000 */ mfc1 $a3, $f0 -/* 00024 809F1B04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 809F1B04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809F1B08 0C00AC78 */ jal ActorShape_Init /* 0002C 809F1B0C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s index b6c6f15a77..317d63dffa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s @@ -82,7 +82,7 @@ glabel EnDntJiji_Update .L809F2D04: /* 01224 809F2D04 51E00004 */ beql $t7, $zero, .L809F2D18 /* 01228 809F2D08 8618024E */ lh $t8, 0x024E($s0) ## 0000024E -/* 0122C 809F2D0C 0C00B56E */ jal Actor_SetHeight +/* 0122C 809F2D0C 0C00B56E */ jal Actor_SetFocus /* 01230 809F2D10 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 01234 809F2D14 8618024E */ lh $t8, 0x024E($s0) ## 0000024E @@ -130,12 +130,12 @@ glabel EnDntJiji_Update /* 012C4 809F2DA4 AFB80014 */ sw $t8, 0x0014($sp) /* 012C8 809F2DA8 8FA4003C */ lw $a0, 0x003C($sp) /* 012CC 809F2DAC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 012D0 809F2DB0 0C00B92D */ jal func_8002E4B4 +/* 012D0 809F2DB0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 012D4 809F2DB4 E7A60010 */ swc1 $f6, 0x0010($sp) /* 012D8 809F2DB8 2606025C */ addiu $a2, $s0, 0x025C ## $a2 = 0000025C /* 012DC 809F2DBC 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000025C /* 012E0 809F2DC0 AFA60028 */ sw $a2, 0x0028($sp) -/* 012E4 809F2DC4 0C0189B7 */ jal Collider_CylinderUpdate +/* 012E4 809F2DC4 0C0189B7 */ jal Collider_UpdateCylinder /* 012E8 809F2DC8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 012EC 809F2DCC 9208023C */ lbu $t0, 0x023C($s0) ## 0000023C @@ -145,7 +145,7 @@ glabel EnDntJiji_Update /* 012FC 809F2DDC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 01300 809F2DE0 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01304 809F2DE4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01308 809F2DE8 00812821 */ addu $a1, $a0, $at .L809F2DEC: /* 0130C 809F2DEC 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s index e5c4eb78d6..c4e3280982 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s @@ -171,7 +171,7 @@ glabel L809F57B0 /* 02580 809F5840 AFA80014 */ sw $t0, 0x0014($sp) /* 02584 809F5844 8FA4003C */ lw $a0, 0x003C($sp) /* 02588 809F5848 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0258C 809F584C 0C00B92D */ jal func_8002E4B4 +/* 0258C 809F584C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02590 809F5850 E7A60010 */ swc1 $f6, 0x0010($sp) /* 02594 809F5854 8609026A */ lh $t1, 0x026A($s0) ## 0000026A /* 02598 809F5858 26060314 */ addiu $a2, $s0, 0x0314 ## $a2 = 00000314 @@ -184,7 +184,7 @@ glabel L809F57B0 /* 025B4 809F5874 AFA4002C */ sw $a0, 0x002C($sp) /* 025B8 809F5878 26050228 */ addiu $a1, $s0, 0x0228 ## $a1 = 00000228 /* 025BC 809F587C 26060234 */ addiu $a2, $s0, 0x0234 ## $a2 = 00000234 -/* 025C0 809F5880 0C0189CD */ jal func_80062734 +/* 025C0 809F5880 0C0189CD */ jal Collider_SetQuadVertices /* 025C4 809F5884 26070240 */ addiu $a3, $s0, 0x0240 ## $a3 = 00000240 /* 025C8 809F5888 8FA4003C */ lw $a0, 0x003C($sp) /* 025CC 809F588C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -196,7 +196,7 @@ glabel L809F57B0 /* 025E0 809F58A0 1000000C */ beq $zero, $zero, .L809F58D4 /* 025E4 809F58A4 8FBF0024 */ lw $ra, 0x0024($sp) .L809F58A8: -/* 025E8 809F58A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 025E8 809F58A8 0C0189B7 */ jal Collider_UpdateCylinder /* 025EC 809F58AC AFA6002C */ sw $a2, 0x002C($sp) /* 025F0 809F58B0 920B0218 */ lbu $t3, 0x0218($s0) ## 00000218 @@ -206,7 +206,7 @@ glabel L809F57B0 /* 02600 809F58C0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 02604 809F58C4 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 02608 809F58C8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0260C 809F58CC 00812821 */ addu $a1, $a0, $at .L809F58D0: /* 02610 809F58D0 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s index 971097550c..ffa021d6dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s @@ -22,14 +22,14 @@ glabel func_809F3480 /* 0020C 809F34CC 01194021 */ addu $t0, $t0, $t9 /* 00210 809F34D0 8D0817B4 */ lw $t0, 0x17B4($t0) ## 000117B4 /* 00214 809F34D4 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00218 809F34D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00218 809F34D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0021C 809F34DC 01014821 */ addu $t1, $t0, $at /* 00220 809F34E0 3C018016 */ lui $at, %hi(gSegments+0x18) /* 00224 809F34E4 AC296FC0 */ sw $t1, %lo(gSegments+0x18)($at) /* 00228 809F34E8 820A0279 */ lb $t2, 0x0279($s0) ## 00000279 /* 0022C 809F34EC 44050000 */ mfc1 $a1, $f0 /* 00230 809F34F0 44070000 */ mfc1 $a3, $f0 -/* 00234 809F34F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00234 809F34F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00238 809F34F8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0023C 809F34FC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s index c491ae7d83..fc222b3dc4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s @@ -42,7 +42,7 @@ glabel func_809F50EC /* 01EC4 809F5184 A600025A */ sh $zero, 0x025A($s0) ## 0000025A /* 01EC8 809F5188 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 01ECC 809F518C 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 -/* 01ED0 809F5190 0C00CDD2 */ jal Actor_ChangeType +/* 01ED0 809F5190 0C00CDD2 */ jal Actor_ChangeCategory /* 01ED4 809F5194 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 01ED8 809F5198 3C0B809F */ lui $t3, %hi(func_809F51B8) ## $t3 = 809F0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s index e453b72c09..b8fb93d85f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s @@ -42,7 +42,7 @@ glabel EnDodojr_Init /* 0008C 809F644C 3C06809F */ lui $a2, %hi(D_809F7EDC) ## $a2 = 809F0000 /* 00090 809F6450 24C67EDC */ addiu $a2, $a2, %lo(D_809F7EDC) ## $a2 = 809F7EDC /* 00094 809F6454 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00098 809F6458 0C0187BF */ jal func_80061EFC +/* 00098 809F6458 0C0187BF */ jal CollisionCheck_SetInfo2 /* 0009C 809F645C 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 000A0 809F6460 8E080004 */ lw $t0, 0x0004($s0) ## 00000004 /* 000A4 809F6464 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s index 1f22008a8d..1692b97aea 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s @@ -32,7 +32,7 @@ glabel EnDodojr_Update /* 01940 809F7D00 468031A0 */ cvt.s.w $f6, $f6 /* 01944 809F7D04 44062000 */ mfc1 $a2, $f4 /* 01948 809F7D08 44073000 */ mfc1 $a3, $f6 -/* 0194C 809F7D0C 0C00B92D */ jal func_8002E4B4 +/* 0194C 809F7D0C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01950 809F7D10 00000000 */ nop /* 01954 809F7D14 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 /* 01958 809F7D18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -40,7 +40,7 @@ glabel EnDodojr_Update /* 0195C 809F7D1C 0040F809 */ jalr $ra, $v0 /* 01960 809F7D20 8FA5002C */ lw $a1, 0x002C($sp) /* 01964 809F7D24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01968 809F7D28 0C00B56E */ jal Actor_SetHeight +/* 01968 809F7D28 0C00B56E */ jal Actor_SetFocus /* 0196C 809F7D2C 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 /* 01970 809F7D30 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s index 44affbf7b7..f158391e09 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s @@ -40,8 +40,8 @@ glabel func_809F70E8 /* 00DB8 809F7178 3C0D809F */ lui $t5, %hi(func_809F74C4) ## $t5 = 809F0000 /* 00DBC 809F717C 25AD74C4 */ addiu $t5, $t5, %lo(func_809F74C4) ## $t5 = 809F74C4 /* 00DC0 809F7180 15A20003 */ bne $t5, $v0, .L809F7190 -/* 00DC4 809F7184 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawFunc_Circle) -/* 00DC8 809F7188 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawFunc_Circle) +/* 00DC4 809F7184 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawCircle) +/* 00DC8 809F7188 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawCircle) /* 00DCC 809F718C AE0E00C0 */ sw $t6, 0x00C0($s0) ## 000000C0 .L809F7190: /* 00DD0 809F7190 0C27DC27 */ jal func_809F709C @@ -65,8 +65,8 @@ glabel func_809F70E8 /* 00E0C 809F71CC 250874C4 */ addiu $t0, $t0, %lo(func_809F74C4) ## $t0 = 809F74C4 /* 00E10 809F71D0 15020003 */ bne $t0, $v0, .L809F71E0 .L809F71D4: -/* 00E14 809F71D4 3C098003 */ lui $t1, %hi(ActorShadow_DrawFunc_Circle) -/* 00E18 809F71D8 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawFunc_Circle) +/* 00E14 809F71D4 3C098003 */ lui $t1, %hi(ActorShadow_DrawCircle) +/* 00E18 809F71D8 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawCircle) /* 00E1C 809F71DC AE0900C0 */ sw $t1, 0x00C0($s0) ## 000000C0 .L809F71E0: /* 00E20 809F71E0 920200B1 */ lbu $v0, 0x00B1($s0) ## 000000B1 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s index d8cff6b09f..6073be6d22 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s @@ -4,7 +4,7 @@ glabel func_809F72A4 /* 00EEC 809F72AC AFBF0014 */ sw $ra, 0x0014($sp) /* 00EF0 809F72B0 24850194 */ addiu $a1, $a0, 0x0194 ## $a1 = 00000194 /* 00EF4 809F72B4 AFA50024 */ sw $a1, 0x0024($sp) -/* 00EF8 809F72B8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00EF8 809F72B8 0C0189B7 */ jal Collider_UpdateCylinder /* 00EFC 809F72BC AFA40028 */ sw $a0, 0x0028($sp) /* 00F00 809F72C0 8FA70028 */ lw $a3, 0x0028($sp) @@ -67,7 +67,7 @@ glabel func_809F72A4 /* 00FD0 809F7390 8FA4002C */ lw $a0, 0x002C($sp) .L809F7394: /* 00FD4 809F7394 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00FD8 809F7398 8FA60024 */ lw $a2, 0x0024($sp) .L809F739C: /* 00FDC 809F739C 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s index 51427ad4da..93c2695c48 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s @@ -36,8 +36,8 @@ glabel func_809F74C4 /* 01174 809F7534 8FA50034 */ lw $a1, 0x0034($sp) /* 01178 809F7538 C7A0002C */ lwc1 $f0, 0x002C($sp) /* 0117C 809F753C 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 01180 809F7540 3C188003 */ lui $t8, %hi(ActorShadow_DrawFunc_Circle) -/* 01184 809F7544 2718B5EC */ addiu $t8, %lo(ActorShadow_DrawFunc_Circle) +/* 01180 809F7540 3C188003 */ lui $t8, %hi(ActorShadow_DrawCircle) +/* 01184 809F7544 2718B5EC */ addiu $t8, %lo(ActorShadow_DrawCircle) /* 01188 809F7548 46040032 */ c.eq.s $f0, $f4 /* 0118C 809F754C 3C01809F */ lui $at, %hi(D_809F7F8C) ## $at = 809F0000 /* 01190 809F7550 4502000A */ bc1fl .L809F757C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s index 75e923afa8..32a0f09989 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s @@ -4,8 +4,8 @@ glabel EnDu_Init /* 00584 809FE1B4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00588 809FE1B8 AFBF002C */ sw $ra, 0x002C($sp) /* 0058C 809FE1BC AFA5004C */ sw $a1, 0x004C($sp) -/* 00590 809FE1C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00594 809FE1C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00590 809FE1C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00594 809FE1C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00598 809FE1C8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0059C 809FE1CC 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 005A0 809FE1D0 0C00AC78 */ jal ActorShape_Init @@ -39,7 +39,7 @@ glabel EnDu_Init /* 00600 809FE230 3C0680A0 */ lui $a2, %hi(D_809FF25C) ## $a2 = 80A00000 /* 00604 809FE234 24C6F25C */ addiu $a2, $a2, %lo(D_809FF25C) ## $a2 = 809FF25C /* 00608 809FE238 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 0060C 809FE23C 0C0187BF */ jal func_80061EFC +/* 0060C 809FE23C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00610 809FE240 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 00614 809FE244 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00618 809FE248 0C27F76D */ jal func_809FDDB4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s index c3aafbe926..36de91f064 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s @@ -7,7 +7,7 @@ glabel EnDu_Update /* 01100 809FED30 AFBF0024 */ sw $ra, 0x0024($sp) /* 01104 809FED34 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 01108 809FED38 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 0110C 809FED3C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0110C 809FED3C 0C0189B7 */ jal Collider_UpdateCylinder /* 01110 809FED40 AFA6002C */ sw $a2, 0x002C($sp) /* 01114 809FED44 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnDu_Update /* 0111C 809FED4C 8FA6002C */ lw $a2, 0x002C($sp) /* 01120 809FED50 02212821 */ addu $a1, $s1, $at /* 01124 809FED54 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01128 809FED58 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0112C 809FED5C 8E0F0154 */ lw $t7, 0x0154($s0) ## 00000154 /* 01130 809FED60 3C0E0600 */ lui $t6, %hi(D_060041F4) ## $t6 = 06000000 @@ -69,7 +69,7 @@ glabel EnDu_Update /* 011E0 809FEE10 44070000 */ mfc1 $a3, $f0 /* 011E4 809FEE14 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 011E8 809FEE18 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 011EC 809FEE1C 0C00B92D */ jal func_8002E4B4 +/* 011EC 809FEE1C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 011F0 809FEE20 E7A00010 */ swc1 $f0, 0x0010($sp) /* 011F4 809FEE24 8E030190 */ lw $v1, 0x0190($s0) ## 00000190 /* 011F8 809FEE28 3C0980A0 */ lui $t1, %hi(func_809FE4A4) ## $t1 = 80A00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s index 5ff4a06462..1c3e739589 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s @@ -9,8 +9,8 @@ glabel EnEiyer_Init /* 0001C 809FFFBC 0C01E037 */ jal Actor_ProcessInitChain /* 00020 809FFFC0 24A519C4 */ addiu $a1, $a1, %lo(D_80A019C4) ## $a1 = 80A019C4 -/* 00024 809FFFC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 809FFFC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 809FFFC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 809FFFC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 809FFFCC 262400B4 */ addiu $a0, $s1, 0x00B4 ## $a0 = 000000B4 /* 00030 809FFFD0 3C054416 */ lui $a1, 0x4416 ## $a1 = 44160000 /* 00034 809FFFD4 0C00AC78 */ jal ActorShape_Init @@ -46,7 +46,7 @@ glabel EnEiyer_Init /* 0009C 80A0003C 3C0680A0 */ lui $a2, %hi(D_80A0199C) ## $a2 = 80A00000 /* 000A0 80A00040 24C6199C */ addiu $a2, $a2, %lo(D_80A0199C) ## $a2 = 80A0199C /* 000A4 80A00044 24A519A4 */ addiu $a1, $a1, %lo(D_80A019A4) ## $a1 = 80A019A4 -/* 000A8 80A00048 0C0187B5 */ jal func_80061ED4 +/* 000A8 80A00048 0C0187B5 */ jal CollisionCheck_SetInfo /* 000AC 80A0004C 26240098 */ addiu $a0, $s1, 0x0098 ## $a0 = 00000098 /* 000B0 80A00050 8622001C */ lh $v0, 0x001C($s1) ## 0000001C /* 000B4 80A00054 28410003 */ slti $at, $v0, 0x0003 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s index 01cbe3ee3f..8309858c26 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s @@ -60,7 +60,7 @@ glabel EnEiyer_Update /* 016A4 80A01644 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 016A8 80A01648 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 016AC 80A0164C 3C0741D8 */ lui $a3, 0x41D8 ## $a3 = 41D80000 -/* 016B0 80A01650 0C00B92D */ jal func_8002E4B4 +/* 016B0 80A01650 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 016B4 80A01654 E7A40010 */ swc1 $f4, 0x0010($sp) .L80A01658: /* 016B8 80A01658 8603001C */ lh $v1, 0x001C($s0) ## 0000001C @@ -87,7 +87,7 @@ glabel EnEiyer_Update /* 01700 80A016A0 1483001F */ bne $a0, $v1, .L80A01720 /* 01704 80A016A4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80A016A8: -/* 01708 80A016A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 01708 80A016A8 0C0189B7 */ jal Collider_UpdateCylinder /* 0170C 80A016AC AFA5002C */ sw $a1, 0x002C($sp) /* 01710 80A016B0 92090298 */ lbu $t1, 0x0298($s0) ## 00000298 @@ -121,7 +121,7 @@ glabel EnEiyer_Update /* 01770 80A01710 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01774 80A01714 00812821 */ addu $a1, $a0, $at /* 01778 80A01718 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0177C 80A0171C 8FA6002C */ lw $a2, 0x002C($sp) .L80A01720: /* 01780 80A01720 8E0F0004 */ lw $t7, 0x0004($s0) ## 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s index 5da515bd79..42d7e16394 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s @@ -14,7 +14,7 @@ glabel func_80A00950 /* 009C8 80A00968 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C /* 009CC 80A0096C 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 009D0 80A00970 AFA50020 */ sw $a1, 0x0020($sp) -/* 009D4 80A00974 0C00B6EC */ jal func_8002DBB0 +/* 009D4 80A00974 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 009D8 80A00978 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 009DC 80A0097C 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 009E0 80A00980 44812000 */ mtc1 $at, $f4 ## $f4 = 100.00 @@ -23,7 +23,7 @@ glabel func_80A00950 /* 009EC 80A0098C 00000000 */ nop /* 009F0 80A00990 45020008 */ bc1fl .L80A009B4 /* 009F4 80A00994 860F0032 */ lh $t7, 0x0032($s0) ## 00000032 -/* 009F8 80A00998 0C00B6B0 */ jal func_8002DAC0 +/* 009F8 80A00998 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 009FC 80A0099C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A00 80A009A0 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 00A04 80A009A4 00417021 */ addu $t6, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s index 9c8da318be..b7000073fc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s @@ -26,7 +26,7 @@ glabel func_80A00E8C /* 00F48 80A00EE8 46083280 */ add.s $f10, $f6, $f8 /* 00F4C 80A00EEC E7AA002C */ swc1 $f10, 0x002C($sp) /* 00F50 80A00EF0 C470002C */ lwc1 $f16, 0x002C($v1) ## 0000002C -/* 00F54 80A00EF4 0C00B6CA */ jal func_8002DB28 +/* 00F54 80A00EF4 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00F58 80A00EF8 E7B00030 */ swc1 $f16, 0x0030($sp) /* 00F5C 80A00EFC 00022C00 */ sll $a1, $v0, 16 /* 00F60 80A00F00 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s index 3be6e59479..3b30b984d7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s @@ -771,7 +771,7 @@ glabel func_80A10220 /* 01A2C 80A10C8C 44060000 */ mfc1 $a2, $f0 /* 01A30 80A10C90 44070000 */ mfc1 $a3, $f0 /* 01A34 80A10C94 AFA80014 */ sw $t0, 0x0014($sp) -/* 01A38 80A10C98 0C00B92D */ jal func_8002E4B4 +/* 01A38 80A10C98 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01A3C 80A10C9C E7A40010 */ swc1 $f4, 0x0010($sp) /* 01A40 80A10CA0 960C0088 */ lhu $t4, 0x0088($s0) ## 00000088 /* 01A44 80A10CA4 3C1880A1 */ lui $t8, %hi(D_80A11810) ## $t8 = 80A10000 @@ -883,7 +883,7 @@ glabel func_80A10220 /* 01BC4 80A10E24 8FBF0044 */ lw $ra, 0x0044($sp) .L80A10E28: /* 01BC8 80A10E28 260501B0 */ addiu $a1, $s0, 0x01B0 ## $a1 = 000001B0 -/* 01BCC 80A10E2C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01BCC 80A10E2C 0C0189B7 */ jal Collider_UpdateCylinder /* 01BD0 80A10E30 AFA50050 */ sw $a1, 0x0050($sp) /* 01BD4 80A10E34 3C0480A1 */ lui $a0, %hi(D_80A118CC) ## $a0 = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s index adc1512b59..bb87f12ffb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s @@ -47,11 +47,11 @@ glabel EnFireRock_Init /* 0000C 80A11C2C AFA5003C */ sw $a1, 0x003C($sp) /* 00010 80A11C30 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 /* 00014 80A11C34 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00018 80A11C38 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00018 80A11C38 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0001C 80A11C3C AFAF0030 */ sw $t7, 0x0030($sp) /* 00020 80A11C40 8498001C */ lh $t8, 0x001C($a0) ## 0000001C /* 00024 80A11C44 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00028 80A11C48 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00028 80A11C48 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80A11C4C A498018C */ sh $t8, 0x018C($a0) ## 0000018C /* 00030 80A11C50 8482018C */ lh $v0, 0x018C($a0) ## 0000018C /* 00034 80A11C54 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 @@ -141,7 +141,7 @@ glabel L80A11D14 /* 00150 80A11D70 A60B01D8 */ sh $t3, 0x01D8($s0) ## 000001D8 /* 00154 80A11D74 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00158 80A11D78 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 0015C 80A11D7C 0C00CDD2 */ jal Actor_ChangeType +/* 0015C 80A11D7C 0C00CDD2 */ jal Actor_ChangeCategory /* 00160 80A11D80 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00164 80A11D84 3C0D80A1 */ lui $t5, %hi(func_80A12730) ## $t5 = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s index aa58cc93bd..f86b735b4b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s @@ -104,7 +104,7 @@ glabel EnFireRock_Update /* 00D48 80A12968 AFA80014 */ sw $t0, 0x0014($sp) /* 00D4C 80A1296C 8FA4004C */ lw $a0, 0x004C($sp) /* 00D50 80A12970 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00D54 80A12974 0C00B92D */ jal func_8002E4B4 +/* 00D54 80A12974 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00D58 80A12978 E7A60010 */ swc1 $f6, 0x0010($sp) /* 00D5C 80A1297C 8603018C */ lh $v1, 0x018C($s0) ## 0000018C /* 00D60 80A12980 8E090168 */ lw $t1, 0x0168($s0) ## 00000168 @@ -182,7 +182,7 @@ glabel EnFireRock_Update /* 00E5C 80A12A7C 1040000F */ beq $v0, $zero, .L80A12ABC /* 00E60 80A12A80 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00E64 80A12A84 26050194 */ addiu $a1, $s0, 0x0194 ## $a1 = 00000194 -/* 00E68 80A12A88 0C0189B7 */ jal Collider_CylinderUpdate +/* 00E68 80A12A88 0C0189B7 */ jal Collider_UpdateCylinder /* 00E6C 80A12A8C AFA5002C */ sw $a1, 0x002C($sp) /* 00E70 80A12A90 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s index 16d121f458..1f62d85d8d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s @@ -16,7 +16,7 @@ glabel EnFish_Draw /* 01D64 80A16FE4 AFA00010 */ sw $zero, 0x0010($sp) /* 01D68 80A16FE8 8FA20028 */ lw $v0, 0x0028($sp) /* 01D6C 80A16FEC 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 01D70 80A16FF0 0C018A29 */ jal func_800628A4 +/* 01D70 80A16FF0 0C018A29 */ jal Collider_UpdateSpheres /* 01D74 80A16FF4 2445014C */ addiu $a1, $v0, 0x014C ## $a1 = 0000014C /* 01D78 80A16FF8 8FBF0024 */ lw $ra, 0x0024($sp) /* 01D7C 80A16FFC 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s index 24de815b3f..b4d537f7e8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s @@ -60,14 +60,14 @@ glabel EnFish_Init /* 002A8 80A15528 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 002AC 80A1552C 460A0402 */ mul.s $f16, $f0, $f10 /* 002B0 80A15530 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 002B4 80A15534 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 002B4 80A15534 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 002B8 80A15538 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 /* 002BC 80A1553C 4600848D */ trunc.w.s $f18, $f16 /* 002C0 80A15540 440D9000 */ mfc1 $t5, $f18 /* 002C4 80A15544 1440000B */ bne $v0, $zero, .L80A15574 /* 002C8 80A15548 A60D024E */ sh $t5, 0x024E($s0) ## 0000024E /* 002CC 80A1554C 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 002D0 80A15550 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 002D0 80A15550 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 002D4 80A15554 3C074100 */ lui $a3, 0x4100 ## $a3 = 41000000 /* 002D8 80A15558 35CF0010 */ ori $t7, $t6, 0x0010 ## $t7 = 00000010 /* 002DC 80A1555C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s index a7d99ee3c2..18b8de3d3b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s @@ -51,7 +51,7 @@ glabel func_80A16C68 /* 01A84 80A16D04 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 /* 01A88 80A16D08 3C074080 */ lui $a3, 0x4080 ## $a3 = 40800000 /* 01A8C 80A16D0C AFA20014 */ sw $v0, 0x0014($sp) -/* 01A90 80A16D10 0C00B92D */ jal func_8002E4B4 +/* 01A90 80A16D10 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01A94 80A16D14 E7A40010 */ swc1 $f4, 0x0010($sp) .L80A16D18: /* 01A98 80A16D18 3C01428C */ lui $at, 0x428C ## $at = 428C0000 @@ -65,7 +65,7 @@ glabel func_80A16C68 /* 01AB8 80A16D38 45000003 */ bc1f .L80A16D48 /* 01ABC 80A16D3C 00000000 */ nop /* 01AC0 80A16D40 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01AC4 80A16D44 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C .L80A16D48: /* 01AC8 80A16D48 3C0180A1 */ lui $at, %hi(D_80A171EC) ## $at = 80A10000 @@ -74,7 +74,7 @@ glabel func_80A16C68 /* 01AD4 80A16D54 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01AD8 80A16D58 46105482 */ mul.s $f18, $f10, $f16 /* 01ADC 80A16D5C 44059000 */ mfc1 $a1, $f18 -/* 01AE0 80A16D60 0C00B56E */ jal Actor_SetHeight +/* 01AE0 80A16D60 0C00B56E */ jal Actor_SetFocus /* 01AE4 80A16D64 00000000 */ nop /* 01AE8 80A16D68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s index 6428967414..bcdf597c1d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s @@ -70,7 +70,7 @@ glabel EnFr_Init /* 0015C 80A1AAFC 8FA40024 */ lw $a0, 0x0024($sp) /* 00160 80A1AB00 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00164 80A1AB04 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00168 80A1AB08 0C00CDD2 */ jal Actor_ChangeType +/* 00168 80A1AB08 0C00CDD2 */ jal Actor_ChangeCategory /* 0016C 80A1AB0C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00170 80A1AB10 3C0A80A2 */ lui $t2, %hi(func_80A1BCB4) ## $t2 = 80A20000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s index 832275af58..79431da972 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s @@ -131,7 +131,7 @@ glabel EnFr_Update /* 0046C 80A1AE0C C432D290 */ lwc1 $f18, %lo(D_80A1D290)($at) /* 00470 80A1AE10 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00474 80A1AE14 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 -/* 00478 80A1AE18 0C00B56E */ jal Actor_SetHeight +/* 00478 80A1AE18 0C00B56E */ jal Actor_SetFocus /* 0047C 80A1AE1C E6120070 */ swc1 $f18, 0x0070($s0) ## 00000070 /* 00480 80A1AE20 3C014270 */ lui $at, 0x4270 ## $at = 42700000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s index 6419a95764..e32305d58c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s @@ -31,7 +31,7 @@ glabel func_80A1BB34 /* 011F0 80A1BB90 1000001C */ beq $zero, $zero, .L80A1BC04 /* 011F4 80A1BB94 8FBF001C */ lw $ra, 0x001C($sp) .L80A1BB98: -/* 011F8 80A1BB98 0C00B56E */ jal Actor_SetHeight +/* 011F8 80A1BB98 0C00B56E */ jal Actor_SetFocus /* 011FC 80A1BB9C 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 /* 01200 80A1BBA0 8E190374 */ lw $t9, 0x0374($s0) ## 00000374 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s index fd1b51ea00..6ee28655c3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s @@ -23,7 +23,7 @@ glabel EnFz_Init /* 0004C 80A1FE0C 8FA50020 */ lw $a1, 0x0020($sp) /* 00050 80A1FE10 24E71B90 */ addiu $a3, $a3, %lo(D_80A21B90) ## $a3 = 80A21B90 /* 00054 80A1FE14 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00058 80A1FE18 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00058 80A1FE18 0C017114 */ jal Collider_SetCylinderType1 /* 0005C 80A1FE1C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00060 80A1FE20 2605019C */ addiu $a1, $s0, 0x019C ## $a1 = 0000019C /* 00064 80A1FE24 AFA50020 */ sw $a1, 0x0020($sp) @@ -34,7 +34,7 @@ glabel EnFz_Init /* 00074 80A1FE34 8FA50020 */ lw $a1, 0x0020($sp) /* 00078 80A1FE38 24E71BBC */ addiu $a3, $a3, %lo(D_80A21BBC) ## $a3 = 80A21BBC /* 0007C 80A1FE3C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00080 80A1FE40 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00080 80A1FE40 0C017114 */ jal Collider_SetCylinderType1 /* 00084 80A1FE44 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00088 80A1FE48 260501E8 */ addiu $a1, $s0, 0x01E8 ## $a1 = 000001E8 /* 0008C 80A1FE4C AFA50020 */ sw $a1, 0x0020($sp) @@ -45,7 +45,7 @@ glabel EnFz_Init /* 0009C 80A1FE5C 8FA50020 */ lw $a1, 0x0020($sp) /* 000A0 80A1FE60 24E71BE8 */ addiu $a3, $a3, %lo(D_80A21BE8) ## $a3 = 80A21BE8 /* 000A4 80A1FE64 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 000A8 80A1FE68 0C017114 */ jal Collider_SetCylinder_Set3 +/* 000A8 80A1FE68 0C017114 */ jal Collider_SetCylinderType1 /* 000AC 80A1FE6C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000B0 80A1FE70 3C053C03 */ lui $a1, 0x3C03 ## $a1 = 3C030000 /* 000B4 80A1FE74 34A5126F */ ori $a1, $a1, 0x126F ## $a1 = 3C03126F diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s index 8bd30cae79..46ae6fae32 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s @@ -24,7 +24,7 @@ glabel EnFz_Update /* 0134C 80A2110C 2448FFFF */ addiu $t0, $v0, 0xFFFF ## $t0 = FFFFFFFF /* 01350 80A21110 A2080263 */ sb $t0, 0x0263($s0) ## 00000263 .L80A21114: -/* 01354 80A21114 0C00B56E */ jal Actor_SetHeight +/* 01354 80A21114 0C00B56E */ jal Actor_SetFocus /* 01358 80A21118 3C054248 */ lui $a1, 0x4248 ## $a1 = 42480000 /* 0135C 80A2111C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -40,12 +40,12 @@ glabel EnFz_Update /* 01384 80A21144 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 /* 01388 80A21148 5520001E */ bnel $t1, $zero, .L80A211C4 /* 0138C 80A2114C 3C063E4C */ lui $a2, 0x3E4C ## $a2 = 3E4C0000 -/* 01390 80A21150 0C0189B7 */ jal Collider_CylinderUpdate +/* 01390 80A21150 0C0189B7 */ jal Collider_UpdateCylinder /* 01394 80A21154 AFA50030 */ sw $a1, 0x0030($sp) /* 01398 80A21158 2605019C */ addiu $a1, $s0, 0x019C ## $a1 = 0000019C /* 0139C 80A2115C AFA5002C */ sw $a1, 0x002C($sp) -/* 013A0 80A21160 0C0189B7 */ jal Collider_CylinderUpdate +/* 013A0 80A21160 0C0189B7 */ jal Collider_UpdateCylinder /* 013A4 80A21164 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 013A8 80A21168 920A0248 */ lbu $t2, 0x0248($s0) ## 00000248 @@ -72,7 +72,7 @@ glabel EnFz_Update /* 013F0 80A211B0 02212821 */ addu $a1, $s1, $at /* 013F4 80A211B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 013F8 80A211B8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 013FC 80A211BC 8FA60030 */ lw $a2, 0x0030($sp) /* 01400 80A211C0 3C063E4C */ lui $a2, 0x3E4C ## $a2 = 3E4C0000 .L80A211C4: @@ -94,7 +94,7 @@ glabel EnFz_Update /* 01438 80A211F8 AFAD0014 */ sw $t5, 0x0014($sp) /* 0143C 80A211FC 44060000 */ mfc1 $a2, $f0 /* 01440 80A21200 44070000 */ mfc1 $a3, $f0 -/* 01444 80A21204 0C00B92D */ jal func_8002E4B4 +/* 01444 80A21204 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01448 80A21208 E7A00010 */ swc1 $f0, 0x0010($sp) .L80A2120C: /* 0144C 80A2120C 920E0260 */ lbu $t6, 0x0260($s0) ## 00000260 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s index 7d7ebcf413..a4e1aaf853 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s @@ -122,7 +122,7 @@ glabel func_80A20100 /* 004DC 80A2029C 00000000 */ nop .L80A202A0: /* 004E0 80A202A0 8FA400BC */ lw $a0, 0x00BC($sp) -/* 004E4 80A202A4 0C018B35 */ jal func_80062CD4 +/* 004E4 80A202A4 0C018B35 */ jal CollisionCheck_SpawnShieldParticles /* 004E8 80A202A8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 004EC 80A202AC 8FBF007C */ lw $ra, 0x007C($sp) /* 004F0 80A202B0 D7B40028 */ ldc1 $f20, 0x0028($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s index c7a35900f5..e39040d3fa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s @@ -24,7 +24,7 @@ glabel func_80A20CAC /* 00F44 80A20D04 8FA40024 */ lw $a0, 0x0024($sp) /* 00F48 80A20D08 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00F4C 80A20D0C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00F50 80A20D10 0C00CDD2 */ jal Actor_ChangeType +/* 00F50 80A20D10 0C00CDD2 */ jal Actor_ChangeCategory /* 00F54 80A20D14 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00F58 80A20D18 8FA40024 */ lw $a0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s index abf0e829b4..6084133643 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s @@ -61,7 +61,7 @@ glabel EnGb_Init /* 000F4 80A2F274 24E70690 */ addiu $a3, $a3, %lo(D_80A30690) ## $a3 = 80A30690 /* 000F8 80A2F278 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 000FC 80A2F27C 02002825 */ or $a1, $s0, $zero ## $a1 = 0000023C -/* 00100 80A2F280 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00100 80A2F280 0C017114 */ jal Collider_SetCylinderType1 /* 00104 80A2F284 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 /* 00108 80A2F288 3C1080A3 */ lui $s0, %hi(D_80A306BC) ## $s0 = 80A30000 /* 0010C 80A2F28C 3C1480A3 */ lui $s4, %hi(D_80A30740) ## $s4 = 80A30000 @@ -76,7 +76,7 @@ glabel EnGb_Init /* 00128 80A2F2A8 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0012C 80A2F2AC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000288 /* 00130 80A2F2B0 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 00134 80A2F2B4 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00134 80A2F2B4 0C017114 */ jal Collider_SetCylinderType1 /* 00138 80A2F2B8 02003825 */ or $a3, $s0, $zero ## $a3 = 80A306BC /* 0013C 80A2F2BC 2610002C */ addiu $s0, $s0, 0x002C ## $s0 = 80A306E8 /* 00140 80A2F2C0 0214082B */ sltu $at, $s0, $s4 @@ -116,8 +116,8 @@ glabel EnGb_Init /* 001C4 80A2F344 02002025 */ or $a0, $s0, $zero ## $a0 = 00000370 /* 001C8 80A2F348 4480C000 */ mtc1 $zero, $f24 ## $f24 = 0.00 -/* 001CC 80A2F34C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001D0 80A2F350 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001CC 80A2F34C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001D0 80A2F350 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001D4 80A2F354 4405C000 */ mfc1 $a1, $f24 /* 001D8 80A2F358 264400B4 */ addiu $a0, $s2, 0x00B4 ## $a0 = 000000B4 /* 001DC 80A2F35C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s index da0a61102c..41bcc8095e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s @@ -30,7 +30,7 @@ glabel EnGb_Update /* 00C60 80A2FDE0 02802825 */ or $a1, $s4, $zero ## $a1 = 00000000 /* 00C64 80A2FDE4 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 00C68 80A2FDE8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C6C 80A2FDEC 2646023C */ addiu $a2, $s2, 0x023C ## $a2 = 0000023C /* 00C70 80A2FDF0 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 /* 00C74 80A2FDF4 26510288 */ addiu $s1, $s2, 0x0288 ## $s1 = 00000288 @@ -39,7 +39,7 @@ glabel EnGb_Update /* 00C7C 80A2FDFC 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 00C80 80A2FE00 02802825 */ or $a1, $s4, $zero ## $a1 = 00000000 /* 00C84 80A2FE04 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C88 80A2FE08 02203025 */ or $a2, $s1, $zero ## $a2 = 00000288 /* 00C8C 80A2FE0C 2610004C */ addiu $s0, $s0, 0x004C ## $s0 = 0000004C /* 00C90 80A2FE10 1615FFFA */ bne $s0, $s5, .L80A2FDFC diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s index d6abfc7f9c..ef38c11a81 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s @@ -14,8 +14,8 @@ glabel EnGe1_Init /* 00008 80A30978 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0000C 80A3097C AFBF002C */ sw $ra, 0x002C($sp) /* 00010 80A30980 AFA50044 */ sw $a1, 0x0044($sp) -/* 00014 80A30984 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00018 80A30988 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00014 80A30984 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00018 80A30988 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0001C 80A3098C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00020 80A30990 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00024 80A30994 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s index d72dad1da6..0f88a732c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s @@ -7,7 +7,7 @@ glabel EnGe1_Update /* 01910 80A32280 AFBF0024 */ sw $ra, 0x0024($sp) /* 01914 80A32284 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 01918 80A32288 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0191C 80A3228C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0191C 80A3228C 0C0189B7 */ jal Collider_UpdateCylinder /* 01920 80A32290 AFA6002C */ sw $a2, 0x002C($sp) /* 01924 80A32294 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnGe1_Update /* 0192C 80A3229C 8FA6002C */ lw $a2, 0x002C($sp) /* 01930 80A322A0 02212821 */ addu $a1, $s1, $at /* 01934 80A322A4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01938 80A322A8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0193C 80A322AC 0C00B638 */ jal Actor_MoveForward @@ -28,7 +28,7 @@ glabel EnGe1_Update /* 01958 80A322C8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0195C 80A322CC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01960 80A322D0 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 01964 80A322D4 0C00B92D */ jal func_8002E4B4 +/* 01964 80A322D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01968 80A322D8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0196C 80A322DC 8E1902B8 */ lw $t9, 0x02B8($s0) ## 000002B8 /* 01970 80A322E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s index 7c0b1fd0fb..9ef3a46683 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s @@ -14,8 +14,8 @@ glabel EnGe2_Init /* 000AC 80A32C7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 000B0 80A32C80 AFBF002C */ sw $ra, 0x002C($sp) /* 000B4 80A32C84 AFA50044 */ sw $a1, 0x0044($sp) -/* 000B8 80A32C88 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 000BC 80A32C8C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000B8 80A32C88 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 000BC 80A32C8C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 000C0 80A32C90 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000C4 80A32C94 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 000C8 80A32C98 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s index f05ba08d6b..d97b6aea06 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s @@ -6,7 +6,7 @@ glabel func_80A33BE8 /* 01028 80A33BF8 AFA5003C */ sw $a1, 0x003C($sp) /* 0102C 80A33BFC 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 01030 80A33C00 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 01034 80A33C04 0C0189B7 */ jal Collider_CylinderUpdate +/* 01034 80A33C04 0C0189B7 */ jal Collider_UpdateCylinder /* 01038 80A33C08 AFA6002C */ sw $a2, 0x002C($sp) /* 0103C 80A33C0C 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80A33BE8 /* 01044 80A33C14 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01048 80A33C18 8FA6002C */ lw $a2, 0x002C($sp) /* 0104C 80A33C1C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01050 80A33C20 00812821 */ addu $a1, $a0, $at /* 01054 80A33C24 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 01058 80A33C28 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 @@ -24,7 +24,7 @@ glabel func_80A33BE8 /* 01068 80A33C38 8FA4003C */ lw $a0, 0x003C($sp) /* 0106C 80A33C3C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01070 80A33C40 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 01074 80A33C44 0C00B92D */ jal func_8002E4B4 +/* 01074 80A33C44 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01078 80A33C48 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0107C 80A33C4C 960F02F4 */ lhu $t7, 0x02F4($s0) ## 000002F4 /* 01080 80A33C50 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s index 88e446051d..e5377aa32a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s @@ -6,7 +6,7 @@ glabel func_80A3402C /* 0146C 80A3403C 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 01470 80A34040 AFBF0024 */ sw $ra, 0x0024($sp) /* 01474 80A34044 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 01478 80A34048 0C0189B7 */ jal Collider_CylinderUpdate +/* 01478 80A34048 0C0189B7 */ jal Collider_UpdateCylinder /* 0147C 80A3404C AFA5002C */ sw $a1, 0x002C($sp) /* 01480 80A34050 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel func_80A3402C /* 0148C 80A3405C AFA50028 */ sw $a1, 0x0028($sp) /* 01490 80A34060 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01494 80A34064 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01498 80A34068 8FA6002C */ lw $a2, 0x002C($sp) /* 0149C 80A3406C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 014A0 80A34070 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 @@ -25,7 +25,7 @@ glabel func_80A3402C /* 014B0 80A34080 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 014B4 80A34084 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 014B8 80A34088 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 014BC 80A3408C 0C00B92D */ jal func_8002E4B4 +/* 014BC 80A3408C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 014C0 80A34090 E7A00010 */ swc1 $f0, 0x0010($sp) /* 014C4 80A34094 920F015D */ lbu $t7, 0x015D($s0) ## 0000015D /* 014C8 80A34098 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s index d417ffab9b..552b102ed8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s @@ -4,8 +4,8 @@ glabel EnGe3_Init /* 000AC 80A346CC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 000B0 80A346D0 AFBF002C */ sw $ra, 0x002C($sp) /* 000B4 80A346D4 AFA50044 */ sw $a1, 0x0044($sp) -/* 000B8 80A346D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 000BC 80A346DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000B8 80A346D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 000BC 80A346DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 000C0 80A346E0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000C4 80A346E4 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 000C8 80A346E8 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s index b20c1c9c8e..8fc719d967 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s @@ -6,7 +6,7 @@ glabel func_80A34C40 /* 00630 80A34C50 AFA5003C */ sw $a1, 0x003C($sp) /* 00634 80A34C54 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 00638 80A34C58 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0063C 80A34C5C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0063C 80A34C5C 0C0189B7 */ jal Collider_UpdateCylinder /* 00640 80A34C60 AFA6002C */ sw $a2, 0x002C($sp) /* 00644 80A34C64 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80A34C40 /* 0064C 80A34C6C 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00650 80A34C70 8FA6002C */ lw $a2, 0x002C($sp) /* 00654 80A34C74 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00658 80A34C78 00812821 */ addu $a1, $a0, $at /* 0065C 80A34C7C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 00660 80A34C80 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 @@ -24,7 +24,7 @@ glabel func_80A34C40 /* 00670 80A34C90 8FA4003C */ lw $a0, 0x003C($sp) /* 00674 80A34C94 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00678 80A34C98 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 0067C 80A34C9C 0C00B92D */ jal func_8002E4B4 +/* 0067C 80A34C9C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00680 80A34CA0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00684 80A34CA4 960F030C */ lhu $t7, 0x030C($s0) ## 0000030C /* 00688 80A34CA8 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s index da774f83b5..8751a281c8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s @@ -20,8 +20,8 @@ glabel EnGo_Init /* 01604 80A3FB74 AD0B0000 */ sw $t3, 0x0000($t0) ## FFFFFFE0 /* 01608 80A3FB78 8D2B0008 */ lw $t3, 0x0008($t1) ## 80A41BB0 /* 0160C 80A3FB7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01610 80A3FB80 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 01614 80A3FB84 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 01610 80A3FB80 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 01614 80A3FB84 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 01618 80A3FB88 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 0161C 80A3FB8C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 01620 80A3FB90 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 @@ -56,7 +56,7 @@ glabel EnGo_Init /* 01684 80A3FBF4 3C0680A4 */ lui $a2, %hi(D_80A41B2C) ## $a2 = 80A40000 /* 01688 80A3FBF8 24C61B2C */ addiu $a2, $a2, %lo(D_80A41B2C) ## $a2 = 80A41B2C /* 0168C 80A3FBFC 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 01690 80A3FC00 0C0187BF */ jal func_80061EFC +/* 01690 80A3FC00 0C0187BF */ jal CollisionCheck_SetInfo2 /* 01694 80A3FC04 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 01698 80A3FC08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0169C 80A3FC0C 0C28FBA3 */ jal func_80A3EE8C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s index 586638a4ba..64edf29025 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s @@ -7,7 +7,7 @@ glabel EnGo_Update /* 028F0 80A40E60 AFBF0024 */ sw $ra, 0x0024($sp) /* 028F4 80A40E64 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 028F8 80A40E68 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 028FC 80A40E6C 0C0189B7 */ jal Collider_CylinderUpdate +/* 028FC 80A40E6C 0C0189B7 */ jal Collider_UpdateCylinder /* 02900 80A40E70 AFA6002C */ sw $a2, 0x002C($sp) /* 02904 80A40E74 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnGo_Update /* 0290C 80A40E7C 8FA6002C */ lw $a2, 0x002C($sp) /* 02910 80A40E80 02212821 */ addu $a1, $s1, $at /* 02914 80A40E84 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02918 80A40E88 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0291C 80A40E8C 0C02927F */ jal SkelAnime_Update @@ -53,7 +53,7 @@ glabel EnGo_Update /* 0298C 80A40EFC 44070000 */ mfc1 $a3, $f0 /* 02990 80A40F00 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02994 80A40F04 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02998 80A40F08 0C00B92D */ jal func_8002E4B4 +/* 02998 80A40F08 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0299C 80A40F0C E7A00010 */ swc1 $f0, 0x0010($sp) /* 029A0 80A40F10 0C28FC39 */ jal func_80A3F0E4 /* 029A4 80A40F14 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s index ab306a6b51..19d6a85ac7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s @@ -41,8 +41,8 @@ glabel EnGo2_Init /* 037A4 80A464D4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 037A8 80A464D8 AFBF002C */ sw $ra, 0x002C($sp) /* 037AC 80A464DC AFA50044 */ sw $a1, 0x0044($sp) -/* 037B0 80A464E0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 037B4 80A464E4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 037B0 80A464E0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 037B4 80A464E4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 037B8 80A464E8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 037BC 80A464EC 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 037C0 80A464F0 0C00AC78 */ jal ActorShape_Init @@ -76,7 +76,7 @@ glabel EnGo2_Init /* 03824 80A46554 3C0680A5 */ lui $a2, %hi(D_80A48140) ## $a2 = 80A50000 /* 03828 80A46558 24C68140 */ addiu $a2, $a2, %lo(D_80A48140) ## $a2 = 80A48140 /* 0382C 80A4655C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 03830 80A46560 0C0187BF */ jal func_80061EFC +/* 03830 80A46560 0C0187BF */ jal CollisionCheck_SetInfo2 /* 03834 80A46564 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 03838 80A46568 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 0383C 80A4656C 3328001F */ andi $t0, $t9, 0x001F ## $t0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s index 081b843f76..7915020a64 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s @@ -39,7 +39,7 @@ glabel EnGo2_Update /* 04BEC 80A4791C 46049182 */ mul.s $f6, $f18, $f4 /* 04BF0 80A47920 44065000 */ mfc1 $a2, $f10 /* 04BF4 80A47924 44073000 */ mfc1 $a3, $f6 -/* 04BF8 80A47928 0C00B92D */ jal func_8002E4B4 +/* 04BF8 80A47928 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04BFC 80A4792C 00000000 */ nop /* 04C00 80A47930 86190194 */ lh $t9, 0x0194($s0) ## 00000194 /* 04C04 80A47934 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s index 7203eb892d..52b5896679 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s @@ -79,7 +79,7 @@ glabel func_80A44940 /* 01D3C 80A44A6C A4EF0206 */ sh $t7, 0x0206($a3) ## 00000206 /* 01D40 80A44A70 AFA60018 */ sw $a2, 0x0018($sp) /* 01D44 80A44A74 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01D48 80A44A78 AFA5001C */ sw $a1, 0x001C($sp) /* 01D4C 80A44A7C 8FA5001C */ lw $a1, 0x001C($sp) /* 01D50 80A44A80 8FA60018 */ lw $a2, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s index 1732fc81a7..b4c0b0e870 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s @@ -58,19 +58,19 @@ glabel EnGoma_Init /* 0005C 80A48F1C 28410064 */ slti $at, $v0, 0x0064 /* 00060 80A48F20 14200017 */ bne $at, $zero, .L80A48F80 /* 00064 80A48F24 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 -/* 00068 80A48F28 0C00CDD2 */ jal Actor_ChangeType +/* 00068 80A48F28 0C00CDD2 */ jal Actor_ChangeCategory /* 0006C 80A48F2C 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00070 80A48F30 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 /* 00074 80A48F34 3C1880A5 */ lui $t8, %hi(func_80A4B554) ## $t8 = 80A50000 /* 00078 80A48F38 2718B554 */ addiu $t8, $t8, %lo(func_80A4B554) ## $t8 = 80A4B554 /* 0007C 80A48F3C 24190003 */ addiu $t9, $zero, 0x0003 ## $t9 = 00000003 -/* 00080 80A48F40 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00080 80A48F40 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00084 80A48F44 44051000 */ mfc1 $a1, $f2 /* 00088 80A48F48 44071000 */ mfc1 $a3, $f2 /* 0008C 80A48F4C AE1802B0 */ sw $t8, 0x02B0($s0) ## 000002B0 /* 00090 80A48F50 A61902B8 */ sh $t9, 0x02B8($s0) ## 000002B8 -/* 00094 80A48F54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00094 80A48F54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00098 80A48F58 0C00AC78 */ jal ActorShape_Init /* 0009C 80A48F5C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 @@ -147,8 +147,8 @@ glabel EnGoma_Init /* 001A0 80A49060 C42AB90C */ lwc1 $f10, %lo(D_80A4B90C)($at) /* 001A4 80A49064 46060202 */ mul.s $f8, $f0, $f6 /* 001A8 80A49068 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 -/* 001AC 80A4906C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001B0 80A49070 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001AC 80A4906C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001B0 80A49070 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001B4 80A49074 44051000 */ mfc1 $a1, $f2 /* 001B8 80A49078 44071000 */ mfc1 $a3, $f2 /* 001BC 80A4907C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 @@ -160,8 +160,8 @@ glabel EnGoma_Init /* 001D0 80A49090 8FBF002C */ lw $ra, 0x002C($sp) .L80A49094: /* 001D4 80A49094 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 -/* 001D8 80A49098 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001DC 80A4909C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001D8 80A49098 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001DC 80A4909C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001E0 80A490A0 44051000 */ mfc1 $a1, $f2 /* 001E4 80A490A4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s index 57b4497fe9..1830d81736 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s @@ -106,12 +106,12 @@ glabel EnGoma_Update /* 01D08 80A4ABC8 AFAB0014 */ sw $t3, 0x0014($sp) /* 01D0C 80A4ABCC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01D10 80A4ABD0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01D14 80A4ABD4 0C00B92D */ jal func_8002E4B4 +/* 01D14 80A4ABD4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D18 80A4ABD8 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 01D1C 80A4ABDC 0C292A59 */ jal func_80A4A964 /* 01D20 80A4ABE0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01D24 80A4ABE4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01D28 80A4ABE8 0C00B56E */ jal Actor_SetHeight +/* 01D28 80A4ABE8 0C00B56E */ jal Actor_SetFocus /* 01D2C 80A4ABEC 3C0541A0 */ lui $a1, 0x41A0 ## $a1 = 41A00000 /* 01D30 80A4ABF0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -142,12 +142,12 @@ glabel EnGoma_Update /* 01D8C 80A4AC4C 2605030C */ addiu $a1, $s0, 0x030C ## $a1 = 0000030C /* 01D90 80A4AC50 55000017 */ bnel $t0, $zero, .L80A4ACB0 /* 01D94 80A4AC54 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01D98 80A4AC58 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D98 80A4AC58 0C0189B7 */ jal Collider_UpdateCylinder /* 01D9C 80A4AC5C AFA5002C */ sw $a1, 0x002C($sp) /* 01DA0 80A4AC60 26050358 */ addiu $a1, $s0, 0x0358 ## $a1 = 00000358 /* 01DA4 80A4AC64 AFA50028 */ sw $a1, 0x0028($sp) -/* 01DA8 80A4AC68 0C0189B7 */ jal Collider_CylinderUpdate +/* 01DA8 80A4AC68 0C0189B7 */ jal Collider_UpdateCylinder /* 01DAC 80A4AC6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01DB0 80A4AC70 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -156,7 +156,7 @@ glabel EnGoma_Update /* 01DBC 80A4AC7C AFA50030 */ sw $a1, 0x0030($sp) /* 01DC0 80A4AC80 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01DC4 80A4AC84 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01DC8 80A4AC88 8FA6002C */ lw $a2, 0x002C($sp) /* 01DCC 80A4AC8C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01DD0 80A4AC90 8FA50030 */ lw $a1, 0x0030($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s index 7fdc275f3e..44f59643cd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s @@ -16,7 +16,7 @@ glabel func_80A49338 /* 004A8 80A49368 3C074000 */ lui $a3, 0x4000 ## $a3 = 40000000 /* 004AC 80A4936C 8FAE0024 */ lw $t6, 0x0024($sp) /* 004B0 80A49370 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 004B4 80A49374 0C00B69E */ jal func_8002DA78 +/* 004B4 80A49374 0C00B69E */ jal Actor_WorldYawTowardActor /* 004B8 80A49378 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 004BC 80A4937C 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 004C0 80A49380 00412821 */ addu $a1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s index 48ceb78dad..ce6039369b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s @@ -35,7 +35,7 @@ glabel func_80A498A8 /* 00A60 80A49920 A61802CC */ sh $t8, 0x02CC($s0) ## 000002CC /* 00A64 80A49924 8FB90034 */ lw $t9, 0x0034($sp) /* 00A68 80A49928 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A6C 80A4992C 0C00B69E */ jal func_8002DA78 +/* 00A6C 80A4992C 0C00B69E */ jal Actor_WorldYawTowardActor /* 00A70 80A49930 8F251C44 */ lw $a1, 0x1C44($t9) ## 00001C44 /* 00A74 80A49934 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 /* 00A78 80A49938 860800B6 */ lh $t0, 0x00B6($s0) ## 000000B6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s index ad495350fa..0765a88cb5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s @@ -14,7 +14,7 @@ glabel func_80A4A010 /* 01178 80A4A038 3C064000 */ lui $a2, 0x4000 ## $a2 = 40000000 /* 0117C 80A4A03C 8FAE002C */ lw $t6, 0x002C($sp) /* 01180 80A4A040 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01184 80A4A044 0C00B69E */ jal func_8002DA78 +/* 01184 80A4A044 0C00B69E */ jal Actor_WorldYawTowardActor /* 01188 80A4A048 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 0118C 80A4A04C 00022C00 */ sll $a1, $v0, 16 /* 01190 80A4A050 A7A20026 */ sh $v0, 0x0026($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s index 381e0307c0..c291ae2b6a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s @@ -14,7 +14,7 @@ glabel func_80A4A2EC /* 01454 80A4A314 3C064000 */ lui $a2, 0x4000 ## $a2 = 40000000 /* 01458 80A4A318 8FAE0024 */ lw $t6, 0x0024($sp) /* 0145C 80A4A31C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01460 80A4A320 0C00B69E */ jal func_8002DA78 +/* 01460 80A4A320 0C00B69E */ jal Actor_WorldYawTowardActor /* 01464 80A4A324 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 01468 80A4A328 00022C00 */ sll $a1, $v0, 16 /* 0146C 80A4A32C 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s index 06988e1d8f..9da9381586 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s @@ -5,7 +5,7 @@ glabel func_80A4A608 /* 01754 80A4A614 AFB00014 */ sw $s0, 0x0014($sp) /* 01758 80A4A618 AFA5002C */ sw $a1, 0x002C($sp) /* 0175C 80A4A61C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01760 80A4A620 0C00B69E */ jal func_8002DA78 +/* 01760 80A4A620 0C00B69E */ jal Actor_WorldYawTowardActor /* 01764 80A4A624 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 01768 80A4A628 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 /* 0176C 80A4A62C 8FB8002C */ lw $t8, 0x002C($sp) @@ -13,7 +13,7 @@ glabel func_80A4A608 /* 01774 80A4A634 004F8823 */ subu $s1, $v0, $t7 /* 01778 80A4A638 00118C00 */ sll $s1, $s1, 16 /* 0177C 80A4A63C 00118C03 */ sra $s1, $s1, 16 -/* 01780 80A4A640 0C00B6B8 */ jal func_8002DAE0 +/* 01780 80A4A640 0C00B6B8 */ jal Actor_WorldPitchTowardActor /* 01784 80A4A644 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 01788 80A4A648 861900B4 */ lh $t9, 0x00B4($s0) ## 000000B4 /* 0178C 80A4A64C 2A211771 */ slti $at, $s1, 0x1771 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s index aa98e7d094..76e414e2ac 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s @@ -99,7 +99,7 @@ glabel func_80A4A6AC /* 01948 80A4A808 1000002D */ beq $zero, $zero, .L80A4A8C0 /* 0194C 80A4A80C A60B02C2 */ sh $t3, 0x02C2($s0) ## 000002C2 .L80A4A810: -/* 01950 80A4A810 0C018D74 */ jal func_800635D0 +/* 01950 80A4A810 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 01954 80A4A814 AFA6003C */ sw $a2, 0x003C($sp) /* 01958 80A4A818 8FA6003C */ lw $a2, 0x003C($sp) /* 0195C 80A4A81C 10400009 */ beq $v0, $zero, .L80A4A844 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s index a88f4fb50d..988132d718 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s @@ -48,7 +48,7 @@ glabel func_80A4B554 /* 02738 80A4B5F8 AFAE0014 */ sw $t6, 0x0014($sp) /* 0273C 80A4B5FC 8FA40074 */ lw $a0, 0x0074($sp) /* 02740 80A4B600 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02744 80A4B604 0C00B92D */ jal func_8002E4B4 +/* 02744 80A4B604 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02748 80A4B608 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 0274C 80A4B60C 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 /* 02750 80A4B610 44819000 */ mtc1 $at, $f18 ## $f18 = 5.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s index a06cd3f8b7..e22e285c74 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s @@ -211,8 +211,8 @@ glabel EnHorse_Init /* 01088 80A5C378 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0108C 80A5C37C 3C01C060 */ lui $at, 0xC060 ## $at = C0600000 /* 01090 80A5C380 44815000 */ mtc1 $at, $f10 ## $f10 = -3.50 -/* 01094 80A5C384 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Squiggly) -/* 01098 80A5C388 24C6B644 */ addiu $a2, %lo(ActorShadow_DrawFunc_Squiggly) +/* 01094 80A5C384 3C068003 */ lui $a2, %hi(ActorShadow_DrawHorse) +/* 01098 80A5C388 24C6B644 */ addiu $a2, %lo(ActorShadow_DrawHorse) /* 0109C 80A5C38C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 010A0 80A5C390 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 010A4 80A5C394 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 @@ -265,7 +265,7 @@ glabel EnHorse_Init /* 01148 80A5C438 3C0680A6 */ lui $a2, %hi(D_80A65F38) ## $a2 = 80A60000 /* 0114C 80A5C43C 24C65F38 */ addiu $a2, $a2, %lo(D_80A65F38) ## $a2 = 80A65F38 /* 01150 80A5C440 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 01154 80A5C444 0C0187B5 */ jal func_80061ED4 +/* 01154 80A5C444 0C0187B5 */ jal CollisionCheck_SetInfo /* 01158 80A5C448 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 0115C 80A5C44C 8FA8003C */ lw $t0, 0x003C($sp) /* 01160 80A5C450 3C01428C */ lui $at, 0x428C ## $at = 428C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s index 9becf35c10..a8210cfb2d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s @@ -207,12 +207,12 @@ glabel EnHorse_Update .L80A64998: /* 096A8 80A64998 26050278 */ addiu $a1, $s0, 0x0278 ## $a1 = 00000278 /* 096AC 80A6499C AFA50030 */ sw $a1, 0x0030($sp) -/* 096B0 80A649A0 0C0189B7 */ jal Collider_CylinderUpdate +/* 096B0 80A649A0 0C0189B7 */ jal Collider_UpdateCylinder /* 096B4 80A649A4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 096B8 80A649A8 260502C4 */ addiu $a1, $s0, 0x02C4 ## $a1 = 000002C4 /* 096BC 80A649AC AFA50034 */ sw $a1, 0x0034($sp) -/* 096C0 80A649B0 0C0189B7 */ jal Collider_CylinderUpdate +/* 096C0 80A649B0 0C0189B7 */ jal Collider_UpdateCylinder /* 096C4 80A649B4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 096C8 80A649B8 0C01DE1C */ jal Math_SinS @@ -274,12 +274,12 @@ glabel EnHorse_Update /* 09794 80A64A84 8FA40074 */ lw $a0, 0x0074($sp) /* 09798 80A64A88 8FA50038 */ lw $a1, 0x0038($sp) /* 0979C 80A64A8C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 097A0 80A64A90 8FA60030 */ lw $a2, 0x0030($sp) /* 097A4 80A64A94 8FA40074 */ lw $a0, 0x0074($sp) /* 097A8 80A64A98 8FA50038 */ lw $a1, 0x0038($sp) /* 097AC 80A64A9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 097B0 80A64AA0 8FA60034 */ lw $a2, 0x0034($sp) /* 097B4 80A64AA4 8FA3004C */ lw $v1, 0x004C($sp) /* 097B8 80A64AA8 8C6F067C */ lw $t7, 0x067C($v1) ## 0000067C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s index f55100aa9c..fb4defd7df 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s @@ -175,12 +175,12 @@ glabel func_80A5B61C /* 00574 80A5B864 8FB90074 */ lw $t9, 0x0074($sp) .L80A5B868: /* 00578 80A5B868 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0057C 80A5B86C 0C00B6E3 */ jal func_8002DB8C +/* 0057C 80A5B86C 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 00580 80A5B870 8F251C44 */ lw $a1, 0x1C44($t9) ## 00001C44 /* 00584 80A5B874 8FB80074 */ lw $t8, 0x0074($sp) /* 00588 80A5B878 E7A00050 */ swc1 $f0, 0x0050($sp) /* 0058C 80A5B87C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00590 80A5B880 0C00B69E */ jal func_8002DA78 +/* 00590 80A5B880 0C00B69E */ jal Actor_WorldYawTowardActor /* 00594 80A5B884 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 00598 80A5B888 3C014348 */ lui $at, 0x4348 ## $at = 43480000 /* 0059C 80A5B88C 44814000 */ mtc1 $at, $f8 ## $f8 = 200.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s index 7c4ca630f5..7eb627d830 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s @@ -128,7 +128,7 @@ glabel func_80A5BD94 /* 00C6C 80A5BF5C AE480108 */ sw $t0, 0x0108($s2) ## 00000108 /* 00C70 80A5BF60 86090008 */ lh $t1, 0x0008($s0) ## 80A65F48 /* 00C74 80A5BF64 A6490032 */ sh $t1, 0x0032($s2) ## 00000032 -/* 00C78 80A5BF68 0C00B69E */ jal func_8002DA78 +/* 00C78 80A5BF68 0C00B69E */ jal Actor_WorldYawTowardActor /* 00C7C 80A5BF6C 8EC51C44 */ lw $a1, 0x1C44($s6) ## 00001C44 /* 00C80 80A5BF70 A64200B6 */ sh $v0, 0x00B6($s2) ## 000000B6 /* 00C84 80A5BF74 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s index a25ce552c0..bdccb4bd02 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s @@ -4,7 +4,7 @@ glabel func_80A5F760 /* 04478 80A5F768 AFB00018 */ sw $s0, 0x0018($sp) /* 0447C 80A5F76C 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 04480 80A5F770 24100004 */ addiu $s0, $zero, 0x0004 ## $s0 = 00000004 -/* 04484 80A5F774 0C00B6E3 */ jal func_8002DB8C +/* 04484 80A5F774 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 04488 80A5F778 AFA40020 */ sw $a0, 0x0020($sp) /* 0448C 80A5F77C 3C0143C8 */ lui $at, 0x43C8 ## $at = 43C80000 /* 04490 80A5F780 44811000 */ mtc1 $at, $f2 ## $f2 = 400.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s index 2ad44ae885..a5077ecfaf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s @@ -21,7 +21,7 @@ glabel func_80A5F890 /* 045B8 80A5F8A8 A5C005BE */ sh $zero, 0x05BE($t6) ## 801605BE /* 045BC 80A5F8AC 8FAF0044 */ lw $t7, 0x0044($sp) /* 045C0 80A5F8B0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 045C4 80A5F8B4 0C00B6E3 */ jal func_8002DB8C +/* 045C4 80A5F8B4 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 045C8 80A5F8B8 8DE51C44 */ lw $a1, 0x1C44($t7) ## 00001C44 /* 045CC 80A5F8BC E7A0003C */ swc1 $f0, 0x003C($sp) /* 045D0 80A5F8C0 8E020370 */ lw $v0, 0x0370($s0) ## 00000370 @@ -46,7 +46,7 @@ glabel func_80A5F890 /* 04618 80A5F908 AE0801F0 */ sw $t0, 0x01F0($s0) ## 000001F0 /* 0461C 80A5F90C 8FA90044 */ lw $t1, 0x0044($sp) /* 04620 80A5F910 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04624 80A5F914 0C00B69E */ jal func_8002DA78 +/* 04624 80A5F914 0C00B69E */ jal Actor_WorldYawTowardActor /* 04628 80A5F918 8D251C44 */ lw $a1, 0x1C44($t1) ## 00001C44 /* 0462C 80A5F91C A6020376 */ sh $v0, 0x0376($s0) ## 00000376 /* 04630 80A5F920 860A0376 */ lh $t2, 0x0376($s0) ## 00000376 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s index 366d15de92..67c2b50ac3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s @@ -232,7 +232,7 @@ glabel func_80A61A28 /* 06A4C 80A61D3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 06A50 80A61D40 84A300B6 */ lh $v1, 0x00B6($a1) ## 000000B6 /* 06A54 80A61D44 AFA6004C */ sw $a2, 0x004C($sp) -/* 06A58 80A61D48 0C00B69E */ jal func_8002DA78 +/* 06A58 80A61D48 0C00B69E */ jal Actor_WorldYawTowardActor /* 06A5C 80A61D4C A7A30046 */ sh $v1, 0x0046($sp) /* 06A60 80A61D50 87A30046 */ lh $v1, 0x0046($sp) /* 06A64 80A61D54 18400003 */ blez $v0, .L80A61D64 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s index 65b13e144c..79f5ca537d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s @@ -51,7 +51,7 @@ glabel func_80A634A0 /* 08208 80A634F8 AFB80014 */ sw $t8, 0x0014($sp) /* 0820C 80A634FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 08210 80A63500 3C07420C */ lui $a3, 0x420C ## $a3 = 420C0000 -/* 08214 80A63504 0C00B92D */ jal func_8002E4B4 +/* 08214 80A63504 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 08218 80A63508 E7A40010 */ swc1 $f4, 0x0010($sp) /* 0821C 80A6350C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 08220 80A63510 0C296CBC */ jal func_80A5B2F0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s index 893b7f0864..e1c1c4dc6e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s @@ -10,7 +10,7 @@ glabel func_80A6437C /* 09090 80A64380 AFBF001C */ sw $ra, 0x001C($sp) /* 09094 80A64384 AFB00018 */ sw $s0, 0x0018($sp) /* 09098 80A64388 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0909C 80A6438C 0C00B69E */ jal func_8002DA78 +/* 0909C 80A6438C 0C00B69E */ jal Actor_WorldYawTowardActor /* 090A0 80A64390 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 090A4 80A64394 860E0032 */ lh $t6, 0x0032($s0) ## 00000032 /* 090A8 80A64398 004E2023 */ subu $a0, $v0, $t6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s index f8b895bc3d..d30d321d29 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s @@ -10,7 +10,7 @@ glabel func_80A64F14 /* 09C30 80A64F20 AFA50024 */ sw $a1, 0x0024($sp) /* 09C34 80A64F24 00C08025 */ or $s0, $a2, $zero ## $s0 = 00000000 /* 09C38 80A64F28 AFA40020 */ sw $a0, 0x0020($sp) -/* 09C3C 80A64F2C 0C00B6E3 */ jal func_8002DB8C +/* 09C3C 80A64F2C 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 09C40 80A64F30 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000 /* 09C44 80A64F34 3C014296 */ lui $at, 0x4296 ## $at = 42960000 /* 09C48 80A64F38 44812000 */ mtc1 $at, $f4 ## $f4 = 75.00 @@ -35,7 +35,7 @@ glabel func_80A64F14 /* 09C90 80A64F80 1000001F */ beq $zero, $zero, .L80A65000 /* 09C94 80A64F84 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 .L80A64F88: -/* 09C98 80A64F88 0C00B69E */ jal func_8002DA78 +/* 09C98 80A64F88 0C00B69E */ jal Actor_WorldYawTowardActor /* 09C9C 80A64F8C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 09CA0 80A64F90 860E0032 */ lh $t6, 0x0032($s0) ## 00000032 /* 09CA4 80A64F94 004E2023 */ subu $a0, $v0, $t6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s index 312b1357d2..e8976d3e87 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s @@ -756,7 +756,7 @@ glabel func_80A65108 /* 0A8DC 80A65BCC 00812821 */ addu $a1, $a0, $at /* 0A8E0 80A65BD0 AFA50024 */ sw $a1, 0x0024($sp) /* 0A8E4 80A65BD4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0A8E8 80A65BD8 AFA60020 */ sw $a2, 0x0020($sp) /* 0A8EC 80A65BDC 8FA50024 */ lw $a1, 0x0024($sp) /* 0A8F0 80A65BE0 8FA60020 */ lw $a2, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Destroy.s deleted file mode 100644 index db85d6e5cd..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Destroy.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel EnHy_Destroy -/* 0185C 80A70E0C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 01860 80A70E10 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 01864 80A70E14 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01868 80A70E18 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 0186C 80A70E1C 0C0170EB */ jal Collider_DestroyCylinder - -/* 01870 80A70E20 24C5019C */ addiu $a1, $a2, 0x019C ## $a1 = 0000019C -/* 01874 80A70E24 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01878 80A70E28 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 0187C 80A70E2C 03E00008 */ jr $ra -/* 01880 80A70E30 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Draw.s deleted file mode 100644 index 752c2eaf17..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Draw.s +++ /dev/null @@ -1,199 +0,0 @@ -.rdata -glabel D_80A72850 - .asciz "../z_en_hy.c" - .balign 4 - -glabel D_80A72860 - .asciz "../z_en_hy.c" - .balign 4 - -.late_rodata -glabel jtbl_80A72AA0 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71E38 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71D08 -.word L80A71E38 -.word L80A71D08 -.word L80A71D08 - -.text -glabel EnHy_Draw -/* 02678 80A71C28 27BDFF98 */ addiu $sp, $sp, 0xFF98 ## $sp = FFFFFF98 -/* 0267C 80A71C2C AFBF002C */ sw $ra, 0x002C($sp) -/* 02680 80A71C30 AFB00028 */ sw $s0, 0x0028($sp) -/* 02684 80A71C34 AFA5006C */ sw $a1, 0x006C($sp) -/* 02688 80A71C38 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000 -/* 0268C 80A71C3C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 02690 80A71C40 3C0680A7 */ lui $a2, %hi(D_80A72850) ## $a2 = 80A70000 -/* 02694 80A71C44 24C62850 */ addiu $a2, $a2, %lo(D_80A72850) ## $a2 = 80A72850 -/* 02698 80A71C48 27A40044 */ addiu $a0, $sp, 0x0044 ## $a0 = FFFFFFDC -/* 0269C 80A71C4C 2407090E */ addiu $a3, $zero, 0x090E ## $a3 = 0000090E -/* 026A0 80A71C50 0C031AB1 */ jal Graph_OpenDisps -/* 026A4 80A71C54 AFA50054 */ sw $a1, 0x0054($sp) -/* 026A8 80A71C58 8E180190 */ lw $t8, 0x0190($s0) ## 00000190 -/* 026AC 80A71C5C 3C0F80A7 */ lui $t7, %hi(func_80A70E34) ## $t7 = 80A70000 -/* 026B0 80A71C60 25EF0E34 */ addiu $t7, $t7, %lo(func_80A70E34) ## $t7 = 80A70E34 -/* 026B4 80A71C64 11F80080 */ beq $t7, $t8, .L80A71E68 -/* 026B8 80A71C68 8FB9006C */ lw $t9, 0x006C($sp) -/* 026BC 80A71C6C 0C024F46 */ jal func_80093D18 -/* 026C0 80A71C70 8F240000 */ lw $a0, 0x0000($t9) ## 00000000 -/* 026C4 80A71C74 C60C0264 */ lwc1 $f12, 0x0264($s0) ## 00000264 -/* 026C8 80A71C78 C60E0268 */ lwc1 $f14, 0x0268($s0) ## 00000268 -/* 026CC 80A71C7C 8E06026C */ lw $a2, 0x026C($s0) ## 0000026C -/* 026D0 80A71C80 0C034261 */ jal Matrix_Translate -/* 026D4 80A71C84 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 026D8 80A71C88 860A001C */ lh $t2, 0x001C($s0) ## 0000001C -/* 026DC 80A71C8C 2403000C */ addiu $v1, $zero, 0x000C ## $v1 = 0000000C -/* 026E0 80A71C90 3C0280A7 */ lui $v0, %hi(D_80A722D8) ## $v0 = 80A70000 -/* 026E4 80A71C94 314B007F */ andi $t3, $t2, 0x007F ## $t3 = 00000000 -/* 026E8 80A71C98 01630019 */ multu $t3, $v1 -/* 026EC 80A71C9C 244222D8 */ addiu $v0, $v0, %lo(D_80A722D8) ## $v0 = 80A722D8 -/* 026F0 80A71CA0 27A90060 */ addiu $t1, $sp, 0x0060 ## $t1 = FFFFFFF8 -/* 026F4 80A71CA4 27B8005C */ addiu $t8, $sp, 0x005C ## $t8 = FFFFFFF4 -/* 026F8 80A71CA8 00006012 */ mflo $t4 -/* 026FC 80A71CAC 004C6821 */ addu $t5, $v0, $t4 -/* 02700 80A71CB0 89AF0002 */ lwl $t7, 0x0002($t5) ## 00000002 -/* 02704 80A71CB4 99AF0005 */ lwr $t7, 0x0005($t5) ## 00000005 -/* 02708 80A71CB8 AD2F0000 */ sw $t7, 0x0000($t1) ## FFFFFFF8 -/* 0270C 80A71CBC 8619001C */ lh $t9, 0x001C($s0) ## 0000001C -/* 02710 80A71CC0 332A007F */ andi $t2, $t9, 0x007F ## $t2 = 00000000 -/* 02714 80A71CC4 01430019 */ multu $t2, $v1 -/* 02718 80A71CC8 00005812 */ mflo $t3 -/* 0271C 80A71CCC 004B6021 */ addu $t4, $v0, $t3 -/* 02720 80A71CD0 898D0007 */ lwl $t5, 0x0007($t4) ## 00000007 -/* 02724 80A71CD4 998D000A */ lwr $t5, 0x000A($t4) ## 0000000A -/* 02728 80A71CD8 AF0D0000 */ sw $t5, 0x0000($t8) ## FFFFFFF4 -/* 0272C 80A71CDC 860E001C */ lh $t6, 0x001C($s0) ## 0000001C -/* 02730 80A71CE0 31CF007F */ andi $t7, $t6, 0x007F ## $t7 = 00000000 -/* 02734 80A71CE4 25F9FFFE */ addiu $t9, $t7, 0xFFFE ## $t9 = FFFFFFFE -/* 02738 80A71CE8 2F210013 */ sltiu $at, $t9, 0x0013 -/* 0273C 80A71CEC 10200052 */ beq $at, $zero, .L80A71E38 -/* 02740 80A71CF0 0019C880 */ sll $t9, $t9, 2 -/* 02744 80A71CF4 3C0180A7 */ lui $at, %hi(jtbl_80A72AA0) ## $at = 80A70000 -/* 02748 80A71CF8 00390821 */ addu $at, $at, $t9 -/* 0274C 80A71CFC 8C392AA0 */ lw $t9, %lo(jtbl_80A72AA0)($at) -/* 02750 80A71D00 03200008 */ jr $t9 -/* 02754 80A71D04 00000000 */ nop -glabel L80A71D08 -/* 02758 80A71D08 8FA80054 */ lw $t0, 0x0054($sp) -/* 0275C 80A71D0C 3C0BDB06 */ lui $t3, 0xDB06 ## $t3 = DB060000 -/* 02760 80A71D10 356B0020 */ ori $t3, $t3, 0x0020 ## $t3 = DB060020 -/* 02764 80A71D14 8D0202C0 */ lw $v0, 0x02C0($t0) ## 000002C0 -/* 02768 80A71D18 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 80A722E0 -/* 0276C 80A71D1C AD0A02C0 */ sw $t2, 0x02C0($t0) ## 000002C0 -/* 02770 80A71D20 AC4B0000 */ sw $t3, 0x0000($v0) ## 80A722D8 -/* 02774 80A71D24 8FB8006C */ lw $t8, 0x006C($sp) -/* 02778 80A71D28 93AC0063 */ lbu $t4, 0x0063($sp) -/* 0277C 80A71D2C 93A70062 */ lbu $a3, 0x0062($sp) -/* 02780 80A71D30 8F040000 */ lw $a0, 0x0000($t8) ## FFFFFFF4 -/* 02784 80A71D34 93A60061 */ lbu $a2, 0x0061($sp) -/* 02788 80A71D38 93A50060 */ lbu $a1, 0x0060($sp) -/* 0278C 80A71D3C AFA20040 */ sw $v0, 0x0040($sp) -/* 02790 80A71D40 0C29C6EF */ jal func_80A71BBC -/* 02794 80A71D44 AFAC0010 */ sw $t4, 0x0010($sp) -/* 02798 80A71D48 8FA30040 */ lw $v1, 0x0040($sp) -/* 0279C 80A71D4C 3C0DDB06 */ lui $t5, 0xDB06 ## $t5 = DB060000 -/* 027A0 80A71D50 35AD0024 */ ori $t5, $t5, 0x0024 ## $t5 = DB060024 -/* 027A4 80A71D54 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 027A8 80A71D58 8FA80054 */ lw $t0, 0x0054($sp) -/* 027AC 80A71D5C 8D0202C0 */ lw $v0, 0x02C0($t0) ## 000002C0 -/* 027B0 80A71D60 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 027B4 80A71D64 AD0902C0 */ sw $t1, 0x02C0($t0) ## 000002C0 -/* 027B8 80A71D68 AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000 -/* 027BC 80A71D6C 8FAE006C */ lw $t6, 0x006C($sp) -/* 027C0 80A71D70 93AF005F */ lbu $t7, 0x005F($sp) -/* 027C4 80A71D74 93A7005E */ lbu $a3, 0x005E($sp) -/* 027C8 80A71D78 8DC40000 */ lw $a0, 0x0000($t6) ## 00000000 -/* 027CC 80A71D7C 93A6005D */ lbu $a2, 0x005D($sp) -/* 027D0 80A71D80 93A5005C */ lbu $a1, 0x005C($sp) -/* 027D4 80A71D84 AFA2003C */ sw $v0, 0x003C($sp) -/* 027D8 80A71D88 0C29C6EF */ jal func_80A71BBC -/* 027DC 80A71D8C AFAF0010 */ sw $t7, 0x0010($sp) -/* 027E0 80A71D90 8FA3003C */ lw $v1, 0x003C($sp) -/* 027E4 80A71D94 2401000B */ addiu $at, $zero, 0x000B ## $at = 0000000B -/* 027E8 80A71D98 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -/* 027EC 80A71D9C 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 027F0 80A71DA0 24030008 */ addiu $v1, $zero, 0x0008 ## $v1 = 00000008 -/* 027F4 80A71DA4 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -/* 027F8 80A71DA8 10620003 */ beq $v1, $v0, .L80A71DB8 -/* 027FC 80A71DAC 00000000 */ nop -/* 02800 80A71DB0 54410022 */ bnel $v0, $at, .L80A71E3C -/* 02804 80A71DB4 8E050150 */ lw $a1, 0x0150($s0) ## 00000150 -.L80A71DB8: -/* 02808 80A71DB8 14620005 */ bne $v1, $v0, .L80A71DD0 -/* 0280C 80A71DBC 2401000B */ addiu $at, $zero, 0x000B ## $at = 0000000B -/* 02810 80A71DC0 8FB90060 */ lw $t9, 0x0060($sp) -/* 02814 80A71DC4 AFB90058 */ sw $t9, 0x0058($sp) -/* 02818 80A71DC8 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 0281C 80A71DCC 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -.L80A71DD0: -/* 02820 80A71DD0 14410007 */ bne $v0, $at, .L80A71DF0 -/* 02824 80A71DD4 240A00FF */ addiu $t2, $zero, 0x00FF ## $t2 = 000000FF -/* 02828 80A71DD8 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF -/* 0282C 80A71DDC 241800FF */ addiu $t8, $zero, 0x00FF ## $t8 = 000000FF -/* 02830 80A71DE0 A3B80058 */ sb $t8, 0x0058($sp) -/* 02834 80A71DE4 A3AB0059 */ sb $t3, 0x0059($sp) -/* 02838 80A71DE8 A3AA005A */ sb $t2, 0x005A($sp) -/* 0283C 80A71DEC A3A0005B */ sb $zero, 0x005B($sp) -.L80A71DF0: -/* 02840 80A71DF0 8FAC0054 */ lw $t4, 0x0054($sp) -/* 02844 80A71DF4 3C0DDB06 */ lui $t5, 0xDB06 ## $t5 = DB060000 -/* 02848 80A71DF8 35AD0028 */ ori $t5, $t5, 0x0028 ## $t5 = DB060028 -/* 0284C 80A71DFC 8D8202C0 */ lw $v0, 0x02C0($t4) ## 000002C0 -/* 02850 80A71E00 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008 -/* 02854 80A71E04 AD8902C0 */ sw $t1, 0x02C0($t4) ## 000002C0 -/* 02858 80A71E08 AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000 -/* 0285C 80A71E0C 8FAE006C */ lw $t6, 0x006C($sp) -/* 02860 80A71E10 93AF005B */ lbu $t7, 0x005B($sp) -/* 02864 80A71E14 93A7005A */ lbu $a3, 0x005A($sp) -/* 02868 80A71E18 8DC40000 */ lw $a0, 0x0000($t6) ## 00000000 -/* 0286C 80A71E1C 93A60059 */ lbu $a2, 0x0059($sp) -/* 02870 80A71E20 93A50058 */ lbu $a1, 0x0058($sp) -/* 02874 80A71E24 AFA20038 */ sw $v0, 0x0038($sp) -/* 02878 80A71E28 0C29C6EF */ jal func_80A71BBC -/* 0287C 80A71E2C AFAF0010 */ sw $t7, 0x0010($sp) -/* 02880 80A71E30 8FA30038 */ lw $v1, 0x0038($sp) -/* 02884 80A71E34 AC620004 */ sw $v0, 0x0004($v1) ## 00000004 -glabel L80A71E38 -.L80A71E38: -/* 02888 80A71E38 8E050150 */ lw $a1, 0x0150($s0) ## 00000150 -.L80A71E3C: -/* 0288C 80A71E3C 8E06016C */ lw $a2, 0x016C($s0) ## 0000016C -/* 02890 80A71E40 9207014E */ lbu $a3, 0x014E($s0) ## 0000014E -/* 02894 80A71E44 3C1980A7 */ lui $t9, %hi(func_80A716B8) ## $t9 = 80A70000 -/* 02898 80A71E48 3C0A80A7 */ lui $t2, %hi(func_80A71A64) ## $t2 = 80A70000 -/* 0289C 80A71E4C 254A1A64 */ addiu $t2, $t2, %lo(func_80A71A64) ## $t2 = 80A71A64 -/* 028A0 80A71E50 273916B8 */ addiu $t9, $t9, %lo(func_80A716B8) ## $t9 = 80A716B8 -/* 028A4 80A71E54 AFB90010 */ sw $t9, 0x0010($sp) -/* 028A8 80A71E58 AFAA0014 */ sw $t2, 0x0014($sp) -/* 028AC 80A71E5C AFB00018 */ sw $s0, 0x0018($sp) -/* 028B0 80A71E60 0C0286B2 */ jal SkelAnime_DrawFlexOpa -/* 028B4 80A71E64 8FA4006C */ lw $a0, 0x006C($sp) -.L80A71E68: -/* 028B8 80A71E68 8FAB006C */ lw $t3, 0x006C($sp) -/* 028BC 80A71E6C 3C0680A7 */ lui $a2, %hi(D_80A72860) ## $a2 = 80A70000 -/* 028C0 80A71E70 24C62860 */ addiu $a2, $a2, %lo(D_80A72860) ## $a2 = 80A72860 -/* 028C4 80A71E74 27A40044 */ addiu $a0, $sp, 0x0044 ## $a0 = FFFFFFDC -/* 028C8 80A71E78 24070954 */ addiu $a3, $zero, 0x0954 ## $a3 = 00000954 -/* 028CC 80A71E7C 0C031AD5 */ jal Graph_CloseDisps -/* 028D0 80A71E80 8D650000 */ lw $a1, 0x0000($t3) ## 00000000 -/* 028D4 80A71E84 8FBF002C */ lw $ra, 0x002C($sp) -/* 028D8 80A71E88 8FB00028 */ lw $s0, 0x0028($sp) -/* 028DC 80A71E8C 27BD0068 */ addiu $sp, $sp, 0x0068 ## $sp = 00000000 -/* 028E0 80A71E90 03E00008 */ jr $ra -/* 028E4 80A71E94 00000000 */ nop -/* 028E8 80A71E98 00000000 */ nop -/* 028EC 80A71E9C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Init.s deleted file mode 100644 index 17b6af422a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Init.s +++ /dev/null @@ -1,41 +0,0 @@ -glabel EnHy_Init -/* 017D0 80A70D80 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 017D4 80A70D84 AFBF001C */ sw $ra, 0x001C($sp) -/* 017D8 80A70D88 AFB00018 */ sw $s0, 0x0018($sp) -/* 017DC 80A70D8C AFA50024 */ sw $a1, 0x0024($sp) -/* 017E0 80A70D90 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 017E4 80A70D94 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 017E8 80A70D98 31CF007F */ andi $t7, $t6, 0x007F ## $t7 = 00000000 -/* 017EC 80A70D9C 29E10015 */ slti $at, $t7, 0x0015 -/* 017F0 80A70DA0 10200009 */ beq $at, $zero, .L80A70DC8 -/* 017F4 80A70DA4 00000000 */ nop -/* 017F8 80A70DA8 0C29BDD1 */ jal func_80A6F744 -/* 017FC 80A70DAC 00000000 */ nop -/* 01800 80A70DB0 10400005 */ beq $v0, $zero, .L80A70DC8 -/* 01804 80A70DB4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01808 80A70DB8 0C29BD6C */ jal func_80A6F5B0 -/* 0180C 80A70DBC 8FA50024 */ lw $a1, 0x0024($sp) -/* 01810 80A70DC0 54400004 */ bnel $v0, $zero, .L80A70DD4 -/* 01814 80A70DC4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A70DC8: -/* 01818 80A70DC8 0C00B55C */ jal Actor_Kill - -/* 0181C 80A70DCC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01820 80A70DD0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A70DD4: -/* 01824 80A70DD4 0C29C2B9 */ jal func_80A70AE4 -/* 01828 80A70DD8 8FA50024 */ lw $a1, 0x0024($sp) -/* 0182C 80A70DDC 14400003 */ bne $v0, $zero, .L80A70DEC -/* 01830 80A70DE0 00000000 */ nop -/* 01834 80A70DE4 0C00B55C */ jal Actor_Kill - -/* 01838 80A70DE8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A70DEC: -/* 0183C 80A70DEC 3C1880A7 */ lui $t8, %hi(func_80A70E34) ## $t8 = 80A70000 -/* 01840 80A70DF0 27180E34 */ addiu $t8, $t8, %lo(func_80A70E34) ## $t8 = 80A70E34 -/* 01844 80A70DF4 AE180190 */ sw $t8, 0x0190($s0) ## 00000190 -/* 01848 80A70DF8 8FBF001C */ lw $ra, 0x001C($sp) -/* 0184C 80A70DFC 8FB00018 */ lw $s0, 0x0018($sp) -/* 01850 80A70E00 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 01854 80A70E04 03E00008 */ jr $ra -/* 01858 80A70E08 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s deleted file mode 100644 index 02411a581e..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s +++ /dev/null @@ -1,60 +0,0 @@ -glabel EnHy_Update -/* 0202C 80A715DC 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 02030 80A715E0 AFBF0024 */ sw $ra, 0x0024($sp) -/* 02034 80A715E4 AFB10020 */ sw $s1, 0x0020($sp) -/* 02038 80A715E8 AFB0001C */ sw $s0, 0x001C($sp) -/* 0203C 80A715EC 8C820190 */ lw $v0, 0x0190($a0) ## 00000190 -/* 02040 80A715F0 3C0E80A7 */ lui $t6, %hi(func_80A70E34) ## $t6 = 80A70000 -/* 02044 80A715F4 25CE0E34 */ addiu $t6, $t6, %lo(func_80A70E34) ## $t6 = 80A70E34 -/* 02048 80A715F8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0204C 80A715FC 11C20020 */ beq $t6, $v0, .L80A71680 -/* 02050 80A71600 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 02054 80A71604 808F0199 */ lb $t7, 0x0199($a0) ## 00000199 -/* 02058 80A71608 3C080001 */ lui $t0, 0x0001 ## $t0 = 00010000 -/* 0205C 80A7160C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 02060 80A71610 000FC100 */ sll $t8, $t7, 4 -/* 02064 80A71614 030FC021 */ addu $t8, $t8, $t7 -/* 02068 80A71618 0018C080 */ sll $t8, $t8, 2 -/* 0206C 80A7161C 00B8C821 */ addu $t9, $a1, $t8 -/* 02070 80A71620 01194021 */ addu $t0, $t0, $t9 -/* 02074 80A71624 8D0817B4 */ lw $t0, 0x17B4($t0) ## 000117B4 -/* 02078 80A71628 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 0207C 80A7162C 01014821 */ addu $t1, $t0, $at -/* 02080 80A71630 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 02084 80A71634 0C02927F */ jal SkelAnime_Update - -/* 02088 80A71638 AC296FC0 */ sw $t1, %lo(gSegments+0x18)($at) -/* 0208C 80A7163C 0C29C169 */ jal func_80A705A4 -/* 02090 80A71640 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02094 80A71644 860A01E8 */ lh $t2, 0x01E8($s0) ## 000001E8 -/* 02098 80A71648 55400004 */ bnel $t2, $zero, .L80A7165C -/* 0209C 80A7164C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 020A0 80A71650 0C00B638 */ jal Actor_MoveForward - -/* 020A4 80A71654 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 020A8 80A71658 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -.L80A7165C: -/* 020AC 80A7165C 240B0004 */ addiu $t3, $zero, 0x0004 ## $t3 = 00000004 -/* 020B0 80A71660 AFAB0014 */ sw $t3, 0x0014($sp) -/* 020B4 80A71664 44060000 */ mfc1 $a2, $f0 -/* 020B8 80A71668 44070000 */ mfc1 $a3, $f0 -/* 020BC 80A7166C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 020C0 80A71670 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 020C4 80A71674 0C00B92D */ jal func_8002E4B4 -/* 020C8 80A71678 E7A00010 */ swc1 $f0, 0x0010($sp) -/* 020CC 80A7167C 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 -.L80A71680: -/* 020D0 80A71680 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 020D4 80A71684 0040F809 */ jalr $ra, $v0 -/* 020D8 80A71688 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 020DC 80A7168C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 020E0 80A71690 0C29C25E */ jal func_80A70978 -/* 020E4 80A71694 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 020E8 80A71698 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 020EC 80A7169C 0C29C1CD */ jal func_80A70734 -/* 020F0 80A716A0 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 020F4 80A716A4 8FBF0024 */ lw $ra, 0x0024($sp) -/* 020F8 80A716A8 8FB0001C */ lw $s0, 0x001C($sp) -/* 020FC 80A716AC 8FB10020 */ lw $s1, 0x0020($sp) -/* 02100 80A716B0 03E00008 */ jr $ra -/* 02104 80A716B4 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F5B0.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F5B0.s deleted file mode 100644 index 7d04873bd5..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F5B0.s +++ /dev/null @@ -1,75 +0,0 @@ -glabel func_80A6F5B0 -/* 00000 80A6F5B0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00004 80A6F5B4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00008 80A6F5B8 848E001C */ lh $t6, 0x001C($a0) ## 0000001C -/* 0000C 80A6F5BC 3C1980A7 */ lui $t9, %hi(D_80A722D8) ## $t9 = 80A70000 -/* 00010 80A6F5C0 273922D8 */ addiu $t9, $t9, %lo(D_80A722D8) ## $t9 = 80A722D8 -/* 00014 80A6F5C4 31CF007F */ andi $t7, $t6, 0x007F ## $t7 = 00000000 -/* 00018 80A6F5C8 000FC080 */ sll $t8, $t7, 2 -/* 0001C 80A6F5CC 030FC023 */ subu $t8, $t8, $t7 -/* 00020 80A6F5D0 0018C080 */ sll $t8, $t8, 2 -/* 00024 80A6F5D4 03191021 */ addu $v0, $t8, $t9 -/* 00028 80A6F5D8 90430006 */ lbu $v1, 0x0006($v0) ## 00000006 -/* 0002C 80A6F5DC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00030 80A6F5E0 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 00034 80A6F5E4 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 00038 80A6F5E8 00A12021 */ addu $a0, $a1, $at -/* 0003C 80A6F5EC 90480000 */ lbu $t0, 0x0000($v0) ## 00000000 -/* 00040 80A6F5F0 90490001 */ lbu $t1, 0x0001($v0) ## 00000001 -/* 00044 80A6F5F4 3C0580A7 */ lui $a1, %hi(D_80A72010) ## $a1 = 80A70000 -/* 00048 80A6F5F8 000350C0 */ sll $t2, $v1, 3 -/* 0004C 80A6F5FC 00AA2821 */ addu $a1, $a1, $t2 -/* 00050 80A6F600 84A52010 */ lh $a1, %lo(D_80A72010)($a1) -/* 00054 80A6F604 AFA40018 */ sw $a0, 0x0018($sp) -/* 00058 80A6F608 AFA60020 */ sw $a2, 0x0020($sp) -/* 0005C 80A6F60C A3A8001F */ sb $t0, 0x001F($sp) -/* 00060 80A6F610 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 00064 80A6F614 A3A9001E */ sb $t1, 0x001E($sp) -/* 00068 80A6F618 8FA60020 */ lw $a2, 0x0020($sp) -/* 0006C 80A6F61C 3C0580A7 */ lui $a1, %hi(D_80A72010) ## $a1 = 80A70000 -/* 00070 80A6F620 A0C20198 */ sb $v0, 0x0198($a2) ## 00000198 -/* 00074 80A6F624 80CB0198 */ lb $t3, 0x0198($a2) ## 00000198 -/* 00078 80A6F628 93AC001E */ lbu $t4, 0x001E($sp) -/* 0007C 80A6F62C 8FA40018 */ lw $a0, 0x0018($sp) -/* 00080 80A6F630 05610003 */ bgez $t3, .L80A6F640 -/* 00084 80A6F634 000C68C0 */ sll $t5, $t4, 3 -/* 00088 80A6F638 1000001D */ beq $zero, $zero, .L80A6F6B0 -/* 0008C 80A6F63C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F640: -/* 00090 80A6F640 00AD2821 */ addu $a1, $a1, $t5 -/* 00094 80A6F644 84A52010 */ lh $a1, %lo(D_80A72010)($a1) -/* 00098 80A6F648 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 0009C 80A6F64C AFA60020 */ sw $a2, 0x0020($sp) -/* 000A0 80A6F650 8FA60020 */ lw $a2, 0x0020($sp) -/* 000A4 80A6F654 3C0580A7 */ lui $a1, %hi(D_80A71F50) ## $a1 = 80A70000 -/* 000A8 80A6F658 A0C20197 */ sb $v0, 0x0197($a2) ## 00000197 -/* 000AC 80A6F65C 80CE0197 */ lb $t6, 0x0197($a2) ## 00000197 -/* 000B0 80A6F660 93AF001F */ lbu $t7, 0x001F($sp) -/* 000B4 80A6F664 8FA40018 */ lw $a0, 0x0018($sp) -/* 000B8 80A6F668 05C10003 */ bgez $t6, .L80A6F678 -/* 000BC 80A6F66C 000FC080 */ sll $t8, $t7, 2 -/* 000C0 80A6F670 1000000F */ beq $zero, $zero, .L80A6F6B0 -/* 000C4 80A6F674 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F678: -/* 000C8 80A6F678 030FC023 */ subu $t8, $t8, $t7 -/* 000CC 80A6F67C 0018C080 */ sll $t8, $t8, 2 -/* 000D0 80A6F680 00B82821 */ addu $a1, $a1, $t8 -/* 000D4 80A6F684 84A51F50 */ lh $a1, %lo(D_80A71F50)($a1) -/* 000D8 80A6F688 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 000DC 80A6F68C AFA60020 */ sw $a2, 0x0020($sp) -/* 000E0 80A6F690 8FA60020 */ lw $a2, 0x0020($sp) -/* 000E4 80A6F694 A0C20196 */ sb $v0, 0x0196($a2) ## 00000196 -/* 000E8 80A6F698 80D90196 */ lb $t9, 0x0196($a2) ## 00000196 -/* 000EC 80A6F69C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 000F0 80A6F6A0 07210003 */ bgez $t9, .L80A6F6B0 -/* 000F4 80A6F6A4 00000000 */ nop -/* 000F8 80A6F6A8 10000001 */ beq $zero, $zero, .L80A6F6B0 -/* 000FC 80A6F6AC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F6B0: -/* 00100 80A6F6B0 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00104 80A6F6B4 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00108 80A6F6B8 03E00008 */ jr $ra -/* 0010C 80A6F6BC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F6C0.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F6C0.s deleted file mode 100644 index 366aa03f62..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F6C0.s +++ /dev/null @@ -1,40 +0,0 @@ -glabel func_80A6F6C0 -/* 00110 80A6F6C0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00114 80A6F6C4 AFA40020 */ sw $a0, 0x0020($sp) -/* 00118 80A6F6C8 8FAE0020 */ lw $t6, 0x0020($sp) -/* 0011C 80A6F6CC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00120 80A6F6D0 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 00124 80A6F6D4 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00128 80A6F6D8 00A12021 */ addu $a0, $a1, $at -/* 0012C 80A6F6DC 81C50198 */ lb $a1, 0x0198($t6) ## 00000198 -/* 00130 80A6F6E0 0C026062 */ jal Object_IsLoaded - -/* 00134 80A6F6E4 AFA4001C */ sw $a0, 0x001C($sp) -/* 00138 80A6F6E8 14400003 */ bne $v0, $zero, .L80A6F6F8 -/* 0013C 80A6F6EC 8FAF0020 */ lw $t7, 0x0020($sp) -/* 00140 80A6F6F0 10000010 */ beq $zero, $zero, .L80A6F734 -/* 00144 80A6F6F4 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F6F8: -/* 00148 80A6F6F8 8FA4001C */ lw $a0, 0x001C($sp) -/* 0014C 80A6F6FC 0C026062 */ jal Object_IsLoaded - -/* 00150 80A6F700 81E50197 */ lb $a1, 0x0197($t7) ## 00000197 -/* 00154 80A6F704 14400003 */ bne $v0, $zero, .L80A6F714 -/* 00158 80A6F708 8FB80020 */ lw $t8, 0x0020($sp) -/* 0015C 80A6F70C 10000009 */ beq $zero, $zero, .L80A6F734 -/* 00160 80A6F710 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F714: -/* 00164 80A6F714 8FA4001C */ lw $a0, 0x001C($sp) -/* 00168 80A6F718 0C026062 */ jal Object_IsLoaded - -/* 0016C 80A6F71C 83050196 */ lb $a1, 0x0196($t8) ## 00000196 -/* 00170 80A6F720 54400004 */ bnel $v0, $zero, .L80A6F734 -/* 00174 80A6F724 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 00178 80A6F728 10000002 */ beq $zero, $zero, .L80A6F734 -/* 0017C 80A6F72C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 00180 80A6F730 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A6F734: -/* 00184 80A6F734 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00188 80A6F738 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 0018C 80A6F73C 03E00008 */ jr $ra -/* 00190 80A6F740 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F744.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F744.s deleted file mode 100644 index 720e22be1a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F744.s +++ /dev/null @@ -1,22 +0,0 @@ -glabel func_80A6F744 -/* 00194 80A6F744 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00198 80A6F748 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 0019C 80A6F74C AFA40018 */ sw $a0, 0x0018($sp) -/* 001A0 80A6F750 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 001A4 80A6F754 AFBF0014 */ sw $ra, 0x0014($sp) -/* 001A8 80A6F758 00A12021 */ addu $a0, $a1, $at -/* 001AC 80A6F75C 0C02604B */ jal Object_GetIndex - ## ObjectIndex -/* 001B0 80A6F760 240500C5 */ addiu $a1, $zero, 0x00C5 ## $a1 = 000000C5 -/* 001B4 80A6F764 8FA30018 */ lw $v1, 0x0018($sp) -/* 001B8 80A6F768 A0620199 */ sb $v0, 0x0199($v1) ## 00000199 -/* 001BC 80A6F76C 806E0199 */ lb $t6, 0x0199($v1) ## 00000199 -/* 001C0 80A6F770 8FBF0014 */ lw $ra, 0x0014($sp) -/* 001C4 80A6F774 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 001C8 80A6F778 05C10003 */ bgez $t6, .L80A6F788 -/* 001CC 80A6F77C 00000000 */ nop -/* 001D0 80A6F780 10000001 */ beq $zero, $zero, .L80A6F788 -/* 001D4 80A6F784 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F788: -/* 001D8 80A6F788 03E00008 */ jr $ra -/* 001DC 80A6F78C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F790.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F790.s deleted file mode 100644 index d6e11b57f4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F790.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel func_80A6F790 -/* 001E0 80A6F790 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 001E4 80A6F794 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 001E8 80A6F798 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 001EC 80A6F79C 342117A4 */ ori $at, $at, 0x17A4 ## $at = 000117A4 -/* 001F0 80A6F7A0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 001F4 80A6F7A4 00A12021 */ addu $a0, $a1, $at -/* 001F8 80A6F7A8 0C026062 */ jal Object_IsLoaded - -/* 001FC 80A6F7AC 80E50199 */ lb $a1, 0x0199($a3) ## 00000199 -/* 00200 80A6F7B0 14400003 */ bne $v0, $zero, .L80A6F7C0 -/* 00204 80A6F7B4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00208 80A6F7B8 10000002 */ beq $zero, $zero, .L80A6F7C4 -/* 0020C 80A6F7BC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A6F7C0: -/* 00210 80A6F7C0 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A6F7C4: -/* 00214 80A6F7C4 03E00008 */ jr $ra -/* 00218 80A6F7C8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F7CC.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F7CC.s deleted file mode 100644 index abdbe4d2fc..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F7CC.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_80A6F7CC -/* 0021C 80A6F7CC 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00220 80A6F7D0 AFBF001C */ sw $ra, 0x001C($sp) -/* 00224 80A6F7D4 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00228 80A6F7D8 44811000 */ mtc1 $at, $f2 ## $f2 = 1.00 -/* 0022C 80A6F7DC C4840090 */ lwc1 $f4, 0x0090($a0) ## 00000090 -/* 00230 80A6F7E0 C4800094 */ lwc1 $f0, 0x0094($a0) ## 00000094 -/* 00234 80A6F7E4 AC860260 */ sw $a2, 0x0260($a0) ## 00000260 -/* 00238 80A6F7E8 46022180 */ add.s $f6, $f4, $f2 -/* 0023C 80A6F7EC 46000005 */ abs.s $f0, $f0 -/* 00240 80A6F7F0 44073000 */ mfc1 $a3, $f6 -/* 00244 80A6F7F4 46020200 */ add.s $f8, $f0, $f2 -/* 00248 80A6F7F8 0C00BD0D */ jal func_8002F434 -/* 0024C 80A6F7FC E7A80010 */ swc1 $f8, 0x0010($sp) -/* 00250 80A6F800 8FBF001C */ lw $ra, 0x001C($sp) -/* 00254 80A6F804 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00258 80A6F808 03E00008 */ jr $ra -/* 0025C 80A6F80C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F810.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F810.s deleted file mode 100644 index e6ac895ec6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F810.s +++ /dev/null @@ -1,639 +0,0 @@ -.late_rodata -glabel jtbl_80A72870 -.word L80A6F8A0 -.word L80A6F994 -.word L80A6F9FC -.word L80A6FAB0 -.word L80A6FAFC -.word L80A6FB48 -.word L80A6FB58 -.word L80A6FBA4 -.word L80A6FC1C -.word L80A6FC84 -.word L80A6FD50 -.word L80A6FE1C -.word L80A6FE68 -.word L80A6FED0 -.word L80A6FED8 -.word L80A6FEE0 -.word L80A6FEE8 -.word L80A6FEF0 -.word L80A6FF9C -.word L80A70038 -.word L80A70040 - -.text -glabel func_80A6F810 -/* 00260 80A6F810 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00264 80A6F814 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00268 80A6F818 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 0026C 80A6F81C 84A5001C */ lh $a1, 0x001C($a1) ## 0000001C -/* 00270 80A6F820 8C831C44 */ lw $v1, 0x1C44($a0) ## 00001C44 -/* 00274 80A6F824 AFA60024 */ sw $a2, 0x0024($sp) -/* 00278 80A6F828 30A5007F */ andi $a1, $a1, 0x007F ## $a1 = 00000000 -/* 0027C 80A6F82C 24A50025 */ addiu $a1, $a1, 0x0025 ## $a1 = 00000025 -/* 00280 80A6F830 AFA40020 */ sw $a0, 0x0020($sp) -/* 00284 80A6F834 0C01B0D8 */ jal Text_GetFaceReaction -/* 00288 80A6F838 AFA3001C */ sw $v1, 0x001C($sp) -/* 0028C 80A6F83C 8FA3001C */ lw $v1, 0x001C($sp) -/* 00290 80A6F840 8FA40020 */ lw $a0, 0x0020($sp) -/* 00294 80A6F844 8FA60024 */ lw $a2, 0x0024($sp) -/* 00298 80A6F848 1040000A */ beq $v0, $zero, .L80A6F874 -/* 0029C 80A6F84C 3045FFFF */ andi $a1, $v0, 0xFFFF ## $a1 = 00000000 -/* 002A0 80A6F850 84CE001C */ lh $t6, 0x001C($a2) ## 0000001C -/* 002A4 80A6F854 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 002A8 80A6F858 24180019 */ addiu $t8, $zero, 0x0019 ## $t8 = 00000019 -/* 002AC 80A6F85C 31CF007F */ andi $t7, $t6, 0x007F ## $t7 = 00000000 -/* 002B0 80A6F860 15E10002 */ bne $t7, $at, .L80A6F86C -/* 002B4 80A6F864 00000000 */ nop -/* 002B8 80A6F868 A0780693 */ sb $t8, 0x0693($v1) ## 00000693 -.L80A6F86C: -/* 002BC 80A6F86C 100001F6 */ beq $zero, $zero, .L80A70048 -/* 002C0 80A6F870 00A01025 */ or $v0, $a1, $zero ## $v0 = 00000000 -.L80A6F874: -/* 002C4 80A6F874 84D9001C */ lh $t9, 0x001C($a2) ## 0000001C -/* 002C8 80A6F878 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 002CC 80A6F87C 3328007F */ andi $t0, $t9, 0x007F ## $t0 = 00000000 -/* 002D0 80A6F880 2D010015 */ sltiu $at, $t0, 0x0015 -/* 002D4 80A6F884 102001F0 */ beq $at, $zero, .L80A70048 -/* 002D8 80A6F888 00084080 */ sll $t0, $t0, 2 -/* 002DC 80A6F88C 3C0180A7 */ lui $at, %hi(jtbl_80A72870) ## $at = 80A70000 -/* 002E0 80A6F890 00280821 */ addu $at, $at, $t0 -/* 002E4 80A6F894 8C282870 */ lw $t0, %lo(jtbl_80A72870)($at) -/* 002E8 80A6F898 01000008 */ jr $t0 -/* 002EC 80A6F89C 00000000 */ nop -glabel L80A6F8A0 -/* 002F0 80A6F8A0 848200A4 */ lh $v0, 0x00A4($a0) ## 000000A4 -/* 002F4 80A6F8A4 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -/* 002F8 80A6F8A8 54410014 */ bnel $v0, $at, .L80A6F8FC -/* 002FC 80A6F8AC 24010020 */ addiu $at, $zero, 0x0020 ## $at = 00000020 -/* 00300 80A6F8B0 94C90330 */ lhu $t1, 0x0330($a2) ## 00000330 -/* 00304 80A6F8B4 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00308 80A6F8B8 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 0030C 80A6F8BC 312A0800 */ andi $t2, $t1, 0x0800 ## $t2 = 00000000 -/* 00310 80A6F8C0 11400003 */ beq $t2, $zero, .L80A6F8D0 -/* 00314 80A6F8C4 2403508D */ addiu $v1, $zero, 0x508D ## $v1 = 0000508D -/* 00318 80A6F8C8 100001DF */ beq $zero, $zero, .L80A70048 -/* 0031C 80A6F8CC 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000508D -.L80A6F8D0: -/* 00320 80A6F8D0 944B0F10 */ lhu $t3, 0x0F10($v0) ## 00005F9D -/* 00324 80A6F8D4 2402508B */ addiu $v0, $zero, 0x508B ## $v0 = 0000508B -/* 00328 80A6F8D8 316C0800 */ andi $t4, $t3, 0x0800 ## $t4 = 00000000 -/* 0032C 80A6F8DC 11800003 */ beq $t4, $zero, .L80A6F8EC -/* 00330 80A6F8E0 00000000 */ nop -/* 00334 80A6F8E4 10000001 */ beq $zero, $zero, .L80A6F8EC -/* 00338 80A6F8E8 2402508C */ addiu $v0, $zero, 0x508C ## $v0 = 0000508C -.L80A6F8EC: -/* 0033C 80A6F8EC 00401825 */ or $v1, $v0, $zero ## $v1 = 0000508C -/* 00340 80A6F8F0 100001D5 */ beq $zero, $zero, .L80A70048 -/* 00344 80A6F8F4 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000508C -/* 00348 80A6F8F8 24010020 */ addiu $at, $zero, 0x0020 ## $at = 00000020 -.L80A6F8FC: -/* 0034C 80A6F8FC 1441000C */ bne $v0, $at, .L80A6F930 -/* 00350 80A6F900 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00354 80A6F904 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00358 80A6F908 944D1400 */ lhu $t5, 0x1400($v0) ## 8015FA60 -/* 0035C 80A6F90C 2403709C */ addiu $v1, $zero, 0x709C ## $v1 = 0000709C -/* 00360 80A6F910 31AE0001 */ andi $t6, $t5, 0x0001 ## $t6 = 00000000 -/* 00364 80A6F914 11C00004 */ beq $t6, $zero, .L80A6F928 -/* 00368 80A6F918 00000000 */ nop -/* 0036C 80A6F91C 2403709B */ addiu $v1, $zero, 0x709B ## $v1 = 0000709B -/* 00370 80A6F920 100001C9 */ beq $zero, $zero, .L80A70048 -/* 00374 80A6F924 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000709B -.L80A6F928: -/* 00378 80A6F928 100001C7 */ beq $zero, $zero, .L80A70048 -/* 0037C 80A6F92C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000709B -.L80A6F930: -/* 00380 80A6F930 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00384 80A6F934 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00388 80A6F938 904F141C */ lbu $t7, 0x141C($v0) ## 8015FA7C -/* 0038C 80A6F93C 11E00013 */ beq $t7, $zero, .L80A6F98C -/* 00390 80A6F940 00000000 */ nop -/* 00394 80A6F944 844313C4 */ lh $v1, 0x13C4($v0) ## 8015FA24 -/* 00398 80A6F948 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 0039C 80A6F94C 30630F00 */ andi $v1, $v1, 0x0F00 ## $v1 = 00000000 -/* 003A0 80A6F950 00031A03 */ sra $v1, $v1, 8 -/* 003A4 80A6F954 00031C00 */ sll $v1, $v1, 16 -/* 003A8 80A6F958 00031C03 */ sra $v1, $v1, 16 -/* 003AC 80A6F95C 10600009 */ beq $v1, $zero, .L80A6F984 -/* 003B0 80A6F960 00000000 */ nop -/* 003B4 80A6F964 14610004 */ bne $v1, $at, .L80A6F978 -/* 003B8 80A6F968 A0C00215 */ sb $zero, 0x0215($a2) ## 00000215 -/* 003BC 80A6F96C 2403709F */ addiu $v1, $zero, 0x709F ## $v1 = 0000709F -/* 003C0 80A6F970 100001B5 */ beq $zero, $zero, .L80A70048 -/* 003C4 80A6F974 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000709F -.L80A6F978: -/* 003C8 80A6F978 2403709E */ addiu $v1, $zero, 0x709E ## $v1 = 0000709E -/* 003CC 80A6F97C 100001B2 */ beq $zero, $zero, .L80A70048 -/* 003D0 80A6F980 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000709E -.L80A6F984: -/* 003D4 80A6F984 100001B0 */ beq $zero, $zero, .L80A70048 -/* 003D8 80A6F988 2402709D */ addiu $v0, $zero, 0x709D ## $v0 = 0000709D -.L80A6F98C: -/* 003DC 80A6F98C 100001AE */ beq $zero, $zero, .L80A70048 -/* 003E0 80A6F990 240270A0 */ addiu $v0, $zero, 0x70A0 ## $v0 = 000070A0 -glabel L80A6F994 -/* 003E4 80A6F994 3C028016 */ lui $v0, %hi(gSaveContext) -/* 003E8 80A6F998 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 003EC 80A6F99C 94580EE4 */ lhu $t8, 0x0EE4($v0) ## 8015F544 -/* 003F0 80A6F9A0 33190001 */ andi $t9, $t8, 0x0001 ## $t9 = 00000001 -/* 003F4 80A6F9A4 5320000C */ beql $t9, $zero, .L80A6F9D8 -/* 003F8 80A6F9A8 944A0F10 */ lhu $t2, 0x0F10($v0) ## 8015F570 -/* 003FC 80A6F9AC 94480F10 */ lhu $t0, 0x0F10($v0) ## 8015F570 -/* 00400 80A6F9B0 24037045 */ addiu $v1, $zero, 0x7045 ## $v1 = 00007045 -/* 00404 80A6F9B4 31090002 */ andi $t1, $t0, 0x0002 ## $t1 = 00000000 -/* 00408 80A6F9B8 11200004 */ beq $t1, $zero, .L80A6F9CC -/* 0040C 80A6F9BC 00000000 */ nop -/* 00410 80A6F9C0 24037017 */ addiu $v1, $zero, 0x7017 ## $v1 = 00007017 -/* 00414 80A6F9C4 100001A0 */ beq $zero, $zero, .L80A70048 -/* 00418 80A6F9C8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007017 -.L80A6F9CC: -/* 0041C 80A6F9CC 1000019E */ beq $zero, $zero, .L80A70048 -/* 00420 80A6F9D0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007017 -/* 00424 80A6F9D4 944A0F10 */ lhu $t2, 0x0F10($v0) ## 00007F27 -.L80A6F9D8: -/* 00428 80A6F9D8 24037016 */ addiu $v1, $zero, 0x7016 ## $v1 = 00007016 -/* 0042C 80A6F9DC 314B0001 */ andi $t3, $t2, 0x0001 ## $t3 = 00000000 -/* 00430 80A6F9E0 11600004 */ beq $t3, $zero, .L80A6F9F4 -/* 00434 80A6F9E4 00000000 */ nop -/* 00438 80A6F9E8 24037017 */ addiu $v1, $zero, 0x7017 ## $v1 = 00007017 -/* 0043C 80A6F9EC 10000196 */ beq $zero, $zero, .L80A70048 -/* 00440 80A6F9F0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007017 -.L80A6F9F4: -/* 00444 80A6F9F4 10000194 */ beq $zero, $zero, .L80A70048 -/* 00448 80A6F9F8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007017 -glabel L80A6F9FC -/* 0044C 80A6F9FC 848200A4 */ lh $v0, 0x00A4($a0) ## 000000A4 -/* 00450 80A6FA00 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -/* 00454 80A6FA04 54410004 */ bnel $v0, $at, .L80A6FA18 -/* 00458 80A6FA08 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 0045C 80A6FA0C 1000018E */ beq $zero, $zero, .L80A70048 -/* 00460 80A6FA10 24025086 */ addiu $v0, $zero, 0x5086 ## $v0 = 00005086 -/* 00464 80A6FA14 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -.L80A6FA18: -/* 00468 80A6FA18 14410003 */ bne $v0, $at, .L80A6FA28 -/* 0046C 80A6FA1C 00000000 */ nop -/* 00470 80A6FA20 10000189 */ beq $zero, $zero, .L80A70048 -/* 00474 80A6FA24 24025085 */ addiu $v0, $zero, 0x5085 ## $v0 = 00005085 -.L80A6FA28: -/* 00478 80A6FA28 3C028016 */ lui $v0, %hi(gSaveContext) -/* 0047C 80A6FA2C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00480 80A6FA30 944C0EE4 */ lhu $t4, 0x0EE4($v0) ## 8015F544 -/* 00484 80A6FA34 318D0001 */ andi $t5, $t4, 0x0001 ## $t5 = 00000000 -/* 00488 80A6FA38 51A0000C */ beql $t5, $zero, .L80A6FA6C -/* 0048C 80A6FA3C 94430ED6 */ lhu $v1, 0x0ED6($v0) ## 8015F536 -/* 00490 80A6FA40 944E0F10 */ lhu $t6, 0x0F10($v0) ## 8015F570 -/* 00494 80A6FA44 24037047 */ addiu $v1, $zero, 0x7047 ## $v1 = 00007047 -/* 00498 80A6FA48 31CF0008 */ andi $t7, $t6, 0x0008 ## $t7 = 00000000 -/* 0049C 80A6FA4C 11E00004 */ beq $t7, $zero, .L80A6FA60 -/* 004A0 80A6FA50 00000000 */ nop -/* 004A4 80A6FA54 2403701A */ addiu $v1, $zero, 0x701A ## $v1 = 0000701A -/* 004A8 80A6FA58 1000017B */ beq $zero, $zero, .L80A70048 -/* 004AC 80A6FA5C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701A -.L80A6FA60: -/* 004B0 80A6FA60 10000179 */ beq $zero, $zero, .L80A70048 -/* 004B4 80A6FA64 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701A -/* 004B8 80A6FA68 94430ED6 */ lhu $v1, 0x0ED6($v0) ## 00007EF0 -.L80A6FA6C: -/* 004BC 80A6FA6C 30780010 */ andi $t8, $v1, 0x0010 ## $t8 = 00000010 -/* 004C0 80A6FA70 13000003 */ beq $t8, $zero, .L80A6FA80 -/* 004C4 80A6FA74 30790001 */ andi $t9, $v1, 0x0001 ## $t9 = 00000000 -/* 004C8 80A6FA78 10000173 */ beq $zero, $zero, .L80A70048 -/* 004CC 80A6FA7C 2402701A */ addiu $v0, $zero, 0x701A ## $v0 = 0000701A -.L80A6FA80: -/* 004D0 80A6FA80 53200004 */ beql $t9, $zero, .L80A6FA94 -/* 004D4 80A6FA84 94480F10 */ lhu $t0, 0x0F10($v0) ## 00007F2A -/* 004D8 80A6FA88 1000016F */ beq $zero, $zero, .L80A70048 -/* 004DC 80A6FA8C 2402701B */ addiu $v0, $zero, 0x701B ## $v0 = 0000701B -/* 004E0 80A6FA90 94480F10 */ lhu $t0, 0x0F10($v0) ## 00007F2B -.L80A6FA94: -/* 004E4 80A6FA94 31090004 */ andi $t1, $t0, 0x0004 ## $t1 = 00000000 -/* 004E8 80A6FA98 11200003 */ beq $t1, $zero, .L80A6FAA8 -/* 004EC 80A6FA9C 00000000 */ nop -/* 004F0 80A6FAA0 10000169 */ beq $zero, $zero, .L80A70048 -/* 004F4 80A6FAA4 2402701C */ addiu $v0, $zero, 0x701C ## $v0 = 0000701C -.L80A6FAA8: -/* 004F8 80A6FAA8 10000167 */ beq $zero, $zero, .L80A70048 -/* 004FC 80A6FAAC 2402701A */ addiu $v0, $zero, 0x701A ## $v0 = 0000701A -glabel L80A6FAB0 -/* 00500 80A6FAB0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00504 80A6FAB4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00508 80A6FAB8 944A0EE4 */ lhu $t2, 0x0EE4($v0) ## 8015F544 -/* 0050C 80A6FABC 24037001 */ addiu $v1, $zero, 0x7001 ## $v1 = 00007001 -/* 00510 80A6FAC0 314B0001 */ andi $t3, $t2, 0x0001 ## $t3 = 00000000 -/* 00514 80A6FAC4 1160000B */ beq $t3, $zero, .L80A6FAF4 -/* 00518 80A6FAC8 00000000 */ nop -/* 0051C 80A6FACC 944C0F10 */ lhu $t4, 0x0F10($v0) ## 8015F570 -/* 00520 80A6FAD0 240270EB */ addiu $v0, $zero, 0x70EB ## $v0 = 000070EB -/* 00524 80A6FAD4 318D0010 */ andi $t5, $t4, 0x0010 ## $t5 = 00000000 -/* 00528 80A6FAD8 11A00004 */ beq $t5, $zero, .L80A6FAEC -/* 0052C 80A6FADC 00000000 */ nop -/* 00530 80A6FAE0 24027001 */ addiu $v0, $zero, 0x7001 ## $v0 = 00007001 -/* 00534 80A6FAE4 10000158 */ beq $zero, $zero, .L80A70048 -/* 00538 80A6FAE8 3042FFFF */ andi $v0, $v0, 0xFFFF ## $v0 = 00007001 -.L80A6FAEC: -/* 0053C 80A6FAEC 10000156 */ beq $zero, $zero, .L80A70048 -/* 00540 80A6FAF0 3042FFFF */ andi $v0, $v0, 0xFFFF ## $v0 = 00007001 -.L80A6FAF4: -/* 00544 80A6FAF4 10000154 */ beq $zero, $zero, .L80A70048 -/* 00548 80A6FAF8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007001 -glabel L80A6FAFC -/* 0054C 80A6FAFC 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00550 80A6FB00 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00554 80A6FB04 944E0EE4 */ lhu $t6, 0x0EE4($v0) ## 8015F544 -/* 00558 80A6FB08 2403704B */ addiu $v1, $zero, 0x704B ## $v1 = 0000704B -/* 0055C 80A6FB0C 31CF0001 */ andi $t7, $t6, 0x0001 ## $t7 = 00000000 -/* 00560 80A6FB10 51E00004 */ beql $t7, $zero, .L80A6FB24 -/* 00564 80A6FB14 94580F10 */ lhu $t8, 0x0F10($v0) ## 8015F570 -/* 00568 80A6FB18 1000014B */ beq $zero, $zero, .L80A70048 -/* 0056C 80A6FB1C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000704B -/* 00570 80A6FB20 94580F10 */ lhu $t8, 0x0F10($v0) ## 00007F5B -.L80A6FB24: -/* 00574 80A6FB24 24027023 */ addiu $v0, $zero, 0x7023 ## $v0 = 00007023 -/* 00578 80A6FB28 33190020 */ andi $t9, $t8, 0x0020 ## $t9 = 00000000 -/* 0057C 80A6FB2C 13200003 */ beq $t9, $zero, .L80A6FB3C -/* 00580 80A6FB30 00000000 */ nop -/* 00584 80A6FB34 10000001 */ beq $zero, $zero, .L80A6FB3C -/* 00588 80A6FB38 24027024 */ addiu $v0, $zero, 0x7024 ## $v0 = 00007024 -.L80A6FB3C: -/* 0058C 80A6FB3C 00401825 */ or $v1, $v0, $zero ## $v1 = 00007024 -/* 00590 80A6FB40 10000141 */ beq $zero, $zero, .L80A70048 -/* 00594 80A6FB44 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007024 -glabel L80A6FB48 -/* 00598 80A6FB48 24080019 */ addiu $t0, $zero, 0x0019 ## $t0 = 00000019 -/* 0059C 80A6FB4C A0680693 */ sb $t0, 0x0693($v1) ## 000076B7 -/* 005A0 80A6FB50 1000013D */ beq $zero, $zero, .L80A70048 -/* 005A4 80A6FB54 2402700C */ addiu $v0, $zero, 0x700C ## $v0 = 0000700C -glabel L80A6FB58 -/* 005A8 80A6FB58 3C028016 */ lui $v0, %hi(gSaveContext) -/* 005AC 80A6FB5C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 005B0 80A6FB60 94490EE4 */ lhu $t1, 0x0EE4($v0) ## 8015F544 -/* 005B4 80A6FB64 2403704A */ addiu $v1, $zero, 0x704A ## $v1 = 0000704A -/* 005B8 80A6FB68 312A0001 */ andi $t2, $t1, 0x0001 ## $t2 = 00000000 -/* 005BC 80A6FB6C 51400004 */ beql $t2, $zero, .L80A6FB80 -/* 005C0 80A6FB70 944B0F10 */ lhu $t3, 0x0F10($v0) ## 8015F570 -/* 005C4 80A6FB74 10000134 */ beq $zero, $zero, .L80A70048 -/* 005C8 80A6FB78 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000704A -/* 005CC 80A6FB7C 944B0F10 */ lhu $t3, 0x0F10($v0) ## 00007F5A -.L80A6FB80: -/* 005D0 80A6FB80 24027021 */ addiu $v0, $zero, 0x7021 ## $v0 = 00007021 -/* 005D4 80A6FB84 316C0040 */ andi $t4, $t3, 0x0040 ## $t4 = 00000000 -/* 005D8 80A6FB88 11800003 */ beq $t4, $zero, .L80A6FB98 -/* 005DC 80A6FB8C 00000000 */ nop -/* 005E0 80A6FB90 10000001 */ beq $zero, $zero, .L80A6FB98 -/* 005E4 80A6FB94 24027022 */ addiu $v0, $zero, 0x7022 ## $v0 = 00007022 -.L80A6FB98: -/* 005E8 80A6FB98 00401825 */ or $v1, $v0, $zero ## $v1 = 00007022 -/* 005EC 80A6FB9C 1000012A */ beq $zero, $zero, .L80A70048 -/* 005F0 80A6FBA0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007022 -glabel L80A6FBA4 -/* 005F4 80A6FBA4 848200A4 */ lh $v0, 0x00A4($a0) ## 000000A4 -/* 005F8 80A6FBA8 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -/* 005FC 80A6FBAC 54410004 */ bnel $v0, $at, .L80A6FBC0 -/* 00600 80A6FBB0 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 00604 80A6FBB4 10000124 */ beq $zero, $zero, .L80A70048 -/* 00608 80A6FBB8 24025088 */ addiu $v0, $zero, 0x5088 ## $v0 = 00005088 -/* 0060C 80A6FBBC 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -.L80A6FBC0: -/* 00610 80A6FBC0 14410003 */ bne $v0, $at, .L80A6FBD0 -/* 00614 80A6FBC4 00000000 */ nop -/* 00618 80A6FBC8 1000011F */ beq $zero, $zero, .L80A70048 -/* 0061C 80A6FBCC 24025087 */ addiu $v0, $zero, 0x5087 ## $v0 = 00005087 -.L80A6FBD0: -/* 00620 80A6FBD0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00624 80A6FBD4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00628 80A6FBD8 944D0EE4 */ lhu $t5, 0x0EE4($v0) ## 8015F544 -/* 0062C 80A6FBDC 2403704D */ addiu $v1, $zero, 0x704D ## $v1 = 0000704D -/* 00630 80A6FBE0 31AE0001 */ andi $t6, $t5, 0x0001 ## $t6 = 00000000 -/* 00634 80A6FBE4 51C00004 */ beql $t6, $zero, .L80A6FBF8 -/* 00638 80A6FBE8 944F0F10 */ lhu $t7, 0x0F10($v0) ## 8015F570 -/* 0063C 80A6FBEC 10000116 */ beq $zero, $zero, .L80A70048 -/* 00640 80A6FBF0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000704D -/* 00644 80A6FBF4 944F0F10 */ lhu $t7, 0x0F10($v0) ## 00007F5D -.L80A6FBF8: -/* 00648 80A6FBF8 24027027 */ addiu $v0, $zero, 0x7027 ## $v0 = 00007027 -/* 0064C 80A6FBFC 31F80080 */ andi $t8, $t7, 0x0080 ## $t8 = 00000000 -/* 00650 80A6FC00 13000003 */ beq $t8, $zero, .L80A6FC10 -/* 00654 80A6FC04 00000000 */ nop -/* 00658 80A6FC08 10000001 */ beq $zero, $zero, .L80A6FC10 -/* 0065C 80A6FC0C 24027028 */ addiu $v0, $zero, 0x7028 ## $v0 = 00007028 -.L80A6FC10: -/* 00660 80A6FC10 00401825 */ or $v1, $v0, $zero ## $v1 = 00007028 -/* 00664 80A6FC14 1000010C */ beq $zero, $zero, .L80A70048 -/* 00668 80A6FC18 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007028 -glabel L80A6FC1C -/* 0066C 80A6FC1C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00670 80A6FC20 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00674 80A6FC24 94590EE4 */ lhu $t9, 0x0EE4($v0) ## 8015F544 -/* 00678 80A6FC28 33280001 */ andi $t0, $t9, 0x0001 ## $t0 = 00000000 -/* 0067C 80A6FC2C 5100000C */ beql $t0, $zero, .L80A6FC60 -/* 00680 80A6FC30 944B0F10 */ lhu $t3, 0x0F10($v0) ## 8015F570 -/* 00684 80A6FC34 94490F10 */ lhu $t1, 0x0F10($v0) ## 8015F570 -/* 00688 80A6FC38 24037048 */ addiu $v1, $zero, 0x7048 ## $v1 = 00007048 -/* 0068C 80A6FC3C 312A0200 */ andi $t2, $t1, 0x0200 ## $t2 = 00000000 -/* 00690 80A6FC40 11400004 */ beq $t2, $zero, .L80A6FC54 -/* 00694 80A6FC44 00000000 */ nop -/* 00698 80A6FC48 2403701E */ addiu $v1, $zero, 0x701E ## $v1 = 0000701E -/* 0069C 80A6FC4C 100000FE */ beq $zero, $zero, .L80A70048 -/* 006A0 80A6FC50 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701E -.L80A6FC54: -/* 006A4 80A6FC54 100000FC */ beq $zero, $zero, .L80A70048 -/* 006A8 80A6FC58 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701E -/* 006AC 80A6FC5C 944B0F10 */ lhu $t3, 0x0F10($v0) ## 00007F2E -.L80A6FC60: -/* 006B0 80A6FC60 2403701D */ addiu $v1, $zero, 0x701D ## $v1 = 0000701D -/* 006B4 80A6FC64 316C0100 */ andi $t4, $t3, 0x0100 ## $t4 = 00000000 -/* 006B8 80A6FC68 11800004 */ beq $t4, $zero, .L80A6FC7C -/* 006BC 80A6FC6C 00000000 */ nop -/* 006C0 80A6FC70 2403701E */ addiu $v1, $zero, 0x701E ## $v1 = 0000701E -/* 006C4 80A6FC74 100000F4 */ beq $zero, $zero, .L80A70048 -/* 006C8 80A6FC78 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701E -.L80A6FC7C: -/* 006CC 80A6FC7C 100000F2 */ beq $zero, $zero, .L80A70048 -/* 006D0 80A6FC80 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000701E -glabel L80A6FC84 -/* 006D4 80A6FC84 848200A4 */ lh $v0, 0x00A4($a0) ## 000000A4 -/* 006D8 80A6FC88 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -/* 006DC 80A6FC8C 5441000E */ bnel $v0, $at, .L80A6FCC8 -/* 006E0 80A6FC90 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 006E4 80A6FC94 3C028016 */ lui $v0, %hi(gSaveContext) -/* 006E8 80A6FC98 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 006EC 80A6FC9C 944D0EE8 */ lhu $t5, 0x0EE8($v0) ## 8015F548 -/* 006F0 80A6FCA0 24035081 */ addiu $v1, $zero, 0x5081 ## $v1 = 00005081 -/* 006F4 80A6FCA4 31AE0400 */ andi $t6, $t5, 0x0400 ## $t6 = 00000000 -/* 006F8 80A6FCA8 11C00004 */ beq $t6, $zero, .L80A6FCBC -/* 006FC 80A6FCAC 00000000 */ nop -/* 00700 80A6FCB0 24035082 */ addiu $v1, $zero, 0x5082 ## $v1 = 00005082 -/* 00704 80A6FCB4 100000E4 */ beq $zero, $zero, .L80A70048 -/* 00708 80A6FCB8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005082 -.L80A6FCBC: -/* 0070C 80A6FCBC 100000E2 */ beq $zero, $zero, .L80A70048 -/* 00710 80A6FCC0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005082 -/* 00714 80A6FCC4 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -.L80A6FCC8: -/* 00718 80A6FCC8 1441000E */ bne $v0, $at, .L80A6FD04 -/* 0071C 80A6FCCC 3C0F8012 */ lui $t7, %hi(gBitFlags+0x10) -/* 00720 80A6FCD0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00724 80A6FCD4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00728 80A6FCD8 8C5800A4 */ lw $t8, 0x00A4($v0) ## 8015E704 -/* 0072C 80A6FCDC 8DEF7130 */ lw $t7, %lo(gBitFlags+0x10)($t7) -/* 00730 80A6FCE0 2403507F */ addiu $v1, $zero, 0x507F ## $v1 = 0000507F -/* 00734 80A6FCE4 01F8C824 */ and $t9, $t7, $t8 -/* 00738 80A6FCE8 13200004 */ beq $t9, $zero, .L80A6FCFC -/* 0073C 80A6FCEC 00000000 */ nop -/* 00740 80A6FCF0 24035080 */ addiu $v1, $zero, 0x5080 ## $v1 = 00005080 -/* 00744 80A6FCF4 100000D4 */ beq $zero, $zero, .L80A70048 -/* 00748 80A6FCF8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005080 -.L80A6FCFC: -/* 0074C 80A6FCFC 100000D2 */ beq $zero, $zero, .L80A70048 -/* 00750 80A6FD00 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005080 -.L80A6FD04: -/* 00754 80A6FD04 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00758 80A6FD08 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 0075C 80A6FD0C 94480EE4 */ lhu $t0, 0x0EE4($v0) ## 8015F544 -/* 00760 80A6FD10 24037049 */ addiu $v1, $zero, 0x7049 ## $v1 = 00007049 -/* 00764 80A6FD14 31090001 */ andi $t1, $t0, 0x0001 ## $t1 = 00000000 -/* 00768 80A6FD18 51200004 */ beql $t1, $zero, .L80A6FD2C -/* 0076C 80A6FD1C 944A0F10 */ lhu $t2, 0x0F10($v0) ## 8015F570 -/* 00770 80A6FD20 100000C9 */ beq $zero, $zero, .L80A70048 -/* 00774 80A6FD24 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007049 -/* 00778 80A6FD28 944A0F10 */ lhu $t2, 0x0F10($v0) ## 00007F59 -.L80A6FD2C: -/* 0077C 80A6FD2C 2402701F */ addiu $v0, $zero, 0x701F ## $v0 = 0000701F -/* 00780 80A6FD30 314B0400 */ andi $t3, $t2, 0x0400 ## $t3 = 00000000 -/* 00784 80A6FD34 11600003 */ beq $t3, $zero, .L80A6FD44 -/* 00788 80A6FD38 00000000 */ nop -/* 0078C 80A6FD3C 10000001 */ beq $zero, $zero, .L80A6FD44 -/* 00790 80A6FD40 24027020 */ addiu $v0, $zero, 0x7020 ## $v0 = 00007020 -.L80A6FD44: -/* 00794 80A6FD44 00401825 */ or $v1, $v0, $zero ## $v1 = 00007020 -/* 00798 80A6FD48 100000BF */ beq $zero, $zero, .L80A70048 -/* 0079C 80A6FD4C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007020 -glabel L80A6FD50 -/* 007A0 80A6FD50 848200A4 */ lh $v0, 0x00A4($a0) ## 000000A4 -/* 007A4 80A6FD54 24010037 */ addiu $at, $zero, 0x0037 ## $at = 00000037 -/* 007A8 80A6FD58 5441000E */ bnel $v0, $at, .L80A6FD94 -/* 007AC 80A6FD5C 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 007B0 80A6FD60 3C028016 */ lui $v0, %hi(gSaveContext) -/* 007B4 80A6FD64 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 007B8 80A6FD68 944C0EE8 */ lhu $t4, 0x0EE8($v0) ## 8015F548 -/* 007BC 80A6FD6C 2403507D */ addiu $v1, $zero, 0x507D ## $v1 = 0000507D -/* 007C0 80A6FD70 318D0400 */ andi $t5, $t4, 0x0400 ## $t5 = 00000000 -/* 007C4 80A6FD74 11A00004 */ beq $t5, $zero, .L80A6FD88 -/* 007C8 80A6FD78 00000000 */ nop -/* 007CC 80A6FD7C 2403507E */ addiu $v1, $zero, 0x507E ## $v1 = 0000507E -/* 007D0 80A6FD80 100000B1 */ beq $zero, $zero, .L80A70048 -/* 007D4 80A6FD84 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000507E -.L80A6FD88: -/* 007D8 80A6FD88 100000AF */ beq $zero, $zero, .L80A70048 -/* 007DC 80A6FD8C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000507E -/* 007E0 80A6FD90 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -.L80A6FD94: -/* 007E4 80A6FD94 1441000E */ bne $v0, $at, .L80A6FDD0 -/* 007E8 80A6FD98 3C0E8012 */ lui $t6, %hi(gBitFlags+0x10) -/* 007EC 80A6FD9C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 007F0 80A6FDA0 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 007F4 80A6FDA4 8C4F00A4 */ lw $t7, 0x00A4($v0) ## 8015E704 -/* 007F8 80A6FDA8 8DCE7130 */ lw $t6, %lo(gBitFlags+0x10)($t6) -/* 007FC 80A6FDAC 2403507B */ addiu $v1, $zero, 0x507B ## $v1 = 0000507B -/* 00800 80A6FDB0 01CFC024 */ and $t8, $t6, $t7 -/* 00804 80A6FDB4 13000004 */ beq $t8, $zero, .L80A6FDC8 -/* 00808 80A6FDB8 00000000 */ nop -/* 0080C 80A6FDBC 2403507C */ addiu $v1, $zero, 0x507C ## $v1 = 0000507C -/* 00810 80A6FDC0 100000A1 */ beq $zero, $zero, .L80A70048 -/* 00814 80A6FDC4 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000507C -.L80A6FDC8: -/* 00818 80A6FDC8 1000009F */ beq $zero, $zero, .L80A70048 -/* 0081C 80A6FDCC 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000507C -.L80A6FDD0: -/* 00820 80A6FDD0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00824 80A6FDD4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00828 80A6FDD8 94590EE4 */ lhu $t9, 0x0EE4($v0) ## 8015F544 -/* 0082C 80A6FDDC 24037046 */ addiu $v1, $zero, 0x7046 ## $v1 = 00007046 -/* 00830 80A6FDE0 33280001 */ andi $t0, $t9, 0x0001 ## $t0 = 00000000 -/* 00834 80A6FDE4 51000004 */ beql $t0, $zero, .L80A6FDF8 -/* 00838 80A6FDE8 94490F10 */ lhu $t1, 0x0F10($v0) ## 8015F570 -/* 0083C 80A6FDEC 10000096 */ beq $zero, $zero, .L80A70048 -/* 00840 80A6FDF0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007046 -/* 00844 80A6FDF4 94490F10 */ lhu $t1, 0x0F10($v0) ## 00007F56 -.L80A6FDF8: -/* 00848 80A6FDF8 24027018 */ addiu $v0, $zero, 0x7018 ## $v0 = 00007018 -/* 0084C 80A6FDFC 312A2000 */ andi $t2, $t1, 0x2000 ## $t2 = 00000000 -/* 00850 80A6FE00 11400003 */ beq $t2, $zero, .L80A6FE10 -/* 00854 80A6FE04 00000000 */ nop -/* 00858 80A6FE08 10000001 */ beq $zero, $zero, .L80A6FE10 -/* 0085C 80A6FE0C 24027019 */ addiu $v0, $zero, 0x7019 ## $v0 = 00007019 -.L80A6FE10: -/* 00860 80A6FE10 00401825 */ or $v1, $v0, $zero ## $v1 = 00007019 -/* 00864 80A6FE14 1000008C */ beq $zero, $zero, .L80A70048 -/* 00868 80A6FE18 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007019 -glabel L80A6FE1C -/* 0086C 80A6FE1C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00870 80A6FE20 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00874 80A6FE24 944B0F08 */ lhu $t3, 0x0F08($v0) ## 8015F568 -/* 00878 80A6FE28 24037014 */ addiu $v1, $zero, 0x7014 ## $v1 = 00007014 -/* 0087C 80A6FE2C 316C0800 */ andi $t4, $t3, 0x0800 ## $t4 = 00000000 -/* 00880 80A6FE30 1180000B */ beq $t4, $zero, .L80A6FE60 -/* 00884 80A6FE34 00000000 */ nop -/* 00888 80A6FE38 944D0F10 */ lhu $t5, 0x0F10($v0) ## 8015F570 -/* 0088C 80A6FE3C 240270A4 */ addiu $v0, $zero, 0x70A4 ## $v0 = 000070A4 -/* 00890 80A6FE40 31AE1000 */ andi $t6, $t5, 0x1000 ## $t6 = 00000000 -/* 00894 80A6FE44 11C00004 */ beq $t6, $zero, .L80A6FE58 -/* 00898 80A6FE48 00000000 */ nop -/* 0089C 80A6FE4C 24027014 */ addiu $v0, $zero, 0x7014 ## $v0 = 00007014 -/* 008A0 80A6FE50 1000007D */ beq $zero, $zero, .L80A70048 -/* 008A4 80A6FE54 3042FFFF */ andi $v0, $v0, 0xFFFF ## $v0 = 00007014 -.L80A6FE58: -/* 008A8 80A6FE58 1000007B */ beq $zero, $zero, .L80A70048 -/* 008AC 80A6FE5C 3042FFFF */ andi $v0, $v0, 0xFFFF ## $v0 = 00007014 -.L80A6FE60: -/* 008B0 80A6FE60 10000079 */ beq $zero, $zero, .L80A70048 -/* 008B4 80A6FE64 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007014 -glabel L80A6FE68 -/* 008B8 80A6FE68 848F00A4 */ lh $t7, 0x00A4($a0) ## 000000A4 -/* 008BC 80A6FE6C 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 008C0 80A6FE70 3C028016 */ lui $v0, %hi(gSaveContext) -/* 008C4 80A6FE74 15E1000C */ bne $t7, $at, .L80A6FEA8 -/* 008C8 80A6FE78 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 008CC 80A6FE7C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 008D0 80A6FE80 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 008D4 80A6FE84 8C580010 */ lw $t8, 0x0010($v0) ## 8015E670 -/* 008D8 80A6FE88 24035083 */ addiu $v1, $zero, 0x5083 ## $v1 = 00005083 -/* 008DC 80A6FE8C 13000004 */ beq $t8, $zero, .L80A6FEA0 -/* 008E0 80A6FE90 00000000 */ nop -/* 008E4 80A6FE94 24035084 */ addiu $v1, $zero, 0x5084 ## $v1 = 00005084 -/* 008E8 80A6FE98 1000006B */ beq $zero, $zero, .L80A70048 -/* 008EC 80A6FE9C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005084 -.L80A6FEA0: -/* 008F0 80A6FEA0 10000069 */ beq $zero, $zero, .L80A70048 -/* 008F4 80A6FEA4 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005084 -.L80A6FEA8: -/* 008F8 80A6FEA8 94590EE4 */ lhu $t9, 0x0EE4($v0) ## 00005F68 -/* 008FC 80A6FEAC 24037015 */ addiu $v1, $zero, 0x7015 ## $v1 = 00007015 -/* 00900 80A6FEB0 33280001 */ andi $t0, $t9, 0x0001 ## $t0 = 00000000 -/* 00904 80A6FEB4 11000004 */ beq $t0, $zero, .L80A6FEC8 -/* 00908 80A6FEB8 00000000 */ nop -/* 0090C 80A6FEBC 24037044 */ addiu $v1, $zero, 0x7044 ## $v1 = 00007044 -/* 00910 80A6FEC0 10000061 */ beq $zero, $zero, .L80A70048 -/* 00914 80A6FEC4 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007044 -.L80A6FEC8: -/* 00918 80A6FEC8 1000005F */ beq $zero, $zero, .L80A70048 -/* 0091C 80A6FECC 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00007044 -glabel L80A6FED0 -/* 00920 80A6FED0 1000005D */ beq $zero, $zero, .L80A70048 -/* 00924 80A6FED4 24027055 */ addiu $v0, $zero, 0x7055 ## $v0 = 00007055 -glabel L80A6FED8 -/* 00928 80A6FED8 1000005B */ beq $zero, $zero, .L80A70048 -/* 0092C 80A6FEDC 24027089 */ addiu $v0, $zero, 0x7089 ## $v0 = 00007089 -glabel L80A6FEE0 -/* 00930 80A6FEE0 10000059 */ beq $zero, $zero, .L80A70048 -/* 00934 80A6FEE4 2402708A */ addiu $v0, $zero, 0x708A ## $v0 = 0000708A -glabel L80A6FEE8 -/* 00938 80A6FEE8 10000057 */ beq $zero, $zero, .L80A70048 -/* 0093C 80A6FEEC 2402700E */ addiu $v0, $zero, 0x700E ## $v0 = 0000700E -glabel L80A6FEF0 -/* 00940 80A6FEF0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00944 80A6FEF4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00948 80A6FEF8 8C490004 */ lw $t1, 0x0004($v0) ## 8015E664 -/* 0094C 80A6FEFC 51200019 */ beql $t1, $zero, .L80A6FF64 -/* 00950 80A6FF00 8C4F0010 */ lw $t7, 0x0010($v0) ## 8015E670 -/* 00954 80A6FF04 8C4A0010 */ lw $t2, 0x0010($v0) ## 8015E670 -/* 00958 80A6FF08 5540000C */ bnel $t2, $zero, .L80A6FF3C -/* 0095C 80A6FF0C 944D0F24 */ lhu $t5, 0x0F24($v0) ## 8015F584 -/* 00960 80A6FF10 944B0F24 */ lhu $t3, 0x0F24($v0) ## 8015F584 -/* 00964 80A6FF14 24035057 */ addiu $v1, $zero, 0x5057 ## $v1 = 00005057 -/* 00968 80A6FF18 316C0001 */ andi $t4, $t3, 0x0001 ## $t4 = 00000000 -/* 0096C 80A6FF1C 11800004 */ beq $t4, $zero, .L80A6FF30 -/* 00970 80A6FF20 00000000 */ nop -/* 00974 80A6FF24 24035058 */ addiu $v1, $zero, 0x5058 ## $v1 = 00005058 -/* 00978 80A6FF28 10000047 */ beq $zero, $zero, .L80A70048 -/* 0097C 80A6FF2C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005058 -.L80A6FF30: -/* 00980 80A6FF30 10000045 */ beq $zero, $zero, .L80A70048 -/* 00984 80A6FF34 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005058 -/* 00988 80A6FF38 944D0F24 */ lhu $t5, 0x0F24($v0) ## 00005F7C -.L80A6FF3C: -/* 0098C 80A6FF3C 24035059 */ addiu $v1, $zero, 0x5059 ## $v1 = 00005059 -/* 00990 80A6FF40 31AE0002 */ andi $t6, $t5, 0x0002 ## $t6 = 00000000 -/* 00994 80A6FF44 11C00004 */ beq $t6, $zero, .L80A6FF58 -/* 00998 80A6FF48 00000000 */ nop -/* 0099C 80A6FF4C 2403505A */ addiu $v1, $zero, 0x505A ## $v1 = 0000505A -/* 009A0 80A6FF50 1000003D */ beq $zero, $zero, .L80A70048 -/* 009A4 80A6FF54 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505A -.L80A6FF58: -/* 009A8 80A6FF58 1000003B */ beq $zero, $zero, .L80A70048 -/* 009AC 80A6FF5C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505A -/* 009B0 80A6FF60 8C4F0010 */ lw $t7, 0x0010($v0) ## 0000506A -.L80A6FF64: -/* 009B4 80A6FF64 15E0000B */ bne $t7, $zero, .L80A6FF94 -/* 009B8 80A6FF68 00000000 */ nop -/* 009BC 80A6FF6C 94580F24 */ lhu $t8, 0x0F24($v0) ## 00005F7E -/* 009C0 80A6FF70 2403505B */ addiu $v1, $zero, 0x505B ## $v1 = 0000505B -/* 009C4 80A6FF74 33190004 */ andi $t9, $t8, 0x0004 ## $t9 = 00000000 -/* 009C8 80A6FF78 13200004 */ beq $t9, $zero, .L80A6FF8C -/* 009CC 80A6FF7C 00000000 */ nop -/* 009D0 80A6FF80 2403505C */ addiu $v1, $zero, 0x505C ## $v1 = 0000505C -/* 009D4 80A6FF84 10000030 */ beq $zero, $zero, .L80A70048 -/* 009D8 80A6FF88 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505C -.L80A6FF8C: -/* 009DC 80A6FF8C 1000002E */ beq $zero, $zero, .L80A70048 -/* 009E0 80A6FF90 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505C -.L80A6FF94: -/* 009E4 80A6FF94 1000002C */ beq $zero, $zero, .L80A70048 -/* 009E8 80A6FF98 24025058 */ addiu $v0, $zero, 0x5058 ## $v0 = 00005058 -glabel L80A6FF9C -/* 009EC 80A6FF9C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 009F0 80A6FFA0 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 009F4 80A6FFA4 8C480004 */ lw $t0, 0x0004($v0) ## 8015E664 -/* 009F8 80A6FFA8 51000013 */ beql $t0, $zero, .L80A6FFF8 -/* 009FC 80A6FFAC 94CD0330 */ lhu $t5, 0x0330($a2) ## 00000330 -/* 00A00 80A6FFB0 94490EE4 */ lhu $t1, 0x0EE4($v0) ## 8015F544 -/* 00A04 80A6FFB4 2403505F */ addiu $v1, $zero, 0x505F ## $v1 = 0000505F -/* 00A08 80A6FFB8 312A0001 */ andi $t2, $t1, 0x0001 ## $t2 = 00000000 -/* 00A0C 80A6FFBC 51400004 */ beql $t2, $zero, .L80A6FFD0 -/* 00A10 80A6FFC0 944B0F24 */ lhu $t3, 0x0F24($v0) ## 8015F584 -/* 00A14 80A6FFC4 10000020 */ beq $zero, $zero, .L80A70048 -/* 00A18 80A6FFC8 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505F -/* 00A1C 80A6FFCC 944B0F24 */ lhu $t3, 0x0F24($v0) ## 00005F83 -.L80A6FFD0: -/* 00A20 80A6FFD0 2402505D */ addiu $v0, $zero, 0x505D ## $v0 = 0000505D -/* 00A24 80A6FFD4 316C0008 */ andi $t4, $t3, 0x0008 ## $t4 = 00000000 -/* 00A28 80A6FFD8 11800003 */ beq $t4, $zero, .L80A6FFE8 -/* 00A2C 80A6FFDC 00000000 */ nop -/* 00A30 80A6FFE0 10000001 */ beq $zero, $zero, .L80A6FFE8 -/* 00A34 80A6FFE4 2402505E */ addiu $v0, $zero, 0x505E ## $v0 = 0000505E -.L80A6FFE8: -/* 00A38 80A6FFE8 00401825 */ or $v1, $v0, $zero ## $v1 = 0000505E -/* 00A3C 80A6FFEC 10000016 */ beq $zero, $zero, .L80A70048 -/* 00A40 80A6FFF0 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 0000505E -/* 00A44 80A6FFF4 94CD0330 */ lhu $t5, 0x0330($a2) ## 00000330 -.L80A6FFF8: -/* 00A48 80A6FFF8 24035062 */ addiu $v1, $zero, 0x5062 ## $v1 = 00005062 -/* 00A4C 80A6FFFC 31AE0800 */ andi $t6, $t5, 0x0800 ## $t6 = 00000000 -/* 00A50 80A70000 51C00004 */ beql $t6, $zero, .L80A70014 -/* 00A54 80A70004 944F0F24 */ lhu $t7, 0x0F24($v0) ## 00005F82 -/* 00A58 80A70008 1000000F */ beq $zero, $zero, .L80A70048 -/* 00A5C 80A7000C 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005062 -/* 00A60 80A70010 944F0F24 */ lhu $t7, 0x0F24($v0) ## 00005F86 -.L80A70014: -/* 00A64 80A70014 24025060 */ addiu $v0, $zero, 0x5060 ## $v0 = 00005060 -/* 00A68 80A70018 31F80010 */ andi $t8, $t7, 0x0010 ## $t8 = 00000000 -/* 00A6C 80A7001C 13000003 */ beq $t8, $zero, .L80A7002C -/* 00A70 80A70020 00000000 */ nop -/* 00A74 80A70024 10000001 */ beq $zero, $zero, .L80A7002C -/* 00A78 80A70028 24025061 */ addiu $v0, $zero, 0x5061 ## $v0 = 00005061 -.L80A7002C: -/* 00A7C 80A7002C 00401825 */ or $v1, $v0, $zero ## $v1 = 00005061 -/* 00A80 80A70030 10000005 */ beq $zero, $zero, .L80A70048 -/* 00A84 80A70034 3062FFFF */ andi $v0, $v1, 0xFFFF ## $v0 = 00005061 -glabel L80A70038 -/* 00A88 80A70038 10000003 */ beq $zero, $zero, .L80A70048 -/* 00A8C 80A7003C 24027120 */ addiu $v0, $zero, 0x7120 ## $v0 = 00007120 -glabel L80A70040 -/* 00A90 80A70040 10000001 */ beq $zero, $zero, .L80A70048 -/* 00A94 80A70044 24027121 */ addiu $v0, $zero, 0x7121 ## $v0 = 00007121 -.L80A70048: -/* 00A98 80A70048 8FBF0014 */ lw $ra, 0x0014($sp) -/* 00A9C 80A7004C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00AA0 80A70050 03E00008 */ jr $ra -/* 00AA4 80A70054 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70058.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70058.s deleted file mode 100644 index 3816961847..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70058.s +++ /dev/null @@ -1,439 +0,0 @@ -.late_rodata -glabel jtbl_80A728C4 -.word L80A700D0 -.word L80A700D0 -.word L80A701B0 -.word L80A700D8 -.word L80A700D0 -.word L80A7056C -.word L80A700D0 -.word L80A700D0 -.word L80A700D0 -.word L80A700D0 -glabel jtbl_80A728EC -.word L80A70380 -.word L80A70564 -.word L80A70564 -.word L80A70564 -.word L80A70564 -.word L80A702CC -.word L80A702CC -.word L80A702CC -.word L80A702CC -glabel jtbl_80A72910 -.word L80A70318 -.word L80A70564 -.word L80A70440 -.word L80A70564 -.word L80A70564 -.word L80A7034C -.word L80A70564 -.word L80A703F0 -.word L80A70564 -.word L80A70424 -.word L80A70564 -.word L80A703B8 -.word L80A70564 -.word L80A7039C -.word L80A70564 -.word L80A70564 -.word L80A70564 -.word L80A703D4 -glabel jtbl_80A72958 -.word L80A70474 -.word L80A70564 -.word L80A70490 -.word L80A70564 -.word L80A704AC -.word L80A70564 -.word L80A704C8 -.word L80A70564 -.word L80A70564 -.word L80A704E4 - -.text -glabel func_80A70058 -/* 00AA8 80A70058 27BDFFB8 */ addiu $sp, $sp, 0xFFB8 ## $sp = FFFFFFB8 -/* 00AAC 80A7005C 3C0F80A7 */ lui $t7, %hi(D_80A727F0) ## $t7 = 80A70000 -/* 00AB0 80A70060 AFBF0024 */ sw $ra, 0x0024($sp) -/* 00AB4 80A70064 AFB00020 */ sw $s0, 0x0020($sp) -/* 00AB8 80A70068 AFA40048 */ sw $a0, 0x0048($sp) -/* 00ABC 80A7006C AFA5004C */ sw $a1, 0x004C($sp) -/* 00AC0 80A70070 25EF27F0 */ addiu $t7, $t7, %lo(D_80A727F0) ## $t7 = 80A727F0 -/* 00AC4 80A70074 8DF90000 */ lw $t9, 0x0000($t7) ## 80A727F0 -/* 00AC8 80A70078 8DF80004 */ lw $t8, 0x0004($t7) ## 80A727F4 -/* 00ACC 80A7007C 27AE003C */ addiu $t6, $sp, 0x003C ## $t6 = FFFFFFF4 -/* 00AD0 80A70080 3C0980A7 */ lui $t1, %hi(D_80A727F8) ## $t1 = 80A70000 -/* 00AD4 80A70084 252927F8 */ addiu $t1, $t1, %lo(D_80A727F8) ## $t1 = 80A727F8 -/* 00AD8 80A70088 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFF4 -/* 00ADC 80A7008C ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF8 -/* 00AE0 80A70090 8D2A0004 */ lw $t2, 0x0004($t1) ## 80A727FC -/* 00AE4 80A70094 8D2B0000 */ lw $t3, 0x0000($t1) ## 80A727F8 -/* 00AE8 80A70098 27A80034 */ addiu $t0, $sp, 0x0034 ## $t0 = FFFFFFEC -/* 00AEC 80A7009C AD0A0004 */ sw $t2, 0x0004($t0) ## FFFFFFF0 -/* 00AF0 80A700A0 AD0B0000 */ sw $t3, 0x0000($t0) ## FFFFFFEC -/* 00AF4 80A700A4 8FA40048 */ lw $a0, 0x0048($sp) -/* 00AF8 80A700A8 0C042F6F */ jal func_8010BDBC -/* 00AFC 80A700AC 248420D8 */ addiu $a0, $a0, 0x20D8 ## $a0 = 000020D8 -/* 00B00 80A700B0 2C41000A */ sltiu $at, $v0, 0x000A -/* 00B04 80A700B4 10200135 */ beq $at, $zero, .L80A7058C -/* 00B08 80A700B8 00026080 */ sll $t4, $v0, 2 -/* 00B0C 80A700BC 3C0180A7 */ lui $at, %hi(jtbl_80A728C4) ## $at = 80A70000 -/* 00B10 80A700C0 002C0821 */ addu $at, $at, $t4 -/* 00B14 80A700C4 8C2C28C4 */ lw $t4, %lo(jtbl_80A728C4)($at) -/* 00B18 80A700C8 01800008 */ jr $t4 -/* 00B1C 80A700CC 00000000 */ nop -glabel L80A700D0 -/* 00B20 80A700D0 1000012F */ beq $zero, $zero, .L80A70590 -/* 00B24 80A700D4 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -glabel L80A700D8 -/* 00B28 80A700D8 8FA3004C */ lw $v1, 0x004C($sp) -/* 00B2C 80A700DC 2401709E */ addiu $at, $zero, 0x709E ## $at = 0000709E -/* 00B30 80A700E0 9462010E */ lhu $v0, 0x010E($v1) ## 0000010E -/* 00B34 80A700E4 1041000E */ beq $v0, $at, .L80A70120 -/* 00B38 80A700E8 00408025 */ or $s0, $v0, $zero ## $s0 = 00000001 -/* 00B3C 80A700EC 2401709F */ addiu $at, $zero, 0x709F ## $at = 0000709F -/* 00B40 80A700F0 1201000B */ beq $s0, $at, .L80A70120 -/* 00B44 80A700F4 240170F0 */ addiu $at, $zero, 0x70F0 ## $at = 000070F0 -/* 00B48 80A700F8 12010020 */ beq $s0, $at, .L80A7017C -/* 00B4C 80A700FC 240170F1 */ addiu $at, $zero, 0x70F1 ## $at = 000070F1 -/* 00B50 80A70100 1201001E */ beq $s0, $at, .L80A7017C -/* 00B54 80A70104 240170F2 */ addiu $at, $zero, 0x70F2 ## $at = 000070F2 -/* 00B58 80A70108 1201001C */ beq $s0, $at, .L80A7017C -/* 00B5C 80A7010C 240170F3 */ addiu $at, $zero, 0x70F3 ## $at = 000070F3 -/* 00B60 80A70110 5201001B */ beql $s0, $at, .L80A70180 -/* 00B64 80A70114 8C680154 */ lw $t0, 0x0154($v1) ## 00000154 -/* 00B68 80A70118 1000011D */ beq $zero, $zero, .L80A70590 -/* 00B6C 80A7011C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70120: -/* 00B70 80A70120 806D0215 */ lb $t5, 0x0215($v1) ## 00000215 -/* 00B74 80A70124 3C078013 */ lui $a3, %hi(D_801333E0) -/* 00B78 80A70128 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 00B7C 80A7012C 15A0001E */ bne $t5, $zero, .L80A701A8 -/* 00B80 80A70130 2401709F */ addiu $at, $zero, 0x709F ## $at = 0000709F -/* 00B84 80A70134 14410003 */ bne $v0, $at, .L80A70144 -/* 00B88 80A70138 3C058013 */ lui $a1, %hi(D_801333D4) -/* 00B8C 80A7013C 10000002 */ beq $zero, $zero, .L80A70148 -/* 00B90 80A70140 24104802 */ addiu $s0, $zero, 0x4802 ## $s0 = 00004802 -.L80A70144: -/* 00B94 80A70144 24104806 */ addiu $s0, $zero, 0x4806 ## $s0 = 00004806 -.L80A70148: -/* 00B98 80A70148 3C0E8013 */ lui $t6, %hi(D_801333E8) -/* 00B9C 80A7014C 25CE33E8 */ addiu $t6, %lo(D_801333E8) -/* 00BA0 80A70150 AFAE0014 */ sw $t6, 0x0014($sp) -/* 00BA4 80A70154 3204FFFF */ andi $a0, $s0, 0xFFFF ## $a0 = 00004806 -/* 00BA8 80A70158 24A533D4 */ addiu $a1, %lo(D_801333D4) -/* 00BAC 80A7015C 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00BB0 80A70160 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00BB4 80A70164 AFA70010 */ sw $a3, 0x0010($sp) -/* 00BB8 80A70168 8FB8004C */ lw $t8, 0x004C($sp) -/* 00BBC 80A7016C 240F0001 */ addiu $t7, $zero, 0x0001 ## $t7 = 00000001 -/* 00BC0 80A70170 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 00BC4 80A70174 10000106 */ beq $zero, $zero, .L80A70590 -/* 00BC8 80A70178 A30F0215 */ sb $t7, 0x0215($t8) ## 00000215 -.L80A7017C: -/* 00BCC 80A7017C 8C680154 */ lw $t0, 0x0154($v1) ## 00000154 -.L80A70180: -/* 00BD0 80A70180 3C190600 */ lui $t9, %hi(D_060033B4) ## $t9 = 06000000 -/* 00BD4 80A70184 273933B4 */ addiu $t9, $t9, %lo(D_060033B4) ## $t9 = 060033B4 -/* 00BD8 80A70188 13280007 */ beq $t9, $t0, .L80A701A8 -/* 00BDC 80A7018C 2464014C */ addiu $a0, $v1, 0x014C ## $a0 = 0000014C -/* 00BE0 80A70190 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 00BE4 80A70194 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 00BE8 80A70198 0C00D3B0 */ jal func_80034EC0 -/* 00BEC 80A7019C 24060017 */ addiu $a2, $zero, 0x0017 ## $a2 = 00000017 -/* 00BF0 80A701A0 0C03D719 */ jal func_800F5C64 -/* 00BF4 80A701A4 24040922 */ addiu $a0, $zero, 0x0922 ## $a0 = 00000922 -.L80A701A8: -/* 00BF8 80A701A8 100000F9 */ beq $zero, $zero, .L80A70590 -/* 00BFC 80A701AC 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -glabel L80A701B0 -/* 00C00 80A701B0 8FA7004C */ lw $a3, 0x004C($sp) -/* 00C04 80A701B4 94E2010E */ lhu $v0, 0x010E($a3) ## 0000010E -/* 00C08 80A701B8 28417048 */ slti $at, $v0, 0x7048 -/* 00C0C 80A701BC 1420001E */ bne $at, $zero, .L80A70238 -/* 00C10 80A701C0 00408025 */ or $s0, $v0, $zero ## $s0 = 00000001 -/* 00C14 80A701C4 2A0170A0 */ slti $at, $s0, 0x70A0 -/* 00C18 80A701C8 14200010 */ bne $at, $zero, .L80A7020C -/* 00C1C 80A701CC 26098F15 */ addiu $t1, $s0, 0x8F15 ## $t1 = FFFF8F16 -/* 00C20 80A701D0 2A0170A5 */ slti $at, $s0, 0x70A5 -/* 00C24 80A701D4 14200008 */ bne $at, $zero, .L80A701F8 -/* 00C28 80A701D8 2D210009 */ sltiu $at, $t1, 0x0009 -/* 00C2C 80A701DC 102000E1 */ beq $at, $zero, .L80A70564 -/* 00C30 80A701E0 00094880 */ sll $t1, $t1, 2 -/* 00C34 80A701E4 3C0180A7 */ lui $at, %hi(jtbl_80A728EC) ## $at = 80A70000 -/* 00C38 80A701E8 00290821 */ addu $at, $at, $t1 -/* 00C3C 80A701EC 8C2928EC */ lw $t1, %lo(jtbl_80A728EC)($at) -/* 00C40 80A701F0 01200008 */ jr $t1 -/* 00C44 80A701F4 00000000 */ nop -.L80A701F8: -/* 00C48 80A701F8 240170A4 */ addiu $at, $zero, 0x70A4 ## $at = 000070A4 -/* 00C4C 80A701FC 12010097 */ beq $s0, $at, .L80A7045C -/* 00C50 80A70200 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00C54 80A70204 100000E2 */ beq $zero, $zero, .L80A70590 -/* 00C58 80A70208 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A7020C: -/* 00C5C 80A7020C 24017048 */ addiu $at, $zero, 0x7048 ## $at = 00007048 -/* 00C60 80A70210 1201007E */ beq $s0, $at, .L80A7040C -/* 00C64 80A70214 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00C68 80A70218 2401709E */ addiu $at, $zero, 0x709E ## $at = 0000709E -/* 00C6C 80A7021C 120100BE */ beq $s0, $at, .L80A70518 -/* 00C70 80A70220 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00C74 80A70224 2401709F */ addiu $at, $zero, 0x709F ## $at = 0000709F -/* 00C78 80A70228 120100BF */ beq $s0, $at, .L80A70528 -/* 00C7C 80A7022C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00C80 80A70230 100000D7 */ beq $zero, $zero, .L80A70590 -/* 00C84 80A70234 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70238: -/* 00C88 80A70238 2A017028 */ slti $at, $s0, 0x7028 -/* 00C8C 80A7023C 14200009 */ bne $at, $zero, .L80A70264 -/* 00C90 80A70240 260A8FEA */ addiu $t2, $s0, 0x8FEA ## $t2 = FFFF8FEB -/* 00C94 80A70244 24017045 */ addiu $at, $zero, 0x7045 ## $at = 00007045 -/* 00C98 80A70248 1201003A */ beq $s0, $at, .L80A70334 -/* 00C9C 80A7024C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00CA0 80A70250 24017047 */ addiu $at, $zero, 0x7047 ## $at = 00007047 -/* 00CA4 80A70254 12010044 */ beq $s0, $at, .L80A70368 -/* 00CA8 80A70258 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00CAC 80A7025C 100000CC */ beq $zero, $zero, .L80A70590 -/* 00CB0 80A70260 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70264: -/* 00CB4 80A70264 2A01508C */ slti $at, $s0, 0x508C -/* 00CB8 80A70268 14200009 */ bne $at, $zero, .L80A70290 -/* 00CBC 80A7026C 260BAFA9 */ addiu $t3, $s0, 0xAFA9 ## $t3 = FFFFAFAA -/* 00CC0 80A70270 2D410012 */ sltiu $at, $t2, 0x0012 -/* 00CC4 80A70274 102000BB */ beq $at, $zero, .L80A70564 -/* 00CC8 80A70278 000A5080 */ sll $t2, $t2, 2 -/* 00CCC 80A7027C 3C0180A7 */ lui $at, %hi(jtbl_80A72910) ## $at = 80A70000 -/* 00CD0 80A70280 002A0821 */ addu $at, $at, $t2 -/* 00CD4 80A70284 8C2A2910 */ lw $t2, %lo(jtbl_80A72910)($at) -/* 00CD8 80A70288 01400008 */ jr $t2 -/* 00CDC 80A7028C 00000000 */ nop -.L80A70290: -/* 00CE0 80A70290 2A015061 */ slti $at, $s0, 0x5061 -/* 00CE4 80A70294 14200005 */ bne $at, $zero, .L80A702AC -/* 00CE8 80A70298 2401508B */ addiu $at, $zero, 0x508B ## $at = 0000508B -/* 00CEC 80A7029C 12010098 */ beq $s0, $at, .L80A70500 -/* 00CF0 80A702A0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00CF4 80A702A4 100000BA */ beq $zero, $zero, .L80A70590 -/* 00CF8 80A702A8 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A702AC: -/* 00CFC 80A702AC 2D61000A */ sltiu $at, $t3, 0x000A -/* 00D00 80A702B0 102000AC */ beq $at, $zero, .L80A70564 -/* 00D04 80A702B4 000B5880 */ sll $t3, $t3, 2 -/* 00D08 80A702B8 3C0180A7 */ lui $at, %hi(jtbl_80A72958) ## $at = 80A70000 -/* 00D0C 80A702BC 002B0821 */ addu $at, $at, $t3 -/* 00D10 80A702C0 8C2B2958 */ lw $t3, %lo(jtbl_80A72958)($at) -/* 00D14 80A702C4 01600008 */ jr $t3 -/* 00D18 80A702C8 00000000 */ nop -glabel L80A702CC -/* 00D1C 80A702CC 00026040 */ sll $t4, $v0, 1 -/* 00D20 80A702D0 03AC2021 */ addu $a0, $sp, $t4 -/* 00D24 80A702D4 3C01FFFF */ lui $at, 0xFFFF ## $at = FFFF0000 -/* 00D28 80A702D8 00240821 */ addu $at, $at, $a0 -/* 00D2C 80A702DC 0C021CC3 */ jal Rupees_ChangeBy -/* 00D30 80A702E0 84241E54 */ lh $a0, 0x1E54($at) ## FFFF1E54 -/* 00D34 80A702E4 8FA4004C */ lw $a0, 0x004C($sp) -/* 00D38 80A702E8 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 00D3C 80A702EC 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 00D40 80A702F0 24060011 */ addiu $a2, $zero, 0x0011 ## $a2 = 00000011 -/* 00D44 80A702F4 0C00D3B0 */ jal func_80034EC0 -/* 00D48 80A702F8 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 00D4C 80A702FC 8FA40048 */ lw $a0, 0x0048($sp) -/* 00D50 80A70300 24060014 */ addiu $a2, $zero, 0x0014 ## $a2 = 00000014 -/* 00D54 80A70304 2407001E */ addiu $a3, $zero, 0x001E ## $a3 = 0000001E -/* 00D58 80A70308 0C023B67 */ jal Player_UpdateBottleHeld -/* 00D5C 80A7030C 8C851C44 */ lw $a1, 0x1C44($a0) ## 00001C44 -/* 00D60 80A70310 1000009F */ beq $zero, $zero, .L80A70590 -/* 00D64 80A70314 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70318 -/* 00D68 80A70318 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00D6C 80A7031C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00D70 80A70320 944D0F10 */ lhu $t5, 0x0F10($v0) ## 8015F570 -/* 00D74 80A70324 35AE0001 */ ori $t6, $t5, 0x0001 ## $t6 = 00000001 -/* 00D78 80A70328 A44E0F10 */ sh $t6, 0x0F10($v0) ## 8015F570 -/* 00D7C 80A7032C 10000098 */ beq $zero, $zero, .L80A70590 -/* 00D80 80A70330 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70334: -/* 00D84 80A70334 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00D88 80A70338 944F0F10 */ lhu $t7, 0x0F10($v0) ## FFFFF570 -/* 00D8C 80A7033C 35F80002 */ ori $t8, $t7, 0x0002 ## $t8 = 00000002 -/* 00D90 80A70340 A4580F10 */ sh $t8, 0x0F10($v0) ## FFFFF570 -/* 00D94 80A70344 10000092 */ beq $zero, $zero, .L80A70590 -/* 00D98 80A70348 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A7034C -/* 00D9C 80A7034C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00DA0 80A70350 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00DA4 80A70354 94590F10 */ lhu $t9, 0x0F10($v0) ## 8015F570 -/* 00DA8 80A70358 37280004 */ ori $t0, $t9, 0x0004 ## $t0 = 00000004 -/* 00DAC 80A7035C A4480F10 */ sh $t0, 0x0F10($v0) ## 8015F570 -/* 00DB0 80A70360 1000008B */ beq $zero, $zero, .L80A70590 -/* 00DB4 80A70364 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70368: -/* 00DB8 80A70368 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00DBC 80A7036C 94490F10 */ lhu $t1, 0x0F10($v0) ## FFFFF570 -/* 00DC0 80A70370 352A0008 */ ori $t2, $t1, 0x0008 ## $t2 = 00000008 -/* 00DC4 80A70374 A44A0F10 */ sh $t2, 0x0F10($v0) ## FFFFF570 -/* 00DC8 80A70378 10000085 */ beq $zero, $zero, .L80A70590 -/* 00DCC 80A7037C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70380 -/* 00DD0 80A70380 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00DD4 80A70384 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00DD8 80A70388 944B0F10 */ lhu $t3, 0x0F10($v0) ## 8015F570 -/* 00DDC 80A7038C 356C0010 */ ori $t4, $t3, 0x0010 ## $t4 = 00000010 -/* 00DE0 80A70390 A44C0F10 */ sh $t4, 0x0F10($v0) ## 8015F570 -/* 00DE4 80A70394 1000007E */ beq $zero, $zero, .L80A70590 -/* 00DE8 80A70398 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A7039C -/* 00DEC 80A7039C 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00DF0 80A703A0 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00DF4 80A703A4 944D0F10 */ lhu $t5, 0x0F10($v0) ## 8015F570 -/* 00DF8 80A703A8 35AE0020 */ ori $t6, $t5, 0x0020 ## $t6 = 00000020 -/* 00DFC 80A703AC A44E0F10 */ sh $t6, 0x0F10($v0) ## 8015F570 -/* 00E00 80A703B0 10000077 */ beq $zero, $zero, .L80A70590 -/* 00E04 80A703B4 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A703B8 -/* 00E08 80A703B8 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00E0C 80A703BC 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E10 80A703C0 944F0F10 */ lhu $t7, 0x0F10($v0) ## 8015F570 -/* 00E14 80A703C4 35F80040 */ ori $t8, $t7, 0x0040 ## $t8 = 00000040 -/* 00E18 80A703C8 A4580F10 */ sh $t8, 0x0F10($v0) ## 8015F570 -/* 00E1C 80A703CC 10000070 */ beq $zero, $zero, .L80A70590 -/* 00E20 80A703D0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A703D4 -/* 00E24 80A703D4 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00E28 80A703D8 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E2C 80A703DC 94590F10 */ lhu $t9, 0x0F10($v0) ## 8015F570 -/* 00E30 80A703E0 37280080 */ ori $t0, $t9, 0x0080 ## $t0 = 00000080 -/* 00E34 80A703E4 A4480F10 */ sh $t0, 0x0F10($v0) ## 8015F570 -/* 00E38 80A703E8 10000069 */ beq $zero, $zero, .L80A70590 -/* 00E3C 80A703EC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A703F0 -/* 00E40 80A703F0 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00E44 80A703F4 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E48 80A703F8 94490F10 */ lhu $t1, 0x0F10($v0) ## 8015F570 -/* 00E4C 80A703FC 352A0100 */ ori $t2, $t1, 0x0100 ## $t2 = 00000100 -/* 00E50 80A70400 A44A0F10 */ sh $t2, 0x0F10($v0) ## 8015F570 -/* 00E54 80A70404 10000062 */ beq $zero, $zero, .L80A70590 -/* 00E58 80A70408 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A7040C: -/* 00E5C 80A7040C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E60 80A70410 944B0F10 */ lhu $t3, 0x0F10($v0) ## FFFFF570 -/* 00E64 80A70414 356C0200 */ ori $t4, $t3, 0x0200 ## $t4 = 00000200 -/* 00E68 80A70418 A44C0F10 */ sh $t4, 0x0F10($v0) ## FFFFF570 -/* 00E6C 80A7041C 1000005C */ beq $zero, $zero, .L80A70590 -/* 00E70 80A70420 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70424 -/* 00E74 80A70424 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00E78 80A70428 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E7C 80A7042C 944D0F10 */ lhu $t5, 0x0F10($v0) ## 8015F570 -/* 00E80 80A70430 35AE0400 */ ori $t6, $t5, 0x0400 ## $t6 = 00000400 -/* 00E84 80A70434 A44E0F10 */ sh $t6, 0x0F10($v0) ## 8015F570 -/* 00E88 80A70438 10000055 */ beq $zero, $zero, .L80A70590 -/* 00E8C 80A7043C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70440 -/* 00E90 80A70440 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00E94 80A70444 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00E98 80A70448 944F0F10 */ lhu $t7, 0x0F10($v0) ## 8015F570 -/* 00E9C 80A7044C 35F82000 */ ori $t8, $t7, 0x2000 ## $t8 = 00002000 -/* 00EA0 80A70450 A4580F10 */ sh $t8, 0x0F10($v0) ## 8015F570 -/* 00EA4 80A70454 1000004E */ beq $zero, $zero, .L80A70590 -/* 00EA8 80A70458 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A7045C: -/* 00EAC 80A7045C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00EB0 80A70460 94590F10 */ lhu $t9, 0x0F10($v0) ## FFFFF570 -/* 00EB4 80A70464 37281000 */ ori $t0, $t9, 0x1000 ## $t0 = 00001000 -/* 00EB8 80A70468 A4480F10 */ sh $t0, 0x0F10($v0) ## FFFFF570 -/* 00EBC 80A7046C 10000048 */ beq $zero, $zero, .L80A70590 -/* 00EC0 80A70470 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70474 -/* 00EC4 80A70474 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00EC8 80A70478 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00ECC 80A7047C 94490F24 */ lhu $t1, 0x0F24($v0) ## 8015F584 -/* 00ED0 80A70480 352A0001 */ ori $t2, $t1, 0x0001 ## $t2 = 00000001 -/* 00ED4 80A70484 A44A0F24 */ sh $t2, 0x0F24($v0) ## 8015F584 -/* 00ED8 80A70488 10000041 */ beq $zero, $zero, .L80A70590 -/* 00EDC 80A7048C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A70490 -/* 00EE0 80A70490 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00EE4 80A70494 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00EE8 80A70498 944B0F24 */ lhu $t3, 0x0F24($v0) ## 8015F584 -/* 00EEC 80A7049C 356C0002 */ ori $t4, $t3, 0x0002 ## $t4 = 00000002 -/* 00EF0 80A704A0 A44C0F24 */ sh $t4, 0x0F24($v0) ## 8015F584 -/* 00EF4 80A704A4 1000003A */ beq $zero, $zero, .L80A70590 -/* 00EF8 80A704A8 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A704AC -/* 00EFC 80A704AC 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00F00 80A704B0 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F04 80A704B4 944D0F24 */ lhu $t5, 0x0F24($v0) ## 8015F584 -/* 00F08 80A704B8 35AE0004 */ ori $t6, $t5, 0x0004 ## $t6 = 00000004 -/* 00F0C 80A704BC A44E0F24 */ sh $t6, 0x0F24($v0) ## 8015F584 -/* 00F10 80A704C0 10000033 */ beq $zero, $zero, .L80A70590 -/* 00F14 80A704C4 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A704C8 -/* 00F18 80A704C8 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00F1C 80A704CC 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F20 80A704D0 944F0F24 */ lhu $t7, 0x0F24($v0) ## 8015F584 -/* 00F24 80A704D4 35F80008 */ ori $t8, $t7, 0x0008 ## $t8 = 00000008 -/* 00F28 80A704D8 A4580F24 */ sh $t8, 0x0F24($v0) ## 8015F584 -/* 00F2C 80A704DC 1000002C */ beq $zero, $zero, .L80A70590 -/* 00F30 80A704E0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A704E4 -/* 00F34 80A704E4 3C028016 */ lui $v0, %hi(gSaveContext) -/* 00F38 80A704E8 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F3C 80A704EC 94590F24 */ lhu $t9, 0x0F24($v0) ## 8015F584 -/* 00F40 80A704F0 37280010 */ ori $t0, $t9, 0x0010 ## $t0 = 00000010 -/* 00F44 80A704F4 A4480F24 */ sh $t0, 0x0F24($v0) ## 8015F584 -/* 00F48 80A704F8 10000025 */ beq $zero, $zero, .L80A70590 -/* 00F4C 80A704FC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70500: -/* 00F50 80A70500 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F54 80A70504 94490F10 */ lhu $t1, 0x0F10($v0) ## FFFFF570 -/* 00F58 80A70508 352A0800 */ ori $t2, $t1, 0x0800 ## $t2 = 00000800 -/* 00F5C 80A7050C A44A0F10 */ sh $t2, 0x0F10($v0) ## FFFFF570 -/* 00F60 80A70510 1000001F */ beq $zero, $zero, .L80A70590 -/* 00F64 80A70514 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70518: -/* 00F68 80A70518 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F6C 80A7051C A44013C4 */ sh $zero, 0x13C4($v0) ## FFFFFA24 -/* 00F70 80A70520 1000001B */ beq $zero, $zero, .L80A70590 -/* 00F74 80A70524 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70528: -/* 00F78 80A70528 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00F7C 80A7052C 944B0F2A */ lhu $t3, 0x0F2A($v0) ## FFFFF58A -/* 00F80 80A70530 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 -/* 00F84 80A70534 8FA50048 */ lw $a1, 0x0048($sp) -/* 00F88 80A70538 316C0002 */ andi $t4, $t3, 0x0002 ## $t4 = 00000000 -/* 00F8C 80A7053C 11800003 */ beq $t4, $zero, .L80A7054C -/* 00F90 80A70540 2410003E */ addiu $s0, $zero, 0x003E ## $s0 = 0000003E -/* 00F94 80A70544 10000001 */ beq $zero, $zero, .L80A7054C -/* 00F98 80A70548 2410004D */ addiu $s0, $zero, 0x004D ## $s0 = 0000004D -.L80A7054C: -/* 00F9C 80A7054C 0C29BDF3 */ jal func_80A6F7CC -/* 00FA0 80A70550 02003025 */ or $a2, $s0, $zero ## $a2 = 0000004D -/* 00FA4 80A70554 8FAE004C */ lw $t6, 0x004C($sp) -/* 00FA8 80A70558 3C0D80A7 */ lui $t5, %hi(func_80A714C4) ## $t5 = 80A70000 -/* 00FAC 80A7055C 25AD14C4 */ addiu $t5, $t5, %lo(func_80A714C4) ## $t5 = 80A714C4 -/* 00FB0 80A70560 ADCD0190 */ sw $t5, 0x0190($t6) ## 00000190 -glabel L80A70564 -.L80A70564: -/* 00FB4 80A70564 1000000A */ beq $zero, $zero, .L80A70590 -/* 00FB8 80A70568 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -glabel L80A7056C -/* 00FBC 80A7056C 0C041AF2 */ jal func_80106BC8 -/* 00FC0 80A70570 8FA40048 */ lw $a0, 0x0048($sp) -/* 00FC4 80A70574 14400003 */ bne $v0, $zero, .L80A70584 -/* 00FC8 80A70578 00000000 */ nop -/* 00FCC 80A7057C 10000004 */ beq $zero, $zero, .L80A70590 -/* 00FD0 80A70580 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70584: -/* 00FD4 80A70584 10000002 */ beq $zero, $zero, .L80A70590 -/* 00FD8 80A70588 24020002 */ addiu $v0, $zero, 0x0002 ## $v0 = 00000002 -.L80A7058C: -/* 00FDC 80A7058C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70590: -/* 00FE0 80A70590 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00FE4 80A70594 8FB00020 */ lw $s0, 0x0020($sp) -/* 00FE8 80A70598 27BD0048 */ addiu $sp, $sp, 0x0048 ## $sp = 00000000 -/* 00FEC 80A7059C 03E00008 */ jr $ra -/* 00FF0 80A705A0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A705A4.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A705A4.s deleted file mode 100644 index d4d7026c10..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A705A4.s +++ /dev/null @@ -1,53 +0,0 @@ -glabel func_80A705A4 -/* 00FF4 80A705A4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 00FF8 80A705A8 AFBF0014 */ sw $ra, 0x0014($sp) -/* 00FFC 80A705AC 8482021A */ lh $v0, 0x021A($a0) ## 0000021A -/* 01000 80A705B0 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 01004 80A705B4 14400003 */ bne $v0, $zero, .L80A705C4 -/* 01008 80A705B8 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 0100C 80A705BC 10000003 */ beq $zero, $zero, .L80A705CC -/* 01010 80A705C0 00001825 */ or $v1, $zero, $zero ## $v1 = 00000000 -.L80A705C4: -/* 01014 80A705C4 A4CE021A */ sh $t6, 0x021A($a2) ## 0000021A -/* 01018 80A705C8 84C3021A */ lh $v1, 0x021A($a2) ## 0000021A -.L80A705CC: -/* 0101C 80A705CC 14600020 */ bne $v1, $zero, .L80A70650 -/* 01020 80A705D0 3C0280A7 */ lui $v0, %hi(D_80A722D8) ## $v0 = 80A70000 -/* 01024 80A705D4 84CF001C */ lh $t7, 0x001C($a2) ## 0000001C -/* 01028 80A705D8 84C80218 */ lh $t0, 0x0218($a2) ## 00000218 -/* 0102C 80A705DC 3C0380A7 */ lui $v1, %hi(D_80A71F58) ## $v1 = 80A70000 -/* 01030 80A705E0 31F8007F */ andi $t8, $t7, 0x007F ## $t8 = 00000000 -/* 01034 80A705E4 0018C880 */ sll $t9, $t8, 2 -/* 01038 80A705E8 0338C823 */ subu $t9, $t9, $t8 -/* 0103C 80A705EC 0019C880 */ sll $t9, $t9, 2 -/* 01040 80A705F0 00591021 */ addu $v0, $v0, $t9 -/* 01044 80A705F4 904222D8 */ lbu $v0, %lo(D_80A722D8)($v0) -/* 01048 80A705F8 25090001 */ addiu $t1, $t0, 0x0001 ## $t1 = 00000001 -/* 0104C 80A705FC A4C90218 */ sh $t1, 0x0218($a2) ## 00000218 -/* 01050 80A70600 00025080 */ sll $t2, $v0, 2 -/* 01054 80A70604 01425023 */ subu $t2, $t2, $v0 -/* 01058 80A70608 000A5080 */ sll $t2, $t2, 2 -/* 0105C 80A7060C 006A1821 */ addu $v1, $v1, $t2 -/* 01060 80A70610 8C631F58 */ lw $v1, %lo(D_80A71F58)($v1) -/* 01064 80A70614 5060000F */ beql $v1, $zero, .L80A70654 -/* 01068 80A70618 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0106C 80A7061C 84CB0218 */ lh $t3, 0x0218($a2) ## 00000218 -/* 01070 80A70620 2404001E */ addiu $a0, $zero, 0x001E ## $a0 = 0000001E -/* 01074 80A70624 2405001E */ addiu $a1, $zero, 0x001E ## $a1 = 0000001E -/* 01078 80A70628 000B6080 */ sll $t4, $t3, 2 -/* 0107C 80A7062C 006C6821 */ addu $t5, $v1, $t4 -/* 01080 80A70630 8DAE0000 */ lw $t6, 0x0000($t5) ## 00000000 -/* 01084 80A70634 55C00007 */ bnel $t6, $zero, .L80A70654 -/* 01088 80A70638 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0108C 80A7063C 0C01DF64 */ jal Rand_S16Offset - -/* 01090 80A70640 AFA60018 */ sw $a2, 0x0018($sp) -/* 01094 80A70644 8FA60018 */ lw $a2, 0x0018($sp) -/* 01098 80A70648 A4C2021A */ sh $v0, 0x021A($a2) ## 0000021A -/* 0109C 80A7064C A4C00218 */ sh $zero, 0x0218($a2) ## 00000218 -.L80A70650: -/* 010A0 80A70650 8FBF0014 */ lw $ra, 0x0014($sp) -.L80A70654: -/* 010A4 80A70654 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 010A8 80A70658 03E00008 */ jr $ra -/* 010AC 80A7065C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70660.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70660.s deleted file mode 100644 index 7bc66da601..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70660.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80A70660 -/* 010B0 80A70660 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 010B4 80A70664 3C0F80A7 */ lui $t7, %hi(D_80A723D4) ## $t7 = 80A70000 -/* 010B8 80A70668 25EF23D4 */ addiu $t7, $t7, %lo(D_80A723D4) ## $t7 = 80A723D4 -/* 010BC 80A7066C 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -/* 010C0 80A70670 304200FF */ andi $v0, $v0, 0x00FF ## $v0 = 00000000 -/* 010C4 80A70674 00027080 */ sll $t6, $v0, 2 -/* 010C8 80A70678 01C27021 */ addu $t6, $t6, $v0 -/* 010CC 80A7067C 000E7040 */ sll $t6, $t6, 1 -/* 010D0 80A70680 01CF1821 */ addu $v1, $t6, $t7 -/* 010D4 80A70684 84780006 */ lh $t8, 0x0006($v1) ## 00000006 -/* 010D8 80A70688 A49801DC */ sh $t8, 0x01DC($a0) ## 000001DC -/* 010DC 80A7068C 84790008 */ lh $t9, 0x0008($v1) ## 00000008 -/* 010E0 80A70690 03E00008 */ jr $ra -/* 010E4 80A70694 A49901DE */ sh $t9, 0x01DE($a0) ## 000001DE diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70698.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70698.s deleted file mode 100644 index 65d07b4954..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70698.s +++ /dev/null @@ -1,41 +0,0 @@ -glabel func_80A70698 -/* 010E8 80A70698 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 010EC 80A7069C AFBF0014 */ sw $ra, 0x0014($sp) -/* 010F0 80A706A0 8483001C */ lh $v1, 0x001C($a0) ## 0000001C -/* 010F4 80A706A4 3C0F80A7 */ lui $t7, %hi(D_80A725A4) ## $t7 = 80A70000 -/* 010F8 80A706A8 25EF25A4 */ addiu $t7, $t7, %lo(D_80A725A4) ## $t7 = 80A725A4 -/* 010FC 80A706AC 3063007F */ andi $v1, $v1, 0x007F ## $v1 = 00000000 -/* 01100 80A706B0 306300FF */ andi $v1, $v1, 0x00FF ## $v1 = 00000000 -/* 01104 80A706B4 000370C0 */ sll $t6, $v1, 3 -/* 01108 80A706B8 01C37023 */ subu $t6, $t6, $v1 -/* 0110C 80A706BC 000E7080 */ sll $t6, $t6, 2 -/* 01110 80A706C0 01CF1021 */ addu $v0, $t6, $t7 -/* 01114 80A706C4 C4440000 */ lwc1 $f4, 0x0000($v0) ## 00000000 -/* 01118 80A706C8 E48400C4 */ swc1 $f4, 0x00C4($a0) ## 000000C4 -/* 0111C 80A706CC AFA40020 */ sw $a0, 0x0020($sp) -/* 01120 80A706D0 AFA20018 */ sw $v0, 0x0018($sp) -/* 01124 80A706D4 0C00B58B */ jal Actor_SetScale - -/* 01128 80A706D8 8C450010 */ lw $a1, 0x0010($v0) ## 00000010 -/* 0112C 80A706DC 8FA20018 */ lw $v0, 0x0018($sp) -/* 01130 80A706E0 8FA40020 */ lw $a0, 0x0020($sp) -/* 01134 80A706E4 80580014 */ lb $t8, 0x0014($v0) ## 00000014 -/* 01138 80A706E8 848901DC */ lh $t1, 0x01DC($a0) ## 000001DC -/* 0113C 80A706EC A098001F */ sb $t8, 0x001F($a0) ## 0000001F -/* 01140 80A706F0 8C480004 */ lw $t0, 0x0004($v0) ## 00000004 -/* 01144 80A706F4 44895000 */ mtc1 $t1, $f10 ## $f10 = 0.00 -/* 01148 80A706F8 AC880264 */ sw $t0, 0x0264($a0) ## 00000264 -/* 0114C 80A706FC 8C590008 */ lw $t9, 0x0008($v0) ## 00000008 -/* 01150 80A70700 46805420 */ cvt.s.w $f16, $f10 -/* 01154 80A70704 AC990268 */ sw $t9, 0x0268($a0) ## 00000268 -/* 01158 80A70708 8C48000C */ lw $t0, 0x000C($v0) ## 0000000C -/* 0115C 80A7070C AC88026C */ sw $t0, 0x026C($a0) ## 0000026C -/* 01160 80A70710 C4460018 */ lwc1 $f6, 0x0018($v0) ## 00000018 -/* 01164 80A70714 E486025C */ swc1 $f6, 0x025C($a0) ## 0000025C -/* 01168 80A70718 C488025C */ lwc1 $f8, 0x025C($a0) ## 0000025C -/* 0116C 80A7071C 46104480 */ add.s $f18, $f8, $f16 -/* 01170 80A70720 E492025C */ swc1 $f18, 0x025C($a0) ## 0000025C -/* 01174 80A70724 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01178 80A70728 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 0117C 80A7072C 03E00008 */ jr $ra -/* 01180 80A70730 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s deleted file mode 100644 index 3739f19aaf..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s +++ /dev/null @@ -1,66 +0,0 @@ -glabel func_80A70734 -/* 01184 80A70734 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 01188 80A70738 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0118C 80A7073C AFA50024 */ sw $a1, 0x0024($sp) -/* 01190 80A70740 C4840024 */ lwc1 $f4, 0x0024($a0) ## 00000024 -/* 01194 80A70744 2403000A */ addiu $v1, $zero, 0x000A ## $v1 = 0000000A -/* 01198 80A70748 3C0280A7 */ lui $v0, %hi(D_80A723D4) ## $v0 = 80A70000 -/* 0119C 80A7074C 4600218D */ trunc.w.s $f6, $f4 -/* 011A0 80A70750 244223D4 */ addiu $v0, $v0, %lo(D_80A723D4) ## $v0 = 80A723D4 -/* 011A4 80A70754 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 011A8 80A70758 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 011AC 80A7075C 440F3000 */ mfc1 $t7, $f6 -/* 011B0 80A70760 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 011B4 80A70764 24E6019C */ addiu $a2, $a3, 0x019C ## $a2 = 0000019C -/* 011B8 80A70768 A7AF0018 */ sh $t7, 0x0018($sp) -/* 011BC 80A7076C C4880028 */ lwc1 $f8, 0x0028($a0) ## 00000028 -/* 011C0 80A70770 87AA0018 */ lh $t2, 0x0018($sp) -/* 011C4 80A70774 4600428D */ trunc.w.s $f10, $f8 -/* 011C8 80A70778 44195000 */ mfc1 $t9, $f10 -/* 011CC 80A7077C 00000000 */ nop -/* 011D0 80A70780 A7B9001A */ sh $t9, 0x001A($sp) -/* 011D4 80A70784 C490002C */ lwc1 $f16, 0x002C($a0) ## 0000002C -/* 011D8 80A70788 87B9001A */ lh $t9, 0x001A($sp) -/* 011DC 80A7078C 4600848D */ trunc.w.s $f18, $f16 -/* 011E0 80A70790 44099000 */ mfc1 $t1, $f18 -/* 011E4 80A70794 00000000 */ nop -/* 011E8 80A70798 A7A9001C */ sh $t1, 0x001C($sp) -/* 011EC 80A7079C 848B001C */ lh $t3, 0x001C($a0) ## 0000001C -/* 011F0 80A707A0 316C007F */ andi $t4, $t3, 0x007F ## $t4 = 00000000 -/* 011F4 80A707A4 01830019 */ multu $t4, $v1 -/* 011F8 80A707A8 00006812 */ mflo $t5 -/* 011FC 80A707AC 004D7021 */ addu $t6, $v0, $t5 -/* 01200 80A707B0 85CF0000 */ lh $t7, 0x0000($t6) ## 00000000 -/* 01204 80A707B4 014FC021 */ addu $t8, $t2, $t7 -/* 01208 80A707B8 A7B80018 */ sh $t8, 0x0018($sp) -/* 0120C 80A707BC 8488001C */ lh $t0, 0x001C($a0) ## 0000001C -/* 01210 80A707C0 87AA001C */ lh $t2, 0x001C($sp) -/* 01214 80A707C4 3109007F */ andi $t1, $t0, 0x007F ## $t1 = 00000000 -/* 01218 80A707C8 01230019 */ multu $t1, $v1 -/* 0121C 80A707CC 00005812 */ mflo $t3 -/* 01220 80A707D0 004B6021 */ addu $t4, $v0, $t3 -/* 01224 80A707D4 858D0002 */ lh $t5, 0x0002($t4) ## 00000002 -/* 01228 80A707D8 032D7021 */ addu $t6, $t9, $t5 -/* 0122C 80A707DC A7AE001A */ sh $t6, 0x001A($sp) -/* 01230 80A707E0 848F001C */ lh $t7, 0x001C($a0) ## 0000001C -/* 01234 80A707E4 27B90018 */ addiu $t9, $sp, 0x0018 ## $t9 = FFFFFFF8 -/* 01238 80A707E8 31F8007F */ andi $t8, $t7, 0x007F ## $t8 = 00000000 -/* 0123C 80A707EC 03030019 */ multu $t8, $v1 -/* 01240 80A707F0 00004012 */ mflo $t0 -/* 01244 80A707F4 00484821 */ addu $t1, $v0, $t0 -/* 01248 80A707F8 852B0004 */ lh $t3, 0x0004($t1) ## 00000004 -/* 0124C 80A707FC 014B6021 */ addu $t4, $t2, $t3 -/* 01250 80A70800 A7AC001C */ sh $t4, 0x001C($sp) -/* 01254 80A70804 8F2E0000 */ lw $t6, 0x0000($t9) ## FFFFFFF8 -/* 01258 80A70808 A88E01E2 */ swl $t6, 0x01E2($a0) ## 000001E2 -/* 0125C 80A7080C B88E01E5 */ swr $t6, 0x01E5($a0) ## 000001E5 -/* 01260 80A70810 972E0004 */ lhu $t6, 0x0004($t9) ## FFFFFFFC -/* 01264 80A70814 A48E01E6 */ sh $t6, 0x01E6($a0) ## 000001E6 -/* 01268 80A70818 8FA40024 */ lw $a0, 0x0024($sp) -/* 0126C 80A7081C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 01270 80A70820 00812821 */ addu $a1, $a0, $at -/* 01274 80A70824 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01278 80A70828 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 0127C 80A7082C 03E00008 */ jr $ra -/* 01280 80A70830 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70834.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70834.s deleted file mode 100644 index 0bf332f8df..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70834.s +++ /dev/null @@ -1,91 +0,0 @@ -glabel func_80A70834 -/* 01284 80A70834 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 01288 80A70838 AFBF0014 */ sw $ra, 0x0014($sp) -/* 0128C 80A7083C AFA50024 */ sw $a1, 0x0024($sp) -/* 01290 80A70840 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 -/* 01294 80A70844 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 -/* 01298 80A70848 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 0129C 80A7084C AFAF001C */ sw $t7, 0x001C($sp) -/* 012A0 80A70850 8498001C */ lh $t8, 0x001C($a0) ## 0000001C -/* 012A4 80A70854 2404001C */ addiu $a0, $zero, 0x001C ## $a0 = 0000001C -/* 012A8 80A70858 3319007F */ andi $t9, $t8, 0x007F ## $t9 = 00000000 -/* 012AC 80A7085C 57210043 */ bnel $t9, $at, .L80A7096C -/* 012B0 80A70860 8FBF0014 */ lw $ra, 0x0014($sp) -/* 012B4 80A70864 0C021ACB */ jal Inventory_HasSpecificBottle -/* 012B8 80A70868 AFA60020 */ sw $a2, 0x0020($sp) -/* 012BC 80A7086C 14400020 */ bne $v0, $zero, .L80A708F0 -/* 012C0 80A70870 8FA60020 */ lw $a2, 0x0020($sp) -/* 012C4 80A70874 2404001D */ addiu $a0, $zero, 0x001D ## $a0 = 0000001D -/* 012C8 80A70878 0C021ACB */ jal Inventory_HasSpecificBottle -/* 012CC 80A7087C AFA60020 */ sw $a2, 0x0020($sp) -/* 012D0 80A70880 1440001B */ bne $v0, $zero, .L80A708F0 -/* 012D4 80A70884 8FA60020 */ lw $a2, 0x0020($sp) -/* 012D8 80A70888 24040019 */ addiu $a0, $zero, 0x0019 ## $a0 = 00000019 -/* 012DC 80A7088C 0C021ACB */ jal Inventory_HasSpecificBottle -/* 012E0 80A70890 AFA60020 */ sw $a2, 0x0020($sp) -/* 012E4 80A70894 14400016 */ bne $v0, $zero, .L80A708F0 -/* 012E8 80A70898 8FA60020 */ lw $a2, 0x0020($sp) -/* 012EC 80A7089C 8FA40024 */ lw $a0, 0x0024($sp) -/* 012F0 80A708A0 0C00BCDA */ jal func_8002F368 -/* 012F4 80A708A4 AFA60020 */ sw $a2, 0x0020($sp) -/* 012F8 80A708A8 2401001B */ addiu $at, $zero, 0x001B ## $at = 0000001B -/* 012FC 80A708AC 10410006 */ beq $v0, $at, .L80A708C8 -/* 01300 80A708B0 8FA60020 */ lw $a2, 0x0020($sp) -/* 01304 80A708B4 2401001C */ addiu $at, $zero, 0x001C ## $at = 0000001C -/* 01308 80A708B8 10410003 */ beq $v0, $at, .L80A708C8 -/* 0130C 80A708BC 2401001D */ addiu $at, $zero, 0x001D ## $at = 0000001D -/* 01310 80A708C0 14410004 */ bne $v0, $at, .L80A708D4 -/* 01314 80A708C4 8FA40024 */ lw $a0, 0x0024($sp) -.L80A708C8: -/* 01318 80A708C8 240870EF */ addiu $t0, $zero, 0x70EF ## $t0 = 000070EF -/* 0131C 80A708CC 10000023 */ beq $zero, $zero, .L80A7095C -/* 01320 80A708D0 A4C8010E */ sh $t0, 0x010E($a2) ## 0000010E -.L80A708D4: -/* 01324 80A708D4 0C023C20 */ jal Player_GetMask -/* 01328 80A708D8 AFA60020 */ sw $a2, 0x0020($sp) -/* 0132C 80A708DC 1440001F */ bne $v0, $zero, .L80A7095C -/* 01330 80A708E0 8FA60020 */ lw $a2, 0x0020($sp) -/* 01334 80A708E4 240970ED */ addiu $t1, $zero, 0x70ED ## $t1 = 000070ED -/* 01338 80A708E8 1000001C */ beq $zero, $zero, .L80A7095C -/* 0133C 80A708EC A4C9010E */ sh $t1, 0x010E($a2) ## 0000010E -.L80A708F0: -/* 01340 80A708F0 8FA40024 */ lw $a0, 0x0024($sp) -/* 01344 80A708F4 0C00BCDA */ jal func_8002F368 -/* 01348 80A708F8 AFA60020 */ sw $a2, 0x0020($sp) -/* 0134C 80A708FC 24010018 */ addiu $at, $zero, 0x0018 ## $at = 00000018 -/* 01350 80A70900 1041000B */ beq $v0, $at, .L80A70930 -/* 01354 80A70904 8FA60020 */ lw $a2, 0x0020($sp) -/* 01358 80A70908 24010019 */ addiu $at, $zero, 0x0019 ## $at = 00000019 -/* 0135C 80A7090C 10410006 */ beq $v0, $at, .L80A70928 -/* 01360 80A70910 240A70F0 */ addiu $t2, $zero, 0x70F0 ## $t2 = 000070F0 -/* 01364 80A70914 2401001A */ addiu $at, $zero, 0x001A ## $at = 0000001A -/* 01368 80A70918 10410008 */ beq $v0, $at, .L80A7093C -/* 0136C 80A7091C 240C70F2 */ addiu $t4, $zero, 0x70F2 ## $t4 = 000070F2 -/* 01370 80A70920 10000008 */ beq $zero, $zero, .L80A70944 -/* 01374 80A70924 8FA40024 */ lw $a0, 0x0024($sp) -.L80A70928: -/* 01378 80A70928 1000000C */ beq $zero, $zero, .L80A7095C -/* 0137C 80A7092C A4CA010E */ sh $t2, 0x010E($a2) ## 0000010E -.L80A70930: -/* 01380 80A70930 240B70F1 */ addiu $t3, $zero, 0x70F1 ## $t3 = 000070F1 -/* 01384 80A70934 10000009 */ beq $zero, $zero, .L80A7095C -/* 01388 80A70938 A4CB010E */ sh $t3, 0x010E($a2) ## 0000010E -.L80A7093C: -/* 0138C 80A7093C 10000007 */ beq $zero, $zero, .L80A7095C -/* 01390 80A70940 A4CC010E */ sh $t4, 0x010E($a2) ## 0000010E -.L80A70944: -/* 01394 80A70944 0C023C20 */ jal Player_GetMask -/* 01398 80A70948 AFA60020 */ sw $a2, 0x0020($sp) -/* 0139C 80A7094C 14400003 */ bne $v0, $zero, .L80A7095C -/* 013A0 80A70950 8FA60020 */ lw $a2, 0x0020($sp) -/* 013A4 80A70954 240D700C */ addiu $t5, $zero, 0x700C ## $t5 = 0000700C -/* 013A8 80A70958 A4CD010E */ sh $t5, 0x010E($a2) ## 0000010E -.L80A7095C: -/* 013AC 80A7095C 94CE010E */ lhu $t6, 0x010E($a2) ## 0000010E -/* 013B0 80A70960 8FAF001C */ lw $t7, 0x001C($sp) -/* 013B4 80A70964 A5EE010E */ sh $t6, 0x010E($t7) ## 0000010E -/* 013B8 80A70968 8FBF0014 */ lw $ra, 0x0014($sp) -.L80A7096C: -/* 013BC 80A7096C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 013C0 80A70970 03E00008 */ jr $ra -/* 013C4 80A70974 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70978.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70978.s deleted file mode 100644 index 11c7b6be05..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70978.s +++ /dev/null @@ -1,127 +0,0 @@ -.late_rodata -glabel jtbl_80A72980 -.word L80A709E4 -.word L80A70A00 -.word L80A709DC -.word L80A709B8 -.word L80A70A00 -.word L80A70A00 -.word L80A70A00 -.word L80A709B8 -.word L80A70A00 -.word L80A709B8 -.word L80A709B8 -.word L80A70A00 -.word L80A709D4 -.word L80A70A00 -.word L80A70A00 -.word L80A70A00 -.word L80A70A00 -.word L80A709DC -.word L80A709E4 - -.text -glabel func_80A70978 -/* 013C8 80A70978 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 013CC 80A7097C AFBF0024 */ sw $ra, 0x0024($sp) -/* 013D0 80A70980 AFB00020 */ sw $s0, 0x0020($sp) -/* 013D4 80A70984 AFA5003C */ sw $a1, 0x003C($sp) -/* 013D8 80A70988 848F001C */ lh $t7, 0x001C($a0) ## 0000001C -/* 013DC 80A7098C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 013E0 80A70990 8CA21C44 */ lw $v0, 0x1C44($a1) ## 00001C44 -/* 013E4 80A70994 31F8007F */ andi $t8, $t7, 0x007F ## $t8 = 00000000 -/* 013E8 80A70998 2F010013 */ sltiu $at, $t8, 0x0013 -/* 013EC 80A7099C 10200018 */ beq $at, $zero, .L80A70A00 -/* 013F0 80A709A0 0018C080 */ sll $t8, $t8, 2 -/* 013F4 80A709A4 3C0180A7 */ lui $at, %hi(jtbl_80A72980) ## $at = 80A70000 -/* 013F8 80A709A8 00380821 */ addu $at, $at, $t8 -/* 013FC 80A709AC 8C382980 */ lw $t8, %lo(jtbl_80A72980)($at) -/* 01400 80A709B0 03000008 */ jr $t8 -/* 01404 80A709B4 00000000 */ nop -glabel L80A709B8 -/* 01408 80A709B8 861901E8 */ lh $t9, 0x01E8($s0) ## 000001E8 -/* 0140C 80A709BC 17200003 */ bne $t9, $zero, .L80A709CC -/* 01410 80A709C0 00000000 */ nop -/* 01414 80A709C4 1000000F */ beq $zero, $zero, .L80A70A04 -/* 01418 80A709C8 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -.L80A709CC: -/* 0141C 80A709CC 1000000D */ beq $zero, $zero, .L80A70A04 -/* 01420 80A709D0 24070002 */ addiu $a3, $zero, 0x0002 ## $a3 = 00000002 -glabel L80A709D4 -/* 01424 80A709D4 1000000B */ beq $zero, $zero, .L80A70A04 -/* 01428 80A709D8 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -glabel L80A709DC -/* 0142C 80A709DC 10000009 */ beq $zero, $zero, .L80A70A04 -/* 01430 80A709E0 24070004 */ addiu $a3, $zero, 0x0004 ## $a3 = 00000004 -glabel L80A709E4 -/* 01434 80A709E4 860801E8 */ lh $t0, 0x01E8($s0) ## 000001E8 -/* 01438 80A709E8 15000003 */ bne $t0, $zero, .L80A709F8 -/* 0143C 80A709EC 00000000 */ nop -/* 01440 80A709F0 10000004 */ beq $zero, $zero, .L80A70A04 -/* 01444 80A709F4 24070002 */ addiu $a3, $zero, 0x0002 ## $a3 = 00000002 -.L80A709F8: -/* 01448 80A709F8 10000002 */ beq $zero, $zero, .L80A70A04 -/* 0144C 80A709FC 24070004 */ addiu $a3, $zero, 0x0004 ## $a3 = 00000004 -glabel L80A70A00 -.L80A70A00: -/* 01450 80A70A00 24070002 */ addiu $a3, $zero, 0x0002 ## $a3 = 00000002 -.L80A70A04: -/* 01454 80A70A04 8C4A0024 */ lw $t2, 0x0024($v0) ## 00000024 -/* 01458 80A70A08 3C0B8016 */ lui $t3, %hi(gSaveContext+4) -/* 0145C 80A70A0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01460 80A70A10 AE0A0200 */ sw $t2, 0x0200($s0) ## 00000200 -/* 01464 80A70A14 8C490028 */ lw $t1, 0x0028($v0) ## 00000028 -/* 01468 80A70A18 260501E8 */ addiu $a1, $s0, 0x01E8 ## $a1 = 000001E8 -/* 0146C 80A70A1C AE090204 */ sw $t1, 0x0204($s0) ## 00000204 -/* 01470 80A70A20 8C4A002C */ lw $t2, 0x002C($v0) ## 0000002C -/* 01474 80A70A24 AE0A0208 */ sw $t2, 0x0208($s0) ## 00000208 -/* 01478 80A70A28 8D6BE664 */ lw $t3, %lo(gSaveContext+4)($t3) -/* 0147C 80A70A2C 5560000D */ bnel $t3, $zero, .L80A70A64 -/* 01480 80A70A30 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -/* 01484 80A70A34 860C001C */ lh $t4, 0x001C($s0) ## 0000001C -/* 01488 80A70A38 3C0F80A7 */ lui $t7, %hi(D_80A724A8) ## $t7 = 80A70000 -/* 0148C 80A70A3C 25EF24A8 */ addiu $t7, $t7, %lo(D_80A724A8) ## $t7 = 80A724A8 -/* 01490 80A70A40 318D007F */ andi $t5, $t4, 0x007F ## $t5 = 00000000 -/* 01494 80A70A44 000D7080 */ sll $t6, $t5, 2 -/* 01498 80A70A48 01CD7023 */ subu $t6, $t6, $t5 -/* 0149C 80A70A4C 000E7080 */ sll $t6, $t6, 2 -/* 014A0 80A70A50 01CF1021 */ addu $v0, $t6, $t7 -/* 014A4 80A70A54 C4440008 */ lwc1 $f4, 0x0008($v0) ## 00000008 -/* 014A8 80A70A58 1000000B */ beq $zero, $zero, .L80A70A88 -/* 014AC 80A70A5C E60401FC */ swc1 $f4, 0x01FC($s0) ## 000001FC -/* 014B0 80A70A60 8618001C */ lh $t8, 0x001C($s0) ## 0000001C -.L80A70A64: -/* 014B4 80A70A64 3C0980A7 */ lui $t1, %hi(D_80A724A8) ## $t1 = 80A70000 -/* 014B8 80A70A68 252924A8 */ addiu $t1, $t1, %lo(D_80A724A8) ## $t1 = 80A724A8 -/* 014BC 80A70A6C 3319007F */ andi $t9, $t8, 0x007F ## $t9 = 00000000 -/* 014C0 80A70A70 00194080 */ sll $t0, $t9, 2 -/* 014C4 80A70A74 01194023 */ subu $t0, $t0, $t9 -/* 014C8 80A70A78 00084080 */ sll $t0, $t0, 2 -/* 014CC 80A70A7C 01091021 */ addu $v0, $t0, $t1 -/* 014D0 80A70A80 C4460004 */ lwc1 $f6, 0x0004($v0) ## 00000004 -/* 014D4 80A70A84 E60601FC */ swc1 $f6, 0x01FC($s0) ## 000001FC -.L80A70A88: -/* 014D8 80A70A88 90460000 */ lbu $a2, 0x0000($v0) ## 00000000 -/* 014DC 80A70A8C 0C00D285 */ jal func_80034A14 -/* 014E0 80A70A90 AFA50028 */ sw $a1, 0x0028($sp) -/* 014E4 80A70A94 3C0A80A7 */ lui $t2, %hi(func_80A6F810) ## $t2 = 80A70000 -/* 014E8 80A70A98 3C0B80A7 */ lui $t3, %hi(func_80A70058) ## $t3 = 80A70000 -/* 014EC 80A70A9C 256B0058 */ addiu $t3, $t3, %lo(func_80A70058) ## $t3 = 80A70058 -/* 014F0 80A70AA0 254AF810 */ addiu $t2, $t2, %lo(func_80A6F810) ## $t2 = 80A6F810 -/* 014F4 80A70AA4 8E07025C */ lw $a3, 0x025C($s0) ## 0000025C -/* 014F8 80A70AA8 AFAB0014 */ sw $t3, 0x0014($sp) -/* 014FC 80A70AAC AFAA0010 */ sw $t2, 0x0010($sp) -/* 01500 80A70AB0 8FA4003C */ lw $a0, 0x003C($sp) -/* 01504 80A70AB4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01508 80A70AB8 0C00D0F3 */ jal func_800343CC -/* 0150C 80A70ABC 8FA60028 */ lw $a2, 0x0028($sp) -/* 01510 80A70AC0 10400003 */ beq $v0, $zero, .L80A70AD0 -/* 01514 80A70AC4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01518 80A70AC8 0C29C20D */ jal func_80A70834 -/* 0151C 80A70ACC 8FA5003C */ lw $a1, 0x003C($sp) -.L80A70AD0: -/* 01520 80A70AD0 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01524 80A70AD4 8FB00020 */ lw $s0, 0x0020($sp) -/* 01528 80A70AD8 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 0152C 80A70ADC 03E00008 */ jr $ra -/* 01530 80A70AE0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70AE4.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70AE4.s deleted file mode 100644 index 306ea1981a..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70AE4.s +++ /dev/null @@ -1,87 +0,0 @@ -.late_rodata -.late_rodata_alignment 4 -glabel D_80A729CC - .word func_80A70CD8 -.word func_80A70CD8 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word func_80A70C44 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word L80A70D40 -.word func_80A70C08 -.word L80A70D40 -.word func_80A70BAC - -.text -glabel func_80A70AE4 -/* 01534 80A70AE4 84A300A4 */ lh $v1, 0x00A4($a1) ## 000000A4 -/* 01538 80A70AE8 28610038 */ slti $at, $v1, 0x0038 -/* 0153C 80A70AEC 14200006 */ bne $at, $zero, .L80A70B08 -/* 01540 80A70AF0 246EFFE2 */ addiu $t6, $v1, 0xFFE2 ## $t6 = FFFFFFE2 -/* 01544 80A70AF4 24010052 */ addiu $at, $zero, 0x0052 ## $at = 00000052 -/* 01548 80A70AF8 5061000C */ beql $v1, $at, .L80A70B2C -/* 0154C 80A70AFC 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 01550 80A70B00 10000090 */ beq $zero, $zero, .L80A70D44 -/* 01554 80A70B04 8483001C */ lh $v1, 0x001C($a0) ## 0000001C -.L80A70B08: -/* 01558 80A70B08 2DC1001A */ sltiu $at, $t6, 0x001A -/* 0155C 80A70B0C 1020008C */ beq $at, $zero, .L80A70D40 -/* 01560 80A70B10 000E7080 */ sll $t6, $t6, 2 -/* 01564 80A70B14 3C0180A7 */ lui $at, %hi(D_80A729CC) ## $at = 80A70000 -/* 01568 80A70B18 002E0821 */ addu $at, $at, $t6 -/* 0156C 80A70B1C 8C2E29CC */ lw $t6, %lo(D_80A729CC)($at) -/* 01570 80A70B20 01C00008 */ jr $t6 -/* 01574 80A70B24 00000000 */ nop -/* 01578 80A70B28 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -.L80A70B2C: -/* 0157C 80A70B2C 24010009 */ addiu $at, $zero, 0x0009 ## $at = 00000009 -/* 01580 80A70B30 2405000A */ addiu $a1, $zero, 0x000A ## $a1 = 0000000A -/* 01584 80A70B34 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -/* 01588 80A70B38 1041000B */ beq $v0, $at, .L80A70B68 -/* 0158C 80A70B3C 3C038016 */ lui $v1, %hi(gSaveContext) -/* 01590 80A70B40 10A20009 */ beq $a1, $v0, .L80A70B68 -/* 01594 80A70B44 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 01598 80A70B48 10410007 */ beq $v0, $at, .L80A70B68 -/* 0159C 80A70B4C 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 015A0 80A70B50 10410005 */ beq $v0, $at, .L80A70B68 -/* 015A4 80A70B54 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 -/* 015A8 80A70B58 10410003 */ beq $v0, $at, .L80A70B68 -/* 015AC 80A70B5C 00000000 */ nop -/* 015B0 80A70B60 03E00008 */ jr $ra -/* 015B4 80A70B64 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70B68: -/* 015B8 80A70B68 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 015BC 80A70B6C 8C6F0004 */ lw $t7, 0x0004($v1) ## 8015E664 -/* 015C0 80A70B70 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 015C4 80A70B74 11E00003 */ beq $t7, $zero, .L80A70B84 -/* 015C8 80A70B78 00000000 */ nop -/* 015CC 80A70B7C 03E00008 */ jr $ra -/* 015D0 80A70B80 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70B84: -/* 015D4 80A70B84 10410007 */ beq $v0, $at, .L80A70BA4 -/* 015D8 80A70B88 00000000 */ nop -/* 015DC 80A70B8C 8C780010 */ lw $t8, 0x0010($v1) ## 8015E670 -/* 015E0 80A70B90 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 015E4 80A70B94 17010003 */ bne $t8, $at, .L80A70BA4 -/* 015E8 80A70B98 00000000 */ nop -/* 015EC 80A70B9C 03E00008 */ jr $ra -/* 015F0 80A70BA0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70BA4: -/* 015F4 80A70BA4 03E00008 */ jr $ra -/* 015F8 80A70BA8 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70BAC.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70BAC.s deleted file mode 100644 index c57e080b1f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70BAC.s +++ /dev/null @@ -1,27 +0,0 @@ -glabel func_80A70BAC -/* 015FC 80A70BAC 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 01600 80A70BB0 2405000A */ addiu $a1, $zero, 0x000A ## $a1 = 0000000A -/* 01604 80A70BB4 3C038016 */ lui $v1, %hi(gSaveContext) -/* 01608 80A70BB8 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -/* 0160C 80A70BBC 10A20003 */ beq $a1, $v0, .L80A70BCC -/* 01610 80A70BC0 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 01614 80A70BC4 03E00008 */ jr $ra -/* 01618 80A70BC8 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70BCC: -/* 0161C 80A70BCC 8C790004 */ lw $t9, 0x0004($v1) ## 8015E664 -/* 01620 80A70BD0 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 01624 80A70BD4 17210003 */ bne $t9, $at, .L80A70BE4 -/* 01628 80A70BD8 00000000 */ nop -/* 0162C 80A70BDC 03E00008 */ jr $ra -/* 01630 80A70BE0 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70BE4: -/* 01634 80A70BE4 14A20006 */ bne $a1, $v0, .L80A70C00 -/* 01638 80A70BE8 00000000 */ nop -/* 0163C 80A70BEC 8C680010 */ lw $t0, 0x0010($v1) ## 8015E670 -/* 01640 80A70BF0 15000003 */ bne $t0, $zero, .L80A70C00 -/* 01644 80A70BF4 00000000 */ nop -/* 01648 80A70BF8 03E00008 */ jr $ra -/* 0164C 80A70BFC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70C00: -/* 01650 80A70C00 03E00008 */ jr $ra -/* 01654 80A70C04 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C08.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C08.s deleted file mode 100644 index a848577b0f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C08.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel func_80A70C08 -/* 01658 80A70C08 8489001C */ lh $t1, 0x001C($a0) ## 0000001C -/* 0165C 80A70C0C 3C038016 */ lui $v1, %hi(gSaveContext) -/* 01660 80A70C10 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 01664 80A70C14 312A007F */ andi $t2, $t1, 0x007F ## $t2 = 00000000 -/* 01668 80A70C18 51400004 */ beql $t2, $zero, .L80A70C2C -/* 0166C 80A70C1C 8C6B0010 */ lw $t3, 0x0010($v1) ## 8015E670 -/* 01670 80A70C20 03E00008 */ jr $ra -/* 01674 80A70C24 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70C28: -/* 01678 80A70C28 8C6B0010 */ lw $t3, 0x0010($v1) ## 8015E670 -.L80A70C2C: -/* 0167C 80A70C2C 15600003 */ bne $t3, $zero, .L80A70C3C -/* 01680 80A70C30 00000000 */ nop -/* 01684 80A70C34 03E00008 */ jr $ra -/* 01688 80A70C38 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70C3C: -/* 0168C 80A70C3C 03E00008 */ jr $ra -/* 01690 80A70C40 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C44.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C44.s deleted file mode 100644 index b65d92358d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C44.s +++ /dev/null @@ -1,44 +0,0 @@ -glabel func_80A70C44 -/* 01694 80A70C44 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 01698 80A70C48 3C038016 */ lui $v1, %hi(gSaveContext) -/* 0169C 80A70C4C 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 016A0 80A70C50 3042007F */ andi $v0, $v0, 0x007F ## $v0 = 00000000 -/* 016A4 80A70C54 14400009 */ bne $v0, $zero, .L80A70C7C -/* 016A8 80A70C58 24010009 */ addiu $at, $zero, 0x0009 ## $at = 00000009 -/* 016AC 80A70C5C 8C6C0004 */ lw $t4, 0x0004($v1) ## 8015E664 -/* 016B0 80A70C60 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 016B4 80A70C64 11800003 */ beq $t4, $zero, .L80A70C74 -/* 016B8 80A70C68 00000000 */ nop -/* 016BC 80A70C6C 03E00008 */ jr $ra -/* 016C0 80A70C70 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70C74: -/* 016C4 80A70C74 03E00008 */ jr $ra -/* 016C8 80A70C78 00601025 */ or $v0, $v1, $zero ## $v0 = 00000001 -.L80A70C7C: -/* 016CC 80A70C7C 10410008 */ beq $v0, $at, .L80A70CA0 -/* 016D0 80A70C80 3C038016 */ lui $v1, %hi(gSaveContext) -/* 016D4 80A70C84 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 016D8 80A70C88 10410005 */ beq $v0, $at, .L80A70CA0 -/* 016DC 80A70C8C 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 -/* 016E0 80A70C90 10410003 */ beq $v0, $at, .L80A70CA0 -/* 016E4 80A70C94 00000000 */ nop -/* 016E8 80A70C98 03E00008 */ jr $ra -/* 016EC 80A70C9C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70CA0: -/* 016F0 80A70CA0 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 016F4 80A70CA4 8C6D0010 */ lw $t5, 0x0010($v1) ## 8015E670 -/* 016F8 80A70CA8 55A00004 */ bnel $t5, $zero, .L80A70CBC -/* 016FC 80A70CAC 8C6E0004 */ lw $t6, 0x0004($v1) ## 8015E664 -/* 01700 80A70CB0 03E00008 */ jr $ra -/* 01704 80A70CB4 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70CB8: -/* 01708 80A70CB8 8C6E0004 */ lw $t6, 0x0004($v1) ## 8015E664 -.L80A70CBC: -/* 0170C 80A70CBC 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 01710 80A70CC0 15C10003 */ bne $t6, $at, .L80A70CD0 -/* 01714 80A70CC4 00000000 */ nop -/* 01718 80A70CC8 03E00008 */ jr $ra -/* 0171C 80A70CCC 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70CD0: -/* 01720 80A70CD0 03E00008 */ jr $ra -/* 01724 80A70CD4 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70CD8.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70CD8.s deleted file mode 100644 index 36450621de..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70CD8.s +++ /dev/null @@ -1,53 +0,0 @@ -glabel func_80A70CD8 -/* 01728 80A70CD8 848F001C */ lh $t7, 0x001C($a0) ## 0000001C -/* 0172C 80A70CDC 2401000E */ addiu $at, $zero, 0x000E ## $at = 0000000E -/* 01730 80A70CE0 3C038016 */ lui $v1, %hi(gSaveContext) -/* 01734 80A70CE4 31F8007F */ andi $t8, $t7, 0x007F ## $t8 = 00000000 -/* 01738 80A70CE8 13010003 */ beq $t8, $at, .L80A70CF8 -/* 0173C 80A70CEC 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 01740 80A70CF0 03E00008 */ jr $ra -/* 01744 80A70CF4 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70CF8: -/* 01748 80A70CF8 8C790010 */ lw $t9, 0x0010($v1) ## 8015E670 -/* 0174C 80A70CFC 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 01750 80A70D00 57210004 */ bnel $t9, $at, .L80A70D14 -/* 01754 80A70D04 94680EE4 */ lhu $t0, 0x0EE4($v1) ## 8015F544 -/* 01758 80A70D08 03E00008 */ jr $ra -/* 0175C 80A70D0C 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70D10: -/* 01760 80A70D10 94680EE4 */ lhu $t0, 0x0EE4($v1) ## 8015F544 -.L80A70D14: -/* 01764 80A70D14 31090001 */ andi $t1, $t0, 0x0001 ## $t1 = 00000000 -/* 01768 80A70D18 11200007 */ beq $t1, $zero, .L80A70D38 -/* 0176C 80A70D1C 00000000 */ nop -/* 01770 80A70D20 946A0EDC */ lhu $t2, 0x0EDC($v1) ## 8015F53C -/* 01774 80A70D24 314B0020 */ andi $t3, $t2, 0x0020 ## $t3 = 00000000 -/* 01778 80A70D28 15600003 */ bne $t3, $zero, .L80A70D38 -/* 0177C 80A70D2C 00000000 */ nop -/* 01780 80A70D30 03E00008 */ jr $ra -/* 01784 80A70D34 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70D38: -/* 01788 80A70D38 03E00008 */ jr $ra -/* 0178C 80A70D3C 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -glabel L80A70D40 -.L80A70D40: -/* 01790 80A70D40 8483001C */ lh $v1, 0x001C($a0) ## 0000001C -.L80A70D44: -/* 01794 80A70D44 24010013 */ addiu $at, $zero, 0x0013 ## $at = 00000013 -/* 01798 80A70D48 3063007F */ andi $v1, $v1, 0x007F ## $v1 = 00000060 -/* 0179C 80A70D4C 10610002 */ beq $v1, $at, .L80A70D58 -/* 017A0 80A70D50 24010014 */ addiu $at, $zero, 0x0014 ## $at = 00000014 -/* 017A4 80A70D54 14610007 */ bne $v1, $at, .L80A70D74 -.L80A70D58: -/* 017A8 80A70D58 3C038016 */ lui $v1, %hi(gSaveContext) -/* 017AC 80A70D5C 2463E660 */ addiu $v1, %lo(gSaveContext) -/* 017B0 80A70D60 8C6C0004 */ lw $t4, 0x0004($v1) ## 8015E664 -/* 017B4 80A70D64 55800004 */ bnel $t4, $zero, .L80A70D78 -/* 017B8 80A70D68 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 017BC 80A70D6C 03E00008 */ jr $ra -/* 017C0 80A70D70 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80A70D74: -/* 017C4 80A70D74 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -.L80A70D78: -/* 017C8 80A70D78 03E00008 */ jr $ra -/* 017CC 80A70D7C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s deleted file mode 100644 index dadfe13905..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s +++ /dev/null @@ -1,219 +0,0 @@ -.late_rodata -glabel jtbl_80A72A34 -.word L80A71098 -.word L80A710BC -.word L80A710BC -.word L80A7105C -.word L80A710BC -.word L80A710CC -.word L80A710BC -.word L80A71084 -.word L80A710BC -.word L80A710CC -.word L80A710CC -.word L80A710CC -.word L80A710CC -.word L80A710BC -.word L80A710BC -.word L80A710BC -.word L80A710BC -.word L80A710BC -.word L80A710BC -.word L80A710BC -.word L80A710BC - -.text -glabel func_80A70E34 -/* 01884 80A70E34 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 01888 80A70E38 AFBF002C */ sw $ra, 0x002C($sp) -/* 0188C 80A70E3C AFB00028 */ sw $s0, 0x0028($sp) -/* 01890 80A70E40 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01894 80A70E44 0C29BDE4 */ jal func_80A6F790 -/* 01898 80A70E48 AFA5003C */ sw $a1, 0x003C($sp) -/* 0189C 80A70E4C 104000A5 */ beq $v0, $zero, .L80A710E4 -/* 018A0 80A70E50 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 018A4 80A70E54 0C29BDB0 */ jal func_80A6F6C0 -/* 018A8 80A70E58 8FA5003C */ lw $a1, 0x003C($sp) -/* 018AC 80A70E5C 104000A1 */ beq $v0, $zero, .L80A710E4 -/* 018B0 80A70E60 8FA4003C */ lw $a0, 0x003C($sp) -/* 018B4 80A70E64 820E0198 */ lb $t6, 0x0198($s0) ## 00000198 -/* 018B8 80A70E68 3C080001 */ lui $t0, 0x0001 ## $t0 = 00010000 -/* 018BC 80A70E6C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 018C0 80A70E70 A20E001E */ sb $t6, 0x001E($s0) ## 0000001E -/* 018C4 80A70E74 820F001E */ lb $t7, 0x001E($s0) ## 0000001E -/* 018C8 80A70E78 3C0D80A7 */ lui $t5, %hi(D_80A722DE) ## $t5 = 80A70000 -/* 018CC 80A70E7C 3C0680A7 */ lui $a2, %hi(D_80A72014) ## $a2 = 80A70000 -/* 018D0 80A70E80 000FC100 */ sll $t8, $t7, 4 -/* 018D4 80A70E84 030FC021 */ addu $t8, $t8, $t7 -/* 018D8 80A70E88 0018C080 */ sll $t8, $t8, 2 -/* 018DC 80A70E8C 0098C821 */ addu $t9, $a0, $t8 -/* 018E0 80A70E90 01194021 */ addu $t0, $t0, $t9 -/* 018E4 80A70E94 8D0817B4 */ lw $t0, 0x17B4($t0) ## 000117B4 -/* 018E8 80A70E98 24190010 */ addiu $t9, $zero, 0x0010 ## $t9 = 00000010 -/* 018EC 80A70E9C 261802D0 */ addiu $t8, $s0, 0x02D0 ## $t8 = 000002D0 -/* 018F0 80A70EA0 01014821 */ addu $t1, $t0, $at -/* 018F4 80A70EA4 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 018F8 80A70EA8 AC296FC0 */ sw $t1, %lo(gSegments+0x18)($at) -/* 018FC 80A70EAC 860A001C */ lh $t2, 0x001C($s0) ## 0000001C -/* 01900 80A70EB0 260F0270 */ addiu $t7, $s0, 0x0270 ## $t7 = 00000270 -/* 01904 80A70EB4 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 01908 80A70EB8 314B007F */ andi $t3, $t2, 0x007F ## $t3 = 00000000 -/* 0190C 80A70EBC 000B6080 */ sll $t4, $t3, 2 -/* 01910 80A70EC0 018B6023 */ subu $t4, $t4, $t3 -/* 01914 80A70EC4 000C6080 */ sll $t4, $t4, 2 -/* 01918 80A70EC8 01AC6821 */ addu $t5, $t5, $t4 -/* 0191C 80A70ECC 91AD22DE */ lbu $t5, %lo(D_80A722DE)($t5) -/* 01920 80A70ED0 AFA50034 */ sw $a1, 0x0034($sp) -/* 01924 80A70ED4 AFAF0010 */ sw $t7, 0x0010($sp) -/* 01928 80A70ED8 000D70C0 */ sll $t6, $t5, 3 -/* 0192C 80A70EDC 00CE3021 */ addu $a2, $a2, $t6 -/* 01930 80A70EE0 8CC62014 */ lw $a2, %lo(D_80A72014)($a2) -/* 01934 80A70EE4 AFB90018 */ sw $t9, 0x0018($sp) -/* 01938 80A70EE8 AFB80014 */ sw $t8, 0x0014($sp) -/* 0193C 80A70EEC 0C0291BE */ jal SkelAnime_InitFlex -/* 01940 80A70EF0 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 01944 80A70EF4 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 01948 80A70EF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0194C 80A70EFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) -/* 01950 80A70F00 44050000 */ mfc1 $a1, $f0 -/* 01954 80A70F04 44070000 */ mfc1 $a3, $f0 -/* 01958 80A70F08 0C00AC78 */ jal ActorShape_Init - -/* 0195C 80A70F0C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 -/* 01960 80A70F10 82080199 */ lb $t0, 0x0199($s0) ## 00000199 -/* 01964 80A70F14 8FA4003C */ lw $a0, 0x003C($sp) -/* 01968 80A70F18 3C0B0001 */ lui $t3, 0x0001 ## $t3 = 00010000 -/* 0196C 80A70F1C 00084900 */ sll $t1, $t0, 4 -/* 01970 80A70F20 01284821 */ addu $t1, $t1, $t0 -/* 01974 80A70F24 00094880 */ sll $t1, $t1, 2 -/* 01978 80A70F28 00895021 */ addu $t2, $a0, $t1 -/* 0197C 80A70F2C 016A5821 */ addu $t3, $t3, $t2 -/* 01980 80A70F30 8D6B17B4 */ lw $t3, 0x17B4($t3) ## 000117B4 -/* 01984 80A70F34 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 01988 80A70F38 2605019C */ addiu $a1, $s0, 0x019C ## $a1 = 0000019C -/* 0198C 80A70F3C 01616021 */ addu $t4, $t3, $at -/* 01990 80A70F40 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 01994 80A70F44 AC2C6FC0 */ sw $t4, %lo(gSegments+0x18)($at) -/* 01998 80A70F48 0C0170D9 */ jal Collider_InitCylinder - -/* 0199C 80A70F4C AFA50030 */ sw $a1, 0x0030($sp) -/* 019A0 80A70F50 3C0780A7 */ lui $a3, %hi(D_80A71EC0) ## $a3 = 80A70000 -/* 019A4 80A70F54 8FA50030 */ lw $a1, 0x0030($sp) -/* 019A8 80A70F58 24E71EC0 */ addiu $a3, $a3, %lo(D_80A71EC0) ## $a3 = 80A71EC0 -/* 019AC 80A70F5C 8FA4003C */ lw $a0, 0x003C($sp) -/* 019B0 80A70F60 0C01712B */ jal Collider_SetCylinder - -/* 019B4 80A70F64 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 019B8 80A70F68 0C29C198 */ jal func_80A70660 -/* 019BC 80A70F6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 019C0 80A70F70 3C0680A7 */ lui $a2, %hi(D_80A71EEC) ## $a2 = 80A70000 -/* 019C4 80A70F74 24C61EEC */ addiu $a2, $a2, %lo(D_80A71EEC) ## $a2 = 80A71EEC -/* 019C8 80A70F78 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 019CC 80A70F7C 0C0187BF */ jal func_80061EFC -/* 019D0 80A70F80 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 019D4 80A70F84 860D001C */ lh $t5, 0x001C($s0) ## 0000001C -/* 019D8 80A70F88 3C0680A7 */ lui $a2, %hi(D_80A722E3) ## $a2 = 80A70000 -/* 019DC 80A70F8C 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 019E0 80A70F90 31AE007F */ andi $t6, $t5, 0x007F ## $t6 = 00000000 -/* 019E4 80A70F94 000E7880 */ sll $t7, $t6, 2 -/* 019E8 80A70F98 01EE7823 */ subu $t7, $t7, $t6 -/* 019EC 80A70F9C 000F7880 */ sll $t7, $t7, 2 -/* 019F0 80A70FA0 00CF3021 */ addu $a2, $a2, $t7 -/* 019F4 80A70FA4 90C622E3 */ lbu $a2, %lo(D_80A722E3)($a2) -/* 019F8 80A70FA8 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 019FC 80A70FAC 0C00D3B0 */ jal func_80034EC0 -/* 01A00 80A70FB0 8FA40034 */ lw $a0, 0x0034($sp) -/* 01A04 80A70FB4 8FB8003C */ lw $t8, 0x003C($sp) -/* 01A08 80A70FB8 2401001E */ addiu $at, $zero, 0x001E ## $at = 0000001E -/* 01A0C 80A70FBC 3C0A8016 */ lui $t2, %hi(gSaveContext+0xee0) -/* 01A10 80A70FC0 870200A4 */ lh $v0, 0x00A4($t8) ## 000000A4 -/* 01A14 80A70FC4 10410003 */ beq $v0, $at, .L80A70FD4 -/* 01A18 80A70FC8 24010020 */ addiu $at, $zero, 0x0020 ## $at = 00000020 -/* 01A1C 80A70FCC 5441000A */ bnel $v0, $at, .L80A70FF8 -/* 01A20 80A70FD0 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -.L80A70FD4: -/* 01A24 80A70FD4 8E190004 */ lw $t9, 0x0004($s0) ## 00000004 -/* 01A28 80A70FD8 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 01A2C 80A70FDC 2401FFEF */ addiu $at, $zero, 0xFFEF ## $at = FFFFFFEF -/* 01A30 80A70FE0 03214024 */ and $t0, $t9, $at -/* 01A34 80A70FE4 AE080004 */ sw $t0, 0x0004($s0) ## 00000004 -/* 01A38 80A70FE8 E60400F8 */ swc1 $f4, 0x00F8($s0) ## 000000F8 -/* 01A3C 80A70FEC 8FA9003C */ lw $t1, 0x003C($sp) -/* 01A40 80A70FF0 852200A4 */ lh $v0, 0x00A4($t1) ## 000000A4 -/* 01A44 80A70FF4 2401002A */ addiu $at, $zero, 0x002A ## $at = 0000002A -.L80A70FF8: -/* 01A48 80A70FF8 14410003 */ bne $v0, $at, .L80A71008 -/* 01A4C 80A70FFC 00000000 */ nop -/* 01A50 80A71000 954AF540 */ lhu $t2, %lo(gSaveContext+0xee0)($t2) -/* 01A54 80A71004 A60A0330 */ sh $t2, 0x0330($s0) ## 00000330 -.L80A71008: -/* 01A58 80A71008 0C29C1A6 */ jal func_80A70698 -/* 01A5C 80A7100C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01A60 80A71010 8605001C */ lh $a1, 0x001C($s0) ## 0000001C -/* 01A64 80A71014 8FA4003C */ lw $a0, 0x003C($sp) -/* 01A68 80A71018 2406000F */ addiu $a2, $zero, 0x000F ## $a2 = 0000000F -/* 01A6C 80A7101C 30A50780 */ andi $a1, $a1, 0x0780 ## $a1 = 00000000 -/* 01A70 80A71020 000529C3 */ sra $a1, $a1, 7 -/* 01A74 80A71024 00052C00 */ sll $a1, $a1, 16 -/* 01A78 80A71028 0C023938 */ jal Path_GetByIndex -/* 01A7C 80A7102C 00052C03 */ sra $a1, $a1, 16 -/* 01A80 80A71030 860B001C */ lh $t3, 0x001C($s0) ## 0000001C -/* 01A84 80A71034 AE020210 */ sw $v0, 0x0210($s0) ## 00000210 -/* 01A88 80A71038 316C007F */ andi $t4, $t3, 0x007F ## $t4 = 00000000 -/* 01A8C 80A7103C 2D810015 */ sltiu $at, $t4, 0x0015 -/* 01A90 80A71040 10200026 */ beq $at, $zero, .L80A710DC -/* 01A94 80A71044 000C6080 */ sll $t4, $t4, 2 -/* 01A98 80A71048 3C0180A7 */ lui $at, %hi(jtbl_80A72A34) ## $at = 80A70000 -/* 01A9C 80A7104C 002C0821 */ addu $at, $at, $t4 -/* 01AA0 80A71050 8C2C2A34 */ lw $t4, %lo(jtbl_80A72A34)($at) -/* 01AA4 80A71054 01800008 */ jr $t4 -/* 01AA8 80A71058 00000000 */ nop -glabel L80A7105C -/* 01AAC 80A7105C 8E0D0210 */ lw $t5, 0x0210($s0) ## 00000210 -/* 01AB0 80A71060 3C0E80A7 */ lui $t6, %hi(func_80A711B4) ## $t6 = 80A70000 -/* 01AB4 80A71064 3C014040 */ lui $at, 0x4040 ## $at = 40400000 -/* 01AB8 80A71068 11A00004 */ beq $t5, $zero, .L80A7107C -/* 01ABC 80A7106C 25CE11B4 */ addiu $t6, $t6, %lo(func_80A711B4) ## $t6 = 80A711B4 -/* 01AC0 80A71070 44813000 */ mtc1 $at, $f6 ## $f6 = 3.00 -/* 01AC4 80A71074 00000000 */ nop -/* 01AC8 80A71078 E6060068 */ swc1 $f6, 0x0068($s0) ## 00000068 -.L80A7107C: -/* 01ACC 80A7107C 10000019 */ beq $zero, $zero, .L80A710E4 -/* 01AD0 80A71080 AE0E0190 */ sw $t6, 0x0190($s0) ## 00000190 -glabel L80A71084 -/* 01AD4 80A71084 3C0F80A7 */ lui $t7, %hi(func_80A712C0) ## $t7 = 80A70000 -/* 01AD8 80A71088 25EF12C0 */ addiu $t7, $t7, %lo(func_80A712C0) ## $t7 = 80A712C0 -/* 01ADC 80A7108C A2000195 */ sb $zero, 0x0195($s0) ## 00000195 -/* 01AE0 80A71090 10000014 */ beq $zero, $zero, .L80A710E4 -/* 01AE4 80A71094 AE0F0190 */ sw $t7, 0x0190($s0) ## 00000190 -glabel L80A71098 -/* 01AE8 80A71098 8FB8003C */ lw $t8, 0x003C($sp) -/* 01AEC 80A7109C 24010020 */ addiu $at, $zero, 0x0020 ## $at = 00000020 -/* 01AF0 80A710A0 3C0880A7 */ lui $t0, %hi(func_80A710F8) ## $t0 = 80A70000 -/* 01AF4 80A710A4 871900A4 */ lh $t9, 0x00A4($t8) ## 000000A4 -/* 01AF8 80A710A8 250810F8 */ addiu $t0, $t0, %lo(func_80A710F8) ## $t0 = 80A710F8 -/* 01AFC 80A710AC 17210003 */ bne $t9, $at, .L80A710BC -/* 01B00 80A710B0 00000000 */ nop -/* 01B04 80A710B4 1000000B */ beq $zero, $zero, .L80A710E4 -/* 01B08 80A710B8 AE080190 */ sw $t0, 0x0190($s0) ## 00000190 -glabel L80A710BC -.L80A710BC: -/* 01B0C 80A710BC 3C0980A7 */ lui $t1, %hi(func_80A7127C) ## $t1 = 80A70000 -/* 01B10 80A710C0 2529127C */ addiu $t1, $t1, %lo(func_80A7127C) ## $t1 = 80A7127C -/* 01B14 80A710C4 10000007 */ beq $zero, $zero, .L80A710E4 -/* 01B18 80A710C8 AE090190 */ sw $t1, 0x0190($s0) ## 00000190 -glabel L80A710CC -/* 01B1C 80A710CC 3C0A80A7 */ lui $t2, %hi(func_80A712B4) ## $t2 = 80A70000 -/* 01B20 80A710D0 254A12B4 */ addiu $t2, $t2, %lo(func_80A712B4) ## $t2 = 80A712B4 -/* 01B24 80A710D4 10000003 */ beq $zero, $zero, .L80A710E4 -/* 01B28 80A710D8 AE0A0190 */ sw $t2, 0x0190($s0) ## 00000190 -.L80A710DC: -/* 01B2C 80A710DC 0C00B55C */ jal Actor_Kill - -/* 01B30 80A710E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A710E4: -/* 01B34 80A710E4 8FBF002C */ lw $ra, 0x002C($sp) -/* 01B38 80A710E8 8FB00028 */ lw $s0, 0x0028($sp) -/* 01B3C 80A710EC 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 01B40 80A710F0 03E00008 */ jr $ra -/* 01B44 80A710F4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A710F8.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A710F8.s deleted file mode 100644 index 5d33305bb1..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A710F8.s +++ /dev/null @@ -1,52 +0,0 @@ -glabel func_80A710F8 -/* 01B48 80A710F8 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 01B4C 80A710FC AFBF0014 */ sw $ra, 0x0014($sp) -/* 01B50 80A71100 AFA5001C */ sw $a1, 0x001C($sp) -/* 01B54 80A71104 848E01E8 */ lh $t6, 0x01E8($a0) ## 000001E8 -/* 01B58 80A71108 00803825 */ or $a3, $a0, $zero ## $a3 = 00000000 -/* 01B5C 80A7110C 3C198016 */ lui $t9, %hi(gSaveContext+0x1400) -/* 01B60 80A71110 11C0000C */ beq $t6, $zero, .L80A71144 -/* 01B64 80A71114 00000000 */ nop -/* 01B68 80A71118 8C980154 */ lw $t8, 0x0154($a0) ## 00000154 -/* 01B6C 80A7111C 3C0F0600 */ lui $t7, %hi(D_06000BFC) ## $t7 = 06000000 -/* 01B70 80A71120 25EF0BFC */ addiu $t7, $t7, %lo(D_06000BFC) ## $t7 = 06000BFC -/* 01B74 80A71124 11F8001F */ beq $t7, $t8, .L80A711A4 -/* 01B78 80A71128 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 01B7C 80A7112C 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01B80 80A71130 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01B84 80A71134 0C00D3B0 */ jal func_80034EC0 -/* 01B88 80A71138 2406001A */ addiu $a2, $zero, 0x001A ## $a2 = 0000001A -/* 01B8C 80A7113C 1000001A */ beq $zero, $zero, .L80A711A8 -/* 01B90 80A71140 8FBF0014 */ lw $ra, 0x0014($sp) -.L80A71144: -/* 01B94 80A71144 9739FA60 */ lhu $t9, %lo(gSaveContext+0x1400)($t9) -/* 01B98 80A71148 33280001 */ andi $t0, $t9, 0x0001 ## $t0 = 00000000 -/* 01B9C 80A7114C 5100000D */ beql $t0, $zero, .L80A71184 -/* 01BA0 80A71150 8CEC0154 */ lw $t4, 0x0154($a3) ## 00000154 -/* 01BA4 80A71154 8CEA0154 */ lw $t2, 0x0154($a3) ## 00000154 -/* 01BA8 80A71158 3C090600 */ lui $t1, %hi(D_06000FE4) ## $t1 = 06000000 -/* 01BAC 80A7115C 25290FE4 */ addiu $t1, $t1, %lo(D_06000FE4) ## $t1 = 06000FE4 -/* 01BB0 80A71160 112A0010 */ beq $t1, $t2, .L80A711A4 -/* 01BB4 80A71164 24E4014C */ addiu $a0, $a3, 0x014C ## $a0 = 0000014C -/* 01BB8 80A71168 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01BBC 80A7116C 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01BC0 80A71170 0C00D3B0 */ jal func_80034EC0 -/* 01BC4 80A71174 24060019 */ addiu $a2, $zero, 0x0019 ## $a2 = 00000019 -/* 01BC8 80A71178 1000000B */ beq $zero, $zero, .L80A711A8 -/* 01BCC 80A7117C 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01BD0 80A71180 8CEC0154 */ lw $t4, 0x0154($a3) ## 00000154 -.L80A71184: -/* 01BD4 80A71184 3C0B0600 */ lui $t3, %hi(D_060012E8) ## $t3 = 06000000 -/* 01BD8 80A71188 256B12E8 */ addiu $t3, $t3, %lo(D_060012E8) ## $t3 = 060012E8 -/* 01BDC 80A7118C 116C0005 */ beq $t3, $t4, .L80A711A4 -/* 01BE0 80A71190 24E4014C */ addiu $a0, $a3, 0x014C ## $a0 = 0000014C -/* 01BE4 80A71194 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01BE8 80A71198 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01BEC 80A7119C 0C00D3B0 */ jal func_80034EC0 -/* 01BF0 80A711A0 24060018 */ addiu $a2, $zero, 0x0018 ## $a2 = 00000018 -.L80A711A4: -/* 01BF4 80A711A4 8FBF0014 */ lw $ra, 0x0014($sp) -.L80A711A8: -/* 01BF8 80A711A8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 01BFC 80A711AC 03E00008 */ jr $ra -/* 01C00 80A711B0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A711B4.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A711B4.s deleted file mode 100644 index d568b6f6e0..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A711B4.s +++ /dev/null @@ -1,54 +0,0 @@ -glabel func_80A711B4 -/* 01C04 80A711B4 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 01C08 80A711B8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 01C0C 80A711BC AFB00020 */ sw $s0, 0x0020($sp) -/* 01C10 80A711C0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01C14 80A711C4 AFA50034 */ sw $a1, 0x0034($sp) -/* 01C18 80A711C8 82060214 */ lb $a2, 0x0214($s0) ## 00000214 -/* 01C1C 80A711CC 8E050210 */ lw $a1, 0x0210($s0) ## 00000210 -/* 01C20 80A711D0 0C023948 */ jal Path_OrientAndGetDistSq -/* 01C24 80A711D4 27A7002E */ addiu $a3, $sp, 0x002E ## $a3 = FFFFFFFE -/* 01C28 80A711D8 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 01C2C 80A711DC AFAE0010 */ sw $t6, 0x0010($sp) -/* 01C30 80A711E0 26040032 */ addiu $a0, $s0, 0x0032 ## $a0 = 00000032 -/* 01C34 80A711E4 87A5002E */ lh $a1, 0x002E($sp) -/* 01C38 80A711E8 2406000A */ addiu $a2, $zero, 0x000A ## $a2 = 0000000A -/* 01C3C 80A711EC 240703E8 */ addiu $a3, $zero, 0x03E8 ## $a3 = 000003E8 -/* 01C40 80A711F0 0C01E1A7 */ jal Math_SmoothStepToS - -/* 01C44 80A711F4 E7A00028 */ swc1 $f0, 0x0028($sp) -/* 01C48 80A711F8 8A180030 */ lwl $t8, 0x0030($s0) ## 00000030 -/* 01C4C 80A711FC C7A20028 */ lwc1 $f2, 0x0028($sp) -/* 01C50 80A71200 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 01C54 80A71204 9A180033 */ lwr $t8, 0x0033($s0) ## 00000033 -/* 01C58 80A71208 3C01447A */ lui $at, 0x447A ## $at = 447A0000 -/* 01C5C 80A7120C 4602203C */ c.lt.s $f4, $f2 -/* 01C60 80A71210 AA1800B4 */ swl $t8, 0x00B4($s0) ## 000000B4 -/* 01C64 80A71214 BA1800B7 */ swr $t8, 0x00B7($s0) ## 000000B7 -/* 01C68 80A71218 96180034 */ lhu $t8, 0x0034($s0) ## 00000034 -/* 01C6C 80A7121C 45000012 */ bc1f .L80A71268 -/* 01C70 80A71220 A61800B8 */ sh $t8, 0x00B8($s0) ## 000000B8 -/* 01C74 80A71224 44813000 */ mtc1 $at, $f6 ## $f6 = 1000.00 -/* 01C78 80A71228 00000000 */ nop -/* 01C7C 80A7122C 4606103C */ c.lt.s $f2, $f6 -/* 01C80 80A71230 00000000 */ nop -/* 01C84 80A71234 4502000D */ bc1fl .L80A7126C -/* 01C88 80A71238 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01C8C 80A7123C 82190214 */ lb $t9, 0x0214($s0) ## 00000214 -/* 01C90 80A71240 8E0A0210 */ lw $t2, 0x0210($s0) ## 00000210 -/* 01C94 80A71244 27280001 */ addiu $t0, $t9, 0x0001 ## $t0 = 00000001 -/* 01C98 80A71248 A2080214 */ sb $t0, 0x0214($s0) ## 00000214 -/* 01C9C 80A7124C 914B0000 */ lbu $t3, 0x0000($t2) ## 00000000 -/* 01CA0 80A71250 82090214 */ lb $t1, 0x0214($s0) ## 00000214 -/* 01CA4 80A71254 256CFFFF */ addiu $t4, $t3, 0xFFFF ## $t4 = FFFFFFFF -/* 01CA8 80A71258 0189082A */ slt $at, $t4, $t1 -/* 01CAC 80A7125C 50200003 */ beql $at, $zero, .L80A7126C -/* 01CB0 80A71260 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01CB4 80A71264 A2000214 */ sb $zero, 0x0214($s0) ## 00000214 -.L80A71268: -/* 01CB8 80A71268 8FBF0024 */ lw $ra, 0x0024($sp) -.L80A7126C: -/* 01CBC 80A7126C 8FB00020 */ lw $s0, 0x0020($sp) -/* 01CC0 80A71270 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 01CC4 80A71274 03E00008 */ jr $ra -/* 01CC8 80A71278 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7127C.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7127C.s deleted file mode 100644 index d2f702ee70..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7127C.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80A7127C -/* 01CCC 80A7127C 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 01CD0 80A71280 AFA40018 */ sw $a0, 0x0018($sp) -/* 01CD4 80A71284 8FAE0018 */ lw $t6, 0x0018($sp) -/* 01CD8 80A71288 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01CDC 80A7128C AFA5001C */ sw $a1, 0x001C($sp) -/* 01CE0 80A71290 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 01CE4 80A71294 24070010 */ addiu $a3, $zero, 0x0010 ## $a3 = 00000010 -/* 01CE8 80A71298 25C5021C */ addiu $a1, $t6, 0x021C ## $a1 = 0000021C -/* 01CEC 80A7129C 0C00D3D5 */ jal func_80034F54 -/* 01CF0 80A712A0 25C6023C */ addiu $a2, $t6, 0x023C ## $a2 = 0000023C -/* 01CF4 80A712A4 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01CF8 80A712A8 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 01CFC 80A712AC 03E00008 */ jr $ra -/* 01D00 80A712B0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712B4.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712B4.s deleted file mode 100644 index 5a5bdea373..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712B4.s +++ /dev/null @@ -1,4 +0,0 @@ -glabel func_80A712B4 -/* 01D04 80A712B4 AFA40000 */ sw $a0, 0x0000($sp) -/* 01D08 80A712B8 03E00008 */ jr $ra -/* 01D0C 80A712BC AFA50004 */ sw $a1, 0x0004($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712C0.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712C0.s deleted file mode 100644 index eb9b5be8bd..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712C0.s +++ /dev/null @@ -1,43 +0,0 @@ -.late_rodata -glabel D_80A72A88 - .float 0.4 - -.text -glabel func_80A712C0 -/* 01D10 80A712C0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 01D14 80A712C4 AFBF001C */ sw $ra, 0x001C($sp) -/* 01D18 80A712C8 AFB00018 */ sw $s0, 0x0018($sp) -/* 01D1C 80A712CC AFA50024 */ sw $a1, 0x0024($sp) -/* 01D20 80A712D0 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 01D24 80A712D4 44812000 */ mtc1 $at, $f4 ## $f4 = 100.00 -/* 01D28 80A712D8 C4860090 */ lwc1 $f6, 0x0090($a0) ## 00000090 -/* 01D2C 80A712DC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01D30 80A712E0 4604303E */ c.le.s $f6, $f4 -/* 01D34 80A712E4 00000000 */ nop -/* 01D38 80A712E8 4502000F */ bc1fl .L80A71328 -/* 01D3C 80A712EC 8FA40024 */ lw $a0, 0x0024($sp) -/* 01D40 80A712F0 8C8E0210 */ lw $t6, 0x0210($a0) ## 00000210 -/* 01D44 80A712F4 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01D48 80A712F8 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01D4C 80A712FC 11C00009 */ beq $t6, $zero, .L80A71324 -/* 01D50 80A71300 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 01D54 80A71304 0C00D3B0 */ jal func_80034EC0 -/* 01D58 80A71308 24060007 */ addiu $a2, $zero, 0x0007 ## $a2 = 00000007 -/* 01D5C 80A7130C 3C0180A7 */ lui $at, %hi(D_80A72A88) ## $at = 80A70000 -/* 01D60 80A71310 C4282A88 */ lwc1 $f8, %lo(D_80A72A88)($at) -/* 01D64 80A71314 3C0F80A7 */ lui $t7, %hi(func_80A7134C) ## $t7 = 80A70000 -/* 01D68 80A71318 25EF134C */ addiu $t7, $t7, %lo(func_80A7134C) ## $t7 = 80A7134C -/* 01D6C 80A7131C AE0F0190 */ sw $t7, 0x0190($s0) ## 00000190 -/* 01D70 80A71320 E6080068 */ swc1 $f8, 0x0068($s0) ## 00000068 -.L80A71324: -/* 01D74 80A71324 8FA40024 */ lw $a0, 0x0024($sp) -.L80A71328: -/* 01D78 80A71328 2605021C */ addiu $a1, $s0, 0x021C ## $a1 = 0000021C -/* 01D7C 80A7132C 2606023C */ addiu $a2, $s0, 0x023C ## $a2 = 0000023C -/* 01D80 80A71330 0C00D3D5 */ jal func_80034F54 -/* 01D84 80A71334 24070010 */ addiu $a3, $zero, 0x0010 ## $a3 = 00000010 -/* 01D88 80A71338 8FBF001C */ lw $ra, 0x001C($sp) -/* 01D8C 80A7133C 8FB00018 */ lw $s0, 0x0018($sp) -/* 01D90 80A71340 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 01D94 80A71344 03E00008 */ jr $ra -/* 01D98 80A71348 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7134C.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7134C.s deleted file mode 100644 index 1261c9c8a2..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7134C.s +++ /dev/null @@ -1,106 +0,0 @@ -.late_rodata -glabel D_80A72A8C - .float 0.4 - -.text -glabel func_80A7134C -/* 01D9C 80A7134C 27BDFFC8 */ addiu $sp, $sp, 0xFFC8 ## $sp = FFFFFFC8 -/* 01DA0 80A71350 AFBF0024 */ sw $ra, 0x0024($sp) -/* 01DA4 80A71354 AFB00020 */ sw $s0, 0x0020($sp) -/* 01DA8 80A71358 AFA5003C */ sw $a1, 0x003C($sp) -/* 01DAC 80A7135C 8C820154 */ lw $v0, 0x0154($a0) ## 00000154 -/* 01DB0 80A71360 3C0E0600 */ lui $t6, %hi(D_06002160) ## $t6 = 06000000 -/* 01DB4 80A71364 25CE2160 */ addiu $t6, $t6, %lo(D_06002160) ## $t6 = 06002160 -/* 01DB8 80A71368 15C20009 */ bne $t6, $v0, .L80A71390 -/* 01DBC 80A7136C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01DC0 80A71370 848F01E8 */ lh $t7, 0x01E8($a0) ## 000001E8 -/* 01DC4 80A71374 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01DC8 80A71378 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01DCC 80A7137C 11E00004 */ beq $t7, $zero, .L80A71390 -/* 01DD0 80A71380 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C -/* 01DD4 80A71384 0C00D3B0 */ jal func_80034EC0 -/* 01DD8 80A71388 24060008 */ addiu $a2, $zero, 0x0008 ## $a2 = 00000008 -/* 01DDC 80A7138C 8E020154 */ lw $v0, 0x0154($s0) ## 00000154 -.L80A71390: -/* 01DE0 80A71390 3C180600 */ lui $t8, %hi(D_0600265C) ## $t8 = 06000000 -/* 01DE4 80A71394 2718265C */ addiu $t8, $t8, %lo(D_0600265C) ## $t8 = 0600265C -/* 01DE8 80A71398 17020008 */ bne $t8, $v0, .L80A713BC -/* 01DEC 80A7139C 00000000 */ nop -/* 01DF0 80A713A0 861901E8 */ lh $t9, 0x01E8($s0) ## 000001E8 -/* 01DF4 80A713A4 3C0580A7 */ lui $a1, %hi(D_80A72050) ## $a1 = 80A70000 -/* 01DF8 80A713A8 24A52050 */ addiu $a1, $a1, %lo(D_80A72050) ## $a1 = 80A72050 -/* 01DFC 80A713AC 17200003 */ bne $t9, $zero, .L80A713BC -/* 01E00 80A713B0 2604014C */ addiu $a0, $s0, 0x014C ## $a0 = 0000014C -/* 01E04 80A713B4 0C00D3B0 */ jal func_80034EC0 -/* 01E08 80A713B8 24060007 */ addiu $a2, $zero, 0x0007 ## $a2 = 00000007 -.L80A713BC: -/* 01E0C 80A713BC 3C0180A7 */ lui $at, %hi(D_80A72A8C) ## $at = 80A70000 -/* 01E10 80A713C0 C4242A8C */ lwc1 $f4, %lo(D_80A72A8C)($at) -/* 01E14 80A713C4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01E18 80A713C8 8E050210 */ lw $a1, 0x0210($s0) ## 00000210 -/* 01E1C 80A713CC 82060214 */ lb $a2, 0x0214($s0) ## 00000214 -/* 01E20 80A713D0 27A70036 */ addiu $a3, $sp, 0x0036 ## $a3 = FFFFFFFE -/* 01E24 80A713D4 0C023948 */ jal Path_OrientAndGetDistSq -/* 01E28 80A713D8 E6040068 */ swc1 $f4, 0x0068($s0) ## 00000068 -/* 01E2C 80A713DC 24080001 */ addiu $t0, $zero, 0x0001 ## $t0 = 00000001 -/* 01E30 80A713E0 AFA80010 */ sw $t0, 0x0010($sp) -/* 01E34 80A713E4 26040032 */ addiu $a0, $s0, 0x0032 ## $a0 = 00000032 -/* 01E38 80A713E8 87A50036 */ lh $a1, 0x0036($sp) -/* 01E3C 80A713EC 2406000A */ addiu $a2, $zero, 0x000A ## $a2 = 0000000A -/* 01E40 80A713F0 240703E8 */ addiu $a3, $zero, 0x03E8 ## $a3 = 000003E8 -/* 01E44 80A713F4 0C01E1A7 */ jal Math_SmoothStepToS - -/* 01E48 80A713F8 E7A00030 */ swc1 $f0, 0x0030($sp) -/* 01E4C 80A713FC 8A0A0030 */ lwl $t2, 0x0030($s0) ## 00000030 -/* 01E50 80A71400 C7A20030 */ lwc1 $f2, 0x0030($sp) -/* 01E54 80A71404 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 -/* 01E58 80A71408 9A0A0033 */ lwr $t2, 0x0033($s0) ## 00000033 -/* 01E5C 80A7140C 3C01447A */ lui $at, 0x447A ## $at = 447A0000 -/* 01E60 80A71410 4606103E */ c.le.s $f2, $f6 -/* 01E64 80A71414 AA0A00B4 */ swl $t2, 0x00B4($s0) ## 000000B4 -/* 01E68 80A71418 BA0A00B7 */ swr $t2, 0x00B7($s0) ## 000000B7 -/* 01E6C 80A7141C 960A0034 */ lhu $t2, 0x0034($s0) ## 00000034 -/* 01E70 80A71420 45010023 */ bc1t .L80A714B0 -/* 01E74 80A71424 A60A00B8 */ sh $t2, 0x00B8($s0) ## 000000B8 -/* 01E78 80A71428 44814000 */ mtc1 $at, $f8 ## $f8 = 1000.00 -/* 01E7C 80A7142C 00000000 */ nop -/* 01E80 80A71430 4602403E */ c.le.s $f8, $f2 -/* 01E84 80A71434 00000000 */ nop -/* 01E88 80A71438 4503001E */ bc1tl .L80A714B4 -/* 01E8C 80A7143C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01E90 80A71440 920B0195 */ lbu $t3, 0x0195($s0) ## 00000195 -/* 01E94 80A71444 55600012 */ bnel $t3, $zero, .L80A71490 -/* 01E98 80A71448 820A0214 */ lb $t2, 0x0214($s0) ## 00000214 -/* 01E9C 80A7144C 820C0214 */ lb $t4, 0x0214($s0) ## 00000214 -/* 01EA0 80A71450 8E020210 */ lw $v0, 0x0210($s0) ## 00000210 -/* 01EA4 80A71454 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 01EA8 80A71458 258D0001 */ addiu $t5, $t4, 0x0001 ## $t5 = 00000001 -/* 01EAC 80A7145C A20D0214 */ sb $t5, 0x0214($s0) ## 00000214 -/* 01EB0 80A71460 904F0000 */ lbu $t7, 0x0000($v0) ## 00000000 -/* 01EB4 80A71464 820E0214 */ lb $t6, 0x0214($s0) ## 00000214 -/* 01EB8 80A71468 25F8FFFF */ addiu $t8, $t7, 0xFFFF ## $t8 = FFFFFFFF -/* 01EBC 80A7146C 030E082A */ slt $at, $t8, $t6 -/* 01EC0 80A71470 50200010 */ beql $at, $zero, .L80A714B4 -/* 01EC4 80A71474 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01EC8 80A71478 A2190195 */ sb $t9, 0x0195($s0) ## 00000195 -/* 01ECC 80A7147C 90480000 */ lbu $t0, 0x0000($v0) ## 00000000 -/* 01ED0 80A71480 2509FFFE */ addiu $t1, $t0, 0xFFFE ## $t1 = FFFFFFFE -/* 01ED4 80A71484 1000000A */ beq $zero, $zero, .L80A714B0 -/* 01ED8 80A71488 A2090214 */ sb $t1, 0x0214($s0) ## 00000214 -/* 01EDC 80A7148C 820A0214 */ lb $t2, 0x0214($s0) ## 00000214 -.L80A71490: -/* 01EE0 80A71490 240D0001 */ addiu $t5, $zero, 0x0001 ## $t5 = 00000001 -/* 01EE4 80A71494 254BFFFF */ addiu $t3, $t2, 0xFFFF ## $t3 = FFFFFFFF -/* 01EE8 80A71498 A20B0214 */ sb $t3, 0x0214($s0) ## 00000214 -/* 01EEC 80A7149C 820C0214 */ lb $t4, 0x0214($s0) ## 00000214 -/* 01EF0 80A714A0 05830004 */ bgezl $t4, .L80A714B4 -/* 01EF4 80A714A4 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01EF8 80A714A8 A2000195 */ sb $zero, 0x0195($s0) ## 00000195 -/* 01EFC 80A714AC A20D0214 */ sb $t5, 0x0214($s0) ## 00000214 -.L80A714B0: -/* 01F00 80A714B0 8FBF0024 */ lw $ra, 0x0024($sp) -.L80A714B4: -/* 01F04 80A714B4 8FB00020 */ lw $s0, 0x0020($sp) -/* 01F08 80A714B8 27BD0038 */ addiu $sp, $sp, 0x0038 ## $sp = 00000000 -/* 01F0C 80A714BC 03E00008 */ jr $ra -/* 01F10 80A714C0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A714C4.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A714C4.s deleted file mode 100644 index d09f432908..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A714C4.s +++ /dev/null @@ -1,30 +0,0 @@ -glabel func_80A714C4 -/* 01F14 80A714C4 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 01F18 80A714C8 AFBF001C */ sw $ra, 0x001C($sp) -/* 01F1C 80A714CC AFA50024 */ sw $a1, 0x0024($sp) -/* 01F20 80A714D0 0C00BD04 */ jal Actor_HasParent -/* 01F24 80A714D4 AFA40020 */ sw $a0, 0x0020($sp) -/* 01F28 80A714D8 10400005 */ beq $v0, $zero, .L80A714F0 -/* 01F2C 80A714DC 8FA40020 */ lw $a0, 0x0020($sp) -/* 01F30 80A714E0 3C0E80A7 */ lui $t6, %hi(func_80A71530) ## $t6 = 80A70000 -/* 01F34 80A714E4 25CE1530 */ addiu $t6, $t6, %lo(func_80A71530) ## $t6 = 80A71530 -/* 01F38 80A714E8 1000000D */ beq $zero, $zero, .L80A71520 -/* 01F3C 80A714EC AC8E0190 */ sw $t6, 0x0190($a0) ## 00000190 -.L80A714F0: -/* 01F40 80A714F0 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 01F44 80A714F4 44811000 */ mtc1 $at, $f2 ## $f2 = 1.00 -/* 01F48 80A714F8 C4800094 */ lwc1 $f0, 0x0094($a0) ## 00000094 -/* 01F4C 80A714FC C4840090 */ lwc1 $f4, 0x0090($a0) ## 00000090 -/* 01F50 80A71500 8C860260 */ lw $a2, 0x0260($a0) ## 00000260 -/* 01F54 80A71504 46000005 */ abs.s $f0, $f0 -/* 01F58 80A71508 46022180 */ add.s $f6, $f4, $f2 -/* 01F5C 80A7150C 8FA50024 */ lw $a1, 0x0024($sp) -/* 01F60 80A71510 46020200 */ add.s $f8, $f0, $f2 -/* 01F64 80A71514 44073000 */ mfc1 $a3, $f6 -/* 01F68 80A71518 0C00BD0D */ jal func_8002F434 -/* 01F6C 80A7151C E7A80010 */ swc1 $f8, 0x0010($sp) -.L80A71520: -/* 01F70 80A71520 8FBF001C */ lw $ra, 0x001C($sp) -/* 01F74 80A71524 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 01F78 80A71528 03E00008 */ jr $ra -/* 01F7C 80A7152C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71530.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71530.s deleted file mode 100644 index 083f9868e4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71530.s +++ /dev/null @@ -1,50 +0,0 @@ -glabel func_80A71530 -/* 01F80 80A71530 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 01F84 80A71534 AFBF0014 */ sw $ra, 0x0014($sp) -/* 01F88 80A71538 AFA40018 */ sw $a0, 0x0018($sp) -/* 01F8C 80A7153C AFA5001C */ sw $a1, 0x001C($sp) -/* 01F90 80A71540 0C042F6F */ jal func_8010BDBC -/* 01F94 80A71544 24A420D8 */ addiu $a0, $a1, 0x20D8 ## $a0 = 000020D8 -/* 01F98 80A71548 24010006 */ addiu $at, $zero, 0x0006 ## $at = 00000006 -/* 01F9C 80A7154C 54410020 */ bnel $v0, $at, .L80A715D0 -/* 01FA0 80A71550 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01FA4 80A71554 0C041AF2 */ jal func_80106BC8 -/* 01FA8 80A71558 8FA4001C */ lw $a0, 0x001C($sp) -/* 01FAC 80A7155C 1040001B */ beq $v0, $zero, .L80A715CC -/* 01FB0 80A71560 8FAE0018 */ lw $t6, 0x0018($sp) -/* 01FB4 80A71564 8DC20260 */ lw $v0, 0x0260($t6) ## 00000260 -/* 01FB8 80A71568 2401003E */ addiu $at, $zero, 0x003E ## $at = 0000003E -/* 01FBC 80A7156C 10410005 */ beq $v0, $at, .L80A71584 -/* 01FC0 80A71570 2401004D */ addiu $at, $zero, 0x004D ## $at = 0000004D -/* 01FC4 80A71574 1041000B */ beq $v0, $at, .L80A715A4 -/* 01FC8 80A71578 00000000 */ nop -/* 01FCC 80A7157C 10000010 */ beq $zero, $zero, .L80A715C0 -/* 01FD0 80A71580 8FA80018 */ lw $t0, 0x0018($sp) -.L80A71584: -/* 01FD4 80A71584 3C028016 */ lui $v0, %hi(gSaveContext) -/* 01FD8 80A71588 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 01FDC 80A7158C 944F0F2A */ lhu $t7, 0x0F2A($v0) ## 8015F58A -/* 01FE0 80A71590 A44013C4 */ sh $zero, 0x13C4($v0) ## 8015FA24 -/* 01FE4 80A71594 A040141C */ sb $zero, 0x141C($v0) ## 8015FA7C -/* 01FE8 80A71598 35F80002 */ ori $t8, $t7, 0x0002 ## $t8 = 00000002 -/* 01FEC 80A7159C 10000007 */ beq $zero, $zero, .L80A715BC -/* 01FF0 80A715A0 A4580F2A */ sh $t8, 0x0F2A($v0) ## 8015F58A -.L80A715A4: -/* 01FF4 80A715A4 0C021CC3 */ jal Rupees_ChangeBy -/* 01FF8 80A715A8 24040005 */ addiu $a0, $zero, 0x0005 ## $a0 = 00000005 -/* 01FFC 80A715AC 3C028016 */ lui $v0, %hi(gSaveContext) -/* 02000 80A715B0 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 02004 80A715B4 A44013C4 */ sh $zero, 0x13C4($v0) ## 8015FA24 -/* 02008 80A715B8 A040141C */ sb $zero, 0x141C($v0) ## 8015FA7C -.L80A715BC: -/* 0200C 80A715BC 8FA80018 */ lw $t0, 0x0018($sp) -.L80A715C0: -/* 02010 80A715C0 3C1980A7 */ lui $t9, %hi(func_80A7127C) ## $t9 = 80A70000 -/* 02014 80A715C4 2739127C */ addiu $t9, $t9, %lo(func_80A7127C) ## $t9 = 80A7127C -/* 02018 80A715C8 AD190190 */ sw $t9, 0x0190($t0) ## 00000190 -.L80A715CC: -/* 0201C 80A715CC 8FBF0014 */ lw $ra, 0x0014($sp) -.L80A715D0: -/* 02020 80A715D0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 02024 80A715D4 03E00008 */ jr $ra -/* 02028 80A715D8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A716B8.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A716B8.s deleted file mode 100644 index 697af756a6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A716B8.s +++ /dev/null @@ -1,267 +0,0 @@ -.rdata -glabel D_80A72810 - .asciz "../z_en_hy.c" - .balign 4 - -glabel D_80A72820 - .asciz "../z_en_hy.c" - .balign 4 - -.late_rodata -glabel D_80A72A90 - .float 3.14159274101 - -glabel D_80A72A94 - .float 3.14159274101 - -glabel D_80A72A98 - .float 3.14159274101 - -glabel D_80A72A9C - .float 3.14159274101 - -.text -glabel func_80A716B8 -/* 02108 80A716B8 27BDFFA8 */ addiu $sp, $sp, 0xFFA8 ## $sp = FFFFFFA8 -/* 0210C 80A716BC AFBF0014 */ sw $ra, 0x0014($sp) -/* 02110 80A716C0 AFA40058 */ sw $a0, 0x0058($sp) -/* 02114 80A716C4 AFA5005C */ sw $a1, 0x005C($sp) -/* 02118 80A716C8 AFA60060 */ sw $a2, 0x0060($sp) -/* 0211C 80A716CC AFA70064 */ sw $a3, 0x0064($sp) -/* 02120 80A716D0 8C850000 */ lw $a1, 0x0000($a0) ## 00000000 -/* 02124 80A716D4 3C0680A7 */ lui $a2, %hi(D_80A72810) ## $a2 = 80A70000 -/* 02128 80A716D8 24C62810 */ addiu $a2, $a2, %lo(D_80A72810) ## $a2 = 80A72810 -/* 0212C 80A716DC 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFD4 -/* 02130 80A716E0 2407087A */ addiu $a3, $zero, 0x087A ## $a3 = 0000087A -/* 02134 80A716E4 0C031AB1 */ jal Graph_OpenDisps -/* 02138 80A716E8 AFA5003C */ sw $a1, 0x003C($sp) -/* 0213C 80A716EC 8FA9005C */ lw $t1, 0x005C($sp) -/* 02140 80A716F0 240C000F */ addiu $t4, $zero, 0x000F ## $t4 = 0000000F -/* 02144 80A716F4 8FA8003C */ lw $t0, 0x003C($sp) -/* 02148 80A716F8 152C0051 */ bne $t1, $t4, .L80A71840 -/* 0214C 80A716FC 8FAA006C */ lw $t2, 0x006C($sp) -/* 02150 80A71700 8D0302C0 */ lw $v1, 0x02C0($t0) ## 000002C0 -/* 02154 80A71704 3C18DB06 */ lui $t8, 0xDB06 ## $t8 = DB060000 -/* 02158 80A71708 37180018 */ ori $t8, $t8, 0x0018 ## $t8 = DB060018 -/* 0215C 80A7170C 246F0008 */ addiu $t7, $v1, 0x0008 ## $t7 = 00000008 -/* 02160 80A71710 AD0F02C0 */ sw $t7, 0x02C0($t0) ## 000002C0 -/* 02164 80A71714 AC780000 */ sw $t8, 0x0000($v1) ## 00000000 -/* 02168 80A71718 814D0196 */ lb $t5, 0x0196($t2) ## 00000196 -/* 0216C 80A7171C 24060044 */ addiu $a2, $zero, 0x0044 ## $a2 = 00000044 -/* 02170 80A71720 8FB90058 */ lw $t9, 0x0058($sp) -/* 02174 80A71724 01A60019 */ multu $t5, $a2 -/* 02178 80A71728 3C070001 */ lui $a3, 0x0001 ## $a3 = 00010000 -/* 0217C 80A7172C 3C0B8000 */ lui $t3, 0x8000 ## $t3 = 80000000 -/* 02180 80A71730 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 02184 80A71734 00007012 */ mflo $t6 -/* 02188 80A71738 032E7821 */ addu $t7, $t9, $t6 -/* 0218C 80A7173C 01E7C021 */ addu $t8, $t7, $a3 -/* 02190 80A71740 8F0D17B4 */ lw $t5, 0x17B4($t8) ## DB0617CC -/* 02194 80A71744 AC6D0004 */ sw $t5, 0x0004($v1) ## 00000004 -/* 02198 80A71748 814E0196 */ lb $t6, 0x0196($t2) ## 00000196 -/* 0219C 80A7174C 8FB90058 */ lw $t9, 0x0058($sp) -/* 021A0 80A71750 3C0380A7 */ lui $v1, %hi(D_80A722D8) ## $v1 = 80A70000 -/* 021A4 80A71754 01C60019 */ multu $t6, $a2 -/* 021A8 80A71758 00007812 */ mflo $t7 -/* 021AC 80A7175C 032FC021 */ addu $t8, $t9, $t7 -/* 021B0 80A71760 03076821 */ addu $t5, $t8, $a3 -/* 021B4 80A71764 8DAE17B4 */ lw $t6, 0x17B4($t5) ## 000017B4 -/* 021B8 80A71768 01CBC821 */ addu $t9, $t6, $t3 -/* 021BC 80A7176C AC396FC0 */ sw $t9, %lo(gSegments+0x18)($at) -/* 021C0 80A71770 854F001C */ lh $t7, 0x001C($t2) ## 0000001C -/* 021C4 80A71774 3C1980A7 */ lui $t9, %hi(D_80A71F50) ## $t9 = 80A70000 -/* 021C8 80A71778 27391F50 */ addiu $t9, $t9, %lo(D_80A71F50) ## $t9 = 80A71F50 -/* 021CC 80A7177C 31F8007F */ andi $t8, $t7, 0x007F ## $t8 = 00000008 -/* 021D0 80A71780 00186880 */ sll $t5, $t8, 2 -/* 021D4 80A71784 01B86823 */ subu $t5, $t5, $t8 -/* 021D8 80A71788 000D6880 */ sll $t5, $t5, 2 -/* 021DC 80A7178C 006D1821 */ addu $v1, $v1, $t5 -/* 021E0 80A71790 906322D8 */ lbu $v1, %lo(D_80A722D8)($v1) -/* 021E4 80A71794 8FB80060 */ lw $t8, 0x0060($sp) -/* 021E8 80A71798 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 021EC 80A7179C 00037080 */ sll $t6, $v1, 2 -/* 021F0 80A717A0 01C37023 */ subu $t6, $t6, $v1 -/* 021F4 80A717A4 000E7080 */ sll $t6, $t6, 2 -/* 021F8 80A717A8 01D91021 */ addu $v0, $t6, $t9 -/* 021FC 80A717AC 8C4F0004 */ lw $t7, 0x0004($v0) ## 00000004 -/* 02200 80A717B0 AF0F0000 */ sw $t7, 0x0000($t8) ## 00000008 -/* 02204 80A717B4 8C440008 */ lw $a0, 0x0008($v0) ## 00000008 -/* 02208 80A717B8 3C18DB06 */ lui $t8, 0xDB06 ## $t8 = DB060000 -/* 0220C 80A717BC 37180028 */ ori $t8, $t8, 0x0028 ## $t8 = DB060028 -/* 02210 80A717C0 50800016 */ beql $a0, $zero, .L80A7181C -/* 02214 80A717C4 814F0198 */ lb $t7, 0x0198($t2) ## 00000198 -/* 02218 80A717C8 854D0218 */ lh $t5, 0x0218($t2) ## 00000218 -/* 0221C 80A717CC 8D0302C0 */ lw $v1, 0x02C0($t0) ## 000002C0 -/* 02220 80A717D0 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 02224 80A717D4 000D7080 */ sll $t6, $t5, 2 -/* 02228 80A717D8 008EC821 */ addu $t9, $a0, $t6 -/* 0222C 80A717DC 8F250000 */ lw $a1, 0x0000($t9) ## 80A71F50 -/* 02230 80A717E0 246F0008 */ addiu $t7, $v1, 0x0008 ## $t7 = 80A70008 -/* 02234 80A717E4 AD0F02C0 */ sw $t7, 0x02C0($t0) ## 000002C0 -/* 02238 80A717E8 00056900 */ sll $t5, $a1, 4 -/* 0223C 80A717EC 000D7702 */ srl $t6, $t5, 28 -/* 02240 80A717F0 000EC880 */ sll $t9, $t6, 2 -/* 02244 80A717F4 3C0F8016 */ lui $t7, %hi(gSegments) -/* 02248 80A717F8 01F97821 */ addu $t7, $t7, $t9 -/* 0224C 80A717FC AC780000 */ sw $t8, 0x0000($v1) ## 80A70000 -/* 02250 80A71800 8DEF6FA8 */ lw $t7, %lo(gSegments)($t7) -/* 02254 80A71804 00A1C024 */ and $t8, $a1, $at -/* 02258 80A71808 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 0225C 80A7180C 01F86821 */ addu $t5, $t7, $t8 -/* 02260 80A71810 01A17021 */ addu $t6, $t5, $at -/* 02264 80A71814 AC6E0004 */ sw $t6, 0x0004($v1) ## 80A70004 -/* 02268 80A71818 814F0198 */ lb $t7, 0x0198($t2) ## 00000198 -.L80A7181C: -/* 0226C 80A7181C 8FB90058 */ lw $t9, 0x0058($sp) -/* 02270 80A71820 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 02274 80A71824 01E60019 */ multu $t7, $a2 -/* 02278 80A71828 0000C012 */ mflo $t8 -/* 0227C 80A7182C 03386821 */ addu $t5, $t9, $t8 -/* 02280 80A71830 01A77021 */ addu $t6, $t5, $a3 -/* 02284 80A71834 8DCF17B4 */ lw $t7, 0x17B4($t6) ## 000017B4 -/* 02288 80A71838 01EBC821 */ addu $t9, $t7, $t3 -/* 0228C 80A7183C AC396FC0 */ sw $t9, %lo(gSegments+0x18)($at) -.L80A71840: -/* 02290 80A71840 152C002F */ bne $t1, $t4, .L80A71900 -/* 02294 80A71844 8FAA006C */ lw $t2, 0x006C($sp) -/* 02298 80A71848 44807000 */ mtc1 $zero, $f14 ## $f14 = 0.00 -/* 0229C 80A7184C 3C0144AF */ lui $at, 0x44AF ## $at = 44AF0000 -/* 022A0 80A71850 44816000 */ mtc1 $at, $f12 ## $f12 = 1400.00 -/* 022A4 80A71854 44067000 */ mfc1 $a2, $f14 -/* 022A8 80A71858 0C034261 */ jal Matrix_Translate -/* 022AC 80A7185C 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 022B0 80A71860 8FAD006C */ lw $t5, 0x006C($sp) -/* 022B4 80A71864 27B80048 */ addiu $t8, $sp, 0x0048 ## $t8 = FFFFFFF0 -/* 022B8 80A71868 3C014700 */ lui $at, 0x4700 ## $at = 47000000 -/* 022BC 80A7186C 89AF01F0 */ lwl $t7, 0x01F0($t5) ## 000001F0 -/* 022C0 80A71870 99AF01F3 */ lwr $t7, 0x01F3($t5) ## 000001F3 -/* 022C4 80A71874 44814000 */ mtc1 $at, $f8 ## $f8 = 32768.00 -/* 022C8 80A71878 3C0180A7 */ lui $at, %hi(D_80A72A90) ## $at = 80A70000 -/* 022CC 80A7187C AF0F0000 */ sw $t7, 0x0000($t8) ## FFFFFFF0 -/* 022D0 80A71880 95AF01F4 */ lhu $t7, 0x01F4($t5) ## 000001F4 -/* 022D4 80A71884 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 022D8 80A71888 A70F0004 */ sh $t7, 0x0004($t8) ## FFFFFFF4 -/* 022DC 80A7188C 87B9004A */ lh $t9, 0x004A($sp) -/* 022E0 80A71890 C4302A90 */ lwc1 $f16, %lo(D_80A72A90)($at) -/* 022E4 80A71894 44992000 */ mtc1 $t9, $f4 ## $f4 = 0.00 -/* 022E8 80A71898 00000000 */ nop -/* 022EC 80A7189C 468021A0 */ cvt.s.w $f6, $f4 -/* 022F0 80A718A0 46083283 */ div.s $f10, $f6, $f8 -/* 022F4 80A718A4 46105302 */ mul.s $f12, $f10, $f16 -/* 022F8 80A718A8 0C0342DC */ jal Matrix_RotateX -/* 022FC 80A718AC 00000000 */ nop -/* 02300 80A718B0 87B80048 */ lh $t8, 0x0048($sp) -/* 02304 80A718B4 3C014700 */ lui $at, 0x4700 ## $at = 47000000 -/* 02308 80A718B8 44813000 */ mtc1 $at, $f6 ## $f6 = 32768.00 -/* 0230C 80A718BC 44989000 */ mtc1 $t8, $f18 ## $f18 = 0.00 -/* 02310 80A718C0 3C0180A7 */ lui $at, %hi(D_80A72A94) ## $at = 80A70000 -/* 02314 80A718C4 C42A2A94 */ lwc1 $f10, %lo(D_80A72A94)($at) -/* 02318 80A718C8 46809120 */ cvt.s.w $f4, $f18 -/* 0231C 80A718CC 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 02320 80A718D0 46062203 */ div.s $f8, $f4, $f6 -/* 02324 80A718D4 460A4302 */ mul.s $f12, $f8, $f10 -/* 02328 80A718D8 0C0343B5 */ jal Matrix_RotateZ -/* 0232C 80A718DC 00000000 */ nop -/* 02330 80A718E0 44807000 */ mtc1 $zero, $f14 ## $f14 = 0.00 -/* 02334 80A718E4 3C01C4AF */ lui $at, 0xC4AF ## $at = C4AF0000 -/* 02338 80A718E8 44816000 */ mtc1 $at, $f12 ## $f12 = -1400.00 -/* 0233C 80A718EC 44067000 */ mfc1 $a2, $f14 -/* 02340 80A718F0 0C034261 */ jal Matrix_Translate -/* 02344 80A718F4 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -/* 02348 80A718F8 8FAA006C */ lw $t2, 0x006C($sp) -/* 0234C 80A718FC 8FA9005C */ lw $t1, 0x005C($sp) -.L80A71900: -/* 02350 80A71900 24010008 */ addiu $at, $zero, 0x0008 ## $at = 00000008 -/* 02354 80A71904 55210024 */ bnel $t1, $at, .L80A71998 -/* 02358 80A71908 24010008 */ addiu $at, $zero, 0x0008 ## $at = 00000008 -/* 0235C 80A7190C 894F01F6 */ lwl $t7, 0x01F6($t2) ## 000001F6 -/* 02360 80A71910 994F01F9 */ lwr $t7, 0x01F9($t2) ## 000001F9 -/* 02364 80A71914 27AD0048 */ addiu $t5, $sp, 0x0048 ## $t5 = FFFFFFF0 -/* 02368 80A71918 3C014700 */ lui $at, 0x4700 ## $at = 47000000 -/* 0236C 80A7191C ADAF0000 */ sw $t7, 0x0000($t5) ## FFFFFFF0 -/* 02370 80A71920 954F01FA */ lhu $t7, 0x01FA($t2) ## 000001FA -/* 02374 80A71924 44812000 */ mtc1 $at, $f4 ## $f4 = 32768.00 -/* 02378 80A71928 3C0180A7 */ lui $at, %hi(D_80A72A98) ## $at = 80A70000 -/* 0237C 80A7192C A5AF0004 */ sh $t7, 0x0004($t5) ## FFFFFFF4 -/* 02380 80A71930 87B9004A */ lh $t9, 0x004A($sp) -/* 02384 80A71934 C4282A98 */ lwc1 $f8, %lo(D_80A72A98)($at) -/* 02388 80A71938 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 0238C 80A7193C 0019C023 */ subu $t8, $zero, $t9 -/* 02390 80A71940 44988000 */ mtc1 $t8, $f16 ## $f16 = 0.00 -/* 02394 80A71944 00000000 */ nop -/* 02398 80A71948 468084A0 */ cvt.s.w $f18, $f16 -/* 0239C 80A7194C 46049183 */ div.s $f6, $f18, $f4 -/* 023A0 80A71950 46083302 */ mul.s $f12, $f6, $f8 -/* 023A4 80A71954 0C0342DC */ jal Matrix_RotateX -/* 023A8 80A71958 00000000 */ nop -/* 023AC 80A7195C 87AD0048 */ lh $t5, 0x0048($sp) -/* 023B0 80A71960 3C014700 */ lui $at, 0x4700 ## $at = 47000000 -/* 023B4 80A71964 44819000 */ mtc1 $at, $f18 ## $f18 = 32768.00 -/* 023B8 80A71968 448D5000 */ mtc1 $t5, $f10 ## $f10 = 0.00 -/* 023BC 80A7196C 3C0180A7 */ lui $at, %hi(D_80A72A9C) ## $at = 80A70000 -/* 023C0 80A71970 C4262A9C */ lwc1 $f6, %lo(D_80A72A9C)($at) -/* 023C4 80A71974 46805420 */ cvt.s.w $f16, $f10 -/* 023C8 80A71978 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 023CC 80A7197C 46128103 */ div.s $f4, $f16, $f18 -/* 023D0 80A71980 46062302 */ mul.s $f12, $f4, $f6 -/* 023D4 80A71984 0C0343B5 */ jal Matrix_RotateZ -/* 023D8 80A71988 00000000 */ nop -/* 023DC 80A7198C 8FAA006C */ lw $t2, 0x006C($sp) -/* 023E0 80A71990 8FA9005C */ lw $t1, 0x005C($sp) -/* 023E4 80A71994 24010008 */ addiu $at, $zero, 0x0008 ## $at = 00000008 -.L80A71998: -/* 023E8 80A71998 11210005 */ beq $t1, $at, .L80A719B0 -/* 023EC 80A7199C 00097040 */ sll $t6, $t1, 1 -/* 023F0 80A719A0 24010009 */ addiu $at, $zero, 0x0009 ## $at = 00000009 -/* 023F4 80A719A4 11210002 */ beq $t1, $at, .L80A719B0 -/* 023F8 80A719A8 2401000C */ addiu $at, $zero, 0x000C ## $at = 0000000C -/* 023FC 80A719AC 15210021 */ bne $t1, $at, .L80A71A34 -.L80A719B0: -/* 02400 80A719B0 014E1821 */ addu $v1, $t2, $t6 -/* 02404 80A719B4 8464021C */ lh $a0, 0x021C($v1) ## 0000021C -/* 02408 80A719B8 0C01DE1C */ jal Math_SinS - ## sins? -/* 0240C 80A719BC AFA3001C */ sw $v1, 0x001C($sp) -/* 02410 80A719C0 8FA20068 */ lw $v0, 0x0068($sp) -/* 02414 80A719C4 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 02418 80A719C8 44818000 */ mtc1 $at, $f16 ## $f16 = 200.00 -/* 0241C 80A719CC 844F0002 */ lh $t7, 0x0002($v0) ## 00000002 -/* 02420 80A719D0 8FA3001C */ lw $v1, 0x001C($sp) -/* 02424 80A719D4 46100482 */ mul.s $f18, $f0, $f16 -/* 02428 80A719D8 448F4000 */ mtc1 $t7, $f8 ## $f8 = 0.00 -/* 0242C 80A719DC 00000000 */ nop -/* 02430 80A719E0 468042A0 */ cvt.s.w $f10, $f8 -/* 02434 80A719E4 46125100 */ add.s $f4, $f10, $f18 -/* 02438 80A719E8 4600218D */ trunc.w.s $f6, $f4 -/* 0243C 80A719EC 44183000 */ mfc1 $t8, $f6 -/* 02440 80A719F0 00000000 */ nop -/* 02444 80A719F4 A4580002 */ sh $t8, 0x0002($v0) ## 00000002 -/* 02448 80A719F8 0C01DE0D */ jal Math_CosS - ## coss? -/* 0244C 80A719FC 8464023C */ lh $a0, 0x023C($v1) ## 0000023C -/* 02450 80A71A00 8FA20068 */ lw $v0, 0x0068($sp) -/* 02454 80A71A04 3C014348 */ lui $at, 0x4348 ## $at = 43480000 -/* 02458 80A71A08 44815000 */ mtc1 $at, $f10 ## $f10 = 200.00 -/* 0245C 80A71A0C 844D0004 */ lh $t5, 0x0004($v0) ## 00000004 -/* 02460 80A71A10 460A0482 */ mul.s $f18, $f0, $f10 -/* 02464 80A71A14 448D4000 */ mtc1 $t5, $f8 ## $f8 = 0.00 -/* 02468 80A71A18 00000000 */ nop -/* 0246C 80A71A1C 46804420 */ cvt.s.w $f16, $f8 -/* 02470 80A71A20 46128100 */ add.s $f4, $f16, $f18 -/* 02474 80A71A24 4600218D */ trunc.w.s $f6, $f4 -/* 02478 80A71A28 440F3000 */ mfc1 $t7, $f6 -/* 0247C 80A71A2C 00000000 */ nop -/* 02480 80A71A30 A44F0004 */ sh $t7, 0x0004($v0) ## 00000004 -.L80A71A34: -/* 02484 80A71A34 8FB90058 */ lw $t9, 0x0058($sp) -/* 02488 80A71A38 3C0680A7 */ lui $a2, %hi(D_80A72820) ## $a2 = 80A70000 -/* 0248C 80A71A3C 24C62820 */ addiu $a2, $a2, %lo(D_80A72820) ## $a2 = 80A72820 -/* 02490 80A71A40 27A4002C */ addiu $a0, $sp, 0x002C ## $a0 = FFFFFFD4 -/* 02494 80A71A44 240708B4 */ addiu $a3, $zero, 0x08B4 ## $a3 = 000008B4 -/* 02498 80A71A48 0C031AD5 */ jal Graph_CloseDisps -/* 0249C 80A71A4C 8F250000 */ lw $a1, 0x0000($t9) ## 00000000 -/* 024A0 80A71A50 8FBF0014 */ lw $ra, 0x0014($sp) -/* 024A4 80A71A54 27BD0058 */ addiu $sp, $sp, 0x0058 ## $sp = 00000000 -/* 024A8 80A71A58 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -/* 024AC 80A71A5C 03E00008 */ jr $ra -/* 024B0 80A71A60 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71A64.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71A64.s deleted file mode 100644 index e482fc4e70..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71A64.s +++ /dev/null @@ -1,100 +0,0 @@ -.rdata -glabel D_80A72830 - .asciz "../z_en_hy.c" - .balign 4 - -glabel D_80A72840 - .asciz "../z_en_hy.c" - .balign 4 - -.text -glabel func_80A71A64 -/* 024B4 80A71A64 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 024B8 80A71A68 3C0F80A7 */ lui $t7, %hi(D_80A72800) ## $t7 = 80A70000 -/* 024BC 80A71A6C AFBF0014 */ sw $ra, 0x0014($sp) -/* 024C0 80A71A70 AFA40050 */ sw $a0, 0x0050($sp) -/* 024C4 80A71A74 AFA50054 */ sw $a1, 0x0054($sp) -/* 024C8 80A71A78 AFA60058 */ sw $a2, 0x0058($sp) -/* 024CC 80A71A7C AFA7005C */ sw $a3, 0x005C($sp) -/* 024D0 80A71A80 25EF2800 */ addiu $t7, $t7, %lo(D_80A72800) ## $t7 = 80A72800 -/* 024D4 80A71A84 8DF90000 */ lw $t9, 0x0000($t7) ## 80A72800 -/* 024D8 80A71A88 27AE003C */ addiu $t6, $sp, 0x003C ## $t6 = FFFFFFEC -/* 024DC 80A71A8C 8DF80004 */ lw $t8, 0x0004($t7) ## 80A72804 -/* 024E0 80A71A90 ADD90000 */ sw $t9, 0x0000($t6) ## FFFFFFEC -/* 024E4 80A71A94 8DF90008 */ lw $t9, 0x0008($t7) ## 80A72808 -/* 024E8 80A71A98 ADD80004 */ sw $t8, 0x0004($t6) ## FFFFFFF0 -/* 024EC 80A71A9C 3C0680A7 */ lui $a2, %hi(D_80A72830) ## $a2 = 80A70000 -/* 024F0 80A71AA0 ADD90008 */ sw $t9, 0x0008($t6) ## FFFFFFF4 -/* 024F4 80A71AA4 8FAA0050 */ lw $t2, 0x0050($sp) -/* 024F8 80A71AA8 24C62830 */ addiu $a2, $a2, %lo(D_80A72830) ## $a2 = 80A72830 -/* 024FC 80A71AAC 240708CF */ addiu $a3, $zero, 0x08CF ## $a3 = 000008CF -/* 02500 80A71AB0 8D450000 */ lw $a1, 0x0000($t2) ## 00000000 -/* 02504 80A71AB4 27A40028 */ addiu $a0, $sp, 0x0028 ## $a0 = FFFFFFD8 -/* 02508 80A71AB8 0C031AB1 */ jal Graph_OpenDisps -/* 0250C 80A71ABC AFA50038 */ sw $a1, 0x0038($sp) -/* 02510 80A71AC0 8FA40054 */ lw $a0, 0x0054($sp) -/* 02514 80A71AC4 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 -/* 02518 80A71AC8 8FA80038 */ lw $t0, 0x0038($sp) -/* 0251C 80A71ACC 1481001B */ bne $a0, $at, .L80A71B3C -/* 02520 80A71AD0 8FA90050 */ lw $t1, 0x0050($sp) -/* 02524 80A71AD4 8D0302C0 */ lw $v1, 0x02C0($t0) ## 000002C0 -/* 02528 80A71AD8 8FA60060 */ lw $a2, 0x0060($sp) -/* 0252C 80A71ADC 3C0CDB06 */ lui $t4, 0xDB06 ## $t4 = DB060000 -/* 02530 80A71AE0 246B0008 */ addiu $t3, $v1, 0x0008 ## $t3 = 00000008 -/* 02534 80A71AE4 AD0B02C0 */ sw $t3, 0x02C0($t0) ## 000002C0 -/* 02538 80A71AE8 358C0018 */ ori $t4, $t4, 0x0018 ## $t4 = DB060018 -/* 0253C 80A71AEC AC6C0000 */ sw $t4, 0x0000($v1) ## 00000000 -/* 02540 80A71AF0 80CD0197 */ lb $t5, 0x0197($a2) ## 00000197 -/* 02544 80A71AF4 24050044 */ addiu $a1, $zero, 0x0044 ## $a1 = 00000044 -/* 02548 80A71AF8 3C070001 */ lui $a3, 0x0001 ## $a3 = 00010000 -/* 0254C 80A71AFC 01A50019 */ multu $t5, $a1 -/* 02550 80A71B00 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 02554 80A71B04 00007012 */ mflo $t6 -/* 02558 80A71B08 012E7821 */ addu $t7, $t1, $t6 -/* 0255C 80A71B0C 01E7C021 */ addu $t8, $t7, $a3 -/* 02560 80A71B10 8F1917B4 */ lw $t9, 0x17B4($t8) ## 000017B4 -/* 02564 80A71B14 AC790004 */ sw $t9, 0x0004($v1) ## 00000004 -/* 02568 80A71B18 80CA0197 */ lb $t2, 0x0197($a2) ## 00000197 -/* 0256C 80A71B1C 01450019 */ multu $t2, $a1 -/* 02570 80A71B20 00005812 */ mflo $t3 -/* 02574 80A71B24 012B6021 */ addu $t4, $t1, $t3 -/* 02578 80A71B28 01876821 */ addu $t5, $t4, $a3 -/* 0257C 80A71B2C 8DAE17B4 */ lw $t6, 0x17B4($t5) ## 000017B4 -/* 02580 80A71B30 01C17821 */ addu $t7, $t6, $at -/* 02584 80A71B34 3C018016 */ lui $at, %hi(gSegments+0x18) -/* 02588 80A71B38 AC2F6FC0 */ sw $t7, %lo(gSegments+0x18)($at) -.L80A71B3C: -/* 0258C 80A71B3C 8FA60060 */ lw $a2, 0x0060($sp) -/* 02590 80A71B40 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 02594 80A71B44 84D8001C */ lh $t8, 0x001C($a2) ## 0000001C -/* 02598 80A71B48 24C50038 */ addiu $a1, $a2, 0x0038 ## $a1 = 00000038 -/* 0259C 80A71B4C 3319007F */ andi $t9, $t8, 0x007F ## $t9 = 00000000 -/* 025A0 80A71B50 1721000A */ bne $t9, $at, .L80A71B7C -/* 025A4 80A71B54 24010008 */ addiu $at, $zero, 0x0008 ## $at = 00000008 -/* 025A8 80A71B58 14810008 */ bne $a0, $at, .L80A71B7C -/* 025AC 80A71B5C 3C0BDE00 */ lui $t3, 0xDE00 ## $t3 = DE000000 -/* 025B0 80A71B60 8D0302C0 */ lw $v1, 0x02C0($t0) ## 000002C0 -/* 025B4 80A71B64 3C0C0600 */ lui $t4, %hi(D_06005BC8) ## $t4 = 06000000 -/* 025B8 80A71B68 258C5BC8 */ addiu $t4, $t4, %lo(D_06005BC8) ## $t4 = 06005BC8 -/* 025BC 80A71B6C 246A0008 */ addiu $t2, $v1, 0x0008 ## $t2 = 00000008 -/* 025C0 80A71B70 AD0A02C0 */ sw $t2, 0x02C0($t0) ## 000002C0 -/* 025C4 80A71B74 AC6C0004 */ sw $t4, 0x0004($v1) ## 00000004 -/* 025C8 80A71B78 AC6B0000 */ sw $t3, 0x0000($v1) ## 00000000 -.L80A71B7C: -/* 025CC 80A71B7C 2401000F */ addiu $at, $zero, 0x000F ## $at = 0000000F -/* 025D0 80A71B80 14810004 */ bne $a0, $at, .L80A71B94 -/* 025D4 80A71B84 00000000 */ nop -/* 025D8 80A71B88 0C0346BD */ jal Matrix_MultVec3f -/* 025DC 80A71B8C 27A4003C */ addiu $a0, $sp, 0x003C ## $a0 = FFFFFFEC -/* 025E0 80A71B90 8FA90050 */ lw $t1, 0x0050($sp) -.L80A71B94: -/* 025E4 80A71B94 3C0680A7 */ lui $a2, %hi(D_80A72840) ## $a2 = 80A70000 -/* 025E8 80A71B98 24C62840 */ addiu $a2, $a2, %lo(D_80A72840) ## $a2 = 80A72840 -/* 025EC 80A71B9C 27A40028 */ addiu $a0, $sp, 0x0028 ## $a0 = FFFFFFD8 -/* 025F0 80A71BA0 8D250000 */ lw $a1, 0x0000($t1) ## 00000000 -/* 025F4 80A71BA4 0C031AD5 */ jal Graph_CloseDisps -/* 025F8 80A71BA8 240708E9 */ addiu $a3, $zero, 0x08E9 ## $a3 = 000008E9 -/* 025FC 80A71BAC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 02600 80A71BB0 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 -/* 02604 80A71BB4 03E00008 */ jr $ra -/* 02608 80A71BB8 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71BBC.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71BBC.s deleted file mode 100644 index ad1f705f79..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71BBC.s +++ /dev/null @@ -1,29 +0,0 @@ -glabel func_80A71BBC -/* 0260C 80A71BBC 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 -/* 02610 80A71BC0 AFBF0014 */ sw $ra, 0x0014($sp) -/* 02614 80A71BC4 AFA5001C */ sw $a1, 0x001C($sp) -/* 02618 80A71BC8 AFA60020 */ sw $a2, 0x0020($sp) -/* 0261C 80A71BCC AFA70024 */ sw $a3, 0x0024($sp) -/* 02620 80A71BD0 0C031A73 */ jal Graph_Alloc - -/* 02624 80A71BD4 24050010 */ addiu $a1, $zero, 0x0010 ## $a1 = 00000010 -/* 02628 80A71BD8 3C0EFB00 */ lui $t6, 0xFB00 ## $t6 = FB000000 -/* 0262C 80A71BDC AC4E0000 */ sw $t6, 0x0000($v0) ## 00000000 -/* 02630 80A71BE0 93A90023 */ lbu $t1, 0x0023($sp) -/* 02634 80A71BE4 93B8001F */ lbu $t8, 0x001F($sp) -/* 02638 80A71BE8 93AD0027 */ lbu $t5, 0x0027($sp) -/* 0263C 80A71BEC 93A8002B */ lbu $t0, 0x002B($sp) -/* 02640 80A71BF0 00095400 */ sll $t2, $t1, 16 -/* 02644 80A71BF4 0018CE00 */ sll $t9, $t8, 24 -/* 02648 80A71BF8 032A5825 */ or $t3, $t9, $t2 ## $t3 = 00000000 -/* 0264C 80A71BFC 000D7200 */ sll $t6, $t5, 8 -/* 02650 80A71C00 016E7825 */ or $t7, $t3, $t6 ## $t7 = FB000000 -/* 02654 80A71C04 3C19DF00 */ lui $t9, 0xDF00 ## $t9 = DF000000 -/* 02658 80A71C08 01E84825 */ or $t1, $t7, $t0 ## $t1 = FB000000 -/* 0265C 80A71C0C AC490004 */ sw $t1, 0x0004($v0) ## 00000004 -/* 02660 80A71C10 AC590008 */ sw $t9, 0x0008($v0) ## 00000008 -/* 02664 80A71C14 AC40000C */ sw $zero, 0x000C($v0) ## 0000000C -/* 02668 80A71C18 8FBF0014 */ lw $ra, 0x0014($sp) -/* 0266C 80A71C1C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 -/* 02670 80A71C20 03E00008 */ jr $ra -/* 02674 80A71C24 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s b/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s index cf4317833b..f8a69671ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s @@ -43,7 +43,7 @@ glabel func_80A87C30 /* 004C8 80A87CC8 02212821 */ addu $a1, $s1, $at /* 004CC 80A87CCC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 004D0 80A87CD0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 004D4 80A87CD4 260602B0 */ addiu $a2, $s0, 0x02B0 ## $a2 = 000002B0 /* 004D8 80A87CD8 8FBF001C */ lw $ra, 0x001C($sp) /* 004DC 80A87CDC 8FB00014 */ lw $s0, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s b/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s index 30440605e7..4ca67d8b67 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s @@ -99,7 +99,7 @@ glabel func_80A89860 /* 00228 80A899C8 E62A002C */ swc1 $f10, 0x002C($s1) ## 0000002C /* 0022C 80A899CC AFAB0014 */ sw $t3, 0x0014($sp) /* 00230 80A899D0 E7B40010 */ swc1 $f20, 0x0010($sp) -/* 00234 80A899D4 0C00B92D */ jal func_8002E4B4 +/* 00234 80A899D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00238 80A899D8 8FA40084 */ lw $a0, 0x0084($sp) /* 0023C 80A899DC C6300080 */ lwc1 $f16, 0x0080($s1) ## 00000080 /* 00240 80A899E0 27AD0068 */ addiu $t5, $sp, 0x0068 ## $t5 = FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s index 7e8b4b6e44..b17d9e778c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s @@ -60,7 +60,7 @@ glabel EnKo_Update /* 02A24 80A997D4 44060000 */ mfc1 $a2, $f0 /* 02A28 80A997D8 44070000 */ mfc1 $a3, $f0 /* 02A2C 80A997DC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02A30 80A997E0 0C00B92D */ jal func_8002E4B4 +/* 02A30 80A997E0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02A34 80A997E4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02A38 80A997E8 3C01BF80 */ lui $at, 0xBF80 ## $at = BF800000 /* 02A3C 80A997EC 44814000 */ mtc1 $at, $f8 ## $f8 = -1.00 @@ -82,7 +82,7 @@ glabel EnKo_Update /* 02A74 80A99824 26060198 */ addiu $a2, $s0, 0x0198 ## $a2 = 00000198 /* 02A78 80A99828 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000198 /* 02A7C 80A9982C AFA60028 */ sw $a2, 0x0028($sp) -/* 02A80 80A99830 0C0189B7 */ jal Collider_CylinderUpdate +/* 02A80 80A99830 0C0189B7 */ jal Collider_UpdateCylinder /* 02A84 80A99834 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02A88 80A99838 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -90,7 +90,7 @@ glabel EnKo_Update /* 02A90 80A99840 8FA60028 */ lw $a2, 0x0028($sp) /* 02A94 80A99844 02212821 */ addu $a1, $s1, $at /* 02A98 80A99848 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02A9C 80A9984C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02AA0 80A99850 8FBF0024 */ lw $ra, 0x0024($sp) /* 02AA4 80A99854 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s index c506d6978c..c9aa471b93 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s @@ -59,8 +59,8 @@ glabel func_80A99048 /* 02364 80A99114 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02368 80A99118 0C0291BE */ jal SkelAnime_InitFlex /* 0236C 80A9911C 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 02370 80A99120 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 02374 80A99124 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 02370 80A99120 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 02374 80A99124 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 02378 80A99128 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0237C 80A9912C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02380 80A99130 0C00AC78 */ jal ActorShape_Init @@ -93,7 +93,7 @@ glabel func_80A99048 /* 023E0 80A99190 3C0680AA */ lui $a2, %hi(D_80A9A12C) ## $a2 = 80AA0000 /* 023E4 80A99194 24C6A12C */ addiu $a2, $a2, %lo(D_80A9A12C) ## $a2 = 80A9A12C /* 023E8 80A99198 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 023EC 80A9919C 0C0187BF */ jal func_80061EFC +/* 023EC 80A9919C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 023F0 80A991A0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 023F4 80A991A4 860F001C */ lh $t7, 0x001C($s0) ## 0000001C /* 023F8 80A991A8 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Destroy.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Destroy.s deleted file mode 100644 index c77361ea46..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Destroy.s +++ /dev/null @@ -1,31 +0,0 @@ -glabel EnMThunder_Destroy -/* 002C8 80A9F2A8 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 002CC 80A9F2AC AFBF001C */ sw $ra, 0x001C($sp) -/* 002D0 80A9F2B0 AFB00018 */ sw $s0, 0x0018($sp) -/* 002D4 80A9F2B4 AFA40020 */ sw $a0, 0x0020($sp) -/* 002D8 80A9F2B8 908F01CA */ lbu $t7, 0x01CA($a0) ## 000001CA -/* 002DC 80A9F2BC 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 -/* 002E0 80A9F2C0 51E00004 */ beql $t7, $zero, .L80A9F2D4 -/* 002E4 80A9F2C4 8FA50020 */ lw $a1, 0x0020($sp) -/* 002E8 80A9F2C8 0C021DB2 */ jal func_800876C8 -/* 002EC 80A9F2CC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 002F0 80A9F2D0 8FA50020 */ lw $a1, 0x0020($sp) -.L80A9F2D4: -/* 002F4 80A9F2D4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 002F8 80A9F2D8 0C0170EB */ jal Collider_DestroyCylinder - -/* 002FC 80A9F2DC 24A5014C */ addiu $a1, $a1, 0x014C ## $a1 = 0000014C -/* 00300 80A9F2E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00304 80A9F2E4 0C2A7CC5 */ jal func_80A9F314 -/* 00308 80A9F2E8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 0030C 80A9F2EC 8FB80020 */ lw $t8, 0x0020($sp) -/* 00310 80A9F2F0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00314 80A9F2F4 260507A8 */ addiu $a1, $s0, 0x07A8 ## $a1 = 000007A8 -/* 00318 80A9F2F8 0C01E9F1 */ jal LightContext_RemoveLight - -/* 0031C 80A9F2FC 8F060198 */ lw $a2, 0x0198($t8) ## 00000198 -/* 00320 80A9F300 8FBF001C */ lw $ra, 0x001C($sp) -/* 00324 80A9F304 8FB00018 */ lw $s0, 0x0018($sp) -/* 00328 80A9F308 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 0032C 80A9F30C 03E00008 */ jr $ra -/* 00330 80A9F310 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Init.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Init.s deleted file mode 100644 index aa0018db99..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Init.s +++ /dev/null @@ -1,193 +0,0 @@ -glabel EnMThunder_Init -/* 00008 80A9EFE8 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 0000C 80A9EFEC AFB00024 */ sw $s0, 0x0024($sp) -/* 00010 80A9EFF0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00014 80A9EFF4 AFBF002C */ sw $ra, 0x002C($sp) -/* 00018 80A9EFF8 AFB10028 */ sw $s1, 0x0028($sp) -/* 0001C 80A9EFFC 00A03025 */ or $a2, $a1, $zero ## $a2 = 00000000 -/* 00020 80A9F000 8CB11C44 */ lw $s1, 0x1C44($a1) ## 00001C44 -/* 00024 80A9F004 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 00028 80A9F008 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 0002C 80A9F00C AFA50030 */ sw $a1, 0x0030($sp) -/* 00030 80A9F010 0C0170D9 */ jal Collider_InitCylinder - -/* 00034 80A9F014 AFA60044 */ sw $a2, 0x0044($sp) -/* 00038 80A9F018 3C0780AA */ lui $a3, %hi(D_80AA0420) ## $a3 = 80AA0000 -/* 0003C 80A9F01C 8FA50030 */ lw $a1, 0x0030($sp) -/* 00040 80A9F020 24E70420 */ addiu $a3, $a3, %lo(D_80AA0420) ## $a3 = 80AA0420 -/* 00044 80A9F024 8FA40044 */ lw $a0, 0x0044($sp) -/* 00048 80A9F028 0C01712B */ jal Collider_SetCylinder - -/* 0004C 80A9F02C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00050 80A9F030 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 00054 80A9F034 C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 00058 80A9F038 C610002C */ lwc1 $f16, 0x002C($s0) ## 0000002C -/* 0005C 80A9F03C 4600218D */ trunc.w.s $f6, $f4 -/* 00060 80A9F040 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 00064 80A9F044 2604019C */ addiu $a0, $s0, 0x019C ## $a0 = 0000019C -/* 00068 80A9F048 4600428D */ trunc.w.s $f10, $f8 -/* 0006C 80A9F04C 25F8FFFF */ addiu $t8, $t7, 0xFFFF ## $t8 = FFFFFFFF -/* 00070 80A9F050 44053000 */ mfc1 $a1, $f6 -/* 00074 80A9F054 4600848D */ trunc.w.s $f18, $f16 -/* 00078 80A9F058 44065000 */ mfc1 $a2, $f10 -/* 0007C 80A9F05C A21801C7 */ sb $t8, 0x01C7($s0) ## 000001C7 -/* 00080 80A9F060 240A00FF */ addiu $t2, $zero, 0x00FF ## $t2 = 000000FF -/* 00084 80A9F064 44079000 */ mfc1 $a3, $f18 -/* 00088 80A9F068 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF -/* 0008C 80A9F06C 240C00FF */ addiu $t4, $zero, 0x00FF ## $t4 = 000000FF -/* 00090 80A9F070 00052C00 */ sll $a1, $a1, 16 -/* 00094 80A9F074 00063400 */ sll $a2, $a2, 16 -/* 00098 80A9F078 00073C00 */ sll $a3, $a3, 16 -/* 0009C 80A9F07C 00073C03 */ sra $a3, $a3, 16 -/* 000A0 80A9F080 00063403 */ sra $a2, $a2, 16 -/* 000A4 80A9F084 00052C03 */ sra $a1, $a1, 16 -/* 000A8 80A9F088 AFAC0018 */ sw $t4, 0x0018($sp) -/* 000AC 80A9F08C AFAB0014 */ sw $t3, 0x0014($sp) -/* 000B0 80A9F090 AFAA0010 */ sw $t2, 0x0010($sp) -/* 000B4 80A9F094 AFA40030 */ sw $a0, 0x0030($sp) -/* 000B8 80A9F098 0C01E763 */ jal Lights_PointNoGlowSetInfo - -/* 000BC 80A9F09C AFA0001C */ sw $zero, 0x001C($sp) -/* 000C0 80A9F0A0 8FA40044 */ lw $a0, 0x0044($sp) -/* 000C4 80A9F0A4 8FA60030 */ lw $a2, 0x0030($sp) -/* 000C8 80A9F0A8 0C01E9D9 */ jal LightContext_InsertLight - -/* 000CC 80A9F0AC 248507A8 */ addiu $a1, $a0, 0x07A8 ## $a1 = 000007A8 -/* 000D0 80A9F0B0 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 000D4 80A9F0B4 240D0028 */ addiu $t5, $zero, 0x0028 ## $t5 = 00000028 -/* 000D8 80A9F0B8 240EFFEC */ addiu $t6, $zero, 0xFFEC ## $t6 = FFFFFFEC -/* 000DC 80A9F0BC 240F0008 */ addiu $t7, $zero, 0x0008 ## $t7 = 00000008 -/* 000E0 80A9F0C0 AE020198 */ sw $v0, 0x0198($s0) ## 00000198 -/* 000E4 80A9F0C4 A600018C */ sh $zero, 0x018C($s0) ## 0000018C -/* 000E8 80A9F0C8 A60D018E */ sh $t5, 0x018E($s0) ## 0000018E -/* 000EC 80A9F0CC A60E0190 */ sh $t6, 0x0190($s0) ## 00000190 -/* 000F0 80A9F0D0 A60F01C4 */ sh $t7, 0x01C4($s0) ## 000001C4 -/* 000F4 80A9F0D4 E60001B4 */ swc1 $f0, 0x01B4($s0) ## 000001B4 -/* 000F8 80A9F0D8 8E390908 */ lw $t9, 0x0908($s1) ## 00000908 -/* 000FC 80A9F0DC 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 -/* 00100 80A9F0E0 240AFFFF */ addiu $t2, $zero, 0xFFFF ## $t2 = FFFFFFFF -/* 00104 80A9F0E4 AE190024 */ sw $t9, 0x0024($s0) ## 00000024 -/* 00108 80A9F0E8 8E38090C */ lw $t8, 0x090C($s1) ## 0000090C -/* 0010C 80A9F0EC 3C053DCC */ lui $a1, 0x3DCC ## $a1 = 3DCC0000 -/* 00110 80A9F0F0 34A5CCCD */ ori $a1, $a1, 0xCCCD ## $a1 = 3DCCCCCD -/* 00114 80A9F0F4 AE180028 */ sw $t8, 0x0028($s0) ## 00000028 -/* 00118 80A9F0F8 8E390910 */ lw $t9, 0x0910($s1) ## 00000910 -/* 0011C 80A9F0FC E60001AC */ swc1 $f0, 0x01AC($s0) ## 000001AC -/* 00120 80A9F100 E60001BC */ swc1 $f0, 0x01BC($s0) ## 000001BC -/* 00124 80A9F104 AE19002C */ sw $t9, 0x002C($s0) ## 0000002C -/* 00128 80A9F108 862800B6 */ lh $t0, 0x00B6($s1) ## 000000B6 -/* 0012C 80A9F10C A20A0003 */ sb $t2, 0x0003($s0) ## 00000003 -/* 00130 80A9F110 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00134 80A9F114 01014821 */ addu $t1, $t0, $at -/* 00138 80A9F118 0C00B58B */ jal Actor_SetScale - -/* 0013C 80A9F11C A60900B6 */ sh $t1, 0x00B6($s0) ## 000000B6 -/* 00140 80A9F120 A20001CA */ sb $zero, 0x01CA($s0) ## 000001CA -/* 00144 80A9F124 8E2B0680 */ lw $t3, 0x0680($s1) ## 00000680 -/* 00148 80A9F128 3C028016 */ lui $v0, %hi(gSaveContext) -/* 0014C 80A9F12C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00150 80A9F130 000B6380 */ sll $t4, $t3, 14 -/* 00154 80A9F134 05810054 */ bgez $t4, .L80A9F288 -/* 00158 80A9F138 3C0580AA */ lui $a1, %hi(func_80A9F408) ## $a1 = 80AA0000 -/* 0015C 80A9F13C 2442E660 */ addiu $v0, %lo(gSaveContext) -/* 00160 80A9F140 904D003A */ lbu $t5, 0x003A($v0) ## 8015E69A -/* 00164 80A9F144 11A0000E */ beq $t5, $zero, .L80A9F180 -/* 00168 80A9F148 00000000 */ nop -/* 0016C 80A9F14C 844E13F0 */ lh $t6, 0x13F0($v0) ## 8015FA50 -/* 00170 80A9F150 15C0000B */ bne $t6, $zero, .L80A9F180 -/* 00174 80A9F154 00000000 */ nop -/* 00178 80A9F158 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 0017C 80A9F15C 8FA40044 */ lw $a0, 0x0044($sp) -/* 00180 80A9F160 00003025 */ or $a2, $zero, $zero ## $a2 = 00000000 -/* 00184 80A9F164 3042FF00 */ andi $v0, $v0, 0xFF00 ## $v0 = 0000E600 -/* 00188 80A9F168 00021203 */ sra $v0, $v0, 8 -/* 0018C 80A9F16C 1040001D */ beq $v0, $zero, .L80A9F1E4 -/* 00190 80A9F170 00022C00 */ sll $a1, $v0, 16 -/* 00194 80A9F174 0C021DC2 */ jal func_80087708 -/* 00198 80A9F178 00052C03 */ sra $a1, $a1, 16 -/* 0019C 80A9F17C 14400019 */ bne $v0, $zero, .L80A9F1E4 -.L80A9F180: -/* 001A0 80A9F180 3C078013 */ lui $a3, %hi(D_801333E0) -/* 001A4 80A9F184 3C0F8013 */ lui $t7, %hi(D_801333E8) -/* 001A8 80A9F188 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 001AC 80A9F18C 25EF33E8 */ addiu $t7, %lo(D_801333E8) -/* 001B0 80A9F190 262500E4 */ addiu $a1, $s1, 0x00E4 ## $a1 = 000000E4 -/* 001B4 80A9F194 AFA50030 */ sw $a1, 0x0030($sp) -/* 001B8 80A9F198 AFAF0014 */ sw $t7, 0x0014($sp) -/* 001BC 80A9F19C AFA70010 */ sw $a3, 0x0010($sp) -/* 001C0 80A9F1A0 24041823 */ addiu $a0, $zero, 0x1823 ## $a0 = 00001823 -/* 001C4 80A9F1A4 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 001C8 80A9F1A8 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 001CC 80A9F1AC 3C078013 */ lui $a3, %hi(D_801333E0) -/* 001D0 80A9F1B0 3C188013 */ lui $t8, %hi(D_801333E8) -/* 001D4 80A9F1B4 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 001D8 80A9F1B8 271833E8 */ addiu $t8, %lo(D_801333E8) -/* 001DC 80A9F1BC 8FA50030 */ lw $a1, 0x0030($sp) -/* 001E0 80A9F1C0 AFB80014 */ sw $t8, 0x0014($sp) -/* 001E4 80A9F1C4 AFA70010 */ sw $a3, 0x0010($sp) -/* 001E8 80A9F1C8 24041818 */ addiu $a0, $zero, 0x1818 ## $a0 = 00001818 -/* 001EC 80A9F1CC 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 001F0 80A9F1D0 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 001F4 80A9F1D4 0C00B55C */ jal Actor_Kill - -/* 001F8 80A9F1D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001FC 80A9F1DC 1000002E */ beq $zero, $zero, .L80A9F298 -/* 00200 80A9F1E0 8FBF002C */ lw $ra, 0x002C($sp) -.L80A9F1E4: -/* 00204 80A9F1E4 8E390680 */ lw $t9, 0x0680($s1) ## 00000680 -/* 00208 80A9F1E8 3C01FFFD */ lui $at, 0xFFFD ## $at = FFFD0000 -/* 0020C 80A9F1EC 3421FFFF */ ori $at, $at, 0xFFFF ## $at = FFFDFFFF -/* 00210 80A9F1F0 03214024 */ and $t0, $t9, $at -/* 00214 80A9F1F4 AE280680 */ sw $t0, 0x0680($s1) ## 00000680 -/* 00218 80A9F1F8 920201C7 */ lbu $v0, 0x01C7($s0) ## 000001C7 -/* 0021C 80A9F1FC 24030001 */ addiu $v1, $zero, 0x0001 ## $v1 = 00000001 -/* 00220 80A9F200 3C0A80AA */ lui $t2, %hi(D_80AA044C) ## $t2 = 80AA0000 -/* 00224 80A9F204 00024880 */ sll $t1, $v0, 2 -/* 00228 80A9F208 A20301CA */ sb $v1, 0x01CA($s0) ## 000001CA -/* 0022C 80A9F20C 01495021 */ addu $t2, $t2, $t1 -/* 00230 80A9F210 8D4A044C */ lw $t2, %lo(D_80AA044C)($t2) -/* 00234 80A9F214 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 00238 80A9F218 A20301C6 */ sb $v1, 0x01C6($s0) ## 000001C6 -/* 0023C 80A9F21C 14410004 */ bne $v0, $at, .L80A9F230 -/* 00240 80A9F220 AE0A0164 */ sw $t2, 0x0164($s0) ## 00000164 -/* 00244 80A9F224 240B0002 */ addiu $t3, $zero, 0x0002 ## $t3 = 00000002 -/* 00248 80A9F228 10000003 */ beq $zero, $zero, .L80A9F238 -/* 0024C 80A9F22C A20B01C9 */ sb $t3, 0x01C9($s0) ## 000001C9 -.L80A9F230: -/* 00250 80A9F230 240C0004 */ addiu $t4, $zero, 0x0004 ## $t4 = 00000004 -/* 00254 80A9F234 A20C01C9 */ sb $t4, 0x01C9($s0) ## 000001C9 -.L80A9F238: -/* 00258 80A9F238 3C0580AA */ lui $a1, %hi(func_80A9F9B4) ## $a1 = 80AA0000 -/* 0025C 80A9F23C 24A5F9B4 */ addiu $a1, $a1, %lo(func_80A9F9B4) ## $a1 = 80A9F9B4 -/* 00260 80A9F240 0C2A7BF8 */ jal func_80A9EFE0 -/* 00264 80A9F244 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00268 80A9F248 3C078013 */ lui $a3, %hi(D_801333E0) -/* 0026C 80A9F24C 240D0008 */ addiu $t5, $zero, 0x0008 ## $t5 = 00000008 -/* 00270 80A9F250 3C0E8013 */ lui $t6, %hi(D_801333E8) -/* 00274 80A9F254 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 00278 80A9F258 A60D01C4 */ sh $t5, 0x01C4($s0) ## 000001C4 -/* 0027C 80A9F25C 25CE33E8 */ addiu $t6, %lo(D_801333E8) -/* 00280 80A9F260 AFAE0014 */ sw $t6, 0x0014($sp) -/* 00284 80A9F264 AFA70010 */ sw $a3, 0x0010($sp) -/* 00288 80A9F268 2404182E */ addiu $a0, $zero, 0x182E ## $a0 = 0000182E -/* 0028C 80A9F26C 262500E4 */ addiu $a1, $s1, 0x00E4 ## $a1 = 000000E4 -/* 00290 80A9F270 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00294 80A9F274 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00298 80A9F278 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 0029C 80A9F27C 44812000 */ mtc1 $at, $f4 ## $f4 = 1.00 -/* 002A0 80A9F280 10000003 */ beq $zero, $zero, .L80A9F290 -/* 002A4 80A9F284 E60401AC */ swc1 $f4, 0x01AC($s0) ## 000001AC -.L80A9F288: -/* 002A8 80A9F288 0C2A7BF8 */ jal func_80A9EFE0 -/* 002AC 80A9F28C 24A5F408 */ addiu $a1, $a1, %lo(func_80A9F408) ## $a1 = FFFFF408 -.L80A9F290: -/* 002B0 80A9F290 AE00011C */ sw $zero, 0x011C($s0) ## 0000011C -/* 002B4 80A9F294 8FBF002C */ lw $ra, 0x002C($sp) -.L80A9F298: -/* 002B8 80A9F298 8FB00024 */ lw $s0, 0x0024($sp) -/* 002BC 80A9F29C 8FB10028 */ lw $s1, 0x0028($sp) -/* 002C0 80A9F2A0 03E00008 */ jr $ra -/* 002C4 80A9F2A4 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Update.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Update.s deleted file mode 100644 index 7e350f00ae..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Update.s +++ /dev/null @@ -1,123 +0,0 @@ -glabel EnMThunder_Update -/* 00B3C 80A9FB1C 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 00B40 80A9FB20 AFB00028 */ sw $s0, 0x0028($sp) -/* 00B44 80A9FB24 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00B48 80A9FB28 AFBF002C */ sw $ra, 0x002C($sp) -/* 00B4C 80A9FB2C AFA50034 */ sw $a1, 0x0034($sp) -/* 00B50 80A9FB30 8E1901C0 */ lw $t9, 0x01C0($s0) ## 000001C0 -/* 00B54 80A9FB34 0320F809 */ jalr $ra, $t9 -/* 00B58 80A9FB38 00000000 */ nop -/* 00B5C 80A9FB3C 8FA40034 */ lw $a0, 0x0034($sp) -/* 00B60 80A9FB40 0C2A7CC5 */ jal func_80A9F314 -/* 00B64 80A9FB44 8E0501BC */ lw $a1, 0x01BC($s0) ## 000001BC -/* 00B68 80A9FB48 C6040024 */ lwc1 $f4, 0x0024($s0) ## 00000024 -/* 00B6C 80A9FB4C 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 00B70 80A9FB50 C60001AC */ lwc1 $f0, 0x01AC($s0) ## 000001AC -/* 00B74 80A9FB54 4600218D */ trunc.w.s $f6, $f4 -/* 00B78 80A9FB58 44812000 */ mtc1 $at, $f4 ## $f4 = 255.00 -/* 00B7C 80A9FB5C C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 00B80 80A9FB60 C610002C */ lwc1 $f16, 0x002C($s0) ## 0000002C -/* 00B84 80A9FB64 44053000 */ mfc1 $a1, $f6 -/* 00B88 80A9FB68 46040182 */ mul.s $f6, $f0, $f4 -/* 00B8C 80A9FB6C 4600428D */ trunc.w.s $f10, $f8 -/* 00B90 80A9FB70 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 00B94 80A9FB74 00052C00 */ sll $a1, $a1, 16 -/* 00B98 80A9FB78 00052C03 */ sra $a1, $a1, 16 -/* 00B9C 80A9FB7C 44065000 */ mfc1 $a2, $f10 -/* 00BA0 80A9FB80 4600848D */ trunc.w.s $f18, $f16 -/* 00BA4 80A9FB84 3C014F00 */ lui $at, 0x4F00 ## $at = 4F000000 -/* 00BA8 80A9FB88 00063400 */ sll $a2, $a2, 16 -/* 00BAC 80A9FB8C 00063403 */ sra $a2, $a2, 16 -/* 00BB0 80A9FB90 4448F800 */ cfc1 $t0, $31 -/* 00BB4 80A9FB94 44C2F800 */ ctc1 $v0, $31 -/* 00BB8 80A9FB98 44079000 */ mfc1 $a3, $f18 -/* 00BBC 80A9FB9C 2604019C */ addiu $a0, $s0, 0x019C ## $a0 = 0000019C -/* 00BC0 80A9FBA0 46003224 */ cvt.w.s $f8, $f6 -/* 00BC4 80A9FBA4 00073C00 */ sll $a3, $a3, 16 -/* 00BC8 80A9FBA8 00073C03 */ sra $a3, $a3, 16 -/* 00BCC 80A9FBAC 4442F800 */ cfc1 $v0, $31 -/* 00BD0 80A9FBB0 00000000 */ nop -/* 00BD4 80A9FBB4 30420078 */ andi $v0, $v0, 0x0078 ## $v0 = 00000000 -/* 00BD8 80A9FBB8 50400013 */ beql $v0, $zero, .L80A9FC08 -/* 00BDC 80A9FBBC 44024000 */ mfc1 $v0, $f8 -/* 00BE0 80A9FBC0 44814000 */ mtc1 $at, $f8 ## $f8 = 2147483648.00 -/* 00BE4 80A9FBC4 24020001 */ addiu $v0, $zero, 0x0001 ## $v0 = 00000001 -/* 00BE8 80A9FBC8 46083201 */ sub.s $f8, $f6, $f8 -/* 00BEC 80A9FBCC 44C2F800 */ ctc1 $v0, $31 -/* 00BF0 80A9FBD0 00000000 */ nop -/* 00BF4 80A9FBD4 46004224 */ cvt.w.s $f8, $f8 -/* 00BF8 80A9FBD8 4442F800 */ cfc1 $v0, $31 -/* 00BFC 80A9FBDC 00000000 */ nop -/* 00C00 80A9FBE0 30420078 */ andi $v0, $v0, 0x0078 ## $v0 = 00000000 -/* 00C04 80A9FBE4 14400005 */ bne $v0, $zero, .L80A9FBFC -/* 00C08 80A9FBE8 00000000 */ nop -/* 00C0C 80A9FBEC 44024000 */ mfc1 $v0, $f8 -/* 00C10 80A9FBF0 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00C14 80A9FBF4 10000007 */ beq $zero, $zero, .L80A9FC14 -/* 00C18 80A9FBF8 00411025 */ or $v0, $v0, $at ## $v0 = 80000000 -.L80A9FBFC: -/* 00C1C 80A9FBFC 10000005 */ beq $zero, $zero, .L80A9FC14 -/* 00C20 80A9FC00 2402FFFF */ addiu $v0, $zero, 0xFFFF ## $v0 = FFFFFFFF -/* 00C24 80A9FC04 44024000 */ mfc1 $v0, $f8 -.L80A9FC08: -/* 00C28 80A9FC08 00000000 */ nop -/* 00C2C 80A9FC0C 0440FFFB */ bltz $v0, .L80A9FBFC -/* 00C30 80A9FC10 00000000 */ nop -.L80A9FC14: -/* 00C34 80A9FC14 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 00C38 80A9FC18 44C8F800 */ ctc1 $t0, $31 -/* 00C3C 80A9FC1C 44815000 */ mtc1 $at, $f10 ## $f10 = 100.00 -/* 00C40 80A9FC20 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00C44 80A9FC24 304200FF */ andi $v0, $v0, 0x00FF ## $v0 = 000000FF -/* 00C48 80A9FC28 460A0402 */ mul.s $f16, $f0, $f10 -/* 00C4C 80A9FC2C AFA20010 */ sw $v0, 0x0010($sp) -/* 00C50 80A9FC30 AFA20014 */ sw $v0, 0x0014($sp) -/* 00C54 80A9FC34 3C014F00 */ lui $at, 0x4F00 ## $at = 4F000000 -/* 00C58 80A9FC38 4449F800 */ cfc1 $t1, $31 -/* 00C5C 80A9FC3C 44CAF800 */ ctc1 $t2, $31 -/* 00C60 80A9FC40 00000000 */ nop -/* 00C64 80A9FC44 460084A4 */ cvt.w.s $f18, $f16 -/* 00C68 80A9FC48 444AF800 */ cfc1 $t2, $31 -/* 00C6C 80A9FC4C 00000000 */ nop -/* 00C70 80A9FC50 314A0078 */ andi $t2, $t2, 0x0078 ## $t2 = 00000000 -/* 00C74 80A9FC54 51400013 */ beql $t2, $zero, .L80A9FCA4 -/* 00C78 80A9FC58 440A9000 */ mfc1 $t2, $f18 -/* 00C7C 80A9FC5C 44819000 */ mtc1 $at, $f18 ## $f18 = 2147483648.00 -/* 00C80 80A9FC60 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 00C84 80A9FC64 46128481 */ sub.s $f18, $f16, $f18 -/* 00C88 80A9FC68 44CAF800 */ ctc1 $t2, $31 -/* 00C8C 80A9FC6C 00000000 */ nop -/* 00C90 80A9FC70 460094A4 */ cvt.w.s $f18, $f18 -/* 00C94 80A9FC74 444AF800 */ cfc1 $t2, $31 -/* 00C98 80A9FC78 00000000 */ nop -/* 00C9C 80A9FC7C 314A0078 */ andi $t2, $t2, 0x0078 ## $t2 = 00000000 -/* 00CA0 80A9FC80 15400005 */ bne $t2, $zero, .L80A9FC98 -/* 00CA4 80A9FC84 00000000 */ nop -/* 00CA8 80A9FC88 440A9000 */ mfc1 $t2, $f18 -/* 00CAC 80A9FC8C 3C018000 */ lui $at, 0x8000 ## $at = 80000000 -/* 00CB0 80A9FC90 10000007 */ beq $zero, $zero, .L80A9FCB0 -/* 00CB4 80A9FC94 01415025 */ or $t2, $t2, $at ## $t2 = 80000000 -.L80A9FC98: -/* 00CB8 80A9FC98 10000005 */ beq $zero, $zero, .L80A9FCB0 -/* 00CBC 80A9FC9C 240AFFFF */ addiu $t2, $zero, 0xFFFF ## $t2 = FFFFFFFF -/* 00CC0 80A9FCA0 440A9000 */ mfc1 $t2, $f18 -.L80A9FCA4: -/* 00CC4 80A9FCA4 00000000 */ nop -/* 00CC8 80A9FCA8 0540FFFB */ bltz $t2, .L80A9FC98 -/* 00CCC 80A9FCAC 00000000 */ nop -.L80A9FCB0: -/* 00CD0 80A9FCB0 3C014448 */ lui $at, 0x4448 ## $at = 44480000 -/* 00CD4 80A9FCB4 44812000 */ mtc1 $at, $f4 ## $f4 = 800.00 -/* 00CD8 80A9FCB8 44C9F800 */ ctc1 $t1, $31 -/* 00CDC 80A9FCBC AFAA0018 */ sw $t2, 0x0018($sp) -/* 00CE0 80A9FCC0 46040182 */ mul.s $f6, $f0, $f4 -/* 00CE4 80A9FCC4 4600320D */ trunc.w.s $f8, $f6 -/* 00CE8 80A9FCC8 440C4000 */ mfc1 $t4, $f8 -/* 00CEC 80A9FCCC 0C01E763 */ jal Lights_PointNoGlowSetInfo - -/* 00CF0 80A9FCD0 AFAC001C */ sw $t4, 0x001C($sp) -/* 00CF4 80A9FCD4 8FBF002C */ lw $ra, 0x002C($sp) -/* 00CF8 80A9FCD8 8FB00028 */ lw $s0, 0x0028($sp) -/* 00CFC 80A9FCDC 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 00D00 80A9FCE0 03E00008 */ jr $ra -/* 00D04 80A9FCE4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9EFE0.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9EFE0.s deleted file mode 100644 index bb6d79b69d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9EFE0.s +++ /dev/null @@ -1,3 +0,0 @@ -glabel func_80A9EFE0 -/* 00000 80A9EFE0 03E00008 */ jr $ra -/* 00004 80A9EFE4 AC8501C0 */ sw $a1, 0x01C0($a0) ## 000001C0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F314.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F314.s deleted file mode 100644 index 3c18811651..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F314.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_80A9F314 -/* 00334 80A9F314 44856000 */ mtc1 $a1, $f12 ## $f12 = 0.00 -/* 00338 80A9F318 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 0033C 80A9F31C 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0 -/* 00340 80A9F320 AFBF001C */ sw $ra, 0x001C($sp) -/* 00344 80A9F324 3C064454 */ lui $a2, 0x4454 ## $a2 = 44540000 -/* 00348 80A9F328 3C073E4C */ lui $a3, 0x3E4C ## $a3 = 3E4C0000 -/* 0034C 80A9F32C 44056000 */ mfc1 $a1, $f12 -/* 00350 80A9F330 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3E4CCCCD -/* 00354 80A9F334 34C68000 */ ori $a2, $a2, 0x8000 ## $a2 = 44548000 -/* 00358 80A9F338 0C01DCEA */ jal func_800773A8 -/* 0035C 80A9F33C E7A40010 */ swc1 $f4, 0x0010($sp) -/* 00360 80A9F340 8FBF001C */ lw $ra, 0x001C($sp) -/* 00364 80A9F344 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 -/* 00368 80A9F348 03E00008 */ jr $ra -/* 0036C 80A9F34C 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F350.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F350.s deleted file mode 100644 index 6b51fff68b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F350.s +++ /dev/null @@ -1,54 +0,0 @@ -glabel func_80A9F350 -/* 00370 80A9F350 27BDFFD8 */ addiu $sp, $sp, 0xFFD8 ## $sp = FFFFFFD8 -/* 00374 80A9F354 AFBF001C */ sw $ra, 0x001C($sp) -/* 00378 80A9F358 AFA40028 */ sw $a0, 0x0028($sp) -/* 0037C 80A9F35C 8CA21C44 */ lw $v0, 0x1C44($a1) ## 00001C44 -/* 00380 80A9F360 8C4E0680 */ lw $t6, 0x0680($v0) ## 00000680 -/* 00384 80A9F364 000E7B80 */ sll $t7, $t6, 14 -/* 00388 80A9F368 05E3001E */ bgezl $t7, .L80A9F3E4 -/* 0038C 80A9F36C 8C49067C */ lw $t1, 0x067C($v0) ## 0000067C -/* 00390 80A9F370 80580842 */ lb $t8, 0x0842($v0) ## 00000842 -/* 00394 80A9F374 3C078013 */ lui $a3, %hi(D_801333E0) -/* 00398 80A9F378 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 0039C 80A9F37C 2B010018 */ slti $at, $t8, 0x0018 -/* 003A0 80A9F380 14200013 */ bne $at, $zero, .L80A9F3D0 -/* 003A4 80A9F384 24041823 */ addiu $a0, $zero, 0x1823 ## $a0 = 00001823 -/* 003A8 80A9F388 3C198013 */ lui $t9, %hi(D_801333E8) -/* 003AC 80A9F38C 273933E8 */ addiu $t9, %lo(D_801333E8) -/* 003B0 80A9F390 244500E4 */ addiu $a1, $v0, 0x00E4 ## $a1 = 000000E4 -/* 003B4 80A9F394 AFA50020 */ sw $a1, 0x0020($sp) -/* 003B8 80A9F398 AFB90014 */ sw $t9, 0x0014($sp) -/* 003BC 80A9F39C 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 003C0 80A9F3A0 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 003C4 80A9F3A4 AFA70010 */ sw $a3, 0x0010($sp) -/* 003C8 80A9F3A8 3C078013 */ lui $a3, %hi(D_801333E0) -/* 003CC 80A9F3AC 3C088013 */ lui $t0, %hi(D_801333E8) -/* 003D0 80A9F3B0 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 003D4 80A9F3B4 250833E8 */ addiu $t0, %lo(D_801333E8) -/* 003D8 80A9F3B8 8FA50020 */ lw $a1, 0x0020($sp) -/* 003DC 80A9F3BC AFA80014 */ sw $t0, 0x0014($sp) -/* 003E0 80A9F3C0 AFA70010 */ sw $a3, 0x0010($sp) -/* 003E4 80A9F3C4 24041818 */ addiu $a0, $zero, 0x1818 ## $a0 = 00001818 -/* 003E8 80A9F3C8 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 003EC 80A9F3CC 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -.L80A9F3D0: -/* 003F0 80A9F3D0 0C00B55C */ jal Actor_Kill - -/* 003F4 80A9F3D4 8FA40028 */ lw $a0, 0x0028($sp) -/* 003F8 80A9F3D8 10000008 */ beq $zero, $zero, .L80A9F3FC -/* 003FC 80A9F3DC 8FBF001C */ lw $ra, 0x001C($sp) -/* 00400 80A9F3E0 8C49067C */ lw $t1, 0x067C($v0) ## 0000067C -.L80A9F3E4: -/* 00404 80A9F3E4 312A1000 */ andi $t2, $t1, 0x1000 ## $t2 = 00000000 -/* 00408 80A9F3E8 55400004 */ bnel $t2, $zero, .L80A9F3FC -/* 0040C 80A9F3EC 8FBF001C */ lw $ra, 0x001C($sp) -/* 00410 80A9F3F0 0C00B55C */ jal Actor_Kill - -/* 00414 80A9F3F4 8FA40028 */ lw $a0, 0x0028($sp) -/* 00418 80A9F3F8 8FBF001C */ lw $ra, 0x001C($sp) -.L80A9F3FC: -/* 0041C 80A9F3FC 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 -/* 00420 80A9F400 03E00008 */ jr $ra -/* 00424 80A9F404 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F408.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F408.s deleted file mode 100644 index 51b049e24f..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F408.s +++ /dev/null @@ -1,395 +0,0 @@ -.late_rodata -glabel D_80AA04E0 - .float 0.1 - -glabel D_80AA04E4 - .float 0.1 - -glabel D_80AA04E8 - .float 0.15 - -glabel D_80AA04EC - .float 0.1 - -glabel D_80AA04F0 - .float 0.85 - -glabel D_80AA04F4 - .float 0.15 - -glabel D_80AA04F8 - .float 0.15 - -glabel D_80AA04FC - .float 0.1 - -glabel D_80AA0500 - .float 0.85 - -glabel D_80AA0504 - .float 0.1 - -.text -glabel func_80A9F408 -/* 00428 80A9F408 27BDFFB0 */ addiu $sp, $sp, 0xFFB0 ## $sp = FFFFFFB0 -/* 0042C 80A9F40C AFBF003C */ sw $ra, 0x003C($sp) -/* 00430 80A9F410 AFB00038 */ sw $s0, 0x0038($sp) -/* 00434 80A9F414 AFA50054 */ sw $a1, 0x0054($sp) -/* 00438 80A9F418 8CA31C44 */ lw $v1, 0x1C44($a1) ## 00001C44 -/* 0043C 80A9F41C 908A01CA */ lbu $t2, 0x01CA($a0) ## 000001CA -/* 00440 80A9F420 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 -/* 00444 80A9F424 C4640858 */ lwc1 $f4, 0x0858($v1) ## 00000858 -/* 00448 80A9F428 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0044C 80A9F42C 8C88011C */ lw $t0, 0x011C($a0) ## 0000011C -/* 00450 80A9F430 E48401B8 */ swc1 $f4, 0x01B8($a0) ## 000001B8 -/* 00454 80A9F434 8C780908 */ lw $t8, 0x0908($v1) ## 00000908 -/* 00458 80A9F438 AC980024 */ sw $t8, 0x0024($a0) ## 00000024 -/* 0045C 80A9F43C 8C6F090C */ lw $t7, 0x090C($v1) ## 0000090C -/* 00460 80A9F440 AC8F0028 */ sw $t7, 0x0028($a0) ## 00000028 -/* 00464 80A9F444 8C780910 */ lw $t8, 0x0910($v1) ## 00000910 -/* 00468 80A9F448 AC98002C */ sw $t8, 0x002C($a0) ## 0000002C -/* 0046C 80A9F44C 847900B6 */ lh $t9, 0x00B6($v1) ## 000000B6 -/* 00470 80A9F450 03214821 */ addu $t1, $t9, $at -/* 00474 80A9F454 15400029 */ bne $t2, $zero, .L80A9F4FC -/* 00478 80A9F458 A48900B6 */ sh $t1, 0x00B6($a0) ## 000000B6 -/* 0047C 80A9F45C 3C0180AA */ lui $at, %hi(D_80AA04E0) ## $at = 80AA0000 -/* 00480 80A9F460 C42804E0 */ lwc1 $f8, %lo(D_80AA04E0)($at) -/* 00484 80A9F464 C4660858 */ lwc1 $f6, 0x0858($v1) ## 00000858 -/* 00488 80A9F468 3C0B8016 */ lui $t3, %hi(gSaveContext+0x13f0) -/* 0048C 80A9F46C 4606403E */ c.le.s $f8, $f6 -/* 00490 80A9F470 00000000 */ nop -/* 00494 80A9F474 45000021 */ bc1f .L80A9F4FC -/* 00498 80A9F478 00000000 */ nop -/* 0049C 80A9F47C 856BFA50 */ lh $t3, %lo(gSaveContext+0x13f0)($t3) -/* 004A0 80A9F480 55600010 */ bnel $t3, $zero, .L80A9F4C4 -/* 004A4 80A9F484 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 004A8 80A9F488 8482001C */ lh $v0, 0x001C($a0) ## 0000001C -/* 004AC 80A9F48C 8FA40054 */ lw $a0, 0x0054($sp) -/* 004B0 80A9F490 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 004B4 80A9F494 3042FF00 */ andi $v0, $v0, 0xFF00 ## $v0 = 00000000 -/* 004B8 80A9F498 00021203 */ sra $v0, $v0, 8 -/* 004BC 80A9F49C 10400015 */ beq $v0, $zero, .L80A9F4F4 -/* 004C0 80A9F4A0 00022C00 */ sll $a1, $v0, 16 -/* 004C4 80A9F4A4 00052C03 */ sra $a1, $a1, 16 -/* 004C8 80A9F4A8 AFA3004C */ sw $v1, 0x004C($sp) -/* 004CC 80A9F4AC 0C021DC2 */ jal func_80087708 -/* 004D0 80A9F4B0 AFA80048 */ sw $t0, 0x0048($sp) -/* 004D4 80A9F4B4 8FA3004C */ lw $v1, 0x004C($sp) -/* 004D8 80A9F4B8 1440000E */ bne $v0, $zero, .L80A9F4F4 -/* 004DC 80A9F4BC 8FA80048 */ lw $t0, 0x0048($sp) -/* 004E0 80A9F4C0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A9F4C4: -/* 004E4 80A9F4C4 0C2A7CD4 */ jal func_80A9F350 -/* 004E8 80A9F4C8 8FA50054 */ lw $a1, 0x0054($sp) -/* 004EC 80A9F4CC 3C0580AA */ lui $a1, %hi(func_80A9F350) ## $a1 = 80AA0000 -/* 004F0 80A9F4D0 24A5F350 */ addiu $a1, $a1, %lo(func_80A9F350) ## $a1 = 80A9F350 -/* 004F4 80A9F4D4 0C2A7BF8 */ jal func_80A9EFE0 -/* 004F8 80A9F4D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 004FC 80A9F4DC 44805000 */ mtc1 $zero, $f10 ## $f10 = 0.00 -/* 00500 80A9F4E0 44808000 */ mtc1 $zero, $f16 ## $f16 = 0.00 -/* 00504 80A9F4E4 A20001C8 */ sb $zero, 0x01C8($s0) ## 000001C8 -/* 00508 80A9F4E8 E60A01BC */ swc1 $f10, 0x01BC($s0) ## 000001BC -/* 0050C 80A9F4EC 1000010D */ beq $zero, $zero, .L80A9F924 -/* 00510 80A9F4F0 E61001AC */ swc1 $f16, 0x01AC($s0) ## 000001AC -.L80A9F4F4: -/* 00514 80A9F4F4 240C0001 */ addiu $t4, $zero, 0x0001 ## $t4 = 00000001 -/* 00518 80A9F4F8 A20C01CA */ sb $t4, 0x01CA($s0) ## 000001CA -.L80A9F4FC: -/* 0051C 80A9F4FC 3C0180AA */ lui $at, %hi(D_80AA04E4) ## $at = 80AA0000 -/* 00520 80A9F500 C43204E4 */ lwc1 $f18, %lo(D_80AA04E4)($at) -/* 00524 80A9F504 C4600858 */ lwc1 $f0, 0x0858($v1) ## 00000858 -/* 00528 80A9F508 3C014316 */ lui $at, 0x4316 ## $at = 43160000 -/* 0052C 80A9F50C 4600903E */ c.le.s $f18, $f0 -/* 00530 80A9F510 00000000 */ nop -/* 00534 80A9F514 45020010 */ bc1fl .L80A9F558 -/* 00538 80A9F518 8C6E0680 */ lw $t6, 0x0680($v1) ## 00000680 -/* 0053C 80A9F51C 44812000 */ mtc1 $at, $f4 ## $f4 = 150.00 -/* 00540 80A9F520 44806000 */ mtc1 $zero, $f12 ## $f12 = 0.00 -/* 00544 80A9F524 24060002 */ addiu $a2, $zero, 0x0002 ## $a2 = 00000002 -/* 00548 80A9F528 46040182 */ mul.s $f6, $f0, $f4 -/* 0054C 80A9F52C AFA3004C */ sw $v1, 0x004C($sp) -/* 00550 80A9F530 AFA80048 */ sw $t0, 0x0048($sp) -/* 00554 80A9F534 4600320D */ trunc.w.s $f8, $f6 -/* 00558 80A9F538 44054000 */ mfc1 $a1, $f8 -/* 0055C 80A9F53C 00000000 */ nop -/* 00560 80A9F540 30A500FF */ andi $a1, $a1, 0x00FF ## $a1 = 00000000 -/* 00564 80A9F544 0C02A800 */ jal func_800AA000 -/* 00568 80A9F548 30A700FF */ andi $a3, $a1, 0x00FF ## $a3 = 00000000 -/* 0056C 80A9F54C 8FA3004C */ lw $v1, 0x004C($sp) -/* 00570 80A9F550 8FA80048 */ lw $t0, 0x0048($sp) -/* 00574 80A9F554 8C6E0680 */ lw $t6, 0x0680($v1) ## 00000680 -.L80A9F558: -/* 00578 80A9F558 3C0180AA */ lui $at, %hi(D_80AA04E8) ## $at = 80AA0000 -/* 0057C 80A9F55C 000E7B80 */ sll $t7, $t6, 14 -/* 00580 80A9F560 05E3007A */ bgezl $t7, .L80A9F74C -/* 00584 80A9F564 8C6B067C */ lw $t3, 0x067C($v1) ## 0000067C -/* 00588 80A9F568 11000005 */ beq $t0, $zero, .L80A9F580 -/* 0058C 80A9F56C 3C0580AA */ lui $a1, %hi(func_80A9F9B4) ## $a1 = 80AA0000 -/* 00590 80A9F570 8D180130 */ lw $t8, 0x0130($t0) ## 00000130 -/* 00594 80A9F574 13000002 */ beq $t8, $zero, .L80A9F580 -/* 00598 80A9F578 00000000 */ nop -/* 0059C 80A9F57C AD000118 */ sw $zero, 0x0118($t0) ## 00000118 -.L80A9F580: -/* 005A0 80A9F580 C42C04E8 */ lwc1 $f12, %lo(D_80AA04E8)($at) -/* 005A4 80A9F584 C4600858 */ lwc1 $f0, 0x0858($v1) ## 00000858 -/* 005A8 80A9F588 3C0180AA */ lui $at, %hi(D_80AA04EC) ## $at = 80AA0000 -/* 005AC 80A9F58C 24A5F9B4 */ addiu $a1, $a1, %lo(func_80A9F9B4) ## $a1 = 80A9F9B4 -/* 005B0 80A9F590 460C003E */ c.le.s $f0, $f12 -/* 005B4 80A9F594 00000000 */ nop -/* 005B8 80A9F598 45020023 */ bc1fl .L80A9F628 -/* 005BC 80A9F59C 8C6B0680 */ lw $t3, 0x0680($v1) ## 00000680 -/* 005C0 80A9F5A0 C42A04EC */ lwc1 $f10, %lo(D_80AA04EC)($at) -/* 005C4 80A9F5A4 4600503E */ c.le.s $f10, $f0 -/* 005C8 80A9F5A8 00000000 */ nop -/* 005CC 80A9F5AC 45000019 */ bc1f .L80A9F614 -/* 005D0 80A9F5B0 00000000 */ nop -/* 005D4 80A9F5B4 80790842 */ lb $t9, 0x0842($v1) ## 00000842 -/* 005D8 80A9F5B8 3C078013 */ lui $a3, %hi(D_801333E0) -/* 005DC 80A9F5BC 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 005E0 80A9F5C0 2B210018 */ slti $at, $t9, 0x0018 -/* 005E4 80A9F5C4 14200013 */ bne $at, $zero, .L80A9F614 -/* 005E8 80A9F5C8 24041823 */ addiu $a0, $zero, 0x1823 ## $a0 = 00001823 -/* 005EC 80A9F5CC 3C098013 */ lui $t1, %hi(D_801333E8) -/* 005F0 80A9F5D0 252933E8 */ addiu $t1, %lo(D_801333E8) -/* 005F4 80A9F5D4 246500E4 */ addiu $a1, $v1, 0x00E4 ## $a1 = 000000E4 -/* 005F8 80A9F5D8 AFA50044 */ sw $a1, 0x0044($sp) -/* 005FC 80A9F5DC AFA90014 */ sw $t1, 0x0014($sp) -/* 00600 80A9F5E0 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00604 80A9F5E4 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00608 80A9F5E8 AFA70010 */ sw $a3, 0x0010($sp) -/* 0060C 80A9F5EC 3C078013 */ lui $a3, %hi(D_801333E0) -/* 00610 80A9F5F0 3C0A8013 */ lui $t2, %hi(D_801333E8) -/* 00614 80A9F5F4 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 00618 80A9F5F8 254A33E8 */ addiu $t2, %lo(D_801333E8) -/* 0061C 80A9F5FC 8FA50044 */ lw $a1, 0x0044($sp) -/* 00620 80A9F600 AFAA0014 */ sw $t2, 0x0014($sp) -/* 00624 80A9F604 AFA70010 */ sw $a3, 0x0010($sp) -/* 00628 80A9F608 24041818 */ addiu $a0, $zero, 0x1818 ## $a0 = 00001818 -/* 0062C 80A9F60C 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00630 80A9F610 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -.L80A9F614: -/* 00634 80A9F614 0C00B55C */ jal Actor_Kill - -/* 00638 80A9F618 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0063C 80A9F61C 100000C2 */ beq $zero, $zero, .L80A9F928 -/* 00640 80A9F620 8FBF003C */ lw $ra, 0x003C($sp) -/* 00644 80A9F624 8C6B0680 */ lw $t3, 0x0680($v1) ## 00000680 -.L80A9F628: -/* 00648 80A9F628 3C01FFFD */ lui $at, 0xFFFD ## $at = FFFD0000 -/* 0064C 80A9F62C 3421FFFF */ ori $at, $at, 0xFFFF ## $at = FFFDFFFF -/* 00650 80A9F630 01616024 */ and $t4, $t3, $at -/* 00654 80A9F634 AC6C0680 */ sw $t4, 0x0680($v1) ## 00000680 -/* 00658 80A9F638 860D001C */ lh $t5, 0x001C($s0) ## 0000001C -/* 0065C 80A9F63C 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 00660 80A9F640 3C018016 */ lui $at, %hi(gSaveContext+0x13f0) -/* 00664 80A9F644 31AEFF00 */ andi $t6, $t5, 0xFF00 ## $t6 = 00000000 -/* 00668 80A9F648 000E7A03 */ sra $t7, $t6, 8 -/* 0066C 80A9F64C 11E00002 */ beq $t7, $zero, .L80A9F658 -/* 00670 80A9F650 00000000 */ nop -/* 00674 80A9F654 A424FA50 */ sh $a0, %lo(gSaveContext+0x13f0)($at) -.L80A9F658: -/* 00678 80A9F658 3C0180AA */ lui $at, %hi(D_80AA04F0) ## $at = 80AA0000 -/* 0067C 80A9F65C C43204F0 */ lwc1 $f18, %lo(D_80AA04F0)($at) -/* 00680 80A9F660 C4700858 */ lwc1 $f16, 0x0858($v1) ## 00000858 -/* 00684 80A9F664 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 -/* 00688 80A9F668 4612803C */ c.lt.s $f16, $f18 -/* 0068C 80A9F66C 00000000 */ nop -/* 00690 80A9F670 45020011 */ bc1fl .L80A9F6B8 -/* 00694 80A9F674 920201C7 */ lbu $v0, 0x01C7($s0) ## 000001C7 -/* 00698 80A9F678 920201C7 */ lbu $v0, 0x01C7($s0) ## 000001C7 -/* 0069C 80A9F67C 3C1980AA */ lui $t9, %hi(D_80AA044C) ## $t9 = 80AA0000 -/* 006A0 80A9F680 24090001 */ addiu $t1, $zero, 0x0001 ## $t1 = 00000001 -/* 006A4 80A9F684 0002C080 */ sll $t8, $v0, 2 -/* 006A8 80A9F688 0338C821 */ addu $t9, $t9, $t8 -/* 006AC 80A9F68C 8F39044C */ lw $t9, %lo(D_80AA044C)($t9) -/* 006B0 80A9F690 A20901C6 */ sb $t1, 0x01C6($s0) ## 000001C6 -/* 006B4 80A9F694 14820004 */ bne $a0, $v0, .L80A9F6A8 -/* 006B8 80A9F698 AE190164 */ sw $t9, 0x0164($s0) ## 00000164 -/* 006BC 80A9F69C 240A0002 */ addiu $t2, $zero, 0x0002 ## $t2 = 00000002 -/* 006C0 80A9F6A0 10000011 */ beq $zero, $zero, .L80A9F6E8 -/* 006C4 80A9F6A4 A20A01C9 */ sb $t2, 0x01C9($s0) ## 000001C9 -.L80A9F6A8: -/* 006C8 80A9F6A8 240B0004 */ addiu $t3, $zero, 0x0004 ## $t3 = 00000004 -/* 006CC 80A9F6AC 1000000E */ beq $zero, $zero, .L80A9F6E8 -/* 006D0 80A9F6B0 A20B01C9 */ sb $t3, 0x01C9($s0) ## 000001C9 -/* 006D4 80A9F6B4 920201C7 */ lbu $v0, 0x01C7($s0) ## 000001C7 -.L80A9F6B8: -/* 006D8 80A9F6B8 3C0D80AA */ lui $t5, %hi(D_80AA0458) ## $t5 = 80AA0000 -/* 006DC 80A9F6BC 240F0008 */ addiu $t7, $zero, 0x0008 ## $t7 = 00000008 -/* 006E0 80A9F6C0 00026080 */ sll $t4, $v0, 2 -/* 006E4 80A9F6C4 01AC6821 */ addu $t5, $t5, $t4 -/* 006E8 80A9F6C8 8DAD0458 */ lw $t5, %lo(D_80AA0458)($t5) -/* 006EC 80A9F6CC A20001C6 */ sb $zero, 0x01C6($s0) ## 000001C6 -/* 006F0 80A9F6D0 14820004 */ bne $a0, $v0, .L80A9F6E4 -/* 006F4 80A9F6D4 AE0D0164 */ sw $t5, 0x0164($s0) ## 00000164 -/* 006F8 80A9F6D8 240E0004 */ addiu $t6, $zero, 0x0004 ## $t6 = 00000004 -/* 006FC 80A9F6DC 10000002 */ beq $zero, $zero, .L80A9F6E8 -/* 00700 80A9F6E0 A20E01C9 */ sb $t6, 0x01C9($s0) ## 000001C9 -.L80A9F6E4: -/* 00704 80A9F6E4 A20F01C9 */ sb $t7, 0x01C9($s0) ## 000001C9 -.L80A9F6E8: -/* 00708 80A9F6E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0070C 80A9F6EC 0C2A7BF8 */ jal func_80A9EFE0 -/* 00710 80A9F6F0 AFA3004C */ sw $v1, 0x004C($sp) -/* 00714 80A9F6F4 921901C6 */ lbu $t9, 0x01C6($s0) ## 000001C6 -/* 00718 80A9F6F8 8FA3004C */ lw $v1, 0x004C($sp) -/* 0071C 80A9F6FC 24180008 */ addiu $t8, $zero, 0x0008 ## $t8 = 00000008 -/* 00720 80A9F700 3C078013 */ lui $a3, %hi(D_801333E0) -/* 00724 80A9F704 A61801C4 */ sh $t8, 0x01C4($s0) ## 000001C4 -/* 00728 80A9F708 3C0480AA */ lui $a0, %hi(D_80AA0464) ## $a0 = 80AA0000 -/* 0072C 80A9F70C 3C0A8013 */ lui $t2, %hi(D_801333E8) -/* 00730 80A9F710 00194840 */ sll $t1, $t9, 1 -/* 00734 80A9F714 24E733E0 */ addiu $a3, %lo(D_801333E0) -/* 00738 80A9F718 00892021 */ addu $a0, $a0, $t1 -/* 0073C 80A9F71C 254A33E8 */ addiu $t2, %lo(D_801333E8) -/* 00740 80A9F720 AFAA0014 */ sw $t2, 0x0014($sp) -/* 00744 80A9F724 94840464 */ lhu $a0, %lo(D_80AA0464)($a0) -/* 00748 80A9F728 AFA70010 */ sw $a3, 0x0010($sp) -/* 0074C 80A9F72C 24060004 */ addiu $a2, $zero, 0x0004 ## $a2 = 00000004 -/* 00750 80A9F730 0C03DCE3 */ jal Audio_PlaySoundGeneral - -/* 00754 80A9F734 246500E4 */ addiu $a1, $v1, 0x00E4 ## $a1 = 000000E4 -/* 00758 80A9F738 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 0075C 80A9F73C 44812000 */ mtc1 $at, $f4 ## $f4 = 1.00 -/* 00760 80A9F740 10000078 */ beq $zero, $zero, .L80A9F924 -/* 00764 80A9F744 E60401AC */ swc1 $f4, 0x01AC($s0) ## 000001AC -/* 00768 80A9F748 8C6B067C */ lw $t3, 0x067C($v1) ## 0000067C -.L80A9F74C: -/* 0076C 80A9F74C 3C0180AA */ lui $at, %hi(D_80AA04F4) ## $at = 80AA0000 -/* 00770 80A9F750 316C1000 */ andi $t4, $t3, 0x1000 ## $t4 = 00000000 -/* 00774 80A9F754 15800009 */ bne $t4, $zero, .L80A9F77C -/* 00778 80A9F758 00000000 */ nop -/* 0077C 80A9F75C 8E02011C */ lw $v0, 0x011C($s0) ## 0000011C -/* 00780 80A9F760 10400002 */ beq $v0, $zero, .L80A9F76C -/* 00784 80A9F764 00000000 */ nop -/* 00788 80A9F768 AC400118 */ sw $zero, 0x0118($v0) ## 00000118 -.L80A9F76C: -/* 0078C 80A9F76C 0C00B55C */ jal Actor_Kill - -/* 00790 80A9F770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00794 80A9F774 1000006C */ beq $zero, $zero, .L80A9F928 -/* 00798 80A9F778 8FBF003C */ lw $ra, 0x003C($sp) -.L80A9F77C: -/* 0079C 80A9F77C C42C04F4 */ lwc1 $f12, %lo(D_80AA04F4)($at) -/* 007A0 80A9F780 C4600858 */ lwc1 $f0, 0x0858($v1) ## 00000858 -/* 007A4 80A9F784 3C0180AA */ lui $at, %hi(D_80AA04FC) ## $at = 80AA0000 -/* 007A8 80A9F788 4600603C */ c.lt.s $f12, $f0 -/* 007AC 80A9F78C 00000000 */ nop -/* 007B0 80A9F790 45000029 */ bc1f .L80A9F838 -/* 007B4 80A9F794 00000000 */ nop -/* 007B8 80A9F798 8E0E011C */ lw $t6, 0x011C($s0) ## 0000011C -/* 007BC 80A9F79C 240D00FF */ addiu $t5, $zero, 0x00FF ## $t5 = 000000FF -/* 007C0 80A9F7A0 A20D01C8 */ sb $t5, 0x01C8($s0) ## 000001C8 -/* 007C4 80A9F7A4 55C00018 */ bnel $t6, $zero, .L80A9F808 -/* 007C8 80A9F7A8 C4700858 */ lwc1 $f16, 0x0858($v1) ## 00000858 -/* 007CC 80A9F7AC C6060024 */ lwc1 $f6, 0x0024($s0) ## 00000024 -/* 007D0 80A9F7B0 8FA60054 */ lw $a2, 0x0054($sp) -/* 007D4 80A9F7B4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 007D8 80A9F7B8 E7A60010 */ swc1 $f6, 0x0010($sp) -/* 007DC 80A9F7BC C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 -/* 007E0 80A9F7C0 24070101 */ addiu $a3, $zero, 0x0101 ## $a3 = 00000101 -/* 007E4 80A9F7C4 24C41C24 */ addiu $a0, $a2, 0x1C24 ## $a0 = 00001C24 -/* 007E8 80A9F7C8 E7A80014 */ swc1 $f8, 0x0014($sp) -/* 007EC 80A9F7CC C60A002C */ lwc1 $f10, 0x002C($s0) ## 0000002C -/* 007F0 80A9F7D0 AFA0001C */ sw $zero, 0x001C($sp) -/* 007F4 80A9F7D4 E7AA0018 */ swc1 $f10, 0x0018($sp) -/* 007F8 80A9F7D8 861800B6 */ lh $t8, 0x00B6($s0) ## 000000B6 -/* 007FC 80A9F7DC AFA00024 */ sw $zero, 0x0024($sp) -/* 00800 80A9F7E0 AFB80020 */ sw $t8, 0x0020($sp) -/* 00804 80A9F7E4 921901C7 */ lbu $t9, 0x01C7($s0) ## 000001C7 -/* 00808 80A9F7E8 AFA3004C */ sw $v1, 0x004C($sp) -/* 0080C 80A9F7EC 27290002 */ addiu $t1, $t9, 0x0002 ## $t1 = 00000002 -/* 00810 80A9F7F0 0C00C916 */ jal Actor_SpawnAsChild - -/* 00814 80A9F7F4 AFA90028 */ sw $t1, 0x0028($sp) -/* 00818 80A9F7F8 3C0180AA */ lui $at, %hi(D_80AA04F8) ## $at = 80AA0000 -/* 0081C 80A9F7FC C42C04F8 */ lwc1 $f12, %lo(D_80AA04F8)($at) -/* 00820 80A9F800 8FA3004C */ lw $v1, 0x004C($sp) -/* 00824 80A9F804 C4700858 */ lwc1 $f16, 0x0858($v1) ## 00000858 -.L80A9F808: -/* 00828 80A9F808 3C013FC0 */ lui $at, 0x3FC0 ## $at = 3FC00000 -/* 0082C 80A9F80C 44812000 */ mtc1 $at, $f4 ## $f4 = 1.50 -/* 00830 80A9F810 460C8481 */ sub.s $f18, $f16, $f12 -/* 00834 80A9F814 C60001BC */ lwc1 $f0, 0x01BC($s0) ## 000001BC -/* 00838 80A9F818 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000 -/* 0083C 80A9F81C 44815000 */ mtc1 $at, $f10 ## $f10 = 0.50 -/* 00840 80A9F820 46049182 */ mul.s $f6, $f18, $f4 -/* 00844 80A9F824 46003201 */ sub.s $f8, $f6, $f0 -/* 00848 80A9F828 460A4402 */ mul.s $f16, $f8, $f10 -/* 0084C 80A9F82C 46100480 */ add.s $f18, $f0, $f16 -/* 00850 80A9F830 10000019 */ beq $zero, $zero, .L80A9F898 -/* 00854 80A9F834 E61201BC */ swc1 $f18, 0x01BC($s0) ## 000001BC -.L80A9F838: -/* 00858 80A9F838 C42204FC */ lwc1 $f2, %lo(D_80AA04FC)($at) -/* 0085C 80A9F83C 3C01437F */ lui $at, 0x437F ## $at = 437F0000 -/* 00860 80A9F840 4600103C */ c.lt.s $f2, $f0 -/* 00864 80A9F844 00000000 */ nop -/* 00868 80A9F848 45020013 */ bc1fl .L80A9F898 -/* 0086C 80A9F84C A20001C8 */ sb $zero, 0x01C8($s0) ## 000001C8 -/* 00870 80A9F850 46020101 */ sub.s $f4, $f0, $f2 -/* 00874 80A9F854 44813000 */ mtc1 $at, $f6 ## $f6 = 255.00 -/* 00878 80A9F858 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 0087C 80A9F85C 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 -/* 00880 80A9F860 46062202 */ mul.s $f8, $f4, $f6 -/* 00884 80A9F864 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 00888 80A9F868 460A4402 */ mul.s $f16, $f8, $f10 -/* 0088C 80A9F86C 44814000 */ mtc1 $at, $f8 ## $f8 = 10.00 -/* 00890 80A9F870 4600848D */ trunc.w.s $f18, $f16 -/* 00894 80A9F874 440B9000 */ mfc1 $t3, $f18 -/* 00898 80A9F878 00000000 */ nop -/* 0089C 80A9F87C A20B01C8 */ sb $t3, 0x01C8($s0) ## 000001C8 -/* 008A0 80A9F880 C4640858 */ lwc1 $f4, 0x0858($v1) ## 00000858 -/* 008A4 80A9F884 46022181 */ sub.s $f6, $f4, $f2 -/* 008A8 80A9F888 46083282 */ mul.s $f10, $f6, $f8 -/* 008AC 80A9F88C 10000002 */ beq $zero, $zero, .L80A9F898 -/* 008B0 80A9F890 E60A01AC */ swc1 $f10, 0x01AC($s0) ## 000001AC -/* 008B4 80A9F894 A20001C8 */ sb $zero, 0x01C8($s0) ## 000001C8 -.L80A9F898: -/* 008B8 80A9F898 3C0180AA */ lui $at, %hi(D_80AA0500) ## $at = 80AA0000 -/* 008BC 80A9F89C C4300500 */ lwc1 $f16, %lo(D_80AA0500)($at) -/* 008C0 80A9F8A0 C4600858 */ lwc1 $f0, 0x0858($v1) ## 00000858 -/* 008C4 80A9F8A4 246400E4 */ addiu $a0, $v1, 0x00E4 ## $a0 = 000000E4 -/* 008C8 80A9F8A8 4600803C */ c.lt.s $f16, $f0 -/* 008CC 80A9F8AC 00000000 */ nop -/* 008D0 80A9F8B0 45020006 */ bc1fl .L80A9F8CC -/* 008D4 80A9F8B4 4600603C */ c.lt.s $f12, $f0 -/* 008D8 80A9F8B8 0C03D095 */ jal func_800F4254 -/* 008DC 80A9F8BC 24050002 */ addiu $a1, $zero, 0x0002 ## $a1 = 00000002 -/* 008E0 80A9F8C0 10000012 */ beq $zero, $zero, .L80A9F90C -/* 008E4 80A9F8C4 00000000 */ nop -/* 008E8 80A9F8C8 4600603C */ c.lt.s $f12, $f0 -.L80A9F8CC: -/* 008EC 80A9F8CC 246400E4 */ addiu $a0, $v1, 0x00E4 ## $a0 = 000000E4 -/* 008F0 80A9F8D0 3C0180AA */ lui $at, %hi(D_80AA0504) ## $at = 80AA0000 -/* 008F4 80A9F8D4 45000005 */ bc1f .L80A9F8EC -/* 008F8 80A9F8D8 00000000 */ nop -/* 008FC 80A9F8DC 0C03D095 */ jal func_800F4254 -/* 00900 80A9F8E0 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 -/* 00904 80A9F8E4 10000009 */ beq $zero, $zero, .L80A9F90C -/* 00908 80A9F8E8 00000000 */ nop -.L80A9F8EC: -/* 0090C 80A9F8EC C4320504 */ lwc1 $f18, %lo(D_80AA0504)($at) -/* 00910 80A9F8F0 246400E4 */ addiu $a0, $v1, 0x00E4 ## $a0 = 000000E4 -/* 00914 80A9F8F4 4600903C */ c.lt.s $f18, $f0 -/* 00918 80A9F8F8 00000000 */ nop -/* 0091C 80A9F8FC 45000003 */ bc1f .L80A9F90C -/* 00920 80A9F900 00000000 */ nop -/* 00924 80A9F904 0C03D095 */ jal func_800F4254 -/* 00928 80A9F908 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -.L80A9F90C: -/* 0092C 80A9F90C 0C02FF21 */ jal Gameplay_InCsMode -/* 00930 80A9F910 8FA40054 */ lw $a0, 0x0054($sp) -/* 00934 80A9F914 50400004 */ beql $v0, $zero, .L80A9F928 -/* 00938 80A9F918 8FBF003C */ lw $ra, 0x003C($sp) -/* 0093C 80A9F91C 0C00B55C */ jal Actor_Kill - -/* 00940 80A9F920 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80A9F924: -/* 00944 80A9F924 8FBF003C */ lw $ra, 0x003C($sp) -.L80A9F928: -/* 00948 80A9F928 8FB00038 */ lw $s0, 0x0038($sp) -/* 0094C 80A9F92C 27BD0050 */ addiu $sp, $sp, 0x0050 ## $sp = 00000000 -/* 00950 80A9F930 03E00008 */ jr $ra -/* 00954 80A9F934 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F938.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F938.s deleted file mode 100644 index bf79073d7b..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F938.s +++ /dev/null @@ -1,41 +0,0 @@ -.late_rodata -glabel D_80AA0508 - .float 0.1 - -.text -glabel func_80A9F938 -/* 00958 80A9F938 AFA50004 */ sw $a1, 0x0004($sp) -/* 0095C 80A9F93C 948E01C4 */ lhu $t6, 0x01C4($a0) ## 000001C4 -/* 00960 80A9F940 29C10002 */ slti $at, $t6, 0x0002 -/* 00964 80A9F944 50200009 */ beql $at, $zero, .L80A9F96C -/* 00968 80A9F948 C48001B0 */ lwc1 $f0, 0x01B0($a0) ## 000001B0 -/* 0096C 80A9F94C 908201C8 */ lbu $v0, 0x01C8($a0) ## 000001C8 -/* 00970 80A9F950 28410028 */ slti $at, $v0, 0x0028 -/* 00974 80A9F954 10200003 */ beq $at, $zero, .L80A9F964 -/* 00978 80A9F958 244FFFD8 */ addiu $t7, $v0, 0xFFD8 ## $t7 = FFFFFFD8 -/* 0097C 80A9F95C 10000002 */ beq $zero, $zero, .L80A9F968 -/* 00980 80A9F960 A08001C8 */ sb $zero, 0x01C8($a0) ## 000001C8 -.L80A9F964: -/* 00984 80A9F964 A08F01C8 */ sb $t7, 0x01C8($a0) ## 000001C8 -.L80A9F968: -/* 00988 80A9F968 C48001B0 */ lwc1 $f0, 0x01B0($a0) ## 000001B0 -.L80A9F96C: -/* 0098C 80A9F96C C48201BC */ lwc1 $f2, 0x01BC($a0) ## 000001BC -/* 00990 80A9F970 C48C01AC */ lwc1 $f12, 0x01AC($a0) ## 000001AC -/* 00994 80A9F974 46000180 */ add.s $f6, $f0, $f0 -/* 00998 80A9F978 C48401B4 */ lwc1 $f4, 0x01B4($a0) ## 000001B4 -/* 0099C 80A9F97C 3C0180AA */ lui $at, %hi(D_80AA0508) ## $at = 80AA0000 -/* 009A0 80A9F980 460C103C */ c.lt.s $f2, $f12 -/* 009A4 80A9F984 46062200 */ add.s $f8, $f4, $f6 -/* 009A8 80A9F988 45000007 */ bc1f .L80A9F9A8 -/* 009AC 80A9F98C E48801B4 */ swc1 $f8, 0x01B4($a0) ## 000001B4 -/* 009B0 80A9F990 46026281 */ sub.s $f10, $f12, $f2 -/* 009B4 80A9F994 C4300508 */ lwc1 $f16, %lo(D_80AA0508)($at) -/* 009B8 80A9F998 46105482 */ mul.s $f18, $f10, $f16 -/* 009BC 80A9F99C 46121100 */ add.s $f4, $f2, $f18 -/* 009C0 80A9F9A0 03E00008 */ jr $ra -/* 009C4 80A9F9A4 E48401BC */ swc1 $f4, 0x01BC($a0) ## 000001BC -.L80A9F9A8: -/* 009C8 80A9F9A8 E48C01BC */ swc1 $f12, 0x01BC($a0) ## 000001BC -/* 009CC 80A9F9AC 03E00008 */ jr $ra -/* 009D0 80A9F9B0 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s deleted file mode 100644 index 7d8462841d..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s +++ /dev/null @@ -1,112 +0,0 @@ -.late_rodata -glabel D_80AA050C - .float 0.6 - -glabel D_80AA0510 - .word 0x3FD55555 - -.text -glabel func_80A9F9B4 -/* 009D4 80A9F9B4 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0 -/* 009D8 80A9F9B8 AFBF0024 */ sw $ra, 0x0024($sp) -/* 009DC 80A9F9BC AFB00020 */ sw $s0, 0x0020($sp) -/* 009E0 80A9F9C0 AFA50034 */ sw $a1, 0x0034($sp) -/* 009E4 80A9F9C4 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 -/* 009E8 80A9F9C8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 009EC 80A9F9CC 248401AC */ addiu $a0, $a0, 0x01AC ## $a0 = 000001AC -/* 009F0 80A9F9D0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 009F4 80A9F9D4 3C063D80 */ lui $a2, 0x3D80 ## $a2 = 3D800000 -/* 009F8 80A9F9D8 0C01DE80 */ jal Math_StepToF - -/* 009FC 80A9F9DC AFAF002C */ sw $t7, 0x002C($sp) -/* 00A00 80A9F9E0 50400006 */ beql $v0, $zero, .L80A9F9FC -/* 00A04 80A9F9E4 921801C9 */ lbu $t8, 0x01C9($s0) ## 000001C9 -/* 00A08 80A9F9E8 0C00B55C */ jal Actor_Kill - -/* 00A0C 80A9F9EC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A10 80A9F9F0 10000025 */ beq $zero, $zero, .L80A9FA88 -/* 00A14 80A9F9F4 960201C4 */ lhu $v0, 0x01C4($s0) ## 000001C4 -/* 00A18 80A9F9F8 921801C9 */ lbu $t8, 0x01C9($s0) ## 000001C9 -.L80A9F9FC: -/* 00A1C 80A9F9FC 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 -/* 00A20 80A9FA00 3C063F19 */ lui $a2, 0x3F19 ## $a2 = 3F190000 -/* 00A24 80A9FA04 44982000 */ mtc1 $t8, $f4 ## $f4 = 0.00 -/* 00A28 80A9FA08 3C073F4C */ lui $a3, 0x3F4C ## $a3 = 3F4C0000 -/* 00A2C 80A9FA0C 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 3F4CCCCD -/* 00A30 80A9FA10 46802120 */ cvt.s.w $f4, $f4 -/* 00A34 80A9FA14 34C6999A */ ori $a2, $a2, 0x999A ## $a2 = 3F19999A -/* 00A38 80A9FA18 26040050 */ addiu $a0, $s0, 0x0050 ## $a0 = 00000050 -/* 00A3C 80A9FA1C E7A60010 */ swc1 $f6, 0x0010($sp) -/* 00A40 80A9FA20 44052000 */ mfc1 $a1, $f4 -/* 00A44 80A9FA24 0C01E0C4 */ jal Math_SmoothStepToF - -/* 00A48 80A9FA28 00000000 */ nop -/* 00A4C 80A9FA2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A50 80A9FA30 0C00B58B */ jal Actor_SetScale - -/* 00A54 80A9FA34 8E050050 */ lw $a1, 0x0050($s0) ## 00000050 -/* 00A58 80A9FA38 3C0141C8 */ lui $at, 0x41C8 ## $at = 41C80000 -/* 00A5C 80A9FA3C 44815000 */ mtc1 $at, $f10 ## $f10 = 25.00 -/* 00A60 80A9FA40 C6080050 */ lwc1 $f8, 0x0050($s0) ## 00000050 -/* 00A64 80A9FA44 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C -/* 00A68 80A9FA48 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 00A6C 80A9FA4C 460A4402 */ mul.s $f16, $f8, $f10 -/* 00A70 80A9FA50 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A74 80A9FA54 4600848D */ trunc.w.s $f18, $f16 -/* 00A78 80A9FA58 44089000 */ mfc1 $t0, $f18 -/* 00A7C 80A9FA5C 00000000 */ nop -/* 00A80 80A9FA60 A608018C */ sh $t0, 0x018C($s0) ## 0000018C -/* 00A84 80A9FA64 0C0189B7 */ jal Collider_CylinderUpdate - -/* 00A88 80A9FA68 AFA60028 */ sw $a2, 0x0028($sp) -/* 00A8C 80A9FA6C 8FA40034 */ lw $a0, 0x0034($sp) -/* 00A90 80A9FA70 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 00A94 80A9FA74 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 00A98 80A9FA78 8FA60028 */ lw $a2, 0x0028($sp) -/* 00A9C 80A9FA7C 0C0175E7 */ jal CollisionCheck_SetAT - ## CollisionCheck_setAT -/* 00AA0 80A9FA80 00812821 */ addu $a1, $a0, $at -/* 00AA4 80A9FA84 960201C4 */ lhu $v0, 0x01C4($s0) ## 000001C4 -.L80A9FA88: -/* 00AA8 80A9FA88 8FA3002C */ lw $v1, 0x002C($sp) -/* 00AAC 80A9FA8C 3C0180AA */ lui $at, %hi(D_80AA050C) ## $at = 80AA0000 -/* 00AB0 80A9FA90 18400007 */ blez $v0, .L80A9FAB0 -/* 00AB4 80A9FA94 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00AB8 80A9FA98 C4640908 */ lwc1 $f4, 0x0908($v1) ## 00000908 -/* 00ABC 80A9FA9C 2449FFFF */ addiu $t1, $v0, 0xFFFF ## $t1 = FFFFFFFF -/* 00AC0 80A9FAA0 E6040024 */ swc1 $f4, 0x0024($s0) ## 00000024 -/* 00AC4 80A9FAA4 C4660910 */ lwc1 $f6, 0x0910($v1) ## 00000910 -/* 00AC8 80A9FAA8 A60901C4 */ sh $t1, 0x01C4($s0) ## 000001C4 -/* 00ACC 80A9FAAC E606002C */ swc1 $f6, 0x002C($s0) ## 0000002C -.L80A9FAB0: -/* 00AD0 80A9FAB0 C60001AC */ lwc1 $f0, 0x01AC($s0) ## 000001AC -/* 00AD4 80A9FAB4 C428050C */ lwc1 $f8, %lo(D_80AA050C)($at) -/* 00AD8 80A9FAB8 3C0180AA */ lui $at, %hi(D_80AA0510) ## $at = 80AA0000 -/* 00ADC 80A9FABC 4600403C */ c.lt.s $f8, $f0 -/* 00AE0 80A9FAC0 00000000 */ nop -/* 00AE4 80A9FAC4 45000005 */ bc1f .L80A9FADC -/* 00AE8 80A9FAC8 00000000 */ nop -/* 00AEC 80A9FACC 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 -/* 00AF0 80A9FAD0 44815000 */ mtc1 $at, $f10 ## $f10 = 1.00 -/* 00AF4 80A9FAD4 10000004 */ beq $zero, $zero, .L80A9FAE8 -/* 00AF8 80A9FAD8 E60A01B0 */ swc1 $f10, 0x01B0($s0) ## 000001B0 -.L80A9FADC: -/* 00AFC 80A9FADC C4300510 */ lwc1 $f16, %lo(D_80AA0510)($at) -/* 00B00 80A9FAE0 46100482 */ mul.s $f18, $f0, $f16 -/* 00B04 80A9FAE4 E61201B0 */ swc1 $f18, 0x01B0($s0) ## 000001B0 -.L80A9FAE8: -/* 00B08 80A9FAE8 0C2A7E4E */ jal func_80A9F938 -/* 00B0C 80A9FAEC 8FA50034 */ lw $a1, 0x0034($sp) -/* 00B10 80A9FAF0 0C02FF21 */ jal Gameplay_InCsMode -/* 00B14 80A9FAF4 8FA40034 */ lw $a0, 0x0034($sp) -/* 00B18 80A9FAF8 50400004 */ beql $v0, $zero, .L80A9FB0C -/* 00B1C 80A9FAFC 8FBF0024 */ lw $ra, 0x0024($sp) -/* 00B20 80A9FB00 0C00B55C */ jal Actor_Kill - -/* 00B24 80A9FB04 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00B28 80A9FB08 8FBF0024 */ lw $ra, 0x0024($sp) -.L80A9FB0C: -/* 00B2C 80A9FB0C 8FB00020 */ lw $s0, 0x0020($sp) -/* 00B30 80A9FB10 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 -/* 00B34 80A9FB14 03E00008 */ jr $ra -/* 00B38 80A9FB18 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s index e58e699dad..355a4265d1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s @@ -8,8 +8,8 @@ glabel EnMk_Init /* 00018 80AAC918 AFB00028 */ sw $s0, 0x0028($sp) /* 0001C 80AAC91C AFA50044 */ sw $a1, 0x0044($sp) /* 00020 80AAC920 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00024 80AAC924 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 80AAC928 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80AAC924 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 80AAC928 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80AAC92C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00030 80AAC930 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00034 80AAC934 3C074210 */ lui $a3, 0x4210 ## $a3 = 42100000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s index 54b7bd7ecd..ec7b6e6cab 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s @@ -11,7 +11,7 @@ glabel EnMk_Update /* 009E0 80AAD2E0 AFA50054 */ sw $a1, 0x0054($sp) /* 009E4 80AAD2E4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 009E8 80AAD2E8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 009EC 80AAD2EC 0C0189B7 */ jal Collider_CylinderUpdate +/* 009EC 80AAD2EC 0C0189B7 */ jal Collider_UpdateCylinder /* 009F0 80AAD2F0 AFA60034 */ sw $a2, 0x0034($sp) /* 009F4 80AAD2F4 8FA40054 */ lw $a0, 0x0054($sp) @@ -19,7 +19,7 @@ glabel EnMk_Update /* 009FC 80AAD2FC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00A00 80AAD300 8FA60034 */ lw $a2, 0x0034($sp) /* 00A04 80AAD304 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A08 80AAD308 00812821 */ addu $a1, $a0, $at /* 00A0C 80AAD30C 0C00B638 */ jal Actor_MoveForward @@ -31,7 +31,7 @@ glabel EnMk_Update /* 00A24 80AAD324 44070000 */ mfc1 $a3, $f0 /* 00A28 80AAD328 8FA40054 */ lw $a0, 0x0054($sp) /* 00A2C 80AAD32C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A30 80AAD330 0C00B92D */ jal func_8002E4B4 +/* 00A30 80AAD330 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A34 80AAD334 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A38 80AAD338 960F027E */ lhu $t7, 0x027E($s0) ## 0000027E /* 00A3C 80AAD33C 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s index d867800cab..d3f539f59b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s @@ -8,8 +8,8 @@ glabel EnMm_Init /* 00138 80AAD8A8 0C01E037 */ jal Actor_ProcessInitChain /* 0013C 80AAD8AC 24A5EBE8 */ addiu $a1, $a1, %lo(D_80AAEBE8) ## $a1 = 80AAEBE8 -/* 00140 80AAD8B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00144 80AAD8B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00140 80AAD8B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00144 80AAD8B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00148 80AAD8B8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0014C 80AAD8BC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00150 80AAD8C0 0C00AC78 */ jal ActorShape_Init @@ -44,7 +44,7 @@ glabel EnMm_Init /* 001B8 80AAD928 3C0680AB */ lui $a2, %hi(D_80AAEB0C) ## $a2 = 80AB0000 /* 001BC 80AAD92C 24C6EB0C */ addiu $a2, $a2, %lo(D_80AAEB0C) ## $a2 = 80AAEB0C /* 001C0 80AAD930 24A5EB18 */ addiu $a1, $a1, %lo(D_80AAEB18) ## $a1 = 80AAEB18 -/* 001C4 80AAD934 0C0187BF */ jal func_80061EFC +/* 001C4 80AAD934 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001C8 80AAD938 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001CC 80AAD93C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001D0 80AAD940 24190004 */ addiu $t9, $zero, 0x0004 ## $t9 = 00000004 @@ -53,7 +53,7 @@ glabel EnMm_Init /* 001DC 80AAD94C 44070000 */ mfc1 $a3, $f0 /* 001E0 80AAD950 8FA4004C */ lw $a0, 0x004C($sp) /* 001E4 80AAD954 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001E8 80AAD958 0C00B92D */ jal func_8002E4B4 +/* 001E8 80AAD958 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001EC 80AAD95C E7A00010 */ swc1 $f0, 0x0010($sp) /* 001F0 80AAD960 3C0380AB */ lui $v1, %hi(D_80AAEB38) ## $v1 = 80AB0000 /* 001F4 80AAD964 2463EB38 */ addiu $v1, $v1, %lo(D_80AAEB38) ## $v1 = 80AAEB38 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s index fb3ca3921e..1146a9b6dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s @@ -13,7 +13,7 @@ glabel EnMm_Update /* 00EFC 80AAE66C 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 00F00 80AAE670 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00F04 80AAE674 AFA60024 */ sw $a2, 0x0024($sp) -/* 00F08 80AAE678 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F08 80AAE678 0C0189B7 */ jal Collider_UpdateCylinder /* 00F0C 80AAE67C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00F10 80AAE680 8FA40034 */ lw $a0, 0x0034($sp) @@ -21,7 +21,7 @@ glabel EnMm_Update /* 00F18 80AAE688 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00F1C 80AAE68C 8FA60024 */ lw $a2, 0x0024($sp) /* 00F20 80AAE690 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F24 80AAE694 00812821 */ addu $a1, $a0, $at /* 00F28 80AAE698 8FBF001C */ lw $ra, 0x001C($sp) /* 00F2C 80AAE69C 8FB00018 */ lw $s0, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s index 44b8afca0b..10a23e8c00 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s @@ -220,7 +220,7 @@ glabel func_80AADEF0 /* 00A74 80AAE1E4 AFAD0014 */ sw $t5, 0x0014($sp) /* 00A78 80AAE1E8 8FA4007C */ lw $a0, 0x007C($sp) /* 00A7C 80AAE1EC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A80 80AAE1F0 0C00B92D */ jal func_8002E4B4 +/* 00A80 80AAE1F0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A84 80AAE1F4 E7B40010 */ swc1 $f20, 0x0010($sp) /* 00A88 80AAE1F8 8FBF0044 */ lw $ra, 0x0044($sp) /* 00A8C 80AAE1FC D7B40020 */ ldc1 $f20, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s index b72e51edb6..3ba639803b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s @@ -14,8 +14,8 @@ glabel EnMm2_Init /* 00204 80AAF054 0C01E037 */ jal Actor_ProcessInitChain /* 00208 80AAF058 24A5FB5C */ addiu $a1, $a1, %lo(D_80AAFB5C) ## $a1 = 80AAFB5C -/* 0020C 80AAF05C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00210 80AAF060 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0020C 80AAF05C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00210 80AAF060 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00214 80AAF064 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00218 80AAF068 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0021C 80AAF06C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s index a49422a2c9..1b9045ac89 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s @@ -63,7 +63,7 @@ glabel EnMm2_Update /* 00A1C 80AAF86C 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 00A20 80AAF870 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00A24 80AAF874 AFA60034 */ sw $a2, 0x0034($sp) -/* 00A28 80AAF878 0C0189B7 */ jal Collider_CylinderUpdate +/* 00A28 80AAF878 0C0189B7 */ jal Collider_UpdateCylinder /* 00A2C 80AAF87C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A30 80AAF880 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -71,7 +71,7 @@ glabel EnMm2_Update /* 00A38 80AAF888 8FA60034 */ lw $a2, 0x0034($sp) /* 00A3C 80AAF88C 02212821 */ addu $a1, $s1, $at /* 00A40 80AAF890 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A44 80AAF894 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00A48 80AAF898 0C00B638 */ jal Actor_MoveForward @@ -83,7 +83,7 @@ glabel EnMm2_Update /* 00A60 80AAF8B0 44070000 */ mfc1 $a3, $f0 /* 00A64 80AAF8B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00A68 80AAF8B8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A6C 80AAF8BC 0C00B92D */ jal func_8002E4B4 +/* 00A6C 80AAF8BC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A70 80AAF8C0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A74 80AAF8C4 8FBF002C */ lw $ra, 0x002C($sp) /* 00A78 80AAF8C8 8FB00024 */ lw $s0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s index 1a2893b20e..a8350f6f97 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s @@ -4,8 +4,8 @@ glabel EnMu_Init /* 00214 80AB0634 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00218 80AB0638 AFBF002C */ sw $ra, 0x002C($sp) /* 0021C 80AB063C AFA50044 */ sw $a1, 0x0044($sp) -/* 00220 80AB0640 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00224 80AB0644 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00220 80AB0640 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00224 80AB0644 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00228 80AB0648 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0022C 80AB064C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00230 80AB0650 0C00AC78 */ jal ActorShape_Init @@ -36,7 +36,7 @@ glabel EnMu_Init /* 00288 80AB06A8 3C0680AB */ lui $a2, %hi(D_80AB0BFC) ## $a2 = 80AB0000 /* 0028C 80AB06AC 24C60BFC */ addiu $a2, $a2, %lo(D_80AB0BFC) ## $a2 = 80AB0BFC /* 00290 80AB06B0 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00294 80AB06B4 0C0187BF */ jal func_80061EFC +/* 00294 80AB06B4 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00298 80AB06B8 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 0029C 80AB06BC 240E0006 */ addiu $t6, $zero, 0x0006 ## $t6 = 00000006 /* 002A0 80AB06C0 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s index 535b3cb6d2..ea45eb6a94 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s @@ -30,7 +30,7 @@ glabel EnMu_Update /* 003AC 80AB07CC A48C01DE */ sh $t4, 0x01DE($a0) ## 000001DE /* 003B0 80AB07D0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 003B4 80AB07D4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 003B8 80AB07D8 00A12821 */ addu $a1, $a1, $at /* 003BC 80AB07DC 0C02927F */ jal SkelAnime_Update @@ -42,7 +42,7 @@ glabel EnMu_Update /* 003D4 80AB07F4 44070000 */ mfc1 $a3, $f0 /* 003D8 80AB07F8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 003DC 80AB07FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 003E0 80AB0800 0C00B92D */ jal func_8002E4B4 +/* 003E0 80AB0800 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003E4 80AB0804 E7A00010 */ swc1 $f0, 0x0010($sp) /* 003E8 80AB0808 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 003EC 80AB080C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s index fc10e076b5..b5bd3ddbc7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s @@ -31,7 +31,7 @@ glabel EnNy_Draw /* 011A0 80ABDD50 0C031AB1 */ jal Graph_OpenDisps /* 011A4 80ABDD54 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 /* 011A8 80ABDD58 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 011AC 80ABDD5C 0C018A29 */ jal func_800628A4 +/* 011AC 80ABDD5C 0C018A29 */ jal Collider_UpdateSpheres /* 011B0 80ABDD60 26250150 */ addiu $a1, $s1, 0x0150 ## $a1 = 00000150 /* 011B4 80ABDD64 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 011B8 80ABDD68 8FA50094 */ lw $a1, 0x0094($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s index d04e9a66fc..ece5183f78 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s @@ -43,8 +43,8 @@ glabel EnNy_Init /* 00058 80ABCC08 8FA40034 */ lw $a0, 0x0034($sp) /* 0005C 80ABCC0C 0C017014 */ jal Collider_SetJntSph /* 00060 80ABCC10 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00064 80ABCC14 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00068 80ABCC18 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00064 80ABCC14 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00068 80ABCC18 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0006C 80ABCC1C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00070 80ABCC20 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00074 80ABCC24 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s index 0bac67c740..9f8cb36d29 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s @@ -27,7 +27,7 @@ glabel EnNy_Update /* 0093C 80ABD4EC A49801CA */ sh $t8, 0x01CA($a0) ## 000001CA .L80ABD4F0: /* 00940 80ABD4F0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00944 80ABD4F4 0C00B56E */ jal Actor_SetHeight +/* 00944 80ABD4F4 0C00B56E */ jal Actor_SetFocus /* 00948 80ABD4F8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0094C 80ABD4FC 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -97,7 +97,7 @@ glabel EnNy_Update /* 00A40 80ABD5F0 AFAE0014 */ sw $t6, 0x0014($sp) /* 00A44 80ABD5F4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A48 80ABD5F8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 -/* 00A4C 80ABD5FC 0C00B92D */ jal func_8002E4B4 +/* 00A4C 80ABD5FC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A50 80ABD600 E7A60010 */ swc1 $f6, 0x0010($sp) /* 00A54 80ABD604 C6480028 */ lwc1 $f8, 0x0028($s2) ## 00000028 /* 00A58 80ABD608 E65601F0 */ swc1 $f22, 0x01F0($s2) ## 000001F0 @@ -170,7 +170,7 @@ glabel EnNy_Update /* 00B44 80ABD6F4 02002025 */ or $a0, $s0, $zero ## $a0 = 0000000C /* 00B48 80ABD6F8 02202825 */ or $a1, $s1, $zero ## $a1 = 00000001 /* 00B4C 80ABD6FC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B50 80ABD700 02603025 */ or $a2, $s3, $zero ## $a2 = 00000150 .L80ABD704: /* 00B54 80ABD704 8FBF003C */ lw $ra, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s index fa1527b7de..85faf285f4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s @@ -13,7 +13,7 @@ glabel func_80ABDBF8 /* 01074 80ABDC24 E7A8003C */ swc1 $f8, 0x003C($sp) /* 01078 80ABDC28 848E01C8 */ lh $t6, 0x01C8($a0) ## 000001C8 /* 0107C 80ABDC2C 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 01080 80ABDC30 0C00B56E */ jal Actor_SetHeight +/* 01080 80ABDC30 0C00B56E */ jal Actor_SetFocus /* 01084 80ABDC34 A48F01C8 */ sh $t7, 0x01C8($a0) ## 000001C8 /* 01088 80ABDC38 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -45,7 +45,7 @@ glabel func_80ABDBF8 /* 010EC 80ABDC9C E6100028 */ swc1 $f16, 0x0028($s0) ## 00000028 /* 010F0 80ABDCA0 E7A00034 */ swc1 $f0, 0x0034($sp) /* 010F4 80ABDCA4 AFB80014 */ sw $t8, 0x0014($sp) -/* 010F8 80ABDCA8 0C00B92D */ jal func_8002E4B4 +/* 010F8 80ABDCA8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 010FC 80ABDCAC E7B20010 */ swc1 $f18, 0x0010($sp) /* 01100 80ABDCB0 C7A00034 */ lwc1 $f0, 0x0034($sp) /* 01104 80ABDCB4 C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 @@ -64,7 +64,7 @@ glabel func_80ABDBF8 /* 01134 80ABDCE4 8FA50030 */ lw $a1, 0x0030($sp) /* 01138 80ABDCE8 8FA6002C */ lw $a2, 0x002C($sp) /* 0113C 80ABDCEC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01140 80ABDCF0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01144 80ABDCF4 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s index 5eb84c8c06..a32a64b70e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s @@ -80,9 +80,9 @@ glabel func_80AC7094 /* 044C8 80AC7168 E6080024 */ swc1 $f8, 0x0024($s0) ## 00000024 /* 044CC 80AC716C C4500004 */ lwc1 $f16, 0x0004($v0) ## 00000004 /* 044D0 80AC7170 012A5821 */ addu $t3, $t1, $t2 -/* 044D4 80AC7174 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 044D4 80AC7174 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 044D8 80AC7178 46105480 */ add.s $f18, $f10, $f16 -/* 044DC 80AC717C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 044DC 80AC717C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 044E0 80AC7180 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 044E4 80AC7184 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 044E8 80AC7188 E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s index 169cc63bb7..66f3015bdd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s @@ -46,10 +46,10 @@ glabel func_80AC73B4 /* 047B8 80AC7458 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 047BC 80AC745C 3C0641D0 */ lui $a2, 0x41D0 ## $a2 = 41D00000 /* 047C0 80AC7460 3C074120 */ lui $a3, 0x4120 ## $a3 = 41200000 -/* 047C4 80AC7464 0C00B92D */ jal func_8002E4B4 +/* 047C4 80AC7464 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 047C8 80AC7468 E7A40010 */ swc1 $f4, 0x0010($sp) /* 047CC 80AC746C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 047D0 80AC7470 0C00B56E */ jal Actor_SetHeight +/* 047D0 80AC7470 0C00B56E */ jal Actor_SetFocus /* 047D4 80AC7474 3C0542B4 */ lui $a1, 0x42B4 ## $a1 = 42B40000 /* 047D8 80AC7478 860A001C */ lh $t2, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s deleted file mode 100644 index 218d92d2a4..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s +++ /dev/null @@ -1,556 +0,0 @@ -.rdata -glabel D_80ACD7AC - .asciz "フクロウ消滅!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" - .balign 4 - -.late_rodata -glabel D_80ACD854 - .float 0.3 - -glabel D_80ACD858 - .float 5000.0 - -glabel D_80ACD85C - .float 5000.0 - -glabel D_80ACD860 - .float 5000.0 - -.text -glabel EnOwl_Update -/* 02780 80ACC6A0 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 02784 80ACC6A4 AFB00020 */ sw $s0, 0x0020($sp) -/* 02788 80ACC6A8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0278C 80ACC6AC AFBF0024 */ sw $ra, 0x0024($sp) -/* 02790 80ACC6B0 AFA50044 */ sw $a1, 0x0044($sp) -/* 02794 80ACC6B4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C -/* 02798 80ACC6B8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0279C 80ACC6BC 0C0189B7 */ jal Collider_CylinderUpdate - -/* 027A0 80ACC6C0 AFA6002C */ sw $a2, 0x002C($sp) -/* 027A4 80ACC6C4 8FA40044 */ lw $a0, 0x0044($sp) -/* 027A8 80ACC6C8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 027AC 80ACC6CC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 -/* 027B0 80ACC6D0 8FA6002C */ lw $a2, 0x002C($sp) -/* 027B4 80ACC6D4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT -/* 027B8 80ACC6D8 00812821 */ addu $a1, $a0, $at -/* 027BC 80ACC6DC 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 027C0 80ACC6E0 44810000 */ mtc1 $at, $f0 ## $f0 = 10.00 -/* 027C4 80ACC6E4 240E0005 */ addiu $t6, $zero, 0x0005 ## $t6 = 00000005 -/* 027C8 80ACC6E8 AFAE0014 */ sw $t6, 0x0014($sp) -/* 027CC 80ACC6EC 44060000 */ mfc1 $a2, $f0 -/* 027D0 80ACC6F0 44070000 */ mfc1 $a3, $f0 -/* 027D4 80ACC6F4 8FA40044 */ lw $a0, 0x0044($sp) -/* 027D8 80ACC6F8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 027DC 80ACC6FC 0C00B92D */ jal func_8002E4B4 -/* 027E0 80ACC700 E7A00010 */ swc1 $f0, 0x0010($sp) -/* 027E4 80ACC704 8E190410 */ lw $t9, 0x0410($s0) ## 00000410 -/* 027E8 80ACC708 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 027EC 80ACC70C 0320F809 */ jalr $ra, $t9 -/* 027F0 80ACC710 00000000 */ nop -/* 027F4 80ACC714 960F03FC */ lhu $t7, 0x03FC($s0) ## 000003FC -/* 027F8 80ACC718 8E19040C */ lw $t9, 0x040C($s0) ## 0000040C -/* 027FC 80ACC71C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02800 80ACC720 31F8FFF7 */ andi $t8, $t7, 0xFFF7 ## $t8 = 00000000 -/* 02804 80ACC724 A61803FC */ sh $t8, 0x03FC($s0) ## 000003FC -/* 02808 80ACC728 0320F809 */ jalr $ra, $t9 -/* 0280C 80ACC72C 8FA50044 */ lw $a1, 0x0044($sp) -/* 02810 80ACC730 8E080130 */ lw $t0, 0x0130($s0) ## 00000130 -/* 02814 80ACC734 3C0480AD */ lui $a0, %hi(D_80ACD7AC) ## $a0 = 80AD0000 -/* 02818 80ACC738 55000006 */ bnel $t0, $zero, .L80ACC754 -/* 0281C 80ACC73C 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -/* 02820 80ACC740 0C00084C */ jal osSyncPrintf - -/* 02824 80ACC744 2484D7AC */ addiu $a0, $a0, %lo(D_80ACD7AC) ## $a0 = 80ACD7AC -/* 02828 80ACC748 100001A9 */ beq $zero, $zero, .L80ACCDF0 -/* 0282C 80ACC74C 8FBF0024 */ lw $ra, 0x0024($sp) -/* 02830 80ACC750 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -.L80ACC754: -/* 02834 80ACC754 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02838 80ACC758 312A0080 */ andi $t2, $t1, 0x0080 ## $t2 = 00000000 -/* 0283C 80ACC75C 55400035 */ bnel $t2, $zero, .L80ACC834 -/* 02840 80ACC760 8E0D0134 */ lw $t5, 0x0134($s0) ## 00000134 -/* 02844 80ACC764 0C2B3189 */ jal func_80ACC624 -/* 02848 80ACC768 8FA50044 */ lw $a1, 0x0044($sp) -/* 0284C 80ACC76C 50400031 */ beql $v0, $zero, .L80ACC834 -/* 02850 80ACC770 8E0D0134 */ lw $t5, 0x0134($s0) ## 00000134 -/* 02854 80ACC774 8E0201A0 */ lw $v0, 0x01A0($s0) ## 000001A0 -/* 02858 80ACC778 3C0B0600 */ lui $t3, %hi(D_06001168) ## $t3 = 06000000 -/* 0285C 80ACC77C 256B1168 */ addiu $t3, $t3, %lo(D_06001168) ## $t3 = 06001168 -/* 02860 80ACC780 1562001F */ bne $t3, $v0, .L80ACC800 -/* 02864 80ACC784 3C014000 */ lui $at, 0x4000 ## $at = 40000000 -/* 02868 80ACC788 C60001B0 */ lwc1 $f0, 0x01B0($s0) ## 000001B0 -/* 0286C 80ACC78C 44812000 */ mtc1 $at, $f4 ## $f4 = 2.00 -/* 02870 80ACC790 3C014110 */ lui $at, 0x4110 ## $at = 41100000 -/* 02874 80ACC794 46002032 */ c.eq.s $f4, $f0 -/* 02878 80ACC798 00000000 */ nop -/* 0287C 80ACC79C 45030022 */ bc1tl .L80ACC828 -/* 02880 80ACC7A0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02884 80ACC7A4 44813000 */ mtc1 $at, $f6 ## $f6 = 9.00 -/* 02888 80ACC7A8 3C0141B8 */ lui $at, 0x41B8 ## $at = 41B80000 -/* 0288C 80ACC7AC 46003032 */ c.eq.s $f6, $f0 -/* 02890 80ACC7B0 00000000 */ nop -/* 02894 80ACC7B4 4503001C */ bc1tl .L80ACC828 -/* 02898 80ACC7B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0289C 80ACC7BC 44814000 */ mtc1 $at, $f8 ## $f8 = 23.00 -/* 028A0 80ACC7C0 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 028A4 80ACC7C4 46004032 */ c.eq.s $f8, $f0 -/* 028A8 80ACC7C8 00000000 */ nop -/* 028AC 80ACC7CC 45030016 */ bc1tl .L80ACC828 -/* 028B0 80ACC7D0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 028B4 80ACC7D4 44815000 */ mtc1 $at, $f10 ## $f10 = 40.00 -/* 028B8 80ACC7D8 3C014268 */ lui $at, 0x4268 ## $at = 42680000 -/* 028BC 80ACC7DC 46005032 */ c.eq.s $f10, $f0 -/* 028C0 80ACC7E0 00000000 */ nop -/* 028C4 80ACC7E4 45030010 */ bc1tl .L80ACC828 -/* 028C8 80ACC7E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 028CC 80ACC7EC 44818000 */ mtc1 $at, $f16 ## $f16 = 58.00 -/* 028D0 80ACC7F0 00000000 */ nop -/* 028D4 80ACC7F4 46008032 */ c.eq.s $f16, $f0 -/* 028D8 80ACC7F8 00000000 */ nop -/* 028DC 80ACC7FC 45010009 */ bc1t .L80ACC824 -.L80ACC800: -/* 028E0 80ACC800 3C0C0600 */ lui $t4, %hi(D_060015CC) ## $t4 = 06000000 -/* 028E4 80ACC804 258C15CC */ addiu $t4, $t4, %lo(D_060015CC) ## $t4 = 060015CC -/* 028E8 80ACC808 15820009 */ bne $t4, $v0, .L80ACC830 -/* 028EC 80ACC80C 3C014080 */ lui $at, 0x4080 ## $at = 40800000 -/* 028F0 80ACC810 44819000 */ mtc1 $at, $f18 ## $f18 = 4.00 -/* 028F4 80ACC814 C60401B0 */ lwc1 $f4, 0x01B0($s0) ## 000001B0 -/* 028F8 80ACC818 46049032 */ c.eq.s $f18, $f4 -/* 028FC 80ACC81C 00000000 */ nop -/* 02900 80ACC820 45000003 */ bc1f .L80ACC830 -.L80ACC824: -/* 02904 80ACC824 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -.L80ACC828: -/* 02908 80ACC828 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 0290C 80ACC82C 24053926 */ addiu $a1, $zero, 0x3926 ## $a1 = 00003926 -.L80ACC830: -/* 02910 80ACC830 8E0D0134 */ lw $t5, 0x0134($s0) ## 00000134 -.L80ACC834: -/* 02914 80ACC834 51A00004 */ beql $t5, $zero, .L80ACC848 -/* 02918 80ACC838 960E03FC */ lhu $t6, 0x03FC($s0) ## 000003FC -/* 0291C 80ACC83C 0C00B638 */ jal Actor_MoveForward - -/* 02920 80ACC840 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02924 80ACC844 960E03FC */ lhu $t6, 0x03FC($s0) ## 000003FC -.L80ACC848: -/* 02928 80ACC848 24180002 */ addiu $t8, $zero, 0x0002 ## $t8 = 00000002 -/* 0292C 80ACC84C 31CF0002 */ andi $t7, $t6, 0x0002 ## $t7 = 00000000 -/* 02930 80ACC850 51E00004 */ beql $t7, $zero, .L80ACC864 -/* 02934 80ACC854 860303F6 */ lh $v1, 0x03F6($s0) ## 000003F6 -/* 02938 80ACC858 10000016 */ beq $zero, $zero, .L80ACC8B4 -/* 0293C 80ACC85C A61803F4 */ sh $t8, 0x03F4($s0) ## 000003F4 -/* 02940 80ACC860 860303F6 */ lh $v1, 0x03F6($s0) ## 000003F6 -.L80ACC864: -/* 02944 80ACC864 2404003C */ addiu $a0, $zero, 0x003C ## $a0 = 0000003C -/* 02948 80ACC868 14600003 */ bne $v1, $zero, .L80ACC878 -/* 0294C 80ACC86C 2479FFFF */ addiu $t9, $v1, 0xFFFF ## $t9 = FFFFFFFF -/* 02950 80ACC870 10000004 */ beq $zero, $zero, .L80ACC884 -/* 02954 80ACC874 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 -.L80ACC878: -/* 02958 80ACC878 A61903F6 */ sh $t9, 0x03F6($s0) ## 000003F6 -/* 0295C 80ACC87C 860303F6 */ lh $v1, 0x03F6($s0) ## 000003F6 -/* 02960 80ACC880 00601025 */ or $v0, $v1, $zero ## $v0 = 00000000 -.L80ACC884: -/* 02964 80ACC884 54400006 */ bnel $v0, $zero, .L80ACC8A0 -/* 02968 80ACC888 A60303F4 */ sh $v1, 0x03F4($s0) ## 000003F4 -/* 0296C 80ACC88C 0C01DF64 */ jal Rand_S16Offset - -/* 02970 80ACC890 2405003C */ addiu $a1, $zero, 0x003C ## $a1 = 0000003C -/* 02974 80ACC894 A60203F6 */ sh $v0, 0x03F6($s0) ## 000003F6 -/* 02978 80ACC898 860303F6 */ lh $v1, 0x03F6($s0) ## 000003F6 -/* 0297C 80ACC89C A60303F4 */ sh $v1, 0x03F4($s0) ## 000003F4 -.L80ACC8A0: -/* 02980 80ACC8A0 860803F4 */ lh $t0, 0x03F4($s0) ## 000003F4 -/* 02984 80ACC8A4 29010003 */ slti $at, $t0, 0x0003 -/* 02988 80ACC8A8 54200003 */ bnel $at, $zero, .L80ACC8B8 -/* 0298C 80ACC8AC 960203FC */ lhu $v0, 0x03FC($s0) ## 000003FC -/* 02990 80ACC8B0 A60003F4 */ sh $zero, 0x03F4($s0) ## 000003F4 -.L80ACC8B4: -/* 02994 80ACC8B4 960203FC */ lhu $v0, 0x03FC($s0) ## 000003FC -.L80ACC8B8: -/* 02998 80ACC8B8 30490008 */ andi $t1, $v0, 0x0008 ## $t1 = 00000000 -/* 0299C 80ACC8BC 1520013E */ bne $t1, $zero, .L80ACCDB8 -/* 029A0 80ACC8C0 304F0002 */ andi $t7, $v0, 0x0002 ## $t7 = 00000000 -/* 029A4 80ACC8C4 304A0010 */ andi $t2, $v0, 0x0010 ## $t2 = 00000000 -/* 029A8 80ACC8C8 11400055 */ beq $t2, $zero, .L80ACCA20 -/* 029AC 80ACC8CC 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 029B0 80ACC8D0 92020404 */ lbu $v0, 0x0404($s0) ## 00000404 -/* 029B4 80ACC8D4 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 029B8 80ACC8D8 240B0001 */ addiu $t3, $zero, 0x0001 ## $t3 = 00000001 -/* 029BC 80ACC8DC 10400007 */ beq $v0, $zero, .L80ACC8FC -/* 029C0 80ACC8E0 240C0006 */ addiu $t4, $zero, 0x0006 ## $t4 = 00000006 -/* 029C4 80ACC8E4 10410008 */ beq $v0, $at, .L80ACC908 -/* 029C8 80ACC8E8 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 029CC 80ACC8EC 10410037 */ beq $v0, $at, .L80ACC9CC -/* 029D0 80ACC8F0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 029D4 80ACC8F4 10000125 */ beq $zero, $zero, .L80ACCD8C -/* 029D8 80ACC8F8 860A03EE */ lh $t2, 0x03EE($s0) ## 000003EE -.L80ACC8FC: -/* 029DC 80ACC8FC A20B0404 */ sb $t3, 0x0404($s0) ## 00000404 -/* 029E0 80ACC900 10000121 */ beq $zero, $zero, .L80ACCD88 -/* 029E4 80ACC904 A20C0405 */ sb $t4, 0x0405($s0) ## 00000405 -.L80ACC908: -/* 029E8 80ACC908 920D0405 */ lbu $t5, 0x0405($s0) ## 00000405 -/* 029EC 80ACC90C 25AEFFFF */ addiu $t6, $t5, 0xFFFF ## $t6 = FFFFFFFF -/* 029F0 80ACC910 31C200FF */ andi $v0, $t6, 0x00FF ## $v0 = 000000FF -/* 029F4 80ACC914 1040000F */ beq $v0, $zero, .L80ACC954 -/* 029F8 80ACC918 A20E0405 */ sb $t6, 0x0405($s0) ## 00000405 -/* 029FC 80ACC91C 00402025 */ or $a0, $v0, $zero ## $a0 = 000000FF -/* 02A00 80ACC920 00042740 */ sll $a0, $a0, 29 -/* 02A04 80ACC924 0C01DE0D */ jal Math_CosS - ## coss? -/* 02A08 80ACC928 00042403 */ sra $a0, $a0, 16 -/* 02A0C 80ACC92C 3C014580 */ lui $at, 0x4580 ## $at = 45800000 -/* 02A10 80ACC930 44813000 */ mtc1 $at, $f6 ## $f6 = 4096.00 -/* 02A14 80ACC934 00000000 */ nop -/* 02A18 80ACC938 46060202 */ mul.s $f8, $f0, $f6 -/* 02A1C 80ACC93C 4600428D */ trunc.w.s $f10, $f8 -/* 02A20 80ACC940 44055000 */ mfc1 $a1, $f10 -/* 02A24 80ACC944 00000000 */ nop -/* 02A28 80ACC948 00052C00 */ sll $a1, $a1, 16 -/* 02A2C 80ACC94C 10000017 */ beq $zero, $zero, .L80ACC9AC -/* 02A30 80ACC950 00052C03 */ sra $a1, $a1, 16 -.L80ACC954: -/* 02A34 80ACC954 961803FC */ lhu $t8, 0x03FC($s0) ## 000003FC -/* 02A38 80ACC958 24080020 */ addiu $t0, $zero, 0x0020 ## $t0 = 00000020 -/* 02A3C 80ACC95C 33190002 */ andi $t9, $t8, 0x0002 ## $t9 = 00000000 -/* 02A40 80ACC960 53200004 */ beql $t9, $zero, .L80ACC974 -/* 02A44 80ACC964 A60803EE */ sh $t0, 0x03EE($s0) ## 000003EE -/* 02A48 80ACC968 10000002 */ beq $zero, $zero, .L80ACC974 -/* 02A4C 80ACC96C A60003EE */ sh $zero, 0x03EE($s0) ## 000003EE -/* 02A50 80ACC970 A60803EE */ sh $t0, 0x03EE($s0) ## 000003EE -.L80ACC974: -/* 02A54 80ACC974 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -/* 02A58 80ACC978 312A0020 */ andi $t2, $t1, 0x0020 ## $t2 = 00000000 -/* 02A5C 80ACC97C 51400006 */ beql $t2, $zero, .L80ACC998 -/* 02A60 80ACC980 860D03EE */ lh $t5, 0x03EE($s0) ## 000003EE -/* 02A64 80ACC984 860B03EE */ lh $t3, 0x03EE($s0) ## 000003EE -/* 02A68 80ACC988 256CFFFC */ addiu $t4, $t3, 0xFFFC ## $t4 = FFFFFFFC -/* 02A6C 80ACC98C 10000004 */ beq $zero, $zero, .L80ACC9A0 -/* 02A70 80ACC990 A60C03EE */ sh $t4, 0x03EE($s0) ## 000003EE -/* 02A74 80ACC994 860D03EE */ lh $t5, 0x03EE($s0) ## 000003EE -.L80ACC998: -/* 02A78 80ACC998 25AE0004 */ addiu $t6, $t5, 0x0004 ## $t6 = 00000004 -/* 02A7C 80ACC99C A60E03EE */ sh $t6, 0x03EE($s0) ## 000003EE -.L80ACC9A0: -/* 02A80 80ACC9A0 920F0404 */ lbu $t7, 0x0404($s0) ## 00000404 -/* 02A84 80ACC9A4 25F80001 */ addiu $t8, $t7, 0x0001 ## $t8 = 00000001 -/* 02A88 80ACC9A8 A2180404 */ sb $t8, 0x0404($s0) ## 00000404 -.L80ACC9AC: -/* 02A8C 80ACC9AC 961903FC */ lhu $t9, 0x03FC($s0) ## 000003FC -/* 02A90 80ACC9B0 33280020 */ andi $t0, $t9, 0x0020 ## $t0 = 00000000 -/* 02A94 80ACC9B4 510000F5 */ beql $t0, $zero, .L80ACCD8C -/* 02A98 80ACC9B8 860A03EE */ lh $t2, 0x03EE($s0) ## 000003EE -/* 02A9C 80ACC9BC 00052823 */ subu $a1, $zero, $a1 -/* 02AA0 80ACC9C0 00052C00 */ sll $a1, $a1, 16 -/* 02AA4 80ACC9C4 100000F0 */ beq $zero, $zero, .L80ACCD88 -/* 02AA8 80ACC9C8 00052C03 */ sra $a1, $a1, 16 -.L80ACC9CC: -/* 02AAC 80ACC9CC 0C2B3173 */ jal func_80ACC5CC -/* 02AB0 80ACC9D0 A7A50036 */ sh $a1, 0x0036($sp) -/* 02AB4 80ACC9D4 104000EC */ beq $v0, $zero, .L80ACCD88 -/* 02AB8 80ACC9D8 87A50036 */ lh $a1, 0x0036($sp) -/* 02ABC 80ACC9DC 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -/* 02AC0 80ACC9E0 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 02AC4 80ACC9E4 44816000 */ mtc1 $at, $f12 ## $f12 = 20.00 -/* 02AC8 80ACC9E8 312AFFEF */ andi $t2, $t1, 0xFFEF ## $t2 = 00000000 -/* 02ACC 80ACC9EC A60A03FC */ sh $t2, 0x03FC($s0) ## 000003FC -/* 02AD0 80ACC9F0 0C00CFBE */ jal Rand_ZeroFloat - -/* 02AD4 80ACC9F4 A7A50036 */ sh $a1, 0x0036($sp) -/* 02AD8 80ACC9F8 4600040D */ trunc.w.s $f16, $f0 -/* 02ADC 80ACC9FC A2000404 */ sb $zero, 0x0404($s0) ## 00000404 -/* 02AE0 80ACCA00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02AE4 80ACCA04 440C8000 */ mfc1 $t4, $f16 -/* 02AE8 80ACCA08 00000000 */ nop -/* 02AEC 80ACCA0C 258D003C */ addiu $t5, $t4, 0x003C ## $t5 = 0000003C -/* 02AF0 80ACCA10 0C2B29B0 */ jal func_80ACA6C0 -/* 02AF4 80ACCA14 A20D0406 */ sb $t5, 0x0406($s0) ## 00000406 -/* 02AF8 80ACCA18 100000DB */ beq $zero, $zero, .L80ACCD88 -/* 02AFC 80ACCA1C 87A50036 */ lh $a1, 0x0036($sp) -.L80ACCA20: -/* 02B00 80ACCA20 92020406 */ lbu $v0, 0x0406($s0) ## 00000406 -/* 02B04 80ACCA24 18400003 */ blez $v0, .L80ACCA34 -/* 02B08 80ACCA28 244EFFFF */ addiu $t6, $v0, 0xFFFF ## $t6 = FFFFFFFF -/* 02B0C 80ACCA2C 1000008B */ beq $zero, $zero, .L80ACCC5C -/* 02B10 80ACCA30 A20E0406 */ sb $t6, 0x0406($s0) ## 00000406 -.L80ACCA34: -/* 02B14 80ACCA34 92030404 */ lbu $v1, 0x0404($s0) ## 00000404 -/* 02B18 80ACCA38 54600014 */ bnel $v1, $zero, .L80ACCA8C -/* 02B1C 80ACCA3C 92090405 */ lbu $t1, 0x0405($s0) ## 00000405 -/* 02B20 80ACCA40 0C03F66B */ jal Rand_ZeroOne - ## Rand.Next() float -/* 02B24 80ACCA44 A7A50036 */ sh $a1, 0x0036($sp) -/* 02B28 80ACCA48 3C0180AD */ lui $at, %hi(D_80ACD854) ## $at = 80AD0000 -/* 02B2C 80ACCA4C C432D854 */ lwc1 $f18, %lo(D_80ACD854)($at) -/* 02B30 80ACCA50 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 02B34 80ACCA54 87A50036 */ lh $a1, 0x0036($sp) -/* 02B38 80ACCA58 4612003C */ c.lt.s $f0, $f18 -/* 02B3C 80ACCA5C 240F0004 */ addiu $t7, $zero, 0x0004 ## $t7 = 00000004 -/* 02B40 80ACCA60 2418000C */ addiu $t8, $zero, 0x000C ## $t8 = 0000000C -/* 02B44 80ACCA64 332300FF */ andi $v1, $t9, 0x00FF ## $v1 = 00000001 -/* 02B48 80ACCA68 45000005 */ bc1f .L80ACCA80 -/* 02B4C 80ACCA6C 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 -/* 02B50 80ACCA70 A20F0404 */ sb $t7, 0x0404($s0) ## 00000404 -/* 02B54 80ACCA74 A2180405 */ sb $t8, 0x0405($s0) ## 00000405 -/* 02B58 80ACCA78 10000003 */ beq $zero, $zero, .L80ACCA88 -/* 02B5C 80ACCA7C 31E300FF */ andi $v1, $t7, 0x00FF ## $v1 = 00000004 -.L80ACCA80: -/* 02B60 80ACCA80 A2190404 */ sb $t9, 0x0404($s0) ## 00000404 -/* 02B64 80ACCA84 A2080405 */ sb $t0, 0x0405($s0) ## 00000405 -.L80ACCA88: -/* 02B68 80ACCA88 92090405 */ lbu $t1, 0x0405($s0) ## 00000405 -.L80ACCA8C: -/* 02B6C 80ACCA8C 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 02B70 80ACCA90 252AFFFF */ addiu $t2, $t1, 0xFFFF ## $t2 = FFFFFFFF -/* 02B74 80ACCA94 1061000A */ beq $v1, $at, .L80ACCAC0 -/* 02B78 80ACCA98 A20A0405 */ sb $t2, 0x0405($s0) ## 00000405 -/* 02B7C 80ACCA9C 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 02B80 80ACCAA0 10610026 */ beq $v1, $at, .L80ACCB3C -/* 02B84 80ACCAA4 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 02B88 80ACCAA8 1061002C */ beq $v1, $at, .L80ACCB5C -/* 02B8C 80ACCAAC 24010004 */ addiu $at, $zero, 0x0004 ## $at = 00000004 -/* 02B90 80ACCAB0 50610048 */ beql $v1, $at, .L80ACCBD4 -/* 02B94 80ACCAB4 92040405 */ lbu $a0, 0x0405($s0) ## 00000405 -/* 02B98 80ACCAB8 10000062 */ beq $zero, $zero, .L80ACCC44 -/* 02B9C 80ACCABC 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -.L80ACCAC0: -/* 02BA0 80ACCAC0 92040405 */ lbu $a0, 0x0405($s0) ## 00000405 -/* 02BA4 80ACCAC4 00042023 */ subu $a0, $zero, $a0 -/* 02BA8 80ACCAC8 00042300 */ sll $a0, $a0, 12 -/* 02BAC 80ACCACC 24844000 */ addiu $a0, $a0, 0x4000 ## $a0 = 00004000 -/* 02BB0 80ACCAD0 00042400 */ sll $a0, $a0, 16 -/* 02BB4 80ACCAD4 0C01DE1C */ jal Math_SinS - ## sins? -/* 02BB8 80ACCAD8 00042403 */ sra $a0, $a0, 16 -/* 02BBC 80ACCADC 3C0180AD */ lui $at, %hi(D_80ACD858) ## $at = 80AD0000 -/* 02BC0 80ACCAE0 C424D858 */ lwc1 $f4, %lo(D_80ACD858)($at) -/* 02BC4 80ACCAE4 920C0405 */ lbu $t4, 0x0405($s0) ## 00000405 -/* 02BC8 80ACCAE8 3C014170 */ lui $at, 0x4170 ## $at = 41700000 -/* 02BCC 80ACCAEC 46040182 */ mul.s $f6, $f0, $f4 -/* 02BD0 80ACCAF0 4600320D */ trunc.w.s $f8, $f6 -/* 02BD4 80ACCAF4 44054000 */ mfc1 $a1, $f8 -/* 02BD8 80ACCAF8 00000000 */ nop -/* 02BDC 80ACCAFC 00052C00 */ sll $a1, $a1, 16 -/* 02BE0 80ACCB00 1D80004F */ bgtz $t4, .L80ACCC40 -/* 02BE4 80ACCB04 00052C03 */ sra $a1, $a1, 16 -/* 02BE8 80ACCB08 44816000 */ mtc1 $at, $f12 ## $f12 = 15.00 -/* 02BEC 80ACCB0C 0C00CFBE */ jal Rand_ZeroFloat - -/* 02BF0 80ACCB10 A7A50036 */ sh $a1, 0x0036($sp) -/* 02BF4 80ACCB14 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 -/* 02BF8 80ACCB18 44815000 */ mtc1 $at, $f10 ## $f10 = 5.00 -/* 02BFC 80ACCB1C 87A50036 */ lh $a1, 0x0036($sp) -/* 02C00 80ACCB20 240F0002 */ addiu $t7, $zero, 0x0002 ## $t7 = 00000002 -/* 02C04 80ACCB24 460A0400 */ add.s $f16, $f0, $f10 -/* 02C08 80ACCB28 A20F0404 */ sb $t7, 0x0404($s0) ## 00000404 -/* 02C0C 80ACCB2C 4600848D */ trunc.w.s $f18, $f16 -/* 02C10 80ACCB30 440E9000 */ mfc1 $t6, $f18 -/* 02C14 80ACCB34 10000042 */ beq $zero, $zero, .L80ACCC40 -/* 02C18 80ACCB38 A20E0405 */ sb $t6, 0x0405($s0) ## 00000405 -.L80ACCB3C: -/* 02C1C 80ACCB3C 92180405 */ lbu $t8, 0x0405($s0) ## 00000405 -/* 02C20 80ACCB40 24051388 */ addiu $a1, $zero, 0x1388 ## $a1 = 00001388 -/* 02C24 80ACCB44 24190003 */ addiu $t9, $zero, 0x0003 ## $t9 = 00000003 -/* 02C28 80ACCB48 1F00003D */ bgtz $t8, .L80ACCC40 -/* 02C2C 80ACCB4C 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 -/* 02C30 80ACCB50 A2190404 */ sb $t9, 0x0404($s0) ## 00000404 -/* 02C34 80ACCB54 1000003A */ beq $zero, $zero, .L80ACCC40 -/* 02C38 80ACCB58 A2080405 */ sb $t0, 0x0405($s0) ## 00000405 -.L80ACCB5C: -/* 02C3C 80ACCB5C 92040405 */ lbu $a0, 0x0405($s0) ## 00000405 -/* 02C40 80ACCB60 00042300 */ sll $a0, $a0, 12 -/* 02C44 80ACCB64 00042400 */ sll $a0, $a0, 16 -/* 02C48 80ACCB68 0C01DE1C */ jal Math_SinS - ## sins? -/* 02C4C 80ACCB6C 00042403 */ sra $a0, $a0, 16 -/* 02C50 80ACCB70 3C0180AD */ lui $at, %hi(D_80ACD85C) ## $at = 80AD0000 -/* 02C54 80ACCB74 C424D85C */ lwc1 $f4, %lo(D_80ACD85C)($at) -/* 02C58 80ACCB78 920A0405 */ lbu $t2, 0x0405($s0) ## 00000405 -/* 02C5C 80ACCB7C 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 02C60 80ACCB80 46040182 */ mul.s $f6, $f0, $f4 -/* 02C64 80ACCB84 4600320D */ trunc.w.s $f8, $f6 -/* 02C68 80ACCB88 44054000 */ mfc1 $a1, $f8 -/* 02C6C 80ACCB8C 00000000 */ nop -/* 02C70 80ACCB90 00052C00 */ sll $a1, $a1, 16 -/* 02C74 80ACCB94 1D40002A */ bgtz $t2, .L80ACCC40 -/* 02C78 80ACCB98 00052C03 */ sra $a1, $a1, 16 -/* 02C7C 80ACCB9C 44816000 */ mtc1 $at, $f12 ## $f12 = 20.00 -/* 02C80 80ACCBA0 0C00CFBE */ jal Rand_ZeroFloat - -/* 02C84 80ACCBA4 A7A50036 */ sh $a1, 0x0036($sp) -/* 02C88 80ACCBA8 4600028D */ trunc.w.s $f10, $f0 -/* 02C8C 80ACCBAC A2000404 */ sb $zero, 0x0404($s0) ## 00000404 -/* 02C90 80ACCBB0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02C94 80ACCBB4 440C5000 */ mfc1 $t4, $f10 -/* 02C98 80ACCBB8 00000000 */ nop -/* 02C9C 80ACCBBC 258D003C */ addiu $t5, $t4, 0x003C ## $t5 = 0000003C -/* 02CA0 80ACCBC0 0C2B29B0 */ jal func_80ACA6C0 -/* 02CA4 80ACCBC4 A20D0406 */ sb $t5, 0x0406($s0) ## 00000406 -/* 02CA8 80ACCBC8 1000001D */ beq $zero, $zero, .L80ACCC40 -/* 02CAC 80ACCBCC 87A50036 */ lh $a1, 0x0036($sp) -/* 02CB0 80ACCBD0 92040405 */ lbu $a0, 0x0405($s0) ## 00000405 -.L80ACCBD4: -/* 02CB4 80ACCBD4 00042340 */ sll $a0, $a0, 13 -/* 02CB8 80ACCBD8 00042400 */ sll $a0, $a0, 16 -/* 02CBC 80ACCBDC 0C01DE1C */ jal Math_SinS - ## sins? -/* 02CC0 80ACCBE0 00042403 */ sra $a0, $a0, 16 -/* 02CC4 80ACCBE4 3C0180AD */ lui $at, %hi(D_80ACD860) ## $at = 80AD0000 -/* 02CC8 80ACCBE8 C430D860 */ lwc1 $f16, %lo(D_80ACD860)($at) -/* 02CCC 80ACCBEC 920F0405 */ lbu $t7, 0x0405($s0) ## 00000405 -/* 02CD0 80ACCBF0 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 -/* 02CD4 80ACCBF4 46100482 */ mul.s $f18, $f0, $f16 -/* 02CD8 80ACCBF8 4600910D */ trunc.w.s $f4, $f18 -/* 02CDC 80ACCBFC 44052000 */ mfc1 $a1, $f4 -/* 02CE0 80ACCC00 00000000 */ nop -/* 02CE4 80ACCC04 00052C00 */ sll $a1, $a1, 16 -/* 02CE8 80ACCC08 1DE0000D */ bgtz $t7, .L80ACCC40 -/* 02CEC 80ACCC0C 00052C03 */ sra $a1, $a1, 16 -/* 02CF0 80ACCC10 44816000 */ mtc1 $at, $f12 ## $f12 = 20.00 -/* 02CF4 80ACCC14 0C00CFBE */ jal Rand_ZeroFloat - -/* 02CF8 80ACCC18 A7A50036 */ sh $a1, 0x0036($sp) -/* 02CFC 80ACCC1C 4600018D */ trunc.w.s $f6, $f0 -/* 02D00 80ACCC20 A2000404 */ sb $zero, 0x0404($s0) ## 00000404 -/* 02D04 80ACCC24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 02D08 80ACCC28 44193000 */ mfc1 $t9, $f6 -/* 02D0C 80ACCC2C 00000000 */ nop -/* 02D10 80ACCC30 2728003C */ addiu $t0, $t9, 0x003C ## $t0 = 0000003C -/* 02D14 80ACCC34 0C2B29B0 */ jal func_80ACA6C0 -/* 02D18 80ACCC38 A2080406 */ sb $t0, 0x0406($s0) ## 00000406 -/* 02D1C 80ACCC3C 87A50036 */ lh $a1, 0x0036($sp) -.L80ACCC40: -/* 02D20 80ACCC40 960903FC */ lhu $t1, 0x03FC($s0) ## 000003FC -.L80ACCC44: -/* 02D24 80ACCC44 312A0020 */ andi $t2, $t1, 0x0020 ## $t2 = 00000000 -/* 02D28 80ACCC48 51400005 */ beql $t2, $zero, .L80ACCC60 -/* 02D2C 80ACCC4C 92020409 */ lbu $v0, 0x0409($s0) ## 00000409 -/* 02D30 80ACCC50 00052823 */ subu $a1, $zero, $a1 -/* 02D34 80ACCC54 00052C00 */ sll $a1, $a1, 16 -/* 02D38 80ACCC58 00052C03 */ sra $a1, $a1, 16 -.L80ACCC5C: -/* 02D3C 80ACCC5C 92020409 */ lbu $v0, 0x0409($s0) ## 00000409 -.L80ACCC60: -/* 02D40 80ACCC60 18400003 */ blez $v0, .L80ACCC70 -/* 02D44 80ACCC64 244BFFFF */ addiu $t3, $v0, 0xFFFF ## $t3 = FFFFFFFF -/* 02D48 80ACCC68 10000047 */ beq $zero, $zero, .L80ACCD88 -/* 02D4C 80ACCC6C A20B0409 */ sb $t3, 0x0409($s0) ## 00000409 -.L80ACCC70: -/* 02D50 80ACCC70 920C0408 */ lbu $t4, 0x0408($s0) ## 00000408 -/* 02D54 80ACCC74 92020407 */ lbu $v0, 0x0407($s0) ## 00000407 -/* 02D58 80ACCC78 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 02D5C 80ACCC7C 258DFFFF */ addiu $t5, $t4, 0xFFFF ## $t5 = FFFFFFFF -/* 02D60 80ACCC80 10400007 */ beq $v0, $zero, .L80ACCCA0 -/* 02D64 80ACCC84 A20D0408 */ sb $t5, 0x0408($s0) ## 00000408 -/* 02D68 80ACCC88 1041001F */ beq $v0, $at, .L80ACCD08 -/* 02D6C 80ACCC8C 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -/* 02D70 80ACCC90 50410027 */ beql $v0, $at, .L80ACCD30 -/* 02D74 80ACCC94 92020408 */ lbu $v0, 0x0408($s0) ## 00000408 -/* 02D78 80ACCC98 1000003C */ beq $zero, $zero, .L80ACCD8C -/* 02D7C 80ACCC9C 860A03EE */ lh $t2, 0x03EE($s0) ## 000003EE -.L80ACCCA0: -/* 02D80 80ACCCA0 92020408 */ lbu $v0, 0x0408($s0) ## 00000408 -/* 02D84 80ACCCA4 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 -/* 02D88 80ACCCA8 3C014170 */ lui $at, 0x4170 ## $at = 41700000 -/* 02D8C 80ACCCAC 00027023 */ subu $t6, $zero, $v0 -/* 02D90 80ACCCB0 000E7880 */ sll $t7, $t6, 2 -/* 02D94 80ACCCB4 01EE7823 */ subu $t7, $t7, $t6 -/* 02D98 80ACCCB8 000F7900 */ sll $t7, $t7, 4 -/* 02D9C 80ACCCBC 01EE7823 */ subu $t7, $t7, $t6 -/* 02DA0 80ACCCC0 000F78C0 */ sll $t7, $t7, 3 -/* 02DA4 80ACCCC4 01EE7823 */ subu $t7, $t7, $t6 -/* 02DA8 80ACCCC8 000F7880 */ sll $t7, $t7, 2 -/* 02DAC 80ACCCCC 25F81770 */ addiu $t8, $t7, 0x1770 ## $t8 = 00001770 -/* 02DB0 80ACCCD0 1C40002D */ bgtz $v0, .L80ACCD88 -/* 02DB4 80ACCCD4 A61803F2 */ sh $t8, 0x03F2($s0) ## 000003F2 -/* 02DB8 80ACCCD8 A2190407 */ sb $t9, 0x0407($s0) ## 00000407 -/* 02DBC 80ACCCDC 44816000 */ mtc1 $at, $f12 ## $f12 = 15.00 -/* 02DC0 80ACCCE0 0C00CFBE */ jal Rand_ZeroFloat - -/* 02DC4 80ACCCE4 A7A50036 */ sh $a1, 0x0036($sp) -/* 02DC8 80ACCCE8 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 -/* 02DCC 80ACCCEC 44814000 */ mtc1 $at, $f8 ## $f8 = 5.00 -/* 02DD0 80ACCCF0 87A50036 */ lh $a1, 0x0036($sp) -/* 02DD4 80ACCCF4 46080280 */ add.s $f10, $f0, $f8 -/* 02DD8 80ACCCF8 4600540D */ trunc.w.s $f16, $f10 -/* 02DDC 80ACCCFC 44098000 */ mfc1 $t1, $f16 -/* 02DE0 80ACCD00 10000021 */ beq $zero, $zero, .L80ACCD88 -/* 02DE4 80ACCD04 A2090408 */ sb $t1, 0x0408($s0) ## 00000408 -.L80ACCD08: -/* 02DE8 80ACCD08 920B0408 */ lbu $t3, 0x0408($s0) ## 00000408 -/* 02DEC 80ACCD0C 240A1770 */ addiu $t2, $zero, 0x1770 ## $t2 = 00001770 -/* 02DF0 80ACCD10 A60A03F2 */ sh $t2, 0x03F2($s0) ## 000003F2 -/* 02DF4 80ACCD14 1D60001C */ bgtz $t3, .L80ACCD88 -/* 02DF8 80ACCD18 240C0002 */ addiu $t4, $zero, 0x0002 ## $t4 = 00000002 -/* 02DFC 80ACCD1C 240D0004 */ addiu $t5, $zero, 0x0004 ## $t5 = 00000004 -/* 02E00 80ACCD20 A20C0407 */ sb $t4, 0x0407($s0) ## 00000407 -/* 02E04 80ACCD24 10000018 */ beq $zero, $zero, .L80ACCD88 -/* 02E08 80ACCD28 A20D0408 */ sb $t5, 0x0408($s0) ## 00000408 -/* 02E0C 80ACCD2C 92020408 */ lbu $v0, 0x0408($s0) ## 00000408 -.L80ACCD30: -/* 02E10 80ACCD30 240F0004 */ addiu $t7, $zero, 0x0004 ## $t7 = 00000004 -/* 02E14 80ACCD34 3C014220 */ lui $at, 0x4220 ## $at = 42200000 -/* 02E18 80ACCD38 00027080 */ sll $t6, $v0, 2 -/* 02E1C 80ACCD3C 01C27023 */ subu $t6, $t6, $v0 -/* 02E20 80ACCD40 000E7100 */ sll $t6, $t6, 4 -/* 02E24 80ACCD44 01C27023 */ subu $t6, $t6, $v0 -/* 02E28 80ACCD48 000E70C0 */ sll $t6, $t6, 3 -/* 02E2C 80ACCD4C 01C27023 */ subu $t6, $t6, $v0 -/* 02E30 80ACCD50 000E7080 */ sll $t6, $t6, 2 -/* 02E34 80ACCD54 1C40000C */ bgtz $v0, .L80ACCD88 -/* 02E38 80ACCD58 A60E03F2 */ sh $t6, 0x03F2($s0) ## 000003F2 -/* 02E3C 80ACCD5C A2000407 */ sb $zero, 0x0407($s0) ## 00000407 -/* 02E40 80ACCD60 A20F0408 */ sb $t7, 0x0408($s0) ## 00000408 -/* 02E44 80ACCD64 44816000 */ mtc1 $at, $f12 ## $f12 = 40.00 -/* 02E48 80ACCD68 0C00CFBE */ jal Rand_ZeroFloat - -/* 02E4C 80ACCD6C A7A50036 */ sh $a1, 0x0036($sp) -/* 02E50 80ACCD70 4600048D */ trunc.w.s $f18, $f0 -/* 02E54 80ACCD74 87A50036 */ lh $a1, 0x0036($sp) -/* 02E58 80ACCD78 44199000 */ mfc1 $t9, $f18 -/* 02E5C 80ACCD7C 00000000 */ nop -/* 02E60 80ACCD80 272800A0 */ addiu $t0, $t9, 0x00A0 ## $t0 = 000000A0 -/* 02E64 80ACCD84 A2080409 */ sb $t0, 0x0409($s0) ## 00000409 -.L80ACCD88: -/* 02E68 80ACCD88 860A03EE */ lh $t2, 0x03EE($s0) ## 000003EE -.L80ACCD8C: -/* 02E6C 80ACCD8C 000A6280 */ sll $t4, $t2, 10 -/* 02E70 80ACCD90 01856821 */ addu $t5, $t4, $a1 -/* 02E74 80ACCD94 A60D03F0 */ sh $t5, 0x03F0($s0) ## 000003F0 -/* 02E78 80ACCD98 860303F0 */ lh $v1, 0x03F0($s0) ## 000003F0 -/* 02E7C 80ACCD9C 04600003 */ bltz $v1, .L80ACCDAC -/* 02E80 80ACCDA0 00031023 */ subu $v0, $zero, $v1 -/* 02E84 80ACCDA4 10000001 */ beq $zero, $zero, .L80ACCDAC -/* 02E88 80ACCDA8 00601025 */ or $v0, $v1, $zero ## $v0 = 00000000 -.L80ACCDAC: -/* 02E8C 80ACCDAC 000270C3 */ sra $t6, $v0, 3 -/* 02E90 80ACCDB0 1000000E */ beq $zero, $zero, .L80ACCDEC -/* 02E94 80ACCDB4 A60E03EC */ sh $t6, 0x03EC($s0) ## 000003EC -.L80ACCDB8: -/* 02E98 80ACCDB8 11E00004 */ beq $t7, $zero, .L80ACCDCC -/* 02E9C 80ACCDBC A60003F2 */ sh $zero, 0x03F2($s0) ## 000003F2 -/* 02EA0 80ACCDC0 24188000 */ addiu $t8, $zero, 0x8000 ## $t8 = FFFF8000 -/* 02EA4 80ACCDC4 10000002 */ beq $zero, $zero, .L80ACCDD0 -/* 02EA8 80ACCDC8 A61803F0 */ sh $t8, 0x03F0($s0) ## 000003F0 -.L80ACCDCC: -/* 02EAC 80ACCDCC A60003F0 */ sh $zero, 0x03F0($s0) ## 000003F0 -.L80ACCDD0: -/* 02EB0 80ACCDD0 860303F0 */ lh $v1, 0x03F0($s0) ## 000003F0 -/* 02EB4 80ACCDD4 04600003 */ bltz $v1, .L80ACCDE4 -/* 02EB8 80ACCDD8 00031023 */ subu $v0, $zero, $v1 -/* 02EBC 80ACCDDC 10000001 */ beq $zero, $zero, .L80ACCDE4 -/* 02EC0 80ACCDE0 00601025 */ or $v0, $v1, $zero ## $v0 = 00000000 -.L80ACCDE4: -/* 02EC4 80ACCDE4 0002C8C3 */ sra $t9, $v0, 3 -/* 02EC8 80ACCDE8 A61903EC */ sh $t9, 0x03EC($s0) ## 000003EC -.L80ACCDEC: -/* 02ECC 80ACCDEC 8FBF0024 */ lw $ra, 0x0024($sp) -.L80ACCDF0: -/* 02ED0 80ACCDF0 8FB00020 */ lw $s0, 0x0020($sp) -/* 02ED4 80ACCDF4 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 02ED8 80ACCDF8 03E00008 */ jr $ra -/* 02EDC 80ACCDFC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s index 84ef7eae57..95d123955c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s @@ -54,7 +54,7 @@ glabel EnPeehat_Draw /* 03250 80AD26F0 260403AC */ addiu $a0, $s0, 0x03AC ## $a0 = 000003AC /* 03254 80AD26F4 8FA50038 */ lw $a1, 0x0038($sp) /* 03258 80AD26F8 8FA60034 */ lw $a2, 0x0034($sp) -/* 0325C 80AD26FC 0C0189CD */ jal func_80062734 +/* 0325C 80AD26FC 0C0189CD */ jal Collider_SetQuadVertices /* 03260 80AD2700 AFB80010 */ sw $t8, 0x0010($sp) /* 03264 80AD2704 8FBF0024 */ lw $ra, 0x0024($sp) .L80AD2708: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s index dfbf270492..768ca36983 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s @@ -37,8 +37,8 @@ glabel EnPeehat_Init /* 00068 80ACF508 0C02915F */ jal SkelAnime_Init /* 0006C 80ACF50C 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 00070 80ACF510 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00074 80ACF514 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00070 80ACF510 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00074 80ACF514 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00078 80ACF518 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0007C 80ACF51C 3C0542C8 */ lui $a1, 0x42C8 ## $a1 = 42C80000 /* 00080 80ACF520 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s index 4442b0742a..b6654e41de 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s @@ -49,7 +49,7 @@ glabel EnPeehat_Update /* 029C0 80AD1E60 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 029C4 80AD1E64 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 029C8 80AD1E68 3C0641C8 */ lui $a2, 0x41C8 ## $a2 = 41C80000 -/* 029CC 80AD1E6C 0C00B92D */ jal func_8002E4B4 +/* 029CC 80AD1E6C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 029D0 80AD1E70 E7A00010 */ swc1 $f0, 0x0010($sp) /* 029D4 80AD1E74 8E7902B8 */ lw $t9, 0x02B8($s3) ## 000002B8 .L80AD1E78: @@ -132,7 +132,7 @@ glabel EnPeehat_Update /* 02AEC 80AD1F8C 26720300 */ addiu $s2, $s3, 0x0300 ## $s2 = 00000300 .L80AD1F90: /* 02AF0 80AD1F90 02402825 */ or $a1, $s2, $zero ## $a1 = 00000300 -/* 02AF4 80AD1F94 0C0189B7 */ jal Collider_CylinderUpdate +/* 02AF4 80AD1F94 0C0189B7 */ jal Collider_UpdateCylinder /* 02AF8 80AD1F98 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 02AFC 80AD1F9C 926A00AF */ lbu $t2, 0x00AF($s3) ## 000000AF @@ -146,13 +146,13 @@ glabel EnPeehat_Update /* 02B1C 80AD1FBC 02818021 */ addu $s0, $s4, $at /* 02B20 80AD1FC0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02B24 80AD1FC4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B28 80AD1FC8 02403025 */ or $a2, $s2, $zero ## $a2 = 00000300 /* 02B2C 80AD1FCC 2671034C */ addiu $s1, $s3, 0x034C ## $s1 = 0000034C /* 02B30 80AD1FD0 02203025 */ or $a2, $s1, $zero ## $a2 = 0000034C /* 02B34 80AD1FD4 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 02B38 80AD1FD8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B3C 80AD1FDC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02B40 80AD1FE0 926C0114 */ lbu $t4, 0x0114($s3) ## 00000114 /* 02B44 80AD1FE4 51800006 */ beql $t4, $zero, .L80AD2000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s index 70b39ae24d..fe4db347e3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s @@ -71,7 +71,7 @@ glabel func_80AD2438 /* 03040 80AD24E0 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 03044 80AD24E4 8FA50050 */ lw $a1, 0x0050($sp) /* 03048 80AD24E8 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 0304C 80AD24EC 0C018A29 */ jal func_800628A4 +/* 0304C 80AD24EC 0C018A29 */ jal Collider_UpdateSpheres /* 03050 80AD24F0 24A5034C */ addiu $a1, $a1, 0x034C ## $a1 = 0000034C /* 03054 80AD24F4 3C0143FA */ lui $at, 0x43FA ## $at = 43FA0000 /* 03058 80AD24F8 44816000 */ mtc1 $at, $f12 ## $f12 = 500.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s index db556ec351..496f2ea3ff 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s @@ -16,8 +16,8 @@ glabel EnSa_Init /* 00C60 80AF61C0 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 00C64 80AF61C4 AFBF003C */ sw $ra, 0x003C($sp) /* 00C68 80AF61C8 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 -/* 00C6C 80AF61CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00C70 80AF61D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00C6C 80AF61CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00C70 80AF61D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00C74 80AF61D4 AFA40044 */ sw $a0, 0x0044($sp) /* 00C78 80AF61D8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00C7C 80AF61DC 0C00AC78 */ jal ActorShape_Init @@ -50,7 +50,7 @@ glabel EnSa_Init /* 00CDC 80AF623C 3C0680AF */ lui $a2, %hi(D_80AF728C) ## $a2 = 80AF0000 /* 00CE0 80AF6240 24C6728C */ addiu $a2, $a2, %lo(D_80AF728C) ## $a2 = 80AF728C /* 00CE4 80AF6244 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00CE8 80AF6248 0C0187BF */ jal func_80061EFC +/* 00CE8 80AF6248 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00CEC 80AF624C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00CF0 80AF6250 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00CF4 80AF6254 0C2BD77F */ jal func_80AF5DFC diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s index b8e3e9dff6..6820b585ee 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s @@ -7,7 +7,7 @@ glabel EnSa_Update /* 01694 80AF6BF4 AFBF0024 */ sw $ra, 0x0024($sp) /* 01698 80AF6BF8 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 0169C 80AF6BFC 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 016A0 80AF6C00 0C0189B7 */ jal Collider_CylinderUpdate +/* 016A0 80AF6C00 0C0189B7 */ jal Collider_UpdateCylinder /* 016A4 80AF6C04 AFA6002C */ sw $a2, 0x002C($sp) /* 016A8 80AF6C08 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnSa_Update /* 016B0 80AF6C10 8FA6002C */ lw $a2, 0x002C($sp) /* 016B4 80AF6C14 02212821 */ addu $a1, $s1, $at /* 016B8 80AF6C18 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 016BC 80AF6C1C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 016C0 80AF6C20 0C02927F */ jal SkelAnime_Update @@ -87,7 +87,7 @@ glabel EnSa_Update /* 017B0 80AF6D10 AFAA0014 */ sw $t2, 0x0014($sp) /* 017B4 80AF6D14 44060000 */ mfc1 $a2, $f0 /* 017B8 80AF6D18 44070000 */ mfc1 $a3, $f0 -/* 017BC 80AF6D1C 0C00B92D */ jal func_8002E4B4 +/* 017BC 80AF6D1C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 017C0 80AF6D20 E7A00010 */ swc1 $f0, 0x0010($sp) .L80AF6D24: /* 017C4 80AF6D24 0C2BD827 */ jal func_80AF609C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s index c887128ac3..732575175f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s @@ -19,11 +19,11 @@ glabel EnSkb_Init /* 001D8 80AFCB78 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001DC 80AFCB7C 3C0E80B0 */ lui $t6, %hi(D_80AFE078) ## $t6 = 80B00000 /* 001E0 80AFCB80 25CEE078 */ addiu $t6, $t6, %lo(D_80AFE078) ## $t6 = 80AFE078 -/* 001E4 80AFCB84 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 001E4 80AFCB84 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 001E8 80AFCB88 44050000 */ mfc1 $a1, $f0 /* 001EC 80AFCB8C 44070000 */ mfc1 $a3, $f0 /* 001F0 80AFCB90 AE0E0098 */ sw $t6, 0x0098($s0) ## 00000098 -/* 001F4 80AFCB94 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001F4 80AFCB94 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001F8 80AFCB98 0C00AC78 */ jal ActorShape_Init /* 001FC 80AFCB9C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s index b67f771438..f9ef234c22 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s @@ -22,7 +22,7 @@ glabel EnSkb_Update /* 012A8 80AFDC48 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 012AC 80AFDC4C 3C064170 */ lui $a2, 0x4170 ## $a2 = 41700000 /* 012B0 80AFDC50 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 012B4 80AFDC54 0C00B92D */ jal func_8002E4B4 +/* 012B4 80AFDC54 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 012B8 80AFDC58 E7A40010 */ swc1 $f4, 0x0010($sp) /* 012BC 80AFDC5C 8E190284 */ lw $t9, 0x0284($s0) ## 00000284 /* 012C0 80AFDC60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -76,7 +76,7 @@ glabel EnSkb_Update /* 01370 80AFDD10 8FA60028 */ lw $a2, 0x0028($sp) .L80AFDD14: /* 01374 80AFDD14 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01378 80AFDD18 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0137C 80AFDD1C 8FBF0024 */ lw $ra, 0x0024($sp) /* 01380 80AFDD20 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s index 38dcd8165b..b46bcd2227 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s @@ -7,7 +7,7 @@ glabel func_80AFDF24 /* 01598 80AFDF38 AFBF0024 */ sw $ra, 0x0024($sp) /* 0159C 80AFDF3C AFA60030 */ sw $a2, 0x0030($sp) /* 015A0 80AFDF40 AFA70034 */ sw $a3, 0x0034($sp) -/* 015A4 80AFDF44 0C018A29 */ jal func_800628A4 +/* 015A4 80AFDF44 0C018A29 */ jal Collider_UpdateSpheres /* 015A8 80AFDF48 24A502A4 */ addiu $a1, $a1, 0x02A4 ## $a1 = 000002A4 /* 015AC 80AFDF4C 8FA30038 */ lw $v1, 0x0038($sp) /* 015B0 80AFDF50 8FA5002C */ lw $a1, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s index 0bd9ea7273..3265db1dff 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s @@ -41,7 +41,7 @@ glabel EnSkj_Init /* 00290 80AFE540 8FA40054 */ lw $a0, 0x0054($sp) /* 00294 80AFE544 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00298 80AFE548 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 0029C 80AFE54C 0C00CDD2 */ jal Actor_ChangeType +/* 0029C 80AFE54C 0C00CDD2 */ jal Actor_ChangeCategory /* 002A0 80AFE550 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002A4 80AFE554 100000D7 */ beq $zero, $zero, .L80AFE8B4 @@ -64,7 +64,7 @@ glabel EnSkj_Init /* 002E4 80AFE594 8FA40054 */ lw $a0, 0x0054($sp) /* 002E8 80AFE598 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 002EC 80AFE59C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 002F0 80AFE5A0 0C00CDD2 */ jal Actor_ChangeType +/* 002F0 80AFE5A0 0C00CDD2 */ jal Actor_ChangeCategory /* 002F4 80AFE5A4 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002F8 80AFE5A8 3C0180B0 */ lui $at, %hi(D_80B018F8) ## $at = 80B00000 @@ -132,7 +132,7 @@ glabel EnSkj_Init /* 003E4 80AFE694 AE0F0004 */ sw $t7, 0x0004($s0) ## 00000004 /* 003E8 80AFE698 A7A3004E */ sh $v1, 0x004E($sp) /* 003EC 80AFE69C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 003F0 80AFE6A0 0C00CDD2 */ jal Actor_ChangeType +/* 003F0 80AFE6A0 0C00CDD2 */ jal Actor_ChangeCategory /* 003F4 80AFE6A4 24070004 */ addiu $a3, $zero, 0x0004 ## $a3 = 00000004 /* 003F8 80AFE6A8 87A3004E */ lh $v1, 0x004E($sp) @@ -192,10 +192,10 @@ glabel EnSkj_Init /* 004B8 80AFE768 8FA50034 */ lw $a1, 0x0034($sp) /* 004BC 80AFE76C 24E71678 */ addiu $a3, $a3, %lo(D_80B01678) ## $a3 = 80B01678 /* 004C0 80AFE770 8FA40054 */ lw $a0, 0x0054($sp) -/* 004C4 80AFE774 0C017114 */ jal Collider_SetCylinder_Set3 +/* 004C4 80AFE774 0C017114 */ jal Collider_SetCylinderType1 /* 004C8 80AFE778 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 004CC 80AFE77C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 004D0 80AFE780 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 004CC 80AFE77C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 004D0 80AFE780 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 004D4 80AFE784 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 004D8 80AFE788 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 004DC 80AFE78C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s index b2ee62f545..620628f1d0 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s @@ -61,7 +61,7 @@ glabel EnSkj_Update /* 025A8 80B00858 1000003E */ beq $zero, $zero, .L80B00954 /* 025AC 80B0085C 8FBF0024 */ lw $ra, 0x0024($sp) .L80B00860: -/* 025B0 80B00860 0C00B56E */ jal Actor_SetHeight +/* 025B0 80B00860 0C00B56E */ jal Actor_SetFocus /* 025B4 80B00864 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 025B8 80B00868 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -81,7 +81,7 @@ glabel EnSkj_Update /* 025EC 80B0089C A60D010E */ sh $t5, 0x010E($s0) ## 0000010E /* 025F0 80B008A0 26050278 */ addiu $a1, $s0, 0x0278 ## $a1 = 00000278 /* 025F4 80B008A4 AFA5002C */ sw $a1, 0x002C($sp) -/* 025F8 80B008A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 025F8 80B008A8 0C0189B7 */ jal Collider_UpdateCylinder /* 025FC 80B008AC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02600 80B008B0 920E02D3 */ lbu $t6, 0x02D3($s0) ## 000002D3 @@ -113,7 +113,7 @@ glabel EnSkj_Update /* 02658 80B00908 02212821 */ addu $a1, $s1, $at /* 0265C 80B0090C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02660 80B00910 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02664 80B00914 8FA6002C */ lw $a2, 0x002C($sp) /* 02668 80B00918 0C02927F */ jal SkelAnime_Update @@ -129,7 +129,7 @@ glabel EnSkj_Update /* 0268C 80B0093C 44070000 */ mfc1 $a3, $f0 /* 02690 80B00940 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02694 80B00944 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02698 80B00948 0C00B92D */ jal func_8002E4B4 +/* 02698 80B00948 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0269C 80B0094C E7A00010 */ swc1 $f0, 0x0010($sp) /* 026A0 80B00950 8FBF0024 */ lw $ra, 0x0024($sp) .L80B00954: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s index 9a7e64be03..1cde33369a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s @@ -4,8 +4,8 @@ glabel func_80B076B0 /* 00178 80B076B8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0017C 80B076BC AFBF001C */ sw $ra, 0x001C($sp) /* 00180 80B076C0 AFA5002C */ sw $a1, 0x002C($sp) -/* 00184 80B076C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00188 80B076C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00184 80B076C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00188 80B076C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0018C 80B076CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00190 80B076D0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00194 80B076D4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s index e320f656ad..ba6b41062b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s @@ -6,7 +6,7 @@ glabel func_80B07EE0 /* 009B0 80B07EF0 AFA5003C */ sw $a1, 0x003C($sp) /* 009B4 80B07EF4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 009B8 80B07EF8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 009BC 80B07EFC 0C0189B7 */ jal Collider_CylinderUpdate +/* 009BC 80B07EFC 0C0189B7 */ jal Collider_UpdateCylinder /* 009C0 80B07F00 AFA60028 */ sw $a2, 0x0028($sp) /* 009C4 80B07F04 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80B07EE0 /* 009CC 80B07F0C 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 009D0 80B07F10 8FA60028 */ lw $a2, 0x0028($sp) /* 009D4 80B07F14 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 009D8 80B07F18 00812821 */ addu $a1, $a0, $at /* 009DC 80B07F1C 0C00B638 */ jal Actor_MoveForward @@ -26,7 +26,7 @@ glabel func_80B07EE0 /* 009F4 80B07F34 44070000 */ mfc1 $a3, $f0 /* 009F8 80B07F38 8FA4003C */ lw $a0, 0x003C($sp) /* 009FC 80B07F3C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A00 80B07F40 0C00B92D */ jal func_8002E4B4 +/* 00A00 80B07F40 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A04 80B07F44 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A08 80B07F48 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s index 6e20290762..0b1d085911 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s @@ -115,7 +115,7 @@ glabel EnSw_Init /* 008E4 80B0C694 3C0680B1 */ lui $a2, %hi(D_80B0F074) ## $a2 = 80B10000 /* 008E8 80B0C698 24C6F074 */ addiu $a2, $a2, %lo(D_80B0F074) ## $a2 = 80B0F074 /* 008EC 80B0C69C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 008F0 80B0C6A0 0C0187BF */ jal func_80061EFC +/* 008F0 80B0C6A0 0C0187BF */ jal CollisionCheck_SetInfo2 /* 008F4 80B0C6A4 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 008F8 80B0C6A8 860A001C */ lh $t2, 0x001C($s0) ## 0000001C /* 008FC 80B0C6AC 3C0180B1 */ lui $at, %hi(D_80B0F208) ## $at = 80B10000 @@ -277,7 +277,7 @@ glabel EnSw_Init .L80B0C8E8: /* 00B38 80B0C8E8 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00B3C 80B0C8EC 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00B40 80B0C8F0 0C00CDD2 */ jal Actor_ChangeType +/* 00B40 80B0C8F0 0C00CDD2 */ jal Actor_ChangeCategory /* 00B44 80B0C8F4 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 /* 00B48 80B0C8F8 240F001F */ addiu $t7, $zero, 0x001F ## $t7 = 0000001F diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s index 2a7806e824..346e155579 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s @@ -69,8 +69,8 @@ glabel func_80B0C9F0 /* 00D10 80B0CAC0 0C00CB1F */ jal func_80032C7C /* 00D14 80B0CAC4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D18 80B0CAC8 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 00D1C 80B0CACC 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawFunc_Circle) -/* 00D20 80B0CAD0 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawFunc_Circle) +/* 00D1C 80B0CACC 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawCircle) +/* 00D20 80B0CAD0 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawCircle) /* 00D24 80B0CAD4 31F8E000 */ andi $t8, $t7, 0xE000 ## $t8 = 00000000 /* 00D28 80B0CAD8 0018CB43 */ sra $t9, $t8, 13 /* 00D2C 80B0CADC 1320001D */ beq $t9, $zero, .L80B0CB54 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s index c91fd2d918..1008377d3c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s @@ -71,7 +71,7 @@ glabel func_80B0CBE8 /* 00F28 80B0CCD8 8FA60018 */ lw $a2, 0x0018($sp) .L80B0CCDC: /* 00F2C 80B0CCDC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F30 80B0CCE0 8FA4002C */ lw $a0, 0x002C($sp) .L80B0CCE4: /* 00F34 80B0CCE4 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s index 89297bf63e..e0a0493dbf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s @@ -21,7 +21,7 @@ glabel func_80B0DB00 /* 01D98 80B0DB48 AFA80014 */ sw $t0, 0x0014($sp) /* 01D9C 80B0DB4C 8FA4003C */ lw $a0, 0x003C($sp) /* 01DA0 80B0DB50 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01DA4 80B0DB54 0C00B92D */ jal func_8002E4B4 +/* 01DA4 80B0DB54 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01DA8 80B0DB58 E7A40010 */ swc1 $f4, 0x0010($sp) /* 01DAC 80B0DB5C 96030088 */ lhu $v1, 0x0088($s0) ## 00000088 /* 01DB0 80B0DB60 30690001 */ andi $t1, $v1, 0x0001 ## $t1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s index 8d1d8dbc56..926c8b74c4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s @@ -223,7 +223,7 @@ glabel L80B0ECB8 /* 02FB0 80B0ED60 016E7825 */ or $t7, $t3, $t6 ## $t7 = FB000000 /* 02FB4 80B0ED64 AC6F0004 */ sw $t7, 0x0004($v1) ## 00000004 .L80B0ED68: -/* 02FB8 80B0ED68 0C018A29 */ jal func_800628A4 +/* 02FB8 80B0ED68 0C018A29 */ jal Collider_UpdateSpheres /* 02FBC 80B0ED6C 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 /* 02FC0 80B0ED70 8FB80088 */ lw $t8, 0x0088($sp) /* 02FC4 80B0ED74 3C0680B1 */ lui $a2, %hi(D_80B0F1B0) ## $a2 = 80B10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s index 4a22ea6e0b..579a4a8a0f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s @@ -37,8 +37,8 @@ glabel EnTest_Init /* 0008C 8085F6DC 0C02915F */ jal SkelAnime_Init /* 00090 8085F6E0 260504A8 */ addiu $a1, $s0, 0x04A8 ## $a1 = 000004A8 -/* 00094 8085F6E4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Teardrop) -/* 00098 8085F6E8 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFunc_Teardrop) +/* 00094 8085F6E4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFeet) +/* 00098 8085F6E8 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFeet) /* 0009C 8085F6EC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 000A0 8085F6F0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000A4 8085F6F4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s index 974d825c87..746b5f6b12 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s @@ -29,7 +29,7 @@ glabel EnTest_Update /* 04088 808636D8 8FA40054 */ lw $a0, 0x0054($sp) /* 0408C 808636DC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 04090 808636E0 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 04094 808636E4 0C00B92D */ jal func_8002E4B4 +/* 04094 808636E4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04098 808636E8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0409C 808636EC 8618001C */ lh $t8, 0x001C($s0) ## 0000001C /* 040A0 808636F0 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 @@ -207,7 +207,7 @@ glabel L808638F4 /* 04300 80863950 26050810 */ addiu $a1, $s0, 0x0810 ## $a1 = 00000810 .L80863954: /* 04304 80863954 AFA50034 */ sw $a1, 0x0034($sp) -/* 04308 80863958 0C0189B7 */ jal Collider_CylinderUpdate +/* 04308 80863958 0C0189B7 */ jal Collider_UpdateCylinder /* 0430C 8086395C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04310 80863960 8E080028 */ lw $t0, 0x0028($s0) ## 00000028 @@ -232,7 +232,7 @@ glabel L808638F4 /* 04358 808639A8 00812821 */ addu $a1, $a0, $at /* 0435C 808639AC AFA50038 */ sw $a1, 0x0038($sp) /* 04360 808639B0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 04364 808639B4 8FA60034 */ lw $a2, 0x0034($sp) /* 04368 808639B8 920C07C8 */ lbu $t4, 0x07C8($s0) ## 000007C8 /* 0436C 808639BC 2981000A */ slti $at, $t4, 0x000A @@ -288,11 +288,11 @@ glabel L808638F4 /* 04410 80863A60 55600011 */ bnel $t3, $zero, .L80863AA8 /* 04414 80863A64 8FBF002C */ lw $ra, 0x002C($sp) /* 04418 80863A68 918D1C27 */ lbu $t5, 0x1C27($t4) ## 00001C27 -/* 0441C 80863A6C 3C188003 */ lui $t8, %hi(ActorShadow_DrawFunc_Teardrop) +/* 0441C 80863A6C 3C188003 */ lui $t8, %hi(ActorShadow_DrawFeet) /* 04420 80863A70 51A00008 */ beql $t5, $zero, .L80863A94 /* 04424 80863A74 8E190004 */ lw $t9, 0x0004($s0) ## 00000004 /* 04428 80863A78 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 0442C 80863A7C 2718B8C4 */ addiu $t8, %lo(ActorShadow_DrawFunc_Teardrop) +/* 0442C 80863A7C 2718B8C4 */ addiu $t8, %lo(ActorShadow_DrawFeet) /* 04430 80863A80 AE1800C0 */ sw $t8, 0x00C0($s0) ## 000000C0 /* 04434 80863A84 35CF0081 */ ori $t7, $t6, 0x0081 ## $t7 = 00000081 /* 04438 80863A88 10000006 */ beq $zero, $zero, .L80863AA4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s index dba77a6e4d..76e7de66a6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s @@ -59,7 +59,7 @@ glabel func_808615F4 /* 0205C 808616AC 10000057 */ beq $zero, $zero, .L8086180C /* 02060 808616B0 ACCA07E8 */ sw $t2, 0x07E8($a2) ## 000007E8 .L808616B4: -/* 02064 808616B4 0C00B69E */ jal func_8002DA78 +/* 02064 808616B4 0C00B69E */ jal Actor_WorldYawTowardActor /* 02068 808616B8 AFA60020 */ sw $a2, 0x0020($sp) /* 0206C 808616BC 8FA60020 */ lw $a2, 0x0020($sp) /* 02070 808616C0 0C03F66B */ jal Rand_ZeroOne diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s index b1b949c107..00c9c70ad9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s @@ -34,7 +34,7 @@ glabel func_80862DBC /* 037E4 80862E34 8FA40024 */ lw $a0, 0x0024($sp) /* 037E8 80862E38 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 037EC 80862E3C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 037F0 80862E40 0C00CDD2 */ jal Actor_ChangeType +/* 037F0 80862E40 0C00CDD2 */ jal Actor_ChangeCategory /* 037F4 80862E44 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 .L80862E48: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s index 0b8e54ff6c..43983c069a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s @@ -41,7 +41,7 @@ glabel func_80862E6C /* 038AC 80862EFC 8FA4002C */ lw $a0, 0x002C($sp) /* 038B0 80862F00 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 038B4 80862F04 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 -/* 038B8 80862F08 0C00CDD2 */ jal Actor_ChangeType +/* 038B8 80862F08 0C00CDD2 */ jal Actor_ChangeCategory /* 038BC 80862F0C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 .L80862F10: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s index a706e40551..f9fff1d2f7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s @@ -103,7 +103,7 @@ glabel func_80863CC4 /* 04730 80863D80 2604085C */ addiu $a0, $s0, 0x085C ## $a0 = 0000085C /* 04734 80863D84 8FA50048 */ lw $a1, 0x0048($sp) /* 04738 80863D88 8FA60044 */ lw $a2, 0x0044($sp) -/* 0473C 80863D8C 0C0189CD */ jal func_80062734 +/* 0473C 80863D8C 0C0189CD */ jal Collider_SetQuadVertices /* 04740 80863D90 AFA90010 */ sw $t1, 0x0010($sp) /* 04744 80863D94 3C048086 */ lui $a0, %hi(D_80864664) ## $a0 = 80860000 /* 04748 80863D98 24844664 */ addiu $a0, $a0, %lo(D_80864664) ## $a0 = 80864664 @@ -175,7 +175,7 @@ glabel func_80863CC4 /* 04840 80863E90 AFA70014 */ sw $a3, 0x0014($sp) /* 04844 80863E94 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04848 80863E98 8FA50084 */ lw $a1, 0x0084($sp) -/* 0484C 80863E9C 0C00AF6C */ jal func_8002BDB0 +/* 0484C 80863E9C 0C00AF6C */ jal Actor_SetFeetPos /* 04850 80863EA0 24060030 */ addiu $a2, $zero, 0x0030 ## $a2 = 00000030 /* 04854 80863EA4 8FAD0084 */ lw $t5, 0x0084($sp) /* 04858 80863EA8 24010030 */ addiu $at, $zero, 0x0030 ## $at = 00000030 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s index b4c3dff997..8476af53b1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s @@ -10,7 +10,7 @@ glabel func_808641E8 /* 04BB8 80864208 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 04BBC 8086420C 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 /* 04BC0 80864210 AFA20024 */ sw $v0, 0x0024($sp) -/* 04BC4 80864214 0C00B69E */ jal func_8002DA78 +/* 04BC4 80864214 0C00B69E */ jal Actor_WorldYawTowardActor /* 04BC8 80864218 AFA7002C */ sw $a3, 0x002C($sp) /* 04BCC 8086421C 8FA7002C */ lw $a3, 0x002C($sp) /* 04BD0 80864220 00004025 */ or $t0, $zero, $zero ## $t0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s index 12dfb646d9..fe7508ae3a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s @@ -4,8 +4,8 @@ glabel EnTg_Init /* 00158 80B184B8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0015C 80B184BC AFBF002C */ sw $ra, 0x002C($sp) /* 00160 80B184C0 AFA5003C */ sw $a1, 0x003C($sp) -/* 00164 80B184C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00168 80B184C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00164 80B184C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00168 80B184C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0016C 80B184CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00170 80B184D0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00174 80B184D4 0C00AC78 */ jal ActorShape_Init @@ -36,7 +36,7 @@ glabel EnTg_Init /* 001CC 80B1852C 3C0680B2 */ lui $a2, %hi(D_80B1893C) ## $a2 = 80B20000 /* 001D0 80B18530 24C6893C */ addiu $a2, $a2, %lo(D_80B1893C) ## $a2 = 80B1893C /* 001D4 80B18534 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 001D8 80B18538 0C0187BF */ jal func_80061EFC +/* 001D8 80B18538 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001DC 80B1853C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 001E0 80B18540 240E0006 */ addiu $t6, $zero, 0x0006 ## $t6 = 00000006 /* 001E4 80B18544 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s index f1df79430f..4ce13b6b61 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s @@ -31,7 +31,7 @@ glabel EnTg_Update /* 002F8 80B18658 A48F01DE */ sh $t7, 0x01DE($a0) ## 000001DE /* 002FC 80B1865C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 00300 80B18660 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00304 80B18664 00A12821 */ addu $a1, $a1, $at /* 00308 80B18668 0C02927F */ jal SkelAnime_Update @@ -43,7 +43,7 @@ glabel EnTg_Update /* 00320 80B18680 44070000 */ mfc1 $a3, $f0 /* 00324 80B18684 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00328 80B18688 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0032C 80B1868C 0C00B92D */ jal func_8002E4B4 +/* 0032C 80B1868C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00330 80B18690 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00334 80B18694 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00338 80B18698 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s index cdbbbab471..6a99405260 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s @@ -1033,7 +1033,7 @@ glabel EnTorch2_Update /* 012F4 80B1EC74 24A50150 */ addiu $a1, $a1, %lo(sSpawnPoint) ## $a1 = 80B20150 /* 012F8 80B1EC78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 012FC 80B1EC7C 46044280 */ add.s $f10, $f8, $f4 -/* 01300 80B1EC80 0C00B6DB */ jal func_8002DB6C +/* 01300 80B1EC80 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 01304 80B1EC84 E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 01308 80B1EC88 3C014448 */ lui $at, 0x4448 ## $at = 44480000 /* 0130C 80B1EC8C 44818000 */ mtc1 $at, $f16 ## $f16 = 800.00 @@ -1684,10 +1684,10 @@ glabel EnTorch2_Update /* 01C48 80B1F5C8 0C028EF0 */ jal LinkAnimation_Update /* 01C4C 80B1F5CC 8FA40084 */ lw $a0, 0x0084($sp) /* 01C50 80B1F5D0 8FA40084 */ lw $a0, 0x0084($sp) -/* 01C54 80B1F5D4 0C017458 */ jal Collider_QuadSetAT +/* 01C54 80B1F5D4 0C017458 */ jal Collider_ResetQuadAT /* 01C58 80B1F5D8 8FA50030 */ lw $a1, 0x0030($sp) /* 01C5C 80B1F5DC 8FA40084 */ lw $a0, 0x0084($sp) -/* 01C60 80B1F5E0 0C017458 */ jal Collider_QuadSetAT +/* 01C60 80B1F5E0 0C017458 */ jal Collider_ResetQuadAT /* 01C64 80B1F5E4 8FA50038 */ lw $a1, 0x0038($sp) /* 01C68 80B1F5E8 3C0780B2 */ lui $a3, %hi(sStaggerTimer) ## $a3 = 80B20000 /* 01C6C 80B1F5EC 3C0680B2 */ lui $a2, %hi(sCounterState) ## $a2 = 80B20000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s index 9053c030e7..88304a4e1a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s @@ -189,7 +189,7 @@ glabel EnTp_Draw /* 01C64 80B22A44 54410004 */ bnel $v0, $at, .L80B22A58 /* 01C68 80B22A48 8FBF0014 */ lw $ra, 0x0014($sp) .L80B22A4C: -/* 01C6C 80B22A4C 0C018A29 */ jal func_800628A4 +/* 01C6C 80B22A4C 0C018A29 */ jal Collider_UpdateSpheres /* 01C70 80B22A50 24650174 */ addiu $a1, $v1, 0x0174 ## $a1 = 00000174 /* 01C74 80B22A54 8FBF0014 */ lw $ra, 0x0014($sp) .L80B22A58: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s index d3238867a9..484300a1aa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s @@ -27,12 +27,12 @@ glabel EnTp_Init /* 00054 80B20E34 3C0F80B2 */ lui $t7, %hi(D_80B22AC4) ## $t7 = 80B20000 /* 00058 80B20E38 240E0003 */ addiu $t6, $zero, 0x0003 ## $t6 = 00000003 /* 0005C 80B20E3C 25EF2AC4 */ addiu $t7, $t7, %lo(D_80B22AC4) ## $t7 = 80B22AC4 -/* 00060 80B20E40 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00060 80B20E40 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00064 80B20E44 3C073E0F */ lui $a3, 0x3E0F ## $a3 = 3E0F0000 /* 00068 80B20E48 A26E001F */ sb $t6, 0x001F($s3) ## 0000001F /* 0006C 80B20E4C AE6F0098 */ sw $t7, 0x0098($s3) ## 00000098 /* 00070 80B20E50 34E75C29 */ ori $a3, $a3, 0x5C29 ## $a3 = 3E0F5C29 -/* 00074 80B20E54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00074 80B20E54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00078 80B20E58 266400B4 */ addiu $a0, $s3, 0x00B4 ## $a0 = 000000B4 /* 0007C 80B20E5C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s index 76d23400fc..c7e416571c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s @@ -65,7 +65,7 @@ glabel EnTp_Update /* 01750 80B22530 AFAA0014 */ sw $t2, 0x0014($sp) /* 01754 80B22534 24060000 */ addiu $a2, $zero, 0x0000 ## $a2 = 00000000 /* 01758 80B22538 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 0175C 80B2253C 0C00B92D */ jal func_8002E4B4 +/* 0175C 80B2253C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01760 80B22540 E7A40010 */ swc1 $f4, 0x0010($sp) .L80B22544: /* 01764 80B22544 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s index 6e0e3351ab..77878828b5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s @@ -19,12 +19,12 @@ glabel EnTr_Draw /* 011D0 80B23EC0 11C0000B */ beq $t6, $zero, .L80B23EF0 /* 011D4 80B23EC4 00000000 */ nop /* 011D8 80B23EC8 848F02D8 */ lh $t7, 0x02D8($a0) ## 000002D8 -/* 011DC 80B23ECC 3C098003 */ lui $t1, %hi(ActorShadow_DrawFunc_Circle) +/* 011DC 80B23ECC 3C098003 */ lui $t1, %hi(ActorShadow_DrawCircle) /* 011E0 80B23ED0 3C0680B2 */ lui $a2, %hi(D_80B24414) ## $a2 = 80B20000 /* 011E4 80B23ED4 000FC080 */ sll $t8, $t7, 2 /* 011E8 80B23ED8 00B8C821 */ addu $t9, $a1, $t8 /* 011EC 80B23EDC 8F281D8C */ lw $t0, 0x1D8C($t9) ## 00001D8C -/* 011F0 80B23EE0 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawFunc_Circle) +/* 011F0 80B23EE0 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawCircle) /* 011F4 80B23EE4 24C64414 */ addiu $a2, $a2, %lo(D_80B24414) ## $a2 = 80B24414 /* 011F8 80B23EE8 15000003 */ bne $t0, $zero, .L80B23EF8 /* 011FC 80B23EEC 27A4003C */ addiu $a0, $sp, 0x003C ## $a0 = FFFFFFE4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s index 816a8da3f0..8d903be913 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s @@ -14,9 +14,9 @@ glabel EnTr_Init /* 00010 80B22D00 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 80B22D04 AFBF002C */ sw $ra, 0x002C($sp) /* 00018 80B22D08 AFA50034 */ sw $a1, 0x0034($sp) -/* 0001C 80B22D0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 0001C 80B22D0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00020 80B22D10 AFB10028 */ sw $s1, 0x0028($sp) -/* 00024 80B22D14 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80B22D14 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 80B22D18 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0002C 80B22D1C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00030 80B22D20 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s index dfca7139c5..bc2c0f7cfb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s @@ -11,7 +11,7 @@ glabel EnTr_Update /* 00EF0 80B23BE0 44070000 */ mfc1 $a3, $f0 /* 00EF4 80B23BE4 AFAE0014 */ sw $t6, 0x0014($sp) /* 00EF8 80B23BE8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00EFC 80B23BEC 0C00B92D */ jal func_8002E4B4 +/* 00EFC 80B23BEC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F00 80B23BF0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00F04 80B23BF4 8E1902DC */ lw $t9, 0x02DC($s0) ## 000002DC /* 00F08 80B23BF8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -95,7 +95,7 @@ glabel EnTr_Update .L80B23D00: /* 01010 80B23D00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B23D04: -/* 01014 80B23D04 0C00B56E */ jal Actor_SetHeight +/* 01014 80B23D04 0C00B56E */ jal Actor_SetFocus /* 01018 80B23D08 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0101C 80B23D0C 860302E2 */ lh $v1, 0x02E2($s0) ## 000002E2 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s index 0f5257b0bd..c8776c8c72 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s @@ -100,7 +100,7 @@ glabel EnTrap_Init /* 00168 80B247C8 8FA40054 */ lw $a0, 0x0054($sp) /* 0016C 80B247CC AFAB0014 */ sw $t3, 0x0014($sp) /* 00170 80B247D0 44070000 */ mfc1 $a3, $f0 -/* 00174 80B247D4 0C00B92D */ jal func_8002E4B4 +/* 00174 80B247D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00178 80B247D8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0017C 80B247DC 26020024 */ addiu $v0, $s0, 0x0024 ## $v0 = 00000024 /* 00180 80B247E0 8C4D0000 */ lw $t5, 0x0000($v0) ## 00000024 @@ -245,8 +245,8 @@ glabel EnTrap_Init /* 00374 80B249D4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00378 80B249D8 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 0037C 80B249DC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00380 80B249E0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0037C 80B249DC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00380 80B249E0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00384 80B249E4 44050000 */ mfc1 $a1, $f0 /* 00388 80B249E8 44070000 */ mfc1 $a3, $f0 /* 0038C 80B249EC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s index 976fa8ebae..1f8cfd7528 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s @@ -943,7 +943,7 @@ glabel EnTrap_Update /* 010E0 80B25740 240F001D */ addiu $t7, $zero, 0x001D ## $t7 = 0000001D /* 010E4 80B25744 AFAF0014 */ sw $t7, 0x0014($sp) /* 010E8 80B25748 8FA400AC */ lw $a0, 0x00AC($sp) -/* 010EC 80B2574C 0C00B92D */ jal func_8002E4B4 +/* 010EC 80B2574C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 010F0 80B25750 E7A60010 */ swc1 $f6, 0x0010($sp) /* 010F4 80B25754 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 010F8 80B25758 C7A80098 */ lwc1 $f8, 0x0098($sp) @@ -956,7 +956,7 @@ glabel EnTrap_Update /* 01114 80B25774 260501A0 */ addiu $a1, $s0, 0x01A0 ## $a1 = 000001A0 .L80B25778: /* 01118 80B25778 AFA50048 */ sw $a1, 0x0048($sp) -/* 0111C 80B2577C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0111C 80B2577C 0C0189B7 */ jal Collider_UpdateCylinder /* 01120 80B25780 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01124 80B25784 8FA400AC */ lw $a0, 0x00AC($sp) @@ -965,7 +965,7 @@ glabel EnTrap_Update /* 01130 80B25790 00812821 */ addu $a1, $a0, $at /* 01134 80B25794 AFA5004C */ sw $a1, 0x004C($sp) /* 01138 80B25798 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0113C 80B2579C 8FA60048 */ lw $a2, 0x0048($sp) /* 01140 80B257A0 920D0114 */ lbu $t5, 0x0114($s0) ## 00000114 /* 01144 80B257A4 8FA5004C */ lw $a1, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s index ffa2221ddd..518adaf8bf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s @@ -9,8 +9,8 @@ glabel EnVali_Init /* 0001C 80B266CC 0C01E037 */ jal Actor_ProcessInitChain /* 00020 80B266D0 24A58944 */ addiu $a1, $a1, %lo(D_80B28944) ## $a1 = 80B28944 -/* 00024 80B266D4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 80B266D8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80B266D4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 80B266D8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80B266DC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00030 80B266E0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00034 80B266E4 0C00AC78 */ jal ActorShape_Init @@ -68,7 +68,7 @@ glabel EnVali_Init /* 000F4 80B267A4 3C0680B3 */ lui $a2, %hi(D_80B2891C) ## $a2 = 80B30000 /* 000F8 80B267A8 24C6891C */ addiu $a2, $a2, %lo(D_80B2891C) ## $a2 = 80B2891C /* 000FC 80B267AC 24A58924 */ addiu $a1, $a1, %lo(D_80B28924) ## $a1 = 80B28924 -/* 00100 80B267B0 0C0187B5 */ jal func_80061ED4 +/* 00100 80B267B0 0C0187B5 */ jal CollisionCheck_SetInfo /* 00104 80B267B4 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 00108 80B267B8 0C2C9A1E */ jal func_80B26878 /* 0010C 80B267BC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s index 351384dec0..cc109f5329 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s @@ -46,7 +46,7 @@ glabel EnVali_Update /* 014B4 80B27B64 11E20028 */ beq $t7, $v0, .L80B27C08 /* 014B8 80B27B68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 014BC 80B27B6C 260503FC */ addiu $a1, $s0, 0x03FC ## $a1 = 000003FC -/* 014C0 80B27B70 0C0189B7 */ jal Collider_CylinderUpdate +/* 014C0 80B27B70 0C0189B7 */ jal Collider_UpdateCylinder /* 014C4 80B27B74 AFA50020 */ sw $a1, 0x0020($sp) /* 014C8 80B27B78 8E080190 */ lw $t0, 0x0190($s0) ## 00000190 @@ -87,10 +87,10 @@ glabel EnVali_Update .L80B27BF0: /* 01540 80B27BF0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01544 80B27BF4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01548 80B27BF8 8FA60020 */ lw $a2, 0x0020($sp) /* 0154C 80B27BFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01550 80B27C00 0C00B56E */ jal Actor_SetHeight +/* 01550 80B27C00 0C00B56E */ jal Actor_SetFocus /* 01554 80B27C04 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 .L80B27C08: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s index 53e4cd06bd..05de902730 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s @@ -35,7 +35,7 @@ glabel func_80B28280 /* 01C50 80B28300 AFB80010 */ sw $t8, 0x0010($sp) /* 01C54 80B28304 260402FC */ addiu $a0, $s0, 0x02FC ## $a0 = 000002FC /* 01C58 80B28308 27A6003C */ addiu $a2, $sp, 0x003C ## $a2 = FFFFFFF4 -/* 01C5C 80B2830C 0C0189CD */ jal func_80062734 +/* 01C5C 80B2830C 0C0189CD */ jal Collider_SetQuadVertices /* 01C60 80B28310 2607033C */ addiu $a3, $s0, 0x033C ## $a3 = 0000033C /* 01C64 80B28314 10000007 */ beq $zero, $zero, .L80B28334 /* 01C68 80B28318 8FBF0024 */ lw $ra, 0x0024($sp) @@ -43,7 +43,7 @@ glabel func_80B28280 /* 01C6C 80B2831C 261903C8 */ addiu $t9, $s0, 0x03C8 ## $t9 = 000003C8 /* 01C70 80B28320 AFB90010 */ sw $t9, 0x0010($sp) /* 01C74 80B28324 27A6003C */ addiu $a2, $sp, 0x003C ## $a2 = FFFFFFF4 -/* 01C78 80B28328 0C0189CD */ jal func_80062734 +/* 01C78 80B28328 0C0189CD */ jal Collider_SetQuadVertices /* 01C7C 80B2832C 260703BC */ addiu $a3, $s0, 0x03BC ## $a3 = 000003BC .L80B28330: /* 01C80 80B28330 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s index 384f0a6156..192763d714 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s @@ -83,7 +83,7 @@ glabel EnVbBall_Update /* 00728 80B296C8 46144281 */ sub.s $f10, $f8, $f20 /* 0072C 80B296CC E62A0028 */ swc1 $f10, 0x0028($s1) ## 00000028 /* 00730 80B296D0 AFA80014 */ sw $t0, 0x0014($sp) -/* 00734 80B296D4 0C00B92D */ jal func_8002E4B4 +/* 00734 80B296D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00738 80B296D8 E7B00010 */ swc1 $f16, 0x0010($sp) /* 0073C 80B296DC C6320028 */ lwc1 $f18, 0x0028($s1) ## 00000028 /* 00740 80B296E0 962C0088 */ lhu $t4, 0x0088($s1) ## 00000088 @@ -539,7 +539,7 @@ glabel EnVbBall_Update .L80B29D28: /* 00D88 80B29D28 26300168 */ addiu $s0, $s1, 0x0168 ## $s0 = 00000168 /* 00D8C 80B29D2C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000168 -/* 00D90 80B29D30 0C0189B7 */ jal Collider_CylinderUpdate +/* 00D90 80B29D30 0C0189B7 */ jal Collider_UpdateCylinder /* 00D94 80B29D34 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D98 80B29D38 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s index 2e6ccb1a10..d898904868 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s @@ -34,7 +34,7 @@ glabel func_80B292D0 /* 0039C 80B2933C 44070000 */ mfc1 $a3, $f0 /* 003A0 80B29340 AFAE0014 */ sw $t6, 0x0014($sp) /* 003A4 80B29344 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 -/* 003A8 80B29348 0C00B92D */ jal func_8002E4B4 +/* 003A8 80B29348 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003AC 80B2934C E7A40010 */ swc1 $f4, 0x0010($sp) /* 003B0 80B29350 966F0088 */ lhu $t7, 0x0088($s3) ## 00000088 /* 003B4 80B29354 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2CC1C.s b/asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2CC1C.s deleted file mode 100644 index b4c4b7c4c6..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2CC1C.s +++ /dev/null @@ -1,179 +0,0 @@ -.late_rodata -glabel D_80B2D1C4 - .word 0xC61C4000 -glabel D_80B2D1C8 - .float 3.14159274101 - -.text -glabel func_80B2CC1C -/* 02A1C 80B2CC1C 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 -/* 02A20 80B2CC20 AFBF001C */ sw $ra, 0x001C($sp) -/* 02A24 80B2CC24 AFB10018 */ sw $s1, 0x0018($sp) -/* 02A28 80B2CC28 AFB00014 */ sw $s0, 0x0014($sp) -/* 02A2C 80B2CC2C AFA40040 */ sw $a0, 0x0040($sp) -/* 02A30 80B2CC30 84AE001C */ lh $t6, 0x001C($a1) ## 0000001C -/* 02A34 80B2CC34 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 02A38 80B2CC38 3C118016 */ lui $s1, %hi(gGameInfo) -/* 02A3C 80B2CC3C 000E7A03 */ sra $t7, $t6, 8 -/* 02A40 80B2CC40 15E10099 */ bne $t7, $at, .L80B2CEA8 -/* 02A44 80B2CC44 2631FA90 */ addiu $s1, %lo(gGameInfo) -/* 02A48 80B2CC48 8E380000 */ lw $t8, 0x0000($s1) ## 8015FA90 -/* 02A4C 80B2CC4C 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 02A50 80B2CC50 44811000 */ mtc1 $at, $f2 ## $f2 = 10.00 -/* 02A54 80B2CC54 87191340 */ lh $t9, 0x1340($t8) ## 00001340 -/* 02A58 80B2CC58 3C1080B3 */ lui $s0, %hi(sGanonCape) ## $s0 = 80B30000 -/* 02A5C 80B2CC5C 2610D440 */ addiu $s0, $s0, %lo(sGanonCape) ## $s0 = 80B2D440 -/* 02A60 80B2CC60 44992000 */ mtc1 $t9, $f4 ## $f4 = 0.00 -/* 02A64 80B2CC64 8E080000 */ lw $t0, 0x0000($s0) ## 80B2D440 -/* 02A68 80B2CC68 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 02A6C 80B2CC6C 468021A0 */ cvt.s.w $f6, $f4 -/* 02A70 80B2CC70 44819000 */ mtc1 $at, $f18 ## $f18 = 100.00 -/* 02A74 80B2CC74 3C0180B3 */ lui $at, %hi(D_80B2D1C4) ## $at = 80B30000 -/* 02A78 80B2CC78 3C0480B3 */ lui $a0, %hi(D_80B2CFEC) ## $a0 = 80B30000 -/* 02A7C 80B2CC7C 46023203 */ div.s $f8, $f6, $f2 -/* 02A80 80B2CC80 E50816B0 */ swc1 $f8, 0x16B0($t0) ## 000016B0 -/* 02A84 80B2CC84 8E290000 */ lw $t1, 0x0000($s1) ## 8015FA90 -/* 02A88 80B2CC88 8E0C0000 */ lw $t4, 0x0000($s0) ## 80B2D440 -/* 02A8C 80B2CC8C 852A134C */ lh $t2, 0x134C($t1) ## 0000134C -/* 02A90 80B2CC90 254B0019 */ addiu $t3, $t2, 0x0019 ## $t3 = 00000019 -/* 02A94 80B2CC94 448B5000 */ mtc1 $t3, $f10 ## $f10 = 0.00 -/* 02A98 80B2CC98 00000000 */ nop -/* 02A9C 80B2CC9C 46805420 */ cvt.s.w $f16, $f10 -/* 02AA0 80B2CCA0 46128103 */ div.s $f4, $f16, $f18 -/* 02AA4 80B2CCA4 44809000 */ mtc1 $zero, $f18 ## $f18 = 0.00 -/* 02AA8 80B2CCA8 E58416B4 */ swc1 $f4, 0x16B4($t4) ## 000016B4 -/* 02AAC 80B2CCAC 8E2D0000 */ lw $t5, 0x0000($s1) ## 8015FA90 -/* 02AB0 80B2CCB0 8E180000 */ lw $t8, 0x0000($s0) ## 80B2D440 -/* 02AB4 80B2CCB4 85AE1342 */ lh $t6, 0x1342($t5) ## 00001342 -/* 02AB8 80B2CCB8 25CFFFD3 */ addiu $t7, $t6, 0xFFD3 ## $t7 = FFFFFFD3 -/* 02ABC 80B2CCBC 448F3000 */ mtc1 $t7, $f6 ## $f6 = NaN -/* 02AC0 80B2CCC0 00000000 */ nop -/* 02AC4 80B2CCC4 46803220 */ cvt.s.w $f8, $f6 -/* 02AC8 80B2CCC8 46024283 */ div.s $f10, $f8, $f2 -/* 02ACC 80B2CCCC E70A16B8 */ swc1 $f10, 0x16B8($t8) ## 000016B8 -/* 02AD0 80B2CCD0 8E190000 */ lw $t9, 0x0000($s0) ## 80B2D440 -/* 02AD4 80B2CCD4 C430D1C4 */ lwc1 $f16, %lo(D_80B2D1C4)($at) -/* 02AD8 80B2CCD8 3C014150 */ lui $at, 0x4150 ## $at = 41500000 -/* 02ADC 80B2CCDC E73016AC */ swc1 $f16, 0x16AC($t9) ## 000016AC -/* 02AE0 80B2CCE0 8E080000 */ lw $t0, 0x0000($s0) ## 80B2D440 -/* 02AE4 80B2CCE4 E51216D0 */ swc1 $f18, 0x16D0($t0) ## 000016D0 -/* 02AE8 80B2CCE8 8E290000 */ lw $t1, 0x0000($s1) ## 8015FA90 -/* 02AEC 80B2CCEC 8E0C0000 */ lw $t4, 0x0000($s0) ## 80B2D440 -/* 02AF0 80B2CCF0 44819000 */ mtc1 $at, $f18 ## $f18 = 13.00 -/* 02AF4 80B2CCF4 852A135A */ lh $t2, 0x135A($t1) ## 0000135A -/* 02AF8 80B2CCF8 254BFFF6 */ addiu $t3, $t2, 0xFFF6 ## $t3 = FFFFFFF6 -/* 02AFC 80B2CCFC 448B2000 */ mtc1 $t3, $f4 ## $f4 = NaN -/* 02B00 80B2CD00 00000000 */ nop -/* 02B04 80B2CD04 468021A0 */ cvt.s.w $f6, $f4 -/* 02B08 80B2CD08 46023203 */ div.s $f8, $f6, $f2 -/* 02B0C 80B2CD0C E58816C8 */ swc1 $f8, 0x16C8($t4) ## 000016C8 -/* 02B10 80B2CD10 8E2D0000 */ lw $t5, 0x0000($s1) ## 8015FA90 -/* 02B14 80B2CD14 8484CFEC */ lh $a0, %lo(D_80B2CFEC)($a0) -/* 02B18 80B2CD18 85AE09F4 */ lh $t6, 0x09F4($t5) ## 000009F4 -/* 02B1C 80B2CD1C AFA50044 */ sw $a1, 0x0044($sp) -/* 02B20 80B2CD20 448E5000 */ mtc1 $t6, $f10 ## $f10 = 0.00 -/* 02B24 80B2CD24 00000000 */ nop -/* 02B28 80B2CD28 46805420 */ cvt.s.w $f16, $f10 -/* 02B2C 80B2CD2C 46128101 */ sub.s $f4, $f16, $f18 -/* 02B30 80B2CD30 0C01DE1C */ jal Math_SinS - ## sins? -/* 02B34 80B2CD34 E7A40034 */ swc1 $f4, 0x0034($sp) -/* 02B38 80B2CD38 8E220000 */ lw $v0, 0x0000($s1) ## 8015FA90 -/* 02B3C 80B2CD3C 3C014120 */ lui $at, 0x4120 ## $at = 41200000 -/* 02B40 80B2CD40 44811000 */ mtc1 $at, $f2 ## $f2 = 10.00 -/* 02B44 80B2CD44 845809FC */ lh $t8, 0x09FC($v0) ## 000009FC -/* 02B48 80B2CD48 844F09F6 */ lh $t7, 0x09F6($v0) ## 000009F6 -/* 02B4C 80B2CD4C 3C014040 */ lui $at, 0x4040 ## $at = 40400000 -/* 02B50 80B2CD50 44989000 */ mtc1 $t8, $f18 ## $f18 = 0.00 -/* 02B54 80B2CD54 448F3000 */ mtc1 $t7, $f6 ## $f6 = 0.00 -/* 02B58 80B2CD58 44815000 */ mtc1 $at, $f10 ## $f10 = 3.00 -/* 02B5C 80B2CD5C 46809120 */ cvt.s.w $f4, $f18 -/* 02B60 80B2CD60 3C0880B3 */ lui $t0, %hi(D_80B2CFEC) ## $t0 = 80B30000 -/* 02B64 80B2CD64 8508CFEC */ lh $t0, %lo(D_80B2CFEC)($t0) -/* 02B68 80B2CD68 8FA60044 */ lw $a2, 0x0044($sp) -/* 02B6C 80B2CD6C 3C0180B3 */ lui $at, %hi(D_80B2CFEC) ## $at = 80B30000 -/* 02B70 80B2CD70 46803220 */ cvt.s.w $f8, $f6 -/* 02B74 80B2CD74 46002182 */ mul.s $f6, $f4, $f0 -/* 02B78 80B2CD78 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 -/* 02B7C 80B2CD7C 460A4400 */ add.s $f16, $f8, $f10 -/* 02B80 80B2CD80 46103200 */ add.s $f8, $f6, $f16 -/* 02B84 80B2CD84 E7A80038 */ swc1 $f8, 0x0038($sp) -/* 02B88 80B2CD88 845909F8 */ lh $t9, 0x09F8($v0) ## 000009F8 -/* 02B8C 80B2CD8C 44995000 */ mtc1 $t9, $f10 ## $f10 = 0.00 -/* 02B90 80B2CD90 00000000 */ nop -/* 02B94 80B2CD94 468054A0 */ cvt.s.w $f18, $f10 -/* 02B98 80B2CD98 46029101 */ sub.s $f4, $f18, $f2 -/* 02B9C 80B2CD9C E7A4003C */ swc1 $f4, 0x003C($sp) -/* 02BA0 80B2CDA0 844909FA */ lh $t1, 0x09FA($v0) ## 000009FA -/* 02BA4 80B2CDA4 00095300 */ sll $t2, $t1, 12 -/* 02BA8 80B2CDA8 010A5821 */ addu $t3, $t0, $t2 -/* 02BAC 80B2CDAC 256C2000 */ addiu $t4, $t3, 0x2000 ## $t4 = 00002000 -/* 02BB0 80B2CDB0 A42CCFEC */ sh $t4, %lo(D_80B2CFEC)($at) -/* 02BB4 80B2CDB4 84CD00B6 */ lh $t5, 0x00B6($a2) ## 000000B6 -/* 02BB8 80B2CDB8 3C014700 */ lui $at, 0x4700 ## $at = 47000000 -/* 02BBC 80B2CDBC 44814000 */ mtc1 $at, $f8 ## $f8 = 32768.00 -/* 02BC0 80B2CDC0 448D3000 */ mtc1 $t5, $f6 ## $f6 = 0.00 -/* 02BC4 80B2CDC4 3C0180B3 */ lui $at, %hi(D_80B2D1C8) ## $at = 80B30000 -/* 02BC8 80B2CDC8 C432D1C8 */ lwc1 $f18, %lo(D_80B2D1C8)($at) -/* 02BCC 80B2CDCC 46803420 */ cvt.s.w $f16, $f6 -/* 02BD0 80B2CDD0 46088283 */ div.s $f10, $f16, $f8 -/* 02BD4 80B2CDD4 46125302 */ mul.s $f12, $f10, $f18 -/* 02BD8 80B2CDD8 0C034348 */ jal Matrix_RotateY -/* 02BDC 80B2CDDC 00000000 */ nop -/* 02BE0 80B2CDE0 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFF4 -/* 02BE4 80B2CDE4 0C0346BD */ jal Matrix_MultVec3f -/* 02BE8 80B2CDE8 27A50028 */ addiu $a1, $sp, 0x0028 ## $a1 = FFFFFFE8 -/* 02BEC 80B2CDEC 3C0280B3 */ lui $v0, %hi(D_80B2D448) ## $v0 = 80B30000 -/* 02BF0 80B2CDF0 2442D448 */ addiu $v0, $v0, %lo(D_80B2D448) ## $v0 = 80B2D448 -/* 02BF4 80B2CDF4 C4440000 */ lwc1 $f4, 0x0000($v0) ## 80B2D448 -/* 02BF8 80B2CDF8 C7A60028 */ lwc1 $f6, 0x0028($sp) -/* 02BFC 80B2CDFC 8E0E0000 */ lw $t6, 0x0000($s0) ## 80B2D440 -/* 02C00 80B2CE00 3C014150 */ lui $at, 0x4150 ## $at = 41500000 -/* 02C04 80B2CE04 46062400 */ add.s $f16, $f4, $f6 -/* 02C08 80B2CE08 27A40034 */ addiu $a0, $sp, 0x0034 ## $a0 = FFFFFFF4 -/* 02C0C 80B2CE0C 27A50028 */ addiu $a1, $sp, 0x0028 ## $a1 = FFFFFFE8 -/* 02C10 80B2CE10 E5D016D4 */ swc1 $f16, 0x16D4($t6) ## 000016D4 -/* 02C14 80B2CE14 C7AA002C */ lwc1 $f10, 0x002C($sp) -/* 02C18 80B2CE18 C4480004 */ lwc1 $f8, 0x0004($v0) ## 80B2D44C -/* 02C1C 80B2CE1C 8E0F0000 */ lw $t7, 0x0000($s0) ## 80B2D440 -/* 02C20 80B2CE20 460A4480 */ add.s $f18, $f8, $f10 -/* 02C24 80B2CE24 E5F216D8 */ swc1 $f18, 0x16D8($t7) ## 000016D8 -/* 02C28 80B2CE28 C7A60030 */ lwc1 $f6, 0x0030($sp) -/* 02C2C 80B2CE2C C4440008 */ lwc1 $f4, 0x0008($v0) ## 80B2D450 -/* 02C30 80B2CE30 8E180000 */ lw $t8, 0x0000($s0) ## 80B2D440 -/* 02C34 80B2CE34 44819000 */ mtc1 $at, $f18 ## $f18 = 13.00 -/* 02C38 80B2CE38 46062400 */ add.s $f16, $f4, $f6 -/* 02C3C 80B2CE3C E71016DC */ swc1 $f16, 0x16DC($t8) ## 000016DC -/* 02C40 80B2CE40 8E390000 */ lw $t9, 0x0000($s1) ## 8015FA90 -/* 02C44 80B2CE44 872909F4 */ lh $t1, 0x09F4($t9) ## 000009F4 -/* 02C48 80B2CE48 44894000 */ mtc1 $t1, $f8 ## $f8 = 0.00 -/* 02C4C 80B2CE4C 00000000 */ nop -/* 02C50 80B2CE50 468042A0 */ cvt.s.w $f10, $f8 -/* 02C54 80B2CE54 46125101 */ sub.s $f4, $f10, $f18 -/* 02C58 80B2CE58 46002187 */ neg.s $f6, $f4 -/* 02C5C 80B2CE5C 0C0346BD */ jal Matrix_MultVec3f -/* 02C60 80B2CE60 E7A60034 */ swc1 $f6, 0x0034($sp) -/* 02C64 80B2CE64 3C0280B3 */ lui $v0, %hi(D_80B2D448) ## $v0 = 80B30000 -/* 02C68 80B2CE68 2442D448 */ addiu $v0, $v0, %lo(D_80B2D448) ## $v0 = 80B2D448 -/* 02C6C 80B2CE6C C4500000 */ lwc1 $f16, 0x0000($v0) ## 80B2D448 -/* 02C70 80B2CE70 C7A80028 */ lwc1 $f8, 0x0028($sp) -/* 02C74 80B2CE74 8E080000 */ lw $t0, 0x0000($s0) ## 80B2D440 -/* 02C78 80B2CE78 46088280 */ add.s $f10, $f16, $f8 -/* 02C7C 80B2CE7C E50A16E0 */ swc1 $f10, 0x16E0($t0) ## 000016E0 -/* 02C80 80B2CE80 C7A4002C */ lwc1 $f4, 0x002C($sp) -/* 02C84 80B2CE84 C4520004 */ lwc1 $f18, 0x0004($v0) ## 80B2D44C -/* 02C88 80B2CE88 8E0A0000 */ lw $t2, 0x0000($s0) ## 80B2D440 -/* 02C8C 80B2CE8C 46049180 */ add.s $f6, $f18, $f4 -/* 02C90 80B2CE90 E54616E4 */ swc1 $f6, 0x16E4($t2) ## 000016E4 -/* 02C94 80B2CE94 C7A80030 */ lwc1 $f8, 0x0030($sp) -/* 02C98 80B2CE98 C4500008 */ lwc1 $f16, 0x0008($v0) ## 80B2D450 -/* 02C9C 80B2CE9C 8E0B0000 */ lw $t3, 0x0000($s0) ## 80B2D440 -/* 02CA0 80B2CEA0 46088280 */ add.s $f10, $f16, $f8 -/* 02CA4 80B2CEA4 E56A16E8 */ swc1 $f10, 0x16E8($t3) ## 000016E8 -.L80B2CEA8: -/* 02CA8 80B2CEA8 8FBF001C */ lw $ra, 0x001C($sp) -/* 02CAC 80B2CEAC 8FB00014 */ lw $s0, 0x0014($sp) -/* 02CB0 80B2CEB0 8FB10018 */ lw $s1, 0x0018($sp) -/* 02CB4 80B2CEB4 03E00008 */ jr $ra -/* 02CB8 80B2CEB8 27BD0040 */ addiu $sp, $sp, 0x0040 ## $sp = 00000000 -/* 02CBC 80B2CEBC 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s index bcc7b6a506..b884bc72db 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s @@ -8,8 +8,8 @@ glabel EnWeiyer_Init /* 00018 80B322A8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 80B322AC 24A53AE4 */ addiu $a1, $a1, %lo(D_80B33AE4) ## $a1 = 80B33AE4 -/* 00020 80B322B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 80B322B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 80B322B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 80B322B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 80B322B8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 80B322BC 3C05447A */ lui $a1, 0x447A ## $a1 = 447A0000 /* 00030 80B322C0 0C00AC78 */ jal ActorShape_Init @@ -45,7 +45,7 @@ glabel EnWeiyer_Init /* 00098 80B32328 3C0680B3 */ lui $a2, %hi(D_80B33ABC) ## $a2 = 80B30000 /* 0009C 80B3232C 24C63ABC */ addiu $a2, $a2, %lo(D_80B33ABC) ## $a2 = 80B33ABC /* 000A0 80B32330 24A53AC4 */ addiu $a1, $a1, %lo(D_80B33AC4) ## $a1 = 80B33AC4 -/* 000A4 80B32334 0C0187B5 */ jal func_80061ED4 +/* 000A4 80B32334 0C0187B5 */ jal CollisionCheck_SetInfo /* 000A8 80B32338 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000AC 80B3233C 3C1980B3 */ lui $t9, %hi(func_80B32804) ## $t9 = 80B30000 /* 000B0 80B32340 27392804 */ addiu $t9, $t9, %lo(func_80B32804) ## $t9 = 80B32804 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s index 6168e54ea7..6982586c93 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s @@ -49,10 +49,10 @@ glabel EnWeiyer_Update /* 01584 80B33814 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01588 80B33818 3C064120 */ lui $a2, 0x4120 ## $a2 = 41200000 /* 0158C 80B3381C 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 01590 80B33820 0C00B92D */ jal func_8002E4B4 +/* 01590 80B33820 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01594 80B33824 E7B20010 */ swc1 $f18, 0x0010($sp) /* 01598 80B33828 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0159C 80B3382C 0C00B56E */ jal Actor_SetHeight +/* 0159C 80B3382C 0C00B56E */ jal Actor_SetFocus /* 015A0 80B33830 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 015A4 80B33834 92020294 */ lbu $v0, 0x0294($s0) ## 00000294 @@ -67,7 +67,7 @@ glabel EnWeiyer_Update .L80B33854: /* 015C4 80B33854 26050284 */ addiu $a1, $s0, 0x0284 ## $a1 = 00000284 /* 015C8 80B33858 AFA50028 */ sw $a1, 0x0028($sp) -/* 015CC 80B3385C 0C0189B7 */ jal Collider_CylinderUpdate +/* 015CC 80B3385C 0C0189B7 */ jal Collider_UpdateCylinder /* 015D0 80B33860 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 015D4 80B33864 92190294 */ lbu $t9, 0x0294($s0) ## 00000294 @@ -96,7 +96,7 @@ glabel EnWeiyer_Update .L80B338B4: /* 01624 80B338B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01628 80B338B8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0162C 80B338BC 8FA60028 */ lw $a2, 0x0028($sp) /* 01630 80B338C0 8FBF0024 */ lw $ra, 0x0024($sp) /* 01634 80B338C4 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s index 3e0eae0bcf..a44b0d0856 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s @@ -11,7 +11,7 @@ glabel func_80B32DEC /* 00B80 80B32E10 46083280 */ add.s $f10, $f6, $f8 /* 00B84 80B32E14 E7AA001C */ swc1 $f10, 0x001C($sp) /* 00B88 80B32E18 C450002C */ lwc1 $f16, 0x002C($v0) ## 0000002C -/* 00B8C 80B32E1C 0C00B6CA */ jal func_8002DB28 +/* 00B8C 80B32E1C 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00B90 80B32E20 E7B00020 */ swc1 $f16, 0x0020($sp) /* 00B94 80B32E24 8FBF0014 */ lw $ra, 0x0014($sp) /* 00B98 80B32E28 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s index 94fc7497fa..66782cb2c0 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s @@ -12,11 +12,11 @@ glabel EnWf_Init /* 0002C 80B33CDC 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 00030 80B33CE0 3C0E80B3 */ lui $t6, %hi(D_80B37A88) ## $t6 = 80B30000 /* 00034 80B33CE4 25CE7A88 */ addiu $t6, $t6, %lo(D_80B37A88) ## $t6 = 80B37A88 -/* 00038 80B33CE8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00038 80B33CE8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0003C 80B33CEC 44050000 */ mfc1 $a1, $f0 /* 00040 80B33CF0 44070000 */ mfc1 $a3, $f0 /* 00044 80B33CF4 AE0E0098 */ sw $t6, 0x0098($s0) ## 00000098 -/* 00048 80B33CF8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00048 80B33CF8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0004C 80B33CFC 0C00AC78 */ jal ActorShape_Init /* 00050 80B33D00 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s index ee5e2330d3..7d0fb6cebc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s @@ -26,7 +26,7 @@ glabel EnWf_Update /* 035A0 80B37250 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 035A4 80B37254 3C064200 */ lui $a2, 0x4200 ## $a2 = 42000000 /* 035A8 80B37258 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 035AC 80B3725C 0C00B92D */ jal func_8002E4B4 +/* 035AC 80B3725C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 035B0 80B37260 E7A40010 */ swc1 $f4, 0x0010($sp) /* 035B4 80B37264 8E1902DC */ lw $t9, 0x02DC($s0) ## 000002DC /* 035B8 80B37268 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -69,7 +69,7 @@ glabel EnWf_Update /* 03638 80B372E8 AFA60030 */ sw $a2, 0x0030($sp) /* 0363C 80B372EC AFA50034 */ sw $a1, 0x0034($sp) /* 03640 80B372F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 03644 80B372F4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 03648 80B372F8 8E0202D4 */ lw $v0, 0x02D4($s0) ## 000002D4 /* 0364C 80B372FC 28410006 */ slti $at, $v0, 0x0006 @@ -85,7 +85,7 @@ glabel EnWf_Update /* 03674 80B37324 5560000D */ bnel $t3, $zero, .L80B3735C /* 03678 80B37328 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 .L80B3732C: -/* 0367C 80B3732C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0367C 80B3732C 0C0189B7 */ jal Collider_UpdateCylinder /* 03680 80B37330 AFA5002C */ sw $a1, 0x002C($sp) /* 03684 80B37334 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s index 1e934289f0..60180b9fe3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s @@ -171,7 +171,7 @@ glabel func_80B33FB0 /* 0056C 80B3421C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00570 80B34220 57010019 */ bnel $t8, $at, .L80B34288 /* 00574 80B34224 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00578 80B34228 0C00B6D2 */ jal func_8002DB48 +/* 00578 80B34228 0C00B6D2 */ jal Actor_WorldDistXYZToActor /* 0057C 80B3422C AFA50030 */ sw $a1, 0x0030($sp) /* 00580 80B34230 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00584 80B34234 44819000 */ mtc1 $at, $f18 ## $f18 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s index d915c98057..4114b44f2a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s @@ -47,7 +47,7 @@ glabel func_80B37494 /* 03800 80B374B0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 03804 80B374B4 AFA70044 */ sw $a3, 0x0044($sp) /* 03808 80B374B8 AFA30030 */ sw $v1, 0x0030($sp) -/* 0380C 80B374BC 0C018A29 */ jal func_800628A4 +/* 0380C 80B374BC 0C018A29 */ jal Collider_UpdateSpheres /* 03810 80B374C0 24C50304 */ addiu $a1, $a2, 0x0304 ## $a1 = 00000304 /* 03814 80B374C4 8FAE003C */ lw $t6, 0x003C($sp) /* 03818 80B374C8 24010006 */ addiu $at, $zero, 0x0006 ## $at = 00000006 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s index bbabf0fd1e..2da21bc99d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s @@ -9,7 +9,7 @@ glabel func_80B37830 /* 03B9C 80B3784C 10400049 */ beq $v0, $zero, .L80B37974 /* 03BA0 80B37850 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03BA4 80B37854 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 -/* 03BA8 80B37858 0C00B69E */ jal func_8002DA78 +/* 03BA8 80B37858 0C00B69E */ jal Actor_WorldYawTowardActor /* 03BAC 80B3785C AFA20024 */ sw $v0, 0x0024($sp) /* 03BB0 80B37860 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 /* 03BB4 80B37864 8FA70024 */ lw $a3, 0x0024($sp) @@ -19,7 +19,7 @@ glabel func_80B37830 /* 03BC4 80B37874 00063403 */ sra $a2, $a2, 16 /* 03BC8 80B37878 A60F0032 */ sh $t7, 0x0032($s0) ## 00000032 /* 03BCC 80B3787C A7A60022 */ sh $a2, 0x0022($sp) -/* 03BD0 80B37880 0C00B6DB */ jal func_8002DB6C +/* 03BD0 80B37880 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 03BD4 80B37884 24E50024 */ addiu $a1, $a3, 0x0024 ## $a1 = 00000024 /* 03BD8 80B37888 87A60022 */ lh $a2, 0x0022($sp) /* 03BDC 80B3788C 46000086 */ mov.s $f2, $f0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s index 3177e4aa48..4eb14104f6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s @@ -25,8 +25,8 @@ glabel EnXc_Init /* 0572C 80B4190C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 05730 80B41910 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 05734 80B41914 AFBF002C */ sw $ra, 0x002C($sp) -/* 05738 80B41918 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0573C 80B4191C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 05738 80B41918 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0573C 80B4191C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 05740 80B41920 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 05744 80B41924 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 05748 80B41928 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s index ebb0ccba71..fd0b927448 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s @@ -13,7 +13,7 @@ glabel func_80B3C1E0 /* 00028 80B3C208 8FA50018 */ lw $a1, 0x0018($sp) /* 0002C 80B3C20C 8FA60020 */ lw $a2, 0x0020($sp) /* 00030 80B3C210 24E71D40 */ addiu $a3, $a3, %lo(D_80B41D40) ## $a3 = 80B41D40 -/* 00034 80B3C214 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00034 80B3C214 0C017114 */ jal Collider_SetCylinderType1 /* 00038 80B3C218 8FA40024 */ lw $a0, 0x0024($sp) /* 0003C 80B3C21C 8FBF0014 */ lw $ra, 0x0014($sp) /* 00040 80B3C220 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s index 9b0a0bd60a..c2ffaefc87 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s @@ -4,7 +4,7 @@ glabel func_80B3C22C /* 00054 80B3C234 AFA50034 */ sw $a1, 0x0034($sp) /* 00058 80B3C238 248602C0 */ addiu $a2, $a0, 0x02C0 ## $a2 = 000002C0 /* 0005C 80B3C23C 00C02825 */ or $a1, $a2, $zero ## $a1 = 000002C0 -/* 00060 80B3C240 0C0189B7 */ jal Collider_CylinderUpdate +/* 00060 80B3C240 0C0189B7 */ jal Collider_UpdateCylinder /* 00064 80B3C244 AFA60018 */ sw $a2, 0x0018($sp) /* 00068 80B3C248 8FA40034 */ lw $a0, 0x0034($sp) @@ -12,7 +12,7 @@ glabel func_80B3C22C /* 00070 80B3C250 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00074 80B3C254 8FA60018 */ lw $a2, 0x0018($sp) /* 00078 80B3C258 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0007C 80B3C25C 00812821 */ addu $a1, $a0, $at /* 00080 80B3C260 8FBF0014 */ lw $ra, 0x0014($sp) /* 00084 80B3C264 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s index b379cce3b8..bdc3a2ad4b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s @@ -11,7 +11,7 @@ glabel func_80B3C468 /* 002AC 80B3C48C AFAE0014 */ sw $t6, 0x0014($sp) /* 002B0 80B3C490 8FA40024 */ lw $a0, 0x0024($sp) /* 002B4 80B3C494 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 002B8 80B3C498 0C00B92D */ jal func_8002E4B4 +/* 002B8 80B3C498 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 002BC 80B3C49C E7A00010 */ swc1 $f0, 0x0010($sp) /* 002C0 80B3C4A0 8FBF001C */ lw $ra, 0x001C($sp) /* 002C4 80B3C4A4 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s index 6431f40997..0eafd0e3f1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s @@ -60,7 +60,7 @@ glabel EnYabusameMark_Update /* 0066C 80B4342C 460C8480 */ add.s $f18, $f16, $f12 /* 00670 80B43430 E612018C */ swc1 $f18, 0x018C($s0) ## 0000018C /* 00674 80B43434 AFA40050 */ sw $a0, 0x0050($sp) -/* 00678 80B43438 0C0189CD */ jal func_80062734 +/* 00678 80B43438 0C0189CD */ jal Collider_SetQuadVertices /* 0067C 80B4343C AFB80010 */ sw $t8, 0x0010($sp) /* 00680 80B43440 8FA40074 */ lw $a0, 0x0074($sp) /* 00684 80B43444 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s index 8bdca72844..a37e2b4434 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s @@ -26,8 +26,8 @@ glabel EnZf_Init /* 002FC 80B4434C 344CFF00 */ ori $t4, $v0, 0xFF00 ## $t4 = 0000FF00 /* 00300 80B44350 A60C001C */ sh $t4, 0x001C($s0) ## 0000001C .L80B44354: -/* 00304 80B44354 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Teardrop) -/* 00308 80B44358 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFunc_Teardrop) +/* 00304 80B44354 3C068003 */ lui $a2, %hi(ActorShadow_DrawFeet) +/* 00308 80B44358 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFeet) /* 0030C 80B4435C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00310 80B44360 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00314 80B44364 0C00AC78 */ jal ActorShape_Init @@ -80,7 +80,7 @@ glabel EnZf_Init /* 003C8 80B44418 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 003CC 80B4441C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 003D0 80B44420 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 003D4 80B44424 0C00B92D */ jal func_8002E4B4 +/* 003D4 80B44424 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003D8 80B44428 E7A00010 */ swc1 $f0, 0x0010($sp) /* 003DC 80B4442C 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF /* 003E0 80B44430 240C0028 */ addiu $t4, $zero, 0x0028 ## $t4 = 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s index 447ca7f85a..b42dd01d27 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s @@ -58,7 +58,7 @@ glabel EnZf_Update /* 052CC 80B4931C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 052D0 80B49320 3C0641C8 */ lui $a2, 0x41C8 ## $a2 = 41C80000 /* 052D4 80B49324 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 052D8 80B49328 0C00B92D */ jal func_8002E4B4 +/* 052D8 80B49328 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 052DC 80B4932C E7AA0010 */ swc1 $f10, 0x0010($sp) /* 052E0 80B49330 960A0088 */ lhu $t2, 0x0088($s0) ## 00000088 /* 052E4 80B49334 240C0001 */ addiu $t4, $zero, 0x0001 ## $t4 = 00000001 @@ -171,7 +171,7 @@ glabel EnZf_Update /* 05468 80B494B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0546C 80B494BC 15810024 */ bne $t4, $at, .L80B49550 /* 05470 80B494C0 26050418 */ addiu $a1, $s0, 0x0418 ## $a1 = 00000418 -/* 05474 80B494C4 0C0189B7 */ jal Collider_CylinderUpdate +/* 05474 80B494C4 0C0189B7 */ jal Collider_UpdateCylinder /* 05478 80B494C8 AFA50028 */ sw $a1, 0x0028($sp) /* 0547C 80B494CC C6060080 */ lwc1 $f6, 0x0080($s0) ## 00000080 @@ -188,7 +188,7 @@ glabel EnZf_Update /* 054A8 80B494F8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 054AC 80B494FC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 054B0 80B49500 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 054B4 80B49504 00812821 */ addu $a1, $a0, $at .L80B49508: /* 054B8 80B49508 8602001C */ lh $v0, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s index 5e3fcb87f0..6d215e6072 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s @@ -76,7 +76,7 @@ glabel func_80B44058 /* 00114 80B44164 E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 00118 80B44168 AFA90014 */ sw $t1, 0x0014($sp) /* 0011C 80B4416C 8FA4004C */ lw $a0, 0x004C($sp) -/* 00120 80B44170 0C00B92D */ jal func_8002E4B4 +/* 00120 80B44170 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00124 80B44174 E7A20010 */ swc1 $f2, 0x0010($sp) /* 00128 80B44178 27AB0030 */ addiu $t3, $sp, 0x0030 ## $t3 = FFFFFFE8 /* 0012C 80B4417C 8D6D0000 */ lw $t5, 0x0000($t3) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s index e43b76a271..0b7fbe3400 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s @@ -55,7 +55,7 @@ glabel func_80B441C4 /* 0023C 80B4428C E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 00240 80B44290 AFA80014 */ sw $t0, 0x0014($sp) /* 00244 80B44294 8FA4004C */ lw $a0, 0x004C($sp) -/* 00248 80B44298 0C00B92D */ jal func_8002E4B4 +/* 00248 80B44298 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0024C 80B4429C E7A20010 */ swc1 $f2, 0x0010($sp) /* 00250 80B442A0 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = FFFFFFE8 /* 00254 80B442A4 8D4C0000 */ lw $t4, 0x0000($t2) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s index 2974fc874b..4a4ceacd82 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s @@ -106,7 +106,7 @@ glabel func_80B44E8C /* 00FB8 80B45008 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00FBC 80B4500C 55C10019 */ bnel $t6, $at, .L80B45074 /* 00FC0 80B45010 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00FC4 80B45014 0C00B6D2 */ jal func_8002DB48 +/* 00FC4 80B45014 0C00B6D2 */ jal Actor_WorldDistXYZToActor /* 00FC8 80B45018 AFA50028 */ sw $a1, 0x0028($sp) /* 00FCC 80B4501C 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00FD0 80B45020 44819000 */ mtc1 $at, $f18 ## $f18 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s index 1253125e2c..d48fcc9e11 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s @@ -87,7 +87,7 @@ glabel func_80B45748 /* 01800 80B45850 000B6080 */ sll $t4, $t3, 2 /* 01804 80B45854 018B6023 */ subu $t4, $t4, $t3 /* 01808 80B45858 000C6080 */ sll $t4, $t4, 2 -/* 0180C 80B4585C 0C00B6B0 */ jal func_8002DAC0 +/* 0180C 80B4585C 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01810 80B45860 018D2821 */ addu $a1, $t4, $t5 /* 01814 80B45864 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 /* 01818 80B45868 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 @@ -129,7 +129,7 @@ glabel func_80B45748 /* 0189C 80B458EC 01495023 */ subu $t2, $t2, $t1 /* 018A0 80B458F0 000A5080 */ sll $t2, $t2, 2 /* 018A4 80B458F4 014B2821 */ addu $a1, $t2, $t3 -/* 018A8 80B458F8 0C00B6EC */ jal func_8002DBB0 +/* 018A8 80B458F8 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 018AC 80B458FC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 018B0 80B45900 C7A60044 */ lwc1 $f6, 0x0044($sp) /* 018B4 80B45904 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -160,7 +160,7 @@ glabel func_80B45748 /* 01914 80B45964 01EE7823 */ subu $t7, $t7, $t6 /* 01918 80B45968 000F7880 */ sll $t7, $t7, 2 /* 0191C 80B4596C 01F92821 */ addu $a1, $t7, $t9 -/* 01920 80B45970 0C00B6B0 */ jal func_8002DAC0 +/* 01920 80B45970 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01924 80B45974 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01928 80B45978 10000009 */ beq $zero, $zero, .L80B459A0 /* 0192C 80B4597C A6020032 */ sh $v0, 0x0032($s0) ## 00000032 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s index 1ac6f2f481..876c1f5d15 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s @@ -10,7 +10,7 @@ glabel func_80B4743C /* 0340C 80B4745C 000E7880 */ sll $t7, $t6, 2 /* 03410 80B47460 01EE7823 */ subu $t7, $t7, $t6 /* 03414 80B47464 000F7880 */ sll $t7, $t7, 2 -/* 03418 80B47468 0C00B6B0 */ jal func_8002DAC0 +/* 03418 80B47468 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 0341C 80B4746C 01F82821 */ addu $a1, $t7, $t8 /* 03420 80B47470 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 03424 80B47474 00411821 */ addu $v1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s index 43d79d02ae..8e33eaa11b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s @@ -27,7 +27,7 @@ glabel func_80B4781C /* 03808 80B47858 000F7880 */ sll $t7, $t7, 2 /* 0380C 80B4785C 2718A090 */ addiu $t8, $t8, %lo(D_80B4A090) ## $t8 = 80B4A090 /* 03810 80B47860 C434A388 */ lwc1 $f20, %lo(D_80B4A388)($at) -/* 03814 80B47864 0C00B6EC */ jal func_8002DBB0 +/* 03814 80B47864 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 03818 80B47868 01F82821 */ addu $a1, $t7, $t8 /* 0381C 80B4786C E7A00074 */ swc1 $f0, 0x0074($sp) /* 03820 80B47870 8E1903E4 */ lw $t9, 0x03E4($s0) ## 000003E4 @@ -61,7 +61,7 @@ glabel func_80B4781C /* 03884 80B478D4 000A5880 */ sll $t3, $t2, 2 /* 03888 80B478D8 016A5823 */ subu $t3, $t3, $t2 /* 0388C 80B478DC 000B5880 */ sll $t3, $t3, 2 -/* 03890 80B478E0 0C00B6B0 */ jal func_8002DAC0 +/* 03890 80B478E0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 03894 80B478E4 016C2821 */ addu $a1, $t3, $t4 /* 03898 80B478E8 A7A2005A */ sh $v0, 0x005A($sp) /* 0389C 80B478EC 8E0703E4 */ lw $a3, 0x03E4($s0) ## 000003E4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s index 66f0c47043..82c2b44b19 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s @@ -57,7 +57,7 @@ glabel func_80B48E50 .L80B48F14: /* 04EC4 80B48F14 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 04EC8 80B48F18 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 04ECC 80B48F1C 0C00CDD2 */ jal Actor_ChangeType +/* 04ECC 80B48F1C 0C00CDD2 */ jal Actor_ChangeCategory /* 04ED0 80B48F20 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 04ED4 80B48F24 92020404 */ lbu $v0, 0x0404($s0) ## 00000404 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s index 78d3818b14..f23b652424 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s @@ -81,7 +81,7 @@ glabel func_80B49688 /* 056C4 80B49714 26040464 */ addiu $a0, $s0, 0x0464 ## $a0 = 00000464 /* 056C8 80B49718 8FA50038 */ lw $a1, 0x0038($sp) /* 056CC 80B4971C 8FA60034 */ lw $a2, 0x0034($sp) -/* 056D0 80B49720 0C0189CD */ jal func_80062734 +/* 056D0 80B49720 0C0189CD */ jal Collider_SetQuadVertices /* 056D4 80B49724 AFAF0010 */ sw $t7, 0x0010($sp) /* 056D8 80B49728 3C0480B5 */ lui $a0, %hi(D_80B4A2A4) ## $a0 = 80B50000 /* 056DC 80B4972C 2484A2A4 */ addiu $a0, $a0, %lo(D_80B4A2A4) ## $a0 = 80B4A2A4 @@ -132,7 +132,7 @@ glabel func_80B49688 /* 05788 80B497D8 AFA70014 */ sw $a3, 0x0014($sp) /* 0578C 80B497DC 8FA50064 */ lw $a1, 0x0064($sp) /* 05790 80B497E0 2406002D */ addiu $a2, $zero, 0x002D ## $a2 = 0000002D -/* 05794 80B497E4 0C00AF6C */ jal func_8002BDB0 +/* 05794 80B497E4 0C00AF6C */ jal Actor_SetFeetPos /* 05798 80B497E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B497EC: /* 0579C 80B497EC 8FA20064 */ lw $v0, 0x0064($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s index dfa1201c3a..e97f7df706 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s @@ -10,7 +10,7 @@ glabel func_80B49C2C /* 05BFC 80B49C4C 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 05C00 80B49C50 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 /* 05C04 80B49C54 AFA2001C */ sw $v0, 0x001C($sp) -/* 05C08 80B49C58 0C00B69E */ jal func_8002DA78 +/* 05C08 80B49C58 0C00B69E */ jal Actor_WorldYawTowardActor /* 05C0C 80B49C5C AFA70024 */ sw $a3, 0x0024($sp) /* 05C10 80B49C60 8FA40024 */ lw $a0, 0x0024($sp) /* 05C14 80B49C64 3C06C100 */ lui $a2, 0xC100 ## $a2 = C1000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s index 30497c5e6b..2325137da7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s @@ -9,7 +9,7 @@ glabel func_80B49E4C /* 05E18 80B49E68 8FA4002C */ lw $a0, 0x002C($sp) /* 05E1C 80B49E6C 10400081 */ beq $v0, $zero, .L80B4A074 /* 05E20 80B49E70 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 -/* 05E24 80B49E74 0C00B69E */ jal func_8002DA78 +/* 05E24 80B49E74 0C00B69E */ jal Actor_WorldYawTowardActor /* 05E28 80B49E78 00000000 */ nop /* 05E2C 80B49E7C 8FA4002C */ lw $a0, 0x002C($sp) /* 05E30 80B49E80 3C06C28C */ lui $a2, 0xC28C ## $a2 = C28C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s index 7875223ca8..47812d7a9d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s @@ -18,8 +18,8 @@ glabel EnZl4_Init /* 0063C 80B5BDEC AFAE0010 */ sw $t6, 0x0010($sp) /* 00640 80B5BDF0 0C0291BE */ jal SkelAnime_InitFlex /* 00644 80B5BDF4 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00648 80B5BDF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0064C 80B5BDFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00648 80B5BDF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0064C 80B5BDFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00650 80B5BE00 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00654 80B5BE04 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00658 80B5BE08 0C00AC78 */ jal ActorShape_Init @@ -45,7 +45,7 @@ glabel EnZl4_Init /* 0069C 80B5BE4C 3C0680B6 */ lui $a2, %hi(D_80B5E7AC) ## $a2 = 80B60000 /* 006A0 80B5BE50 24C6E7AC */ addiu $a2, $a2, %lo(D_80B5E7AC) ## $a2 = 80B5E7AC /* 006A4 80B5BE54 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 006A8 80B5BE58 0C0187BF */ jal func_80061EFC +/* 006A8 80B5BE58 0C0187BF */ jal CollisionCheck_SetInfo2 /* 006AC 80B5BE5C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 006B0 80B5BE60 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 /* 006B4 80B5BE64 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 3C23D70A diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s index 57c2d8de6d..d79a3bbf74 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s @@ -21,7 +21,7 @@ glabel EnZl4_Update /* 02B4C 80B5E2FC 44070000 */ mfc1 $a3, $f0 /* 02B50 80B5E300 8FA4003C */ lw $a0, 0x003C($sp) /* 02B54 80B5E304 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02B58 80B5E308 0C00B92D */ jal func_8002E4B4 +/* 02B58 80B5E308 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02B5C 80B5E30C E7A00010 */ swc1 $f0, 0x0010($sp) /* 02B60 80B5E310 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 02B64 80B5E314 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -31,7 +31,7 @@ glabel EnZl4_Update /* 02B74 80B5E324 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 02B78 80B5E328 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 02B7C 80B5E32C AFA6002C */ sw $a2, 0x002C($sp) -/* 02B80 80B5E330 0C0189B7 */ jal Collider_CylinderUpdate +/* 02B80 80B5E330 0C0189B7 */ jal Collider_UpdateCylinder /* 02B84 80B5E334 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02B88 80B5E338 8FA4003C */ lw $a0, 0x003C($sp) @@ -39,7 +39,7 @@ glabel EnZl4_Update /* 02B90 80B5E340 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 02B94 80B5E344 8FA6002C */ lw $a2, 0x002C($sp) /* 02B98 80B5E348 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B9C 80B5E34C 00812821 */ addu $a1, $a0, $at /* 02BA0 80B5E350 8FBF0024 */ lw $ra, 0x0024($sp) /* 02BA4 80B5E354 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s index 3a951b0372..27d1a36175 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s @@ -587,7 +587,7 @@ glabel Fishing_Init /* 01398 80B6AD38 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0139C 80B6AD3C 26651C24 */ addiu $a1, $s3, 0x1C24 ## $a1 = 00001C24 /* 013A0 80B6AD40 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 013A4 80B6AD44 0C00CDD2 */ jal Actor_ChangeType +/* 013A4 80B6AD44 0C00CDD2 */ jal Actor_ChangeCategory /* 013A8 80B6AD48 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 /* 013AC 80B6AD4C 8E480004 */ lw $t0, 0x0004($s2) ## 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s index d2ec0774e5..d545b16753 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s @@ -5040,7 +5040,7 @@ glabel L80B75278 /* 0BEC8 80B75868 E6040104 */ swc1 $f4, 0x0104($s0) ## 00000104 /* 0BECC 80B7586C E7A000D8 */ swc1 $f0, 0x00D8($sp) /* 0BED0 80B75870 AFB90014 */ sw $t9, 0x0014($sp) -/* 0BED4 80B75874 0C00B92D */ jal func_8002E4B4 +/* 0BED4 80B75874 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0BED8 80B75878 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 0BEDC 80B7587C C7A000D8 */ lwc1 $f0, 0x00D8($sp) /* 0BEE0 80B75880 C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s index 2b4e87366e..535f2b7a5c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s @@ -869,7 +869,7 @@ glabel L80B6F0C4 /* 05A98 80B6F438 E7AC00C8 */ swc1 $f12, 0x00C8($sp) /* 05A9C 80B6F43C AFB90014 */ sw $t9, 0x0014($sp) /* 05AA0 80B6F440 8FA400EC */ lw $a0, 0x00EC($sp) -/* 05AA4 80B6F444 0C00B92D */ jal func_8002E4B4 +/* 05AA4 80B6F444 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 05AA8 80B6F448 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 05AAC 80B6F44C 27AF0080 */ addiu $t7, $sp, 0x0080 ## $t7 = FFFFFF98 /* 05AB0 80B6F450 8DF80000 */ lw $t8, 0x0000($t7) ## FFFFFF98 @@ -1897,7 +1897,7 @@ glabel L80B6FA3C /* 069B8 80B70358 ACB80108 */ sw $t8, 0x0108($a1) ## 00000108 /* 069BC 80B7035C AFB90014 */ sw $t9, 0x0014($sp) /* 069C0 80B70360 8FA400EC */ lw $a0, 0x00EC($sp) -/* 069C4 80B70364 0C00B92D */ jal func_8002E4B4 +/* 069C4 80B70364 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 069C8 80B70368 E7A00010 */ swc1 $f0, 0x0010($sp) /* 069CC 80B7036C 27AF0058 */ addiu $t7, $sp, 0x0058 ## $t7 = FFFFFF70 /* 069D0 80B70370 8DF80000 */ lw $t8, 0x0000($t7) ## FFFFFF70 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s index fa1d1d52ae..41bd205212 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s @@ -186,7 +186,7 @@ glabel func_80B761B8 /* 0CA98 80B76438 8CC6E070 */ lw $a2, %lo(D_80B7E070)($a2) /* 0CA9C 80B7643C 02612821 */ addu $a1, $s3, $at /* 0CAA0 80B76440 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0CAA4 80B76444 24C60230 */ addiu $a2, $a2, 0x0230 ## $a2 = 80B80230 .L80B76448: /* 0CAA8 80B76448 8FBF003C */ lw $ra, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s index a18359428d..e8c398c4f8 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s @@ -33,7 +33,7 @@ glabel func_80B86AC8 /* 00218 80B86B38 AFAE0014 */ sw $t6, 0x0014($sp) /* 0021C 80B86B3C 8FA4002C */ lw $a0, 0x002C($sp) /* 00220 80B86B40 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00224 80B86B44 0C00B92D */ jal func_8002E4B4 +/* 00224 80B86B44 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00228 80B86B48 E7A60010 */ swc1 $f6, 0x0010($sp) /* 0022C 80B86B4C 960F0088 */ lhu $t7, 0x0088($s0) ## 00000088 /* 00230 80B86B50 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s index c1f30774df..105026d782 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s @@ -50,7 +50,7 @@ glabel func_80B86BC8 /* 0034C 80B86C6C 10000009 */ beq $zero, $zero, .L80B86C94 /* 00350 80B86C70 E6100068 */ swc1 $f16, 0x0068($s0) ## 00000068 .L80B86C74: -/* 00354 80B86C74 0C0189B7 */ jal Collider_CylinderUpdate +/* 00354 80B86C74 0C0189B7 */ jal Collider_UpdateCylinder /* 00358 80B86C78 AFA6002C */ sw $a2, 0x002C($sp) /* 0035C 80B86C7C 8FA40034 */ lw $a0, 0x0034($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s index e2522c0fa4..1781ed29a6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s @@ -42,7 +42,7 @@ glabel func_80B86CA8 /* 003EC 80B86D0C AFAE0014 */ sw $t6, 0x0014($sp) /* 003F0 80B86D10 8FA40074 */ lw $a0, 0x0074($sp) /* 003F4 80B86D14 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 -/* 003F8 80B86D18 0C00B92D */ jal func_8002E4B4 +/* 003F8 80B86D18 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003FC 80B86D1C E7A40010 */ swc1 $f4, 0x0010($sp) /* 00400 80B86D20 0C01DE1C */ jal Math_SinS ## sins? diff --git a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s index ab900484b2..c999e9807a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s @@ -31,7 +31,7 @@ glabel MagicFire_Init /* 00068 80B88DD8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 0006C 80B88DDC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00070 80B88DE0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00070 80B88DE0 0C0189B7 */ jal Collider_UpdateCylinder /* 00074 80B88DE4 8FA50020 */ lw $a1, 0x0020($sp) /* 00078 80B88DE8 3C0E80B9 */ lui $t6, %hi(func_80B88E3C) ## $t6 = 80B90000 diff --git a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s index 9b88d9de8f..a3ae73fb3b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s @@ -60,7 +60,7 @@ glabel MagicFire_Update .L80B88F78: /* 00208 80B88F78 AFA6002C */ sw $a2, 0x002C($sp) .L80B88F7C: -/* 0020C 80B88F7C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0020C 80B88F7C 0C0189B7 */ jal Collider_UpdateCylinder /* 00210 80B88F80 AFA7004C */ sw $a3, 0x004C($sp) /* 00214 80B88F84 3C0180B9 */ lui $at, %hi(D_80B8AFFC) ## $at = 80B90000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s index 528975ca39..620a0d3b14 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s @@ -151,12 +151,12 @@ glabel ObjBean_Init /* 01180 80B8FC00 0C2E3AA0 */ jal func_80B8EA80 /* 01184 80B8FC04 8FA50024 */ lw $a1, 0x0024($sp) /* 01188 80B8FC08 920D01F7 */ lbu $t5, 0x01F7($s0) ## 000001F7 -/* 0118C 80B8FC0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 0118C 80B8FC0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 01190 80B8FC10 3C07410C */ lui $a3, 0x410C ## $a3 = 410C0000 /* 01194 80B8FC14 35AE0010 */ ori $t6, $t5, 0x0010 ## $t6 = 00000010 /* 01198 80B8FC18 A20E01F7 */ sb $t6, 0x01F7($s0) ## 000001F7 /* 0119C 80B8FC1C 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 410CCCCD -/* 011A0 80B8FC20 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 011A0 80B8FC20 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 011A4 80B8FC24 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 011A8 80B8FC28 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s index d146c87a66..fb20f8c4dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s @@ -56,7 +56,7 @@ glabel ObjBean_Update /* 020E4 80B90B64 44093000 */ mfc1 $t1, $f6 /* 020E8 80B90B68 00000000 */ nop /* 020EC 80B90B6C A60901A8 */ sh $t1, 0x01A8($s0) ## 000001A8 -/* 020F0 80B90B70 0C0189B7 */ jal Collider_CylinderUpdate +/* 020F0 80B90B70 0C0189B7 */ jal Collider_UpdateCylinder /* 020F4 80B90B74 AFA60024 */ sw $a2, 0x0024($sp) /* 020F8 80B90B78 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -64,7 +64,7 @@ glabel ObjBean_Update /* 02100 80B90B80 8FA60024 */ lw $a2, 0x0024($sp) /* 02104 80B90B84 02212821 */ addu $a1, $s1, $at /* 02108 80B90B88 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0210C 80B90B8C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02110 80B90B90 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B90B94: @@ -73,8 +73,8 @@ glabel ObjBean_Update /* 0211C 80B90B9C 3C0142B0 */ lui $at, 0x42B0 ## $at = 42B00000 /* 02120 80B90BA0 44815000 */ mtc1 $at, $f10 ## $f10 = 88.00 /* 02124 80B90BA4 C6080050 */ lwc1 $f8, 0x0050($s0) ## 00000050 -/* 02128 80B90BA8 3C0A8003 */ lui $t2, %hi(ActorShadow_DrawFunc_Circle) -/* 0212C 80B90BAC 254AB5EC */ addiu $t2, %lo(ActorShadow_DrawFunc_Circle) +/* 02128 80B90BA8 3C0A8003 */ lui $t2, %hi(ActorShadow_DrawCircle) +/* 0212C 80B90BAC 254AB5EC */ addiu $t2, %lo(ActorShadow_DrawCircle) /* 02130 80B90BB0 460A4402 */ mul.s $f16, $f8, $f10 /* 02134 80B90BB4 AE0A00C0 */ sw $t2, 0x00C0($s0) ## 000000C0 /* 02138 80B90BB8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -109,7 +109,7 @@ glabel ObjBean_Update .L80B90C20: /* 021A0 80B90C20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B90C24: -/* 021A4 80B90C24 0C00B56E */ jal Actor_SetHeight +/* 021A4 80B90C24 0C00B56E */ jal Actor_SetFocus /* 021A8 80B90C28 3C0540C0 */ lui $a1, 0x40C0 ## $a1 = 40C00000 /* 021AC 80B90C2C 920B01F7 */ lbu $t3, 0x01F7($s0) ## 000001F7 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s index cae6a61ab4..fedf03f745 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s @@ -17,7 +17,7 @@ glabel func_80B8EA80 /* 00038 80B8EAB8 8FA50018 */ lw $a1, 0x0018($sp) /* 0003C 80B8EABC 8FA40020 */ lw $a0, 0x0020($sp) -/* 00040 80B8EAC0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00040 80B8EAC0 0C0189B7 */ jal Collider_UpdateCylinder /* 00044 80B8EAC4 8FA50018 */ lw $a1, 0x0018($sp) /* 00048 80B8EAC8 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s index d5c3835a55..6957a27ea3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s @@ -28,7 +28,7 @@ glabel ObjTsubo_Init /* 001BC 80BA0F1C 3C0680BA */ lui $a2, %hi(D_80BA1BC0) ## $a2 = 80BA0000 /* 001C0 80BA0F20 24C61BC0 */ addiu $a2, $a2, %lo(D_80BA1BC0) ## $a2 = 80BA1BC0 /* 001C4 80BA0F24 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 001C8 80BA0F28 0C0187B5 */ jal func_80061ED4 +/* 001C8 80BA0F28 0C0187B5 */ jal CollisionCheck_SetInfo /* 001CC 80BA0F2C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 001D0 80BA0F30 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 001D4 80BA0F34 0C2E837D */ jal func_80BA0DF4 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s index 11abceac74..bc3a61ac27 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s @@ -17,7 +17,7 @@ glabel func_80BA0E98 /* 00170 80BA0ED0 8FA50018 */ lw $a1, 0x0018($sp) /* 00174 80BA0ED4 8FA40020 */ lw $a0, 0x0020($sp) -/* 00178 80BA0ED8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00178 80BA0ED8 0C0189B7 */ jal Collider_UpdateCylinder /* 0017C 80BA0EDC 8FA50018 */ lw $a1, 0x0018($sp) /* 00180 80BA0EE0 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s index 586747c093..b606b3a715 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s @@ -80,7 +80,7 @@ glabel func_80BA15BC /* 00978 80BA16D8 00000000 */ nop /* 0097C 80BA16DC 4502001A */ bc1fl .L80BA1748 /* 00980 80BA16E0 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 00984 80BA16E4 0C0189B7 */ jal Collider_CylinderUpdate +/* 00984 80BA16E4 0C0189B7 */ jal Collider_UpdateCylinder /* 00988 80BA16E8 AFA5002C */ sw $a1, 0x002C($sp) /* 0098C 80BA16EC 920B0161 */ lbu $t3, 0x0161($s0) ## 00000161 @@ -104,7 +104,7 @@ glabel func_80BA15BC /* 009D0 80BA1730 45020005 */ bc1fl .L80BA1748 /* 009D4 80BA1734 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 009D8 80BA1738 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 009DC 80BA173C 8FA6002C */ lw $a2, 0x002C($sp) /* 009E0 80BA1740 C6000090 */ lwc1 $f0, 0x0090($s0) ## 00000090 /* 009E4 80BA1744 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s index 559850d2ee..c33aac2fb4 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s @@ -24,7 +24,7 @@ glabel func_80BA180C /* 00B04 80BA1864 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00B08 80BA1868 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 00B0C 80BA186C 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 00B10 80BA1870 0C00B92D */ jal func_8002E4B4 +/* 00B10 80BA1870 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B14 80BA1874 E7A40010 */ swc1 $f4, 0x0010($sp) .L80BA1878: /* 00B18 80BA1878 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s index ce14fe0335..80f190ec7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s @@ -86,11 +86,11 @@ glabel func_80BA1958 /* 00D24 80BA1A84 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D28 80BA1A88 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 00D2C 80BA1A8C 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 00D30 80BA1A90 0C00B92D */ jal func_8002E4B4 +/* 00D30 80BA1A90 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00D34 80BA1A94 E7A40010 */ swc1 $f4, 0x0010($sp) /* 00D38 80BA1A98 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 /* 00D3C 80BA1A9C AFA5002C */ sw $a1, 0x002C($sp) -/* 00D40 80BA1AA0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00D40 80BA1AA0 0C0189B7 */ jal Collider_UpdateCylinder /* 00D44 80BA1AA4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00D48 80BA1AA8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -99,7 +99,7 @@ glabel func_80BA1958 /* 00D54 80BA1AB4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D58 80BA1AB8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D5C 80BA1ABC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00D60 80BA1AC0 8FA6002C */ lw $a2, 0x002C($sp) /* 00D64 80BA1AC4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D68 80BA1AC8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s index 4f58da42d1..7bc7421e59 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s @@ -42,7 +42,7 @@ glabel ObjWarp2block_Init /* 005D8 80BA23C8 AE090168 */ sw $t1, 0x0168($s0) ## 00000168 /* 005DC 80BA23CC 00AD2821 */ addu $a1, $a1, $t5 /* 005E0 80BA23D0 8CA52844 */ lw $a1, %lo(D_80BA2844)($a1) -/* 005E4 80BA23D4 0C00B56E */ jal Actor_SetHeight +/* 005E4 80BA23D4 0C00B56E */ jal Actor_SetFocus /* 005E8 80BA23D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 005EC 80BA23DC 860E001C */ lh $t6, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s b/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s index 2e4a634fef..279191e4e4 100644 --- a/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s @@ -109,7 +109,7 @@ glabel L80BA2BA8 /* 00114 80BA2BB4 E4C40198 */ swc1 $f4, 0x0198($a2) ## 00000198 /* 00118 80BA2BB8 8FA4001C */ lw $a0, 0x001C($sp) /* 0011C 80BA2BBC AFA60018 */ sw $a2, 0x0018($sp) -/* 00120 80BA2BC0 0C00CDD2 */ jal Actor_ChangeType +/* 00120 80BA2BC0 0C00CDD2 */ jal Actor_ChangeCategory /* 00124 80BA2BC4 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00128 80BA2BC8 8FA40018 */ lw $a0, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_player_actor/Player_Init.s b/asm/non_matchings/overlays/actors/ovl_player_actor/Player_Init.s deleted file mode 100644 index ac99398c46..0000000000 --- a/asm/non_matchings/overlays/actors/ovl_player_actor/Player_Init.s +++ /dev/null @@ -1,362 +0,0 @@ -.rdata -glabel D_80855290 - .asciz "../z_player.c" - .balign 4 - -.text -glabel Player_Init -/* 14AC8 80846CD8 27BDFF98 */ addiu $sp, $sp, 0xFF98 ## $sp = FFFFFF98 -/* 14ACC 80846CDC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14AD0 80846CE0 AFBF0034 */ sw $ra, 0x0034($sp) -/* 14AD4 80846CE4 AFB20030 */ sw $s2, 0x0030($sp) -/* 14AD8 80846CE8 AFB1002C */ sw $s1, 0x002C($sp) -/* 14ADC 80846CEC AFB00028 */ sw $s0, 0x0028($sp) -/* 14AE0 80846CF0 00A11021 */ addu $v0, $a1, $at -/* 14AE4 80846CF4 8C4E242C */ lw $t6, 0x242C($v0) ## 0000242C -/* 14AE8 80846CF8 00250821 */ addu $at, $at, $a1 -/* 14AEC 80846CFC 3C188084 */ lui $t8, %hi(Player_InitCommon) ## $t8 = 80840000 -/* 14AF0 80846D00 AFAE005C */ sw $t6, 0x005C($sp) -/* 14AF4 80846D04 A0201E5D */ sb $zero, 0x1E5D($at) ## 00011E5D -/* 14AF8 80846D08 804F1E5D */ lb $t7, 0x1E5D($v0) ## 00001E5D -/* 14AFC 80846D0C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B00 80846D10 00250821 */ addu $at, $at, $a1 -/* 14B04 80846D14 A02F1E5C */ sb $t7, 0x1E5C($at) ## 00011E5C -/* 14B08 80846D18 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B0C 80846D1C 00250821 */ addu $at, $at, $a1 -/* 14B10 80846D20 27186AAC */ addiu $t8, $t8, %lo(Player_InitCommon) ## $t8 = 80846AAC -/* 14B14 80846D24 AC381D3C */ sw $t8, 0x1D3C($at) ## 00011D3C -/* 14B18 80846D28 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B1C 80846D2C 3C198085 */ lui $t9, %hi(Player_UpdateCommon) ## $t9 = 80850000 -/* 14B20 80846D30 27398F9C */ addiu $t9, $t9, %lo(Player_UpdateCommon) ## $t9 = 80848F9C -/* 14B24 80846D34 00250821 */ addu $at, $at, $a1 -/* 14B28 80846D38 AC391D40 */ sw $t9, 0x1D40($at) ## 00011D40 -/* 14B2C 80846D3C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B30 80846D40 3C098085 */ lui $t1, %hi(Player_IsDroppingFish) ## $t1 = 80850000 -/* 14B34 80846D44 25292EC8 */ addiu $t1, $t1, %lo(Player_IsDroppingFish) ## $t1 = 80852EC8 -/* 14B38 80846D48 00250821 */ addu $at, $at, $a1 -/* 14B3C 80846D4C AC291D44 */ sw $t1, 0x1D44($at) ## 00011D44 -/* 14B40 80846D50 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B44 80846D54 3C0A8085 */ lui $t2, %hi(Player_StartFishing) ## $t2 = 80850000 -/* 14B48 80846D58 254A2EFC */ addiu $t2, $t2, %lo(Player_StartFishing) ## $t2 = 80852EFC -/* 14B4C 80846D5C 00250821 */ addu $at, $at, $a1 -/* 14B50 80846D60 AC2A1D48 */ sw $t2, 0x1D48($at) ## 00011D48 -/* 14B54 80846D64 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B58 80846D68 3C0B8085 */ lui $t3, %hi(func_80852F38) ## $t3 = 80850000 -/* 14B5C 80846D6C 256B2F38 */ addiu $t3, $t3, %lo(func_80852F38) ## $t3 = 80852F38 -/* 14B60 80846D70 00250821 */ addu $at, $at, $a1 -/* 14B64 80846D74 AC2B1D4C */ sw $t3, 0x1D4C($at) ## 00011D4C -/* 14B68 80846D78 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B6C 80846D7C 3C0C8085 */ lui $t4, %hi(func_80852FFC) ## $t4 = 80850000 -/* 14B70 80846D80 258C2FFC */ addiu $t4, $t4, %lo(func_80852FFC) ## $t4 = 80852FFC -/* 14B74 80846D84 00250821 */ addu $at, $at, $a1 -/* 14B78 80846D88 AC2C1D50 */ sw $t4, 0x1D50($at) ## 00011D50 -/* 14B7C 80846D8C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B80 80846D90 3C0D8085 */ lui $t5, %hi(func_80853080) ## $t5 = 80850000 -/* 14B84 80846D94 25AD3080 */ addiu $t5, $t5, %lo(func_80853080) ## $t5 = 80853080 -/* 14B88 80846D98 00250821 */ addu $at, $at, $a1 -/* 14B8C 80846D9C AC2D1D54 */ sw $t5, 0x1D54($at) ## 00011D54 -/* 14B90 80846DA0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14B94 80846DA4 3C0E8085 */ lui $t6, %hi(Player_InflictDamage) ## $t6 = 80850000 -/* 14B98 80846DA8 25CE30E0 */ addiu $t6, $t6, %lo(Player_InflictDamage) ## $t6 = 808530E0 -/* 14B9C 80846DAC 00250821 */ addu $at, $at, $a1 -/* 14BA0 80846DB0 AC2E1D58 */ sw $t6, 0x1D58($at) ## 00011D58 -/* 14BA4 80846DB4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 -/* 14BA8 80846DB8 3C0F8085 */ lui $t7, %hi(func_80853148) ## $t7 = 80850000 -/* 14BAC 80846DBC 25EF3148 */ addiu $t7, $t7, %lo(func_80853148) ## $t7 = 80853148 -/* 14BB0 80846DC0 00250821 */ addu $at, $at, $a1 -/* 14BB4 80846DC4 3C128016 */ lui $s2, %hi(gSaveContext) -/* 14BB8 80846DC8 2403FFFF */ addiu $v1, $zero, 0xFFFF ## $v1 = FFFFFFFF -/* 14BBC 80846DCC AC2F1D5C */ sw $t7, 0x1D5C($at) ## 00011D5C -/* 14BC0 80846DD0 2652E660 */ addiu $s2, %lo(gSaveContext) -/* 14BC4 80846DD4 A0830003 */ sb $v1, 0x0003($a0) ## 00000003 -/* 14BC8 80846DD8 8E580004 */ lw $t8, 0x0004($s2) ## 8015E664 -/* 14BCC 80846DDC A0830151 */ sb $v1, 0x0151($a0) ## 00000151 -/* 14BD0 80846DE0 808B0151 */ lb $t3, 0x0151($a0) ## 00000151 -/* 14BD4 80846DE4 0018C880 */ sll $t9, $t8, 2 -/* 14BD8 80846DE8 0338C823 */ subu $t9, $t9, $t8 -/* 14BDC 80846DEC 0019C880 */ sll $t9, $t9, 2 -/* 14BE0 80846DF0 0338C821 */ addu $t9, $t9, $t8 -/* 14BE4 80846DF4 0019C880 */ sll $t9, $t9, 2 -/* 14BE8 80846DF8 3C098085 */ lui $t1, %hi(sAgeProperties) ## $t1 = 80850000 -/* 14BEC 80846DFC 0338C821 */ addu $t9, $t9, $t8 -/* 14BF0 80846E00 0019C880 */ sll $t9, $t9, 2 -/* 14BF4 80846E04 25293428 */ addiu $t1, $t1, %lo(sAgeProperties) ## $t1 = 80853428 -/* 14BF8 80846E08 03295021 */ addu $t2, $t9, $t1 -/* 14BFC 80846E0C 240C00FF */ addiu $t4, $zero, 0x00FF ## $t4 = 000000FF -/* 14C00 80846E10 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 14C04 80846E14 AC8A0678 */ sw $t2, 0x0678($a0) ## 00000678 -/* 14C08 80846E18 A08C0152 */ sb $t4, 0x0152($a0) ## 00000152 -/* 14C0C 80846E1C A08B0154 */ sb $t3, 0x0154($a0) ## 00000154 -/* 14C10 80846E20 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 -/* 14C14 80846E24 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 -/* 14C18 80846E28 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 14C1C 80846E2C 0C20D7D1 */ jal func_80835F44 -/* 14C20 80846E30 240600FF */ addiu $a2, $zero, 0x00FF ## $a2 = 000000FF -/* 14C24 80846E34 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14C28 80846E38 0C023B2B */ jal Player_SetEquipmentData -/* 14C2C 80846E3C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 14C30 80846E40 820D014F */ lb $t5, 0x014F($s0) ## 0000014F -/* 14C34 80846E44 3C068012 */ lui $a2, %hi(gPlayerSkelHeaders) -/* 14C38 80846E48 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 14C3C 80846E4C A20D0153 */ sb $t5, 0x0153($s0) ## 00000153 -/* 14C40 80846E50 8E470004 */ lw $a3, 0x0004($s2) ## 8015E664 -/* 14C44 80846E54 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 14C48 80846E58 00077080 */ sll $t6, $a3, 2 -/* 14C4C 80846E5C 00CE3021 */ addu $a2, $a2, $t6 -/* 14C50 80846E60 0C211AAB */ jal Player_InitCommon -/* 14C54 80846E64 8CC65B70 */ lw $a2, %lo(gPlayerSkelHeaders)($a2) -/* 14C58 80846E68 3C058085 */ lui $a1, %hi(D_80855290) ## $a1 = 80850000 -/* 14C5C 80846E6C 24A55290 */ addiu $a1, $a1, %lo(D_80855290) ## $a1 = 80855290 -/* 14C60 80846E70 24043008 */ addiu $a0, $zero, 0x3008 ## $a0 = 00003008 -/* 14C64 80846E74 0C01EBB8 */ jal ZeldaArena_MallocDebug -/* 14C68 80846E78 24064317 */ addiu $a2, $zero, 0x4317 ## $a2 = 00004317 -/* 14C6C 80846E7C 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008 -/* 14C70 80846E80 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 14C74 80846E84 01E1C024 */ and $t8, $t7, $at -/* 14C78 80846E88 AE1801B0 */ sw $t8, 0x01B0($s0) ## 000001B0 -/* 14C7C 80846E8C 8E481364 */ lw $t0, 0x1364($s2) ## 8015F9C4 -/* 14C80 80846E90 1100003E */ beq $t0, $zero, .L80846F8C -/* 14C84 80846E94 2401FFFD */ addiu $at, $zero, 0xFFFD ## $at = FFFFFFFD -/* 14C88 80846E98 55010005 */ bnel $t0, $at, .L80846EB0 -/* 14C8C 80846E9C 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 14C90 80846EA0 86591392 */ lh $t9, 0x1392($s2) ## 8015F9F2 -/* 14C94 80846EA4 10000039 */ beq $zero, $zero, .L80846F8C -/* 14C98 80846EA8 A619001C */ sh $t9, 0x001C($s0) ## 0000001C -/* 14C9C 80846EAC 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -.L80846EB0: -/* 14CA0 80846EB0 11010004 */ beq $t0, $at, .L80846EC4 -/* 14CA4 80846EB4 2409FFFE */ addiu $t1, $zero, 0xFFFE ## $t1 = FFFFFFFE -/* 14CA8 80846EB8 2401FFFF */ addiu $at, $zero, 0xFFFF ## $at = FFFFFFFF -/* 14CAC 80846EBC 15010002 */ bne $t0, $at, .L80846EC8 -/* 14CB0 80846EC0 00000000 */ nop -.L80846EC4: -/* 14CB4 80846EC4 A2090A86 */ sb $t1, 0x0A86($s0) ## 00000A86 -.L80846EC8: -/* 14CB8 80846EC8 05010003 */ bgez $t0, .L80846ED8 -/* 14CBC 80846ECC 2502FFFF */ addiu $v0, $t0, 0xFFFF ## $v0 = FFFFFFFF -/* 14CC0 80846ED0 10000022 */ beq $zero, $zero, .L80846F5C -/* 14CC4 80846ED4 AFA0004C */ sw $zero, 0x004C($sp) -.L80846ED8: -/* 14CC8 80846ED8 000850C0 */ sll $t2, $t0, 3 -/* 14CCC 80846EDC 01485023 */ subu $t2, $t2, $t0 -/* 14CD0 80846EE0 000A5080 */ sll $t2, $t2, 2 -/* 14CD4 80846EE4 024A2821 */ addu $a1, $s2, $t2 -/* 14CD8 80846EE8 26040024 */ addiu $a0, $s0, 0x0024 ## $a0 = 00000024 -/* 14CDC 80846EEC AFA2004C */ sw $v0, 0x004C($sp) -/* 14CE0 80846EF0 AFA40038 */ sw $a0, 0x0038($sp) -/* 14CE4 80846EF4 24A5134C */ addiu $a1, $a1, 0x134C ## $a1 = 0000134C -/* 14CE8 80846EF8 AFA2003C */ sw $v0, 0x003C($sp) -/* 14CEC 80846EFC 0C01DF90 */ jal Math_Vec3f_Copy - ## Vec3f_Copy -/* 14CF0 80846F00 AFA80050 */ sw $t0, 0x0050($sp) -/* 14CF4 80846F04 26040008 */ addiu $a0, $s0, 0x0008 ## $a0 = 00000008 -/* 14CF8 80846F08 0C01DF90 */ jal Math_Vec3f_Copy - ## Vec3f_Copy -/* 14CFC 80846F0C 8FA50038 */ lw $a1, 0x0038($sp) -/* 14D00 80846F10 26040100 */ addiu $a0, $s0, 0x0100 ## $a0 = 00000100 -/* 14D04 80846F14 0C01DF90 */ jal Math_Vec3f_Copy - ## Vec3f_Copy -/* 14D08 80846F18 8FA50038 */ lw $a1, 0x0038($sp) -/* 14D0C 80846F1C C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 -/* 14D10 80846F20 8FA80050 */ lw $t0, 0x0050($sp) -/* 14D14 80846F24 4600218D */ trunc.w.s $f6, $f4 -/* 14D18 80846F28 440C3000 */ mfc1 $t4, $f6 -/* 14D1C 80846F2C 00000000 */ nop -/* 14D20 80846F30 A60C0894 */ sh $t4, 0x0894($s0) ## 00000894 -/* 14D24 80846F34 8FAD003C */ lw $t5, 0x003C($sp) -/* 14D28 80846F38 000D70C0 */ sll $t6, $t5, 3 -/* 14D2C 80846F3C 01CD7023 */ subu $t6, $t6, $t5 -/* 14D30 80846F40 000E7080 */ sll $t6, $t6, 2 -/* 14D34 80846F44 024E1021 */ addu $v0, $s2, $t6 -/* 14D38 80846F48 84451374 */ lh $a1, 0x1374($v0) ## 00001374 -/* 14D3C 80846F4C A60500B6 */ sh $a1, 0x00B6($s0) ## 000000B6 -/* 14D40 80846F50 A605083C */ sh $a1, 0x083C($s0) ## 0000083C -/* 14D44 80846F54 844F1376 */ lh $t7, 0x1376($v0) ## 00001376 -/* 14D48 80846F58 A60F001C */ sh $t7, 0x001C($s0) ## 0000001C -.L80846F5C: -/* 14D4C 80846F5C 8FB8004C */ lw $t8, 0x004C($sp) -/* 14D50 80846F60 3C0100FF */ lui $at, 0x00FF ## $at = 00FF0000 -/* 14D54 80846F64 3421FFFF */ ori $at, $at, 0xFFFF ## $at = 00FFFFFF -/* 14D58 80846F68 0018C8C0 */ sll $t9, $t8, 3 -/* 14D5C 80846F6C 0338C823 */ subu $t9, $t9, $t8 -/* 14D60 80846F70 0019C880 */ sll $t9, $t9, 2 -/* 14D64 80846F74 02591021 */ addu $v0, $s2, $t9 -/* 14D68 80846F78 8C49137C */ lw $t1, 0x137C($v0) ## 0000137C -/* 14D6C 80846F7C 01215024 */ and $t2, $t1, $at -/* 14D70 80846F80 AE2A1D2C */ sw $t2, 0x1D2C($s1) ## 00001D2C -/* 14D74 80846F84 8C4B1380 */ lw $t3, 0x1380($v0) ## 00001380 -/* 14D78 80846F88 AE2B1D48 */ sw $t3, 0x1D48($s1) ## 00001D48 -.L80846F8C: -/* 14D7C 80846F8C 11000003 */ beq $t0, $zero, .L80846F9C -/* 14D80 80846F90 2901FFFF */ slti $at, $t0, 0xFFFF -/* 14D84 80846F94 50200036 */ beql $at, $zero, .L80847070 -/* 14D88 80846F98 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -.L80846F9C: -/* 14D8C 80846F9C 8FA3005C */ lw $v1, 0x005C($sp) -/* 14D90 80846FA0 8C6C000C */ lw $t4, 0x000C($v1) ## 0000000C -/* 14D94 80846FA4 8C6D0008 */ lw $t5, 0x0008($v1) ## 00000008 -/* 14D98 80846FA8 518D002F */ beql $t4, $t5, .L80847068 -/* 14D9C 80846FAC 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 14DA0 80846FB0 924E13C7 */ lbu $t6, 0x13C7($s2) ## 8015FA27 -/* 14DA4 80846FB4 51C0002C */ beql $t6, $zero, .L80847068 -/* 14DA8 80846FB8 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 14DAC 80846FBC 8E431360 */ lw $v1, 0x1360($s2) ## 8015F9C0 -/* 14DB0 80846FC0 28610004 */ slti $at, $v1, 0x0004 -/* 14DB4 80846FC4 50200028 */ beql $at, $zero, .L80847068 -/* 14DB8 80846FC8 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 14DBC 80846FCC 8E420000 */ lw $v0, 0x0000($s2) ## 8015E660 -/* 14DC0 80846FD0 00037880 */ sll $t7, $v1, 2 -/* 14DC4 80846FD4 3C098013 */ lui $t1, %hi(gEntranceTable+2) -/* 14DC8 80846FD8 0002C080 */ sll $t8, $v0, 2 -/* 14DCC 80846FDC 01F8C821 */ addu $t9, $t7, $t8 -/* 14DD0 80846FE0 01394821 */ addu $t1, $t1, $t9 -/* 14DD4 80846FE4 952981C2 */ lhu $t1, %lo(gEntranceTable+2)($t1) -/* 14DD8 80846FE8 312A4000 */ andi $t2, $t1, 0x4000 ## $t2 = 00000000 -/* 14DDC 80846FEC 5140001E */ beql $t2, $zero, .L80847068 -/* 14DE0 80846FF0 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -/* 14DE4 80846FF4 862200A4 */ lh $v0, 0x00A4($s1) ## 000000A4 -/* 14DE8 80846FF8 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 14DEC 80846FFC 54410005 */ bnel $v0, $at, .L80847014 -/* 14DF0 80847000 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -/* 14DF4 80847004 964B0EEA */ lhu $t3, 0x0EEA($s2) ## 8015F54A -/* 14DF8 80847008 316C0001 */ andi $t4, $t3, 0x0001 ## $t4 = 00000000 -/* 14DFC 8084700C 11800015 */ beq $t4, $zero, .L80847064 -/* 14E00 80847010 24010032 */ addiu $at, $zero, 0x0032 ## $at = 00000032 -.L80847014: -/* 14E04 80847014 14410005 */ bne $v0, $at, .L8084702C -/* 14E08 80847018 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14E0C 8084701C 964D0ED8 */ lhu $t5, 0x0ED8($s2) ## 8015F538 -/* 14E10 80847020 31AE0020 */ andi $t6, $t5, 0x0020 ## $t6 = 00000000 -/* 14E14 80847024 51C00010 */ beql $t6, $zero, .L80847068 -/* 14E18 80847028 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -.L8084702C: -/* 14E1C 8084702C 8E0601B0 */ lw $a2, 0x01B0($s0) ## 000001B0 -/* 14E20 80847030 240F0078 */ addiu $t7, $zero, 0x0078 ## $t7 = 00000078 -/* 14E24 80847034 24180090 */ addiu $t8, $zero, 0x0090 ## $t8 = 00000090 -/* 14E28 80847038 24190018 */ addiu $t9, $zero, 0x0018 ## $t9 = 00000018 -/* 14E2C 8084703C 24090014 */ addiu $t1, $zero, 0x0014 ## $t1 = 00000014 -/* 14E30 80847040 AFA9001C */ sw $t1, 0x001C($sp) -/* 14E34 80847044 AFB90018 */ sw $t9, 0x0018($sp) -/* 14E38 80847048 AFB80014 */ sw $t8, 0x0014($sp) -/* 14E3C 8084704C AFAF0010 */ sw $t7, 0x0010($sp) -/* 14E40 80847050 AFA80050 */ sw $t0, 0x0050($sp) -/* 14E44 80847054 26251D4C */ addiu $a1, $s1, 0x1D4C ## $a1 = 00001D4C -/* 14E48 80847058 0C00B390 */ jal TitleCard_InitPlaceName - -/* 14E4C 8084705C 240700A0 */ addiu $a3, $zero, 0x00A0 ## $a3 = 000000A0 -/* 14E50 80847060 8FA80050 */ lw $t0, 0x0050($sp) -.L80847064: -/* 14E54 80847064 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 -.L80847068: -/* 14E58 80847068 A24A13C7 */ sb $t2, 0x13C7($s2) ## 8015FA27 -/* 14E5C 8084706C 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 -.L80847070: -/* 14E60 80847070 15010003 */ bne $t0, $at, .L80847080 -/* 14E64 80847074 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14E68 80847078 10000002 */ beq $zero, $zero, .L80847084 -/* 14E6C 8084707C 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 -.L80847080: -/* 14E70 80847080 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -.L80847084: -/* 14E74 80847084 0C21171A */ jal func_80845C68 -/* 14E78 80847088 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 -/* 14E7C 8084708C 14400005 */ bne $v0, $zero, .L808470A4 -/* 14E80 80847090 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 14E84 80847094 860B001C */ lh $t3, 0x001C($s0) ## 0000001C -/* 14E88 80847098 316C00FF */ andi $t4, $t3, 0x00FF ## $t4 = 00000000 -/* 14E8C 8084709C 358D0D00 */ ori $t5, $t4, 0x0D00 ## $t5 = 00000D00 -/* 14E90 808470A0 A64D1376 */ sh $t5, 0x1376($s2) ## 8015F9D6 -.L808470A4: -/* 14E94 808470A4 A24E137B */ sb $t6, 0x137B($s2) ## 8015F9DB -/* 14E98 808470A8 862200A4 */ lh $v0, 0x00A4($s1) ## 000000A4 -/* 14E9C 808470AC 3C0C8085 */ lui $t4, %hi(D_80854738) ## $t4 = 80850000 -/* 14EA0 808470B0 258C4738 */ addiu $t4, $t4, %lo(D_80854738) ## $t4 = 80854738 -/* 14EA4 808470B4 28410010 */ slti $at, $v0, 0x0010 -/* 14EA8 808470B8 10200008 */ beq $at, $zero, .L808470DC -/* 14EAC 808470BC 0002C080 */ sll $t8, $v0, 2 -/* 14EB0 808470C0 3C198012 */ lui $t9, %hi(gBitFlags) -/* 14EB4 808470C4 0338C821 */ addu $t9, $t9, $t8 -/* 14EB8 808470C8 8F397120 */ lw $t9, %lo(gBitFlags)($t9) -/* 14EBC 808470CC 964F0F2C */ lhu $t7, 0x0F2C($s2) ## 8015F58C -/* 14EC0 808470D0 3C018016 */ lui $at, %hi(gSaveContext+0xf2c) -/* 14EC4 808470D4 01F94825 */ or $t1, $t7, $t9 ## $t1 = 80120000 -/* 14EC8 808470D8 A429F58C */ sh $t1, %lo(gSaveContext+0xf2c)($at) -.L808470DC: -/* 14ECC 808470DC 8602001C */ lh $v0, 0x001C($s0) ## 0000001C -/* 14ED0 808470E0 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 14ED4 808470E4 30420F00 */ andi $v0, $v0, 0x0F00 ## $v0 = 00000000 -/* 14ED8 808470E8 00021203 */ sra $v0, $v0, 8 -/* 14EDC 808470EC 10410003 */ beq $v0, $at, .L808470FC -/* 14EE0 808470F0 24010006 */ addiu $at, $zero, 0x0006 ## $at = 00000006 -/* 14EE4 808470F4 54410008 */ bnel $v0, $at, .L80847118 -/* 14EE8 808470F8 00025880 */ sll $t3, $v0, 2 -.L808470FC: -/* 14EEC 808470FC 8E4A0008 */ lw $t2, 0x0008($s2) ## 8015E668 -/* 14EF0 80847100 3401FFF0 */ ori $at, $zero, 0xFFF0 ## $at = 0000FFF0 -/* 14EF4 80847104 0141082A */ slt $at, $t2, $at -/* 14EF8 80847108 54200003 */ bnel $at, $zero, .L80847118 -/* 14EFC 8084710C 00025880 */ sll $t3, $v0, 2 -/* 14F00 80847110 2402000D */ addiu $v0, $zero, 0x000D ## $v0 = 0000000D -/* 14F04 80847114 00025880 */ sll $t3, $v0, 2 -.L80847118: -/* 14F08 80847118 016C1821 */ addu $v1, $t3, $t4 -/* 14F0C 8084711C 8C790000 */ lw $t9, 0x0000($v1) ## 00000000 -/* 14F10 80847120 AFA3003C */ sw $v1, 0x003C($sp) -/* 14F14 80847124 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14F18 80847128 0320F809 */ jalr $ra, $t9 -/* 14F1C 8084712C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 14F20 80847130 8FA3003C */ lw $v1, 0x003C($sp) -/* 14F24 80847134 3C0D8085 */ lui $t5, %hi(D_80854738) ## $t5 = 80850000 -/* 14F28 80847138 25AD4738 */ addiu $t5, $t5, %lo(D_80854738) ## $t5 = 80854738 -/* 14F2C 8084713C 506D0012 */ beql $v1, $t5, .L80847188 -/* 14F30 80847140 865813C8 */ lh $t8, 0x13C8($s2) ## 8015FA28 -/* 14F34 80847144 8E42135C */ lw $v0, 0x135C($s2) ## 8015F9BC -/* 14F38 80847148 24010003 */ addiu $at, $zero, 0x0003 ## $at = 00000003 -/* 14F3C 8084714C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14F40 80847150 10400002 */ beq $v0, $zero, .L8084715C -/* 14F44 80847154 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 14F48 80847158 1441000A */ bne $v0, $at, .L80847184 -.L8084715C: -/* 14F4C 8084715C 3C078085 */ lui $a3, %hi(D_80854778) ## $a3 = 80850000 -/* 14F50 80847160 24E74778 */ addiu $a3, $a3, %lo(D_80854778) ## $a3 = 80854778 -/* 14F54 80847164 26060024 */ addiu $a2, $s0, 0x0024 ## $a2 = 00000024 -/* 14F58 80847168 0C20E5A0 */ jal Player_SpawnFairy -/* 14F5C 8084716C AFA00010 */ sw $zero, 0x0010($sp) -/* 14F60 80847170 AE02068C */ sw $v0, 0x068C($s0) ## 0000068C -/* 14F64 80847174 864313C4 */ lh $v1, 0x13C4($s2) ## 8015FA24 -/* 14F68 80847178 10600002 */ beq $v1, $zero, .L80847184 -/* 14F6C 8084717C 346E8000 */ ori $t6, $v1, 0x8000 ## $t6 = 00008000 -/* 14F70 80847180 A64E13C4 */ sh $t6, 0x13C4($s2) ## 8015FA24 -.L80847184: -/* 14F74 80847184 865813C8 */ lh $t8, 0x13C8($s2) ## 8015FA28 -.L80847188: -/* 14F78 80847188 240F0003 */ addiu $t7, $zero, 0x0003 ## $t7 = 00000003 -/* 14F7C 8084718C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14F80 80847190 13000007 */ beq $t8, $zero, .L808471B0 -/* 14F84 80847194 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 14F88 80847198 A64F13F0 */ sh $t7, 0x13F0($s2) ## 8015FA50 -/* 14F8C 8084719C 0C211A80 */ jal func_80846A00 -/* 14F90 808471A0 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 -/* 14F94 808471A4 92090692 */ lbu $t1, 0x0692($s0) ## 00000692 -/* 14F98 808471A8 312AFFBF */ andi $t2, $t1, 0xFFBF ## $t2 = 00000000 -/* 14F9C 808471AC A20A0692 */ sb $t2, 0x0692($s0) ## 00000692 -.L808471B0: -/* 14FA0 808471B0 964213C0 */ lhu $v0, 0x13C0($s2) ## 8015FA20 -/* 14FA4 808471B4 10400004 */ beq $v0, $zero, .L808471C8 -/* 14FA8 808471B8 3045FFFF */ andi $a1, $v0, 0xFFFF ## $a1 = 00000000 -/* 14FAC 808471BC 0C00BE0A */ jal Audio_PlayActorSound2 - -/* 14FB0 808471C0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 14FB4 808471C4 A64013C0 */ sh $zero, 0x13C0($s2) ## 8015FA20 -.L808471C8: -/* 14FB8 808471C8 0C0201E8 */ jal Map_SavePlayerInitialInfo -/* 14FBC 808471CC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 14FC0 808471D0 3C0B8016 */ lui $t3, %hi(gGameInfo) -/* 14FC4 808471D4 8D6BFA90 */ lw $t3, %lo(gGameInfo)($t3) -/* 14FC8 808471D8 A5600454 */ sh $zero, 0x0454($t3) ## 80160454 -/* 14FCC 808471DC 8FBF0034 */ lw $ra, 0x0034($sp) -/* 14FD0 808471E0 8FB20030 */ lw $s2, 0x0030($sp) -/* 14FD4 808471E4 8FB1002C */ lw $s1, 0x002C($sp) -/* 14FD8 808471E8 8FB00028 */ lw $s0, 0x0028($sp) -/* 14FDC 808471EC 03E00008 */ jr $ra -/* 14FE0 808471F0 27BD0068 */ addiu $sp, $sp, 0x0068 ## $sp = 00000000 diff --git a/assets/objects/object_vase/.gitkeep b/assets/overlays/.gitkeep similarity index 100% rename from assets/objects/object_vase/.gitkeep rename to assets/overlays/.gitkeep diff --git a/data/overlays/actors/z_bg_haka_zou.data.s b/data/overlays/actors/z_bg_haka_zou.data.s deleted file mode 100644 index 67e92d53ed..0000000000 --- a/data/overlays/actors/z_bg_haka_zou.data.s +++ /dev/null @@ -1,26 +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 purpose registers - -.section .data - -.balign 16 - -glabel D_808835F0 - .word 0x0A000900, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x00000000, 0x00010000, 0x0005003C, 0x00000000, 0x00000000 -glabel D_8088361C - .word 0x00000000, 0x00000000, 0x00000000 -glabel Bg_Haka_Zou_InitVars - .word 0x00BE0600, 0x00000010, 0x00010000, 0x000001B8 -.word BgHakaZou_Init -.word BgHakaZou_Destroy -.word BgHakaZou_Update -.word 0x00000000 -glabel D_80883648 - .word 0xB86CFC18, 0x48500064 -glabel D_80883650 - .word 0x060064E0, 0x06005CE0, 0x06000A10, 0x06005CE0 - diff --git a/data/overlays/actors/z_bg_haka_zou.reloc.s b/data/overlays/actors/z_bg_haka_zou.reloc.s deleted file mode 100644 index 9d2a97cc0a..0000000000 --- a/data/overlays/actors/z_bg_haka_zou.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_80883680 - .incbin "baserom/ovl_Bg_Haka_Zou", 0x10C0, 0x00000110 diff --git a/data/overlays/actors/z_bg_jya_cobra.data.s b/data/overlays/actors/z_bg_jya_cobra.data.s deleted file mode 100644 index 33b05c9865..0000000000 --- a/data/overlays/actors/z_bg_jya_cobra.data.s +++ /dev/null @@ -1,52 +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 purpose registers - -.section .data - -.balign 16 - -glabel D_80897270 - .word 0xFCE00000, 0xFCE00000, 0x00000800, 0xFFFFFFFF, 0x03200000, 0xFCE00000, 0x08000800, 0xFFFFFFFF, 0x03200000, 0x03200000, 0x08000000, 0xFFFFFFFF, 0xFCE00000, 0x03200000, 0x00000000, 0xFFFFFFFF -glabel D_808972B0 - .word 0xE7000000, 0x00000000, 0xFC3097FF, 0xFFFFFE38, 0xE200001C, 0x0C184DD8, 0xD9F0FBFF, 0x00000000, 0x01004008 -.word D_80897270 -.word 0x06000204, 0x00000406, 0xDF000000, 0x00000000 -glabel Bg_Jya_Cobra_InitVars - .word 0x00FC0600, 0x00000010, 0x00F10000, 0x000011A4 -.word BgJyaCobra_Init -.word BgJyaCobra_Destroy -.word BgJyaCobra_Update -.word BgJyaCobra_Draw -glabel D_80897308 - .word 0x00000000, 0x00000000 -glabel D_80897310 - .word 0x01000100 -glabel D_80897314 - .word 0xC0000000, 0x40000000 -glabel D_8089731C - .word 0x00002080, 0x80808080, 0x20000000, 0x2080A0A3, 0xA3A3A080, 0x20002080, 0xA0A5A6A6, 0xA6A5A080, 0x2080A0A5, 0xA6A6A6A6, 0xA6A5A080, 0x80A3A6A6, 0xA6A6A6A6, 0xA6A38080, 0xA3A6A6A6, 0xA6A6A6A6, 0xA38080A3, 0xA6A6A6A6, 0xA6A6A6A3, 0x8080A0A5, 0xA6A6A6A6, 0xA6A5A080, 0x2080A0A5, 0xA6A6A6A5, 0xA0802000, 0x2080A0A3, 0xA3A3A080, 0x20000000, 0x20808080, 0x80802000, 0x00000000 -glabel D_80897398 - .word 0x20802080, 0xA0802080, 0x20000000 -glabel D_808973A4 - .word 0xC0C00000, 0x42C80000, 0x40F33333 -glabel D_808973B0 - .word 0xC149999A, 0x428A6667, 0xC1200000, 0xC1100000, 0x422C0000, 0xBF800000, 0xC0400000, 0x41700000, 0x4109999A, 0xC109999A, 0x41700000, 0x41580000, 0xC0D33333, 0x41D00000, 0x4139999A, 0xC1480000, 0x422C0000, 0x41000000, 0xC189999A, 0x428C0000, 0x3F19999A, 0xC1000000, 0x42C80000, 0x40F33333, 0x40C00000, 0x42C80000, 0x40F33333, 0x4149999A, 0x428A6667, 0xC1200000, 0x41100000, 0x422C0000, 0xBF800000, 0x40400000, 0x41700000, 0x4109999A, 0x4109999A, 0x41700000, 0x41580000, 0x40D33333, 0x41D00000, 0x4139999A, 0x41480000, 0x422C0000, 0x41000000, 0x4189999A, 0x428C0000, 0x3F19999A, 0x41000000, 0x42C80000, 0x40F33333, 0x00000000, 0x428C0000, 0xC134CCCD, 0x00000000, 0x42326667, 0xC0000000, 0x00000000, 0x41700000, 0x4129999A, 0x00000000, 0x41700000, 0x3E99999A, 0x00000000, 0x41D00000, 0x4139999A, 0x00000000, 0x42B0CCCD, 0xBFB33333, 0x00000000, 0x42BF6667, 0x416E6667, 0x00000000, 0x42CACCCD, 0x40A00000 -glabel D_808974DC - .word 0x41400000, 0x41AA6667, 0xC0200000 -glabel D_808974E8 - .word 0x41F00000, 0x41AA6667, 0xC0200000, 0xC1700000, 0x41AA6667, 0xC0200000, 0xC1F00000, 0x41AA6667, 0xC0200000, 0x41400000, 0x41AA6667, 0xC0200000 -glabel D_80897518 - .word 0x00000080, 0x000000A0, 0x000000A0, 0x00000080 -glabel D_80897528 - .word 0xC8500064, 0xB0F403E8, 0xB0F80320, 0x30FC03E8 -glabel D_80897538 - .word 0x0000C000, 0x00000000 -glabel D_80897540 - .word 0x00004000, 0x00000000 -glabel D_80897548 - .word 0x3DCCCCCD, 0x3DCCCCCD, 0x3DCCCCCD, 0x3D9374BC, 0x3D9374BC, 0x3D9374BC, 0x3DCCCCCD, 0x3DCCCCCD, 0x3E072B02, 0x00000000 - diff --git a/data/overlays/actors/z_bg_spot06_objects.data.s b/data/overlays/actors/z_bg_spot06_objects.data.s deleted file mode 100644 index c3e3df8a3e..0000000000 --- a/data/overlays/actors/z_bg_spot06_objects.data.s +++ /dev/null @@ -1,27 +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 purpose registers - -.section .data - -.balign 16 - -glabel Bg_Spot06_Objects_InitVars - .word 0x00D50600, 0x00000200, 0x006A0000, 0x000001D0 -.word BgSpot06Objects_Init -.word BgSpot06Objects_Destroy -.word BgSpot06Objects_Update -.word BgSpot06Objects_Draw -glabel D_808AF930 - .word 0x00000000, 0x00000000, 0x00000000, 0x00000080, 0x00000000, 0x00050100, 0x01000000, 0x0000FF60, 0x00120064 -glabel D_808AF954 - .word 0x0A000939, 0x20000000, 0x00000001 -.word D_808AF930 -glabel D_808AF964 - .word 0x48500064 -glabel D_808AF968 - .word 0x485003E8, 0x00000000 - diff --git a/data/overlays/actors/z_bg_spot06_objects.reloc.s b/data/overlays/actors/z_bg_spot06_objects.reloc.s deleted file mode 100644 index 283f5b3315..0000000000 --- a/data/overlays/actors/z_bg_spot06_objects.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_808AFA50 - .incbin "baserom/ovl_Bg_Spot06_Objects", 0x12D0, 0x000001E0 diff --git a/data/overlays/actors/z_en_hy.data.s b/data/overlays/actors/z_en_hy.data.s deleted file mode 100644 index 6a044e2501..0000000000 --- a/data/overlays/actors/z_en_hy.data.s +++ /dev/null @@ -1,73 +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 purpose registers - -.section .data - -.balign 16 - -glabel En_Hy_InitVars - .word 0x016E0400, 0x00000019, 0x00010000, 0x00000334 -.word EnHy_Init -.word EnHy_Destroy -.word EnHy_Update -.word EnHy_Draw -glabel D_80A71EC0 - .word 0x0A000039, 0x20010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x0014002E, 0x00000000, 0x00000000 -glabel D_80A71EEC - .word 0x00000000, 0x00000000, 0xFF000000 -glabel D_80A71EF8 - .word 0x060005C8, 0x06000DC8, 0x060015C8, 0x00000000 -glabel D_80A71F08 - .word 0x0600057C, 0x0600067C, 0x0600077C, 0x00000000 -glabel D_80A71F18 - .word 0x060004C8, 0x00000000 -glabel D_80A71F20 - .word 0x060005FC, 0x060009FC, 0x06000DFC, 0x00000000 -glabel D_80A71F30 - .word 0x060005FC, 0x060006FC, 0x060007FC, 0x00000000 -glabel D_80A71F40 - .word 0x060007C8, 0x06000FC8, 0x060017C8, 0x00000000 -glabel D_80A71F50 - .word 0x01050000, 0x06003C88 -glabel D_80A71F58 - .word D_80A71EF8 -.word 0x01150000, 0x06003B78 -.word D_80A71F40 -.word 0x01110000, 0x060026F0 -.word D_80A71F30 -.word 0x01110000, 0x060052E0, 0x00000000, 0x01110000, 0x06005528, 0x00000000, 0x01110000, 0x06005738, 0x00000000, 0x01110000, 0x060059B0, 0x00000000, 0x01070000, 0x060030F0 -.word D_80A71F08 -.word 0x01070000, 0x06005508, 0x00000000, 0x01070000, 0x06005728, 0x00000000, 0x010D0000, 0x06002948 -.word D_80A71F18 -.word 0x01080000, 0x06001300, 0x00000000, 0x01080000, 0x06002860, 0x00000000, 0x010C0000, 0x06002560 -.word D_80A71F20 -.word 0x010C0000, 0x06003F68, 0x00000000, 0x018C0000, 0x06001300, 0x00000000 -glabel D_80A72010 - .word 0x01050000 -glabel D_80A72014 - .word 0x060000F0, 0x01150000, 0x060000F0, 0x01110000, 0x060000F0, 0x01070000, 0x060000F0, 0x010D0000, 0x060000F0, 0x01080000, 0x060000F0, 0x010C0000, 0x060000F0, 0x018C0000, 0x060021F8 -glabel D_80A72050 - .word 0x0600092C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06000228, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06004CF4, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060016EC, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x0600265C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060042AC, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060028DC, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06002160, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1200000, 0x0600265C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1200000, 0x06004E90, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06001E7C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06000170, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060000B4, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06003D84, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060041F8, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x0600300C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060031B0, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060031B0, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1000000, 0x06002D0C, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06002DC0, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06004408, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06001F18, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x06004F28, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0x00000000, 0x060033B4, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1000000, 0x060012E8, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1000000, 0x06000FE4, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1000000, 0x06000BFC, 0x3F800000, 0x00000000, 0xBF800000, 0x00000000, 0xC1000000 -glabel D_80A722D8 - .byte 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF -glabel D_80A722DE - .byte 0x00, 0xFF, 0xFF, 0xFF, 0xFF -glabel D_80A722E3 - .byte 0x00, 0x0F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x07, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0x02, 0xFF, 0xFF, 0xFF, 0x00, 0x02, 0x37, 0x37, 0xFF, 0x00, 0x0F, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x0B, 0x04, 0x02, 0x32, 0x50, 0x00, 0x00, 0x02, 0x32, 0x50, 0x00, 0x00, 0x10, 0x0A, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0D, 0x06, 0x00, 0x32, 0xA0, 0x00, 0x06, 0xFF, 0xFF, 0xFF, 0x00, 0x04, 0x0B, 0x05, 0xA0, 0xB4, 0xFF, 0x00, 0x05, 0xA0, 0xB4, 0xFF, 0x00, 0x09, 0x02, 0x02, 0xDC, 0x00, 0x50, 0x00, 0x02, 0xFF, 0xFF, 0xFF, 0x00, 0x0D, 0x02, 0x02, 0x00, 0x82, 0xDC, 0x00, 0x02, 0xFF, 0xFF, 0xFF, 0x00, 0x0E, 0x0C, 0x05, 0x46, 0xA0, 0xE6, 0x00, 0x05, 0xFF, 0xFF, 0x64, 0x00, 0x14, 0x05, 0x02, 0x96, 0x3C, 0x5A, 0x00, 0x02, 0xFF, 0xF0, 0x96, 0x00, 0x12, 0x09, 0x03, 0xC8, 0xB4, 0xFF, 0x00, 0x03, 0xC8, 0xB4, 0xFF, 0x00, 0x0C, 0x06, 0x02, 0x8C, 0xFF, 0x6E, 0x00, 0x02, 0xFF, 0xFF, 0xFF, 0x00, 0x13, 0x0E, 0x06, 0x82, 0x46, 0x14, 0x00, 0x06, 0x82, 0xB4, 0xFF, 0x00, 0x15, 0x02, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x08, 0x03, 0x5A, 0x64, 0x14, 0xFF, 0x03, 0x64, 0x8C, 0x32, 0xFF, 0x0B, 0x01, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x0E, 0x06, 0xA0, 0x00, 0x64, 0x00, 0x06, 0x46, 0x82, 0xD2, 0x00, 0x15, 0x09, 0x03, 0xA0, 0xE6, 0x00, 0x00, 0x03, 0x00, 0x96, 0x6E, 0x00, 0x0C -glabel D_80A723D4 - .word 0x00000000, 0x00040018, 0x00460000, 0x00000008, 0x001C003E, 0x00000000, 0x00040014, 0x003C0000, 0x00000002, 0x0014003C, 0x00000000, 0xFFFE0014, 0x003C0000, 0x00000008, 0x00180028, 0x00000000, 0x000A001A, 0x00280000, 0x0000000C, 0x001A003A, 0x00000000, 0x00020012, 0x00440000, 0x00000004, 0x0014003C, 0x00000000, 0x00040014, 0x003C0000, 0x00000006, 0x00140040, 0x00000000, 0x00000012, 0x003C0000, 0x00000000, 0x0010003C, 0x00000000, 0x00000010, 0x00400000, 0x00000008, 0x0014003A, 0x00040000, 0x00000012, 0x003E0004, 0x00000000, 0x0012003E, 0x00000000, 0x0008001C, 0x003E0000, 0x00000000, 0x0010003C, 0x00000000, 0x00080014, 0x003A0000 -glabel D_80A724A8 - .word 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x07000000, 0x42200000, 0x41A00000, 0x06000000, 0x41A00000, 0x41200000, 0x07000000, 0x42200000, 0x41A00000, 0x08000000, 0x00000000, 0xC1A00000, 0x09000000, 0x41A00000, 0x00000000, 0x09000000, 0x41A00000, 0x00000000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x00000000, 0x00000000, 0x00000000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x0A000000, 0x41A00000, 0x00000000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x06000000, 0x41A00000, 0x41200000, 0x0A000000, 0x41A00000, 0x00000000 -glabel D_80A725A4 - .word 0x42100000, 0x00000000, 0x00000000, 0x44160000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x42200000, 0xC2C80000, 0x00000000, 0x43C80000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41B00000, 0x00000000, 0x00000000, 0xC3480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41A00000, 0xC2C80000, 0x00000000, 0x00000000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41B00000, 0x00000000, 0x00000000, 0x00000000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41A80000, 0x00000000, 0x00000000, 0x00000000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41C80000, 0xC2C80000, 0x00000000, 0x44160000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41E00000, 0xC2C80000, 0x00000000, 0x44480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41880000, 0x00000000, 0x00000000, 0x442F0000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41900000, 0x00000000, 0x00000000, 0x42C80000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41900000, 0x00000000, 0x00000000, 0xC3480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41880000, 0x00000000, 0x00000000, 0x442F0000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41A80000, 0x00000000, 0x00000000, 0xC3960000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41A00000, 0x00000000, 0x00000000, 0xC3480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41900000, 0xC3480000, 0x00000000, 0xC3480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41D80000, 0xC2C80000, 0x00000000, 0x44480000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41980000, 0x43C80000, 0x00000000, 0x00000000, 0x3C23D70A, 0x04000000, 0x41F00000, 0x41980000, 0x43C80000, 0x00000000, 0x00000000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x42200000, 0xC2C80000, 0x00000000, 0x43C80000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41880000, 0x00000000, 0x00000000, 0x442F0000, 0x3C23D70A, 0x06000000, 0x41F00000, 0x41A00000, 0x00000000, 0x00000000, 0xC3480000, 0x3C23D70A, 0x06000000, 0x41F00000 -glabel D_80A727F0 - .word 0x001C0019, 0x001D0018 -glabel D_80A727F8 - .word 0x00960064, 0x00320019 -glabel D_80A72800 - .word 0x43C80000, 0x00000000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_en_hy.reloc.s b/data/overlays/actors/z_en_hy.reloc.s deleted file mode 100644 index 819fca69b9..0000000000 --- a/data/overlays/actors/z_en_hy.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_80A72AF0 - .incbin "baserom/ovl_En_Hy", 0x3540, 0x00000500 diff --git a/data/overlays/actors/z_en_m_thunder.data.s b/data/overlays/actors/z_en_m_thunder.data.s deleted file mode 100644 index 4f2aab6404..0000000000 --- a/data/overlays/actors/z_en_m_thunder.data.s +++ /dev/null @@ -1,28 +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 purpose registers - -.section .data - -.balign 16 - -glabel En_M_Thunder_InitVars - .word 0x00570700, 0x00000000, 0x00010000, 0x000001CC -.word EnMThunder_Init -.word EnMThunder_Destroy -.word EnMThunder_Update -.word EnMThunder_Draw -glabel D_80AA0420 - .word 0x0A090000, 0x10010000, 0x02000000, 0x00000001, 0x00000000, 0xFFCFFFFF, 0x00000000, 0x19010100, 0x00C800C8, 0x00000000, 0x00000000 -glabel D_80AA044C - .word 0x01000000, 0x00400000, 0x00800000 -glabel D_80AA0458 - .word 0x08000000, 0x02000000, 0x04000000 -glabel D_80AA0464 - .word 0x182F182E, 0x182F182E -glabel D_80AA046C - .word 0x3DCCCCCD, 0x3E19999A, 0x3E4CCCCD, 0x3E800000, 0x3E99999A, 0x3E800000, 0x3E4CCCCD, 0x3E19999A, 0x00000000 - diff --git a/data/overlays/actors/z_en_owl.reloc.s b/data/overlays/actors/z_en_owl.reloc.s deleted file mode 100644 index 6590b3ca3c..0000000000 --- a/data/overlays/actors/z_en_owl.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_80ACD870 - .incbin "baserom/ovl_En_Owl", 0x3950, 0x00000560 diff --git a/data/overlays/actors/z_en_viewer.reloc.s b/data/overlays/actors/z_en_viewer.reloc.s deleted file mode 100644 index 5933845977..0000000000 --- a/data/overlays/actors/z_en_viewer.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_80B2D1D0 - .incbin "baserom/ovl_En_Viewer", 0x2FD0, 0x00000270 diff --git a/data/overlays/actors/z_player.reloc.s b/data/overlays/actors/z_player.reloc.s deleted file mode 100644 index 0059d9ad15..0000000000 --- a/data/overlays/actors/z_player.reloc.s +++ /dev/null @@ -1,13 +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 purpose registers - -.section .rodata - -.balign 16 - -glabel D_80855550 - .incbin "baserom/ovl_player_actor", 0x23340, 0x00003550 diff --git a/docs/BUILDING_BINUTILS_CYGWIN.md b/docs/BUILDING_BINUTILS_CYGWIN.md new file mode 100644 index 0000000000..31fbdfe6c5 --- /dev/null +++ b/docs/BUILDING_BINUTILS_CYGWIN.md @@ -0,0 +1,42 @@ +# Building mips-linux-binutils on Windows using Cygwin + +First, you will need to install the following packages using the Cygwin installer: +- make +- gcc-g++ +- bison +- flex +- texinfo +- binutils (Make sure to check the "Src?" checkbox since we're interested in the source code. Once the download is finished, you will find it in `/usr/src/`) + +Create destination dir for binutils +```bash +sudo mkdir -p /opt/cross +``` +Extract binutils source +```bash +cd /usr/src/binutils-[...].src/ +tar xjf binutils-[...].tar.bz2 +``` + +Create and enter build dir +```bash +mkdir build-binutils +cd build-binutils +``` + +Configure the build +```bash +../binutils-gdb/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-gprof --disable-nls --disable-werror --disable-gdb --disable-libdecnumber --disable-readline --disable-sim +``` + +Make and install binutils +```bash +make -j +sudo make install -j +``` + +Add the new binutils binaries to your system PATH: + +You can do that by adding `PATH=$PATH:/opt/cross/bin` to `~/.bashrc` and then reloading `~/.bashrc`. + +Alternatively you can edit the `Path` variable in `Edit the system environment variables`>`Environment Variables` (in which case you will need to relaunch your terminal). diff --git a/include/functions.h b/include/functions.h index f8c3ead76c..06294f143c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -347,12 +347,13 @@ void EffectSsIceSmoke_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocit void FlagSet_Update(GlobalContext* globalCtx); void Overlay_LoadGameState(GameStateOverlay* overlayEntry); void Overlay_FreeGameState(GameStateOverlay* overlayEntry); -void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3); -void ActorShadow_DrawFunc_Circle(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_Squiggly(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, Vec3f* arg3, s32 arg4, Vec3f* arg5); +void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale); +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawFeet(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos); void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx); s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag); void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag); @@ -376,7 +377,7 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt s32 arg5, s32 arg6, s32 arg7); s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx); void Actor_Kill(Actor* actor); -void Actor_SetHeight(Actor* actor, f32 offset); +void Actor_SetFocus(Actor* actor, f32 offset); void Actor_SetScale(Actor* actor, f32 scale); void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor); void func_8002D7EC(Actor* actor); @@ -385,14 +386,14 @@ void Actor_MoveForward(Actor* actor); void func_8002D908(Actor* actor); void func_8002D97C(Actor* actor); void func_8002D9A4(Actor* actor, f32 arg1); -s16 func_8002DA78(Actor* actorA, Actor* actorB); -s16 func_8002DAC0(Actor* actor, Vec3f* arg1); -f32 func_8002DB48(Actor* actorA, Actor* actorB); -f32 func_8002DB6C(Actor* actor, Vec3f* arg1); -s16 func_8002DAE0(Actor* actorA, Actor* actorB); -s16 func_8002DB28(Actor* actor, Vec3f* arg1); -f32 func_8002DB8C(Actor* actorA, Actor* actorB); -f32 func_8002DBB0(Actor* actor, Vec3f* arg1); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2); f32 Actor_HeightDiff(Actor* actorA, Actor* actorB); f32 Player_GetHeight(Player* player); @@ -414,14 +415,14 @@ s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx); s32 func_8002E084(Actor* actor, s16 arg1); s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2); s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3); -void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5); +void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5); Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag); void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag); -PosRot* func_8002EEE4(PosRot* arg0, Actor* actor); -PosRot* func_8002EF14(PosRot* arg0, Actor* actor); -PosRot* func_8002EF44(PosRot* arg0, Actor* actor); +PosRot* Actor_GetFocus(PosRot* arg0, Actor* actor); +PosRot* Actor_GetWorld(PosRot* arg0, Actor* actor); +PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor); s32 func_8002F0C8(Actor* actor, Player* player, s32 arg2); u32 func_8002F194(Actor* actor, GlobalContext* globalCtx); s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4); @@ -469,7 +470,7 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx); Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx); Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player); -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType); +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory); void func_80032C7C(GlobalContext* globalCtx, Actor* actor); void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx); void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, Gfx** dList, s16 arg6); @@ -480,7 +481,7 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider); Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor); Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2); -void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType); +void Actor_ChangeCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory); void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 textIdLower); s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3); s32 func_80033A84(GlobalContext* globalCtx, Actor* actor); @@ -511,13 +512,13 @@ void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist); void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist); -Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range); +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorCategory, f32 range); s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1); u8 func_800355E4(GlobalContext* globalCtx, Collider* collider); u8 Actor_ApplyDamage(Actor* actor); -void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag); +void func_80035650(Actor* actor, ColliderInfo* colBody, s32 freezeFlag); void func_8003573C(Actor* actor, ColliderJntSph* colBody, s32 freezeFlag); void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3); void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); @@ -560,8 +561,10 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon // ? func_8003992C(?); // ? BgCheck_ComputeWallDisplacement(?); // ? BgCheck_SphVsStaticWall(?); -s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly); -s32 func_8003A5B8(SSList* headNodeId, CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, Vec3f* outPos, CollisionPoly** outPoly, f32* outDistSq, f32 chkDist, s32 bccFlags); +s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, f32* outY, Vec3f* pos, + f32 checkHeight, CollisionPoly** outPoly); +s32 func_8003A5B8(SSList* headNodeId, CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, + Vec3f* outPos, CollisionPoly** outPoly, f32* outDistSq, f32 chkDist, s32 bccFlags); // ? func_8003A7D8(?); // ? BgCheck_SphVsFirstStaticPolyList(?); // ? BgCheck_SphVsFirstStaticPoly(?); @@ -580,37 +583,60 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis // ? BgCheck_GetCollisionHeader(?); s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos); f32 BgCheck_EntityRaycastFloor1(CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor2(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor2(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, + Vec3f* pos); f32 BgCheck_EntityRaycastFloor3(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor4(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* arg4); -f32 BgCheck_EntityRaycastFloor5(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos, f32 chkDist); +f32 BgCheck_EntityRaycastFloor4(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, + Vec3f* arg4); +f32 BgCheck_EntityRaycastFloor5(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, + Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos, + f32 chkDist); f32 BgCheck_EntityRaycastFloor7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); f32 BgCheck_AnyRaycastFloor1(CollisionContext* colCtx, CollisionPoly* outPoly, Vec3f* pos); f32 BgCheck_AnyRaycastFloor2(CollisionContext* colCtx, CollisionPoly* outPoly, s32* bgId, Vec3f* pos); f32 BgCheck_CameraRaycastFloor2(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); f32 BgCheck_EntityRaycastFloor8(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); f32 BgCheck_EntityRaycastFloor9(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -s32 BgCheck_SphVsWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight, u8 argA); -s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, f32 checkHeight); -s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); -s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); +s32 BgCheck_SphVsWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, + f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight, u8 argA); +s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, f32 checkHeight); +s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); +s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); +s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); // ? BgCheck_CheckCeilingImpl(?); s32 BgCheck_AnyCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight); -s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* arg1, Vec3f* arg2, f32 arg3, CollisionPoly** outPoly, s32* outBgId, Actor* actor); -s32 BgCheck_LineTestImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32* bgId, Actor* actor, f32 chkDist, u32 bccFlags); -s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, Actor* actor); -s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, Actor* actor, f32 chkDist); -s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkOneFace); -s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); -s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* arg1, Vec3f* arg2, f32 arg3, CollisionPoly** outPoly, + s32* outBgId, Actor* actor); +s32 BgCheck_LineTestImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, + Vec3f* posResult, CollisionPoly** outPoly, s32* bgId, Actor* actor, f32 chkDist, u32 bccFlags); +s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + Actor* actor); +s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + Actor* actor, f32 chkDist); +s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, + s32* bgId); +s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkOneFace); +s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); +s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); // ? BgCheck_SphVsFirstPolyImpl(?); -s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); +s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); void SSNodeList_Initialize(SSNodeList*); void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s32 numPolys); u16 SSNodeList_GetNextNodeIdx(SSNodeList* this); @@ -644,15 +670,19 @@ void DynaPoly_UpdateBgActorTransforms(GlobalContext* globalCtx, DynaCollisionCon // ? BgCheck_RaycastFloorDynaList(?); f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast); // ? BgCheck_SphVsDynaWallInBgActor(?); -s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor); // ? BgCheck_CheckDynaCeilingList(?); -s32 BgCheck_CheckDynaCeiling(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 chkDist, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_CheckDynaCeiling(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 chkDist, + CollisionPoly** outPoly, s32* outBgId, Actor* actor); // ? func_80040FA4(?); // ? func_80041128(?); -s32 func_80041240(CollisionContext* colCtx, u16 xpFlags, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, f32* distSq, s32* outBgId, Actor* actor, f32 chkDist, s32 bccFlags); +s32 func_80041240(CollisionContext* colCtx, u16 xpFlags, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, f32* distSq, s32* outBgId, Actor* actor, f32 chkDist, s32 bccFlags); // ? BgCheck_SphVsFirstDynaPolyList(?); // ? BgCheck_SphVsFirstDynaPolyInBgActor(?); -s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* center, f32 radius, Actor* actor, u16 bciFlags); +s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, + Vec3f* center, f32 radius, Actor* actor, u16 bciFlags); // ? CollisionHeader_SegmentedToVirtual(?); void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest); void BgCheck_ResetPolyCheckTbl(SSNodeList* nodeList, s32 numPolys); @@ -687,9 +717,12 @@ s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bg u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_IsWallDamage(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox); -s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, WaterBox** outWaterBox); -s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox); +s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); +s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, + WaterBox** outWaterBox); +s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); u32 WaterBox_GetCamDataIndex(CollisionContext* colCtx, WaterBox* waterBox); u16 WaterBox_GetCameraSType(CollisionContext* colCtx, WaterBox* waterBox); u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox); @@ -708,8 +741,8 @@ s32 func_800433A4(CollisionContext* colCtx, s32 bgId, Actor* actor); void DynaPolyActor_Init(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags); void func_800434A0(DynaPolyActor* dynaActor); void func_800434A8(DynaPolyActor* dynaActor); -void func_800434C8(CollisionContext* colCtx, s32 floorPolySource); -void func_80043508(CollisionContext* colCtx, s32 floorPolySource); +void func_800434C8(CollisionContext* colCtx, s32 floorBgId); +void func_80043508(CollisionContext* colCtx, s32 floorBgId); void func_80043538(DynaPolyActor* dynaActor); s32 func_80043548(DynaPolyActor* dynaActor); s32 func_8004356C(DynaPolyActor* dynaActor); @@ -742,99 +775,59 @@ void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* d UNK_TYPE arg6); s16 func_8005B1A4(Camera* camera); DamageTable* DamageTable_Get(s32 index); -void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); -void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); -s32 Collider_InitBase(GlobalContext* globalCtx, Collider* collider); -s32 Collider_DestroyBase(GlobalContext* globalCtx, Collider* collider); -s32 Collider_SetBase_Actor(GlobalContext* globalCtx, Collider* collider, ColliderInit_Actor* src); -s32 Collider_SetBase_Set3(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit_Set3* src); -s32 Collider_SetBase(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit* src); -void Collider_BaseSetAT(GlobalContext* globalCtx, Collider* collider); -void Collider_BaseSetAC(GlobalContext* globalCtx, Collider* collider); -void Collider_BaseSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitTouch(GlobalContext* globalCtx, ColliderTouch* touch); -s32 Collider_DestroyTouch(GlobalContext* globalCtx, ColliderTouch* touch); -s32 Collider_SetTouch(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src); -void Collider_BodySetAT_Unk(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_InitBump(GlobalContext* globalCtx, ColliderBump* bump); -s32 Collider_DestroyBump(GlobalContext* globalCtx, ColliderBump* bump); -s32 Collider_SetBump(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit* init); -s32 Collider_InitBody(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_DestroyBody(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_SetBody(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit* bodyInit); -void Collider_BodySetAT(GlobalContext* globalCtx, ColliderBody* body); -void Collider_BodySetAC(GlobalContext* globalCtx, ColliderBody* body); -void Collider_BodySetOC(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_InitJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dim); -s32 Collider_DestroyJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* item); -s32 Collider_SetJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dest, ColliderJntSphItemDimInit* src); -s32 Collider_InitJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item); -s32 Collider_DestroyJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item); -s32 Collider_SetJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* dest, ColliderJntSphItemInit* src); -s32 Collider_JntSphItemSetAT(GlobalContext* globalCtx, ColliderJntSphItem* collider); -s32 Collider_JntSphItemSetAC(GlobalContext* globalCtx, ColliderJntSphItem* collider); -s32 Collider_JntSphItemSetOC(GlobalContext* globalCtx, ColliderJntSphItem* collider); +void DamageTable_Clear(DamageTable* table); +void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); +void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); s32 Collider_InitJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); s32 Collider_DestroyJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); -s32 Collider_SetJntSph_Set(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInit_Actor* src); -s32 Collider_SetJntSph_Set3(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit_Set3* src); -s32 Collider_SetJntSph_Set5(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); +s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInitToActor* src); +s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, + ColliderJntSphInitType1* src); +s32 Collider_SetJntSphAlloc(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphItem* list); -s32 Collider_InitCylinderDim(GlobalContext* globalCtx, Cylinder16* dim); -s32 Collider_DestroyCylinderDim(GlobalContext* globalCtx, Cylinder16* dim); -s32 Collider_SetCylinderDim(GlobalContext* globalCtx, Cylinder16* dest, Cylinder16* src); + ColliderJntSphElement* elements); +s32 Collider_ResetJntSphAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetJntSphAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetJntSphOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitCylinder(GlobalContext* globalCtx, ColliderCylinder* collider); s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collider); -s32 Collider_SetCylinder_Actor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInit_Actor* arg2); -s32 Collider_SetCylinder_Set3(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, - ColliderCylinderInit_Set3* src); +s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInitToActor* src); +s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, + ColliderCylinderInitType1* src); s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src); -s32 Collider_CylinderSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_CylinderSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_CylinderSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitTrisItemDim(GlobalContext* globalCtx, TriNorm* dim); -s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim); -s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src); -s32 Collider_InitTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider); -s32 Collider_DestroyTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider); -s32 Collider_SetTrisItem(GlobalContext* globalCtx, ColliderTrisItem* dest, ColliderTrisItemInit* src); -s32 Collider_TrisItemSetAT(GlobalContext* globalCtx, ColliderTrisItem* item); -s32 Collider_TrisItemSetAC(GlobalContext* globalCtx, ColliderTrisItem* item); -s32 Collider_TrisItemSetOC(GlobalContext* globalCtx, ColliderTrisItem* item); +s32 Collider_ResetCylinderAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetCylinderAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetCylinderOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitTris(GlobalContext* globalCtx, ColliderTris* tris); s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris); s32 Collider_DestroyTris(GlobalContext* globalCtx, ColliderTris* tris); -s32 Collider_SetTris_Set3(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit_Set3* src); -s32 Collider_SetTris_Set5(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); +s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src); +s32 Collider_SetTrisAlloc(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, - ColliderTrisItem* list); -s32 Collider_TrisSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_TrisSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_TrisSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim); -s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim); -s32 func_8005CEC4(GlobalContext* globalCtx, ColliderQuadDim* dim); -void func_8005CEDC(ColliderQuadDim* dim); -s32 Collider_SetQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dest, ColliderQuadDimInit* src); + ColliderTrisElement* elements); +s32 Collider_ResetTrisAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetTrisAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetTrisOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitQuad(GlobalContext* globalCtx, ColliderQuad* collider); s32 Collider_DestroyQuad(GlobalContext* globalCtx, ColliderQuad* collider); -s32 Collider_SetQuad_Set3(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit_Set3* src); +s32 Collider_SetQuadType1(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src); s32 Collider_SetQuad(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src); -s32 Collider_QuadSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_QuadSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_QuadSetOC(GlobalContext* globalCtx, Collider* collider); -s32 func_8005D218(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* arg2); -s32 Collider_InitOcLine(GlobalContext* globalCtx, OcLine* line); -s32 Collider_DestroyOcLine(GlobalContext* globalCtx, OcLine* line); -void func_8005D3BC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +s32 Collider_ResetQuadAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetQuadAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_InitLine(GlobalContext* globalCtx, OcLine* line); +s32 Collider_DestroyLine(GlobalContext* globalCtx, OcLine* line); +s32 Collider_SetLinePoints(GlobalContext* globalCtx, OcLine* ocLine, Vec3f* a, Vec3f* b); +s32 Collider_SetLine(GlobalContext* globalCtx, OcLine* dest, OcLine* src); +s32 Collider_ResetLineOC(GlobalContext* globalCtx, OcLine* line); void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void CollisionCheck_ClearContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_EnableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_DisableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -void func_8005D4DC(GlobalContext* globalCtx, Collider* collider); -void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void Collider_Draw(GlobalContext* globalCtx, Collider* collider); +void CollisionCheck_DrawCollision(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); @@ -842,49 +835,35 @@ s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, OcLine* collider); -// ? func_8005DF2C(?); -// ? func_8005DF50(?); -// ? func_8005DF74(?); -void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos); -void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos); -// ? func_8005E2EC(?); -// ? func_8005E4F8(?); -// ? func_8005E604(?); -// ? func_8005E800(?); -// ? func_8005E81C(?); -// ? func_800611A0(?); -// ? func_80061274(?); -void func_8006139C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -// ? func_8006146C(?); -// ? func_800614A4(?); -// ? func_80061BF4(?); -// ? func_80061C18(?); +void CollisionCheck_BlueBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v); +void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_OC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -// ? func_80061E48(?); -void func_80061E8C(CollisionCheckInfo* info); -void func_80061EB0(CollisionCheckInfo* info, CollisionCheckInfoInit* init); -void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); -void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); -// ? func_80061F64(?); -// ? func_800622E4(?); -s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, - Vec3f* arg3, Actor** arg4, s32 arg5); -s32 func_800626B0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, Vec3f* arg3, - Actor** arg4, s32 arg5); -void Collider_CylinderUpdate(Actor* actor, ColliderCylinder* collider); -void func_80062718(ColliderCylinder* collider, Vec3s* pos); -void func_80062734(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); -void func_800627A0(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); -void func_800628A4(s32 arg0, ColliderJntSph* collider); -void func_80062A28(GlobalContext*, Vec3f*); -void func_80062B80(GlobalContext*, Vec3f*); -void func_80062CD4(GlobalContext* globalCtx, Vec3f* v); -void func_80062D60(GlobalContext* globalCtx, Vec3f* v); -void func_80062DAC(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2); -void func_80062DF4(GlobalContext* globalCtx, Vec3f* v); -void func_80062E14(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2); -s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, Vec3f* itemProjPos, Vec3f* out1, - Vec3f* out2); +void CollisionCheck_InitInfo(CollisionCheckInfo* info); +void CollisionCheck_ResetDamage(CollisionCheckInfo* info); +void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); +void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init); +void CollisionCheck_Damage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b); +s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions); +void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider); +void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos); +void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); +void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); +void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* init); +void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider); +void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticles(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetalSound(GlobalContext* globalCtx, Vec3f* v, Vec3f* actorPos); +void CollisionCheck_SpawnShieldParticlesMetal2(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesWood(GlobalContext* globalCtx, Vec3f* b, Vec3f* actorPos); +s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, + Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2); +u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); void SaveContext_Init(void); // ? func_800636C0(?); void func_8006375C(s32 arg0, s32 arg1, const char* text); @@ -934,6 +913,7 @@ void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skel // ? func_8006D0EC(?); // ? func_8006D684(?); void func_8006DC68(GlobalContext* globalCtx, Player* player); +void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2); u32 Jpeg_SendTask(JpegContext* ctx); void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y); u16 Jpeg_GetU16(u8* ptr); @@ -1092,7 +1072,7 @@ s16 func_800800F8(GlobalContext* globalCtx, s16 csID, s16 timer, Actor* actor, s void func_800803F0(GlobalContext* globalCtx, s16 camId); s16 func_80080480(GlobalContext* globalCtx, Actor* actor); void func_800806BC(GlobalContext* globalCtx, Actor* actor, u16 sfxId); -UNK_TYPE func_80080728(GlobalContext* globalCtx, u8 actorType); +UNK_TYPE func_80080728(GlobalContext* globalCtx, u8 actorCategory); void func_80080788(UNK_TYPE, UNK_TYPE); void Map_SavePlayerInitialInfo(GlobalContext* globalCtx); void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor); @@ -2256,6 +2236,7 @@ void func_800F4010(Vec3f*, u16 sfxId, f32); void func_800F41E0(Vec3f*, u16 sfxId, u8); void func_800F4138(Vec3f*, u16 sfxId, f32); void func_800F4190(Vec3f*, u16 sfxId); +void func_800F4254(Vec3f* pos, u8 arg1); void func_800F436C(Vec3f*, s16 arg1, f32 arg2); void func_800F4414(Vec3f*, u16, f32); void func_800F44EC(UNK_TYPE arg0, UNK_TYPE arg1); diff --git a/include/macros.h b/include/macros.h index e972883c1a..3a3b61890e 100644 --- a/include/macros.h +++ b/include/macros.h @@ -12,14 +12,14 @@ #define SQ(x) ((x)*(x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) -#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1)) +#define DECR(x) ((x) == 0 ? 0 : --(x)) #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) #define RGBA8(r, g, b, a) (((r & 0xFF) << 24) | ((g & 0xFF) << 16) | ((b & 0xFF) << 8) | ((a & 0xFF) << 0)) -#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first) +#define PLAYER ((Player*)globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head) #define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera] diff --git a/include/variables.h b/include/variables.h index 4731511e53..a94250a1fe 100644 --- a/include/variables.h +++ b/include/variables.h @@ -173,9 +173,9 @@ extern u8 D_80114930[]; //extern ? D_801159A8; //extern ? D_801159A9; //extern ? D_801159AA; -extern EffectSsOverlay gEffectSsOverlayTable[37]; +extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX]; extern Gfx D_80116280[]; -extern ActorOverlay gActorOverlayTable[471]; // original name: "actor_dlftbls" 801162A0 +extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0 extern s32 gMaxActorId; // original name: "MaxProfile" //extern ? D_80119E2C; //extern ? D_80119E52; @@ -397,9 +397,9 @@ extern u8 gItemSlots[56]; extern void (*gSceneCmdHandlers[26])(GlobalContext*, SceneCmd*); extern s16 gLinkObjectIds[2]; extern u32 gObjectTableSize; -extern RomFile gObjectTable[402]; +extern RomFile gObjectTable[OBJECT_ID_MAX]; extern EntranceInfo gEntranceTable[1556]; -extern Scene gSceneTable[110]; +extern Scene gSceneTable[SCENE_ID_MAX]; //extern ? D_8012A4A0; extern u16 gSramSlotOffsets[2][3]; //extern ? D_8012A690; diff --git a/include/z64.h b/include/z64.h index 86ce28e828..833994027c 100644 --- a/include/z64.h +++ b/include/z64.h @@ -205,7 +205,7 @@ typedef struct { /* 0x40 */ f32 unk_40; /* 0x44 */ f32 unk_44; /* 0x48 */ s16 unk_48; - /* 0x4A */ u8 activeType; + /* 0x4A */ u8 activeCategory; /* 0x4B */ u8 unk_4B; /* 0x4C */ s8 unk_4C; /* 0x4D */ char unk_4D[0x03]; @@ -228,8 +228,8 @@ typedef struct { } TitleCardContext; // size = 0x10 typedef struct { - /* 0x00 */ s32 length; // number of actors loaded of this type - /* 0x04 */ Actor* first; // pointer to first actor of this type + /* 0x00 */ s32 length; // number of actors loaded of this category + /* 0x04 */ Actor* head; // pointer to head of the linked list of this category (most recent actor added) } ActorListEntry; // size = 0x08 typedef struct { @@ -240,7 +240,7 @@ typedef struct { /* 0x0004 */ char unk_04[0x04]; /* 0x0008 */ u8 total; // total number of actors loaded /* 0x0009 */ char unk_09[0x03]; - /* 0x000C */ ActorListEntry actorList[12]; + /* 0x000C */ ActorListEntry actorLists[12]; /* 0x006C */ TargetContext targetCtx; struct { /* 0x0104 */ u32 swch; @@ -667,15 +667,15 @@ typedef struct { } RoomContext; // size = 0x74 typedef struct { - /* 0x000 */ s16 colAtCount; + /* 0x000 */ s16 colATCount; /* 0x002 */ u16 sacFlags; - /* 0x004 */ Collider* colAt[COLLISION_CHECK_AT_MAX]; - /* 0x0CC */ s32 colAcCount; - /* 0x0D0 */ Collider* colAc[COLLISION_CHECK_AC_MAX]; - /* 0x1C0 */ s32 colOcCount; - /* 0x1C4 */ Collider* colOc[COLLISION_CHECK_OC_MAX]; - /* 0x28C */ s32 colOcLineCount; - /* 0x290 */ OcLine* colOcLine[COLLISION_CHECK_OC_LINE_MAX]; + /* 0x004 */ Collider* colAT[COLLISION_CHECK_AT_MAX]; + /* 0x0CC */ s32 colACCount; + /* 0x0D0 */ Collider* colAC[COLLISION_CHECK_AC_MAX]; + /* 0x1C0 */ s32 colOCCount; + /* 0x1C4 */ Collider* colOC[COLLISION_CHECK_OC_MAX]; + /* 0x28C */ s32 colLineCount; + /* 0x290 */ OcLine* colLine[COLLISION_CHECK_OC_LINE_MAX]; } CollisionCheckContext; // size = 0x29C typedef struct ListAlloc { diff --git a/include/z64actor.h b/include/z64actor.h index cf6d20e013..f8670cc274 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -9,52 +9,51 @@ #define ACTOR_NUMBER_MAX 200 #define INVISIBLE_ACTOR_MAX 20 #define AM_FIELD_SIZE 0x27A0 +#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions +#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects. struct Actor; -// From z64.h struct GlobalContext; - -// From z64light.h struct Lights; +typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*); +typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct GlobalContext*); +typedef u16 (*callback1_800343CC)(struct GlobalContext*, struct Actor*); +typedef s16 (*callback2_800343CC)(struct GlobalContext*, struct Actor*); + typedef struct { Vec3f pos; Vec3s rot; } PosRot; // size = 0x14 - -typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*); -typedef u16 (*callback1_800343CC)(struct GlobalContext*, struct Actor*); -typedef s16 (*callback2_800343CC)(struct GlobalContext*, struct Actor*); - typedef struct { /* 0x00 */ s16 id; - /* 0x02 */ u8 type; // Classifies actor and determines when actor will execute + /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw /* 0x04 */ u32 flags; /* 0x08 */ s16 objectId; /* 0x0C */ u32 instanceSize; /* 0x10 */ ActorFunc init; // Constructor /* 0x14 */ ActorFunc destroy; // Destructor - /* 0x18 */ ActorFunc update; // Main Update Function + /* 0x18 */ ActorFunc update; // Update Function /* 0x1C */ ActorFunc draw; // Draw function } ActorInit; // size = 0x20 typedef enum { - ALLOCTYPE_NORMAL, - ALLOCTYPE_ABSOLUTE, - ALLOCTYPE_PERMANENT + /* 0 */ ALLOCTYPE_NORMAL, + /* 1 */ ALLOCTYPE_ABSOLUTE, + /* 2 */ ALLOCTYPE_PERMANENT } AllocType; typedef struct { - /* 0x00 */ u32 vromStart; - /* 0x04 */ u32 vromEnd; + /* 0x00 */ u32 vromStart; + /* 0x04 */ u32 vromEnd; /* 0x08 */ void* vramStart; /* 0x0C */ void* vramEnd; /* 0x10 */ void* loadedRamAddr; // original name: "allocp" /* 0x14 */ ActorInit* initInfo; /* 0x18 */ char* name; - /* 0x1C */ u16 allocType; - /* 0x1E */ s8 nbLoaded; // original name: "clients" + /* 0x1C */ u16 allocType; + /* 0x1E */ s8 nbLoaded; // original name: "clients" } ActorOverlay; // size = 0x20 typedef struct { @@ -63,103 +62,131 @@ typedef struct { typedef struct { /* 0x00 */ u8 health; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; /* 0x06 */ u8 mass; } CollisionCheckInfoInit; typedef struct { /* 0x00 */ u8 health; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; + /* 0x06 */ s16 cylYShift; /* 0x08 */ u8 mass; } CollisionCheckInfoInit2; typedef struct { - /* 0x00 */ DamageTable* damageTable; // For actors which contain one (example: Stalfos)... + /* 0x00 */ DamageTable* damageTable; /* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body - /* 0x10 */ s16 unk_10; - /* 0x12 */ s16 unk_12; - /* 0x14 */ u16 unk_14; - /* 0x16 */ u8 mass; // Used to compute displacement, 50 is common value, 0xFF for infinite mass/unmoveable - /* 0x17 */ u8 health; - /* 0x18 */ u8 damage; // Amount to decrement health by - /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon - /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC - /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT + /* 0x10 */ s16 cylRadius; // Used for various purposes + /* 0x12 */ s16 cylHeight; // Used for various purposes + /* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg + /* 0x16 */ u8 mass; // Used to compute displacement for OC collisions + /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one + /* 0x18 */ u8 damage; // Amount to decrement health by + /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon + /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC + /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT } CollisionCheckInfo; // size = 0x1C typedef struct { - /* 0x00 */ Vec3s rot; // Current actor shape rotation - /* 0x06 */ s16 unk_06; - /* 0x08 */ f32 unk_08; // Model y axis offset. Represents model space units. collision mesh related - /* 0x0C */ void (*shadowDrawFunc)(struct Actor*, struct Lights*, struct GlobalContext*); - /* 0x10 */ f32 unk_10; - /* 0x14 */ u8 unk_14; - /* 0x15 */ u8 unk_15; + /* 0x00 */ Vec3s rot; // Current actor shape rotation + /* 0x06 */ s16 face; // Used to index eyebrow/eye/mouth textures. Only used by player + /* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units + /* 0x0C */ ActorShadowFunc shadowDraw; // Shadow draw function + /* 0x10 */ f32 shadowScale; // Changes the size of the shadow + /* 0x14 */ u8 shadowAlpha; // Default is 255 + /* 0x15 */ u8 feetFloorFlags; // Set if the actor's foot is clipped under the floor. & 1 is right foot, & 2 is left + /* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDraw } ActorShape; // size = 0x18 typedef struct Actor { - /* 0x000 */ s16 id; // Actor Id - /* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values - /* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change - /* 0x004 */ u32 flags; // Flags used for various purposes - /* 0x008 */ PosRot initPosRot; // Initial position/rotation when spawned. Is sometimes used for other purposes - /* 0x01C */ s16 params; // original name: "args_data"; Configurable variable set by an actor's spawn data - /* 0x01E */ s8 objBankIndex; // original name: "bank"; Object bank index of this actor's object dependency - /* 0x01F */ s8 unk_1F; - /* 0x020 */ u16 sfx; // Plays sound effect relative to actor's location (if within range of camera?) - /* 0x024 */ PosRot posRot; // position/rotation in the world - /* 0x038 */ PosRot posRot2; - /* 0x04C */ f32 unk_4C; - /* 0x050 */ Vec3f scale; // Sets x,y,z scaling factor. Typically, a factor of 0.01 is used for each axis - /* 0x05C */ Vec3f velocity; - /* 0x068 */ f32 speedXZ; // Always positive, stores how fast the actor is traveling along the XZ plane - /* 0x06C */ f32 gravity; // Acceleration due to gravity; value is added to Y velocity every frame - /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis - /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon an actor is touching - /* 0x078 */ CollisionPoly* floorPoly; // Floor polygon an actor is over/touching - /* 0x07C */ u8 wallPolySource; // Complex Poly Surface Source. 0x32 = Scene - /* 0x07D */ u8 floorPolySource; // Complex Poly Surface Source. 0x32 = Scene. related to 0x80/88 - /* 0x07E */ s16 wallPolyRot; // Rotation of the wall poly - /* 0x080 */ f32 groundY; // Floor poly height - /* 0x084 */ f32 yDistToWater; // Distance from water surface - /* 0x088 */ u16 bgCheckFlags; - /* 0x08A */ s16 yawTowardsLink; - /* 0x08C */ f32 xyzDistToLinkSq; - /* 0x090 */ f32 xzDistToLink; - /* 0x094 */ f32 yDistToLink; - /* 0x098 */ CollisionCheckInfo colChkInfo; - /* 0x0B4 */ ActorShape shape; - /* 0x0CC */ Vec3f unk_CC[2]; - /* 0x0E4 */ Vec3f projectedPos; // actor position in projected space - /* 0x0F0 */ f32 projectedW; // w component of the projected actor position vector - /* 0x0F4 */ f32 uncullZoneForward; // amount to increase the uncull zone forward by (in projected space) - /* 0x0F8 */ f32 uncullZoneScale; // amount to increase the uncull zone scale by (in projected space) - /* 0x0FC */ f32 uncullZoneDownward; // amount to increase uncull zone downward by (in projected space) - /* 0x100 */ Vec3f pos4; // previous position - /* 0x10C */ u8 unk_10C; // Z-Target related - /* 0x10D */ u8 unk_10D; // Z-Target related - /* 0x10E */ u16 textId; // Text id to pass to link/display when interacting with an actor - /* 0x110 */ u16 freezeTimer; - /* 0x112 */ u16 dmgEffectParams; // Specifies damage effect color (white/red/blue) and if opaque or translucent - /* 0x114 */ u8 dmgEffectTimer; - /* 0x115 */ u8 isDrawn; // Indicates whether the actor is currently being drawn (but not seen through lens) - /* 0x116 */ u8 unk_116; - /* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF - /* 0x118 */ struct Actor* parent; - /* 0x11C */ struct Actor* child; - /* 0x120 */ struct Actor* prev; // Previous Actor of this type - /* 0x124 */ struct Actor* next; // Next Actor of this type - /* 0x128 */ ActorFunc init; // Initialization Routine. Called by Actor_Init or Actor_UpdateAll - /* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by Actor_Destroy - /* 0x130 */ ActorFunc update; // Update Routine. Called by Actor_UpdateAll - /* 0x134 */ ActorFunc draw; // Draw Routine. Called by Actor_Draw + /* 0x000 */ s16 id; // Actor ID + /* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values + /* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change + /* 0x004 */ u32 flags; // Flags used for various purposes + /* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes + /* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data" + /* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank" + /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on + /* 0x020 */ u16 sfx; // SFX ID to play. Sound plays when value is set, then is cleared the following update cycle + /* 0x024 */ PosRot world; // Position/rotation in the world + /* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot + /* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position + /* 0x050 */ Vec3f scale; // Scale of the actor in each axis + /* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis + /* 0x068 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane + /* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame + /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis + /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching + /* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor + /* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching + /* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor + /* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching + /* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor + /* 0x084 */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water + /* 0x088 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags + /* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player + /* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis + /* 0x090 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane + /* 0x094 */ f32 yDistToPlayer; // Dist is negative if the actor is above the player + /* 0x098 */ CollisionCheckInfo colChkInfo; // Variables related to the Collision Check system + /* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor + /* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space + /* 0x0F0 */ f32 projectedW; // w component of the projected actor position + /* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space) + /* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) + /* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) + /* 0x100 */ Vec3f prevPos; // World position from the previous update cycle + /* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player + /* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting + /* 0x10E */ u16 textId; // Text ID to pass to link/display when interacting with the actor + /* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically + /* 0x112 */ u16 colorFilterParams; // Set color filter to red, blue, or white. Toggle opa or xlu + /* 0x114 */ u8 colorFilterTimer; // A non-zero value enables the color filter. Decrements automatically + /* 0x115 */ u8 isDrawn; // Set to true if the actor is currently being drawn. Always stays false for lens actors + /* 0x116 */ u8 dropFlag; // Configures what item is dropped by the actor from `Item_DropCollectibleRandom` + /* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF + /* 0x118 */ struct Actor* parent; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` + /* 0x11C */ struct Actor* child; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` + /* 0x120 */ struct Actor* prev; // Previous actor of this category + /* 0x124 */ struct Actor* next; // Next actor of this category + /* 0x128 */ ActorFunc init; // Initialization Routine. Called by `Actor_Init` or `Actor_UpdateAll` + /* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy` + /* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll` + /* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw` /* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor - /* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom + /* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom } Actor; // size = 0x14C +typedef enum { + /* 0 */ FOOT_LEFT, + /* 1 */ FOOT_RIGHT +} ActorFootIndex; + +/* +BgCheckFlags WIP documentation: +& 0x001 : Standing on the ground +& 0x002 : Has touched the ground (only active for 1 frame) +& 0x004 : Has left the ground (only active for 1 frame) +& 0x008 : Touching a wall +& 0x010 : Touching a ceiling +& 0x020 : On or below water surface +& 0x040 : Has touched water (actor is responsible for unsetting this the frame it touches the water) +& 0x080 : Similar to & 0x1 but with no velocity check and is cleared every frame +& 0x100 : Crushed between a floor and ceiling (triggers a void for player) +& 0x200 : Unknown (only set/used by player so far) +*/ + +/* +colorFilterParams WIP documentation +& 0x8000 : white +& 0x4000 : red +if neither of the above are set : blue + +(& 0x1F00 >> 5) | 7 : color intensity +0x2000 : translucent, else opaque +*/ typedef struct DynaPolyActor { /* 0x000 */ struct Actor actor; @@ -262,19 +289,19 @@ typedef struct EnAObj { } EnAObj; // size = 0x1C8 typedef enum { - /* 0x00 */ ACTORTYPE_SWITCH, - /* 0x01 */ ACTORTYPE_BG, - /* 0x02 */ ACTORTYPE_PLAYER, - /* 0x03 */ ACTORTYPE_EXPLOSIVES, - /* 0x04 */ ACTORTYPE_NPC, - /* 0x05 */ ACTORTYPE_ENEMY, - /* 0x06 */ ACTORTYPE_PROP, - /* 0x07 */ ACTORTYPE_ITEMACTION, - /* 0x08 */ ACTORTYPE_MISC, - /* 0x09 */ ACTORTYPE_BOSS, - /* 0x0A */ ACTORTYPE_DOOR, - /* 0x0B */ ACTORTYPE_CHEST -} ActorType; + /* 0x00 */ ACTORCAT_SWITCH, + /* 0x01 */ ACTORCAT_BG, + /* 0x02 */ ACTORCAT_PLAYER, + /* 0x03 */ ACTORCAT_EXPLOSIVE, + /* 0x04 */ ACTORCAT_NPC, + /* 0x05 */ ACTORCAT_ENEMY, + /* 0x06 */ ACTORCAT_PROP, + /* 0x07 */ ACTORCAT_ITEMACTION, + /* 0x08 */ ACTORCAT_MISC, + /* 0x09 */ ACTORCAT_BOSS, + /* 0x0A */ ACTORCAT_DOOR, + /* 0x0B */ ACTORCAT_CHEST +} ActorCategory; typedef enum { /* 0x0000 */ ACTOR_PLAYER, diff --git a/include/z64camera.h b/include/z64camera.h index 71ff853f57..cca2a8ff69 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -677,9 +677,9 @@ typedef struct { * & 0x00FF = atInitFlags * & 0xFF00 = eyeInitFlags * 0x1: Direct Copy of atTargetInit - * if initFlags & 0x6060: use posRot2 for focus point + * if initFlags & 0x6060: use head for focus point * 0x2: Add atTargetInit to view's lookAt - * if initFlags & 0x6060: use posRot for focus point + * if initFlags & 0x6060: use world for focus point * 0x3: Add atTargetInit to camera's at * 0x4: Don't update targets? * 0x8: flag to use atTagetInit as f32 pitch, yaw, r diff --git a/include/z64collision_check.h b/include/z64collision_check.h index af8178e6c1..6fb7e5c5ca 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -9,245 +9,382 @@ // From z64.h struct Actor; -typedef enum { - COLTYPE_UNK0, - COLTYPE_UNK1, - COLTYPE_UNK2, - COLTYPE_UNK3, - COLTYPE_UNK4, - COLTYPE_UNK5, - COLTYPE_UNK6, - COLTYPE_UNK7, - COLTYPE_UNK8, - COLTYPE_METAL_SHIELD, - COLTYPE_UNK10, - COLTYPE_WOODEN_SHIELD, - COLTYPE_UNK12, - COLTYPE_UNK13 -} ColliderType; - -typedef enum { - COLSHAPE_JNTSPH, - COLSHAPE_CYLINDER, - COLSHAPE_TRIS, - COLSHAPE_QUAD, - COLSHAPE_INVALID -} ColliderShape; - typedef struct { - /* 0x00 */ struct Actor* actor; - /* 0x04 */ struct Actor* at; - /* 0x08 */ struct Actor* ac; - /* 0x0C */ struct Actor* oc; - /* 0x10 */ u8 atFlags; // Compared to acFlags - /* 0x11 */ u8 acFlags; // Compared to atFlags - /* 0x12 */ u8 maskA; // Bitwise-and compared to maskB - /* 0x13 */ u8 maskB; // Bitwise-and compared to maskA - /* 0x14 */ u8 type; - /* 0x15 */ u8 shape; // ColliderShape + /* 0x00 */ struct Actor* actor; // Attached actor + /* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider. + /* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider. + /* 0x0C */ struct Actor* oc; // Actor attached to what it collided with as an OC collider. + /* 0x10 */ u8 atFlags; // Information flags for AT collisions. + /* 0x11 */ u8 acFlags; // Information flags for AC collisions. + /* 0x12 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x13 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with. + /* 0x14 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x15 */ u8 shape; // JntSph, Cylinder, Tris, or Quad } Collider; // size = 0x18 typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 atFlags; - /* 0x02 */ u8 acFlags; - /* 0x03 */ u8 maskA; // Bitwise-And with maskB - /* 0x04 */ u8 maskB; // Bitwise-And with maskA - /* 0x05 */ u8 shape; // ColliderShape + /* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x01 */ u8 atFlags; // Information flags for AT collisions. + /* 0x02 */ u8 acFlags; // Information flags for OC collisions. + /* 0x03 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x04 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with. + /* 0x05 */ u8 shape; // JntSph, Cylinder, Tris, or Quad } ColliderInit; // size = 0x06 typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 atFlags; - /* 0x02 */ u8 acFlags; - /* 0x03 */ u8 maskA; // Bitwise-And with maskB - /* 0x04 */ u8 shape; // Collider Type -} ColliderInit_Set3; // size = 0x05 + /* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x01 */ u8 atFlags; // Information flags for AT collisions. + /* 0x02 */ u8 acFlags; // Information flags for AC collisions. + /* 0x03 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x04 */ u8 shape; // JntSph, Cylinder, Tris, or Quad +} ColliderInitType1; // size = 0x05 typedef struct { /* 0x00 */ struct Actor* actor; - /* 0x04 */ u8 atFlags; // Compared to acFlags - /* 0x05 */ u8 acFlags; // Compared to atFlags - /* 0x06 */ u8 maskA; // Bitwise-and compared to maskB - /* 0x07 */ u8 shape; // ColliderShape -} ColliderInit_Actor; // size = 0x08 + /* 0x04 */ u8 atFlags; // Information flags for AT collisions. + /* 0x05 */ u8 acFlags; // Information flags for AC collisions. + /* 0x06 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x07 */ u8 shape; // JntSph, Cylinder, Tris, or Quad +} ColliderInitToActor; // size = 0x08 typedef struct { - /* 0x00 */ u32 flags; // Toucher Attack ID Flags - /* 0x04 */ u8 effect; + /* 0x00 */ u32 dmgFlags; // Toucher damage type flags. + /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 damage; // Damage or Stun Timer } ColliderTouch; // size = 0x08 typedef struct { - /* 0x00 */ u32 flags; // Collision Exclusion Mask + /* 0x00 */ u32 dmgFlags; // Bumper damage type flags. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 defense; // Damage Resistance - /* 0x06 */ Vec3s unk_06; + /* 0x06 */ Vec3s hitPos; // Point of contact } ColliderBump; // size = 0x0C typedef struct { - /* 0x00 */ u32 flags; // Collision Exclusion Mask + /* 0x00 */ u32 dmgFlags; // Bumper exclusion mask /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) - /* 0x05 */ u8 defense; + /* 0x05 */ u8 defense; // Damage Resistance } ColliderBumpInit; // size = 0x08 -typedef struct ColliderBody { - /* 0x00 */ ColliderTouch toucher; - /* 0x08 */ ColliderBump bumper; - /* 0x14 */ u8 flags; // affects sfx reaction when attacked by Link - /* 0x15 */ u8 toucherFlags; - /* 0x16 */ u8 bumperFlags; - /* 0x17 */ u8 ocFlags; - /* 0x18 */ Collider* atHit; // object touching this object's AT collider - /* 0x1C */ Collider* acHit; // object touching this object's AC collider - /* 0x20 */ struct ColliderBody* atHitItem; // element that hit the AT collider - /* 0x24 */ struct ColliderBody* acHitItem; // element that hit the AC collider -} ColliderBody; // size = 0x28 +typedef struct ColliderInfo { + /* 0x00 */ ColliderTouch toucher; // Damage properties when acting as an AT collider + /* 0x08 */ ColliderBump bumper; // Damage properties when acting as an AC collider + /* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. + /* 0x15 */ u8 toucherFlags; // Information flags for AT collisions + /* 0x16 */ u8 bumperFlags; // Information flags for AC collisions + /* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions + /* 0x18 */ Collider* atHit; // object touching this element's AT collider + /* 0x1C */ Collider* acHit; // object touching this element's AC collider + /* 0x20 */ struct ColliderInfo* atHitInfo; // element that hit the AT collider + /* 0x24 */ struct ColliderInfo* acHitInfo; // element that hit the AC collider +} ColliderInfo; // size = 0x28 typedef struct { - /* 0x00 */ u8 bodyFlags; - /* 0x04 */ ColliderTouch toucher; - /* 0x0C */ ColliderBumpInit bumper; - /* 0x14 */ u8 toucherFlags; // Attack Toucher Flags - /* 0x15 */ u8 bumperFlags; // Bumper Flags - /* 0x16 */ u8 bodyFlags2; -} ColliderBodyInit; // size = 0x18 + /* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. + /* 0x04 */ ColliderTouch toucher; // Damage properties when acting as an AT collider + /* 0x0C */ ColliderBumpInit bumper; // Damage properties when acting as an AC collider + /* 0x14 */ u8 toucherFlags; // Information flags for AT collisions + /* 0x15 */ u8 bumperFlags; // Information flags for AC collisions + /* 0x16 */ u8 ocElemFlags; // Information flags for OC collisions +} ColliderInfoInit; // size = 0x18 typedef struct { /* 0x00 */ Sphere16 modelSphere; // model space sphere /* 0x08 */ Sphere16 worldSphere; // world space sphere /* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01 - /* 0x14 */ u8 joint; -} ColliderJntSphItemDim; // size = 0x18 + /* 0x14 */ u8 limb; // attached limb +} ColliderJntSphElementDim; // size = 0x18 typedef struct { - /* 0x00 */ u8 joint; - /* 0x02 */ Sphere16 modelSphere; - /* 0x0A */ s16 scale; -} ColliderJntSphItemDimInit; // size = 0x0C + /* 0x00 */ u8 limb; // attached limb + /* 0x02 */ Sphere16 modelSphere; // model space sphere + /* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01 +} ColliderJntSphElementDimInit; // size = 0x0C typedef struct { - /* 0x00 */ ColliderBody body; - /* 0x28 */ ColliderJntSphItemDim dim; -} ColliderJntSphItem; // size = 0x40 + /* 0x00 */ ColliderInfo info; + /* 0x28 */ ColliderJntSphElementDim dim; +} ColliderJntSphElement; // size = 0x40 typedef struct { - /* 0x00 */ ColliderBodyInit body; - /* 0x18 */ ColliderJntSphItemDimInit dim; -} ColliderJntSphItemInit; // size = 0x24 + /* 0x00 */ ColliderInfoInit info; + /* 0x18 */ ColliderJntSphElementDimInit dim; +} ColliderJntSphElementInit; // size = 0x24 typedef struct { /* 0x00 */ Collider base; /* 0x18 */ s32 count; - /* 0x1C */ ColliderJntSphItem* list; + /* 0x1C */ ColliderJntSphElement* elements; } ColliderJntSph; // size = 0x20 typedef struct { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; + /* 0x0C */ ColliderJntSphElementInit* elements; } ColliderJntSphInit; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; + /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; -} ColliderJntSphInit_Set3; // size = 0x10 + /* 0x0C */ ColliderJntSphElementInit* elements; +} ColliderJntSphInitType1; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Actor base; + /* 0x00 */ ColliderInitToActor base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; -} ColliderJntSphInit_Actor; // size = 0x10 + /* 0x0C */ ColliderJntSphElementInit* elements; +} ColliderJntSphInitToActor; // size = 0x10 typedef struct { /* 0x00 */ Collider base; - /* 0x18 */ ColliderBody body; + /* 0x18 */ ColliderInfo info; /* 0x40 */ Cylinder16 dim; } ColliderCylinder; // size = 0x4C typedef struct { /* 0x00 */ ColliderInit base; - /* 0x08 */ ColliderBodyInit body; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; } ColliderCylinderInit; // size = 0x2C typedef struct { - /* 0x00 */ ColliderInit_Set3 base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitType1 base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; -} ColliderCylinderInit_Set3; // size = 0x2C +} ColliderCylinderInitType1; // size = 0x2C typedef struct { - /* 0x00 */ ColliderInit_Actor base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitToActor base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; -} ColliderCylinderInit_Actor; // size = 0x2C +} ColliderCylinderInitToActor; // size = 0x2C typedef struct { /* 0x00 */ Vec3f vtx[3]; -} ColliderTrisItemDimInit; // size = 0x24 +} ColliderTrisElementDimInit; // size = 0x24 typedef struct { - /* 0x00 */ ColliderBody body; + /* 0x00 */ ColliderInfo info; /* 0x28 */ TriNorm dim; -} ColliderTrisItem; // size = 0x5C +} ColliderTrisElement; // size = 0x5C typedef struct { - /* 0x00 */ ColliderBodyInit body; - /* 0x18 */ ColliderTrisItemDimInit dim; -} ColliderTrisItemInit; // size 0x3C + /* 0x00 */ ColliderInfoInit info; + /* 0x18 */ ColliderTrisElementDimInit dim; +} ColliderTrisElementInit; // size 0x3C typedef struct { /* 0x00 */ Collider base; /* 0x18 */ s32 count; - /* 0x1C */ ColliderTrisItem* list; + /* 0x1C */ ColliderTrisElement* elements; } ColliderTris; // size = 0x20 typedef struct { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderTrisItemInit* list; + /* 0x0C */ ColliderTrisElementInit* elements; } ColliderTrisInit; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; + /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderTrisItemInit* list; -} ColliderTrisInit_Set3; // size = 0x10 + /* 0x0C */ ColliderTrisElementInit* elements; +} ColliderTrisInitType1; // size = 0x10 typedef struct { /* 0x00 */ Vec3f quad[4]; /* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c /* 0x36 */ Vec3s baMid; // midpoint of vectors b, a - /* 0x3C */ f32 unk_3C; + /* 0x3C */ f32 acDist; // distance to nearest AC collision this frame. } ColliderQuadDim; // size = 0x40 typedef struct { /* 0x00 */ Vec3f quad[4]; } ColliderQuadDimInit; // size = 0x30 +typedef struct { + /* 0x00 */ ColliderInfo info; + /* 0x24 */ ColliderQuadDim dim; +} ColliderQuadElement; // size = 0x68 + typedef struct { /* 0x00 */ Collider base; - /* 0x18 */ ColliderBody body; + /* 0x18 */ ColliderInfo info; /* 0x40 */ ColliderQuadDim dim; } ColliderQuad; // size = 0x80 typedef struct { /* 0x00 */ ColliderInit base; - /* 0x08 */ ColliderBodyInit body; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ ColliderQuadDimInit dim; } ColliderQuadInit; // size = 0x50 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitType1 base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ ColliderQuadDimInit dim; -} ColliderQuadInit_Set3; // size = 0x50 +} ColliderQuadInitType1; // size = 0x50 typedef struct { /* 0x00 */ Linef line; - /* 0x18 */ u16 unk_18; + /* 0x18 */ u16 ocFlags; } OcLine; // size = 0x1C +typedef enum { + /* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark + /* 1 */ COLTYPE_HIT1, // No blood, dust hitmark + /* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark + /* 3 */ COLTYPE_HIT3, // No blood, white hitmark + /* 4 */ COLTYPE_HIT4, // Water burst, no hitmark + /* 5 */ COLTYPE_HIT5, // No blood, red hitmark + /* 6 */ COLTYPE_HIT6, // Green blood, white hitmark + /* 7 */ COLTYPE_HIT7, // Red blood, white hitmark + /* 8 */ COLTYPE_HIT8, // Blue blood, red hitmark + /* 9 */ COLTYPE_METAL, + /* 10 */ COLTYPE_NONE, + /* 11 */ COLTYPE_WOOD, + /* 12 */ COLTYPE_HARD, + /* 13 */ COLTYPE_TREE +} ColliderType; + +typedef enum { + /* 0 */ COLSHAPE_JNTSPH, + /* 1 */ COLSHAPE_CYLINDER, + /* 2 */ COLSHAPE_TRIS, + /* 3 */ COLSHAPE_QUAD, + /* 4 */ COLSHAPE_INVALID +} ColliderShape; + +/** + * Affects the sound Link's sword makes when hitting it, hookability, + * and possibly other things. It's definitely not flags, as all checks + * are == or !=. Will probably need more actors decomped to truly + * understand what this is. + */ +typedef enum { + /* 0 */ ELEMTYPE_UNK0, + /* 1 */ ELEMTYPE_UNK1, + /* 2 */ ELEMTYPE_UNK2, + /* 3 */ ELEMTYPE_UNK3, + /* 4 */ ELEMTYPE_UNK4, + /* 5 */ ELEMTYPE_UNK5, + /* 6 */ ELEMTYPE_UNK6, + /* 7 */ ELEMTYPE_UNK7 +} ElementType; + +#define AT_NONE 0 // No flags set. Cannot have AT collisions when set as AT +#define AT_ON (1 << 0) // Can have AT collisions when set as AT +#define AT_HIT (1 << 1) // Had an AT collision +#define AT_BOUNCED (1 << 2) // Had an AT collision with an AC_HARD collider +#define AT_TYPE_PLAYER (1 << 3) // Has player-aligned damage +#define AT_TYPE_ENEMY (1 << 4) // Has enemy-aligned damage +#define AT_TYPE_OTHER (1 << 5) // Has non-aligned damage +#define AT_SELF (1 << 6) // Can have AT collisions with colliders attached to the same actor +#define AT_TYPE_ALL (AT_TYPE_PLAYER | AT_TYPE_ENEMY | AT_TYPE_OTHER) // Has all three damage alignments + +#define AC_NONE 0 // No flags set. Cannot have AC collisions when set as AC +#define AC_ON (1 << 0) // Can have AC collisions when set as AC +#define AC_HIT (1 << 1) // Had an AC collision +#define AC_HARD (1 << 2) // Causes AT colliders to bounce off it +#define AC_TYPE_PLAYER AT_TYPE_PLAYER // Takes player-aligned damage +#define AC_TYPE_ENEMY AT_TYPE_ENEMY // Takes enemy-aligned damage +#define AC_TYPE_OTHER AT_TYPE_OTHER // Takes non-aligned damage +#define AC_NO_DAMAGE (1 << 6) // Collider does not take damage +#define AC_BOUNCED (1 << 7) // Caused an AT collider to bounce off it +#define AC_TYPE_ALL (AC_TYPE_PLAYER | AC_TYPE_ENEMY | AC_TYPE_OTHER) // Takes damage from all three alignments + +#define OC1_NONE 0 // No flags set. Cannot have OC collisions when set as OC +#define OC1_ON (1 << 0) // Can have OC collisions when set as OC +#define OC1_HIT (1 << 1) // Had an OC collision +#define OC1_NO_PUSH (1 << 2) // Does not push other colliders away during OC collisions +#define OC1_TYPE_PLAYER (1 << 3) // Can have OC collisions with OC type player +#define OC1_TYPE_1 (1 << 4) // Can have OC collisions with OC type 1 +#define OC1_TYPE_2 (1 << 5) // Can have OC collisions with OC type 2 +#define OC1_TYPE_ALL (OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2) // Can have collisions with all three OC types + +#define OC2_NONE 0 // No flags set. Has no OC type +#define OC2_HIT_PLAYER (1 << 0) // Had an OC collision with OC type player +#define OC2_UNK1 (1 << 1) // Prevents OC collisions with OC2_UNK2. Some horses and toki_sword have it. +#define OC2_UNK2 (1 << 2) // Prevents OC collisions with OC2_UNK1. Nothing has it. +#define OC2_TYPE_PLAYER OC1_TYPE_PLAYER // Has OC type player +#define OC2_TYPE_1 OC1_TYPE_1 // Has OC type 1 +#define OC2_TYPE_2 OC1_TYPE_2 // Has OC type 2 +#define OC2_FIRST_ONLY (1 << 6) // Skips AC checks on elements after the first collision. Only used by Ganon + +#define TOUCH_NONE 0 // No flags set. Cannot have AT collisions +#define TOUCH_ON (1 << 0) // Can have AT collisions +#define TOUCH_HIT (1 << 1) // Had an AT collision +#define TOUCH_NEAREST (1 << 2) // If a Quad, only collides with the closest bumper +#define TOUCH_SFX_NORMAL (0 << 3) // Hit sound effect based on AC collider's type +#define TOUCH_SFX_HARD (1 << 3) // Always uses hard deflection sound +#define TOUCH_SFX_WOOD (2 << 3) // Always uses wood deflection sound +#define TOUCH_SFX_NONE (3 << 3) // No hit sound effect +#define TOUCH_AT_HITMARK (1 << 5) // Draw hitmarks for every AT collision +#define TOUCH_DREW_HITMARK (1 << 6) // Already drew hitmark for this frame +#define TOUCH_UNK7 (1 << 7) // Unknown purpose. Used by some enemy quads + +#define BUMP_NONE 0 // No flags set. Cannot have AC collisions +#define BUMP_ON (1 << 0) // Can have AC collisions +#define BUMP_HIT (1 << 1) // Had an AC collision +#define BUMP_HOOKABLE (1 << 2) // Can be hooked if actor has hookability flags set. +#define BUMP_NO_AT_INFO (1 << 3) // Does not give its info to the AT collider that hit it. +#define BUMP_NO_DAMAGE (1 << 4) // Does not take damage. +#define BUMP_NO_SWORD_SFX (1 << 5) // Does not have a sound when hit by player-attached AT colliders. +#define BUMP_NO_HITMARK (1 << 6) // Skips hit effects. +#define BUMP_DRAW_HITMARK (1 << 7) // Draw hitmark for AC collision this frame. + +#define OCELEM_NONE 0 // No flags set. Cannot have OC collisions +#define OCELEM_ON (1 << 0) // Can have OC collisions +#define OCELEM_HIT (1 << 1) // Had an OC collision +#define OCELEM_UNK3 (1 << 3) // Unknown purpose. Used by Dead Hand element 0 and Dodongo element 5 + +#define OCLINE_NONE 0 // Did not have an OcLine collision +#define OCLINE_HIT (1 << 0) // Had an OcLine collision + +#define DMG_ENTRY(damage, effect) ((damage) | ((effect) << 4)) + +// These flags are not to be used in code until we figure out how we want to format them. They are only here for reference +#define DMG_DEKU_NUT (1 << 0x00) +#define DMG_DEKU_STICK (1 << 0x01) +#define DMG_SLINGSHOT (1 << 0x02) +#define DMG_EXPLOSIVE (1 << 0x03) +#define DMG_BOOMERANG (1 << 0x04) +#define DMG_ARROW_NORMAL (1 << 0x05) +#define DMG_HAMMER_SWING (1 << 0x06) +#define DMG_HOOKSHOT (1 << 0x07) +#define DMG_SLASH_KOKIRI (1 << 0x08) +#define DMG_SLASH_MASTER (1 << 0x09) +#define DMG_SLASH_GIANT (1 << 0x0A) +#define DMG_ARROW_FIRE (1 << 0x0B) +#define DMG_ARROW_ICE (1 << 0x0C) +#define DMG_ARROW_LIGHT (1 << 0x0D) +#define DMG_ARROW_UNK1 (1 << 0x0E) +#define DMG_ARROW_UNK2 (1 << 0x0F) +#define DMG_ARROW_UNK3 (1 << 0x10) +#define DMG_MAGIC_FIRE (1 << 0x11) +#define DMG_MAGIC_ICE (1 << 0x12) +#define DMG_MAGIC_LIGHT (1 << 0x13) +#define DMG_SHIELD (1 << 0x14) +#define DMG_MIR_RAY (1 << 0x15) +#define DMG_SPIN_KOKIRI (1 << 0x16) +#define DMG_SPIN_GIANT (1 << 0x17) +#define DMG_SPIN_MASTER (1 << 0x18) +#define DMG_JUMP_KOKIRI (1 << 0x19) +#define DMG_JUMP_GIANT (1 << 0x1A) +#define DMG_JUMP_MASTER (1 << 0x1B) +#define DMG_UNKNOWN_1 (1 << 0x1C) +#define DMG_UNBLOCKABLE (1 << 0x1D) +#define DMG_HAMMER_JUMP (1 << 0x1E) +#define DMG_UNKNOWN_2 (1 << 0x1F) + +#define DMG_SLASH (DMG_SLASH_KOKIRI | DMG_SLASH_MASTER | DMG_SLASH_GIANT) +#define DMG_SPIN_ATTACK (DMG_SPIN_KOKIRI | DMG_SPIN_MASTER | DMG_SPIN_GIANT) +#define DMG_JUMP_SLASH (DMG_JUMP_KOKIRI | DMG_JUMP_MASTER | DMG_JUMP_GIANT) +#define DMG_SWORD (DMG_SLASH | DMG_SPIN_ATTACK | DMG_JUMP_SLASH) +#define DMG_HAMMER (DMG_HAMMER_SWING | DMG_HAMMER_JUMP) +#define DMG_FIRE (DMG_ARROW_FIRE | DMG_MAGIC_FIRE) +#define DMG_ARROW (DMG_ARROW_NORMAL | DMG_ARROW_FIRE | DMG_ARROW_ICE | DMG_ARROW_LIGHT | DMG_UNK_ARROW_1 | DMG_UNK_ARROW_2 | DMG_UNK_ARROW_3) +#define DMG_RANGED (DMG_ARROW | DMG_HOOKSHOT | DMG_SLINGSHOT) +#define DMG_DEFAULT ~(DMG_SHIELD | DMG_MIR_RAY) + #endif diff --git a/include/z64object.h b/include/z64object.h index 54271d82f4..7e36e5b13e 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -405,7 +405,8 @@ typedef enum { /* 0x018E */ OBJECT_DOOR_KILLER, /* 0x018F */ OBJECT_OUKE_HAKA, /* 0x0190 */ OBJECT_TIMEBLOCK, - /* 0x0191 */ OBJECT_ZL4 + /* 0x0191 */ OBJECT_ZL4, + /* 0x0192 */ OBJECT_ID_MAX } ObjectID; #endif diff --git a/include/z64scene.h b/include/z64scene.h index d15867a9a1..cdfa1f4870 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -413,7 +413,8 @@ typedef enum { /* 0x6A */ SCENE_SUTARU, /* 0x6B */ SCENE_HAIRAL_NIWA2, /* 0x6C */ SCENE_SASATEST, - /* 0x6D */ SCENE_TESTROOM + /* 0x6D */ SCENE_TESTROOM, + /* 0x6E */ SCENE_ID_MAX } SceneID; #endif diff --git a/spec b/spec index fda4e20c80..ab3d6dd30f 100644 --- a/spec +++ b/spec @@ -569,11 +569,7 @@ endseg beginseg name "ovl_player_actor" include "build/src/overlays/actors/ovl_player_actor/z_player.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_player_actor/ovl_player_actor_reloc.o" -#else - include "build/data/overlays/actors/z_player.reloc.o" -#endif endseg beginseg @@ -788,8 +784,7 @@ endseg beginseg name "ovl_Bg_Haka_Zou" include "build/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.o" - include "build/data/overlays/actors/z_bg_haka_zou.data.o" - include "build/data/overlays/actors/z_bg_haka_zou.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Haka_Zou/ovl_Bg_Haka_Zou_reloc.o" endseg beginseg @@ -956,8 +951,11 @@ endseg beginseg name "ovl_Bg_Jya_Cobra" include "build/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.o" - include "build/data/overlays/actors/z_bg_jya_cobra.data.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_Bg_Jya_Cobra/ovl_Bg_Jya_Cobra_reloc.o" +#else include "build/data/overlays/actors/z_bg_jya_cobra.reloc.o" +#endif endseg beginseg @@ -1196,8 +1194,7 @@ endseg beginseg name "ovl_Bg_Spot06_Objects" include "build/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.o" - include "build/data/overlays/actors/z_bg_spot06_objects.data.o" - include "build/data/overlays/actors/z_bg_spot06_objects.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Spot06_Objects/ovl_Bg_Spot06_Objects_reloc.o" endseg beginseg @@ -2499,8 +2496,7 @@ endseg beginseg name "ovl_En_Hy" include "build/src/overlays/actors/ovl_En_Hy/z_en_hy.o" - include "build/data/overlays/actors/z_en_hy.data.o" - include "build/data/overlays/actors/z_en_hy.reloc.o" + include "build/src/overlays/actors/ovl_En_Hy/ovl_En_Hy_reloc.o" endseg beginseg @@ -2630,8 +2626,11 @@ endseg beginseg name "ovl_En_M_Thunder" include "build/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.o" - include "build/data/overlays/actors/z_en_m_thunder.data.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_En_M_Thunder/ovl_En_M_Thunder_reloc.o" +#else include "build/data/overlays/actors/z_en_m_thunder.reloc.o" +#endif endseg beginseg @@ -2782,11 +2781,7 @@ endseg beginseg name "ovl_En_Owl" include "build/src/overlays/actors/ovl_En_Owl/z_en_owl.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_En_Owl/ovl_En_Owl_reloc.o" -#else - include "build/data/overlays/actors/z_en_owl.reloc.o" -#endif endseg beginseg @@ -3106,11 +3101,7 @@ endseg beginseg name "ovl_En_Viewer" include "build/src/overlays/actors/ovl_En_Viewer/z_en_viewer.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_En_Viewer/ovl_En_Viewer_reloc.o" -#else - include "build/data/overlays/actors/z_en_viewer.reloc.o" -#endif endseg beginseg diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index 9ecc9d29c3..ff221da46b 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -776,22 +776,19 @@ s32 Audio_ResetStep(void) { return 1; } -#ifdef NON_EQUIVALENT -// first half matches, reorderings and regalloc in second half void func_800DFBF8(void) { - s32 pad[6]; - s32 i; - s32 j; + s32 pad1[4]; s16* mem; - u16 windowSize; s32 persistentMem; s32 temporaryMem; s32 totalMem; - AudioSessionSettings* preset; s32 wantMisc; u32 intMask; + s32 i; + s32 j; + s32 pad2; + AudioSessionSettings* preset = &gAudioSessionPresets[gAudioContext.gAudioResetPresetIdToLoad]; - preset = &gAudioSessionPresets[gAudioContext.gAudioResetPresetIdToLoad]; gAudioContext.gSampleDmaNumListItems = 0; gAudioContext.gAudioBufferParameters.frequency = preset->frequency; gAudioContext.gAudioBufferParameters.aiFrequency = osAiSetFrequency(gAudioContext.gAudioBufferParameters.frequency); @@ -894,8 +891,8 @@ void func_800DFBF8(void) { gAudioContext.gNumSynthesisReverbs = preset->numReverbs; for (i = 0; i < gAudioContext.gNumSynthesisReverbs; i++) { - SynthesisReverb* reverb = &gAudioContext.gSynthesisReverbs[i]; ReverbSettings* settings = &preset->reverbSettings[i]; + SynthesisReverb* reverb = &gAudioContext.gSynthesisReverbs[i]; reverb->downsampleRate = settings->downsampleRate; reverb->windowSize = settings->windowSize * 64; reverb->windowSize /= reverb->downsampleRate; @@ -914,19 +911,19 @@ void func_800DFBF8(void) { reverb->unk_1C = 0; reverb->unk_20 = 0; reverb->unk_03 = 0; + reverb->unk_24 = reverb->windowSize; reverb->unk_02 = 2; reverb->unk_00 = 1; - reverb->unk_24 = reverb->windowSize; reverb->sound.sample = &reverb->sample; reverb->sample.loop = &reverb->loop; + reverb->sound.tuning = 1.0f; reverb->sample.bits4 = 4; reverb->sample.bits2 = 0; reverb->sample.bits24 = reverb->windowSize * 2; + reverb->sample.sampleAddr = (u8*)reverb->unk_28; reverb->loop.start = 0; reverb->loop.count = 1; reverb->loop.end = reverb->windowSize; - reverb->sound.tuning = 1.0f; - reverb->sample.sampleAddr = (u8*)reverb->unk_28; if (reverb->downsampleRate != 1) { reverb->unk_0E = 0x8000 / reverb->downsampleRate; @@ -934,7 +931,6 @@ void func_800DFBF8(void) { reverb->unk_34 = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20); reverb->unk_38 = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20); reverb->unk_3C = Audio_AllocZeroed(&gAudioContext.gNotesAndBuffersPool, 0x20); - reverb = reverb; for (j = 0; j < gAudioContext.gAudioBufferParameters.updatesPerFrame; j++) { mem = func_800DE258(&gAudioContext.gNotesAndBuffersPool, 0x340); reverb->items[0][j].toDownsampleLeft = mem; @@ -963,9 +959,9 @@ void func_800DFBF8(void) { } Audio_InitSequencePlayers(); - for (i = 0; i < gAudioContext.gAudioBufferParameters.numSequencePlayers; i++) { - func_800EC734(i); - Audio_ResetSequencePlayer(&gAudioContext.gSequencePlayers[i]); + for (j = 0; j < gAudioContext.gAudioBufferParameters.numSequencePlayers; j++) { + func_800EC734(j); + Audio_ResetSequencePlayer(&gAudioContext.gSequencePlayers[j]); } func_800E0634(preset->unk_30, preset->unk_34); @@ -980,9 +976,6 @@ void func_800DFBF8(void) { osWritebackDCacheAll(); osSetIntMask(intMask); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_800DFBF8.s") -#endif void* func_800E04E8(s32 poolIdx, s32 id) { s32 i; diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 9673fc86ae..1b2f73c480 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -22,9 +22,9 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { colCtx->dyna.bgActors[bgId].curTransform.rot.x, colCtx->dyna.bgActors[bgId].curTransform.rot.y, colCtx->dyna.bgActors[bgId].curTransform.rot.z, colCtx->dyna.bgActors[bgId].curTransform.pos.x, colCtx->dyna.bgActors[bgId].curTransform.pos.y, colCtx->dyna.bgActors[bgId].curTransform.pos.z); - SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->posRot.pos, &tempPos); + SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->world.pos, &tempPos); SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos); - actor->posRot.pos = pos; + actor->world.pos = pos; if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y || pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { @@ -52,7 +52,7 @@ void func_800432A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { } actor->shape.rot.y += rot; - actor->posRot.rot.y += rot; + actor->world.rot.y += rot; } } diff --git a/src/code/code_80043480.c b/src/code/code_80043480.c index 900dd9683e..fe8097eb97 100644 --- a/src/code/code_80043480.c +++ b/src/code/code_80043480.c @@ -20,8 +20,8 @@ void func_800434B8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 2; } -void func_800434C8(CollisionContext* colCtx, s32 floorPolySource) { - DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource); +void func_800434C8(CollisionContext* colCtx, s32 floorBgId) { + DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL) { func_800434B8(dynaActor); @@ -32,8 +32,8 @@ void func_800434F8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 4; } -void func_80043508(CollisionContext* colCtx, s32 floorPolySource) { - DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource); +void func_80043508(CollisionContext* colCtx, s32 floorBgId) { + DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL) { func_800434F8(dynaActor); @@ -93,9 +93,9 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16 sign = (0.0f <= actor->unk_150) ? 1.0f : -1.0f; a2 = (f32)arg2 - 0.1f; - posA.x = actor->actor.posRot.pos.x + (a2 * cos); - posA.y = actor->actor.posRot.pos.y + arg4; - posA.z = actor->actor.posRot.pos.z - (a2 * sin); + posA.x = actor->actor.world.pos.x + (a2 * cos); + posA.y = actor->actor.world.pos.y + arg4; + posA.z = actor->actor.world.pos.z - (a2 * sin); a3 = (f32)arg3 - 0.1f; posB.x = sign * a3 * sin + posA.x; @@ -105,8 +105,8 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16 actor, 0.0f)) { return false; } - posA.x = (actor->actor.posRot.pos.x * 2) - posA.x; - posA.z = (actor->actor.posRot.pos.z * 2) - posA.z; + posA.x = (actor->actor.world.pos.x * 2) - posA.x; + posA.z = (actor->actor.world.pos.z * 2) - posA.z; posB.x = sign * a3 * sin + posA.x; posB.z = sign * a3 * cos + posA.z; if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId, diff --git a/src/code/z_actor.c b/src/code/z_actor.c index c5d2f3d4a6..a009939877 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -5,20 +5,20 @@ #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "objects/gameplay_keep/gameplay_keep.h" -void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) { - shape->unk_08 = arg1; - shape->shadowDrawFunc = shadowDrawFunc; - shape->unk_10 = arg3; - shape->unk_14 = -1; +void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale) { + shape->yOffset = yOffset; + shape->shadowDraw = shadowDraw; + shape->shadowScale = shadowScale; + shape->shadowAlpha = 255; } -void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* dlist, Color_RGBA8* color) { +void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* dlist, Color_RGBA8* color) { f32 temp1; f32 temp2; MtxF sp60; if (actor->floorPoly != NULL) { - temp1 = actor->posRot.pos.y - actor->groundY; + temp1 = actor->world.pos.y - actor->floorHeight; if (temp1 >= -50.0f && temp1 < 500.0f) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1553); @@ -33,19 +33,19 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* if (color != NULL) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color->r, color->g, color->b, - (u32)(actor->shape.unk_14 * temp2) & 0xFF); + (u32)(actor->shape.shadowAlpha * temp2) & 0xFF); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u32)(actor->shape.unk_14 * temp2) & 0xFF); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u32)(actor->shape.shadowAlpha * temp2) & 0xFF); } - func_80038A28(actor->floorPoly, actor->posRot.pos.x, actor->groundY, actor->posRot.pos.z, &sp60); + func_80038A28(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &sp60); Matrix_Put(&sp60); if (dlist != D_04049210) { Matrix_RotateY(actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); } - temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.unk_10; + temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale; Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588), @@ -57,21 +57,21 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* } } -void ActorShadow_DrawFunc_Circle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, &D_04049210, NULL); +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + ActorShadow_Draw(actor, lights, globalCtx, D_04049210, NULL); } -Color_RGBA8 D_80115F80 = { 255, 255, 255, 255 }; +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + static Color_RGBA8 white = { 255, 255, 255, 255 }; -void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, &D_04049210, &D_80115F80); + ActorShadow_Draw(actor, lights, globalCtx, D_04049210, &white); } -void ActorShadow_DrawFunc_Squiggly(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, D_04049AD0, NULL); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + ActorShadow_Draw(actor, lights, globalCtx, D_04049AD0, NULL); } -void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { +void ActorShadow_DrawFoot(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { s32 pad1; f32 sp58; s32 pad2[2]; @@ -97,7 +97,7 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, #ifdef NON_MATCHING // saved register, stack usage and minor ordering differences -void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* globalCtx) { +void ActorShadow_DrawFeet(Actor* actor, Lights* lights, GlobalContext* globalCtx) { MtxF spE8; f32 spE0[2]; s32 i; @@ -118,20 +118,20 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* s32 phi_s1; s32 phi_s2; - temp_f20 = actor->posRot.pos.y - actor->groundY; + temp_f20 = actor->world.pos.y - actor->floorHeight; if (temp_f20 > 20.0f) { - temp_10 = actor->shape.unk_10; - temp_14 = actor->shape.unk_14; - actor->shape.unk_10 *= 0.3f; - actor->shape.unk_14 *= ((temp_f20 - 20.0f) * 0.02f) > 1.0f ? 1.0f : ((temp_f20 - 20.0f) * 0.02f); - ActorShadow_DrawFunc_Circle(actor, lights, globalCtx); - actor->shape.unk_10 = temp_10; - actor->shape.unk_14 = temp_14; + temp_10 = actor->shape.shadowScale; + temp_14 = actor->shape.shadowAlpha; + actor->shape.shadowScale *= 0.3f; + actor->shape.shadowAlpha *= ((temp_f20 - 20.0f) * 0.02f) > 1.0f ? 1.0f : ((temp_f20 - 20.0f) * 0.02f); + ActorShadow_DrawCircle(actor, lights, globalCtx); + actor->shape.shadowScale = temp_10; + actor->shape.shadowAlpha = temp_14; } if (temp_f20 < 200.0f) { - phi_s7 = &actor->unk_CC[0]; + phi_s7 = &actor->shape.feetPos[FOOT_LEFT]; spAC = &spE0[0]; temp_s6 = lights->numLights; temp_s6 -= 2; @@ -139,14 +139,14 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1741); POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C); - actor->shape.unk_15 = 0; + actor->shape.feetFloorFlags = 0; for (i = 0; i < 2; i++) { phi_s7->y += 50.0f; *spAC = func_800BFCB8(globalCtx, &spE8, phi_s7); phi_s7->y -= 50.0f; - actor->shape.unk_15 *= 2; + actor->shape.feetFloorFlags *= 2; phi_f2 = phi_s7->y - *spAC; @@ -154,21 +154,21 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* phi_s0 = &lights->l.l[0]; if (phi_f2 <= 0.0f) { - actor->shape.unk_15++; + actor->shape.feetFloorFlags++; } if (30.0f < phi_f2) { phi_f2 = 30.0f; } - temp_f24 = actor->shape.unk_14 * (1.0f - (phi_f2 * (1.0f / 30))); + temp_f24 = actor->shape.shadowAlpha * (1.0f - (phi_f2 * (1.0f / 30))); if (30.0f < phi_f2) { phi_f2 = 30.0f; } temp_f20_2 = 1.0f - (phi_f2 * (1.0f / 70)); - temp_f22_2 = (actor->shape.unk_10 * temp_f20_2) * actor->scale.x; + temp_f22_2 = (actor->shape.shadowScale * temp_f20_2) * actor->scale.x; phi_s2 = 0; @@ -176,7 +176,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* if (phi_s0->l.dir[1] > 0) { temp_lo = ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2]); if (temp_lo > 0) { - func_8002B66C(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2); + ActorShadow_DrawFoot(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2); phi_s2 += temp_lo; } } @@ -188,7 +188,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) - (phi_s2 * 8); if (temp_a3 > 0) { - func_8002B66C(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2); + ActorShadow_DrawFoot(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2); } } phi_s0++; @@ -200,24 +200,25 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* } if (!(actor->bgCheckFlags & 1)) { - actor->shape.unk_15 = 0; - } else if (actor->shape.unk_15 == 3) { - temp_f0 = actor->unk_CC[0].y - actor->unk_CC[1].y; - actor->shape.unk_15 = ((spE0[0] + temp_f0) < (spE0[1] - temp_f0)) ? 2 : 1; + actor->shape.feetFloorFlags = 0; + } else if (actor->shape.feetFloorFlags == 3) { + temp_f0 = actor->shape.feetPos[FOOT_LEFT].y - actor->shape.feetPos[FOOT_RIGHT].y; + actor->shape.feetFloorFlags = ((spE0[0] + temp_f0) < (spE0[1] - temp_f0)) ? 2 : 1; } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1831); } } #else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s") #endif -void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, Vec3f* arg3, s32 arg4, Vec3f* arg5) { - if (arg1 == arg2) { - Matrix_MultVec3f(arg3, &actor->unk_CC[0]); - } else if (arg1 == arg4) { - Matrix_MultVec3f(arg5, &actor->unk_CC[1]); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos) { + if (limbIndex == leftFootIndex) { + Matrix_MultVec3f(leftFootPos, &actor->shape.feetPos[FOOT_LEFT]); + } else if (limbIndex == rightFootIndex) { + Matrix_MultVec3f(rightFootPos, &actor->shape.feetPos[FOOT_RIGHT]); } } @@ -253,7 +254,7 @@ void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 targetCtx->arr_50[index].unk_0C = targetCtx->unk_44; } -void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx) { +void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, GlobalContext* globalCtx) { TargetContextEntry* entry; NaviColor* naviColor; s32 i; @@ -262,7 +263,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa targetCtx->unk_44 = 500.0f; targetCtx->unk_48 = 0x100; - naviColor = &sNaviColorList[actorType]; + naviColor = &sNaviColorList[actorCategory]; entry = &targetCtx->arr_50[0]; for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) { @@ -274,11 +275,11 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa } } -void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx) { - NaviColor* naviColor = &sNaviColorList[actorType]; - targetCtx->naviRefPos.x = actor->posRot2.pos.x; - targetCtx->naviRefPos.y = actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y); - targetCtx->naviRefPos.z = actor->posRot2.pos.z; +void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) { + NaviColor* naviColor = &sNaviColorList[actorCategory]; + targetCtx->naviRefPos.x = actor->focus.pos.x; + targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); + targetCtx->naviRefPos.z = actor->focus.pos.z; targetCtx->naviInner.r = naviColor->inner.r; targetCtx->naviInner.g = naviColor->inner.g; targetCtx->naviInner.b = naviColor->inner.b; @@ -297,8 +298,8 @@ void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* global targetCtx->unk_90 = NULL; targetCtx->unk_4B = 0; targetCtx->unk_4C = 0; - func_8002BF60(targetCtx, actor, actor->type, globalCtx); - func_8002BE98(targetCtx, actor->type, globalCtx); + func_8002BF60(targetCtx, actor, actor->category, globalCtx); + func_8002BE98(targetCtx, actor->category, globalCtx); } void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { @@ -332,7 +333,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { } if (actor != NULL) { - Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->posRot2.pos); + Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->focus.pos); var1 = (500.0f - targetCtx->unk_44) / 420.0f; } else { targetCtx->unk_48 -= 120; @@ -400,12 +401,12 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { actor = targetCtx->unk_94; if ((actor != NULL) && !(actor->flags & 0x8000000)) { - NaviColor* naviColor = &sNaviColorList[actor->type]; + NaviColor* naviColor = &sNaviColorList[actor->category]; POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x7); - Matrix_Translate(actor->posRot2.pos.x, actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f, - actor->posRot2.pos.z, MTXMODE_NEW); + Matrix_Translate(actor->focus.pos.x, actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f, + actor->focus.pos.z, MTXMODE_NEW); Matrix_RotateY((f32)((u16)(globalCtx->gameplayFrames * 3000)) * (M_PI / 32768), MTXMODE_APPLY); Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY); @@ -421,7 +422,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx) { s32 pad; Actor* unkActor; - s32 actorType; + s32 actorCategory; Vec3f sp50; f32 sp4C; f32 temp1; @@ -449,14 +450,14 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl } if (unkActor != NULL) { - actorType = unkActor->type; + actorCategory = unkActor->category; } else { - actorType = player->actor.type; + actorCategory = player->actor.category; } - if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType)) { + if ((unkActor != targetCtx->arrowPointedActor) || (actorCategory != targetCtx->activeCategory)) { targetCtx->arrowPointedActor = unkActor; - targetCtx->activeType = actorType; + targetCtx->activeCategory = actorCategory; targetCtx->unk_40 = 1.0f; } @@ -466,18 +467,18 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl if (Math_StepToF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) { temp1 = 0.25f / targetCtx->unk_40; - temp2 = unkActor->posRot.pos.x - targetCtx->naviRefPos.x; - temp3 = (unkActor->posRot.pos.y + (unkActor->unk_4C * unkActor->scale.y)) - targetCtx->naviRefPos.y; - temp4 = unkActor->posRot.pos.z - targetCtx->naviRefPos.z; + temp2 = unkActor->world.pos.x - targetCtx->naviRefPos.x; + temp3 = (unkActor->world.pos.y + (unkActor->targetArrowOffset * unkActor->scale.y)) - targetCtx->naviRefPos.y; + temp4 = unkActor->world.pos.z - targetCtx->naviRefPos.z; targetCtx->naviRefPos.x += temp2 * temp1; targetCtx->naviRefPos.y += temp3 * temp1; targetCtx->naviRefPos.z += temp4 * temp1; } else { - func_8002BF60(targetCtx, unkActor, actorType, globalCtx); + func_8002BF60(targetCtx, unkActor, actorCategory, globalCtx); } if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) { - func_8002BE04(globalCtx, &actorArg->posRot2.pos, &sp50, &sp4C); + func_8002BE04(globalCtx, &actorArg->focus.pos, &sp50, &sp4C); if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C))) { actorArg = NULL; } @@ -485,7 +486,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl if (actorArg != NULL) { if (actorArg != targetCtx->targetedActor) { - func_8002BE98(targetCtx, actorArg->type, globalCtx); + func_8002BE98(targetCtx, actorArg->category, globalCtx); targetCtx->targetedActor = actorArg; if (actorArg->id == ACTOR_EN_BOOM) { @@ -496,9 +497,9 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl func_80078884(lockOnSfxId); } - targetCtx->targetCenterPos.x = actorArg->posRot.pos.x; - targetCtx->targetCenterPos.y = actorArg->posRot.pos.y - (actorArg->shape.unk_08 * actorArg->scale.y); - targetCtx->targetCenterPos.z = actorArg->posRot.pos.z; + targetCtx->targetCenterPos.x = actorArg->world.pos.x; + targetCtx->targetCenterPos.y = actorArg->world.pos.y - (actorArg->shape.yOffset * actorArg->scale.y); + targetCtx->targetCenterPos.z = actorArg->world.pos.z; if (targetCtx->unk_4B == 0) { temp5 = (500.0f - targetCtx->unk_44) * 3.0f; @@ -775,26 +776,26 @@ void Actor_Kill(Actor* actor) { actor->flags &= ~0x1; } -void Actor_InitPosRot(Actor* actor) { - actor->posRot = actor->initPosRot; +void Actor_SetWorldToHome(Actor* actor) { + actor->world = actor->home; } -void Actor_SetHeight(Actor* actor, f32 offset) { - actor->posRot2.pos.x = actor->posRot.pos.x; - actor->posRot2.pos.y = actor->posRot.pos.y + offset; - actor->posRot2.pos.z = actor->posRot.pos.z; +void Actor_SetFocus(Actor* actor, f32 yOffset) { + actor->focus.pos.x = actor->world.pos.x; + actor->focus.pos.y = actor->world.pos.y + yOffset; + actor->focus.pos.z = actor->world.pos.z; - actor->posRot2.rot.x = actor->posRot.rot.x; - actor->posRot2.rot.y = actor->posRot.rot.y; - actor->posRot2.rot.z = actor->posRot.rot.z; + actor->focus.rot.x = actor->world.rot.x; + actor->focus.rot.y = actor->world.rot.y; + actor->focus.rot.z = actor->world.rot.z; } -void func_8002D5F4(Actor* actor) { - actor->posRot.rot = actor->shape.rot; +void Actor_SetWorldRotToShape(Actor* actor) { + actor->world.rot = actor->shape.rot; } -void func_8002D610(Actor* actor) { - actor->shape.rot = actor->posRot.rot; +void Actor_SetShapeRotToWorld(Actor* actor) { + actor->shape.rot = actor->world.rot; } void Actor_SetScale(Actor* actor, f32 scale) { @@ -808,20 +809,20 @@ void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) { } void Actor_Init(Actor* actor, GlobalContext* globalCtx) { - Actor_InitPosRot(actor); - func_8002D610(actor); - Actor_SetHeight(actor, 0.0f); - Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos); + Actor_SetWorldToHome(actor); + Actor_SetShapeRotToWorld(actor); + Actor_SetFocus(actor, 0.0f); + Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); Actor_SetScale(actor, 0.01f); - actor->unk_1F = 3; + actor->targetMode = 3; actor->minVelocityY = -20.0f; - actor->xyzDistToLinkSq = FLT_MAX; + actor->xyzDistToPlayerSq = FLT_MAX; actor->naviEnemyId = 0xFF; actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - func_80061E48(&actor->colChkInfo); - actor->floorPolySource = BGCHECK_SCENE; + CollisionCheck_InitInfo(&actor->colChkInfo); + actor->floorBgId = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(globalCtx, actor); @@ -848,14 +849,14 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) { void func_8002D7EC(Actor* actor) { f32 speedRate = R_UPDATE_RATE * 0.5f; - actor->posRot.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; - actor->posRot.pos.y += (actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y; - actor->posRot.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; + actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; + actor->world.pos.y += (actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y; + actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; } void func_8002D868(Actor* actor) { - actor->velocity.x = Math_SinS(actor->posRot.rot.y) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->posRot.rot.y) * actor->speedXZ; + actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ; + actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ; actor->velocity.y += actor->gravity; if (actor->velocity.y < actor->minVelocityY) { @@ -869,10 +870,10 @@ void Actor_MoveForward(Actor* actor) { } void func_8002D908(Actor* actor) { - f32 sp24 = Math_CosS(actor->posRot.rot.x) * actor->speedXZ; - actor->velocity.x = Math_SinS(actor->posRot.rot.y) * sp24; - actor->velocity.y = Math_SinS(actor->posRot.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->posRot.rot.y) * sp24; + f32 sp24 = Math_CosS(actor->world.rot.x) * actor->speedXZ; + actor->velocity.x = Math_SinS(actor->world.rot.y) * sp24; + actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; + actor->velocity.z = Math_CosS(actor->world.rot.y) * sp24; } void func_8002D97C(Actor* actor) { @@ -881,56 +882,56 @@ void func_8002D97C(Actor* actor) { } void func_8002D9A4(Actor* actor, f32 arg1) { - actor->speedXZ = Math_CosS(actor->posRot.rot.x) * arg1; - actor->velocity.y = -Math_SinS(actor->posRot.rot.x) * arg1; + actor->speedXZ = Math_CosS(actor->world.rot.x) * arg1; + actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1; } void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) { Vec3f sp1C; SkelAnime_UpdateTranslation(skelAnime, &sp1C, actor->shape.rot.y); - actor->posRot.pos.x += sp1C.x * actor->scale.x; - actor->posRot.pos.y += sp1C.y * actor->scale.y; - actor->posRot.pos.z += sp1C.z * actor->scale.z; + actor->world.pos.x += sp1C.x * actor->scale.x; + actor->world.pos.y += sp1C.y * actor->scale.y; + actor->world.pos.z += sp1C.z * actor->scale.z; } -s16 func_8002DA78(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Yaw(&actorA->posRot.pos, &actorB->posRot.pos); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->world.pos, &actorB->world.pos); } -s16 func_8002DA9C(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Yaw(&actorA->posRot2.pos, &actorB->posRot2.pos); +s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->focus.pos, &actorB->focus.pos); } -s16 func_8002DAC0(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_Yaw(&actor->posRot.pos, arg1); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Yaw(&actor->world.pos, refPoint); } -s16 func_8002DAE0(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Pitch(&actorA->posRot.pos, &actorB->posRot.pos); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->world.pos, &actorB->world.pos); } -s16 func_8002DB04(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Pitch(&actorA->posRot2.pos, &actorB->posRot2.pos); +s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->focus.pos, &actorB->focus.pos); } -s16 func_8002DB28(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_Pitch(&actor->posRot.pos, arg1); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Pitch(&actor->world.pos, refPoint); } -f32 func_8002DB48(Actor* actorA, Actor* actorB) { - return Math_Vec3f_DistXYZ(&actorA->posRot.pos, &actorB->posRot.pos); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXYZ(&actorA->world.pos, &actorB->world.pos); } -f32 func_8002DB6C(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_DistXYZ(&actor->posRot.pos, arg1); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXYZ(&actor->world.pos, refPoint); } -f32 func_8002DB8C(Actor* actorA, Actor* actorB) { - return Math_Vec3f_DistXZ(&actorA->posRot.pos, &actorB->posRot.pos); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXZ(&actorA->world.pos, &actorB->world.pos); } -f32 func_8002DBB0(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_DistXZ(&actor->posRot.pos, arg1); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXZ(&actor->world.pos, refPoint); } void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { @@ -941,16 +942,16 @@ void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { cosRot2Y = Math_CosS(actor->shape.rot.y); sinRot2Y = Math_SinS(actor->shape.rot.y); - deltaX = arg2->x - actor->posRot.pos.x; - deltaZ = arg2->z - actor->posRot.pos.z; + deltaX = arg2->x - actor->world.pos.x; + deltaZ = arg2->z - actor->world.pos.z; result->x = (deltaX * cosRot2Y) - (deltaZ * sinRot2Y); result->z = (deltaX * sinRot2Y) + (deltaZ * cosRot2Y); - result->y = arg2->y - actor->posRot.pos.y; + result->y = arg2->y - actor->world.pos.y; } f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) { - return actorB->posRot.pos.y - actorA->posRot.pos.y; + return actorB->world.pos.y - actorA->world.pos.y; } f32 Player_GetHeight(Player* player) { @@ -1002,7 +1003,7 @@ s32 func_8002DDF4(GlobalContext* globalCtx) { void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { ArmsHook* hookshot; - hookshot = (ArmsHook*)Actor_Find(&globalCtx->actorCtx, ACTOR_ARMS_HOOK, ACTORTYPE_ITEMACTION); + hookshot = (ArmsHook*)Actor_Find(&globalCtx->actorCtx, ACTOR_ARMS_HOOK, ACTORCAT_ITEMACTION); hookshot->grabbed = actorB; hookshot->grabbedDistDiff.x = 0.0f; hookshot->grabbedDistDiff.y = 0.0f; @@ -1062,7 +1063,7 @@ void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) { s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 var = (s16)(actor->yawTowardsLink + 0x8000) - player->actor.shape.rot.y; + s16 var = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y; if (ABS(var) < arg1) { return 1; @@ -1072,7 +1073,7 @@ s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) { } s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) { - s16 var = (s16)(func_8002DA78(actorA, actorB) + 0x8000) - actorB->shape.rot.y; + s16 var = (s16)(Actor_WorldYawTowardActor(actorA, actorB) + 0x8000) - actorB->shape.rot.y; if (ABS(var) < arg2) { return 1; @@ -1082,7 +1083,7 @@ s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) { } s32 func_8002E084(Actor* actor, s16 arg1) { - s16 var = actor->yawTowardsLink - actor->shape.rot.y; + s16 var = actor->yawTowardsPlayer - actor->shape.rot.y; if (ABS(var) < arg1) { return 1; @@ -1092,7 +1093,7 @@ s32 func_8002E084(Actor* actor, s16 arg1) { } s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) { - s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; + s16 var = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS(var) < arg2) { return 1; @@ -1102,10 +1103,10 @@ s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) { } s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) { - s16 var = actor->yawTowardsLink - actor->shape.rot.y; + s16 var = actor->yawTowardsPlayer - actor->shape.rot.y; if (ABS(var) < arg2) { - f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistToLink) + SQ(actor->yDistToLink)); + f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistToPlayer) + SQ(actor->yDistToPlayer)); if (xyzDistanceFromLink < arg1) { return 1; @@ -1116,8 +1117,8 @@ s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) { } s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3) { - if (func_8002DB48(actorA, actorB) < arg2) { - s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; + if (Actor_WorldDistXYZToActor(actorA, actorB) < arg2) { + s16 var = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS(var) < arg3) { return 1; @@ -1142,40 +1143,41 @@ s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) { return 1; } -CollisionPoly* D_8015BBA0; -s32 D_8015BBA4; +CollisionPoly* sCurCeilingPoly; +s32 sCurCeilingBgId; s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) { - f32 sp34; - s32 bgId; + f32 floorHeightDiff; + s32 floorBgId; arg2->y += 50.0f; - actor->groundY = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &bgId, actor, arg2); + actor->floorHeight = + BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &floorBgId, actor, arg2); actor->bgCheckFlags &= ~0x0086; - if (actor->groundY <= BGCHECK_Y_MIN) { + if (actor->floorHeight <= BGCHECK_Y_MIN) { return func_8002E234(actor, BGCHECK_Y_MIN, arg3); } - sp34 = actor->groundY - actor->posRot.pos.y; - actor->floorPolySource = bgId; + floorHeightDiff = actor->floorHeight - actor->world.pos.y; + actor->floorBgId = floorBgId; - if (sp34 >= 0.0f) { + if (floorHeightDiff >= 0.0f) { // actor is on or below the ground actor->bgCheckFlags |= 0x80; if (actor->bgCheckFlags & 0x10) { - if (bgId != D_8015BBA4) { - if (sp34 > 15.0f) { + if (floorBgId != sCurCeilingBgId) { + if (floorHeightDiff > 15.0f) { actor->bgCheckFlags |= 0x100; } } else { - actor->posRot.pos.x = actor->pos4.x; - actor->posRot.pos.z = actor->pos4.z; + actor->world.pos.x = actor->prevPos.x; + actor->world.pos.z = actor->prevPos.z; } } - actor->posRot.pos.y = actor->groundY; + actor->world.pos.y = actor->floorHeight; if (actor->velocity.y <= 0.0f) { if (!(actor->bgCheckFlags & 0x1)) { @@ -1187,81 +1189,81 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) } actor->bgCheckFlags |= 0x1; - func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); + func_80043334(&globalCtx->colCtx, actor, actor->floorBgId); } - } else { - if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f)) { - func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); + } else { // actor is above ground + if ((actor->bgCheckFlags & 0x1) && (floorHeightDiff >= -11.0f)) { + func_80043334(&globalCtx->colCtx, actor, actor->floorBgId); } - return func_8002E234(actor, sp34, arg3); + return func_8002E234(actor, floorHeightDiff, arg3); } return 1; } -void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { +void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { f32 sp74; s32 pad; Vec3f sp64; s32 bgId; - CollisionPoly* sp5C; + CollisionPoly* wallPoly; f32 sp58; WaterBox* waterBox; - f32 sp50; + f32 waterBoxYSurface; Vec3f ripplePos; - sp74 = actor->posRot.pos.y - actor->pos4.y; + sp74 = actor->world.pos.y - actor->prevPos.y; - if ((actor->floorPolySource != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { - func_800433A4(&globalCtx->colCtx, actor->floorPolySource, actor); + if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { + func_800433A4(&globalCtx->colCtx, actor->floorBgId, actor); } if (arg5 & 1) { - if ((!(arg5 & 0x80) && BgCheck_EntitySphVsWall3(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, + if ((!(arg5 & 0x80) && BgCheck_EntitySphVsWall3(&globalCtx->colCtx, &sp64, &actor->world.pos, &actor->prevPos, arg3, &actor->wallPoly, &bgId, actor, arg2)) || - ((arg5 & 0x80) && BgCheck_EntitySphVsWall4(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, + ((arg5 & 0x80) && BgCheck_EntitySphVsWall4(&globalCtx->colCtx, &sp64, &actor->world.pos, &actor->prevPos, arg3, &actor->wallPoly, &bgId, actor, arg2))) { - sp5C = actor->wallPoly; - Math_Vec3f_Copy(&actor->posRot.pos, &sp64); - actor->wallPolyRot = Math_Atan2S(sp5C->normal.z, sp5C->normal.x); + wallPoly = actor->wallPoly; + Math_Vec3f_Copy(&actor->world.pos, &sp64); + actor->wallYaw = Math_Atan2S(wallPoly->normal.z, wallPoly->normal.x); actor->bgCheckFlags |= 8; - actor->wallPolySource = bgId; + actor->wallBgId = bgId; } else { actor->bgCheckFlags &= ~8; } } - sp64.x = actor->posRot.pos.x; - sp64.z = actor->posRot.pos.z; + sp64.x = actor->world.pos.x; + sp64.z = actor->world.pos.z; if (arg5 & 2) { - sp64.y = actor->pos4.y + 10.0f; - if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, - &D_8015BBA4, actor)) { + sp64.y = actor->prevPos.y + 10.0f; + if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &sCurCeilingPoly, + &sCurCeilingBgId, actor)) { actor->bgCheckFlags |= 0x10; - actor->posRot.pos.y = (sp58 + sp74) - 10.0f; + actor->world.pos.y = (sp58 + sp74) - 10.0f; } else { actor->bgCheckFlags &= ~0x10; } } if (arg5 & 4) { - sp64.y = actor->pos4.y; + sp64.y = actor->prevPos.y; func_8002E2AC(globalCtx, actor, &sp64, arg5); - sp50 = actor->posRot.pos.y; - if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, - &waterBox)) { - actor->yDistToWater = sp50 - actor->posRot.pos.y; + waterBoxYSurface = actor->world.pos.y; + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->world.pos.x, actor->world.pos.z, + &waterBoxYSurface, &waterBox)) { + actor->yDistToWater = waterBoxYSurface - actor->world.pos.y; if (actor->yDistToWater < 0.0f) { actor->bgCheckFlags &= ~0x60; } else { if (!(actor->bgCheckFlags & 0x20)) { actor->bgCheckFlags |= 0x40; if (!(arg5 & 0x40)) { - ripplePos.x = actor->posRot.pos.x; - ripplePos.y = sp50; - ripplePos.z = actor->posRot.pos.z; + ripplePos.x = actor->world.pos.x; + ripplePos.y = waterBoxYSurface; + ripplePos.z = actor->world.pos.z; EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 0); EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 4); EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 8); @@ -1343,7 +1345,7 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) { globalCtx->view.eye.y, globalCtx->view.eye.z); } - hilite = func_8002EABC(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); + hilite = func_8002EABC(&actor->world.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); @@ -1369,7 +1371,7 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { lightDir.y = globalCtx->envCtx.unk_2B; lightDir.z = globalCtx->envCtx.unk_2C; - hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); + hilite = func_8002EB44(&actor->world.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); @@ -1385,22 +1387,22 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { } } -PosRot* func_8002EEE4(PosRot* arg0, Actor* actor) { - *arg0 = actor->posRot2; +PosRot* Actor_GetFocus(PosRot* dest, Actor* actor) { + *dest = actor->focus; - return arg0; + return dest; } -PosRot* func_8002EF14(PosRot* arg0, Actor* actor) { - *arg0 = actor->posRot; +PosRot* Actor_GetWorld(PosRot* dest, Actor* actor) { + *dest = actor->world; - return arg0; + return dest; } -PosRot* func_8002EF44(PosRot* arg0, Actor* actor) { +PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor) { PosRot sp1C; - Math_Vec3f_Copy(&sp1C.pos, &actor->posRot.pos); + Math_Vec3f_Copy(&sp1C.pos, &actor->world.pos); sp1C.rot = actor->shape.rot; *arg0 = sp1C; @@ -1412,14 +1414,15 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { s16 yawTempAbs; f32 ret; - yawTemp = (s16)(actor->yawTowardsLink - 0x8000) - arg2; + yawTemp = (s16)(actor->yawTowardsPlayer - 0x8000) - arg2; yawTempAbs = ABS(yawTemp); if (player->unk_664 != NULL) { if ((yawTempAbs > 0x4000) || (actor->flags & 0x8000000)) { return FLT_MAX; } else { - ret = actor->xyzDistToLinkSq - actor->xyzDistToLinkSq * 0.8f * ((0x4000 - yawTempAbs) * 3.0517578125e-05f); + ret = actor->xyzDistToPlayerSq - + actor->xyzDistToPlayerSq * 0.8f * ((0x4000 - yawTempAbs) * 3.0517578125e-05f); return ret; } } @@ -1428,21 +1431,25 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { return FLT_MAX; } - return actor->xyzDistToLinkSq; + return actor->xyzDistToPlayerSq; } typedef struct { - f32 unk_0, unk_4; -} struct_80115FF8; // size = 0x8 + /* 0x0 */ f32 rangeSq; + /* 0x4 */ f32 leashScale; +} TargetRangeParams; // size = 0x8 -struct_80115FF8 D_80115FF8[] = { - { 4900.0f, 0.5f }, { 28900.0f, 0.6666667f }, { 78400.0f, 0.05f }, { 122500.0f, 0.6666667f }, - { 490000.0f, 0.6666667f }, { 1000000.0f, 0.6666667f }, { 10000.0f, 0.94905096f }, { 19600.0f, 0.85714287f }, - { 57600.0f, 0.41666666f }, { 78400.0f, 0.001f }, +#define TARGET_RANGE(range, leash) \ + { SQ(range), (f32)range / leash } + +TargetRangeParams D_80115FF8[] = { + TARGET_RANGE(70, 140), TARGET_RANGE(170, 255), TARGET_RANGE(280, 5600), TARGET_RANGE(350, 525), + TARGET_RANGE(700, 1050), TARGET_RANGE(1000, 1500), TARGET_RANGE(100, 105.36842), TARGET_RANGE(140, 163.33333), + TARGET_RANGE(240, 576), TARGET_RANGE(280, 280000), }; u32 func_8002F090(Actor* actor, f32 arg1) { - return arg1 < D_80115FF8[actor->unk_1F].unk_0; + return arg1 < D_80115FF8[actor->targetMode].rangeSq; } s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { @@ -1455,16 +1462,16 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { } if (!flag) { - var = (s16)(actor->yawTowardsLink - 0x8000) - player->actor.shape.rot.y; + var = (s16)(actor->yawTowardsPlayer - 0x8000) - player->actor.shape.rot.y; abs_var = ABS(var); if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) { dist = FLT_MAX; } else { - dist = actor->xyzDistToLinkSq; + dist = actor->xyzDistToPlayerSq; } - return !func_8002F090(actor, D_80115FF8[actor->unk_1F].unk_4 * dist); + return !func_8002F090(actor, D_80115FF8[actor->targetMode].leashScale * dist); } return 0; @@ -1484,14 +1491,14 @@ s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u3 // This is convoluted but it seems like it must be a single if statement to match if ((player->actor.flags & 0x100) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(globalCtx)) || - ((actor->unk_10C == 0) && - ((arg3 < fabsf(actor->yDistToLink)) || (player->targetActorDistance < actor->xzDistToLink) || - (arg2 < actor->xzDistToLink)))) { + (!actor->isTargeted && + ((arg3 < fabsf(actor->yDistToPlayer)) || (player->targetActorDistance < actor->xzDistToPlayer) || + (arg2 < actor->xzDistToPlayer)))) { return 0; } player->targetActor = actor; - player->targetActorDistance = actor->xzDistToLink; + player->targetActorDistance = actor->xzDistToPlayer; player->exchangeItemId = exchangeItemId; return 1; @@ -1506,7 +1513,7 @@ s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) { } s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) { - f32 var1 = 50.0f + actor->colChkInfo.unk_10; + f32 var1 = 50.0f + actor->colChkInfo.cylRadius; return func_8002F2CC(actor, globalCtx, var1); } @@ -1528,7 +1535,7 @@ void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) Vec3f sp1C; f32 sp18; - func_8002BE04(globalCtx, &actor->posRot2.pos, &sp1C, &sp18); + func_8002BE04(globalCtx, &actor->focus.pos, &sp1C, &sp18); *arg2 = sp1C.x * sp18 * 160.0f + 160.0f; *arg3 = sp1C.y * sp18 * -120.0f + 120.0f; } @@ -1550,8 +1557,8 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) || (!(player->stateFlags1 & 0x20000800))) { - if ((actor->xzDistToLink < xzRange) && (fabsf(actor->yDistToLink) < yRange)) { - yawDiff = actor->yawTowardsLink - player->actor.shape.rot.y; + if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { + yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; absYawDiff = ABS(yawDiff); if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) { player->getItemId = getItemId; @@ -1599,8 +1606,8 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) { void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) { Player* player = PLAYER; - if (actor->xyzDistToLinkSq < player->unk_6A4) { - player->unk_6A4 = actor->xyzDistToLinkSq; + if (actor->xyzDistToPlayerSq < player->unk_6A4) { + player->unk_6A4 = actor->xyzDistToPlayerSq; } } @@ -1676,7 +1683,7 @@ void func_8002F850(GlobalContext* globalCtx, Actor* actor) { sfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG; } } else { - sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource); + sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, actor->floorPoly, actor->floorBgId); } func_80078914(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); @@ -1722,7 +1729,7 @@ void func_8002F994(Actor* actor, s32 arg1) { s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos) { if (func_80041D4C(&globalCtx->colCtx, poly, bgId) == 8) { globalCtx->unk_11D30[0] = 1; - func_8005DFAC(globalCtx, NULL, pos); + CollisionCheck_BlueBlood(globalCtx, NULL, pos); Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO); return true; } @@ -1978,7 +1985,7 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorCtx->absoluteSpace = NULL; Actor_SpawnEntry(actorCtx, actorEntry, globalCtx); - func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorList[ACTORTYPE_PLAYER].first, globalCtx); + func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorLists[ACTORCAT_PLAYER].head, globalCtx); func_8002FA60(globalCtx); } @@ -2025,8 +2032,8 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { if (KREG(0) == -100) { refActor = &PLAYER->actor; KREG(0) = 0; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->posRot.pos.x, - refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->world.pos.x, + refActor->world.pos.y + 100.0f, refActor->world.pos.z, 0, 0, 0, 1); } sp80 = &D_80116068[0]; @@ -2039,13 +2046,13 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { sp74 = player->targetActor; } - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++, sp80++) { unkCondition = (*sp80 & player->stateFlags1); - actor = actorCtx->actorList[i].first; + actor = actorCtx->actorLists[i].head; while (actor != NULL) { - if (actor->posRot.pos.y < -25000.0f) { - actor->posRot.pos.y = -25000.0f; + if (actor->world.pos.y < -25000.0f) { + actor->world.pos.y = -25000.0f; } actor->sfx = 0; @@ -2063,7 +2070,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { } else if ((unkFlag && !(actor->flags & unkFlag)) || (!unkFlag && unkCondition && (sp74 != actor) && (actor != player->naviActor) && (actor != player->heldActor) && (&player->actor != actor->parent))) { - func_80061E8C(&actor->colChkInfo); + CollisionCheck_ResetDamage(&actor->colChkInfo); actor = actor->next; } else if (actor->update == NULL) { if (!actor->isDrawn) { @@ -2073,40 +2080,40 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { actor = actor->next; } } else { - Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos); - actor->xzDistToLink = func_8002DB8C(actor, &player->actor); - actor->yDistToLink = Actor_HeightDiff(actor, &player->actor); - actor->xyzDistToLinkSq = SQ(actor->xzDistToLink) + SQ(actor->yDistToLink); + Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); + actor->xzDistToPlayer = Actor_WorldDistXZToActor(actor, &player->actor); + actor->yDistToPlayer = Actor_HeightDiff(actor, &player->actor); + actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->yDistToPlayer); - actor->yawTowardsLink = func_8002DA78(actor, &player->actor); + actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, &player->actor); actor->flags &= ~0x1000000; if ((DECR(actor->freezeTimer) == 0) && (actor->flags & 0x50)) { if (actor == player->unk_664) { - actor->unk_10C = 1; + actor->isTargeted = true; } else { - actor->unk_10C = 0; + actor->isTargeted = false; } - if ((actor->unk_10D != 0) && (player->unk_664 == NULL)) { - actor->unk_10D = 0; + if ((actor->targetPriority != 0) && (player->unk_664 == NULL)) { + actor->targetPriority = 0; } Actor_SetObjectDependency(globalCtx, actor); - if (actor->dmgEffectTimer != 0) { - actor->dmgEffectTimer--; + if (actor->colorFilterTimer != 0) { + actor->colorFilterTimer--; } actor->update(actor, globalCtx); func_8003F8EC(globalCtx, &globalCtx->colCtx.dyna, actor); } - func_80061E8C(&actor->colChkInfo); + CollisionCheck_ResetDamage(&actor->colChkInfo); actor = actor->next; } } - if (i == ACTORTYPE_BG) { + if (i == ACTORCAT_BG) { DynaPoly_Setup(globalCtx, &globalCtx->colCtx.dyna); } } @@ -2165,17 +2172,17 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx); - Lights_BindAll(lights, globalCtx->lightCtx.listHead, (actor->flags & 0x400000) ? NULL : &actor->posRot.pos); + Lights_BindAll(lights, globalCtx->lightCtx.listHead, (actor->flags & 0x400000) ? NULL : &actor->world.pos); Lights_Draw(lights, globalCtx->state.gfxCtx); if (actor->flags & 0x1000) { - func_800D1694(actor->posRot.pos.x + globalCtx->mainCamera.skyboxOffset.x, - actor->posRot.pos.y + - (f32)((actor->shape.unk_08 * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y), - actor->posRot.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot); + func_800D1694(actor->world.pos.x + globalCtx->mainCamera.skyboxOffset.x, + actor->world.pos.y + + (f32)((actor->shape.yOffset * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y), + actor->world.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot); } else { - func_800D1694(actor->posRot.pos.x, actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y), - actor->posRot.pos.z, &actor->shape.rot); + func_800D1694(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y), + actor->world.pos.z, &actor->shape.rot); } Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); @@ -2184,36 +2191,36 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); gSPSegment(POLY_XLU_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); - if (actor->dmgEffectTimer != 0) { + if (actor->colorFilterTimer != 0) { Color_RGBA8 sp2C = { 0, 0, 0, 255 }; - if (actor->dmgEffectParams & 0x8000) { - sp2C.r = sp2C.g = sp2C.b = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; - } else if (actor->dmgEffectParams & 0x4000) { - sp2C.r = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; + if (actor->colorFilterParams & 0x8000) { + sp2C.r = sp2C.g = sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + } else if (actor->colorFilterParams & 0x4000) { + sp2C.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; } else { - sp2C.b = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; + sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; } - if (actor->dmgEffectParams & 0x2000) { - func_80026860(globalCtx, &sp2C, actor->dmgEffectTimer, actor->dmgEffectParams & 0xFF); + if (actor->colorFilterParams & 0x2000) { + func_80026860(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); } else { - func_80026400(globalCtx, &sp2C, actor->dmgEffectTimer, actor->dmgEffectParams & 0xFF); + func_80026400(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); } } actor->draw(actor, globalCtx); - if (actor->dmgEffectTimer != 0) { - if (actor->dmgEffectParams & 0x2000) { + if (actor->colorFilterTimer != 0) { + if (actor->colorFilterParams & 0x2000) { func_80026A6C(globalCtx); } else { func_80026608(globalCtx); } } - if (actor->shape.shadowDrawFunc != NULL) { - actor->shape.shadowDrawFunc(actor, lights, globalCtx); + if (actor->shape.shadowDraw != NULL) { + actor->shape.shadowDraw(actor, lights, globalCtx); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6119); @@ -2354,10 +2361,10 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6336); - actorListEntry = &actorCtx->actorList[0]; + actorListEntry = &actorCtx->actorLists[0]; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++) { - actor = actorListEntry->first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++, actorListEntry++) { + actor = actorListEntry->head; while (actor != NULL) { ActorOverlay* overlayEntry = actor->overlayEntry; @@ -2369,7 +2376,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { HREG(66) = i; if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) { - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &actor->posRot.pos, &actor->projectedPos, + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &actor->world.pos, &actor->projectedPos, &actor->projectedW); } @@ -2387,7 +2394,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } } - actor->isDrawn = 0; + actor->isDrawn = false; if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) { if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60)) { @@ -2402,7 +2409,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } else { if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(72) == 0)) { Actor_Draw(globalCtx, actor); - actor->isDrawn = 1; + actor->isDrawn = true; } } } @@ -2440,7 +2447,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } if ((HREG(64) != 1) || (HREG(76) != 0)) { - CollisionCheck_Draw(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_DrawCollision(globalCtx, &globalCtx->colChkCtx); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6563); @@ -2450,8 +2457,8 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_Kill(actor); @@ -2461,14 +2468,14 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) { } } -u8 sEnemyActorTypes[] = { ACTORTYPE_ENEMY, ACTORTYPE_BOSS }; +u8 sEnemyActorCategories[] = { ACTORCAT_ENEMY, ACTORCAT_BOSS }; void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 duration) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) { - actor = actorCtx->actorList[sEnemyActorTypes[i]].first; + for (i = 0; i < ARRAY_COUNT(sEnemyActorCategories); i++) { + actor = actorCtx->actorLists[sEnemyActorCategories[i]].head; while (actor != NULL) { actor->freezeTimer = duration; actor = actor->next; @@ -2480,8 +2487,8 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { if ((actor->room >= 0) && (actor->room != globalCtx->roomCtx.curRoom.num) && (actor->room != globalCtx->roomCtx.prevRoom.num)) { @@ -2498,7 +2505,7 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { } } - CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); actorCtx->flags.tempClear = 0; actorCtx->flags.tempSwch &= 0xFFFFFF; globalCtx->msgCtx.unk_E3F4 = 0; @@ -2509,11 +2516,11 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { Actor_Delete(actorCtx, actor, globalCtx); - actor = actorCtx->actorList[i].first; + actor = actorCtx->actorLists[i].head; } } @@ -2533,57 +2540,57 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { } /** - * Adds a given actor instance at the front of the actor list of the specified type. - * Also sets the actor instance as being of that type. + * Adds a given actor instance at the front of the actor list of the specified category. + * Also sets the actor instance as being of that category. */ -void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType) { - Actor* prevFirstActor; +void Actor_AddToCategory(ActorContext* actorCtx, Actor* actorToAdd, u8 actorCategory) { + Actor* prevHead; - actorToAdd->type = actorType; + actorToAdd->category = actorCategory; actorCtx->total++; - actorCtx->actorList[actorType].length++; - prevFirstActor = actorCtx->actorList[actorType].first; + actorCtx->actorLists[actorCategory].length++; + prevHead = actorCtx->actorLists[actorCategory].head; - if (prevFirstActor != NULL) { - prevFirstActor->prev = actorToAdd; + if (prevHead != NULL) { + prevHead->prev = actorToAdd; } - actorCtx->actorList[actorType].first = actorToAdd; - actorToAdd->next = prevFirstActor; + actorCtx->actorLists[actorCategory].head = actorToAdd; + actorToAdd->next = prevHead; } /** * Removes a given actor instance from its actor list. * Also sets the temp clear flag of the current room if the actor removed was the last enemy loaded. */ -Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { - Actor* newFirstActor; +Actor* Actor_RemoveFromCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { + Actor* newHead; actorCtx->total--; - actorCtx->actorList[actorToRemove->type].length--; + actorCtx->actorLists[actorToRemove->category].length--; if (actorToRemove->prev != NULL) { actorToRemove->prev->next = actorToRemove->next; } else { - actorCtx->actorList[actorToRemove->type].first = actorToRemove->next; + actorCtx->actorLists[actorToRemove->category].head = actorToRemove->next; } - newFirstActor = actorToRemove->next; + newHead = actorToRemove->next; - if (newFirstActor != NULL) { - newFirstActor->prev = actorToRemove->prev; + if (newHead != NULL) { + newHead->prev = actorToRemove->prev; } actorToRemove->next = NULL; actorToRemove->prev = NULL; - if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->type == ACTORTYPE_ENEMY) && - (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0)) { + if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->category == ACTORCAT_ENEMY) && + (actorCtx->actorLists[ACTORCAT_ENEMY].length == 0)) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } - return newFirstActor; + return newHead; } void Actor_FreeOverlay(ActorOverlay* actorOverlay) { @@ -2718,7 +2725,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId); if ((objBankIndex < 0) || - ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { + ((actorInit->category == ACTORCAT_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { // Translates to: "NO DATA BANK!! (profilep->bank=%d)" osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objBankIndex, actorInit->objectId); @@ -2764,15 +2771,15 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId actor->update = actorInit->update; actor->draw = actorInit->draw; actor->room = globalCtx->roomCtx.curRoom.num; - actor->initPosRot.pos.x = posX; - actor->initPosRot.pos.y = posY; - actor->initPosRot.pos.z = posZ; - actor->initPosRot.rot.x = rotX; - actor->initPosRot.rot.y = rotY; - actor->initPosRot.rot.z = rotZ; + actor->home.pos.x = posX; + actor->home.pos.y = posY; + actor->home.pos.z = posZ; + actor->home.rot.x = rotX; + actor->home.rot.y = rotY; + actor->home.rot.z = rotZ; actor->params = params; - Actor_AddToTypeList(actorCtx, actor, actorInit->type); + Actor_AddToCategory(actorCtx, actor, actorInit->category); temp = gSegments[6]; Actor_Init(actor, globalCtx); @@ -2834,7 +2841,7 @@ Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalCo Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) { char* name; Player* player; - Actor* newFirstActor; + Actor* newHead; ActorOverlay* overlayEntry; player = PLAYER; @@ -2867,7 +2874,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC func_800F89E8(&actor->projectedPos); Actor_Destroy(actor, globalCtx); - newFirstActor = Actor_RemoveFromTypeList(globalCtx, actorCtx, actor); + newHead = Actor_RemoveFromCategory(globalCtx, actorCtx, actor); ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); @@ -2889,7 +2896,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC Actor_FreeOverlay(overlayEntry); } - return newFirstActor; + return newHead; } s32 func_80032880(GlobalContext* globalCtx, Actor* actor) { @@ -2908,7 +2915,7 @@ f32 D_8015BBF4; s32 D_8015BBF8; s16 D_8015BBFC; -void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType) { +void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorCategory) { f32 var; Actor* actor; Actor* sp84; @@ -2916,27 +2923,27 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla UNK_TYPE sp7C; Vec3f sp70; - actor = actorCtx->actorList[actorType].first; + actor = actorCtx->actorLists[actorCategory].head; sp84 = player->unk_664; while (actor != NULL) { if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1)) { - if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) && (actor->xyzDistToLinkSq < 250000.0f) && - (actor->xyzDistToLinkSq < D_8015BBF4)) { + if ((actorCategory == ACTORCAT_ENEMY) && ((actor->flags & 5) == 5) && + (actor->xyzDistToPlayerSq < 250000.0f) && (actor->xyzDistToPlayerSq < D_8015BBF4)) { actorCtx->targetCtx.unk_90 = actor; - D_8015BBF4 = actor->xyzDistToLinkSq; + D_8015BBF4 = actor->xyzDistToPlayerSq; } if (actor != sp84) { var = func_8002EFC0(actor, player, D_8015BBFC); if ((var < D_8015BBF0) && func_8002F090(actor, var) && func_80032880(globalCtx, actor) && - (!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.posRot2.pos, &actor->posRot2.pos, - &sp70, &sp80, 1, 1, 1, 1, &sp7C) || + (!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.focus.pos, &actor->focus.pos, &sp70, + &sp80, 1, 1, 1, 1, &sp7C) || SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, sp80, sp7C))) { - if (actor->unk_10D != 0) { - if (actor->unk_10D < D_8015BBF8) { + if (actor->targetPriority != 0) { + if (actor->targetPriority < D_8015BBF8) { D_8015BBEC = actor; - D_8015BBF8 = actor->unk_10D; + D_8015BBF8 = actor->targetPriority; } } else { D_8015BBE8 = actor; @@ -2951,8 +2958,8 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla } u8 D_801160A0[] = { - ACTORTYPE_BOSS, ACTORTYPE_ENEMY, ACTORTYPE_BG, ACTORTYPE_EXPLOSIVES, ACTORTYPE_NPC, ACTORTYPE_ITEMACTION, - ACTORTYPE_CHEST, ACTORTYPE_SWITCH, ACTORTYPE_PROP, ACTORTYPE_MISC, ACTORTYPE_DOOR, ACTORTYPE_SWITCH, + ACTORCAT_BOSS, ACTORCAT_ENEMY, ACTORCAT_BG, ACTORCAT_EXPLOSIVE, ACTORCAT_NPC, ACTORCAT_ITEMACTION, + ACTORCAT_CHEST, ACTORCAT_SWITCH, ACTORCAT_PROP, ACTORCAT_MISC, ACTORCAT_DOOR, ACTORCAT_SWITCH, }; Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player) { @@ -2992,10 +2999,10 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a } /** - * Finds the first actor instance of a specified id and type if there is one. + * Finds the first actor instance of a specified ID and category if there is one. */ -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) { - Actor* actor = actorCtx->actorList[actorType].first; +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory) { + Actor* actor = actorCtx->actorLists[actorCategory].head; while (actor != NULL) { if (actorId == actor->id) { @@ -3009,7 +3016,7 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) { void func_80032C7C(GlobalContext* globalCtx, Actor* actor) { globalCtx->actorCtx.unk_00 = 5; - Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 20, NA_SE_EN_LAST_DAMAGE); + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); } s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { @@ -3152,7 +3159,7 @@ void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3 s32 i; var = (Rand_ZeroOne() - 0.5f) * 6.28f; - pos.y = actor->groundY; + pos.y = actor->floorHeight; accel.y += (Rand_ZeroOne() - 0.5f) * 0.2f; for (i = arg4; i >= 0; i--) { @@ -3198,8 +3205,8 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 } Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider) { - if ((collider->acFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) { - collider->acFlags &= ~0x2; + if ((collider->acFlags & AC_HIT) && (collider->ac->category == ACTORCAT_EXPLOSIVE)) { + collider->acFlags &= ~AC_HIT; return collider->ac; } @@ -3207,13 +3214,13 @@ Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider) } Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (actor != NULL) { if ((actor == explosiveActor) || (actor->params != 1)) { actor = actor->next; } else { - if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) { + if (Actor_WorldDistXYZToActor(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) { return actor; } else { actor = actor->next; @@ -3225,12 +3232,12 @@ Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) { } /** - * Dynamically changes the type of a given actor instance. - * This is done by moving it to the corresponding type list and setting its type variable accordingly. + * Dynamically changes the category of a given actor instance. + * This is done by moving it to the corresponding category list and setting its category variable accordingly. */ -void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType) { - Actor_RemoveFromTypeList(globalCtx, actorCtx, actor); - Actor_AddToTypeList(actorCtx, actor, actorType); +void Actor_ChangeCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory) { + Actor_RemoveFromCategory(globalCtx, actorCtx, actor); + Actor_AddToCategory(actorCtx, actor, actorCategory); } typedef struct { @@ -3249,26 +3256,27 @@ Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) { Vec3f sp84; Actor* actor; - actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (actor != NULL) { if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor)) { actor = actor->next; } else { itemActor = (Actor_80033780*)actor; - if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) || + if ((arg2 < Math_Vec3f_DistXYZ(&refActor->world.pos, &itemActor->actor.world.pos)) || (itemActor->unk_210 == 0)) { actor = actor->next; } else { - deltaX = Math_SinS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); + deltaX = Math_SinS(itemActor->actor.world.rot.y) * (itemActor->actor.speedXZ * 10.0f); deltaY = itemActor->actor.velocity.y + (itemActor->actor.gravity * 10.0f); - deltaZ = Math_CosS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); + deltaZ = Math_CosS(itemActor->actor.world.rot.y) * (itemActor->actor.speedXZ * 10.0f); - spA8.x = itemActor->actor.posRot.pos.x + deltaX; - spA8.y = itemActor->actor.posRot.pos.y + deltaY; - spA8.z = itemActor->actor.posRot.pos.z + deltaZ; + spA8.x = itemActor->actor.world.pos.x + deltaX; + spA8.y = itemActor->actor.world.pos.y + deltaY; + spA8.z = itemActor->actor.world.pos.z + deltaZ; - if (func_80062ECC(refActor->colChkInfo.unk_10, refActor->colChkInfo.unk_12, 0.0f, &refActor->posRot.pos, - &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84)) { + if (CollisionCheck_CylSideVsLineSeg(refActor->colChkInfo.cylRadius, refActor->colChkInfo.cylHeight, + 0.0f, &refActor->world.pos, &itemActor->actor.world.pos, &spA8, + &sp90, &sp84)) { return &itemActor->actor; } else { actor = actor->next; @@ -3367,14 +3375,14 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) { f32 sp3C; Vec3f sp30; - Math_Vec3f_Copy(&sp30, &actor->posRot.pos); + Math_Vec3f_Copy(&sp30, &actor->world.pos); sp44 = actor->bgCheckFlags; sp40 = Math_SinS(arg3) * arg2; sp3C = Math_CosS(arg3) * arg2; - actor->posRot.pos.x += sp40; - actor->posRot.pos.z += sp3C; - func_8002E4B4(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4); - Math_Vec3f_Copy(&actor->posRot.pos, &sp30); + actor->world.pos.x += sp40; + actor->world.pos.z += sp3C; + Actor_UpdateBgCheckInfo(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4); + Math_Vec3f_Copy(&actor->world.pos, &sp30); ret = actor->bgCheckFlags & 1; actor->bgCheckFlags = sp44; @@ -3385,7 +3393,7 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) { s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) { + if ((player->stateFlags1 & 0x10) && actor->isTargeted) { return 1; } else { return 0; @@ -3395,7 +3403,7 @@ s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) { s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) { + if ((player->stateFlags1 & 0x10) && !actor->isTargeted) { return 1; } else { return 0; @@ -3470,9 +3478,9 @@ void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) { void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) { if (arg2 >= 5) { - func_800AA000(actor->xyzDistToLinkSq, 0xFF, 0x14, 0x96); + func_800AA000(actor->xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } else { - func_800AA000(actor->xyzDistToLinkSq, 0xB4, 0x14, 0x64); + func_800AA000(actor->xyzDistToPlayerSq, 0xB4, 0x14, 0x64); } func_80033DB8(globalCtx, arg2, arg3); @@ -3555,7 +3563,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { } void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1) { - func_80062D60(globalCtx, arg1); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, arg1); } void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { @@ -3563,8 +3571,8 @@ void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT); } - actor->dmgEffectParams = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4; - actor->dmgEffectTimer = arg4; + actor->colorFilterParams = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4; + actor->colorFilterTimer = arg4; } Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) { @@ -3660,13 +3668,13 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 temp1; Vec3f sp30; - sp30.x = actor->posRot.pos.x; - sp30.y = actor->posRot.pos.y + arg1->unk_14; - sp30.z = actor->posRot.pos.z; + sp30.x = actor->world.pos.x; + sp30.y = actor->world.pos.y + arg1->unk_14; + sp30.z = actor->world.pos.z; sp46 = Math_Vec3f_Pitch(&sp30, &arg1->unk_18); sp44 = Math_Vec3f_Yaw(&sp30, &arg1->unk_18); - sp40 = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18) - actor->shape.rot.y; + sp40 = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18) - actor->shape.rot.y; temp1 = CLAMP(sp40, -arg2, arg2); Math_SmoothStepToS(&arg1->unk_08.y, temp1, 6, 2000, 1); @@ -3716,13 +3724,13 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, return 4; } - if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18)) { + if (arg2 < Math_Vec3f_DistXYZ(&actor->world.pos, &arg1->unk_18)) { arg1->unk_04 = 0; arg1->unk_06 = 0; return 1; } - var = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18); + var = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18); abs_var = ABS((s16)((f32)var - actor->shape.rot.y)); if (arg3 >= abs_var) { arg1->unk_04 = 0; @@ -3835,9 +3843,9 @@ s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) { f32 var; if ((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) { - var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &globalCtx->view.eye) * 0.25f; + var = Math_Vec3f_DistXYZ(&actor->world.pos, &globalCtx->view.eye) * 0.25f; } else { - var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &player->actor.posRot.pos); + var = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); } if (arg3 < var) { @@ -3903,7 +3911,8 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) { break; } - func_8002E4B4(globalCtx, actor, actor->colChkInfo.unk_12, actor->colChkInfo.unk_10, actor->colChkInfo.unk_10, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, actor, actor->colChkInfo.cylHeight, actor->colChkInfo.cylRadius, + actor->colChkInfo.cylRadius, 0x1D); return ret; } @@ -3917,17 +3926,18 @@ u8 func_800353E8(GlobalContext* globalCtx) { } /** - * Finds the first actor instance of a specified id and type within a given range from an actor if there is one. - * If the id provided is -1, this will look for any actor of the specified type rather than a specific id. + * Finds the first actor instance of a specified ID and category within a given range from + * an actor if there is one. If the ID provided is -1, this will look for any actor of the + * specified category rather than a specific ID. */ -Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range) { - Actor* actor = globalCtx->actorCtx.actorList[actorType].first; +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorCategory, f32 range) { + Actor* actor = globalCtx->actorCtx.actorLists[actorCategory].head; while (actor != NULL) { if (actor == refActor || ((actorId != -1) && (actorId != actor->id))) { actor = actor->next; } else { - if (func_8002DB48(refActor, actor) <= range) { + if (Actor_WorldDistXYZToActor(refActor, actor) <= range) { return actor; } else { actor = actor->next; @@ -3943,10 +3953,10 @@ s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s s16 var1; s16 var2; - var1 = (s16)(actor->yawTowardsLink + 0x8000) - player->actor.shape.rot.y; - var2 = actor->yawTowardsLink - arg5; + var1 = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y; + var2 = actor->yawTowardsPlayer - arg5; - if ((actor->xzDistToLink <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) { + if ((actor->xzDistToPlayer <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) { return 1; } else { return 0; @@ -3985,7 +3995,7 @@ void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) { u8 func_800355E4(GlobalContext* globalCtx, Collider* collider) { Player* player = PLAYER; - if ((collider->acFlags & 0x08) && (player->swordState != 0) && (player->swordAnimation == 0x16)) { + if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) { return 1; } else { return 0; @@ -4002,69 +4012,69 @@ u8 Actor_ApplyDamage(Actor* actor) { return actor->colChkInfo.health; } -void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) { - if (colBody->acHitItem == NULL) { - actor->unk_116 = 0x00; - } else if (freezeFlag && (colBody->acHitItem->toucher.flags & 0x10060000)) { - actor->freezeTimer = colBody->acHitItem->toucher.damage; - actor->unk_116 = 0x00; - } else if (colBody->acHitItem->toucher.flags & 0x0800) { - actor->unk_116 = 0x01; - } else if (colBody->acHitItem->toucher.flags & 0x1000) { - actor->unk_116 = 0x02; - } else if (colBody->acHitItem->toucher.flags & 0x4000) { - actor->unk_116 = 0x04; - } else if (colBody->acHitItem->toucher.flags & 0x8000) { - actor->unk_116 = 0x08; - } else if (colBody->acHitItem->toucher.flags & 0x10000) { - actor->unk_116 = 0x10; - } else if (colBody->acHitItem->toucher.flags & 0x2000) { - actor->unk_116 = 0x20; - } else if (colBody->acHitItem->toucher.flags & 0x80000) { +void func_80035650(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) { + if (colInfo->acHitInfo == NULL) { + actor->dropFlag = 0x00; + } else if (freezeFlag && (colInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) { + actor->freezeTimer = colInfo->acHitInfo->toucher.damage; + actor->dropFlag = 0x00; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x0800) { + actor->dropFlag = 0x01; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x1000) { + actor->dropFlag = 0x02; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x4000) { + actor->dropFlag = 0x04; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x8000) { + actor->dropFlag = 0x08; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x10000) { + actor->dropFlag = 0x10; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x2000) { + actor->dropFlag = 0x20; + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x80000) { if (freezeFlag) { - actor->freezeTimer = colBody->acHitItem->toucher.damage; + actor->freezeTimer = colInfo->acHitInfo->toucher.damage; } - actor->unk_116 = 0x40; + actor->dropFlag = 0x40; } else { - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; } } void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) { - ColliderBody* curColBody; + ColliderInfo* curColInfo; s32 flag; s32 i; - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; for (i = jntSph->count - 1; i >= 0; i--) { - curColBody = &jntSph->list[i].body; - if (curColBody->acHitItem == NULL) { + curColInfo = &jntSph->elements[i].info; + if (curColInfo->acHitInfo == NULL) { flag = 0x00; - } else if (freezeFlag && (curColBody->acHitItem->toucher.flags & 0x10060000)) { - actor->freezeTimer = curColBody->acHitItem->toucher.damage; + } else if (freezeFlag && (curColInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) { + actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; flag = 0x00; - } else if (curColBody->acHitItem->toucher.flags & 0x0800) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x0800) { flag = 0x01; - } else if (curColBody->acHitItem->toucher.flags & 0x1000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x1000) { flag = 0x02; - } else if (curColBody->acHitItem->toucher.flags & 0x4000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x4000) { flag = 0x04; - } else if (curColBody->acHitItem->toucher.flags & 0x8000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x8000) { flag = 0x08; - } else if (curColBody->acHitItem->toucher.flags & 0x10000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x10000) { flag = 0x10; - } else if (curColBody->acHitItem->toucher.flags & 0x2000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x2000) { flag = 0x20; - } else if (curColBody->acHitItem->toucher.flags & 0x80000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x80000) { if (freezeFlag) { - actor->freezeTimer = curColBody->acHitItem->toucher.damage; + actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; } flag = 0x40; } else { flag = 0x00; } - actor->unk_116 |= flag; + actor->dropFlag |= flag; } } @@ -5411,18 +5421,18 @@ s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) { return 0; } - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { return 0; } - if ((actor->xyzDistToLinkSq > 25600.0f) && (actor->unk_10C == 0)) { + if ((actor->xyzDistToPlayerSq > 25600.0f) && !actor->isTargeted) { return 0; } - if (actor->xyzDistToLinkSq <= 6400.0f) { + if (actor->xyzDistToPlayerSq <= 6400.0f) { if (func_8002F2CC(actor, globalCtx, 80.0f)) { actor->textId = func_80037C30(globalCtx, arg2); } @@ -5448,8 +5458,8 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) { s16 sp34; s16 var; - sp36 = Math_Vec3f_Pitch(&actor->posRot2.pos, arg1); - sp34 = Math_Vec3f_Yaw(&actor->posRot2.pos, arg1) - actor->posRot.rot.y; + sp36 = Math_Vec3f_Pitch(&actor->focus.pos, arg1); + sp34 = Math_Vec3f_Yaw(&actor->focus.pos, arg1) - actor->world.rot.y; Math_SmoothStepToS(&arg2->x, sp36, 6, 2000, 1); arg2->x = (arg2->x < -6000) ? -6000 : ((arg2->x > 6000) ? 6000 : arg2->x); @@ -5474,11 +5484,11 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar s16 var; s16 abs_var; - actor->posRot2.pos = actor->posRot.pos; - actor->posRot2.pos.y += arg4; + actor->focus.pos = actor->world.pos; + actor->focus.pos.y += arg4; if (!(((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); @@ -5489,7 +5499,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar if (((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp2C = globalCtx->view.eye; } else { - sp2C = player->actor.posRot2.pos; + sp2C = player->actor.focus.pos; } func_80037FC8(actor, &sp2C, arg2, arg3); @@ -5504,10 +5514,10 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar s16 var; s16 abs_var; - actor->posRot2.pos = arg4; + actor->focus.pos = arg4; if (!(((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); @@ -5518,7 +5528,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar if (((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp24 = globalCtx->view.eye; } else { - sp24 = player->actor.posRot2.pos; + sp24 = player->actor.focus.pos; } func_80037FC8(actor, &sp24, arg2, arg3); diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 2f6778f509..d5f03badcb 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -2507,10 +2507,10 @@ void BgActor_SetActor(BgActor* bgActor, Actor* actor, CollisionHeader* colHeader bgActor->prevTransform.scale = actor->scale; bgActor->prevTransform.rot = actor->shape.rot; bgActor->prevTransform.rot.x--; - bgActor->prevTransform.pos = actor->posRot.pos; + bgActor->prevTransform.pos = actor->world.pos; bgActor->curTransform.scale = actor->scale; bgActor->curTransform.rot = actor->shape.rot; - bgActor->curTransform.pos = actor->posRot.pos; + bgActor->curTransform.pos = actor->world.pos; } /** @@ -2742,8 +2742,8 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3 actor = dyna->bgActors[bgId].actor; dyna->bgActors[bgId].dynaLookup.polyStartIndex = *polyStartIndex; dyna->bgActors[bgId].vtxStartIndex = *vtxStartIndex; - pos = actor->posRot.pos; - pos.y += actor->shape.unk_08 * actor->scale.y; + pos = actor->world.pos; + pos.y += actor->shape.yOffset * actor->scale.y; ScaleRotPos_SetValue(&dyna->bgActors[bgId].curTransform, &actor->scale, &actor->shape.rot, &pos); @@ -4390,7 +4390,7 @@ void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx vC.y += AREG(26) * ny; vC.z += AREG(26) * nz; } - func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); + Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); if (curNode->next == SS_NULL) { break; } @@ -4461,7 +4461,7 @@ void BgCheck_DrawStaticPoly(GlobalContext* globalCtx, CollisionContext* colCtx, vC.y += AREG(26) * ny; vC.z += AREG(26) * nz; } - func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); + Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); } /** @@ -4494,7 +4494,7 @@ void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* col StaticLookup* lookup; player = PLAYER; - lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.posRot.pos); + lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos); if (AREG(23) != 0) { BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->floor, 0, 0, 255); } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 4f56fdf806..3c3666a72d 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -459,7 +459,7 @@ s32 Camera_GetDataIdxForPoly(Camera* camera, u32* bgId, CollisionPoly* poly) { PosRot playerPosRot; s32 ret; - func_8002EF44(&playerPosRot, &camera->player->actor); // unused. + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); // unused. camDataIdx = SurfaceType_GetCamDataIndex(&camera->globalCtx->colCtx, poly, *bgId); if (func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) { @@ -481,7 +481,7 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) { s32 bgId; PosRot playerPosShape; - func_8002EF44(&playerPosShape, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); playerPosShape.pos.y += Player_GetHeight(camera->player); if (BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) { @@ -503,7 +503,7 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) { WaterBox* waterBox; s32 ret; - func_8002EF44(&playerPosShape, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); *waterY = playerPosShape.pos.y; if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, @@ -538,7 +538,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) { f32 waterY; WaterBox* waterBox; - func_8002EF44(&playerPosRot, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); waterY = playerPosRot.pos.y; if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, chkPos->x, chkPos->z, &waterY, @@ -1184,7 +1184,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecSph* eyeAtDir, f32 yOffset, f32* yP playerHeight = Player_GetHeight(camera->player); player = camera->player; - func_8002EF44(&horsePosRot, player->rideActor); + Actor_GetWorldPosShapeRot(&horsePosRot, player->rideActor); if (EN_HORSE_CHECK_5((EnHorse*)player->rideActor)) { horsePosRot.pos.y -= 49.f; @@ -2171,7 +2171,7 @@ s32 Camera_Jump1(Camera* camera) { VecSph eyeDiffSph; VecSph eyeDiffTarget; PosRot* playerPosRot = &camera->playerPosRot; - PosRot playerPosRot2; + PosRot playerhead; s16 tangle; Jump1* jump1 = (Jump1*)camera->paramData; Jump1Anim* anim = &jump1->anim; @@ -2196,8 +2196,8 @@ s32 Camera_Jump1(Camera* camera) { Camera_CopyPREGToModeValues(camera); } - // playerPosRot2 never gets used. - func_8002EEE4(&playerPosRot2, &camera->player->actor); + // playerhead never gets used. + Actor_GetFocus(&playerhead, &camera->player->actor); OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, at, eye); OLib_Vec3fDiffToVecSphGeo(&eyeNextAtOffset, at, eyeNext); @@ -2506,7 +2506,7 @@ s32 Camera_Jump3(Camera* camera) { f32 phi_f0; f32 phi_f2; f32 playerHeight; - PosRot playerPosRot2; + PosRot playerhead; f32 yNormal; f32 temp_f18; s32 modeSwitch; @@ -2514,7 +2514,7 @@ s32 Camera_Jump3(Camera* camera) { Jump3Anim* anim = &jump3->anim; playerHeight = Player_GetHeight(camera->player); - func_8002EEE4(&playerPosRot2, &camera->player->actor); + Actor_GetFocus(&playerhead, &camera->player->actor); modeSwitch = false; if (((camera->waterYPos - eye->y) < OREG(44) || (camera->animState == 0))) { @@ -2611,10 +2611,10 @@ s32 Camera_Jump3(Camera* camera) { } if (!(phi_f0 < 10.0f)) { - if (camera->waterYPos <= playerPosRot2.pos.y) { - phi_f2 = playerPosRot2.pos.y - camera->waterYPos; + if (camera->waterYPos <= playerhead.pos.y) { + phi_f2 = playerhead.pos.y - camera->waterYPos; } else { - phi_f2 = -(playerPosRot2.pos.y - camera->waterYPos); + phi_f2 = -(playerhead.pos.y - camera->waterYPos); } if (!(phi_f2 < 50.0f)) { camera->pitchUpdateRateInv = 100.0f; @@ -2829,7 +2829,7 @@ s32 Camera_Battle1(Camera* camera) { camera->atLERPStepScale = Camera_ClampLERPScale(camera, isOffGround ? batt1->atLERPScaleOffGround : batt1->atLERPScaleOnGround); } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); if (anim->target != camera->target) { osSyncPrintf("camera: battle: change target %d -> " VT_FGCOL(BLUE) "%d" VT_RST "\n", anim->target->id, camera->target->id); @@ -3108,17 +3108,17 @@ s32 Camera_KeepOn1(Camera* camera) { switch (camera->paramFlags & 0x18) { case 8: - if ((camera->player->actor.type == 2) && (camera->player->interactRangeActor == camera->target)) { + if ((camera->player->actor.category == 2) && (camera->player->interactRangeActor == camera->target)) { PosRot sp54; - func_8002EEE4(&sp54, &camera->player->actor); + Actor_GetFocus(&sp54, &camera->player->actor); spC8.r = 60.0f; spC8.yaw = camera->playerPosRot.rot.y; spC8.pitch = 0x2EE0; Camera_Vec3fVecSphGeoAdd(&camera->targetPosRot.pos, &sp54.pos, &spC8); } else { - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); if (anim->unk_0C != camera->target) { anim->unk_0C = camera->target; camera->atLERPStepScale = 0.0f; @@ -3324,8 +3324,8 @@ s32 Camera_KeepOn3(Camera* camera) { playerHeight += keep3->yOffset; OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye); OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext); - func_8002EEE4(&camera->targetPosRot, camera->target); - func_8002EEE4(&playerPosRot, &camera->player->actor); + Actor_GetFocus(&camera->targetPosRot, camera->target); + Actor_GetFocus(&playerPosRot, &camera->player->actor); playerHeadPos = camPlayerPosRot->pos; playerHeadPos.y += playerHeight; OLib_Vec3fDiffToVecSphGeo(&targetToPlayerDir, &playerHeadPos, &camera->targetPosRot.pos); @@ -3382,8 +3382,8 @@ s32 Camera_KeepOn3(Camera* camera) { Camera_Vec3fVecSphGeoAdd(&lineChkPointB, &anim->atTarget, &atToEyeAdj); if (!(keep3->flags & 0x80)) { while (i < angleCnt) { - if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget, &lineChkPointB, - &colChkActors, 2) && + if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget, + &lineChkPointB, &colChkActors, 2) && !Camera_BGCheck(camera, &anim->atTarget, &lineChkPointB)) { break; } @@ -3470,7 +3470,7 @@ s32 Camera_KeepOn4(Camera* camera) { s16 angleCnt; s32 i; - player = (Player*)camera->globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first; + player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head; if (camera->animState == 0 || camera->animState == 0xA || camera->animState == 0x14) { if (camera->globalCtx->view.unk_124 == 0) { @@ -3634,7 +3634,7 @@ s32 Camera_KeepOn4(Camera* camera) { } else if ((keep4->unk_1C & 8) && camera->target != NULL) { PosRot sp60; - func_8002EF44(&sp60, camera->target); + Actor_GetWorldPosShapeRot(&sp60, camera->target); spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x; spA0 = BINANG_SUB(BINANG_ROT180(sp60.rot.y), spA8.yaw) > 0 ? BINANG_ROT180(sp60.rot.y) + DEGF_TO_BINANG(keep4->unk_0C) @@ -3644,7 +3644,7 @@ s32 Camera_KeepOn4(Camera* camera) { } else if ((keep4->unk_1C & 0x80) && camera->target != NULL) { PosRot sp4C; - func_8002EF14(&sp4C, camera->target); + Actor_GetWorld(&sp4C, camera->target); spA2 = DEGF_TO_BINANG(keep4->unk_08); sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos); spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + DEGF_TO_BINANG(keep4->unk_0C) @@ -3666,8 +3666,8 @@ s32 Camera_KeepOn4(Camera* camera) { if (!(keep4->unk_1C & 1)) { angleCnt = ARRAY_COUNT(D_8011D3B0); for (i = 0; i < angleCnt; i++) { - if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50, &D_8015BD70, spCC, - sp9C) && + if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50, + &D_8015BD70, spCC, sp9C) && !Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) { break; } @@ -3786,7 +3786,7 @@ s32 Camera_KeepOn0(Camera* camera) { return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, eye, at); OLib_Vec3fDiffToVecSphGeo(&eyeTargetPosOffset, eye, &camera->targetPosRot.pos); @@ -4144,7 +4144,7 @@ s32 Camera_Subj3(Camera* camera) { Vec3f* pad2; f32 playerHeight; - func_8002EEE4(&sp60, &camera->player->actor); + Actor_GetFocus(&sp60, &camera->player->actor); playerHeight = Player_GetHeight(camera->player); if (camera->globalCtx->view.unk_124 == 0) { @@ -4280,7 +4280,7 @@ s32 Camera_Subj4(Camera* camera) { return true; } - func_8002EF44(&sp6C, &camera->player->actor); + Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor); OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eye); sCameraInterfaceFlags = subj4->interfaceFlags; @@ -4333,7 +4333,7 @@ s32 Camera_Subj4(Camera* camera) { return false; } - func_8002EF44(&sp6C, &camera->player->actor); + Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor); Math3D_LineClosestToPoint(&anim->unk_00, &sp6C.pos, eyeNext); at->x = eyeNext->x + anim->unk_00.b.x; at->y = eyeNext->y + anim->unk_00.b.y; @@ -4358,8 +4358,8 @@ s32 Camera_Subj4(Camera* camera) { } anim->unk_28 = temp_f16; - camera->player->actor.posRot.pos = *eyeNext; - camera->player->actor.posRot.pos.y = camera->playerGroundY; + camera->player->actor.world.pos = *eyeNext; + camera->player->actor.world.pos.y = camera->playerGroundY; camera->player->actor.shape.rot.y = sp64.yaw; temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f)); temp_a0 = temp_f16 + anim->unk_30; @@ -4478,7 +4478,7 @@ s32 Camera_Unique1(Camera* camera) { VecSph eyeAtOffset; VecSph eyeNextAtOffset; PosRot* playerPosRot = &camera->playerPosRot; - PosRot playerPosRot2; + PosRot playerhead; Unique1* uniq1 = (Unique1*)camera->paramData; Unique1Anim* anim = &uniq1->anim; s32 pad; @@ -4522,7 +4522,7 @@ s32 Camera_Unique1(Camera* camera) { camera->animState++; } - func_8002EEE4(&playerPosRot2, &camera->player->actor); // unused + Actor_GetFocus(&playerhead, &camera->player->actor); // unused camera->yawUpdateRateInv = Camera_LERPCeilF(100.0f, camera->yawUpdateRateInv, OREG(25) * 0.01f, 0.1f); camera->pitchUpdateRateInv = Camera_LERPCeilF(100.0f, camera->pitchUpdateRateInv, OREG(25) * 0.01f, 0.1f); @@ -5001,8 +5001,8 @@ s32 Camera_Unique9(Camera* camera) { s16 atInitFlags; s16 eyeInitFlags; s16 pad2; - PosRot targetPosRot2; - PosRot playerPosRot2; + PosRot targethead; + PosRot playerhead; PosRot playerPosRot; Vec3f* eyeNext = &camera->eyeNext; Vec3f* at = &camera->at; @@ -5028,7 +5028,7 @@ s32 Camera_Unique9(Camera* camera) { sCameraInterfaceFlags = uniq9->interfaceFlags; - func_8002EF14(&playerPosRot, &camera->player->actor); + Actor_GetWorld(&playerPosRot, &camera->player->actor); if (camera->animState == 0) { camera->animState++; @@ -5094,11 +5094,11 @@ s32 Camera_Unique9(Camera* camera) { } } else if (atInitFlags == 4 || atInitFlags == 0x84) { if (camera->target != NULL && camera->target->update != NULL) { - func_8002EEE4(&targetPosRot2, camera->target); - func_8002EEE4(&playerPosRot2, &camera->player->actor); - playerPosRot2.pos.x = playerPosRot.pos.x; - playerPosRot2.pos.z = playerPosRot.pos.z; - OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos); + Actor_GetFocus(&targethead, camera->target); + Actor_GetFocus(&playerhead, &camera->player->actor); + playerhead.pos.x = playerPosRot.pos.x; + playerhead.pos.z = playerPosRot.pos.z; + OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); if (atInitFlags & (s16)0x8080) { scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.x); scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.y); @@ -5108,7 +5108,7 @@ s32 Camera_Unique9(Camera* camera) { } scratchSph.yaw += playerTargetOffset.yaw; scratchSph.pitch += playerTargetOffset.pitch; - Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targetPosRot2.pos, &scratchSph); + Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targethead.pos, &scratchSph); } else { if (camera->target == NULL) { osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: demo C: actor is not valid\n" VT_RST); @@ -5130,14 +5130,14 @@ s32 Camera_Unique9(Camera* camera) { if (focusActor != NULL) { if ((atInitFlags & 0xF) == 1) { - // posRot2 - func_8002EEE4(&atFocusPosRot, focusActor); + // head + Actor_GetFocus(&atFocusPosRot, focusActor); } else if ((atInitFlags & 0xF) == 2) { - // posRot - func_8002EF14(&atFocusPosRot, focusActor); + // world + Actor_GetWorld(&atFocusPosRot, focusActor); } else { - // posRot, shape rot - func_8002EF44(&atFocusPosRot, focusActor); + // world, shape rot + Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor); } if (atInitFlags & (s16)0x8080) { @@ -5181,13 +5181,13 @@ s32 Camera_Unique9(Camera* camera) { if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 || eyeInitFlags == (s16)0x8500) { if (camera->target != NULL && camera->target->update != NULL) { - func_8002EEE4(&targetPosRot2, camera->target); - func_8002EEE4(&playerPosRot2, &camera->player->actor); - playerPosRot2.pos.x = playerPosRot.pos.x; - playerPosRot2.pos.z = playerPosRot.pos.z; - OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos); + Actor_GetFocus(&targethead, camera->target); + Actor_GetFocus(&playerhead, &camera->player->actor); + playerhead.pos.x = playerPosRot.pos.x; + playerhead.pos.z = playerPosRot.pos.z; + OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) { - eyeLookAtPos = targetPosRot2.pos; + eyeLookAtPos = targethead.pos; } else { eyeLookAtPos = anim->atTarget; } @@ -5224,14 +5224,14 @@ s32 Camera_Unique9(Camera* camera) { if (focusActor != NULL) { if ((eyeInitFlags & 0xF00) == 0x100) { - // posRot2 - func_8002EEE4(&eyeFocusPosRot, focusActor); + // head + Actor_GetFocus(&eyeFocusPosRot, focusActor); } else if ((eyeInitFlags & 0xF00) == 0x200) { - // posRot - func_8002EF14(&eyeFocusPosRot, focusActor); + // world + Actor_GetWorld(&eyeFocusPosRot, focusActor); } else { - // posRot, shapeRot - func_8002EF44(&eyeFocusPosRot, focusActor); + // world, shapeRot + Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor); } if (eyeInitFlags & (s16)0x8080) { @@ -5436,10 +5436,10 @@ s32 Camera_Unique9(Camera* camera) { if (anim->curKeyFrame->actionFlags & 0x40) { // Set the player's position - camera->player->actor.posRot.pos.x = anim->playerPos.x; - camera->player->actor.posRot.pos.z = anim->playerPos.z; + camera->player->actor.world.pos.x = anim->playerPos.x; + camera->player->actor.world.pos.z = anim->playerPos.z; if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) { - camera->player->actor.posRot.pos.y = anim->playerPos.y; + camera->player->actor.world.pos.y = anim->playerPos.y; } } else { anim->playerPos.x = playerPosRot.pos.x; @@ -5555,7 +5555,7 @@ s32 Camera_Demo1(Camera* camera) { // if the camera is set to be relative to the player, move the interpolated points // relative to the player's position if (camera->player != NULL && camera->player->actor.update != NULL) { - func_8002EF14(&curPlayerPosRot, &camera->player->actor); + Actor_GetWorld(&curPlayerPosRot, &camera->player->actor); Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext); Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at); } else { @@ -5811,8 +5811,8 @@ s32 Camera_Demo5(Camera* camera) { VecSph playerTargetGeo; VecSph eyePlayerGeo; VecSph sp78; - PosRot playerPosRot2; - PosRot targetPosRot2; + PosRot playerhead; + PosRot targethead; Player* player; s16 sp4A; s32 pad; @@ -5820,7 +5820,7 @@ s32 Camera_Demo5(Camera* camera) { s16 t; s32 pad2; - func_8002EEE4(&playerPosRot2, &camera->player->actor); + Actor_GetFocus(&playerhead, &camera->player->actor); player = camera->player; sCameraInterfaceFlags = 0x3200; if ((camera->target == NULL) || (camera->target->update == NULL)) { @@ -5830,14 +5830,14 @@ s32 Camera_Demo5(Camera* camera) { camera->target = NULL; return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); OLib_Vec3fDiffToVecSphGeo(&playerTargetGeo, &camera->targetPosRot.pos, &camera->playerPosRot.pos); - D_8011D3AC = camera->target->type; + D_8011D3AC = camera->target->category; func_8002F374(camera->globalCtx, camera->target, &sp78.yaw, &sp78.pitch); eyeTargetDist = OLib_Vec3fDist(&camera->targetPosRot.pos, &camera->eye); - OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerPosRot2.pos, &camera->eyeNext); + OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerhead.pos, &camera->eyeNext); sp4A = eyePlayerGeo.yaw - playerTargetGeo.yaw; - if (camera->target->type == ACTORTYPE_PLAYER) { + if (camera->target->category == ACTORCAT_PLAYER) { // camera is targeting a(the) player actor if (eyePlayerGeo.r > 30.0f) { D_8011D6AC[1].timerInit = camera->timer - 1; @@ -5925,7 +5925,7 @@ s32 Camera_Demo5(Camera* camera) { camera->timer += D_8011D8DC[1].timerInit + D_8011D8DC[2].timerInit; } } - } else if (camera->target->type == ACTORTYPE_DOOR) { + } else if (camera->target->category == ACTORCAT_DOOR) { // the target is a door. D_8011D954[0].timerInit = camera->timer - 5; sp4A = 0; @@ -5945,10 +5945,10 @@ s32 Camera_Demo5(Camera* camera) { temp_v0 = Rand_ZeroOne() * (sp90 * -0.2f); D_8011D954[1].rollTargetInit = temp_v0; D_8011D954[0].rollTargetInit = temp_v0; - func_8002EEE4(&targetPosRot2, camera->target); - targetPosRot2.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A)); - targetPosRot2.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A)); - if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) { + Actor_GetFocus(&targethead, camera->target); + targethead.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A)); + targethead.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A)); + if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) { D_8011D954[1].actionFlags = 0xC1; D_8011D954[2].actionFlags = 0x8F; } else { @@ -5971,8 +5971,8 @@ s32 Camera_Demo5(Camera* camera) { } Player_GetHeight(camera->player); D_8011D9F4[0].timerInit = camera->timer; - func_8002EEE4(&targetPosRot2, camera->target); - if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) { + Actor_GetFocus(&targethead, camera->target); + if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) { D_8011D9F4[1].timerInit = 4; D_8011D9F4[1].actionFlags = 0x8F; } else { @@ -6006,8 +6006,8 @@ s32 Camera_Demo5(Camera* camera) { // env frozen player->actor.freezeTimer = camera->timer; } else { - sp4A = playerPosRot2.rot.y - playerTargetGeo.yaw; - if (camera->target->type == ACTORTYPE_PLAYER) { + sp4A = playerhead.rot.y - playerTargetGeo.yaw; + if (camera->target->category == ACTORCAT_PLAYER) { pad = camera->globalCtx->state.frames - sDemo5PrevAction12Frame; if (player->stateFlags1 & 0x800) { // holding object over head. @@ -6063,7 +6063,7 @@ s32 Camera_Demo6(Camera* camera) { // initalizes the camera state. anim->animTimer = 0; camera->fov = 60.0f; - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); camera->at.x = focusPosRot.pos.x; camera->at.y = focusPosRot.pos.y + 20.0f; camera->at.z = focusPosRot.pos.z; @@ -6078,7 +6078,7 @@ s32 Camera_Demo6(Camera* camera) { case 1: if (stateTimers[camera->animState] < anim->animTimer) { func_8002DF54(camera->globalCtx, &camera->player->actor, 8); - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); anim->atTarget.x = focusPosRot.pos.x; anim->atTarget.y = focusPosRot.pos.y - 20.0f; anim->atTarget.z = focusPosRot.pos.z; @@ -6103,7 +6103,7 @@ s32 Camera_Demo6(Camera* camera) { } anim->animTimer++; - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); return true; } @@ -6198,13 +6198,13 @@ s32 Camera_Demo9(Camera* camera) { Camera_RotateAroundPoint(cam0PlayerPosRot, &csAtUpdate, &newAt); } else if (demo9OnePoint->onePointDemo.actionParameters == 4) { // rotate around the current camera's player - func_8002EF14(&focusPosRot, &camera->player->actor); + Actor_GetWorld(&focusPosRot, &camera->player->actor); Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye); Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt); } else if (demo9OnePoint->onePointDemo.actionParameters == 8) { // rotate around the current camera's target if (camera->target != NULL && camera->target->update != NULL) { - func_8002EF14(&focusPosRot, camera->target); + Actor_GetWorld(&focusPosRot, camera->target); Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye); Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt); } else { @@ -6297,7 +6297,7 @@ s32 Camera_Special0(Camera* camera) { return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); Camera_LERPCeilVec3f(&camera->targetPosRot.pos, &camera->at, spec0->lerpAtScale, spec0->lerpAtScale, 0.1f); camera->posOffset.x = camera->at.x - playerPosRot->pos.x; @@ -6343,7 +6343,7 @@ s32 Camera_Special4(Camera* camera) { return false; } else { camera->roll = -0x1F4; - func_8002EF14(&curTargetPosRot, camera->target); + Actor_GetWorld(&curTargetPosRot, camera->target); camera->at = curTargetPosRot.pos; camera->at.y -= 150.0f; @@ -6401,7 +6401,7 @@ s32 Camera_Special5(Camera* camera) { OLib_Vec3fDiffToVecSphGeo(&sp64, at, eye); OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eyeNext); - func_8002EF14(&spA8, camera->target); + Actor_GetWorld(&spA8, camera->target); sCameraInterfaceFlags = spec5->interfaceFlags; @@ -6647,7 +6647,7 @@ s32 Camera_Special9(Camera* camera) { } if (spec9->doorParams.doorActor != NULL) { - func_8002EF44(&adjustedPlayerPosRot, spec9->doorParams.doorActor); + Actor_GetWorldPosShapeRot(&adjustedPlayerPosRot, spec9->doorParams.doorActor); } else { adjustedPlayerPosRot = *playerPosRot; adjustedPlayerPosRot.pos.y += playerYOffset + params->yOffset; @@ -6894,7 +6894,7 @@ void Camera_InitPlayerSettings(Camera* camera, Player* player) { Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - func_8002EF44(&playerPosShape, &player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor); playerYOffset = Player_GetHeight(player); camera->player = player; camera->playerPosRot = playerPosShape; @@ -7333,7 +7333,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) { sUpdateCameraDirection = false; if (camera->player != NULL) { - func_8002EF44(&curPlayerPosRot, &camera->player->actor); + Actor_GetWorldPosShapeRot(&curPlayerPosRot, &camera->player->actor); camera->xzSpeed = playerXZSpeed = OLib_Vec3fDistXZ(&curPlayerPosRot.pos, &camera->playerPosRot.pos); camera->speedRatio = OLib_ClampMaxDist(playerXZSpeed / (func_8002DCE4(camera->player) * PCT(OREG(8))), 1.0f); @@ -7558,7 +7558,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) { */ void Camera_Finish(Camera* camera) { Camera* defaultCam = camera->globalCtx->cameraPtrs[0]; - Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first; + Player* player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head; if (camera->timer == 0) { Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamIdx, 7); @@ -7966,7 +7966,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa if (camera->data2 != 0) { camera->player = player; - func_8002EF44(&playerPosRot, &player->actor); + Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor); camera->playerPosRot = playerPosRot; camera->nextCamDataIdx = -1; @@ -8042,7 +8042,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) { func_80043B60(dstCamera); if (dstCamera->player != NULL) { - func_8002EF14(&dstCamera->playerPosRot, &dstCamera->player->actor); + Actor_GetWorld(&dstCamera->playerPosRot, &dstCamera->player->actor); dstCamera->posOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x; dstCamera->posOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y; dstCamera->posOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z; diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index 1b323dacfc..a99f6becbd 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -1,109 +1,825 @@ #include "global.h" -DamageTable D_8011DB20[] = { +static DamageTable sDamageTablePresets[] = { { { - 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 1 Used by En_Karebaba + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 2 Used by En_St, En_Ssh + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(3, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + // 3 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(2, 0x0), + /* Master jump */ DMG_ENTRY(2, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 4 Used by En_Dodojr + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x31, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 5 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(1, 0x0), + /* Master spin */ DMG_ENTRY(1, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 6 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(6, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(6, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(6, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 7 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(6, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(6, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(6, 0x0), + /* Ice arrow */ DMG_ENTRY(6, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 8 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 9 Used by En_Bubble + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0xE2, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 10 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xE), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 11 Used by En_Horse + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(9, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 12 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(4, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x02, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 13 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(1, 0x0), + /* Master spin */ DMG_ENTRY(1, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 14 Used by En_Sw + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 15 Used by En_Fd + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 16 Used by En_Fw + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 17 + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(1, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 18 + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(1, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0x02, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 19 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0xF2, 0xE0, 0x01, 0xD2, 0x10, 0x01, 0x02, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 20 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xD), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0xF0, 0x10, 0x01, 0xF0, 0x10, 0x01, 0x02, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 21 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x1), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(2, 0x1), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 22 Used by En_Du, En_Go, En_Ma1, En_Ma2, En_Ma3 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, }; +// Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range. DamageTable* DamageTable_Get(s32 index) { - if (index < 0 || index >= 23) { + if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) { + // Index over osSyncPrintf("CollisionBtlTbl_get():インデックスオーバー\n"); - return 0; + return NULL; } - return &D_8011DB20[index]; + return &sDamageTablePresets[index]; } -void func_8005B248(DamageTable* table) { +// Sets all entries in the damage table to 0x00 +void DamageTable_Clear(DamageTable* table) { s32 i; for (i = 0; i < 32; i++) { table->table[i] = 0; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index fbf8a5eba8..30f71cda20 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,13 +1,53 @@ #include "global.h" #include "vt.h" +#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" -// draw red poly -void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC) { - func_8005B2AC(gfxCtx, vA, vB, vC, 255, 0, 0); +typedef s32 (*ColChkResetFunc)(GlobalContext*, Collider*); +typedef void (*ColChkBloodFunc)(GlobalContext*, Collider*, Vec3f*); +typedef void (*ColChkApplyFunc)(GlobalContext*, CollisionCheckContext*, Collider*); +typedef void (*ColChkVsFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*); +typedef s32 (*ColChkLineFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); + +typedef struct { + /* 0 */ u8 blood; + /* 1 */ u8 effect; +} HitInfo; // size = 0x2 + +typedef enum { + /* 0 */ BLOOD_NONE, + /* 1 */ BLOOD_BLUE, + /* 2 */ BLOOD_GREEN, + /* 3 */ BLOOD_WATER, + /* 4 */ BLOOD_RED, + /* 5 */ BLOOD_RED2 +} ColChkBloodType; + +typedef enum { + /* 0 */ HIT_WHITE, + /* 1 */ HIT_DUST, + /* 2 */ HIT_RED, + /* 3 */ HIT_SOLID, + /* 4 */ HIT_WOOD, + /* 5 */ HIT_NONE +} ColChkHitType; + +typedef enum { + /* 0 */ MASSTYPE_IMMOVABLE, + /* 1 */ MASSTYPE_HEAVY, + /* 2 */ MASSTYPE_NORMAL +} ColChkMassType; + +/** + * Draws a red triangle with vertices vA, vB, and vC. + */ +void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC) { + Collider_DrawPoly(gfxCtx, vA, vB, vC, 255, 0, 0); } -// draw poly -void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b) { +/** + * Draws the triangle with vertices vA, vB, and vC and with the specified color. + */ +void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b) { Vtx* vtxTbl; Vtx* vtx; f32 nx; @@ -63,7 +103,10 @@ void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 } s32 Collider_InitBase(GlobalContext* globalCtx, Collider* collider) { - static Collider init = { NULL, NULL, NULL, NULL, 0, 0, 0, 0, COLTYPE_UNK3, COLSHAPE_INVALID }; + static Collider init = { + NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COLTYPE_HIT3, COLSHAPE_INVALID, + }; + *collider = init; return 1; } @@ -72,58 +115,63 @@ s32 Collider_DestroyBase(GlobalContext* globalCtx, Collider* collider) { return 1; } -s32 Collider_SetBase_Actor(GlobalContext* globalCtx, Collider* collider, ColliderInit_Actor* src) { +/** + * Uses default OC2_TYPE_1 and COLTYPE_HIT0 + */ +s32 Collider_SetBaseToActor(GlobalContext* globalCtx, Collider* collider, ColliderInitToActor* src) { collider->actor = src->actor; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = 0x10; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = OC2_TYPE_1; collider->shape = src->shape; return 1; } -// maskB = 0x10 -s32 Collider_SetBase_Set3(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit_Set3* src) { +/** + * Uses default OC2_TYPE_1 + */ +s32 Collider_SetBaseType1(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInitType1* src) { collider->actor = actor; - collider->type = src->type; + collider->colType = src->colType; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = 0x10; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = OC2_TYPE_1; collider->shape = src->shape; return 1; } -// maskB = src->maskB s32 Collider_SetBase(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit* src) { collider->actor = actor; - collider->type = src->type; + collider->colType = src->colType; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = src->maskB; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = src->ocFlags2; collider->shape = src->shape; return 1; } -void Collider_BaseSetAT(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetATBase(GlobalContext* globalCtx, Collider* collider) { collider->at = NULL; - collider->atFlags &= ~0x6; + collider->atFlags &= ~(AT_HIT | AT_BOUNCED); } -void Collider_BaseSetAC(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetACBase(GlobalContext* globalCtx, Collider* collider) { collider->ac = NULL; - collider->acFlags &= ~0x82; + collider->acFlags &= ~(AC_HIT | AC_BOUNCED); } -void Collider_BaseSetOC(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetOCBase(GlobalContext* globalCtx, Collider* collider) { collider->oc = NULL; - collider->maskA &= ~0x2; - collider->maskB &= ~0x1; + collider->ocFlags1 &= ~OC1_HIT; + collider->ocFlags2 &= ~OC2_HIT_PLAYER; } s32 Collider_InitTouch(GlobalContext* globalCtx, ColliderTouch* touch) { - static ColliderTouch init = { 0, 0, 0 }; + static ColliderTouch init = { 0x00000000, 0, 0 }; + *touch = init; return 1; } @@ -132,19 +180,19 @@ s32 Collider_DestroyTouch(GlobalContext* globalCtx, ColliderTouch* touch) { return 1; } -// src might actually be a different type s32 Collider_SetTouch(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src) { - dest->flags = src->flags; + dest->dmgFlags = src->dmgFlags; dest->effect = src->effect; dest->damage = src->damage; return 1; } -void Collider_BodySetAT_Unk(GlobalContext* globalCtx, ColliderBody* body) { +void Collider_ResetATInfo_Unk(GlobalContext* globalCtx, ColliderInfo* info) { } s32 Collider_InitBump(GlobalContext* globalCtx, ColliderBump* bump) { static ColliderBump init = { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }; + *bump = init; return 1; } @@ -154,314 +202,321 @@ s32 Collider_DestroyBump(GlobalContext* globalCtx, ColliderBump* bump) { } s32 Collider_SetBump(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit* init) { - bump->flags = init->flags; + bump->dmgFlags = init->dmgFlags; bump->effect = init->effect; bump->defense = init->defense; return 1; } -s32 Collider_InitBody(GlobalContext* globalCtx, ColliderBody* body) { - static ColliderBody init = { - { 0, 0, 0 }, { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, 0, 0, 0, 0, NULL, NULL, NULL, NULL, +s32 Collider_InitInfo(GlobalContext* globalCtx, ColliderInfo* info) { + static ColliderInfo init = { + { 0, 0, 0 }, { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, + ELEMTYPE_UNK0, TOUCH_NONE, + BUMP_NONE, OCELEM_NONE, + NULL, NULL, + NULL, NULL, }; - *body = init; - Collider_InitTouch(globalCtx, &body->toucher); - Collider_InitBump(globalCtx, &body->bumper); + + *info = init; + Collider_InitTouch(globalCtx, &info->toucher); + Collider_InitBump(globalCtx, &info->bumper); return 1; } -s32 Collider_DestroyBody(GlobalContext* globalCtx, ColliderBody* body) { - Collider_DestroyTouch(globalCtx, &body->toucher); - Collider_DestroyBump(globalCtx, &body->bumper); +s32 Collider_DestroyInfo(GlobalContext* globalCtx, ColliderInfo* info) { + Collider_DestroyTouch(globalCtx, &info->toucher); + Collider_DestroyBump(globalCtx, &info->bumper); return 1; } -s32 Collider_SetBody(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit* bodyInit) { - body->flags = bodyInit->bodyFlags; - Collider_SetTouch(globalCtx, &body->toucher, &bodyInit->toucher); - Collider_SetBump(globalCtx, &body->bumper, &bodyInit->bumper); - body->toucherFlags = bodyInit->toucherFlags; - body->bumperFlags = bodyInit->bumperFlags; - body->ocFlags = bodyInit->bodyFlags2; +s32 Collider_SetInfo(GlobalContext* globalCtx, ColliderInfo* info, ColliderInfoInit* infoInit) { + info->elemType = infoInit->elemType; + Collider_SetTouch(globalCtx, &info->toucher, &infoInit->toucher); + Collider_SetBump(globalCtx, &info->bumper, &infoInit->bumper); + info->toucherFlags = infoInit->toucherFlags; + info->bumperFlags = infoInit->bumperFlags; + info->ocElemFlags = infoInit->ocElemFlags; return 1; } -void Collider_BodySetAT(GlobalContext* globalCtx, ColliderBody* body) { - body->atHit = NULL; - body->atHitItem = NULL; - body->toucherFlags &= ~0x2; - body->toucherFlags &= ~0x40; - Collider_BodySetAT_Unk(globalCtx, body); +void Collider_ResetATInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->atHit = NULL; + info->atHitInfo = NULL; + info->toucherFlags &= ~TOUCH_HIT; + info->toucherFlags &= ~TOUCH_DREW_HITMARK; + Collider_ResetATInfo_Unk(globalCtx, info); } -void Collider_BodySetAC(GlobalContext* globalCtx, ColliderBody* body) { - body->bumper.unk_06.z = 0; - body->bumperFlags &= ~0x2; - body->bumperFlags &= ~0x80; - body->acHit = NULL; - body->acHitItem = NULL; - body->bumper.unk_06.y = body->bumper.unk_06.z; - body->bumper.unk_06.x = body->bumper.unk_06.z; +void Collider_ResetACInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->bumper.hitPos.x = info->bumper.hitPos.y = info->bumper.hitPos.z = 0; + info->bumperFlags &= ~BUMP_HIT; + info->bumperFlags &= ~BUMP_DRAW_HITMARK; + info->acHit = NULL; + info->acHitInfo = NULL; } -void Collider_BodySetOC(GlobalContext* globalCtx, ColliderBody* body) { - body->ocFlags &= ~0x2; +void Collider_ResetOCInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->ocElemFlags &= ~OCELEM_HIT; } -s32 Collider_InitJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dim) { - static ColliderJntSphItemDim init = { 0 }; +s32 Collider_InitJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* dim) { + static ColliderJntSphElementDim init = { + { { 0, 0, 0 }, 0 }, + { { 0, 0, 0 }, 0 }, + 0.0f, + 0, + }; *dim = init; return 1; } -s32 Collider_DestroyJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* item) { +s32 Collider_DestroyJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* element) { return 1; } -s32 Collider_SetJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dest, ColliderJntSphItemDimInit* src) { - dest->joint = src->joint; +s32 Collider_SetJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* dest, + ColliderJntSphElementDimInit* src) { + dest->limb = src->limb; dest->modelSphere = src->modelSphere; dest->scale = src->scale * 0.01f; return 1; } -s32 Collider_InitJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item) { - Collider_InitBody(globalCtx, &item->body); - Collider_InitJntSphItemDim(globalCtx, &item->dim); +s32 Collider_InitJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* element) { + Collider_InitInfo(globalCtx, &element->info); + Collider_InitJntSphElementDim(globalCtx, &element->dim); return 1; } -s32 Collider_DestroyJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item) { - Collider_DestroyBody(globalCtx, &item->body); - Collider_DestroyJntSphItemDim(globalCtx, &item->dim); +s32 Collider_DestroyJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* element) { + Collider_DestroyInfo(globalCtx, &element->info); + Collider_DestroyJntSphElementDim(globalCtx, &element->dim); return 1; } -s32 Collider_SetJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* dest, ColliderJntSphItemInit* src) { - Collider_SetBody(globalCtx, &dest->body, &src->body); - Collider_SetJntSphItemDim(globalCtx, &dest->dim, &src->dim); +s32 Collider_SetJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* dest, ColliderJntSphElementInit* src) { + Collider_SetInfo(globalCtx, &dest->info, &src->info); + Collider_SetJntSphElementDim(globalCtx, &dest->dim, &src->dim); return 1; } -s32 Collider_JntSphItemSetAT(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetAT(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementAT(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetATInfo(globalCtx, &collider->info); return 1; } -s32 Collider_JntSphItemSetAC(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetAC(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementAC(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetACInfo(globalCtx, &collider->info); return 1; } -s32 Collider_JntSphItemSetOC(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetOC(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementOC(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetOCInfo(globalCtx, &collider->info); return 1; } +/** + * Initializes a ColliderJntSph to default values + */ s32 Collider_InitJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { Collider_InitBase(globalCtx, &collider->base); collider->count = 0; - collider->list = NULL; + collider->elements = NULL; return 1; } -// Destruct ColliderJntSph (malloc) +/** + * Destroys a dynamically allocated ColliderJntSph + */ s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { - ColliderJntSphItem* next; + ColliderJntSphElement* element; Collider_DestroyBase(globalCtx, &collider->base); - next = collider->list; - - while (next < collider->list + collider->count) { - Collider_DestroyJntSphItem(globalCtx, next); - next++; + for (element = collider->elements; element < collider->elements + collider->count; element++) { + Collider_DestroyJntSphElement(globalCtx, element); } collider->count = 0; - if (collider->list != NULL) { - ZeldaArena_FreeDebug(collider->list, "../z_collision_check.c", 1393); + if (collider->elements != NULL) { + ZeldaArena_FreeDebug(collider->elements, "../z_collision_check.c", 1393); } - collider->list = NULL; + collider->elements = NULL; return 1; } -// Destruct ColliderJntSph (no malloc) +/** + * Destroys a preallocated ColliderJntSph + */ s32 Collider_DestroyJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { - ColliderJntSphItem* next; + ColliderJntSphElement* element; Collider_DestroyBase(globalCtx, &collider->base); - next = collider->list; - - while (next < collider->list + collider->count) { - - Collider_DestroyJntSphItem(globalCtx, next); - next++; + for (element = collider->elements; element < collider->elements + collider->count; element++) { + Collider_DestroyJntSphElement(globalCtx, element); } collider->count = 0; - collider->list = NULL; + collider->elements = NULL; return 1; } -// ClObjJntSph -s32 Collider_SetJntSph_Set(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInit_Actor* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src, sets it to the actor specified in src, and dynamically allocates + * the element array. Uses default OC2_TYPE_1 and COLTYPE_HIT0. Unused. + */ +s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInitToActor* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; - Collider_SetBase_Actor(globalCtx, &dest->base, &src->base); + Collider_SetBaseToActor(globalCtx, &dest->base, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1443); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1443); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set():zelda_malloc()出来ません。\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set():zelda_malloc()出来ません。\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjJntSph_set3 (maskB = 0x10) -// called by En_Nwc -s32 Collider_SetJntSph_Set3(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, - ColliderJntSphInit_Set3* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src and dynamically allocates the element array. Uses default + * OC2_TYPE_1. Only used by En_Nwc, an unused and unfinished actor. + */ +s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, + ColliderJntSphInitType1* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; - Collider_SetBase_Set3(globalCtx, &dest->base, actor, &src->base); + Collider_SetBaseType1(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1490); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1490); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjJntSph_set5 (maskB = src->maskB) -s32 Collider_SetJntSph_Set5(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src and dynamically allocates the element array. + * Unused. + */ +s32 Collider_SetJntSphAlloc(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1551); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1551); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set5():zelda_malloc出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set5():zelda_malloc出来ません\n"); osSyncPrintf(VT_RST); return 0; } - - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } +/** + * Sets up the ColliderJntSph using the values in src, placing the element array in elements. + */ s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphItem* list) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; + ColliderJntSphElement* elements) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = list; + dest->elements = elements; - if (dest->list == NULL) { + if (dest->elements == NULL) { __assert("pclobj_jntsph->elem_tbl != NULL", "../z_collision_check.c", 1603); } - - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -s32 Collider_JntSphSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetJntSphAT(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetAT(gctx, &col->base); - next = col->list; + Collider_ResetATBase(globalCtx, &jntSph->base); - while (next < col->list + col->count) { - Collider_JntSphItemSetAT(gctx, next); - next++; + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementAT(globalCtx, element); } return 1; } -s32 Collider_JntSphSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetJntSphAC(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetAC(gctx, &col->base); - next = col->list; + Collider_ResetACBase(globalCtx, &jntSph->base); - while (next < col->list + col->count) { - Collider_JntSphItemSetAC(gctx, next); - next++; + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementAC(globalCtx, element); } return 1; } -s32 Collider_JntSphSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetJntSphOC(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetOC(gctx, &col->base); - next = col->list; - while (next < col->list + col->count) { - Collider_JntSphItemSetOC(gctx, next); - next++; + Collider_ResetOCBase(globalCtx, &jntSph->base); + + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementOC(globalCtx, element); } return 1; } s32 Collider_InitCylinderDim(GlobalContext* globalCtx, Cylinder16* dim) { - Cylinder16 init = { 0 }; + Cylinder16 init = { 0, 0, 0, { 0, 0, 0 } }; + *dim = init; return 1; } @@ -475,306 +530,337 @@ s32 Collider_SetCylinderDim(GlobalContext* globalCtx, Cylinder16* dest, Cylinder return 1; } +/** + * Initializes a ColliderCylinder to default values + */ s32 Collider_InitCylinder(GlobalContext* globalCtx, ColliderCylinder* collider) { Collider_InitBase(globalCtx, &collider->base); - Collider_InitBody(globalCtx, &collider->body); + Collider_InitInfo(globalCtx, &collider->info); Collider_InitCylinderDim(globalCtx, &collider->dim); return 1; } +/** + * Destroys a ColliderCylinder + */ s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collider) { Collider_DestroyBase(globalCtx, &collider->base); - Collider_DestroyBody(globalCtx, &collider->body); + Collider_DestroyInfo(globalCtx, &collider->info); Collider_DestroyCylinderDim(globalCtx, &collider->dim); return 1; } -// used only by DekuJr, D_80B92A00 -s32 Collider_SetCylinder_Actor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInit_Actor* src) { - Collider_SetBase_Actor(globalCtx, &collider->base, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderCylinder using the values in src and sets it to the actor specified in src. Uses default + * OC2_TYPE_1 and COLTYPE_0. Used only by DekuJr, who sets it to himself anyways. + */ +s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, + ColliderCylinderInitToActor* src) { + Collider_SetBaseToActor(globalCtx, &collider->base, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = 0x10 -s32 Collider_SetCylinder_Set3(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, - ColliderCylinderInit_Set3* src) { - Collider_SetBase_Set3(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderCylinder using the values in src. Uses default OC2_TYPE_1 + */ +s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, + ColliderCylinderInitType1* src) { + Collider_SetBaseType1(globalCtx, &collider->base, actor, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = src->maskB +/** + * Sets up the ColliderCylinder using the values in src. + */ s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) { Collider_SetBase(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -s32 Collider_CylinderSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetAT(globalCtx, &col->base); - Collider_BodySetAT(globalCtx, &col->body); +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetCylinderAT(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetATBase(globalCtx, &cylinder->base); + Collider_ResetATInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_CylinderSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetAC(globalCtx, &col->base); - Collider_BodySetAC(globalCtx, &col->body); +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetCylinderAC(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetACBase(globalCtx, &cylinder->base); + Collider_ResetACInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_CylinderSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetOC(globalCtx, &col->base); - Collider_BodySetOC(globalCtx, &col->body); +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetCylinderOC(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetOCBase(globalCtx, &cylinder->base); + Collider_ResetOCInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_InitTrisItemDim(GlobalContext* globalCtx, TriNorm* dim) { - static TriNorm init = { 0 }; +s32 Collider_InitTrisElementDim(GlobalContext* globalCtx, TriNorm* dim) { + static TriNorm init = { + { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, + { { 0.0f, 0.0f, 0.0f }, 0.0f }, + }; + *dim = init; return 1; } -s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim) { +s32 Collider_DestroyTrisElementDim(GlobalContext* globalCtx, TriNorm* dim) { return 1; } -s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src) { - Vec3f* d; - Vec3f* s; - f32 nx, ny, nz, nd; +s32 Collider_SetTrisElementDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisElementDimInit* src) { + Vec3f* destVtx; + Vec3f* srcVtx; + f32 nx; + f32 ny; + f32 nz; + f32 originDist; - d = dest->vtx; - s = src->vtx; - while (d < dest->vtx + 3) { - *d++ = *s++; + for (destVtx = dest->vtx, srcVtx = src->vtx; destVtx < dest->vtx + 3; destVtx++, srcVtx++) { + *destVtx = *srcVtx; } - Math3D_DefPlane(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &nd); + Math3D_DefPlane(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &originDist); dest->plane.normal.x = nx; dest->plane.normal.y = ny; dest->plane.normal.z = nz; - dest->plane.originDist = nd; + dest->plane.originDist = originDist; return 1; } -s32 Collider_InitTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider) { - Collider_InitBody(globalCtx, &collider->body); - Collider_InitTrisItemDim(globalCtx, &collider->dim); +s32 Collider_InitTrisElement(GlobalContext* globalCtx, ColliderTrisElement* collider) { + Collider_InitInfo(globalCtx, &collider->info); + Collider_InitTrisElementDim(globalCtx, &collider->dim); return 1; } -s32 Collider_DestroyTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider) { - Collider_DestroyBody(globalCtx, &collider->body); - Collider_DestroyTrisItemDim(globalCtx, &collider->dim); +s32 Collider_DestroyTrisElement(GlobalContext* globalCtx, ColliderTrisElement* collider) { + Collider_DestroyInfo(globalCtx, &collider->info); + Collider_DestroyTrisElementDim(globalCtx, &collider->dim); return 1; } -s32 Collider_SetTrisItem(GlobalContext* globalCtx, ColliderTrisItem* dest, ColliderTrisItemInit* src) { - Collider_SetBody(globalCtx, &dest->body, &src->body); - Collider_SetTrisItemDim(globalCtx, &dest->dim, &src->dim); +s32 Collider_SetTrisElement(GlobalContext* globalCtx, ColliderTrisElement* dest, ColliderTrisElementInit* src) { + Collider_SetInfo(globalCtx, &dest->info, &src->info); + Collider_SetTrisElementDim(globalCtx, &dest->dim, &src->dim); return 1; } -s32 Collider_TrisItemSetAT(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetAT(globalCtx, &item->body); +s32 Collider_ResetTrisElementAT(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetATInfo(globalCtx, &element->info); return 1; } -s32 Collider_TrisItemSetAC(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetAC(globalCtx, &item->body); +s32 Collider_ResetTrisElementAC(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetACInfo(globalCtx, &element->info); return 1; } -s32 Collider_TrisItemSetOC(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetOC(globalCtx, &item->body); +s32 Collider_ResetTrisElementOC(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetOCInfo(globalCtx, &element->info); return 1; } +/** + * Initializes a ColliderTris to default values + */ s32 Collider_InitTris(GlobalContext* globalCtx, ColliderTris* tris) { Collider_InitBase(globalCtx, &tris->base); tris->count = 0; - tris->list = 0; + tris->elements = 0; return 1; } -// zelda malloc +/** + * Destroys a dynamically allocated ColliderTris + * Unused + */ s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris) { - ColliderTrisItem* next; + ColliderTrisElement* element; Collider_DestroyBase(globalCtx, &tris->base); - next = tris->list; - - while (next < tris->list + tris->count) { - Collider_DestroyTrisItem(globalCtx, next); - next++; + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_DestroyTrisElement(globalCtx, element); } tris->count = 0; - if (tris->list != NULL) { - ZeldaArena_FreeDebug(tris->list, "../z_collision_check.c", 2099); + if (tris->elements != NULL) { + ZeldaArena_FreeDebug(tris->elements, "../z_collision_check.c", 2099); } - tris->list = NULL; + tris->elements = NULL; return 1; } -// no malloc +/** + * Destroys a preallocated ColliderTris + */ s32 Collider_DestroyTris(GlobalContext* globalCtx, ColliderTris* tris) { - ColliderTrisItem* next; + ColliderTrisElement* element; Collider_DestroyBase(globalCtx, &tris->base); - next = tris->list; - - while (next < tris->list + tris->count) { - Collider_DestroyTrisItem(globalCtx, next); - next++; + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_DestroyTrisElement(globalCtx, element); } + tris->count = 0; - tris->list = NULL; + tris->elements = NULL; return 1; } -// ClObjTris_set3 (maskB = 0x10) -s32 Collider_SetTris_Set3(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit_Set3* src) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; +/** + * Sets up the ColliderTris using the values in src and dynamically allocates the element array. Uses default OC2_TYPE_1 + * Unused. + */ +s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; - Collider_SetBase_Set3(globalCtx, &dest->base, actor, &src->base); + Collider_SetBaseType1(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisItem), "../z_collision_check.c", 2156); - if (dest->list == NULL) { + dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2156); + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjTris_set3():zelda_malloc()出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjTris_set3():zelda_malloc()出来ません\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjTris_set5 (maskB = src->maskB) -s32 Collider_SetTris_Set5(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; +/** + * Sets up the ColliderTris using the values in src and dynamically allocates the element array. + * Unused + */ +s32 Collider_SetTrisAlloc(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisItem), "../z_collision_check.c", 2207); + dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2207); - if (dest->list == NULL) { + if (dest->elements == NULL) { osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjTris_set5():zelda_malloc出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjTris_set5():zelda_malloc出来ません\n"); osSyncPrintf(VT_RST); dest->count = 0; return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } +/** + * Sets up the ColliderTris using the values in src, placing the element array in elements. + */ s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, - ColliderTrisItem* list) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; + ColliderTrisElement* elements) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = list; + dest->elements = elements; - if (dest->list == NULL) { + if (dest->elements == NULL) { __assert("pclobj_tris->elem_tbl != NULL", "../z_collision_check.c", 2258); } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } -s32 Collider_TrisSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetTrisAT(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetAT(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetAT(gctx, next); - next++; + Collider_ResetATBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementAT(globalCtx, element); } return 1; } -s32 Collider_TrisSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetTrisAC(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetAC(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetAC(gctx, next); - next++; + Collider_ResetACBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementAC(globalCtx, element); } return 1; } -s32 Collider_TrisSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetTrisOC(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetOC(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetOC(gctx, next); - next++; + Collider_ResetOCBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementOC(globalCtx, element); } return 1; } s32 Collider_InitQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim) { static ColliderQuadDim init = { - { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0, 0, 0 }, { 0, 0, 0 }, 1.0E38f, }; + *dim = init; return 1; } @@ -783,14 +869,12 @@ s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim) { return 1; } -// Set ColliderQuadDim unk_3C -s32 func_8005CEC4(GlobalContext* globalCtx, ColliderQuadDim* dim) { - dim->unk_3C = 1.0E38f; +s32 Collider_ResetQuadACDist(GlobalContext* globalCtx, ColliderQuadDim* dim) { + dim->acDist = 1.0E38f; return 1; } -// ColliderQuadDim compute dc ba midpoints -void func_8005CEDC(ColliderQuadDim* dim) { +void Collider_SetQuadMidpoints(ColliderQuadDim* dim) { dim->dcMid.x = (dim->quad[3].x + dim->quad[2].x) * 0.5f; dim->dcMid.y = (dim->quad[3].y + dim->quad[2].y) * 0.5f; dim->dcMid.z = (dim->quad[3].z + dim->quad[2].z) * 0.5f; @@ -804,170 +888,225 @@ s32 Collider_SetQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dest, Collide dest->quad[1] = src->quad[1]; dest->quad[2] = src->quad[2]; dest->quad[3] = src->quad[3]; - func_8005CEDC(dest); + Collider_SetQuadMidpoints(dest); return 1; } +/** + * Initializes a ColliderQuad to default values. + */ s32 Collider_InitQuad(GlobalContext* globalCtx, ColliderQuad* collider) { Collider_InitBase(globalCtx, &collider->base); - Collider_InitBody(globalCtx, &collider->body); + Collider_InitInfo(globalCtx, &collider->info); Collider_InitQuadDim(globalCtx, &collider->dim); return 1; } +/** + * Destroys a ColliderQuad. + */ s32 Collider_DestroyQuad(GlobalContext* globalCtx, ColliderQuad* collider) { Collider_DestroyBase(globalCtx, &collider->base); - Collider_DestroyBody(globalCtx, &collider->body); + Collider_DestroyInfo(globalCtx, &collider->info); Collider_DestroyQuadDim(globalCtx, &collider->dim); return 1; } -// maskB = 0x10 -s32 Collider_SetQuad_Set3(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit_Set3* src) { - Collider_SetBase_Set3(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderQuad using the values in src. Uses the default OC2_TYPE_1 + */ +s32 Collider_SetQuadType1(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src) { + Collider_SetBaseType1(globalCtx, &collider->base, actor, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetQuadDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = src->maskB +/** + * Sets up the ColliderQuad using the values in src. + */ s32 Collider_SetQuad(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { Collider_SetBase(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetQuadDim(globalCtx, &collider->dim, &src->dim); return 1; } -s32 Collider_QuadSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetAT(globalCtx, &col->base); - Collider_BodySetAT(globalCtx, &col->body); - func_8005CEC4(globalCtx, &col->dim); +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetQuadAT(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetATBase(globalCtx, &quad->base); + Collider_ResetATInfo(globalCtx, &quad->info); + Collider_ResetQuadACDist(globalCtx, &quad->dim); return 1; } -s32 Collider_QuadSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetAC(globalCtx, &col->base); - Collider_BodySetAC(globalCtx, &col->body); +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetQuadAC(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetACBase(globalCtx, &quad->base); + Collider_ResetACInfo(globalCtx, &quad->info); return 1; } -s32 Collider_QuadSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetOC(globalCtx, &col->base); - Collider_BodySetOC(globalCtx, &col->body); +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetOCBase(globalCtx, &quad->base); + Collider_ResetOCInfo(globalCtx, &quad->info); return 1; } -s32 func_8005D218(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* arg2) { - f32 temp; - Vec3f sp20; +/** + * For quad colliders with AT_NEAREST, resets the previous AC collider it hit if the current element is closer, + * otherwise returns false. Used on player AT colliders to prevent multiple collisions from registering. + */ +s32 Collider_QuadSetNearestAC(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* hitPos) { + f32 acDist; + Vec3f dcMid; - if (!(quad->body.toucherFlags & 4)) { - return 1; + if (!(quad->info.toucherFlags & TOUCH_NEAREST)) { + return true; } - Math_Vec3s_ToVec3f(&sp20, &quad->dim.dcMid); - temp = Math3D_Vec3fDistSq(&sp20, arg2); - if (temp < quad->dim.unk_3C) { - quad->dim.unk_3C = temp; - if (quad->body.atHit != NULL) { - Collider_BaseSetAC(globalCtx, quad->body.atHit); + Math_Vec3s_ToVec3f(&dcMid, &quad->dim.dcMid); + acDist = Math3D_Vec3fDistSq(&dcMid, hitPos); + if (acDist < quad->dim.acDist) { + quad->dim.acDist = acDist; + if (quad->info.atHit != NULL) { + Collider_ResetACBase(globalCtx, quad->info.atHit); } - if (quad->body.atHitItem != NULL) { - Collider_BodySetAC(globalCtx, quad->body.atHitItem); + if (quad->info.atHitInfo != NULL) { + Collider_ResetACInfo(globalCtx, quad->info.atHitInfo); } - return 1; + return true; } - return 0; + return false; } -s32 Collider_InitOcLine(GlobalContext* globalCtx, OcLine* line) { - static Vec3f init = { 0, 0, 0 }; - Vec3f temp; +/** + * Initializes an OcLine to default values + * OcLines are entirely unused. + */ +s32 Collider_InitLine(GlobalContext* globalCtx, OcLine* line) { + Vec3f init = { 0.0f, 0.0f, 0.0f }; - temp = init; - Math_Vec3f_Copy(&line->line.a, &temp); - Math_Vec3f_Copy(&line->line.b, &temp); + Math_Vec3f_Copy(&line->line.a, &init); + Math_Vec3f_Copy(&line->line.b, &init); return 1; } -s32 Collider_DestroyOcLine(GlobalContext* globalCtx, OcLine* line) { +/** + * Destroys an OcLine + * OcLines are entirely unused. + */ +s32 Collider_DestroyLine(GlobalContext* globalCtx, OcLine* line) { return 1; } -s32 func_8005D334(UNK_TYPE arg0, OcLine* arg1, Vec3f* arg2, Vec3f* arg3) { - Math_Vec3f_Copy(&arg1->line.a, arg2); - Math_Vec3f_Copy(&arg1->line.b, arg3); +/** + * Sets up an OcLine with endpoints a and b. + * OcLines are entirely unused. + */ +s32 Collider_SetLinePoints(GlobalContext* GlobalContext, OcLine* ocLine, Vec3f* a, Vec3f* b) { + Math_Vec3f_Copy(&ocLine->line.a, a); + Math_Vec3f_Copy(&ocLine->line.b, b); return 1; } -s32 func_8005D378(UNK_TYPE arg0, OcLine* arg1, OcLine* arg2) { - arg1->unk_18 = arg2->unk_18; - func_8005D334(arg0, arg1, &arg2->line.a, &arg2->line.b); +/** + * Sets up an OcLine using the values in src. + * OcLines are entirely unused. + */ +s32 Collider_SetLine(GlobalContext* globalCtx, OcLine* dest, OcLine* src) { + dest->ocFlags = src->ocFlags; + Collider_SetLinePoints(globalCtx, dest, &src->line.a, &src->line.b); return 1; } -s32 func_8005D3A4(GlobalContext* globalCtx, OcLine* line) { - line->unk_18 &= 0xFFFE; +/** + * Resets the OcLine's collision flags. + * OcLines are entirely unused. + */ +s32 Collider_ResetLineOC(GlobalContext* globalCtx, OcLine* line) { + line->ocFlags &= ~OCLINE_HIT; return 1; } -void func_8005D3BC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Initializes CollisionCheckContext. Clears all collider arrays, disables SAC, and sets flags for drawing colliders. + */ +void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { colChkCtx->sacFlags = 0; - CollisionCheck_InitContext(globalCtx, colChkCtx); - AREG(21) = 1; - AREG(22) = 1; - AREG(23) = 1; + CollisionCheck_ClearContext(globalCtx, colChkCtx); + AREG(21) = true; + AREG(22) = true; + AREG(23) = true; } void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { } -// Initialize CollisionCheckContext -void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** c; - OcLine** d; +/** + * Clears all collider lists in CollisionCheckContext when not in SAC mode. + */ +void CollisionCheck_ClearContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { + Collider** col; + OcLine** line; if (!(colChkCtx->sacFlags & 1)) { - colChkCtx->colAtCount = 0; - colChkCtx->colAcCount = 0; - colChkCtx->colOcCount = 0; - colChkCtx->colOcLineCount = 0; - for (c = colChkCtx->colAt; c < colChkCtx->colAt + COLLISION_CHECK_AT_MAX; c++) { - *c = NULL; + colChkCtx->colATCount = 0; + colChkCtx->colACCount = 0; + colChkCtx->colOCCount = 0; + colChkCtx->colLineCount = 0; + for (col = colChkCtx->colAT; col < colChkCtx->colAT + COLLISION_CHECK_AT_MAX; col++) { + *col = NULL; } - for (c = colChkCtx->colAc; c < colChkCtx->colAc + COLLISION_CHECK_AC_MAX; c++) { - *c = NULL; + for (col = colChkCtx->colAC; col < colChkCtx->colAC + COLLISION_CHECK_AC_MAX; col++) { + *col = NULL; } - for (c = colChkCtx->colOc; c < colChkCtx->colOc + COLLISION_CHECK_OC_MAX; c++) { - *c = NULL; + for (col = colChkCtx->colOC; col < colChkCtx->colOC + COLLISION_CHECK_OC_MAX; col++) { + *col = NULL; } - for (d = colChkCtx->colOcLine; d < colChkCtx->colOcLine + COLLISION_CHECK_OC_LINE_MAX; d++) { - *d = NULL; + for (line = colChkCtx->colLine; line < colChkCtx->colLine + COLLISION_CHECK_OC_LINE_MAX; line++) { + *line = NULL; } } } -// Unused +/** + * Enables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. + */ void CollisionCheck_EnableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - colChkCtx->sacFlags |= 1; + colChkCtx->sacFlags |= AC_ON; } -// Unused +/** + * Disables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. + */ void CollisionCheck_DisableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - colChkCtx->sacFlags &= ~1; + colChkCtx->sacFlags &= ~AC_ON; } -// Draw Collider -void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { +/** + * Draws a collider of any shape. + * Math3D_DrawSphere and Math3D_DrawCylinder are noops, so JntSph and Cylinder are not drawn. + */ +void Collider_Draw(GlobalContext* globalCtx, Collider* collider) { ColliderJntSph* jntSph; ColliderCylinder* cylinder; ColliderTris* tris; - ColliderTrisItem* trisItem; ColliderQuad* quad; s32 i; @@ -978,7 +1117,7 @@ void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { case COLSHAPE_JNTSPH: jntSph = (ColliderJntSph*)collider; for (i = 0; i < jntSph->count; i++) { - Math3D_DrawSphere(globalCtx, &jntSph->list[i].dim.worldSphere); + Math3D_DrawSphere(globalCtx, &jntSph->elements[i].dim.worldSphere); } break; case COLSHAPE_CYLINDER: @@ -988,39 +1127,42 @@ void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { case COLSHAPE_TRIS: tris = (ColliderTris*)collider; for (i = 0; i < tris->count; i++) { - trisItem = &tris->list[i]; - func_8005B280(globalCtx->state.gfxCtx, &trisItem->dim.vtx[0], &trisItem->dim.vtx[1], - &trisItem->dim.vtx[2]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &tris->elements[i].dim.vtx[0], + &tris->elements[i].dim.vtx[1], &tris->elements[i].dim.vtx[2]); } break; case COLSHAPE_QUAD: quad = (ColliderQuad*)collider; - func_8005B280(globalCtx->state.gfxCtx, &quad->dim.quad[2], &quad->dim.quad[3], &quad->dim.quad[1]); - func_8005B280(globalCtx->state.gfxCtx, &quad->dim.quad[1], &quad->dim.quad[0], &quad->dim.quad[2]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &quad->dim.quad[2], &quad->dim.quad[3], &quad->dim.quad[1]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &quad->dim.quad[1], &quad->dim.quad[0], &quad->dim.quad[2]); break; } } -void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Draws collision if AREG(15) and other AREGs are set. AREG(21) draws AT colliders, AREG(22) draws AC colliders, + * AREG(23) draws OC colliders, AREG(24) draws dynapolys, and AREG(25) draws bg polys + */ +void CollisionCheck_DrawCollision(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { Collider* collider; s32 i; if (AREG(15)) { if (AREG(21)) { - for (i = 0; i < colChkCtx->colAtCount; i++) { - func_8005D4DC(globalCtx, colChkCtx->colAt[i]); + for (i = 0; i < colChkCtx->colATCount; i++) { + Collider_Draw(globalCtx, colChkCtx->colAT[i]); } } if (AREG(22)) { - for (i = 0; i < colChkCtx->colAcCount; i++) { - func_8005D4DC(globalCtx, colChkCtx->colAc[i]); + for (i = 0; i < colChkCtx->colACCount; i++) { + Collider_Draw(globalCtx, colChkCtx->colAC[i]); } } if (AREG(23)) { - for (i = 0; i < colChkCtx->colOcCount; i++) { - collider = colChkCtx->colOc[i]; - if (collider->maskA & 1) { - func_8005D4DC(globalCtx, collider); + for (i = 0; i < colChkCtx->colOCCount; i++) { + collider = colChkCtx->colOC[i]; + if (collider->ocFlags1 & OC1_ON) { + Collider_Draw(globalCtx, collider); } } } @@ -1033,262 +1175,298 @@ void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChk } } -s32 (*D_8011DEF8[])(GlobalContext*, Collider*) = { Collider_JntSphSetAT, Collider_CylinderSetAT, Collider_TrisSetAT, - Collider_QuadSetAT }; +static ColChkResetFunc sATResetFuncs[] = { + Collider_ResetJntSphAT, + Collider_ResetCylinderAT, + Collider_ResetTrisAT, + Collider_ResetQuadAT, +}; -// Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders) +/** + * Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders) + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 2997); } - D_8011DEF8[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sATResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colAtCount >= COLLISION_CHECK_AT_MAX) { + if (colChkCtx->colATCount >= COLLISION_CHECK_AT_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); - // EUC-JP: インデックスがオーバーして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colAtCount; - colChkCtx->colAt[colChkCtx->colAtCount++] = collider; + index = colChkCtx->colATCount; + colChkCtx->colAT[colChkCtx->colATCount++] = collider; return index; } -// Unused. Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders). -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders). + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3037); } if (func_800C0D28(globalCtx) == 1) { return -1; } - D_8011DEF8[collider->shape](globalCtx, collider); + sATResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colAtCount)) { + if (!(index < colChkCtx->colATCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。 | You are trying to register a location that - // is larger than the total number of data. return -1; } - colChkCtx->colAt[index] = collider; + colChkCtx->colAT[index] = collider; } else { - if (!(colChkCtx->colAtCount < COLLISION_CHECK_AT_MAX)) { + if (!(colChkCtx->colATCount < COLLISION_CHECK_AT_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); return -1; } - index = colChkCtx->colAtCount; - colChkCtx->colAt[colChkCtx->colAtCount++] = collider; + index = colChkCtx->colATCount; + colChkCtx->colAT[colChkCtx->colATCount++] = collider; } return index; } -s32 (*D_8011DF08[])(GlobalContext*, Collider*) = { Collider_JntSphSetAC, Collider_CylinderSetAC, Collider_TrisSetAC, - Collider_QuadSetAC }; +static ColChkResetFunc sACResetFuncs[] = { + Collider_ResetJntSphAC, + Collider_ResetCylinderAC, + Collider_ResetTrisAC, + Collider_ResetQuadAC, +}; -// Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks) +/** + * Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks) + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3114); } - D_8011DF08[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sACResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colAcCount >= COLLISION_CHECK_AC_MAX) { + if (colChkCtx->colACCount >= COLLISION_CHECK_AC_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colAcCount; - colChkCtx->colAc[colChkCtx->colAcCount++] = collider; + index = colChkCtx->colACCount; + colChkCtx->colAC[colChkCtx->colACCount++] = collider; return index; } -// Unused. Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks). -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks). + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3153); } if (func_800C0D28(globalCtx) == 1) { return -1; } - D_8011DF08[collider->shape](globalCtx, collider); + sACResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colAcCount)) { + if (!(index < colChkCtx->colACCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。| You are trying to register a location that is - // larger than the total number of data. return -1; } - colChkCtx->colAc[index] = collider; + colChkCtx->colAC[index] = collider; } else { - if (!(colChkCtx->colAcCount < COLLISION_CHECK_AC_MAX)) { + if (!(colChkCtx->colACCount < COLLISION_CHECK_AC_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } - index = colChkCtx->colAcCount; - colChkCtx->colAc[colChkCtx->colAcCount++] = collider; + index = colChkCtx->colACCount; + colChkCtx->colAC[colChkCtx->colACCount++] = collider; } return index; } -s32 (*D_8011DF18[])(GlobalContext*, Collider*) = { - Collider_JntSphSetOC, - Collider_CylinderSetOC, - Collider_TrisSetOC, - Collider_QuadSetOC, +static ColChkResetFunc sOCResetFuncs[] = { + Collider_ResetJntSphOC, + Collider_ResetCylinderOC, + Collider_ResetTrisOC, + Collider_ResetQuadOC, }; -// Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs +/** + * Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3229); } - D_8011DF18[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sOCResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colOcCount >= COLLISION_CHECK_OC_MAX) { + if (colChkCtx->colOCCount >= COLLISION_CHECK_OC_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colOcCount; - colChkCtx->colOc[colChkCtx->colOcCount++] = collider; + index = colChkCtx->colOCCount; + colChkCtx->colOC[colChkCtx->colOCCount++] = collider; return index; } -// Unused. Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3274); } - D_8011DF18[collider->shape](globalCtx, collider); + sOCResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colOcCount)) { + if (!(index < colChkCtx->colOCCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。| You are trying to register a location that is - // larger than the total number of data. return -1; } - //! @bug Should be colOc - colChkCtx->colAt[index] = collider; + //! @bug Should be colOC + colChkCtx->colAT[index] = collider; } else { - if (!(colChkCtx->colOcCount < COLLISION_CHECK_OC_MAX)) { + if (!(colChkCtx->colOCCount < COLLISION_CHECK_OC_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } - index = colChkCtx->colOcCount; - colChkCtx->colOc[colChkCtx->colOcCount++] = collider; + index = colChkCtx->colOCCount; + colChkCtx->colOC[colChkCtx->colOCCount++] = collider; } return index; } +/** + * Sets a line as an OC collider for this frame. + * OC lines are entirely unused, and do not even have collision check functions. + */ s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, OcLine* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - func_8005D3A4(globalCtx, collider); - if (!(colChkCtx->colOcLineCount < COLLISION_CHECK_OC_LINE_MAX)) { + Collider_ResetLineOC(globalCtx, collider); + if (!(colChkCtx->colLineCount < COLLISION_CHECK_OC_LINE_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n"); return -1; } - index = colChkCtx->colOcLineCount; - colChkCtx->colOcLine[colChkCtx->colOcLineCount++] = collider; + index = colChkCtx->colLineCount; + colChkCtx->colLine[colChkCtx->colLineCount++] = collider; return index; } -s32 func_8005DF2C(ColliderBody* body) { - if (!(body->toucherFlags & 1)) { +/** + * Skips AT elements that are off. + */ +s32 CollisionCheck_SkipTouch(ColliderInfo* info) { + if (!(info->toucherFlags & TOUCH_ON)) { return 1; } return 0; } -s32 func_8005DF50(ColliderBody* body) { - if (!(body->bumperFlags & 1)) { +/** + * Skips AC elements that are off. + */ +s32 CollisionCheck_SkipBump(ColliderInfo* info) { + if (!(info->bumperFlags & BUMP_ON)) { return 1; } return 0; } -s32 func_8005DF74(ColliderBody* left, ColliderBody* right) { - if (!(left->toucher.flags & right->bumper.flags)) { +/** + * If the AT element has no dmgFlags in common with the AC element, no collision happens. + */ +s32 CollisionCheck_NoSharedFlags(ColliderInfo* atInfo, ColliderInfo* acInfo) { + if (!(atInfo->toucher.dmgFlags & acInfo->bumper.dmgFlags)) { return 1; } return 0; } -void func_8005DF9C(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { +/** + * Spawns no blood drops. + * Used by collider types HIT1, HIT3, HIT5, METAL, NONE, WOOD, HARD, and TREE + */ +void CollisionCheck_NoBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { } -// Blue EffectSpark -void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns blue blood drops. + * Used by collider types HIT0 and HIT8. + */ +void CollisionCheck_BlueBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { static EffectSparkInit D_8015D8A0; - s32 sp24; + s32 effectIndex; - D_8015D8A0.position.x = (s32)pos->x; - D_8015D8A0.position.y = (s32)pos->y; - D_8015D8A0.position.z = (s32)pos->z; + D_8015D8A0.position.x = v->x; + D_8015D8A0.position.y = v->y; + D_8015D8A0.position.z = v->z; D_8015D8A0.uDiv = 5; D_8015D8A0.vDiv = 5; D_8015D8A0.colorStart[0].r = 10; @@ -1328,17 +1506,20 @@ void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { D_8015D8A0.speed = 8.0f; D_8015D8A0.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015D8A0); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015D8A0); } -// Green EffectSpark -void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns green blood drops. + * Used by collider types HIT2 and HIT6. No actor has type HIT2. + */ +void CollisionCheck_GreenBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { static EffectSparkInit D_8015DD68; - s32 sp24; + s32 effectIndex; - D_8015DD68.position.x = (s32)pos->x; - D_8015DD68.position.y = (s32)pos->y; - D_8015DD68.position.z = (s32)pos->z; + D_8015DD68.position.x = v->x; + D_8015DD68.position.y = v->y; + D_8015DD68.position.z = v->z; D_8015DD68.uDiv = 5; D_8015DD68.vDiv = 5; D_8015DD68.colorStart[0].r = 10; @@ -1378,505 +1559,245 @@ void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { D_8015DD68.speed = 8.0f; D_8015DD68.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015DD68); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015DD68); } -void func_8005E26C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns a burst of water. + * Used by collider type HIT4, which no actor has. + */ +void CollisionCheck_WaterBurst(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { EffectSsSibuki_SpawnBurst(globalCtx, pos); - func_80062B80(globalCtx, pos); + CollisionCheck_SpawnWaterDroplets(globalCtx, pos); } -void func_8005E2A4(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { - func_80062A28(globalCtx, v); +/** + * Spawns red blood drops. + * Used by collider type HIT7, which no actor has. + */ +void CollisionCheck_RedBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { + CollisionCheck_SpawnRedBlood(globalCtx, v); } -void func_8005E2C8(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { - func_80062A28(globalCtx, v); +/** + * Spawns red blood drops. + * Unused. + */ +void CollisionCheck_RedBloodUnused(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { + CollisionCheck_SpawnRedBlood(globalCtx, v); } -void func_8005E2EC(GlobalContext* globalCtx, ColliderBody* colliderBody, Collider* collider, Vec3f* arg3) { +/** + * Plays sound effects and displays hitmarks for solid-type AC colliders (METAL, WOOD, HARD, and TREE) + */ +void CollisionCheck_HitSolid(GlobalContext* globalCtx, ColliderInfo* info, Collider* collider, Vec3f* hitPos) { s32 flags; - flags = colliderBody->toucherFlags & 0x18; - if (flags == 0 && collider->type != COLTYPE_METAL_SHIELD) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg3); + flags = info->toucherFlags & TOUCH_SFX_NONE; + if (flags == TOUCH_SFX_NORMAL && collider->colType != COLTYPE_METAL) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; - } - if (flags == 0) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 3, arg3); + } else if (flags == TOUCH_SFX_NORMAL) { // collider->colType == COLTYPE_METAL + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_METAL, hitPos); if (collider->actor == NULL) { - func_80062D60(globalCtx, arg3); - return; + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, hitPos); + } else { + CollisionCheck_SpawnShieldParticlesMetalSound(globalCtx, hitPos, &collider->actor->projectedPos); } - func_80062DAC(globalCtx, arg3, &collider->actor->projectedPos); - return; - } - if (flags == 8) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg3); + } else if (flags == TOUCH_SFX_HARD) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; - } - if (flags == 0x10) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 1, arg3); + } else if (flags == TOUCH_SFX_WOOD) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_DUST, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; } } -s32 func_8005E4F8(Collider* left, ColliderBody* rightBody) { - if (left->actor != NULL) { - if (ACTORTYPE_PLAYER == left->actor->type) { - if (rightBody->flags == 0) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - } else if (rightBody->flags == 1) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } else if (rightBody->flags == 2) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } else if (rightBody->flags == 3) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } +/** + * Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType. + */ +s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) { + if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) { + if (acInfo->elemType == ELEMTYPE_UNK0) { + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK1) { + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK2) { + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK3) { + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } return 1; } -typedef struct { - u8 unk00; - u8 unk01; -} D_8011DF40_s; +static ColChkBloodFunc sBloodFuncs[] = { + CollisionCheck_NoBlood, CollisionCheck_BlueBlood, CollisionCheck_GreenBlood, + CollisionCheck_WaterBurst, CollisionCheck_RedBlood, CollisionCheck_RedBloodUnused, +}; +static HitInfo sHitInfo[] = { + { BLOOD_BLUE, HIT_WHITE }, { BLOOD_NONE, HIT_DUST }, { BLOOD_GREEN, HIT_DUST }, { BLOOD_NONE, HIT_WHITE }, + { BLOOD_WATER, HIT_NONE }, { BLOOD_NONE, HIT_RED }, { BLOOD_GREEN, HIT_WHITE }, { BLOOD_RED, HIT_WHITE }, + { BLOOD_BLUE, HIT_RED }, { BLOOD_NONE, HIT_SOLID }, { BLOOD_NONE, HIT_NONE }, { BLOOD_NONE, HIT_SOLID }, + { BLOOD_NONE, HIT_SOLID }, { BLOOD_NONE, HIT_WOOD }, +}; -void func_8005E604(GlobalContext* globalCtx, Collider* left, ColliderBody* leftBody, Collider* right, - ColliderBody* rightBody, Vec3f* arg5) { - - static void (*D_8011DF28[])(GlobalContext*, Collider*, Vec3f*) = { - func_8005DF9C, func_8005DFAC, func_8005E10C, func_8005E26C, func_8005E2A4, func_8005E2C8, - }; - - static D_8011DF40_s D_8011DF40[] = { - { 1, 0 }, { 0, 1 }, { 2, 1 }, { 0, 0 }, { 3, 5 }, { 0, 2 }, { 2, 0 }, - { 4, 0 }, { 1, 2 }, { 0, 3 }, { 0, 5 }, { 0, 3 }, { 0, 3 }, { 0, 4 }, - }; - - if (rightBody->bumperFlags & 0x40) { +/** + * Handles hitmarks, blood, and sound effects for each AC collision, determined by the AC collider's colType + */ +void CollisionCheck_HitEffects(GlobalContext* globalCtx, Collider* at, ColliderInfo* atInfo, Collider* ac, + ColliderInfo* acInfo, Vec3f* hitPos) { + if (acInfo->bumperFlags & BUMP_NO_HITMARK) { return; } - if (!(leftBody->toucherFlags & 0x20) && leftBody->toucherFlags & 0x40) { + if (!(atInfo->toucherFlags & TOUCH_AT_HITMARK) && atInfo->toucherFlags & TOUCH_DREW_HITMARK) { return; } - if (right->actor != NULL) { - (*D_8011DF28[D_8011DF40[right->type].unk00])(globalCtx, right, arg5); + if (ac->actor != NULL) { + sBloodFuncs[sHitInfo[ac->colType].blood](globalCtx, ac, hitPos); } - if (right->actor != NULL) { - if (D_8011DF40[right->type].unk01 == 3) { - func_8005E2EC(globalCtx, leftBody, right, arg5); - } else if (D_8011DF40[right->type].unk01 == 4) { - if (left->actor == NULL) { - func_80062CD4(globalCtx, arg5); + if (ac->actor != NULL) { + if (sHitInfo[ac->colType].effect == HIT_SOLID) { + CollisionCheck_HitSolid(globalCtx, atInfo, ac, hitPos); + } else if (sHitInfo[ac->colType].effect == HIT_WOOD) { + if (at->actor == NULL) { + CollisionCheck_SpawnShieldParticles(globalCtx, hitPos); Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { - func_80062E14(globalCtx, arg5, &left->actor->projectedPos); + CollisionCheck_SpawnShieldParticlesWood(globalCtx, hitPos, &at->actor->projectedPos); } - } else if (D_8011DF40[right->type].unk01 != 5) { - EffectSsHitMark_SpawnFixedScale(globalCtx, D_8011DF40[right->type].unk01, arg5); - if ((rightBody->bumperFlags & 0x20) == 0) { - func_8005E4F8(left, rightBody); + } else if (sHitInfo[ac->colType].effect != HIT_NONE) { + EffectSsHitMark_SpawnFixedScale(globalCtx, sHitInfo[ac->colType].effect, hitPos); + if (!(acInfo->bumperFlags & BUMP_NO_SWORD_SFX)) { + CollisionCheck_SwordHitAudio(at, acInfo); } } } else { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg5); - if (right->actor == NULL) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); + if (ac->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &right->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } } -void func_8005E800(Collider* left, Collider* right) { - left->atFlags |= 4; - right->acFlags |= 0x80; +/** + * Sets the flags to indicate an attack bounced off an AC_HARD collider. + */ +void CollisionCheck_SetBounce(Collider* at, Collider* ac) { + at->atFlags |= AT_BOUNCED; + ac->acFlags |= AC_BOUNCED; } -// Set AT to AC collision -s32 func_8005E81C(GlobalContext* globalCtx, Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collider* right, - ColliderBody* rightBody, Vec3f* rightv, Vec3f* arg7) { +/** + * Performs the AC collision between the AT element and AC element that collided. + */ +s32 CollisionCheck_SetATvsAC(GlobalContext* globalCtx, Collider* at, ColliderInfo* atInfo, Vec3f* atPos, Collider* ac, + ColliderInfo* acInfo, Vec3f* acPos, Vec3f* hitPos) { - if (right->acFlags & 4 && left->actor != NULL && right->actor != NULL) { - func_8005E800(left, right); + if (ac->acFlags & AC_HARD && at->actor != NULL && ac->actor != NULL) { + CollisionCheck_SetBounce(at, ac); } - if (!(rightBody->bumperFlags & 8)) { - left->atFlags |= 2; - left->at = right->actor; - leftBody->atHit = right; - leftBody->atHitItem = rightBody; - leftBody->toucherFlags |= 2; - if (left->actor != NULL) { - left->actor->colChkInfo.atHitEffect = rightBody->bumper.effect; + if (!(acInfo->bumperFlags & BUMP_NO_AT_INFO)) { + at->atFlags |= AT_HIT; + at->at = ac->actor; + atInfo->atHit = ac; + atInfo->atHitInfo = acInfo; + atInfo->toucherFlags |= TOUCH_HIT; + if (at->actor != NULL) { + at->actor->colChkInfo.atHitEffect = acInfo->bumper.effect; } } - right->acFlags |= 2; - right->ac = left->actor; - rightBody->acHit = left; - rightBody->acHitItem = leftBody; - rightBody->bumperFlags |= 2; - if (right->actor != NULL) { - right->actor->colChkInfo.acHitEffect = leftBody->toucher.effect; + ac->acFlags |= AC_HIT; + ac->ac = at->actor; + acInfo->acHit = at; + acInfo->acHitInfo = atInfo; + acInfo->bumperFlags |= BUMP_HIT; + if (ac->actor != NULL) { + ac->actor->colChkInfo.acHitEffect = atInfo->toucher.effect; } - rightBody->bumper.unk_06.x = (s16)arg7->x; - rightBody->bumper.unk_06.y = (s16)arg7->y; - rightBody->bumper.unk_06.z = (s16)arg7->z; - if (!(leftBody->toucherFlags & 0x20) && right->type != COLTYPE_METAL_SHIELD && - right->type != COLTYPE_WOODEN_SHIELD && right->type != COLTYPE_UNK12) { - rightBody->bumperFlags |= 0x80; + acInfo->bumper.hitPos.x = hitPos->x; + acInfo->bumper.hitPos.y = hitPos->y; + acInfo->bumper.hitPos.z = hitPos->z; + if (!(atInfo->toucherFlags & TOUCH_AT_HITMARK) && ac->colType != COLTYPE_METAL && ac->colType != COLTYPE_WOOD && + ac->colType != COLTYPE_HARD) { + acInfo->bumperFlags |= BUMP_DRAW_HITMARK; } else { - func_8005E604(globalCtx, left, leftBody, right, rightBody, arg7); - leftBody->toucherFlags |= 0x40; + CollisionCheck_HitEffects(globalCtx, at, atInfo, ac, acInfo, hitPos); + atInfo->toucherFlags |= TOUCH_DREW_HITMARK; } return 1; } -void CollisionCheck_AC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left; - ColliderJntSph* right; - ColliderJntSphItem* lItem; - ColliderJntSphItem* rItem; - f32 sp8C; - f32 sp88; - f32 temp_f0; - Vec3f sp78; - Vec3f sp6C; - Vec3f sp60; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atItem; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + ColliderJntSphElement* acElem; + f32 overlapSize; + f32 centerDist; - left = (ColliderJntSph*)l; - right = (ColliderJntSph*)r; - if (left->count <= 0 || left->list == NULL || right->count <= 0 || right->list == NULL) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + if (at->count > 0 && at->elements != NULL && ac->count > 0 && ac->elements != NULL) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_SphVsSphOverlapCenter(&lItem->dim.worldSphere, &rItem->dim.worldSphere, &sp8C, &sp88) == 1) { - sp6C.x = lItem->dim.worldSphere.center.x; - sp6C.y = lItem->dim.worldSphere.center.y; - sp6C.z = lItem->dim.worldSphere.center.z; - sp60.x = rItem->dim.worldSphere.center.x; - sp60.y = rItem->dim.worldSphere.center.y; - sp60.z = rItem->dim.worldSphere.center.z; - if (!IS_ZERO(sp88)) { - temp_f0 = rItem->dim.worldSphere.radius / sp88; - sp78.x = (((sp6C.x - sp60.x) * temp_f0) + sp60.x); - sp78.y = (((sp6C.y - sp60.y) * temp_f0) + sp60.y); - sp78.z = (((sp6C.z - sp60.z) * temp_f0) + sp60.z); - } else { - Math_Vec3f_Copy(&sp78, &sp6C); - } - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp6C, &right->base, &rItem->body, &sp60, &sp78); - if (!(right->base.maskB & 0x40)) { - return; - } - } - } - } -} - -void CollisionCheck_AC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - ColliderJntSphItem* lItem; - f32 sp80; - f32 sp7C; - Vec3f sp70; - Vec3f sp64; - Vec3f sp58; - f32 temp_f0; - - if (left->count <= 0 || left->list == NULL || right->dim.radius <= 0 || right->dim.height <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_SphVsCylOverlapCenterDist(&lItem->dim.worldSphere, &right->dim, &sp80, &sp7C) != 0) { - sp64.x = lItem->dim.worldSphere.center.x; - sp64.y = lItem->dim.worldSphere.center.y; - sp64.z = lItem->dim.worldSphere.center.z; - sp58.x = right->dim.pos.x; - sp58.y = right->dim.pos.y; - sp58.z = right->dim.pos.z; - if (!IS_ZERO(sp7C)) { - temp_f0 = right->dim.radius / sp7C; - if (temp_f0 <= 1.0f) { - sp70.x = ((sp64.x - sp58.x) * temp_f0) + sp58.x; - sp70.y = ((sp64.y - sp58.y) * temp_f0) + sp58.y; - sp70.z = ((sp64.z - sp58.z) * temp_f0) + sp58.z; - } else { - Math_Vec3f_Copy(&sp70, &sp64); - } - } else { - Math_Vec3f_Copy(&sp70, &sp64); - } - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp64, &right->base, &right->body, &sp58, &sp70); - return; - } - } -} - -void CollisionCheck_AC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderJntSph* right = (ColliderJntSph*)r; - f32 sp9C; - f32 sp98; - ColliderJntSphItem* rItem; - Vec3f sp88; - Vec3f sp7C; - Vec3f sp70; - f32 temp_f0; - - if (right->count <= 0 || right->list == NULL || left->dim.radius <= 0 || left->dim.height <= 0) { - return; - } - if (func_8005DF2C(&left->body) == 1) { - return; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_SphVsCylOverlapCenterDist(&rItem->dim.worldSphere, &left->dim, &sp9C, &sp98) != 0) { - sp7C.x = left->dim.pos.x; - sp7C.y = left->dim.pos.y; - sp7C.z = left->dim.pos.z; - sp70.x = rItem->dim.worldSphere.center.x; - sp70.y = rItem->dim.worldSphere.center.y; - sp70.z = rItem->dim.worldSphere.center.z; - if (!IS_ZERO(sp98)) { - temp_f0 = (f32)rItem->dim.worldSphere.radius / sp98; - if (temp_f0 <= 1.0f) { - sp88.x = ((sp7C.x - sp70.x) * temp_f0) + sp70.x; - sp88.y = ((sp7C.y - sp70.y) * temp_f0) + sp70.y; - sp88.z = ((sp7C.z - sp70.z) * temp_f0) + sp70.z; - } else { - Math_Vec3f_Copy(&sp88, &sp7C); - } - } else { - Math_Vec3f_Copy(&sp88, &sp7C); - } - func_8005E81C(globalCtx, &left->base, &left->body, &sp7C, &right->base, &rItem->body, &sp70, &sp88); - if (!(right->base.maskB & 0x40)) { - break; - } - } - } -} - -void CollisionCheck_AC_JntSphVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderJntSphItem* lItem; - ColliderTrisItem* rItem; - Vec3f sp6C; - Vec3f sp60; - Vec3f sp54; - - if (left->count <= 0 || left->list == NULL || right->count <= 0 || right->list == NULL) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &rItem->dim, &sp6C) == 1) { - sp60.x = lItem->dim.worldSphere.center.x; - sp60.y = lItem->dim.worldSphere.center.y; - sp60.z = lItem->dim.worldSphere.center.z; - sp54.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp54.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp54.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp60, &right->base, &rItem->body, &sp54, &sp6C); - return; - } - } - } -} - -void CollisionCheck_AC_TrisVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderTrisItem* lItem; - ColliderJntSph* right = (ColliderJntSph*)r; - ColliderJntSphItem* rItem; - Vec3f sp7C; - Vec3f sp70; - Vec3f sp64; - - if (right->count > 0 && right->list != NULL) { - if (left->count > 0 && left->list != NULL) { - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { + continue; + } + if (Math3D_SphVsSphOverlapCenter(&atItem->dim.worldSphere, &acElem->dim.worldSphere, &overlapSize, + ¢erDist) == 1) { + f32 acToHit; + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + + atPos.x = atItem->dim.worldSphere.center.x; + atPos.y = atItem->dim.worldSphere.center.y; + atPos.z = atItem->dim.worldSphere.center.z; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + if (!IS_ZERO(centerDist)) { + acToHit = acElem->dim.worldSphere.radius / centerDist; + hitPos.x = (((atPos.x - acPos.x) * acToHit) + acPos.x); + hitPos.y = (((atPos.y - acPos.y) * acToHit) + acPos.y); + hitPos.z = (((atPos.z - acPos.z) * acToHit) + acPos.z); + } else { + Math_Vec3f_Copy(&hitPos, &atPos); } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &lItem->dim, &sp7C) == 1) { - Math_Vec3s_ToVec3f(&sp64, &rItem->dim.worldSphere.center); - sp70.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp70.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp70.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp70, &right->base, &rItem->body, &sp64, - &sp7C); - if (!(right->base.maskB & 0x40)) { - return; - } - } - } - } - } - } -} - -static TriNorm D_8015E230; -static TriNorm D_8015E268; - -void CollisionCheck_AC_JntSphVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderQuad* right = (ColliderQuad*)r; - Vec3f sp7C; - ColliderJntSphItem* lItem; - Vec3f sp6C; - Vec3f sp60; - - if (left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) == 1) { - return; - } - Math3D_TriNorm(&D_8015E230, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E268, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &D_8015E230, &sp7C) == 1 || - Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &D_8015E268, &sp7C) == 1) { - Math_Vec3s_ToVec3f(&sp6C, &lItem->dim.worldSphere.center); - - sp60.x = - (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp60.y = - (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp60.z = - (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp6C, &right->base, &right->body, &sp60, &sp7C); - return; - } - } - } -} - -static TriNorm D_8015E2A0; -static TriNorm D_8015E2D8; - -void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* right = (ColliderJntSph*)r; - Vec3f sp88; - ColliderQuad* left = (ColliderQuad*)l; - ColliderJntSphItem* rItem; - Vec3f sp74; - Vec3f sp68; - - if (right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) != 1) { - Math3D_TriNorm(&D_8015E2A0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E2D8, &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &D_8015E2A0, &sp88) != 1 && - Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &D_8015E2D8, &sp88) != 1) { - continue; - } - if (func_8005D218(globalCtx, left, &sp88) != 0) { - sp68.x = rItem->dim.worldSphere.center.x; - sp68.y = rItem->dim.worldSphere.center.y; - sp68.z = rItem->dim.worldSphere.center.z; - - sp74.x = - (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp74.y = - (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp74.z = - (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp74, &right->base, &rItem->body, &sp68, &sp88); - if ((right->base.maskB & 0x40) == 0) { + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { return; } } @@ -1885,152 +1806,453 @@ void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckCont } } -void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - f32 sp6C; - f32 sp68; - Vec3f sp5C; - Vec3f sp50; - Vec3f sp44; - f32 temp_f0; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atItem; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + f32 overlapSize; + f32 centerDist; - if (left->dim.radius <= 0 || left->dim.height <= 0 || right->dim.radius <= 0 || right->dim.height <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1) { - return; - } - if (func_8005DF2C(&left->body) == 1) { - return; - } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; - } - if (Math3D_CylOutsideCylDist(&left->dim, &right->dim, &sp6C, &sp68) == 1) { - Math_Vec3s_ToVec3f(&sp50, &left->dim.pos); - Math_Vec3s_ToVec3f(&sp44, &right->dim.pos); - if (!IS_ZERO(sp68)) { - temp_f0 = (f32)right->dim.radius / sp68; - sp5C.y = (f32)right->dim.pos.y + (f32)right->dim.yShift + (f32)right->dim.height * 0.5f; - sp5C.x = ((f32)left->dim.pos.x - right->dim.pos.x) * temp_f0 + right->dim.pos.x; - sp5C.z = ((f32)left->dim.pos.z - right->dim.pos.z) * temp_f0 + right->dim.pos.z; - } else { - Math_Vec3s_ToVec3f(&sp5C, &right->dim.pos); - } - func_8005E81C(globalCtx, &left->base, &left->body, &sp50, &right->base, &right->body, &sp44, &sp5C); - } -} - -void CollisionCheck_AC_CylVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* rItem; - Vec3f sp68; - Vec3f sp5C; - Vec3f sp50; - - if (left->dim.radius > 0 && left->dim.height > 0 && right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) == 1) { + if (at->count > 0 && at->elements != NULL && ac->dim.radius > 0 && ac->dim.height > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { return; } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&left->body, &rItem->body) == 1) { + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { continue; } - if (Math3D_CylTriVsIntersect(&left->dim, &rItem->dim, &sp68) == 1) { - Math_Vec3s_ToVec3f(&sp5C, &left->dim.pos); + if (Math3D_SphVsCylOverlapCenterDist(&atItem->dim.worldSphere, &ac->dim, &overlapSize, ¢erDist)) { + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + f32 acToHit; - sp50.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp50.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp50.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &left->body, &sp5C, &right->base, &rItem->body, &sp50, &sp68); + atPos.x = atItem->dim.worldSphere.center.x; + atPos.y = atItem->dim.worldSphere.center.y; + atPos.z = atItem->dim.worldSphere.center.z; + acPos.x = ac->dim.pos.x; + acPos.y = ac->dim.pos.y; + acPos.z = ac->dim.pos.z; + if (!IS_ZERO(centerDist)) { + acToHit = ac->dim.radius / centerDist; + if (acToHit <= 1.0f) { + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &hitPos); return; } } } } -static Vec3f D_8015E310; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + f32 overlapSize; + f32 centerDist; + ColliderJntSphElement* acElem; -void CollisionCheck_AC_TrisVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - ColliderTrisItem* lItem; - Vec3f sp60; - Vec3f sp54; - - if (right->dim.radius > 0 && right->dim.height > 0 && left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) == 1) { + if (ac->count > 0 && ac->elements != NULL && at->dim.radius > 0 && at->dim.height > 0) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { return; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &right->body) == 1) { + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { continue; } + if (Math3D_SphVsCylOverlapCenterDist(&acElem->dim.worldSphere, &at->dim, &overlapSize, ¢erDist)) { + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + f32 acToHit; - if (Math3D_CylTriVsIntersect(&right->dim, &lItem->dim, &D_8015E310) == 1) { - sp60.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp60.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp60.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - Math_Vec3s_ToVec3f(&sp54, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp60, &right->base, &right->body, &sp54, - &D_8015E310); + atPos.x = at->dim.pos.x; + atPos.y = at->dim.pos.y; + atPos.z = at->dim.pos.z; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + if (!IS_ZERO(centerDist)) { + acToHit = acElem->dim.worldSphere.radius / centerDist; + if (acToHit <= 1.0f) { + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + break; + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atSph; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acTri; + Vec3f hitPos; + + if (at->count > 0 && at->elements != NULL && ac->count > 0 && ac->elements != NULL) { + for (atSph = at->elements; atSph < at->elements + at->count; atSph++) { + if (CollisionCheck_SkipTouch(&atSph->info) == 1) { + continue; + } + for (acTri = ac->elements; acTri < ac->elements + ac->count; acTri++) { + if (CollisionCheck_SkipBump(&acTri->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atSph->info, &acTri->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&atSph->dim.worldSphere, &acTri->dim, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = atSph->dim.worldSphere.center.x; + atPos.y = atSph->dim.worldSphere.center.y; + atPos.z = atSph->dim.worldSphere.center.z; + acPos.x = (acTri->dim.vtx[0].x + acTri->dim.vtx[1].x + acTri->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acTri->dim.vtx[0].y + acTri->dim.vtx[1].y + acTri->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acTri->dim.vtx[0].z + acTri->dim.vtx[1].z + acTri->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atSph->info, &atPos, &ac->base, &acTri->info, + &acPos, &hitPos); + return; + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + ColliderJntSphElement* acElem; + Vec3f hitPos; + + if (ac->count > 0 && ac->elements != NULL && at->count > 0 && at->elements != NULL) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &atItem->dim, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&acPos, &acElem->dim.worldSphere.center); + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + return; + } + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E230; + static TriNorm D_8015E268; + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; + Vec3f hitPos; + ColliderJntSphElement* atItem; + + if (at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E230, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E268, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&atItem->dim.worldSphere, &D_8015E230, &hitPos) == 1 || + Math3D_TriVsSphIntersect(&atItem->dim.worldSphere, &D_8015E268, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&atPos, &atItem->dim.worldSphere.center); + + acPos.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &hitPos); return; } } } } -static TriNorm D_8015E320; -static TriNorm D_8015E358; -static Vec3f D_8015E390; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E2A0; + static TriNorm D_8015E2D8; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + Vec3f hitPos; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderJntSphElement* acElem; -void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderQuad* right = (ColliderQuad*)r; - Vec3f sp64; - Vec3f sp58; - Vec3f sp4C; - Vec3f sp40; + if (ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E2A0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E2D8, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_8015E2A0, &hitPos) == 1 || + Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_8015E2D8, &hitPos) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &hitPos)) { + Vec3f atPos; + Vec3f acPos; - if (left->dim.height <= 0 || left->dim.radius <= 0) { - return; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + return; + } + } + } + } } - if (func_8005DF2C(&left->body) == 1 || func_8005DF50(&right->body) == 1) { - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + f32 deadSpace; + f32 centerDistXZ; + Vec3f hitPos; + + if (at->dim.radius > 0 && at->dim.height > 0 && ac->dim.radius > 0 && ac->dim.height > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + if (Math3D_CylOutsideCylDist(&at->dim, &ac->dim, &deadSpace, ¢erDistXZ) == 1) { + Vec3f atPos; + Vec3f acPos; + f32 acToHit; + + Math_Vec3s_ToVec3f(&atPos, &at->dim.pos); + Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos); + if (!IS_ZERO(centerDistXZ)) { + acToHit = ac->dim.radius / centerDistXZ; + hitPos.y = (f32)ac->dim.pos.y + ac->dim.yShift + ac->dim.height * 0.5f; + hitPos.x = ((f32)at->dim.pos.x - ac->dim.pos.x) * acToHit + ac->dim.pos.x; + hitPos.z = ((f32)at->dim.pos.z - ac->dim.pos.z) * acToHit + ac->dim.pos.z; + } else { + Math_Vec3s_ToVec3f(&hitPos, &ac->dim.pos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &hitPos); + } } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; + Vec3f hitPos; + + if (at->dim.radius > 0 && at->dim.height > 0 && ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_CylTriVsIntersect(&at->dim, &acElem->dim, &hitPos) == 1) { + Vec3f atpos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&atpos, &at->dim.pos); + + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atpos, &ac->base, &acElem->info, &acPos, + &hitPos); + return; + } + } } - Math3D_TriNorm(&D_8015E320, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E358, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - if (Math3D_CylTriVsIntersect(&left->dim, &D_8015E320, &D_8015E390) == 1) { - Math_Vec3s_ToVec3f(&sp64, &left->dim.pos); - sp58.x = - (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * 0.25f; - sp58.y = - (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * 0.25f; - sp58.z = - (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * 0.25f; - func_8005E81C(globalCtx, &left->base, &left->body, &sp64, &right->base, &right->body, &sp58, &D_8015E390); - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E310; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + Vec3f atPos; + Vec3f acPos; + + if (ac->dim.radius > 0 && ac->dim.height > 0 && at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + + if (Math3D_CylTriVsIntersect(&ac->dim, &atItem->dim, &D_8015E310) == 1) { + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E310); + return; + } + } } - if (Math3D_CylTriVsIntersect(&left->dim, &D_8015E358, &D_8015E390) == 1) { - Math_Vec3s_ToVec3f(&sp4C, &left->dim.pos); - sp40.x = (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp40.y = (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp40.z = (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp4C, &right->base, &right->body, &sp40, &D_8015E390); +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E320; + static TriNorm D_8015E358; + static Vec3f D_8015E390; + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; + + if (at->dim.height > 0 && at->dim.radius > 0) { + if (CollisionCheck_SkipTouch(&at->info) == 1 || CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E320, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E358, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + if (Math3D_CylTriVsIntersect(&at->dim, &D_8015E320, &D_8015E390) == 1) { + Vec3f atPos1; + Vec3f acPos1; + + Math_Vec3s_ToVec3f(&atPos1, &at->dim.pos); + acPos1.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos1.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos1.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos1, &ac->base, &ac->info, &acPos1, + &D_8015E390); + } else if (Math3D_CylTriVsIntersect(&at->dim, &D_8015E358, &D_8015E390) == 1) { + Vec3f atPos2; + Vec3f acPos2; + + Math_Vec3s_ToVec3f(&atPos2, &at->dim.pos); + acPos2.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos2.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos2.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos2, &ac->base, &ac->info, &acPos2, + &D_8015E390); + } } } @@ -2038,52 +2260,52 @@ static s8 sBssDummy0; static s8 sBssDummy1; static s8 sBssDummy2; -static TriNorm D_8015E3A0; -static TriNorm D_8015E3D8; -static Vec3f D_8015E410; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E3A0; + static TriNorm D_8015E3D8; + static Vec3f D_8015E410; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderCylinder* ac = (ColliderCylinder*)colAC; -void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - Vec3f sp64; - Vec3f sp58; - Vec3f sp4C; - Vec3f sp40; - - if (right->dim.height <= 0 || right->dim.radius <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1 || func_8005DF2C(&left->body) == 1) { - return; - } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; - } - Math3D_TriNorm(&D_8015E3A0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E3D8, &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - if (Math3D_CylTriVsIntersect(&right->dim, &D_8015E3A0, &D_8015E410) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E410) != 0) { - sp64.x = (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp64.y = (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp64.z = (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - Math_Vec3s_ToVec3f(&sp58, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &left->body, &sp64, &right->base, &right->body, &sp58, &D_8015E410); + if (ac->dim.height > 0 && ac->dim.radius > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1 || CollisionCheck_SkipTouch(&at->info) == 1) { return; } - } - if (Math3D_CylTriVsIntersect(&right->dim, &D_8015E3D8, &D_8015E410) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E410) != 0) { - sp4C.x = (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp4C.y = (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp4C.z = (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - Math_Vec3s_ToVec3f(&sp40, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &left->body, &sp4C, &right->base, &right->body, &sp40, &D_8015E410); + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E3A0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E3D8, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + if (Math3D_CylTriVsIntersect(&ac->dim, &D_8015E3A0, &D_8015E410) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E410)) { + Vec3f atPos1; + Vec3f acPos1; + + atPos1.x = (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos1.y = (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos1.z = (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + Math_Vec3s_ToVec3f(&acPos1, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos1, &ac->base, &ac->info, &acPos1, + &D_8015E410); + return; + } + } + if (Math3D_CylTriVsIntersect(&ac->dim, &D_8015E3D8, &D_8015E410) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E410)) { + Vec3f atPos2; + Vec3f acPos2; + + atPos2.x = (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos2.y = (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos2.z = (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + Math_Vec3s_ToVec3f(&acPos2, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos2, &ac->base, &ac->info, &acPos2, + &D_8015E410); + } } } } @@ -2093,39 +2315,41 @@ static s8 sBssDummy4; static s8 sBssDummy5; static s8 sBssDummy6; -static Vec3f D_8015E420; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E420; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; -void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* lItem; - ColliderTrisItem* rItem; - - Vec3f sp5C; - Vec3f sp50; - - if (right->count > 0 && right->list != NULL && left->count > 0 && left->list != NULL) { - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + if (ac->count > 0 && ac->elements != NULL && at->count > 0 && at->elements != NULL) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { continue; } - if (Math3D_TriVsTriIntersect(&lItem->dim, &rItem->dim, &D_8015E420) == 1) { - sp5C.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp5C.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp5C.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - sp50.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp50.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp50.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp5C, &right->base, &rItem->body, &sp50, - &D_8015E420); + if (Math3D_TriVsTriIntersect(&atItem->dim, &acElem->dim, &D_8015E420) == 1) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &D_8015E420); return; } } @@ -2138,45 +2362,92 @@ static s8 sBssDummy8; static s8 sBssDummy9; static s8 sBssDummy10; -static Vec3f D_8015E430; -static TriNorm D_8015E440; -static TriNorm D_8015E478; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E430; + static TriNorm D_8015E440; + static TriNorm D_8015E478; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderQuad* ac = (ColliderQuad*)colAC; -void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderQuad* right = (ColliderQuad*)r; - ColliderTrisItem* lItem; - Vec3f sp68; - Vec3f sp5C; + if (at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E440, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E478, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + if (Math3D_TriVsTriIntersect(&D_8015E440, &atItem->dim, &D_8015E430) == 1 || + Math3D_TriVsTriIntersect(&D_8015E478, &atItem->dim, &D_8015E430) == 1) { + Vec3f atPos; + Vec3f acPos; - if (left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) != 1) { - Math3D_TriNorm(&D_8015E440, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E478, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_TriVsTriIntersect(&D_8015E440, &lItem->dim, &D_8015E430) == 1 || - Math3D_TriVsTriIntersect(&D_8015E478, &lItem->dim, &D_8015E430) == 1) { - sp68.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp68.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp68.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - sp5C.x = (right->dim.quad[0].x + - (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp5C.y = (right->dim.quad[0].y + - (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp5C.z = (right->dim.quad[0].z + - (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp68, &right->base, &right->body, &sp5C, - &D_8015E430); + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + acPos.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E430); + return; + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E4B0; + static TriNorm D_8015E4C0; + static TriNorm D_8015E4F8; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; + + if (ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E4C0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E4F8, &at->dim.quad[1], &at->dim.quad[0], &at->dim.quad[2]); + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsTriIntersect(&D_8015E4C0, &acElem->dim, &D_8015E4B0) == 1 || + Math3D_TriVsTriIntersect(&D_8015E4F8, &acElem->dim, &D_8015E4B0) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E4B0)) { + Vec3f atPos; + Vec3f acPos; + + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &D_8015E4B0); return; } } @@ -2184,104 +2455,53 @@ void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContex } } -static Vec3f D_8015E4B0; -static TriNorm D_8015E4C0; -static TriNorm D_8015E4F8; - -void CollisionCheck_AC_QuadVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* rItem; - Vec3f sp68; - Vec3f sp5C; - - if (right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) != 1) { - Math3D_TriNorm(&D_8015E4C0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E4F8, &left->dim.quad[1], &left->dim.quad[0], &left->dim.quad[2]); - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsTriIntersect(&D_8015E4C0, &rItem->dim, &D_8015E4B0) == 1 || - Math3D_TriVsTriIntersect(&D_8015E4F8, &rItem->dim, &D_8015E4B0) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E4B0) != 0) { - sp5C.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp5C.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp5C.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - sp68.x = (left->dim.quad[0].x + - (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp68.y = (left->dim.quad[0].y + - (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp68.z = (left->dim.quad[0].z + - (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp68, &right->base, &rItem->body, &sp5C, - &D_8015E4B0); - return; - } - } - } - } - } -} - -static TriNorm D_8015E530[2]; -static Vec3f D_8015E598; -static TriNorm D_8015E5A8[2]; - -void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderQuad* right = (ColliderQuad*)r; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E530[2]; + static Vec3f D_8015E598; + static TriNorm D_8015E5A8[2]; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; s32 i; s32 j; - Vec3f sp6C; - Vec3f sp60; - if (func_8005DF2C(&left->body) == 1) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { return; } - if (func_8005DF50(&right->body) == 1) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { return; } - if (func_8005DF74(&left->body, &right->body) == 1) { + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { return; } - Math3D_TriNorm(&D_8015E5A8[0], &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E5A8[1], &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - Math3D_TriNorm(&D_8015E530[0], &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E530[1], &right->dim.quad[2], &right->dim.quad[1], &right->dim.quad[0]); + Math3D_TriNorm(&D_8015E5A8[0], &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E5A8[1], &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + Math3D_TriNorm(&D_8015E530[0], &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E530[1], &ac->dim.quad[2], &ac->dim.quad[1], &ac->dim.quad[0]); for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { if (Math3D_TriVsTriIntersect(&D_8015E5A8[j], &D_8015E530[i], &D_8015E598) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E598) != 0) { - sp6C.x = - (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp6C.y = - (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp6C.z = - (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - sp60.x = (right->dim.quad[0].x + - (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp60.y = (right->dim.quad[0].y + - (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp60.z = (right->dim.quad[0].z + - (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp6C, &right->base, &right->body, &sp60, - &D_8015E598); + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E598)) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + acPos.x = + (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = + (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = + (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E598); return; } } @@ -2289,174 +2509,184 @@ void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContex } } -// D_8011DF5C ColliderJntSph -void func_80060EBC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderJntSph* col = (ColliderJntSph*)collider; - ColliderJntSphItem* item; - Vec3f sp24; +/** + * Sets a ColliderJntSph's hit effects + */ +void CollisionCheck_SetJntSphHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderJntSph* jntSph = (ColliderJntSph*)collider; + ColliderJntSphElement* element; + Vec3f hitPos; - for (item = col->list; item < col->list + col->count; item++) { - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp24, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &col->base, &item->body, &sp24); - item->body.acHitItem->toucherFlags |= 0x40; - return; - } - } + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + if ((element->info.bumperFlags & BUMP_DRAW_HITMARK) && (element->info.acHitInfo != NULL) && + !(element->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &jntSph->base, + &element->info, &hitPos); + element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + return; } } } -// D_8011DF5C ColliderCylinder -void func_80060F94(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderCylinder* item = (ColliderCylinder*)collider; - Vec3f sp28; +/** + * Sets a ColliderCylinder's hit effects + */ +void CollisionCheck_SetCylHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + Vec3f hitPos; - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp28, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &item->base, &item->body, &sp28); - item->body.acHitItem->toucherFlags |= 0x40; - } + if ((cylinder->info.bumperFlags & BUMP_DRAW_HITMARK) && (cylinder->info.acHitInfo != NULL) && + !(cylinder->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &cylinder->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, cylinder->info.acHit, cylinder->info.acHitInfo, &cylinder->base, + &cylinder->info, &hitPos); + cylinder->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + } +} + +/** + * Sets a ColliderTris's hit effects + */ +void CollisionCheck_SetTrisHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderTris* tris = (ColliderTris*)collider; + ColliderTrisElement* element; + Vec3f hitPos; + + for (element = tris->elements; element < tris->elements + tris->count; element++) { + if ((element->info.bumperFlags & BUMP_DRAW_HITMARK) && (element->info.acHitInfo != NULL) && + !(element->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &tris->base, + &element->info, &hitPos); + element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + return; } } } -// D_8011DF5C ColliderTris -void func_80061028(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderTris* col = (ColliderTris*)collider; - ColliderTrisItem* item; - Vec3f sp24; +/** + * Sets a ColliderQuad's hit effects + */ +void CollisionCheck_SetQuadHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + Vec3f hitPos; - for (item = col->list; item < col->list + col->count; item++) { - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp24, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &col->base, &item->body, &sp24); - item->body.acHitItem->toucherFlags |= 0x40; - return; - } - } - } + if ((quad->info.bumperFlags & BUMP_DRAW_HITMARK) && (quad->info.acHitInfo != NULL) && + !(quad->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &quad->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, quad->info.acHit, quad->info.acHitInfo, &quad->base, &quad->info, &hitPos); + quad->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; } } -// D_8011DF5C ColliderQuad -void func_8006110C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderQuad* item = (ColliderQuad*)collider; - Vec3f sp28; +static ColChkApplyFunc sColChkApplyFuncs[] = { + CollisionCheck_SetJntSphHitFX, + CollisionCheck_SetCylHitFX, + CollisionCheck_SetTrisHitFX, + CollisionCheck_SetQuadHitFX, +}; - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp28, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &item->base, &item->body, &sp28); - item->body.acHitItem->toucherFlags |= 0x40; - } - } - } -} - -void func_800611A0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Handles hit effects for each AC collider that had an AC collision. Spawns hitmarks and plays sound effects. + */ +void CollisionCheck_SetHitEffects(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { Collider** col; - Collider* temp; - static void (*D_8011DF5C[4])(GlobalContext*, CollisionCheckContext*, Collider*) = { - func_80060EBC, - func_80060F94, - func_80061028, - func_8006110C, - }; + for (col = colChkCtx->colAC; col < colChkCtx->colAC + colChkCtx->colACCount; col++) { + Collider* colAC = *col; - for (col = colChkCtx->colAc; col < colChkCtx->colAc + colChkCtx->colAcCount; col++) { - temp = *col; - if (temp != NULL) { - if (temp->acFlags & 1) { - if (temp->actor == NULL || temp->actor->update != NULL) { - (*D_8011DF5C[temp->shape])(globalCtx, colChkCtx, temp); - } + if (colAC != NULL && colAC->acFlags & AC_ON) { + if (colAC->actor != NULL && colAC->actor->update == NULL) { + continue; } + sColChkApplyFuncs[colAC->shape](globalCtx, colChkCtx, colAC); } } } -void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +static ColChkVsFunc sACVsFuncs[4][4] = { + { CollisionCheck_AC_JntSphVsJntSph, CollisionCheck_AC_JntSphVsCyl, CollisionCheck_AC_JntSphVsTris, + CollisionCheck_AC_JntSphVsQuad }, + { CollisionCheck_AC_CylVsJntSph, CollisionCheck_AC_CylVsCyl, CollisionCheck_AC_CylVsTris, + CollisionCheck_AC_CylVsQuad }, + { CollisionCheck_AC_TrisVsJntSph, CollisionCheck_AC_TrisVsCyl, CollisionCheck_AC_TrisVsTris, + CollisionCheck_AC_TrisVsQuad }, + { CollisionCheck_AC_QuadVsJntSph, CollisionCheck_AC_QuadVsCyl, CollisionCheck_AC_QuadVsTris, + CollisionCheck_AC_QuadVsQuad }, +}; + +/** + * Iterates through all AC colliders, performing AC collisions with the AT collider. + */ +void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT) { Collider** col; - Collider* temp; - static void (*D_8011DF6C[4][4])(GlobalContext*, CollisionCheckContext*, Collider*, Collider*) = { - { CollisionCheck_AC_JntSphVsJntSph, CollisionCheck_AC_JntSphVsCyl, CollisionCheck_AC_JntSphVsTris, - CollisionCheck_AC_JntSphVsQuad }, - { CollisionCheck_AC_CylVsJntSph, CollisionCheck_AC_CylVsCyl, CollisionCheck_AC_CylVsTris, - CollisionCheck_AC_CylVsQuad }, - { CollisionCheck_AC_TrisVsJntSph, CollisionCheck_AC_TrisVsCyl, CollisionCheck_AC_TrisVsTris, - CollisionCheck_AC_TrisVsQuad }, - { CollisionCheck_AC_QuadVsJntSph, CollisionCheck_AC_QuadVsCyl, CollisionCheck_AC_QuadVsTris, - CollisionCheck_AC_QuadVsQuad }, - }; - for (col = colChkCtx->colAc; col < colChkCtx->colAc + colChkCtx->colAcCount; col++) { - temp = *col; - if (temp == NULL) { - continue; - } else if (!(temp->acFlags & 1)) { - continue; - } else if (temp->actor != NULL && temp->actor->update == NULL) { - continue; - } else if (!((temp->acFlags & collider->atFlags) & 0x38)) { - continue; - } else if (collider == temp) { - continue; - } + for (col = colChkCtx->colAC; col < colChkCtx->colAC + colChkCtx->colACCount; col++) { + Collider* colAC = *col; - else if ((collider->atFlags & 0x40) || collider->actor == NULL || temp->actor != collider->actor) { - D_8011DF6C[collider->shape][temp->shape](globalCtx, colChkCtx, collider, temp); - } - } -} - -// Test Attack Collisions -void func_8006139C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** colAt; - Collider* colliderAt; - - if (colChkCtx->colAtCount != 0) { - if (colChkCtx->colAcCount != 0) { - for (colAt = colChkCtx->colAt; colAt < colChkCtx->colAt + colChkCtx->colAtCount; colAt++) { - colliderAt = *colAt; - if (colliderAt != NULL) { - if (colliderAt->atFlags & 1) { - if ((colliderAt->actor == NULL) || (colliderAt->actor->update != NULL)) { - CollisionCheck_AC(globalCtx, colChkCtx, colliderAt); - } - } - } + if (colAC != NULL && colAC->acFlags & AC_ON) { + if (colAC->actor != NULL && colAC->actor->update == NULL) { + continue; + } + if ((colAC->acFlags & colAT->atFlags & AC_TYPE_ALL) && (colAT != colAC)) { + if (!(colAT->atFlags & AT_SELF) && colAT->actor != NULL && colAC->actor == colAT->actor) { + continue; + } + sACVsFuncs[colAT->shape][colAC->shape](globalCtx, colChkCtx, colAT, colAC); } - func_800611A0(globalCtx, colChkCtx); } } } -// Get mass type -s32 func_8006146C(u8 mass) { - if (mass == 0xFF) { - return 0; +/** + * Iterates through all AT colliders, testing them for AC collisions with each AC collider, setting the info regarding + * the collision for each AC and AT collider that collided. Then spawns hitmarks and plays sound effects for each + * successful collision. To collide, an AT collider must share a type (PLAYER, ENEMY, or BOMB) with the AC collider and + * the toucher and bumper elements that overlapped must share a dmgFlag. + */ +void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { + Collider** col; + + if (colChkCtx->colATCount == 0 || colChkCtx->colACCount == 0) { + return; } - if (mass == 0xFE) { - return 1; + for (col = colChkCtx->colAT; col < colChkCtx->colAT + colChkCtx->colATCount; col++) { + Collider* colAT = *col; + + if (colAT != NULL && colAT->atFlags & AT_ON) { + if (colAT->actor != NULL && colAT->actor->update == NULL) { + continue; + } + CollisionCheck_AC(globalCtx, colChkCtx, colAT); + } } - return 2; + CollisionCheck_SetHitEffects(globalCtx, colChkCtx); } -// SetOC collision, perform elastic collision -void func_800614A4(Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collider* right, ColliderBody* rightBody, - Vec3f* rightv, f32 arg6) { - f32 temp_f0; - f32 leftDisplacementFactor; - f32 rightDisplacementFactor; +/** + * Get mass type. Immobile colliders cannot be pushed, while heavy colliders can only be pushed by heavy and immobile + * colliders. + */ +s32 CollisionCheck_GetMassType(u8 mass) { + if (mass == MASS_IMMOVABLE) { + return MASSTYPE_IMMOVABLE; + } + if (mass == MASS_HEAVY) { + return MASSTYPE_HEAVY; + } + return MASSTYPE_NORMAL; +} + +/** + * Sets OC collision flags for OC collider overlaps. If both colliders are attached to actors and can push, + * also performs an elastic collision where both colliders are moved apart in proportion to their masses. + */ +void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* leftPos, Collider* right, + ColliderInfo* rightInfo, Vec3f* rightPos, f32 overlap) { + f32 pad; + f32 leftDispRatio; + f32 rightDispRatio; f32 xzDist; f32 leftMass; f32 rightMass; @@ -2464,441 +2694,502 @@ void func_800614A4(Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collide f32 inverseTotalMass; f32 xDelta; f32 zDelta; - Actor* leftActor; - Actor* rightActor; - s32 rightMassType; + Actor* leftActor = left->actor; + Actor* rightActor = right->actor; s32 leftMassType; + s32 rightMassType; - leftActor = left->actor; - rightActor = right->actor; - left->maskA |= 2; + left->ocFlags1 |= OC1_HIT; left->oc = rightActor; - leftBody->ocFlags |= 2; - if ((right->maskB & 8) != 0) { - left->maskB |= 1; + leftInfo->ocElemFlags |= OCELEM_HIT; + if (right->ocFlags2 & OC2_TYPE_PLAYER) { + left->ocFlags2 |= OC2_HIT_PLAYER; } right->oc = leftActor; - right->maskA |= 2; - rightBody->ocFlags |= 2; - if ((left->maskB & 8) != 0) { - right->maskB |= 1; + right->ocFlags1 |= OC1_HIT; + rightInfo->ocElemFlags |= OCELEM_HIT; + if (left->ocFlags2 & OC2_TYPE_PLAYER) { + right->ocFlags2 |= OC2_HIT_PLAYER; } - if (leftActor == NULL || rightActor == NULL || (left->maskA & 4) || (right->maskA & 4)) { + if (leftActor == NULL || rightActor == NULL || left->ocFlags1 & OC1_NO_PUSH || right->ocFlags1 & OC1_NO_PUSH) { return; } - leftMassType = func_8006146C(leftActor->colChkInfo.mass); - rightMassType = func_8006146C(rightActor->colChkInfo.mass); + rightMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass); + leftMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass); leftMass = leftActor->colChkInfo.mass; rightMass = rightActor->colChkInfo.mass; totalMass = leftMass + rightMass; if (IS_ZERO(totalMass)) { - totalMass = (leftMass = rightMass = 1.0f) * 2; + leftMass = rightMass = 1.0f; + totalMass = 2.0f; } - xDelta = rightv->x - leftv->x; - zDelta = rightv->z - leftv->z; + xDelta = rightPos->x - leftPos->x; + zDelta = rightPos->z - leftPos->z; xzDist = sqrtf(SQ(xDelta) + SQ(zDelta)); - if (leftMassType == 0) { - if (rightMassType == 0) { + if (rightMassType == MASSTYPE_IMMOVABLE) { + if (leftMassType == MASSTYPE_IMMOVABLE) { return; - } else { - leftDisplacementFactor = 0; - rightDisplacementFactor = 1; + } else { // leftMassType == MASS_HEAVY | MASS_NORMAL + leftDispRatio = 0; + rightDispRatio = 1; } - } else if (leftMassType == 1) { - if (rightMassType == 0) { - leftDisplacementFactor = 1; - rightDisplacementFactor = 0; - } else if (rightMassType == 1) { - leftDisplacementFactor = 0.5f; - rightDisplacementFactor = 0.5f; - } else { - leftDisplacementFactor = 0; - rightDisplacementFactor = 1; + } else if (rightMassType == MASSTYPE_HEAVY) { + if (leftMassType == MASSTYPE_IMMOVABLE) { + leftDispRatio = 1; + rightDispRatio = 0; + } else if (leftMassType == MASSTYPE_HEAVY) { + leftDispRatio = 0.5f; + rightDispRatio = 0.5f; + } else { // leftMassType == MASS_NORMAL + leftDispRatio = 0; + rightDispRatio = 1; } - } else { - if (rightMassType == 2) { + } else { // rightMassType == MASS_NORMAL + if (leftMassType == MASSTYPE_NORMAL) { inverseTotalMass = 1 / totalMass; - leftDisplacementFactor = rightMass * inverseTotalMass; - rightDisplacementFactor = leftMass * inverseTotalMass; - } else { - leftDisplacementFactor = 1; - rightDisplacementFactor = 0; + leftDispRatio = rightMass * inverseTotalMass; + rightDispRatio = leftMass * inverseTotalMass; + } else { // leftMassType == MASS_HEAVY | MASS_IMMOVABLE + leftDispRatio = 1; + rightDispRatio = 0; } } if (!IS_ZERO(xzDist)) { - temp_f0 = arg6 / xzDist; - xDelta *= temp_f0; - zDelta *= temp_f0; - leftActor->colChkInfo.displacement.x += -xDelta * leftDisplacementFactor; - leftActor->colChkInfo.displacement.z += -zDelta * leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += xDelta * rightDisplacementFactor; - rightActor->colChkInfo.displacement.z += zDelta * rightDisplacementFactor; - } else if (!(arg6 == 0.0f)) { - leftActor->colChkInfo.displacement.x += -arg6 * leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += arg6 * rightDisplacementFactor; + xDelta *= overlap / xzDist; + zDelta *= overlap / xzDist; + leftActor->colChkInfo.displacement.x += -xDelta * leftDispRatio; + leftActor->colChkInfo.displacement.z += -zDelta * leftDispRatio; + rightActor->colChkInfo.displacement.x += xDelta * rightDispRatio; + rightActor->colChkInfo.displacement.z += zDelta * rightDispRatio; + } else if (!(overlap == 0.0f)) { + leftActor->colChkInfo.displacement.x += -overlap * leftDispRatio; + rightActor->colChkInfo.displacement.x += overlap * rightDispRatio; } else { - leftActor->colChkInfo.displacement.x -= leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += rightDisplacementFactor; + leftActor->colChkInfo.displacement.x -= leftDispRatio; + rightActor->colChkInfo.displacement.x += rightDispRatio; } } +/** + * OC overlap check for two JntSphs + */ void CollisionCheck_OC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; + ColliderJntSphElement* leftElem; ColliderJntSph* right = (ColliderJntSph*)r; - ColliderJntSphItem* lItem; - ColliderJntSphItem* rItem; - f32 sp74; - Vec3f sp68; - Vec3f sp5C; + ColliderJntSphElement* rightElem; + f32 overlap; - if (left->count > 0 && left->list != NULL && right->count > 0 && right->list != NULL) { - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (!(lItem->body.ocFlags & 1)) { + if (left->count > 0 && left->elements != NULL && right->count > 0 && right->elements != NULL) { + for (leftElem = left->elements; leftElem < left->elements + left->count; leftElem++) { + if (!(leftElem->info.ocElemFlags & OCELEM_ON)) { continue; } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (!(rItem->body.ocFlags & 1)) { + for (rightElem = right->elements; rightElem < right->elements + right->count; rightElem++) { + if (!(rightElem->info.ocElemFlags & OCELEM_ON)) { continue; } - if (Math3D_SphVsSphOverlap(&lItem->dim.worldSphere, &rItem->dim.worldSphere, &sp74) == 1) { - Math_Vec3s_ToVec3f(&sp68, &lItem->dim.worldSphere.center); - Math_Vec3s_ToVec3f(&sp5C, &rItem->dim.worldSphere.center); - func_800614A4(&left->base, &lItem->body, &sp68, &right->base, &rItem->body, &sp5C, sp74); + if (Math3D_SphVsSphOverlap(&leftElem->dim.worldSphere, &rightElem->dim.worldSphere, &overlap) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &leftElem->dim.worldSphere.center); + Math_Vec3s_ToVec3f(&rightPos, &rightElem->dim.worldSphere.center); + CollisionCheck_SetOCvsOC(&left->base, &leftElem->info, &leftPos, &right->base, &rightElem->info, + &rightPos, overlap); } } } } } +/** + * OC overlap check for a JntSph and Cylinder + */ void CollisionCheck_OC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; + ColliderJntSphElement* leftElem; ColliderCylinder* right = (ColliderCylinder*)r; - ColliderJntSphItem* lItem; - f32 sp78; - Vec3f sp6C; - Vec3f sp60; + f32 overlap; - if (left->count > 0 && left->list != NULL) { - if (!(right->base.maskA & 1)) { - return; - } - if (!(right->body.ocFlags & 1)) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (!(lItem->body.ocFlags & 1)) { - continue; - } - if (Math3D_SphVsCylOverlapDist(&lItem->dim.worldSphere, &right->dim, &sp78) == 1) { - Math_Vec3s_ToVec3f(&sp6C, &lItem->dim.worldSphere.center); - Math_Vec3s_ToVec3f(&sp60, &right->dim.pos); - func_800614A4(&left->base, &lItem->body, &sp6C, &right->base, &right->body, &sp60, sp78); + if (left->count > 0 && left->elements != NULL) { + if ((right->base.ocFlags1 & OC1_ON) && (right->info.ocElemFlags & OCELEM_ON)) { + for (leftElem = left->elements; leftElem < left->elements + left->count; leftElem++) { + if (!(leftElem->info.ocElemFlags & OCELEM_ON)) { + continue; + } + if (Math3D_SphVsCylOverlapDist(&leftElem->dim.worldSphere, &right->dim, &overlap) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &leftElem->dim.worldSphere.center); + Math_Vec3s_ToVec3f(&rightPos, &right->dim.pos); + CollisionCheck_SetOCvsOC(&left->base, &leftElem->info, &leftPos, &right->base, &right->info, + &rightPos, overlap); + } } } } } +/** + * OC overlap check for a Cylinder and JntSph + */ void CollisionCheck_OC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { CollisionCheck_OC_JntSphVsCyl(globalCtx, colChkCtx, r, l); } +/** + * OC overlap check for two Cylinders + */ void CollisionCheck_OC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderCylinder* left = (ColliderCylinder*)l; ColliderCylinder* right = (ColliderCylinder*)r; - f32 sp4C; - Vec3f sp40; - Vec3f sp34; + f32 deadSpace; - if (!(left->base.maskA & 1) || !(right->base.maskA & 1)) { - return; - } - if (!(left->body.ocFlags & 1) || !(right->body.ocFlags & 1)) { - return; - } - if (Math3D_CylOutsideCyl(&left->dim, &right->dim, &sp4C) == 1) { - Math_Vec3s_ToVec3f(&sp40, &left->dim.pos); - Math_Vec3s_ToVec3f(&sp34, &right->dim.pos); - func_800614A4(&left->base, &left->body, &sp40, &right->base, &right->body, &sp34, sp4C); + if ((left->base.ocFlags1 & OC1_ON) && (right->base.ocFlags1 & OC1_ON)) { + if ((left->info.ocElemFlags & OCELEM_ON) && (right->info.ocElemFlags & OCELEM_ON)) { + if (Math3D_CylOutsideCyl(&left->dim, &right->dim, &deadSpace) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &left->dim.pos); + Math_Vec3s_ToVec3f(&rightPos, &right->dim.pos); + CollisionCheck_SetOCvsOC(&left->base, &left->info, &leftPos, &right->base, &right->info, &rightPos, + deadSpace); + } + } } } -// CollisionCheck_OC test ? -s32 func_80061BF4(Collider* collider) { - if (!(collider->maskA & 1)) { +/** + * Skip any OC colliders that are off + */ +s32 CollisionCheck_SkipOC(Collider* collider) { + if (!(collider->ocFlags1 & OC1_ON)) { return 1; } return 0; } -// CollisionCheck_OC test ? -s32 func_80061C18(Collider* arg0, Collider* arg1) { - if (!((arg0->maskA & arg1->maskB) & 0x38) || !((arg0->maskB & arg1->maskA) & 0x38) || - ((arg0->maskB & 2) && (arg1->maskB & 4)) || ((arg1->maskB & 2) && (arg0->maskB & 4))) { +/** + * Checks for OC compatibility. There are three conditions: + * First, each collider must have an OC flag corresponding to the other's OC type. + * Second, OC2_UNK1 and OC2_UNK2 can't collide with each other (has something to do with horses?) + * Third, the colliders can't collide if they belong to the same actor + */ +s32 CollisionCheck_Incompatible(Collider* left, Collider* right) { + if (!(left->ocFlags1 & right->ocFlags2 & OC1_TYPE_ALL) || !(left->ocFlags2 & right->ocFlags1 & OC1_TYPE_ALL) || + ((left->ocFlags2 & OC2_UNK1) && (right->ocFlags2 & OC2_UNK2)) || + ((right->ocFlags2 & OC2_UNK1) && (left->ocFlags2 & OC2_UNK2))) { return 1; } - if (arg0->actor == arg1->actor) { + if (left->actor == right->actor) { return 1; } return 0; } +static ColChkVsFunc sOCVsFuncs[4][4] = { + { CollisionCheck_OC_JntSphVsJntSph, CollisionCheck_OC_JntSphVsCyl, NULL, NULL }, + { CollisionCheck_OC_CylVsJntSph, CollisionCheck_OC_CylVsCyl, NULL, NULL }, + { NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL }, +}; + +/** + * Iterates through all OC colliders and collides them with all subsequent OC colliders on the list. During an OC + * collision, colliders with overlapping elements move away from each other so that their elements no longer overlap. + * The relative amount each collider is pushed is determined by the collider's mass. Only JntSph and Cylinder colliders + * can collide, and each collider must have the OC flag corresponding to the other's OC type. Additionally, OC2_UNK1 + * cannot collide with OC2_UNK2, nor can two colliders that share an actor. + */ void CollisionCheck_OC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** phi_s2; - Collider** phi_s0; - Collider** new_var; - Collider** new_var2; - void (*test)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*); + Collider** left; + Collider** right; + ColChkVsFunc vsFunc; - static void (*D_8011DFAC[4][4])(GlobalContext*, CollisionCheckContext*, Collider*, Collider*) = { - { CollisionCheck_OC_JntSphVsJntSph, CollisionCheck_OC_JntSphVsCyl, NULL, NULL }, - { CollisionCheck_OC_CylVsJntSph, CollisionCheck_OC_CylVsCyl, NULL, NULL }, - { NULL, NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL }, - }; - - for (phi_s2 = colChkCtx->colOc; phi_s2 < colChkCtx->colOc + colChkCtx->colOcCount; phi_s2++) { - if (*phi_s2 == NULL || func_80061BF4(*phi_s2) == 1) { + for (left = colChkCtx->colOC; left < colChkCtx->colOC + colChkCtx->colOCCount; left++) { + if (*left == NULL || CollisionCheck_SkipOC(*left) == 1) { continue; } - for (phi_s0 = phi_s2 + 1; phi_s0 < colChkCtx->colOc + colChkCtx->colOcCount; phi_s0++) { - if (*phi_s0 == NULL || func_80061BF4(*phi_s0) == 1 || func_80061C18(*phi_s2, *phi_s0) == 1) { + for (right = left + 1; right < colChkCtx->colOC + colChkCtx->colOCCount; right++) { + if (*right == NULL || CollisionCheck_SkipOC(*right) == 1 || + CollisionCheck_Incompatible(*left, *right) == 1) { continue; } - new_var2 = phi_s0; - new_var = phi_s2; - test = D_8011DFAC[(*new_var)->shape][(*new_var2)->shape]; - if (test == NULL) { - osSyncPrintf("CollisionCheck_OC():未対応 %d, %d\n", (*new_var)->shape, (*new_var2)->shape); - // EUC-JP: 未対応 | Not compatible + vsFunc = sOCVsFuncs[(*left)->shape][(*right)->shape]; + if (vsFunc == NULL) { + // Not compatible + osSyncPrintf("CollisionCheck_OC():未対応 %d, %d\n", (*left)->shape, (*right)->shape); continue; } - (*test)(globalCtx, colChkCtx, *new_var, *new_var2); + vsFunc(globalCtx, colChkCtx, *left, *right); } } } -// Initialize CollisionCheckInfo -void func_80061E48(CollisionCheckInfo* info) { - static CollisionCheckInfo init = { NULL, { 0, 0, 0 }, 10, 10, 0, 50, 8, 0, 0, 0, 0 }; +/** + * Initializes CollisionCheckInfo to default values + */ +void CollisionCheck_InitInfo(CollisionCheckInfo* info) { + static CollisionCheckInfo init = { + NULL, { 0.0f, 0.0f, 0.0f }, 10, 10, 0, 50, 8, 0, 0, 0, 0, + }; + *info = init; } -void func_80061E8C(CollisionCheckInfo* info) { +/** + * Resets ColisionCheckInfo fields other than DamageTable, mass, and dim. + */ +void CollisionCheck_ResetDamage(CollisionCheckInfo* info) { info->damage = 0; info->damageEffect = 0; info->atHitEffect = 0; info->acHitEffect = 0; - info->displacement.z = 0.0f; - info->displacement.y = 0.0f; - info->displacement.x = 0.0f; + info->displacement.x = info->displacement.y = info->displacement.z = 0.0f; } -void func_80061EB0(CollisionCheckInfo* info, CollisionCheckInfoInit* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Does not set a damage table or the unused unk_14. + * Unused, as all actors that don't set a damage table set their CollisionCheckInfo manually + */ +void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init) { info->health = init->health; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; info->mass = init->mass; } -void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Does not set the unused unk_14 + */ +void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) { info->health = init->health; info->damageTable = damageTable; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; info->mass = init->mass; } -void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Sets the unused unk_14 + */ +void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) { info->health = init->health; info->damageTable = damageTable; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; - info->unk_14 = init->unk_06; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; + info->cylYShift = init->cylYShift; info->mass = init->mass; } -void func_80061F2C(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init) { - func_80061EFC(info, DamageTable_Get(index), init); +/** + * Sets up CollisionCheckInfo using the values in Init and a preset damage table. Sets the unused unk_14. + * Unused, as all actors that use a preset damage table set their CollisionCheckInfo manually. + */ +void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init) { + CollisionCheck_SetInfo2(info, DamageTable_Get(index), init); } -// Apply AC damage effect -void func_80061F64(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, ColliderBody* body) { +/** + * Apply AC damage effect + */ +void CollisionCheck_ApplyDamage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, + ColliderInfo* info) { DamageTable* tbl; - u32 flags; - s32 i; f32 damage; - s32 tblLookup; - if (collider->actor == NULL || !(collider->acFlags & 2)) { + if (collider->actor == NULL || !(collider->acFlags & AC_HIT)) { return; } - if (!(body->bumperFlags & 2) || (body->bumperFlags & 0x10)) { + if (!(info->bumperFlags & BUMP_HIT) || info->bumperFlags & BUMP_NO_DAMAGE) { return; } - if (body->acHitItem == NULL) { + if (info->acHitInfo == NULL) { __assert("pclobj_elem->ac_hit_elem != NULL", "../z_collision_check.c", 6493); } tbl = collider->actor->colChkInfo.damageTable; if (tbl == NULL) { - damage = (f32)body->acHitItem->toucher.damage - (f32)body->bumper.defense; + damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense; if (damage < 0) { damage = 0; } } else { - for (i = 0, flags = body->acHitItem->toucher.flags; i < 0x20; i++, flags >>= 1) { + s32 i; + u32 flags = info->acHitInfo->toucher.dmgFlags; + + for (i = 0; i < 0x20; i++, flags >>= 1) { if (flags == 1) { break; } } - tblLookup = tbl->table[i]; - damage = tblLookup & 0xF; - collider->actor->colChkInfo.damageEffect = tblLookup >> 4 & 0xF; + damage = tbl->table[i] & 0xF; + collider->actor->colChkInfo.damageEffect = tbl->table[i] >> 4 & 0xF; } - if (!(collider->acFlags & 4)) { - collider->actor->colChkInfo.damage = (u32)(collider->actor->colChkInfo.damage + damage); + if (!(collider->acFlags & AC_HARD)) { + collider->actor->colChkInfo.damage += damage; } } -// Apply ColliderJntSph AC damage effect -void func_8006216C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderJntSph AC damage effect + */ +void CollisionCheck_ApplyDamageJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderJntSph* jntSph = (ColliderJntSph*)collider; s32 i; - if (!(jntSph->count > 0) || jntSph->list == NULL) { - return; - } - for (i = 0; i < jntSph->count; i++) { - func_80061F64(globalCtx, colChkCtx, &jntSph->base, &jntSph->list[i].body); + if (jntSph->count > 0 && jntSph->elements != NULL) { + for (i = 0; i < jntSph->count; i++) { + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &jntSph->base, &jntSph->elements[i].info); + } } } -// Apply ColliderCylinder AC damage effect -void func_80062210(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderCylinder AC damage effect + */ +void CollisionCheck_ApplyDamageCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; - func_80061F64(globalCtx, colChkCtx, &cylinder->base, &cylinder->body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &cylinder->base, &cylinder->info); } -// Apply ColliderTris AC damage effect -void func_80062230(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderTris AC damage effect + */ +void CollisionCheck_ApplyDamageTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderTris* tris = (ColliderTris*)collider; s32 i; for (i = 0; i < tris->count; i++) { - func_80061F64(globalCtx, colChkCtx, collider, &tris->list[i].body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, collider, &tris->elements[i].info); } } -// Apply ColliderQuad AC damage effect -void func_800622C4(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderQuad AC damage effect + */ +void CollisionCheck_ApplyDamageQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; - func_80061F64(globalCtx, colChkCtx, &quad->base, &quad->body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &quad->base, &quad->info); } -// Apply all AC damage effects -void func_800622E4(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider* collider; +static ColChkApplyFunc sApplyDamageFuncs[4] = { + CollisionCheck_ApplyDamageJntSph, + CollisionCheck_ApplyDamageCyl, + CollisionCheck_ApplyDamageTris, + CollisionCheck_ApplyDamageQuad, +}; + +/** + * For all AC colliders, sets any damage effects from collisions with AT colliders to their corresponding actor's + * CollisionCheckInfo. + */ +void CollisionCheck_Damage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { s32 i; - static void (*D_8011E008[4])(GlobalContext*, CollisionCheckContext*, Collider*) = { - func_8006216C, - func_80062210, - func_80062230, - func_800622C4, - }; + for (i = 0; i < colChkCtx->colACCount; i++) { + Collider* collider = colChkCtx->colAC[i]; - for (i = 0; i < colChkCtx->colAcCount; i++) { - collider = colChkCtx->colAc[i]; - if (collider == 0) { + if (collider == NULL) { continue; } - if ((collider->acFlags & 0x40)) { + if (collider->acFlags & AC_NO_DAMAGE) { continue; } - D_8011E008[collider->shape](globalCtx, colChkCtx, collider); + sApplyDamageFuncs[collider->shape](globalCtx, colChkCtx, collider); } } -static Linef D_8015E610; - -s32 CollisionCheck_generalLineOcCheck_JntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, - Collider* collider, Vec3f* arg3, Vec3f* arg4) { +/** + * Checks if the line ab intersects any of the ColliderJntSph's elements + */ +s32 CollisionCheck_LineOC_JntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, + Vec3f* a, Vec3f* b) { + static Linef D_8015E610; ColliderJntSph* jntSph = (ColliderJntSph*)collider; - ColliderJntSphItem* item; - s32 phi_s0; - for (phi_s0 = 0; phi_s0 < jntSph->count; phi_s0++) { - item = &jntSph->list[phi_s0]; - if (!(item->body.ocFlags & 1)) { - continue; - } - D_8015E610.a = *arg3; - D_8015E610.b = *arg4; - if (Math3D_LineVsSph(&item->dim.worldSphere, &D_8015E610) == 1) { - return 1; - } - } - return 0; -} - -static Vec3f D_8015E628; -static Vec3f D_8015E638; - -s32 CollisionCheck_generalLineOcCheck_Cyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, - Collider* collider, Vec3f* arg3, Vec3f* arg4) { - ColliderCylinder* cylinder = (ColliderCylinder*)collider; - if (!(cylinder->body.ocFlags & 1)) { - return 0; - } - if (Math3D_CylVsLineSeg(&cylinder->dim, arg3, arg4, &D_8015E628, &D_8015E638) != 0) { - return 1; - } - return 0; -} - -s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, - Vec3f* arg3, Actor** arg4, s32 arg5) { - Collider* collider; - s32 (*t)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); - Collider** c; s32 i; - s32 test; - s32 result; - static s32 (*D_8011E018[4])(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*) = { - CollisionCheck_generalLineOcCheck_JntSph, - CollisionCheck_generalLineOcCheck_Cyl, - NULL, - NULL, - }; + for (i = 0; i < jntSph->count; i++) { + ColliderJntSphElement* element = &jntSph->elements[i]; - result = 0; - for (c = colChkCtx->colOc; c < colChkCtx->colOc + colChkCtx->colOcCount; c++) { - if (func_80061BF4(*c) == 1) { + if (!(element->info.ocElemFlags & OCELEM_ON)) { continue; } - test = 0; - for (i = 0; i < arg5; i++) { - if ((*c)->actor == arg4[i]) { - test = 1; + D_8015E610.a = *a; + D_8015E610.b = *b; + if (Math3D_LineVsSph(&element->dim.worldSphere, &D_8015E610) == 1) { + return true; + } + } + return false; +} + +/** + * Checks if the line segment ab intersects the ColliderCylinder + */ +s32 CollisionCheck_LineOC_Cyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, + Vec3f* b) { + static Vec3f D_8015E628; + static Vec3f D_8015E638; + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + if (!(cylinder->info.ocElemFlags & OCELEM_ON)) { + return false; + } + if (Math3D_CylVsLineSeg(&cylinder->dim, a, b, &D_8015E628, &D_8015E638) != 0) { + return true; + } + return false; +} + +static ColChkLineFunc sOCLineCheckFuncs[4] = { + CollisionCheck_LineOC_JntSph, + CollisionCheck_LineOC_Cyl, + NULL, + NULL, +}; + +/** + * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors + * on the exclusion list. Returns true if there are any intersections and false otherwise. + */ +s32 CollisionCheck_LineOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { + ColChkLineFunc lineCheck; + Collider** col; + s32 i; + s32 exclude; + s32 result = 0; + + for (col = colChkCtx->colOC; col < colChkCtx->colOC + colChkCtx->colOCCount; col++) { + if (CollisionCheck_SkipOC(*col) == 1) { + continue; + } + exclude = 0; + for (i = 0; i < numExclusions; i++) { + if ((*col)->actor == exclusions[i]) { + exclude = 1; break; } } - if (test == 1) { + if (exclude == 1) { continue; } - collider = *c; - t = D_8011E018[collider->shape]; - if (t == NULL) { - osSyncPrintf("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", collider->shape); - // EUC-JP: 未対応 %dタイプ | %d's type is not supported + lineCheck = sOCLineCheckFuncs[(*col)->shape]; + if (lineCheck == NULL) { + // type %d not supported + osSyncPrintf("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", (*col)->shape); } else { - result = (*t)(globalCtx, colChkCtx, collider, camera_3C, arg3); - if (result != 0) { + result = lineCheck(globalCtx, colChkCtx, (*col), a, b); + if (result) { break; } } @@ -2906,60 +3197,79 @@ s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckCo return result; } -s32 func_8006268C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* arg2, Vec3f* arg3) { - CollisionCheck_GeneralLineOcCheck(globalCtx, colChkCtx, arg2, arg3, NULL, 0); +/** + * Checks if the line segment ab intersects any OC colliders. Returns true if there are any intersections and false + * otherwise. Unused. + */ +s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b) { + CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, NULL, 0); } -s32 func_800626B0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, Vec3f* arg3, - Actor** arg4, s32 arg5) { - CollisionCheck_GeneralLineOcCheck(globalCtx, colChkCtx, camera_3C, arg3, arg4, arg5); +/** + * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors on the exclusion list. + * Returns true if there are any intersections and false otherwise. + */ +s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { + CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, exclusions, numExclusions); } -void Collider_CylinderUpdate(Actor* actor, ColliderCylinder* collider) { - collider->dim.pos.x = (s32)actor->posRot.pos.x; - collider->dim.pos.y = (s32)actor->posRot.pos.y; - collider->dim.pos.z = (s32)actor->posRot.pos.z; +/** + * Moves the ColliderCylinder's position to the actor's position + */ +void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider) { + collider->dim.pos.x = actor->world.pos.x; + collider->dim.pos.y = actor->world.pos.y; + collider->dim.pos.z = actor->world.pos.z; } -// Set ColliderCylinder position -void func_80062718(ColliderCylinder* collider, Vec3s* pos) { +/** + * Sets the ColliderCylinder's position + */ +void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos) { collider->dim.pos.x = pos->x; collider->dim.pos.y = pos->y; collider->dim.pos.z = pos->z; } -// Set ColliderQuad vertices -void func_80062734(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d) { +/** + * Sets the ColliderQuad's vertices + */ +void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d) { Math_Vec3f_Copy(&collider->dim.quad[2], c); Math_Vec3f_Copy(&collider->dim.quad[3], d); Math_Vec3f_Copy(&collider->dim.quad[0], a); Math_Vec3f_Copy(&collider->dim.quad[1], b); - func_8005CEDC(&collider->dim); + Collider_SetQuadMidpoints(&collider->dim); } -// Set ColliderTrisItem at index -void func_800627A0(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c) { - ColliderTrisItem* item; - f32 sp40; - f32 sp3C; - f32 sp38; - f32 sp34; +/** + * Sets the specified ColliderTrisElement's vertices + */ +void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c) { + ColliderTrisElement* element = &collider->elements[index]; + f32 nx; + f32 ny; + f32 nz; + f32 originDist; - item = &collider->list[index]; - Math_Vec3f_Copy(&item->dim.vtx[0], a); - Math_Vec3f_Copy(&item->dim.vtx[1], b); - Math_Vec3f_Copy(&item->dim.vtx[2], c); - Math3D_DefPlane(a, b, c, &sp40, &sp3C, &sp38, &sp34); - item->dim.plane.normal.x = sp40; - item->dim.plane.normal.y = sp3C; - item->dim.plane.normal.z = sp38; - item->dim.plane.originDist = sp34; + Math_Vec3f_Copy(&element->dim.vtx[0], a); + Math_Vec3f_Copy(&element->dim.vtx[1], b); + Math_Vec3f_Copy(&element->dim.vtx[2], c); + Math3D_DefPlane(a, b, c, &nx, &ny, &nz, &originDist); + element->dim.plane.normal.x = nx; + element->dim.plane.normal.y = ny; + element->dim.plane.normal.z = nz; + element->dim.plane.originDist = originDist; } -// Set ColliderTrisItem at index -void func_8006285C(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisItemDimInit* init) { - ColliderTrisItem* item = &collider->list[index]; - Collider_SetTrisItemDim(globalCtx, &item->dim, init); +/** + * Sets the specified ColliderTrisElement's dim using the values in src + */ +void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* src) { + ColliderTrisElement* element = &collider->elements[index]; + + Collider_SetTrisElementDim(globalCtx, &element->dim, src); } // Due to an unknown reason, bss ordering changed between the 2 static Vec3f variables in the function below. @@ -2971,33 +3281,40 @@ static s8 sBssDummy12; static s8 sBssDummy13; static s8 sBssDummy14; -void func_800628A4(s32 arg0, ColliderJntSph* collider) { +/** + * Updates the world spheres for all of the collider's JntSph elements attached to the specified limb + */ +void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider) { static Vec3f D_8015E648; static Vec3f D_8015CF00; // bss ordering changes here s32 i; for (i = 0; i < collider->count; i++) { - if (arg0 == collider->list[i].dim.joint) { - D_8015E648.x = collider->list[i].dim.modelSphere.center.x; - D_8015E648.y = collider->list[i].dim.modelSphere.center.y; - D_8015E648.z = collider->list[i].dim.modelSphere.center.z; + if (limb == collider->elements[i].dim.limb) { + D_8015E648.x = collider->elements[i].dim.modelSphere.center.x; + D_8015E648.y = collider->elements[i].dim.modelSphere.center.y; + D_8015E648.z = collider->elements[i].dim.modelSphere.center.z; Matrix_MultVec3f(&D_8015E648, &D_8015CF00); - collider->list[i].dim.worldSphere.center.x = (s32)D_8015CF00.x; - collider->list[i].dim.worldSphere.center.y = (s32)D_8015CF00.y; - collider->list[i].dim.worldSphere.center.z = (s32)D_8015CF00.z; - collider->list[i].dim.worldSphere.radius = - (s32)((f32)collider->list[i].dim.modelSphere.radius * collider->list[i].dim.scale); + collider->elements[i].dim.worldSphere.center.x = D_8015CF00.x; + collider->elements[i].dim.worldSphere.center.y = D_8015CF00.y; + collider->elements[i].dim.worldSphere.center.z = D_8015CF00.z; + collider->elements[i].dim.worldSphere.radius = + collider->elements[i].dim.modelSphere.radius * collider->elements[i].dim.scale; } } } -void func_80062A28(GlobalContext* globalCtx, Vec3f* v) { +/** + * Spawns red blood droplets. + * No actor has a collision type that spawns red blood. + */ +void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v) { static EffectSparkInit D_8015CF10; - s32 sp24; + s32 effectIndex; - D_8015CF10.position.x = (s32)v->x; - D_8015CF10.position.y = (s32)v->y; - D_8015CF10.position.z = (s32)v->z; + D_8015CF10.position.x = v->x; + D_8015CF10.position.y = v->y; + D_8015CF10.position.z = v->z; D_8015CF10.uDiv = 5; D_8015CF10.vDiv = 5; D_8015CF10.colorStart[0].r = 128; @@ -3037,16 +3354,20 @@ void func_80062A28(GlobalContext* globalCtx, Vec3f* v) { D_8015CF10.speed = 8.0f; D_8015CF10.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015CF10); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015CF10); } -void func_80062B80(GlobalContext* globalCtx, Vec3f* v) { +/** + * Spawns water droplets. + * No actor has a collision type that spawns water droplets. + */ +void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v) { static EffectSparkInit D_8015D3D8; - s32 sp24; + s32 effectIndex; - D_8015D3D8.position.x = (s32)v->x; - D_8015D3D8.position.y = (s32)v->y; - D_8015D3D8.position.z = (s32)v->z; + D_8015D3D8.position.x = v->x; + D_8015D3D8.position.y = v->y; + D_8015D3D8.position.z = v->z; D_8015D3D8.uDiv = 5; D_8015D3D8.vDiv = 5; D_8015D3D8.colorStart[0].r = 255; @@ -3086,90 +3407,105 @@ void func_80062B80(GlobalContext* globalCtx, Vec3f* v) { D_8015D3D8.speed = 8.0f; D_8015D3D8.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015D3D8); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015D3D8); } -void func_80062CD4(GlobalContext* globalCtx, Vec3f* v) { - static EffectShieldParticleInit init = { +/** + * Spawns streaks of light from hits against solid objects + */ +void CollisionCheck_SpawnShieldParticles(GlobalContext* globalCtx, Vec3f* v) { + static EffectShieldParticleInit initMetal = { 16, - { 0.0f, 0.0f, 0.0f }, - { 0x00, 0xC8, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0x80, 0xFF }, - { 0xFF, 0xFF, 0x00, 0xFF }, - { 0xFF, 0x40, 0x00, 0xC8 }, - { 0xFF, 0x00, 0x00, 0xFF }, + { 0, 0, 0 }, + { 0, 200, 255, 255 }, + { 255, 255, 255, 255 }, + { 255, 255, 128, 255 }, + { 255, 255, 0, 255 }, + { 255, 64, 0, 200 }, + { 255, 0, 0, 255 }, 2.1f, 35.0f, 30.0f, 8, - { 0, 0, 0, 0x00, 0x80, 0xFF, 0x00, 300 }, - 1, + { 0, 0, 0, { 0, 128, 255 }, false, 300 }, + true, }; - s32 sp24; + s32 effectIndex; - init.position.x = (s32)v->x; - init.position.y = (s32)v->y; - init.position.z = (s32)v->z; - init.lightPoint.x = init.position.x; - init.lightPoint.y = init.position.y; - init.lightPoint.z = init.position.z; + initMetal.position.x = v->x; + initMetal.position.y = v->y; + initMetal.position.z = v->z; + initMetal.lightPoint.x = initMetal.position.x; + initMetal.lightPoint.y = initMetal.position.y; + initMetal.lightPoint.z = initMetal.position.z; - Effect_Add(globalCtx, &sp24, EFFECT_SHIELD_PARTICLE, 0, 1, &init); + Effect_Add(globalCtx, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &initMetal); } -void func_80062D60(GlobalContext* globalCtx, Vec3f* v) { - func_80062CD4(globalCtx, v); +/** + * Spawns streaks of light and makes a metallic sound + */ +void CollisionCheck_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* v) { + CollisionCheck_SpawnShieldParticles(globalCtx, v); Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_80062DAC(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2) { - func_80062CD4(globalCtx, v); - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, arg2, 4, &D_801333E0, &D_801333E0, &D_801333E8); +/** + * Spawns streaks of light and makes a metallic sound at the specified position + */ +void CollisionCheck_SpawnShieldParticlesMetalSound(GlobalContext* globalCtx, Vec3f* v, Vec3f* pos) { + CollisionCheck_SpawnShieldParticles(globalCtx, v); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_80062DF4(GlobalContext* globalCtx, Vec3f* v) { - func_80062D60(globalCtx, v); +/** + * Spawns streaks of light and makes a metallic sound + */ +void CollisionCheck_SpawnShieldParticlesMetal2(GlobalContext* globalCtx, Vec3f* v) { + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, v); } -void func_80062E14(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2) { - static EffectShieldParticleInit init = { +/** + * Spawns streaks of light and makes a wooden sound + */ +void CollisionCheck_SpawnShieldParticlesWood(GlobalContext* globalCtx, Vec3f* v, Vec3f* actorPos) { + static EffectShieldParticleInit initWood = { 16, - { 0.0f, 0.0f, 0.0f }, - { 0x00, 0xC8, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0x80, 0xFF }, - { 0xFF, 0xFF, 0x00, 0xFF }, - { 0xFF, 0x40, 0x00, 0xC8 }, - { 0xFF, 0x00, 0x00, 0xFF }, + { 0, 0, 0 }, + { 0, 200, 255, 255 }, + { 255, 255, 255, 255 }, + { 255, 255, 128, 255 }, + { 255, 255, 0, 255 }, + { 255, 64, 0, 200 }, + { 255, 0, 0, 255 }, 2.1f, 35.0f, 30.0f, 8, - { 0, 0, 0, 0x00, 0x80, 0xFF, 0x00, 300 }, - 0, + { 0, 0, 0, { 0, 128, 255 }, false, 300 }, + false, }; - s32 sp24; + s32 effectIndex; - init.position.x = (s32)v->x; - init.position.y = (s32)v->y; - init.position.z = (s32)v->z; - init.lightPoint.x = init.position.x; - init.lightPoint.y = init.position.y; - init.lightPoint.z = init.position.z; + initWood.position.x = v->x; + initWood.position.y = v->y; + initWood.position.z = v->z; + initWood.lightPoint.x = initWood.position.x; + initWood.lightPoint.y = initWood.position.y; + initWood.lightPoint.z = initWood.position.z; - Effect_Add(globalCtx, &sp24, EFFECT_SHIELD_PARTICLE, 0, 1, &init); - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, arg2, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Effect_Add(globalCtx, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &initWood); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -/* +/** * Determines if the line segment connecting itemPos and itemProjPos intersects the side of a cylinder with the given * radius, height, and offset at actorPos. Returns 3 if either endpoint is inside the cylinder, otherwise returns the * number of points of intersection with the side of the cylinder. The locations of those points are put in out1 and * out2, with out1 being closer to itemPos. Line segments that pass through both bases of the cylinder are not detected. */ -s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, Vec3f* itemProjPos, Vec3f* out1, - Vec3f* out2) { +s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, + Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2) { Vec3f actorToItem; Vec3f actorToItemProj; Vec3f itemStep; @@ -3301,20 +3637,23 @@ s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* it return 1; } -s32 func_800635D0(s32 arg0) { - s32 result; +/** + * Gets damage from a sword strike using generic values, and returns 0 if the attack is + * not sword-type. Used by bosses to require that a sword attack deal the killing blow. + */ +u8 CollisionCheck_GetSwordDamage(s32 dmgFlags) { + u8 damage = 0; - result = 0; - if (arg0 & 0x00400100) { - result = 1; - } else if (arg0 & 0x03000242) { - result = 2; - } else if (arg0 & 0x48800400) { - result = 4; - } else if (arg0 & 0x04000000) { - result = 8; + if (dmgFlags & 0x00400100) { + damage = 1; + } else if (dmgFlags & 0x03000242) { + damage = 2; + } else if (dmgFlags & 0x48800400) { + damage = 4; + } else if (dmgFlags & 0x04000000) { + damage = 8; } - KREG(7) = result; - return result; + KREG(7) = damage; + return damage; } diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 64b18aea31..7f65ff5eb7 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -23,7 +23,7 @@ void func_8001D5C8(EnAObj* this, s16 params); const ActorInit En_A_Obj_InitVars = { ACTOR_EN_A_OBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnAObj), @@ -34,8 +34,22 @@ const ActorInit En_A_Obj_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 60, 0, { 0, 0, 0 } }, }; @@ -94,9 +108,9 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { sp28 = 12.0f; } - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, sp28); - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; this->dyna.bgId = BGACTOR_NEG_ONE; this->dyna.unk_160 = 0; this->dyna.unk_15C = DPM_UNK; @@ -107,13 +121,13 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { case A_OBJ_BLOCK_LARGE: case A_OBJ_BLOCK_HUGE: this->dyna.bgId = 1; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG); func_8001D5C8(this, thisx->params); break; case A_OBJ_BLOCK_SMALL_ROT: case A_OBJ_BLOCK_LARGE_ROT: this->dyna.bgId = 3; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG); func_8001D310(this, thisx->params); break; case A_OBJ_UNKNOWN_6: @@ -132,14 +146,14 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { case A_OBJ_SIGNPOST_ARROW: thisx->textId = (this->textId & 0xFF) | 0x300; // clang-format off - thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f; + thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f; // clang-format on this->unk_178 = 45.0f; func_8001D234(this, thisx->params); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - thisx->colChkInfo.mass = 0xFF; - thisx->unk_1F = 0; + thisx->colChkInfo.mass = MASS_IMMOVABLE; + thisx->targetMode = 0; break; case A_OBJ_KNOB: thisx->gravity = -1.5f; @@ -152,7 +166,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params < 5) { - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; } if (this->dyna.bgId != BGACTOR_NEG_ONE) { @@ -187,7 +201,7 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) { s16 var; if (this->dyna.actor.textId != 0) { - var = this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y; + var = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) { if (func_8002F194(&this->dyna.actor, globalCtx)) { EnAObj_SetupAction(this, func_8001D204); @@ -201,8 +215,8 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) { void func_8001D310(EnAObj* this, s16 params) { this->unk_16E = 0; this->unk_168 = 10; - this->dyna.actor.posRot.rot.y = 0; - this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot; + this->dyna.actor.world.rot.y = 0; + this->dyna.actor.shape.rot = this->dyna.actor.world.rot; EnAObj_SetupAction(this, func_8001D360); } @@ -212,13 +226,13 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) { this->unk_16E++; this->unk_170 = 20; - if ((s16)(this->dyna.actor.yawTowardsLink + 0x4000) < 0) { + if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) { this->unk_174 = -1000; } else { this->unk_174 = 1000; } - if (this->dyna.actor.yawTowardsLink < 0) { + if (this->dyna.actor.yawTowardsPlayer < 0) { this->unk_172 = -this->unk_174; } else { this->unk_172 = this->unk_174; @@ -234,12 +248,12 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) { this->dyna.actor.gravity = -1.0f; if (this->unk_170 == 0) { - this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos; + this->dyna.actor.world.pos = this->dyna.actor.home.pos; this->unk_16E = 0; this->unk_168 = 10; this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.gravity = 0.0f; - this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot; + this->dyna.actor.shape.rot = this->dyna.actor.world.rot; } } } @@ -251,14 +265,13 @@ void func_8001D480(EnAObj* this, s16 params) { void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f); - this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.posRot.rot.x >> 1); - this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.posRot.rot.z >> 1); + this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.world.rot.x >> 1); + this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.world.rot.z >> 1); if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) { if (1) { // Necessary to match - this->dyna.actor.posRot.rot.y = - ((this->dyna.actor.wallPolyRot - this->dyna.actor.posRot.rot.y) + this->dyna.actor.wallPolyRot) - - 0x8000; + this->dyna.actor.world.rot.y = + ((this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw) - 0x8000; } this->dyna.actor.bgCheckFlags &= ~0x8; } @@ -282,7 +295,7 @@ void func_8001D5C8(EnAObj* this, s16 params) { void func_8001D608(EnAObj* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ += this->dyna.unk_150; - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; + this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f); Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); @@ -303,20 +316,20 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.gravity != 0.0f) { if (this->dyna.actor.params != A_OBJ_KNOB) { - func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D); } else { - func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D); } } - this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos; - this->dyna.actor.posRot2.pos.y += this->unk_178; + this->dyna.actor.focus.pos = this->dyna.actor.world.pos; + this->dyna.actor.focus.pos.y += this->unk_178; switch (this->dyna.actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 4a67a71720..4058748f83 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -18,7 +18,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx); const ActorInit En_Item00_InitVars = { ACTOR_EN_ITEM00, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnItem00), @@ -96,7 +96,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.02f; break; case ITEM00_HEART: - this->actor.initPosRot.rot.z = Rand_CenteredFloat(65535.0f); + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); sp34 = 430.0f; Actor_SetScale(&this->actor, 0.02f); this->unk_15C = 0.02f; @@ -157,7 +157,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; case ITEM00_SHIELD_HYLIAN: this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2); @@ -166,7 +166,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; case ITEM00_TUNIC_ZORA: case ITEM00_TUNIC_GORON: @@ -176,14 +176,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; } this->unk_156 = 0; - ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawFunc_Circle, sp30); - this->actor.shape.unk_14 = 0xB4; - this->actor.posRot2.pos = this->actor.posRot.pos; + ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawCircle, sp30); + this->actor.shape.shadowAlpha = 0xB4; + this->actor.focus.pos = this->actor.world.pos; this->unk_152 = 0; if (!spawnParam8000) { @@ -286,20 +286,20 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { } else { if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) { if (this->unk_15A == -1) { - if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) { this->unk_15A = -2; } } else { - if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) { this->unk_15A = -1; } } - Math_SmoothStepToS(&this->actor.posRot.rot.x, 0, 2, 2500, 500); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500); } } if (this->actor.params == ITEM00_HEART_PIECE) { - this->actor.shape.unk_08 = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; + this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; } Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); @@ -332,9 +332,9 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) { } if (globalCtx->gameplayFrames & 1) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(10.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(10.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(10.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(10.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(10.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(10.0f); EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } @@ -364,20 +364,20 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) { if (this->actor.velocity.y < -1.5f) { this->actor.velocity.y = -1.5f; } - this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f); - this->actor.posRot.pos.x += - Math_CosS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z)); - this->actor.posRot.pos.z += - Math_SinS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z)); + this->actor.home.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f); + this->actor.world.pos.x += + Math_CosS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z)); + this->actor.world.pos.z += + Math_SinS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z)); } } if (this->actor.params <= ITEM00_RUPEE_RED) { this->actor.shape.rot.y += 960; } else if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) { - this->actor.posRot.rot.x -= 700; + this->actor.world.rot.x -= 700; this->actor.shape.rot.y += 400; - this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000; + this->actor.shape.rot.x = this->actor.world.rot.x - 0x4000; } if (this->actor.velocity.y <= 2.0f) { @@ -390,9 +390,9 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) { } if (!(globalCtx->gameplayFrames & 1)) { - pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f; - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f; - pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f; EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } @@ -421,7 +421,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) { return; } - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; if (this->actor.params <= ITEM00_RUPEE_RED) { this->actor.shape.rot.y += 960; @@ -429,10 +429,10 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = 0; } - this->actor.posRot.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f); + this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f); if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } } @@ -475,9 +475,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->colCtx.dyna.bgActorFlags[i] & 1) { dynaActor = globalCtx->colCtx.dyna.bgActors[i].actor; if ((dynaActor != NULL) && (dynaActor->update != NULL) && - ((dynaActor->posRot.pos.x != dynaActor->pos4.x) || - (dynaActor->posRot.pos.y != dynaActor->pos4.y) || - (dynaActor->posRot.pos.z != dynaActor->pos4.z))) { + ((dynaActor->world.pos.x != dynaActor->prevPos.x) || + (dynaActor->world.pos.y != dynaActor->prevPos.y) || + (dynaActor->world.pos.z != dynaActor->prevPos.z))) { D_80157D94++; break; } @@ -490,26 +490,26 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { } if (sp3A || D_80157D94) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D); - if (this->actor.groundY <= -10000.0f) { + if (this->actor.floorHeight <= -10000.0f) { Actor_Kill(&this->actor); return; } } } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) || (this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) { f32 newUnkBC = Math_CosS(this->actor.shape.rot.x) * 37.0f; - this->actor.shape.unk_08 = newUnkBC; + this->actor.shape.yOffset = newUnkBC; if (newUnkBC >= 0.0f) { - this->actor.shape.unk_08 = this->actor.shape.unk_08; + this->actor.shape.yOffset = this->actor.shape.yOffset; } else { - this->actor.shape.unk_08 = -this->actor.shape.unk_08; + this->actor.shape.yOffset = -this->actor.shape.yOffset; } } @@ -517,8 +517,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { return; } - if (!((this->actor.xzDistToLink <= 30.0f) && (this->actor.yDistToLink >= -50.0f) && - (this->actor.yDistToLink <= 50.0f))) { + if (!((this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) && + (this->actor.yDistToPlayer <= 50.0f))) { if (!Actor_HasParent(&this->actor, globalCtx)) { return; } @@ -890,7 +890,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f); + spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); Actor_SetScale(&spawnedActor->actor, 0.0f); EnItem00_SetupAction(spawnedActor, func_8001E304); spawnedActor->unk_15A = 220; @@ -931,7 +931,7 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p spawnedActor->actor.velocity.y = 0.0f; spawnedActor->actor.speedXZ = 0.0f; spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f); + spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); spawnedActor->actor.flags |= 0x0010; } } @@ -953,31 +953,31 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 params = params & 0x7FFF; if (fromActor != NULL) { - if (fromActor->unk_116) { - if (fromActor->unk_116 & 0x01) { + if (fromActor->dropFlag) { + if (fromActor->dropFlag & 0x01) { params = 1 * 0x10; - dropTableIndex = 0xB; - } else if (fromActor->unk_116 & 0x02) { + dropTableIndex = 11; + } else if (fromActor->dropFlag & 0x02) { params = 1 * 0x10; - dropTableIndex = 0x6; - } else if (fromActor->unk_116 & 0x04) { + dropTableIndex = 6; + } else if (fromActor->dropFlag & 0x04) { params = 6 * 0x10; - dropTableIndex = 0x9; - } else if (fromActor->unk_116 & 0x08) { + dropTableIndex = 9; + } else if (fromActor->dropFlag & 0x08) { params = 3 * 0x10; - dropTableIndex = 0xB; - } else if (fromActor->unk_116 & 0x10) { + dropTableIndex = 11; + } else if (fromActor->dropFlag & 0x10) { params = 6 * 0x10; - dropTableIndex = 0xC; - } else if (fromActor->unk_116 & 0x20) { + dropTableIndex = 12; + } else if (fromActor->dropFlag & 0x20) { params = 0 * 0x10; - dropTableIndex = 0x0; - } else if (fromActor->unk_116 & 0x40) { + dropTableIndex = 0; + } else if (fromActor->dropFlag & 0x40) { params = 0 * 0x10; - dropTableIndex = 0x1; + dropTableIndex = 1; } } - if (fromActor->unk_116 & 0x20) { + if (fromActor->dropFlag & 0x20) { dropId = ITEM00_RUPEE_PURPLE; } else { dropId = D_80115574[params + dropTableIndex]; @@ -1043,7 +1043,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 spawnedActor->actor.velocity.y = 8.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_ZeroOne() * 40000.0f; + spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f; Actor_SetScale(&spawnedActor->actor, 0.0f); EnItem00_SetupAction(spawnedActor, func_8001E304); spawnedActor->actor.flags |= 0x0010; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 076d69d2bc..fd6cb3cbb7 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -48,10 +48,9 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { }; if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) { - player->rideActor = - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x, - player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x, - player->actor.shape.rot.y, player->actor.shape.rot.z, 9); + player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x, + player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x, + player->actor.shape.rot.y, player->actor.shape.rot.z, 9); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 343); } @@ -167,7 +166,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { } player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y, - spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7); + spawnPos.z, 0, player->actor.world.rot.y, 0, 7); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 561); } @@ -203,14 +202,14 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { (((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) { if (D_8011F9B8[i].type == 7) { if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { - D_8011F9B8[i].pos.x = player->actor.posRot.pos.x; - D_8011F9B8[i].pos.y = player->actor.posRot.pos.y; - D_8011F9B8[i].pos.z = player->actor.posRot.pos.z; + D_8011F9B8[i].pos.x = player->actor.world.pos.x; + D_8011F9B8[i].pos.y = player->actor.world.pos.y; + D_8011F9B8[i].pos.z = player->actor.world.pos.z; } player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, - player->actor.posRot.rot.y, 0, D_8011F9B8[i].type); + player->actor.world.rot.y, 0, D_8011F9B8[i].type); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 628); } @@ -233,20 +232,20 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { __assert("player->ride.actor != NULL", "../z_horse.c", 667); } - player->actor.posRot.pos.x = D_8011F9B8[i].pos.x; - player->actor.posRot.pos.y = D_8011F9B8[i].pos.y; - player->actor.posRot.pos.z = D_8011F9B8[i].pos.z; + player->actor.world.pos.x = D_8011F9B8[i].pos.x; + player->actor.world.pos.y = D_8011F9B8[i].pos.y; + player->actor.world.pos.z = D_8011F9B8[i].pos.z; player->actor.shape.rot.x = player->actor.shape.rot.z = 0; player->actor.shape.rot.y = D_8011F9B8[i].angle; func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - sp54.x = player->actor.posRot.pos.x - 200.0f; - sp54.y = player->actor.posRot.pos.y + 100.0f; - sp54.z = player->actor.posRot.pos.z; + sp54.x = player->actor.world.pos.x - 200.0f; + sp54.y = player->actor.world.pos.y + 100.0f; + sp54.z = player->actor.world.pos.z; - Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54); + Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.world.pos, &sp54); } else { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, @@ -284,15 +283,15 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player) { } void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) { - s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y; + s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y; if (x > arg2) { - actor->posRot.rot.y += arg2; + actor->world.rot.y += arg2; } else if (x < -arg2) { - actor->posRot.rot.y -= arg2; + actor->world.rot.y -= arg2; } else { - actor->posRot.rot.y += x; + actor->world.rot.y += x; } - actor->shape.rot.y = actor->posRot.rot.y; + actor->shape.rot.y = actor->world.rot.y; } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index e81b087fc0..fab39d42b7 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -11,8 +11,8 @@ s16 sEntranceIconMapIndex = 0; void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) { Player* player = PLAYER; - sPlayerInitialPosX = player->actor.posRot.pos.x; - sPlayerInitialPosZ = player->actor.posRot.pos.z; + sPlayerInitialPosX = player->actor.world.pos.x; + sPlayerInitialPosZ = player->actor.world.pos.z; sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400); } @@ -326,8 +326,8 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - tempX = player->actor.posRot.pos.x; - tempZ = player->actor.posRot.pos.z; + tempX = player->actor.world.pos.x; + tempZ = player->actor.world.pos.z; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; Matrix_Translate((R_COMPASS_OFFSET_X + tempX) / 10.0f, (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); @@ -531,7 +531,7 @@ void Map_Update(GlobalContext* globalCtx) { } for (floor = 0; floor < 8; floor++) { - if (player->actor.posRot.pos.y > gMapData->floorCoordY[mapIndex][floor]) { + if (player->actor.world.pos.y > gMapData->floorCoordY[mapIndex][floor]) { break; } } diff --git a/src/code/z_path.c b/src/code/z_path.c index 0f50fe02a6..8ff42c07aa 100644 --- a/src/code/z_path.c +++ b/src/code/z_path.c @@ -24,8 +24,8 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos = &pointPos[waypoint]; - dx = pointPos->x - actor->posRot.pos.x; - dz = pointPos->z - actor->posRot.pos.z; + dx = pointPos->x - actor->world.pos.x; + dz = pointPos->z - actor->world.pos.z; *yaw = Math_FAtan2F(dx, dz) * (32768 / M_PI); diff --git a/src/code/z_play.c b/src/code/z_play.c index 12d1b07bdf..06a5f82d99 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -237,7 +237,7 @@ void Gameplay_Init(GameState* thisx) { func_8006BA00(globalCtx); Effect_InitContext(globalCtx); EffectSs_InitInfo(globalCtx, 0x55); - func_8005D3BC(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); AnimationContext_Reset(&globalCtx->animationCtx); func_8006450C(globalCtx, &globalCtx->csCtx); @@ -835,7 +835,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3612); } - func_8006139C(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_AT(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3618); @@ -847,13 +847,13 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3624); } - func_800622E4(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_Damage(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3631); } - CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3637); @@ -1594,9 +1594,9 @@ s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3 player = camera->player; if (player != NULL) { - camera->posOffset.x = at->x - player->actor.posRot.pos.x; - camera->posOffset.y = at->y - player->actor.posRot.pos.y; - camera->posOffset.z = at->z - player->actor.posRot.pos.z; + camera->posOffset.x = at->x - player->actor.world.pos.x; + camera->posOffset.y = at->y - player->actor.world.pos.y; + camera->posOffset.z = at->z - player->actor.world.pos.z; } else { camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f; } @@ -1622,9 +1622,9 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve player = camera->player; if (player != NULL) { - camera->posOffset.x = at->x - player->actor.posRot.pos.x; - camera->posOffset.y = at->y - player->actor.posRot.pos.y; - camera->posOffset.z = at->z - player->actor.posRot.pos.z; + camera->posOffset.x = at->x - player->actor.world.pos.x; + camera->posOffset.y = at->y - player->actor.world.pos.y; + camera->posOffset.z = at->z - player->actor.world.pos.z; } else { camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f; } @@ -1748,7 +1748,7 @@ void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 p roomIndex = globalCtx->roomCtx.curRoom.num; entranceIndex = gSaveContext.entranceIndex; Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams, - &player->actor.posRot.pos, player->actor.shape.rot.y); + &player->actor.world.pos, player->actor.shape.rot.y); } } @@ -1797,7 +1797,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { TransitionActorEntry* transitionActor; s32 frontRoom; - if (actor->type != ACTORTYPE_DOOR) { + if (actor->category != ACTORCAT_DOOR) { return 0; } diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 616f1e4b37..d6ed609d21 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -19,7 +19,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Player_InitVars = { ACTOR_PLAYER, - ACTORTYPE_PLAYER, + ACTORCAT_PLAYER, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(Player), diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index db619db673..e4d9141ed1 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -389,7 +389,7 @@ void func_8008EDF0(Player* this) { void func_8008EE08(Player* this) { if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8A00000) || - (!(this->stateFlags1 & 0xC0000) && ((this->actor.posRot.pos.y - this->actor.groundY) < 100.0f))) { + (!(this->stateFlags1 & 0xC0000) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { this->stateFlags1 &= ~0x400F8000; } else if (!(this->stateFlags1 & 0x2C0000)) { this->stateFlags1 |= 0x80000; @@ -945,7 +945,7 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w Vec3f* newBase) { if (weaponInfo->active == 0) { if (collider != NULL) { - Collider_QuadSetAT(globalCtx, &collider->base); + Collider_ResetQuadAT(globalCtx, &collider->base); } Math_Vec3f_Copy(&weaponInfo->tip, newTip); Math_Vec3f_Copy(&weaponInfo->base, newBase); @@ -955,12 +955,12 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w (weaponInfo->tip.z == newTip->z) && (weaponInfo->base.x == newBase->x) && (weaponInfo->base.y == newBase->y) && (weaponInfo->base.z == newBase->z)) { if (collider != NULL) { - Collider_QuadSetAT(globalCtx, &collider->base); + Collider_ResetQuadAT(globalCtx, &collider->base); } return 0; } else { if (collider != NULL) { - func_80062734(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip); + Collider_SetQuadVertices(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); } Math_Vec3f_Copy(&weaponInfo->base, newBase); @@ -972,22 +972,22 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collider, Vec3f* quadSrc) { static u8 shieldColTypes[PLAYER_SHIELD_MAX] = { - COLTYPE_METAL_SHIELD, - COLTYPE_WOODEN_SHIELD, - COLTYPE_METAL_SHIELD, - COLTYPE_METAL_SHIELD, + COLTYPE_METAL, + COLTYPE_WOOD, + COLTYPE_METAL, + COLTYPE_METAL, }; if (this->stateFlags1 & 0x400000) { Vec3f quadDest[4]; - this->shieldQuad.base.type = shieldColTypes[this->currentShield]; + this->shieldQuad.base.colType = shieldColTypes[this->currentShield]; Matrix_MultVec3f(&quadSrc[0], &quadDest[0]); Matrix_MultVec3f(&quadSrc[1], &quadDest[1]); Matrix_MultVec3f(&quadSrc[2], &quadDest[2]); Matrix_MultVec3f(&quadSrc[3], &quadDest[3]); - func_80062734(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]); + Collider_SetQuadVertices(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); @@ -1215,11 +1215,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (this->actor.scale.y >= 0.0f) { if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) { if (this->stateFlags1 & 0x200) { - Matrix_MultVec3f(&D_80126128, &hookedActor->posRot.pos); + Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos); Matrix_RotateRPY(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY); Matrix_Get(&sp14C); - func_800D20CC(&sp14C, &hookedActor->posRot.rot, 0); - hookedActor->shape.rot = hookedActor->posRot.rot; + func_800D20CC(&sp14C, &hookedActor->world.rot, 0); + hookedActor->shape.rot = hookedActor->world.rot; } else if (this->stateFlags1 & 0x800) { Vec3s spB8; @@ -1227,10 +1227,9 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* func_800D20CC(&sp14C, &spB8, 0); if (hookedActor->flags & 0x20000) { - hookedActor->posRot.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x; + hookedActor->world.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x; } else { - hookedActor->posRot.rot.y = hookedActor->shape.rot.y = - this->actor.shape.rot.y + this->unk_3BC.y; + hookedActor->world.rot.y = hookedActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y; } } } else { @@ -1298,11 +1297,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* MtxF sp44; s32 pad; - Matrix_MultVec3f(&D_80126190, &heldActor->posRot.pos); + Matrix_MultVec3f(&D_80126190, &heldActor->world.pos); Matrix_RotateRPY(0, -0x4000, -0x4000, MTXMODE_APPLY); Matrix_Get(&sp44); - func_800D20CC(&sp44, &heldActor->posRot.rot, 0); - heldActor->shape.rot = heldActor->posRot.rot; + func_800D20CC(&sp44, &heldActor->world.rot, 0); + heldActor->shape.rot = heldActor->world.rot; if (func_8002DD78(this) != 0) { Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY); @@ -1322,7 +1321,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } if (this->unk_862 == 0) { - Math_Vec3f_Copy(&heldActor->posRot.pos, &sGetItemRefPos); + Math_Vec3f_Copy(&heldActor->world.pos, &sGetItemRefPos); } } } @@ -1337,11 +1336,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Matrix_Get(&this->shieldMf); } } else if (limbIndex == PLAYER_LIMB_HEAD) { - Matrix_MultVec3f(&D_801260D4, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_801260D4, &this->actor.focus.pos); } else { Vec3f* vec = &D_801261E0[(0, gSaveContext.linkAge)]; - func_8002BDB0(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec); + Actor_SetFeetPos(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec); } } } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index dce656a146..05070c2144 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -527,7 +527,7 @@ RomFile sNaviMsgFiles[] = { s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD }; -u32 gObjectTableSize = 402; +u32 gObjectTableSize = ARRAY_COUNT(gObjectTable); RomFile gObjectTable[] = { ROM_FILE_UNSET, diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index f0752a3e5e..30451a159c 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1054,9 +1054,9 @@ void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* da Vec3f diff; SkelAnime_UpdateTranslation(entry->skelAnime, &diff, actor->shape.rot.y); - actor->posRot.pos.x += diff.x * actor->scale.x; - actor->posRot.pos.y += diff.y * actor->scale.y * entry->unk_08; - actor->posRot.pos.z += diff.z * actor->scale.z; + actor->world.pos.x += diff.x * actor->scale.x; + actor->world.pos.y += diff.y * actor->scale.y * entry->unk_08; + actor->world.pos.z += diff.z * actor->scale.z; } /** diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index d8abe9dda2..923aa5c10f 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -14,7 +14,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx); const ActorInit Arms_Hook_InitVars = { ACTOR_ARMS_HOOK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_LINK_BOY, sizeof(ArmsHook), @@ -25,8 +25,22 @@ const ActorInit Arms_Hook_InitVars = { }; ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000080, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000080, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0 }, }; @@ -58,7 +72,7 @@ void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitQuad(globalCtx, &this->collider); Collider_SetQuad(globalCtx, &this->collider, &this->actor, &sQuadInit); ArmsHook_SetupAction(this, ArmsHook_Wait); - this->unk_1E8 = this->actor.posRot.pos; + this->unk_1E8 = this->actor.world.pos; } void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -116,7 +130,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { ((player->stateFlags1 & 0x4000080))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); - Math_Vec3f_Copy(&this->actor.posRot.pos, &player->unk_3C8); + Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8); return 1; } } @@ -126,7 +140,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) { actor->flags |= 0x2000; this->grabbed = actor; - Math_Vec3f_Diff(&actor->posRot.pos, &this->actor.posRot.pos, &this->grabbedDistDiff); + Math_Vec3f_Diff(&actor->world.pos, &this->actor.world.pos, &this->grabbedDistDiff); } void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { @@ -161,10 +175,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { ArmsHook_CheckForCancel(this); if (this->timer != 0) { - if ((this->collider.base.atFlags & 2) && (this->collider.body.atHitItem->flags != 4)) { + if ((this->collider.base.atFlags & AT_HIT) && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) { touchedActor = this->collider.base.at; if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) { - if (this->collider.body.atHitItem->bumperFlags & 4) { + if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) { ArmsHook_AttachHookToActor(this, touchedActor); if ((touchedActor->flags & 0x400) == 0x400) { func_80865044(this); @@ -186,10 +200,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { this->grabbed = NULL; } else { if (this->actor.child != NULL) { - sp94 = func_8002DB48(this, grabbed); + sp94 = Actor_WorldDistXYZToActor(this, grabbed); sp90 = sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z)); - Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos); + Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos); if (50.0f < (sp94 - sp90)) { ArmsHook_DetachHookFromActor(this); grabbed = NULL; @@ -198,7 +212,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { } } - bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.posRot.pos, &bodyDistDiffVec); + bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.world.pos, &bodyDistDiffVec); if (bodyDistDiff < 30.0f) { velocity = 0.0f; phi_f16 = 0.0f; @@ -225,17 +239,17 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (this->actor.child == NULL) { if ((grabbed != NULL) && (grabbed->id == ACTOR_BG_SPOT06_OBJECTS)) { - Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos); + Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos); phi_f16 = 1.0f; } else { - Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.posRot.pos); + Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.world.pos); if (grabbed != NULL) { - Math_Vec3f_Sum(&this->actor.posRot.pos, &this->grabbedDistDiff, &grabbed->posRot.pos); + Math_Vec3f_Sum(&this->actor.world.pos, &this->grabbedDistDiff, &grabbed->world.pos); } } } else { Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity); - player->actor.posRot.rot.x = + player->actor.world.rot.x = Math_Atan2S(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y); } @@ -244,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (phi_f16 == 0.0f) { ArmsHook_SetupAction(this, ArmsHook_Wait); if (ArmsHook_AttachToPlayer(this, player)) { - Math_Vec3f_Diff(&this->actor.posRot.pos, &player->actor.posRot.pos, &player->actor.velocity); + Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &player->actor.velocity); player->actor.velocity.y -= 20.0f; return; } @@ -252,7 +266,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { } } else { Actor_MoveForward(&this->actor); - Math_Vec3f_Diff(&this->actor.posRot.pos, &this->actor.pos4, &prevFrameDiff); + Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8); this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y); sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x); @@ -262,9 +276,9 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78) == false) { sp5C = COLPOLY_GET_NORMAL(poly->normal.x); sp58 = COLPOLY_GET_NORMAL(poly->normal.z); - Math_Vec3f_Copy(&this->actor.posRot.pos, &sp78); - this->actor.posRot.pos.x += 10.0f * sp5C; - this->actor.posRot.pos.z += 10.0f * sp58; + Math_Vec3f_Copy(&this->actor.world.pos, &sp78); + this->actor.world.pos.x += 10.0f * sp5C; + this->actor.world.pos.z += 10.0f * sp58; this->timer = 0; if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId) != 0) { if (bgId != BGCHECK_SCENE) { @@ -278,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { &D_801333E0, &D_801333E8); return; } - func_80062D60(globalCtx, &this->actor.posRot.pos); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos); Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); return; @@ -328,8 +342,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602B288); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); - Math_Vec3f_Diff(&player->unk_3C8, &this->actor.posRot.pos, &sp78); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Math_Vec3f_Diff(&player->unk_3C8, &this->actor.world.pos, &sp78); sp58 = SQ(sp78.x) + SQ(sp78.z); sp5C = sqrtf(sp58); Matrix_RotateY(Math_FAtan2F(sp78.x, sp78.z), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 54bfe1e424..03d769267f 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -24,7 +24,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx); const ActorInit Arrow_Fire_InitVars = { ACTOR_ARROW_FIRE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowFire), @@ -74,14 +74,14 @@ void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowFire_SetupAction(this, ArrowFire_Fly); this->alpha = 255; @@ -157,14 +157,14 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) { return; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_158 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_158 = 1.0f; } - func_80865ECC(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80865ECC(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_FRAME); @@ -207,7 +207,7 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 618); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index e34b68c11f..cd0dd87db8 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -25,7 +25,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx); const ActorInit Arrow_Ice_InitVars = { ACTOR_ARROW_ICE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowIce), @@ -75,14 +75,14 @@ void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowIce_SetupAction(this, ArrowIce_Fly); this->alpha = 255; @@ -158,14 +158,14 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) { return; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_160 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_160 = 1.0f; } - func_80867E8C(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80867E8C(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE); @@ -208,7 +208,7 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 610); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 02feaaf5e4..90a5e7f033 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -25,7 +25,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx); const ActorInit Arrow_Light_InitVars = { ACTOR_ARROW_LIGHT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowLight), @@ -75,14 +75,14 @@ void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowLight_SetupAction(this, ArrowLight_Fly); this->alpha = 255; @@ -158,14 +158,14 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) { return; } // copy position and rotation from parent arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_160 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_160 = 1.0f; } - func_80869E6C(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80869E6C(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT); @@ -208,7 +208,7 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_light.c", 598); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 6aa587bbcf..ae669899ee 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -34,7 +34,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx); const ActorInit Bg_Bdan_Objects_InitVars = { ACTOR_BG_BDAN_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_BDAN_OBJECTS, sizeof(BgBdanObjects), @@ -45,8 +45,22 @@ const ActorInit Bg_Bdan_Objects_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_NONE, + OCELEM_NONE, + }, { 0x00BB, 0x0050, 0x0000, { 0 } }, }; @@ -107,7 +121,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->params &= 0xFF; if (thisx->params == 2) { thisx->flags |= 0x30; - globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->world.pos.y; this->actionFunc = func_8086C9A8; return; } @@ -115,20 +129,20 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06008CE0, &colHeader); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, this, &sCylinderInit); - thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f); + thisx->world.pos.y = (f32)(thisx->world.pos.y + -79.0f); if (Flags_GetClear(globalCtx, thisx->room)) { Flags_SetSwitch(globalCtx, this->unk_168); this->actionFunc = func_8086C6EC; } else { if (BgBdanObjects_GetContactRu1(this, 4)) { - if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA, - thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, 0, - thisx->shape.rot.y + 0x8000, 0, 3) != NULL) { - thisx->child->posRot.pos.z = thisx->child->initPosRot.pos.z + 263.0f; + if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA, thisx->home.pos.x, + thisx->home.pos.y, thisx->home.pos.z, 0, thisx->shape.rot.y + 0x8000, 0, + 3) != NULL) { + thisx->child->world.pos.z = thisx->child->home.pos.z + 263.0f; } - thisx->posRot.rot.y = 0; + thisx->world.rot.y = 0; this->actionFunc = func_8086C618; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + -70.0f; + thisx->world.pos.y = thisx->home.pos.y + -70.0f; } else { Flags_SetSwitch(globalCtx, this->unk_168); this->unk_16A = 0; @@ -145,7 +159,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06005580, &colHeader); if (Flags_GetSwitch(globalCtx, this->unk_168)) { this->actionFunc = BgBdanObjects_DoNothing; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f; + thisx->world.pos.y = thisx->home.pos.y - 400.0f; } else { this->actionFunc = func_8086CB10; } @@ -167,13 +181,13 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (BgBdanObjects_GetContactRu1(this, 0)) { - if (this->dyna.actor.xzDistToLink < 250.0f) { + if (this->dyna.actor.xzDistToPlayer < 250.0f) { BgBdanObjects_SetContactRu1(this, 1); this->unk_16A = 0x14; func_800800F8(globalCtx, 0xBFE, -0x63, &this->dyna.actor, 0); - player->actor.posRot.pos.x = -1130.0f; - player->actor.posRot.pos.y = -1025.0f; - player->actor.posRot.pos.z = -3300.0f; + player->actor.world.pos.x = -1130.0f; + player->actor.world.pos.y = -1025.0f; + player->actor.world.pos.z = -3300.0f; func_800AA000(0.0f, 0xFF, 0x14, 0x96); } } else { @@ -188,15 +202,15 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) { } if (!Gameplay_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -79.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -79.0f; } else { - this->dyna.actor.posRot.pos.y = (this->dyna.actor.initPosRot.pos.y + -79.0f) - 5.0f; + this->dyna.actor.world.pos.y = (this->dyna.actor.home.pos.y + -79.0f) - 5.0f; } } void func_8086C1A0(BgBdanObjects* this, GlobalContext* globalCtx) { - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 500.0f, 0.5f, 7.5f, - 1.0f) < 0.1f) { + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) < + 0.1f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); this->actionFunc = func_8086C29C; this->unk_16A = 0x1E; @@ -229,8 +243,8 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) { if (BgBdanObjects_GetContactRu1(this, 3)) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_BIGOKUTA, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 140.0f, - this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0); + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 140.0f, + this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0); BgBdanObjects_SetContactRu1(this, 4); this->unk_16A = 0xA; this->actionFunc = func_8086C55C; @@ -242,19 +256,19 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) { Player* player = PLAYER; this->dyna.actor.velocity.y += 0.5f; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -70.0f, + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -70.0f, this->dyna.actor.velocity.y)) { - this->dyna.actor.posRot.rot.y = 0; + this->dyna.actor.world.rot.y = 0; this->unk_16A = 0x3C; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); - this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f; + this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f; this->actionFunc = func_8086C5BC; func_800800F8(globalCtx, 0xC08, -0x63, this->dyna.actor.child, 0); - player->actor.posRot.pos.x = -1130.0f; - player->actor.posRot.pos.y = -1025.0f; - player->actor.posRot.pos.z = -3500.0f; + player->actor.world.pos.x = -1130.0f; + player->actor.world.pos.y = -1025.0f; + player->actor.world.pos.z = -3500.0f; player->actor.shape.rot.y = 0x7530; - player->actor.posRot.rot.y = player->actor.shape.rot.y; + player->actor.world.rot.y = player->actor.shape.rot.y; func_800AA000(0.0f, 0xFF, 0x1E, 0x96); } else { func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); @@ -266,7 +280,7 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) { this->unk_16A = 0xB; } if (this->dyna.actor.child != NULL) { - this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f; + this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f; } } } @@ -298,22 +312,22 @@ void func_8086C5BC(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { Flags_SetSwitch(globalCtx, this->unk_168); - this->dyna.actor.initPosRot.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; + this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; this->actionFunc = func_8086C6EC; } else { - this->dyna.actor.shape.rot.y += this->dyna.actor.posRot.rot.y; - func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.posRot.rot.y) / 512.0f); + this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y; + func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.world.rot.y) / 512.0f); } } void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { - s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200); + s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -125.0f, 3.0f)) { if (cond) { this->actionFunc = func_8086C76C; } @@ -322,7 +336,7 @@ void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) { if (func_8004356C(&this->dyna.actor)) { - if (this->dyna.actor.xzDistToLink < 120.0f) { + if (this->dyna.actor.xzDistToPlayer < 120.0f) { this->actionFunc = func_8086C7D0; func_800800F8(globalCtx, 0xC12, -0x63, &this->dyna.actor, 0); } @@ -330,8 +344,8 @@ void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx) { - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f, - 0.2f) < 0.01f) { + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) < + 0.01f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); this->actionFunc = BgBdanObjects_DoNothing; } else { @@ -367,8 +381,8 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { func_8005ACFC(globalCtx->cameraPtrs[0], 4); } } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - - (sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150 + this->dyna.actor.world.pos.y = + this->dyna.actor.home.pos.y - (sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150 if (this->unk_16A == 0) { this->unk_16A = 0x200; } @@ -383,18 +397,18 @@ void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->unk_16A == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.5f)) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->actionFunc = func_8086C9A8; } func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 75.0f, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 75.0f, 0.5f)) { this->actionFunc = func_8086CABC; } func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } - globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.world.pos.y; } void func_8086CABC(BgBdanObjects* this, GlobalContext* globalCtx) { @@ -412,7 +426,7 @@ void func_8086CB10(BgBdanObjects* this, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, this->unk_168); this->unk_16A = 0x32; this->actionFunc = func_8086CB8C; - this->dyna.actor.initPosRot.pos.y -= 200.0f; + this->dyna.actor.home.pos.y -= 200.0f; func_800800F8(globalCtx, 0xC1C, 0x33, &this->dyna.actor, 0); } } @@ -421,7 +435,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); if (this->unk_16A == 0) { Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U); this->actionFunc = BgBdanObjects_DoNothing; @@ -434,7 +448,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { void BgBdanObjects_Update(Actor* thisx, GlobalContext* globalCtx) { BgBdanObjects* this = THIS; - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); this->actionFunc(this, globalCtx); } @@ -443,7 +457,7 @@ void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 0) { if (this->actionFunc == func_8086C054) { - if (((thisx->initPosRot.pos.y + -79.0f) - 5.0f) < thisx->posRot.pos.y) { + if (((thisx->home.pos.y + -79.0f) - 5.0f) < thisx->world.pos.y) { Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY); } } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index ef13edeecd..df768d6478 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -45,7 +45,7 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx); const ActorInit Bg_Bdan_Switch_InitVars = { ACTOR_BG_BDAN_SWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_BDAN_OBJECTS, sizeof(BgBdanSwitch), @@ -59,17 +59,31 @@ extern CollisionHeader D_06005CF8; extern Gfx D_060061A0[]; extern Gfx D_06005A20[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xEFC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 120, 0 }, 370 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -121,7 +135,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1D0 = ((Math_CosS(this->unk_1CC) * 0.5f) + 20.5f) * (this->unk_1C8 * 0.0050000004f); this->dyna.actor.scale.y = this->unk_1C8 * 0.1f; } - this->dyna.actor.shape.unk_08 = 1.2f / this->unk_1D0; + this->dyna.actor.shape.yOffset = 1.2f / this->unk_1D0; } void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -140,7 +154,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.scale.x = 0.1f; } this->dyna.actor.scale.y = 0.0f; - Actor_SetHeight(&this->dyna.actor, 10.0f); + Actor_SetFocus(&this->dyna.actor, 10.0f); switch (type) { case BLUE: @@ -152,7 +166,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_2: func_8086D098(this, globalCtx); this->dyna.actor.flags |= 1; - this->dyna.actor.unk_1F = 4; + this->dyna.actor.targetMode = 4; } flag = Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); @@ -256,12 +270,12 @@ void func_8086D67C(BgBdanSwitch* this) { } void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; if (this->unk_1C8 <= 0.1f) { func_8086D730(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } } @@ -323,7 +337,7 @@ void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) { if (this->unk_1C8 <= 0.6f) { func_8086D9F8(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } @@ -333,12 +347,12 @@ void func_8086D944(BgBdanSwitch* this) { } void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; if (this->unk_1C8 <= 0.1f) { func_8086DB24(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } } @@ -398,14 +412,14 @@ void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) { default: return; case YELLOW_TALL_1: - if (((this->collider.base.acFlags & 2) != 0) && this->unk_1D8 <= 0) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); } break; case YELLOW_TALL_2: - if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); @@ -419,7 +433,7 @@ void func_8086DC30(BgBdanSwitch* this) { } void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.3f; if (this->unk_1C8 <= 1.0f) { func_8086DCCC(this); @@ -441,7 +455,7 @@ void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) { } break; case YELLOW_TALL_2: - if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) { this->unk_1D8 = 0xA; func_8086DDA8(this); func_8086D548(this, globalCtx); @@ -455,7 +469,7 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.type)) || + if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { @@ -466,35 +480,34 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { } void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; BgBdanSwitch* this = THIS; s32 type; - s32 temp; if (this->unk_1DA > 0) { - this->unk_1DA -= 1; + this->unk_1DA--; } this->actionFunc(this, globalCtx); func_8086D0EC(this); type = this->dyna.actor.params & 0xFF; if (type != 3 && type != 4) { - this->unk_1D8 -= 1; - return; + this->unk_1D8--; + } else { + if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) { + this->unk_1D8--; + } + this->unk_1DC = this->collider.base.acFlags; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.elements[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f; + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) { - this->unk_1D8 -= 1; - } - temp = this->collider.base.acFlags; - this->collider.base.acFlags &= 0xFFFD; - this->unk_1DC = temp; - this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f; - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) { - func_800D1694(this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + (this->dyna.actor.shape.unk_08 * this->unk_1D0), - this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot); + func_800D1694(this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + (this->dyna.actor.shape.yOffset * this->unk_1D0), + this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY); Gfx_DrawDListOpa(globalCtx, dlist); } @@ -510,8 +523,8 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_1: case YELLOW_TALL_2: func_8086DF58(this, globalCtx, D_060061A0); - func_800628A4(0, &this->collider); - Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos); + Collider_UpdateSpheres(0, &this->collider); + Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.focus.pos); break; case BLUE: func_8086DF58(this, globalCtx, D_06005A20); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index 89d597baff..44c7a62a9c 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -21,7 +21,7 @@ typedef struct BgBdanSwitch { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ BgBdanSwitchActionFunc actionFunc; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems[1]; + /* 0x0188 */ ColliderJntSphElement colliderItems[1]; /* 0x01C8 */ f32 unk_1C8; /* 0x01CC */ s16 unk_1CC; /* 0x01CE */ char unk_1CE[0x2]; diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index 0f5a15537f..ebffccccb0 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -20,7 +20,7 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx); const ActorInit Bg_Bom_Guard_InitVars = { ACTOR_BG_BOM_GUARD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOWL, sizeof(BgBomGuard), @@ -51,7 +51,7 @@ void BgBomGuard_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = 1.0f; thisx->scale.y = 1.0f; thisx->scale.z = 1.0f; - this->unk_16C = thisx->posRot.pos; + this->unk_16C = thisx->world.pos; BgBomGuard_SetupAction(this, func_8086E638); } @@ -62,7 +62,7 @@ void BgBomGuard_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { - Actor* it = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + Actor* it = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; Actor* thisx = &this->dyna.actor; this->unk_168 = 0; @@ -79,9 +79,9 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { } if (this->unk_168 == 0) { - thisx->posRot.pos.y = sREG(64) + -200.0f; + thisx->world.pos.y = sREG(64) + -200.0f; } else { - thisx->posRot.pos.y = 0.0f; + thisx->world.pos.y = 0.0f; } } diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 802597b102..e38cf2ef3f 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -25,30 +25,58 @@ extern CollisionHeader D_050041B0; extern Gfx D_05003FC0[]; extern Gfx D_05004088[]; -static ColliderTrisItemInit sTrimItemInit[3] = { +static ColliderTrisElementInit sTrisElementsInit[3] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -70.0f, 176.0f, 0.0f }, { -70.0f, -4.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 70.0f, 176.0f, 0.0f }, { -70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 70.0f, -4.0f, 0.0f }, { 70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 3, - sTrimItemInit, + sTrisElementsInit, }; const ActorInit Bg_Bombwall_InitVars = { ACTOR_BG_BOMBWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(BgBombwall), @@ -109,17 +137,17 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i <= 2; i++) { for (j = 0; j <= 2; j++) { - sp80.x = sTrisInit.list[i].dim.vtx[j].x; - sp80.y = sTrisInit.list[i].dim.vtx[j].y; - sp80.z = sTrisInit.list[i].dim.vtx[j].z + 2.0f; + sp80.x = sTrisInit.elements[i].dim.vtx[j].x; + sp80.y = sTrisInit.elements[i].dim.vtx[j].y; + sp80.z = sTrisInit.elements[i].dim.vtx[j].z + 2.0f; BgBombwall_RotateVec(&vecs[j], &sp80, sin, cos); - vecs[j].x += this->dyna.actor.posRot.pos.x; - vecs[j].y += this->dyna.actor.posRot.pos.y; - vecs[j].z += this->dyna.actor.posRot.pos.z; + vecs[j].x += this->dyna.actor.world.pos.x; + vecs[j].y += this->dyna.actor.world.pos.y; + vecs[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]); + Collider_SetTrisVertices(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]); } this->unk_2A2 |= 1; @@ -159,7 +187,7 @@ void func_8086EB5C(BgBombwall* this, GlobalContext* globalCtx) { s32 i; f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; f32 temp; f32 new_var; @@ -187,11 +215,11 @@ void func_8086ED50(BgBombwall* this, GlobalContext* globalCtx) { } void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - } else if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h index e375f579fc..d462cefe48 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -11,7 +11,7 @@ typedef void (*BgBombwallActionFunc)(struct BgBombwall*, GlobalContext*); typedef struct BgBombwall { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem colliderItems[3]; + /* 0x0184 */ ColliderTrisElement colliderItems[3]; /* 0x0298 */ BgBombwallActionFunc actionFunc; /* 0x029C */ Gfx* dList; /* 0x02A0 */ s16 unk_2A0; diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index 1d44577c78..08c07b7dc3 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -31,7 +31,7 @@ extern Gfx D_06001390[]; const ActorInit Bg_Bowl_Wall_InitVars = { ACTOR_BG_BOWL_WALL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOWL, sizeof(BgBowlWall), @@ -65,7 +65,7 @@ void BgBowlWall_Init(Actor* thisx, GlobalContext* globalCtx) { } this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - this->initPos = this->dyna.actor.posRot.pos; + this->initPos = this->dyna.actor.world.pos; osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ ボーリングおじゃま壁発生 ☆☆☆☆☆ %d\n" VT_RST, this->dyna.actor.params); this->actionFunc = BgBowlWall_SpawnBullseyes; @@ -87,12 +87,12 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) { type = this->dyna.actor.params; if (type != 0) { type += (s16)Rand_ZeroFloat(2.99f); - this->dyna.actor.shape.rot.z = this->dyna.actor.posRot.rot.z = sTargetRot[type]; + this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z = sTargetRot[type]; osSyncPrintf("\n\n"); } - this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.posRot.pos.x; - this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.posRot.pos.y; - this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.posRot.pos.z; + this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.world.pos.x; + this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.world.pos.y; + this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.world.pos.z; if (1) {} bullseye = (EnWallTubo*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_WALL_TUBO, this->bullseyeCenter.x, this->bullseyeCenter.y, this->bullseyeCenter.z, @@ -100,10 +100,10 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) { if (bullseye != NULL) { bullseye->explosionCenter = this->bullseyeCenter; if (type != 0) { - bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.posRot.pos; + bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.world.pos; } if (this->chuGirl == NULL) { - lookForGirl = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + lookForGirl = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; while (lookForGirl != NULL) { if (lookForGirl->id != ACTOR_EN_BOM_BOWL_MAN) { lookForGirl = lookForGirl->next; @@ -136,13 +136,13 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, GlobalContext* globalCtx) { if (this->dyna.actor.params == 0) { // wall collapses backwards Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 3, 500, 0); - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x; + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x; if (this->dyna.actor.shape.rot.x < -0x3C1E) { wallFallen = true; } } else { // wall slides downwards - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); - if (this->dyna.actor.posRot.pos.y < (this->initPos.y - 400.0f)) { + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); + if (this->dyna.actor.world.pos.y < (this->initPos.y - 400.0f)) { wallFallen = true; } } @@ -171,11 +171,11 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) { if (this->dyna.actor.params == 0) { Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 1, 200, 0); } else { - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); } } else if (this->timer == 1) { - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x = 0; - this->dyna.actor.posRot.pos.y = this->initPos.y - 450.0f; + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0; + this->dyna.actor.world.pos.y = this->initPos.y - 450.0f; this->chuGirl->wallStatus[this->dyna.actor.params] = 2; this->actionFunc = BgBowlWall_Reset; } @@ -183,9 +183,9 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) { void BgBowlWall_Reset(BgBowlWall* this, GlobalContext* globalCtx) { if (this->chuGirl->wallStatus[this->dyna.actor.params] != 2) { - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y, 0.3f, 50.0f); - if (fabsf(this->dyna.actor.posRot.pos.y - this->initPos.y) <= 10.0f) { - this->dyna.actor.posRot.pos.y = this->initPos.y; + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y, 0.3f, 50.0f); + if (fabsf(this->dyna.actor.world.pos.y - this->initPos.y) <= 10.0f) { + this->dyna.actor.world.pos.y = this->initPos.y; this->isHit = false; this->actionFunc = BgBowlWall_SpawnBullseyes; } diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 6a2e770d0e..08362ae1b8 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_02014F80; /* const ActorInit Bg_Breakwall_InitVars = { ACTOR_BG_BREAKWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgBreakwall), @@ -33,6 +33,26 @@ const ActorInit Bg_Breakwall_InitVars = { (ActorFunc)BgBreakwall_Update, NULL, }; + +static ColliderQuadInit D_80870760 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000048, 0x00, 0x00 }, + { 0x00000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/BgBreakwall_SetupAction.s") diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index d9ec7b202b..24ea5ffcec 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -23,7 +23,7 @@ extern CollisionHeader D_06003CE0; const ActorInit Bg_Ddan_Jd_InitVars = { ACTOR_BG_DDAN_JD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDdanJd), @@ -94,35 +94,35 @@ void BgDdanJd_Idle(BgDdanJd* this, GlobalContext* globalCtx) { this->ySpeed = SHORTCUT_Y_SPEED; this->state = STATE_GO_MIDDLE_FROM_BOTTOM; this->idleTimer = 0; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0); } if (this->idleTimer == 0) { this->idleTimer = IDLE_FRAMES; if (this->state == STATE_GO_BOTTOM) { this->state = STATE_GO_MIDDLE_FROM_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; } else if (this->state == STATE_GO_MIDDLE_FROM_BOTTOM) { // If the platform has been activated as a shortcut if (this->ySpeed != DEFAULT_Y_SPEED) { this->state = STATE_GO_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP; } else { this->state = STATE_GO_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y; + this->targetY = this->dyna.actor.home.pos.y; } } else if (this->state == STATE_GO_MIDDLE_FROM_TOP) { // If the platform has been activated as a shortcut if (this->ySpeed != DEFAULT_Y_SPEED) { this->state = STATE_GO_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP; } else { this->state = STATE_GO_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y; + this->targetY = this->dyna.actor.home.pos.y; } } else if (this->state == STATE_GO_TOP) { this->state = STATE_GO_MIDDLE_FROM_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; } this->actionFunc = BgDdanJd_Move; } @@ -133,20 +133,20 @@ void BgDdanJd_MoveEffects(BgDdanJd* this, GlobalContext* globalCtx) { Vec3f dustPos; // Generate random dust particles at the platform's base. - dustPos.y = this->dyna.actor.initPosRot.pos.y; + dustPos.y = this->dyna.actor.home.pos.y; if (globalCtx->gameplayFrames & 1) { - dustPos.x = this->dyna.actor.posRot.pos.x + 65.0f; - dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z; + dustPos.x = this->dyna.actor.world.pos.x + 65.0f; + dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); - dustPos.x = this->dyna.actor.posRot.pos.x - 65.0f; - dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z; + dustPos.x = this->dyna.actor.world.pos.x - 65.0f; + dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); } else { - dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x; - dustPos.z = this->dyna.actor.posRot.pos.z + 65.0f; + dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x; + dustPos.z = this->dyna.actor.world.pos.z + 65.0f; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); - dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x; - dustPos.z = this->dyna.actor.posRot.pos.z - 65.0f; + dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x; + dustPos.z = this->dyna.actor.world.pos.z - 65.0f; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); } if (this->ySpeed == SHORTCUT_Y_SPEED) { @@ -161,11 +161,11 @@ void BgDdanJd_Move(BgDdanJd* this, GlobalContext* globalCtx) { Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { this->ySpeed = SHORTCUT_Y_SPEED; this->state = STATE_GO_MIDDLE_FROM_BOTTOM; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; this->idleTimer = 0; this->actionFunc = BgDdanJd_Idle; func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0); - } else if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->targetY, this->ySpeed)) { + } else if (Math_StepToF(&this->dyna.actor.world.pos.y, this->targetY, this->ySpeed)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_PILLAR_MOVE_STOP); this->actionFunc = BgDdanJd_Idle; } diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index e9853ab6e1..d9e8219c9b 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -21,7 +21,7 @@ void func_80871838(BgDdanKd* this, GlobalContext* globalCtx); const ActorInit Bg_Ddan_Kd_InitVars = { ACTOR_BG_DDAN_KD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDdanKd), @@ -32,8 +32,22 @@ const ActorInit Bg_Ddan_Kd_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 245, 180, -400, { 0, 0, 0 } }, }; @@ -73,7 +87,7 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params) == 0) { BgDdanKd_SetupAction(this, BgDdanKd_CheckForExplosions); } else { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 200.0f - 20.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 200.0f - 20.0f; BgDdanKd_SetupAction(this, func_80871838); } } @@ -94,7 +108,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { explosive->params = 2; } if ((explosive != NULL) && (this->prevExplosive != NULL) && (explosive != this->prevExplosive) && - (Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->posRot.pos) > 80.0f)) { + (Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->world.pos) > 80.0f)) { BgDdanKd_SetupAction(this, BgDdanKd_LowerStairs); func_800800F8(globalCtx, 0xBEA, 0x3E7, this, 0); } else { @@ -104,11 +118,11 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { this->prevExplosive = explosive; if (explosive != NULL) { this->timer = 13; - this->prevExplosivePos = explosive->posRot.pos; + this->prevExplosivePos = explosive->world.pos; } } - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -120,15 +134,15 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f); func_800AA000(500.0f, 0x78, 0x14, 0xA); - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (this->dyna.actor.initPosRot.pos.y - 200.0f) - 20.0f, 0.075f, + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (this->dyna.actor.home.pos.y - 200.0f) - 20.0f, 0.075f, this->dyna.actor.speedXZ, 0.0075f) == 0.0f) { Flags_SetSwitch(globalCtx, this->dyna.actor.params); BgDdanKd_SetupAction(this, func_80871838); } else { - sp4C = (this->dyna.actor.pos4.y - this->dyna.actor.posRot.pos.y) + (this->dyna.actor.speedXZ * 0.25f); + sp4C = (this->dyna.actor.prevPos.y - this->dyna.actor.world.pos.y) + (this->dyna.actor.speedXZ * 0.25f); if (globalCtx->state.frames & 1) { - sp5C = sp50 = this->dyna.actor.posRot.pos; + sp5C = sp50 = this->dyna.actor.world.pos; if (globalCtx->state.frames & 2) { sp5C.z += 210.0f + Rand_ZeroOne() * 230.0f; @@ -139,8 +153,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { } sp5C.x += 80.0f + Rand_ZeroOne() * 10.0f; sp50.x -= 80.0f + Rand_ZeroOne() * 10.0f; - sp5C.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne(); - sp50.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne(); + sp5C.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne(); + sp50.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne(); func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1); func_80033480(globalCtx, &sp50, 20.0f, 1, sp4C * 135.0f, 60, 1); @@ -151,10 +165,10 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908); func_8003555C(globalCtx, &sp50, &D_808718FC, &D_80871908); - sp5C = this->dyna.actor.posRot.pos; + sp5C = this->dyna.actor.world.pos; sp5C.z += 560.0f + Rand_ZeroOne() * 5.0f; sp5C.x += (Rand_ZeroOne() - 0.5f) * 160.0f; - sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.groundY + 20.0f); + sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.floorHeight + 20.0f); func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1); func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908); diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index e24925c47d..96b5e19547 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -23,7 +23,7 @@ void func_80872288(BgDodoago* this, GlobalContext* globalCtx); const ActorInit Bg_Dodoago_InitVars = { ACTOR_BG_DODOAGO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDodoago), @@ -34,14 +34,42 @@ const ActorInit Bg_Dodoago_InitVars = { }; static ColliderCylinderInit sColCylinderInit0 = { - { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 80, 30, 80, { 0, 0, 0 } }, }; static ColliderCylinderInit sColCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x3D, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 50, 60, 280, { 0, 0, 0 } }, }; @@ -123,8 +151,8 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) { if (explosive != NULL) { this->unk_164 = - (Math_Vec3f_Yaw(&this->dyna.actor.posRot.pos, &explosive->posRot.pos) >= this->dyna.actor.shape.rot.y) ? 1 - : 0; + (Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &explosive->world.pos) >= this->dyna.actor.shape.rot.y) ? 1 + : 0; if (((globalCtx->unk_11D30[0] == 0xFF) && (this->unk_164 == 1)) || ((globalCtx->unk_11D30[1] == 0xFF) && (this->unk_164 == 0))) { @@ -152,9 +180,9 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) { } else { if (Flags_GetEventChkInf(0xB0)) { - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[0]); - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[1]); - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[2]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[0]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[1]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[2]); this->colliders[0].dim.pos.z += 0xC8; this->colliders[1].dim.pos.z += 0xD7; this->colliders[1].dim.pos.x += 0x5A; @@ -192,22 +220,22 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) { if (D_80872824 == 0x6C) { for (i = 10; i >= 0; i--) { - currentPos.x = D_808725CC[i].x + this->dyna.actor.posRot.pos.x; - currentPos.y = D_808725CC[i].y + this->dyna.actor.posRot.pos.y; - currentPos.z = D_808725CC[i].z + this->dyna.actor.posRot.pos.z; + currentPos.x = D_808725CC[i].x + this->dyna.actor.world.pos.x; + currentPos.y = D_808725CC[i].y + this->dyna.actor.world.pos.y; + currentPos.z = D_808725CC[i].z + this->dyna.actor.world.pos.z; func_80033480(globalCtx, ¤tPos, 2.0f, 3, 0xC8, 0x4B, 1); } } - currentPos.x = this->dyna.actor.posRot.pos.x + 200.0f; - currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f; - currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f; + currentPos.x = this->dyna.actor.world.pos.x + 200.0f; + currentPos.y = this->dyna.actor.world.pos.y - 20.0f; + currentPos.z = this->dyna.actor.world.pos.z + 100.0f; BgDodoago_SpawnSparkles(¤tPos, globalCtx); - currentPos.x = this->dyna.actor.posRot.pos.x - 200.0f; - currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f; - currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f; + currentPos.x = this->dyna.actor.world.pos.x - 200.0f; + currentPos.y = this->dyna.actor.world.pos.y - 20.0f; + currentPos.z = this->dyna.actor.world.pos.z + 100.0f; BgDodoago_SpawnSparkles(¤tPos, globalCtx); Math_StepToS(&this->unk_164, 0x64, 3); @@ -239,16 +267,17 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) { EnBom* bomb; if (this->dyna.actor.parent == NULL) { - if ((s32)(this->colliders[1].base.maskA & 2) || (this->colliders[2].base.maskA & 2)) { + if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT) || (this->colliders[2].base.ocFlags1 & OC1_HIT)) { - if ((s32)(this->colliders[1].base.maskA & 2)) { + if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT)) { bomb = (EnBom*)this->colliders[1].base.oc; } else { bomb = (EnBom*)this->colliders[2].base.oc; } - this->colliders[1].base.maskA &= ~2; - this->colliders[2].base.maskA &= ~2; - if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) { + this->colliders[1].base.ocFlags1 &= ~OC1_HIT; + this->colliders[2].base.ocFlags1 &= ~OC1_HIT; + if (bomb->actor.category == ACTORCAT_EXPLOSIVE && bomb->actor.id == ACTOR_EN_BOM && + bomb->actor.params == 0) { this->dyna.actor.parent = &bomb->actor; bomb->timer = 50; bomb->actor.speedXZ = 0.0f; diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 6e227b4c12..e892972eac 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -62,7 +62,7 @@ extern UNK_TYPE D_0601D514; /* const ActorInit Bg_Dy_Yoseizo_InitVars = { ACTOR_BG_DY_YOSEIZO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DY_OBJ, sizeof(BgDyYoseizo), diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index 09dc7cc5a6..d2dc3a9e2e 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -29,7 +29,7 @@ void BgGanonOtyuka_DoNothing(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Ganon_Otyuka_InitVars = { ACTOR_BG_GANON_OTYUKA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GANON, sizeof(BgGanonOtyuka), @@ -135,11 +135,11 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { Vec3f center; s16 i; - if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToLinkSq < 4900.0f))) { + if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToPlayerSq < 4900.0f))) { osSyncPrintf("OTC O 1\n"); for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) { - prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if ((prop == thisx) || (prop->id != ACTOR_BG_GANON_OTYUKA)) { prop = prop->next; @@ -148,9 +148,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { platform = (BgGanonOtyuka*)prop; - dx = platform->dyna.actor.posRot.pos.x - this->dyna.actor.posRot.pos.x + D_80876A68[i].x; - dy = platform->dyna.actor.posRot.pos.y - this->dyna.actor.posRot.pos.y; - dz = platform->dyna.actor.posRot.pos.z - this->dyna.actor.posRot.pos.z + D_80876A68[i].z; + dx = platform->dyna.actor.world.pos.x - this->dyna.actor.world.pos.x + D_80876A68[i].x; + dy = platform->dyna.actor.world.pos.y - this->dyna.actor.world.pos.y; + dz = platform->dyna.actor.world.pos.z - this->dyna.actor.world.pos.z + D_80876A68[i].z; if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) { platform->visibleSides |= sSides[i]; @@ -164,9 +164,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { osSyncPrintf("OTC O 2\n"); for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) { - center.x = this->dyna.actor.posRot.pos.x + D_80876A68[i].x; - center.y = this->dyna.actor.posRot.pos.y; - center.z = this->dyna.actor.posRot.pos.z + D_80876A68[i].z; + center.x = this->dyna.actor.world.pos.x + D_80876A68[i].x; + center.y = this->dyna.actor.world.pos.y; + center.z = this->dyna.actor.world.pos.z + D_80876A68[i].z; if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, ¢er, 50.0f)) { this->unwalledSides |= sSides[i]; } @@ -214,7 +214,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { } if (this->dropTimer == 0) { this->flashYScale = 0.0f; - Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); + Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 2.0f); if (!(this->unwalledSides & OTYUKA_SIDE_EAST)) { this->dyna.actor.shape.rot.z -= (s16)(this->dyna.actor.speedXZ * 30.0f); @@ -228,22 +228,22 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { if (!(this->unwalledSides & OTYUKA_SIDE_NORTH)) { this->dyna.actor.shape.rot.x -= (s16)(this->dyna.actor.speedXZ * 30.0f); } - if (this->dyna.actor.posRot.pos.y < -750.0f) { - if (player->actor.posRot.pos.y < -400.0f) { + if (this->dyna.actor.world.pos.y < -750.0f) { + if (player->actor.world.pos.y < -400.0f) { accel.x = accel.z = 0.0f; accel.y = 0.1f; velocity.x = velocity.y = velocity.z = 0.0f; for (i = 0; i < 30; i++) { - pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.x; + pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.x; pos.y = Rand_ZeroFloat(60.0f) + -750.0f; - pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.z; + pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.z; func_8002836C(globalCtx, &pos, &velocity, &accel, &sDustPrimColor, &sDustEnvColor, (s16)Rand_ZeroFloat(100.0f) + 250, 5, (s16)Rand_ZeroFloat(5.0f) + 15); } func_80033DB8(globalCtx, 10, 15); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 0x28, NA_SE_EV_BOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 0x28, NA_SE_EV_BOX_BREAK); } Actor_Kill(&this->dyna.actor); } @@ -255,7 +255,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); + Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f); } osSyncPrintf("MODE DOWN END\n"); @@ -287,7 +287,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 702); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actor != NULL) { if (actor->id == ACTOR_BOSS_GANON) { ganondorf = (BossGanon*)actor; @@ -307,24 +307,24 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, sPlatformSetupDList); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actor != NULL) { if (actor->id == ACTOR_BG_GANON_OTYUKA) { platform = (BgGanonOtyuka*)actor; if (platform->dyna.actor.projectedPos.z > spBC) { - if (camera->eye.y > platform->dyna.actor.posRot.pos.y) { + if (camera->eye.y > platform->dyna.actor.world.pos.y) { phi_s2 = sPlatformTopDList; } else { phi_s2 = sPlatformBottomDList; } - Matrix_Translate(platform->dyna.actor.posRot.pos.x, platform->dyna.actor.posRot.pos.y, - platform->dyna.actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(platform->dyna.actor.world.pos.x, platform->dyna.actor.world.pos.y, + platform->dyna.actor.world.pos.z, MTXMODE_NEW); phi_s1 = NULL; if (platform->isFalling) { Matrix_RotateX((platform->dyna.actor.shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); Matrix_RotateZ((platform->dyna.actor.shape.rot.z / (f32)0x8000) * M_PI, MTXMODE_APPLY); - if (camera->eye.y > platform->dyna.actor.posRot.pos.y) { + if (camera->eye.y > platform->dyna.actor.world.pos.y) { phi_s1 = sPlatformBottomDList; } else { phi_s1 = sPlatformTopDList; @@ -357,7 +357,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { } func_80093D84(globalCtx->state.gfxCtx); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actor != NULL) { if (actor->id == ACTOR_BG_GANON_OTYUKA) { platform = (BgGanonOtyuka*)actor; @@ -371,8 +371,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { platform->flashPrimColorB, 0); gDPSetEnvColor(POLY_XLU_DISP++, platform->flashEnvColorR, platform->flashEnvColorG, platform->flashEnvColorB, 128); - Matrix_Translate(platform->dyna.actor.posRot.pos.x, 0.0f, platform->dyna.actor.posRot.pos.z, - MTXMODE_NEW); + Matrix_Translate(platform->dyna.actor.world.pos.x, 0.0f, platform->dyna.actor.world.pos.z, MTXMODE_NEW); for (i = 0; i < ARRAY_COUNT(sSides); i++) { if (platform->unwalledSides & sSides[i]) { diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index eb5f279aaf..144f967170 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -23,7 +23,7 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx); const ActorInit Bg_Gate_Shutter_InitVars = { ACTOR_BG_GATE_SHUTTER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_SPOT01_MATOYAB, sizeof(BgGateShutter), @@ -44,13 +44,13 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_06001DA8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - this->somePos.x = thisx->posRot.pos.x; - this->somePos.y = thisx->posRot.pos.y; - this->somePos.z = thisx->posRot.pos.z; + this->somePos.x = thisx->world.pos.x; + this->somePos.y = thisx->world.pos.y; + this->somePos.z = thisx->world.pos.z; if (((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) && (globalCtx->sceneNum == SCENE_SPOT01)) { - thisx->posRot.pos.x = -89.0f; - thisx->posRot.pos.z = -1375.0f; + thisx->world.pos.x = -89.0f; + thisx->world.pos.z = -1375.0f; } thisx->scale.x = 1.0f; thisx->scale.y = 1.0f; @@ -84,9 +84,9 @@ void func_80878300(BgGateShutter* this, GlobalContext* globalCtx) { if (this->unk_178 == 0) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.x -= 2.0f; - Math_ApproachF(&thisx->posRot.pos.z, -1375.0f, 0.8f, 0.3f); - if (thisx->posRot.pos.x < -89.0f) { + thisx->world.pos.x -= 2.0f; + Math_ApproachF(&thisx->world.pos.z, -1375.0f, 0.8f, 0.3f); + if (thisx->world.pos.x < -89.0f) { Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_178 = 0x1E; this->actionFunc = func_808783AC; @@ -106,10 +106,10 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx) { if (this->unk_178 == 0) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.x += 2.0f; - Math_ApproachF(&thisx->posRot.pos.z, -1350.0f, 0.8f, 0.3f); - if (thisx->posRot.pos.x > 90.0f) { - thisx->posRot.pos.x = 91.0f; + thisx->world.pos.x += 2.0f; + Math_ApproachF(&thisx->world.pos.z, -1350.0f, 0.8f, 0.3f); + if (thisx->world.pos.x > 90.0f) { + thisx->world.pos.x = 91.0f; Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_178 = 30; this->actionFunc = func_808783AC; diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index b2c401451e..f3e2e75c60 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -21,7 +21,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx); const ActorInit Bg_Gjyo_Bridge_InitVars = { ACTOR_BG_GJYO_BRIDGE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GJYO_OBJECTS, sizeof(BgGjyoBridge), @@ -75,9 +75,9 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) Player* player = PLAYER; if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && - (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.posRot.pos.x > -70.0f) && - (player->actor.posRot.pos.x < 300.0f) && (player->actor.posRot.pos.y > 1340.0f) && - (player->actor.posRot.pos.z > 1340.0f) && (player->actor.posRot.pos.z < 1662.0f) && + (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.world.pos.x > -70.0f) && + (player->actor.world.pos.x < 300.0f) && (player->actor.world.pos.y > 1340.0f) && + (player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) && !Gameplay_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_02002640); gSaveContext.cutsceneTrigger = 1; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index dfc40ef178..5997d1d8e0 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -24,7 +24,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, GlobalContext* globa const ActorInit Bg_Gnd_Darkmeiro_InitVars = { ACTOR_BG_GND_DARKMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndDarkmeiro), diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index a9b02997ec..a5f7652033 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_0600ECD8; /* const ActorInit Bg_Gnd_Firemeiro_InitVars = { ACTOR_BG_GND_FIREMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndFiremeiro), diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index 0ee93ed524..c079e69e08 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -29,7 +29,7 @@ extern CollisionHeader D_06004618; const ActorInit Bg_Gnd_Iceblock_InitVars = { ACTOR_BG_GND_ICEBLOCK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndIceblock), @@ -56,17 +56,17 @@ void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_06004618, &colHeader); - this->targetPos = this->dyna.actor.initPosRot.pos; + this->targetPos = this->dyna.actor.home.pos; this->actionFunc = BgGndIceblock_Idle; this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - if (this->dyna.actor.posRot.pos.x == 2792.0f) { + if (this->dyna.actor.world.pos.x == 2792.0f) { this->dyna.actor.params = 0; sBlockPositions[0] = 7; - } else if (this->dyna.actor.posRot.pos.x == 3032.0f) { + } else if (this->dyna.actor.world.pos.x == 3032.0f) { this->dyna.actor.params = 1; sBlockPositions[1] = 14; } else { - LOG_FLOAT("thisx->world.position.x", this->dyna.actor.posRot.pos.x, "../z_bg_gnd_iceblock.c", 138); + LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x, "../z_bg_gnd_iceblock.c", 138); __assert("0", "../z_bg_gnd_iceblock.c", 139); } } @@ -242,7 +242,7 @@ void BgGndIceblock_Idle(BgGndIceblock* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; if (this->dyna.unk_150 > 0.0f) { BgGndIceblock_SetNextPosition(this); - if (func_8002DBB0(&this->dyna.actor, &this->targetPos) > 1.0f) { + if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->targetPos) > 1.0f) { func_8002DF54(globalCtx, &this->dyna.actor, 8); this->actionFunc = BgGndIceblock_Slide; } @@ -259,8 +259,8 @@ void BgGndIceblock_Reset(BgGndIceblock* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) { - this->targetPos = thisx->initPosRot.pos; + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { + this->targetPos = thisx->home.pos; thisx->speedXZ = 0.0f; this->actionFunc = BgGndIceblock_Idle; switch (thisx->params) { @@ -278,11 +278,11 @@ void BgGndIceblock_Fall(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 300.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 300.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 100.0f; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.y = thisx->home.pos.y - 100.0f; + thisx->world.pos.z = thisx->home.pos.z; if (Player_InCsMode(globalCtx)) { func_8002DF54(globalCtx, thisx, 7); } @@ -294,7 +294,7 @@ void BgGndIceblock_Hole(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 100.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 100.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; if (Player_InCsMode(globalCtx)) { func_8002DF54(globalCtx, thisx, 7); @@ -311,12 +311,12 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); - atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ); - atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ); + atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); + atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); if (atTarget) { thisx->speedXZ = 0.0f; - this->targetPos.x = thisx->posRot.pos.x; - this->targetPos.z = thisx->posRot.pos.z; + this->targetPos.x = thisx->world.pos.x; + this->targetPos.z = thisx->world.pos.z; Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); switch (BgGndIceblock_NextAction(this)) { case GNDICE_IDLE: @@ -335,17 +335,13 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) { velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.y = Rand_ZeroOne() + 1.0f; velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); - pos.y = thisx->posRot.pos.y; + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); + pos.y = thisx->world.pos.y; func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); spread = Rand_CenteredFloat(120.0f); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 58d9b4eb64..af0f8acf17 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -17,7 +17,7 @@ void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Gnd_Nisekabe_InitVars = { ACTOR_BG_GND_NISEKABE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndNisekabe), diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index b82e3d7493..ee410ce7fc 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -22,7 +22,7 @@ void func_8087B350(BgGndSoulmeiro* this, GlobalContext* globalCtx); const ActorInit Bg_Gnd_Soulmeiro_InitVars = { ACTOR_BG_GND_SOULMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndSoulmeiro), @@ -33,8 +33,22 @@ const ActorInit Bg_Gnd_Soulmeiro_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 20, 20, { 0, 0, 0 } }, }; @@ -63,8 +77,8 @@ void BgGndSoulmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_8087B284; if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 9); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); this->actor.draw = NULL; Actor_Kill(&this->actor); return; @@ -116,8 +130,8 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if (!this->unk_198) { Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); Actor_Kill(&this->actor); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 9); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 9); return; } @@ -126,29 +140,29 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if ((this->unk_198 % 6) == 0) { temp_2 = Rand_ZeroOne() * (10922.0f); // This should be: 0x10000 / 6.0f vecA.y = 0.0f; - vecB.y = this->actor.posRot.pos.y; + vecB.y = this->actor.world.pos.y; this2 = this; for (i = 0; i < 6; i++) { temp_1 = Rand_CenteredFloat(0x2800) + temp_2; temp_3 = Math_SinS(temp_1); temp_4 = Math_CosS(temp_1); - vecB.x = this2->actor.posRot.pos.x + (120.0f * temp_3); - vecB.z = this2->actor.posRot.pos.z + (120.0f * temp_4); - distXZ = Math_Vec3f_DistXZ(&this2->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f); + vecB.x = this2->actor.world.pos.x + (120.0f * temp_3); + vecB.z = this2->actor.world.pos.z + (120.0f * temp_4); + distXZ = Math_Vec3f_DistXZ(&this2->actor.home.pos, &vecB) * (1.0f / 120.0f); if (distXZ < 0.7f) { temp_3 = Math_SinS(temp_1 + 0x8000); temp_4 = Math_CosS(temp_1 + 0x8000); - vecB.x = this->actor.posRot.pos.x + (120.0f * temp_3); - vecB.z = this->actor.posRot.pos.z + (120.0f * temp_4); - distXZ = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f); + vecB.x = this->actor.world.pos.x + (120.0f * temp_3); + vecB.z = this->actor.world.pos.z + (120.0f * temp_4); + distXZ = Math_Vec3f_DistXZ(&this->actor.home.pos, &vecB) * (1.0f / 120.0f); } vecA.x = 4.0f * temp_3 * distXZ; vecA.y = 0.0f; vecA.z = 4.0f * temp_4 * distXZ; - EffectSsDeadDb_Spawn(globalCtx, &this->actor.initPosRot.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170, - 255, 0, 0, 1, 14, true); + EffectSsDeadDb_Spawn(globalCtx, &this->actor.home.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170, 255, 0, + 0, 1, 14, true); temp_2 += 0x2AAA; } } @@ -159,13 +173,13 @@ void func_8087B284(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { this->actor.draw = BgGndSoulmeiro_Draw; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_198 = 40; this->actionFunc = func_8087AF38; return; } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index e04b5c2220..bdaff7b6f4 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -23,7 +23,7 @@ void func_8087BAE4(BgHaka* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_InitVars = { ACTOR_BG_HAKA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA, sizeof(BgHaka), @@ -63,7 +63,7 @@ void BgHaka_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_8087B758(BgHaka* this, Player* player) { Vec3f sp1C; - func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.world.pos); if (fabsf(sp1C.x) < 34.6f && sp1C.z > -112.8f && sp1C.z < -36.0f) { player->stateFlags2 |= 0x200; } @@ -86,7 +86,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; } else { - this->dyna.actor.posRot.rot.y = this->dyna.actor.shape.rot.y + 0x8000; + this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000; this->actionFunc = func_8087B938; } } @@ -100,19 +100,19 @@ void func_8087B938(BgHaka* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ += 0.05f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 1.5f); sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speedXZ); - this->dyna.actor.posRot.pos.x = - Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = + Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = + Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.z; if (sp38 != 0) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; if (this->dyna.actor.params == 1) { func_80078884(NA_SE_SY_CORRECT_CHIME); } else if (gSaveContext.nightFlag && globalCtx->sceneNum == SCENE_SPOT02) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.y, this->dyna.actor.initPosRot.pos.z, 0, - this->dyna.actor.shape.rot.y, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0, + 1); } this->actionFunc = func_8087BAAC; } diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 4a2a28b501..08e6faf3fa 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -56,13 +56,13 @@ extern CollisionHeader D_060131C4; static s16 sSkullOfTruthRotY = 0x100; static u8 sPuzzleState = 1; -static f32 sStatueDistToLink = 0; +static f32 sStatueDistToPlayer = 0; static s16 sStatueRotY; const ActorInit Bg_Haka_Gate_InitVars = { ACTOR_BG_HAKA_GATE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaGate), @@ -113,7 +113,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == BGHAKAGATE_STATUE) { CollisionHeader_GetVirtual(&D_060131C4, &colHeader); this->vTimer = 0; - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->actionFunc = BgHakaGate_StatueInactive; } else { @@ -130,10 +130,10 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_0600A938, &colHeader); if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->actionFunc = BgHakaGate_DoNothing; - thisx->posRot.pos.y += 80.0f; + thisx->world.pos.y += 80.0f; } else { thisx->flags |= 0x10; - Actor_SetHeight(thisx, 30.0f); + Actor_SetFocus(thisx, 30.0f); this->actionFunc = BgHakaGate_GateWait; } } @@ -171,10 +171,10 @@ void BgHakaGate_StatueIdle(BgHakaGate* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { if (this->vTimer == 0) { - this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsLink; - sStatueDistToLink = this->dyna.actor.xzDistToLink; + this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsPlayer; + sStatueDistToPlayer = this->dyna.actor.xzDistToPlayer; forceDirection = (this->dyna.unk_150 >= 0.0f) ? 1.0f : -1.0f; - linkDirection = ((s16)(this->dyna.actor.yawTowardsLink - player->actor.shape.rot.y) > 0) ? -1 : 1; + linkDirection = ((s16)(this->dyna.actor.yawTowardsPlayer - player->actor.shape.rot.y) > 0) ? -1 : 1; this->vTurnDirection = linkDirection * forceDirection; this->actionFunc = BgHakaGate_StatueTurn; } else { @@ -203,15 +203,15 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10); turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection; this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f); - if ((player->stateFlags2 & 0x10) && (sStatueDistToLink > 0.0f)) { - player->actor.posRot.pos.x = - this->dyna.actor.initPosRot.pos.x + - (Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink); - player->actor.posRot.pos.z = - this->dyna.actor.initPosRot.pos.z + - (Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink); + if ((player->stateFlags2 & 0x10) && (sStatueDistToPlayer > 0.0f)) { + player->actor.world.pos.x = + this->dyna.actor.home.pos.x + + (Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer); + player->actor.world.pos.z = + this->dyna.actor.home.pos.z + + (Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer); } else { - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; } sStatueRotY = this->dyna.actor.shape.rot.y; if (turnFinished) { @@ -227,14 +227,14 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { } void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) { - if ((sStatueDistToLink > 1.0f) && (sStatueRotY != 0)) { + if ((sStatueDistToPlayer > 1.0f) && (sStatueRotY != 0)) { Player* player = PLAYER; f32 radialDist; f32 angDist; f32 cos = Math_CosS(sStatueRotY); f32 sin = Math_SinS(sStatueRotY); - f32 dx = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x; - f32 dz = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z; + f32 dx = player->actor.world.pos.x - this->dyna.actor.world.pos.x; + f32 dz = player->actor.world.pos.z - this->dyna.actor.world.pos.z; radialDist = dx * cos - dz * sin; angDist = dx * sin + dz * cos; @@ -242,7 +242,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) { if ((radialDist > 110.0f) || (fabsf(angDist) > 40.0f)) { s16 yawDiff = sSkullOfTruthRotY - sStatueRotY; - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; if (ABS(yawDiff) < 0x80) { Flags_SetSwitch(globalCtx, this->switchFlag); sPuzzleState = SKULL_OF_TRUTH_FOUND; @@ -280,7 +280,7 @@ void BgHakaGate_GateWait(BgHakaGate* this, GlobalContext* globalCtx) { } void BgHakaGate_GateOpen(BgHakaGate* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 80.0f, 1.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 80.0f, 1.0f)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); this->dyna.actor.flags &= ~0x10; this->actionFunc = BgHakaGate_DoNothing; @@ -332,7 +332,7 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); - Matrix_Translate(thisx->posRot.pos.x, thisx->posRot.pos.y + 15.0f, thisx->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + 15.0f, thisx->world.pos.z, MTXMODE_NEW); Matrix_RotateY(Camera_GetCamDirYaw(ACTIVE_CAM) * (M_PI / 0x8000), MTXMODE_APPLY); scale = this->vFlameScale * 0.00001f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 19a44eacf8..b4ea40dbdd 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_06000870; /* const ActorInit Bg_Haka_Huta_InitVars = { ACTOR_BG_HAKA_HUTA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKACH_OBJECTS, sizeof(BgHakaHuta), diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index f5a5178715..3b87b6d214 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -21,7 +21,7 @@ void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Megane_InitVars = { ACTOR_BG_HAKA_MEGANE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaMegane), diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 9e50a0ce06..74e9bec158 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -26,7 +26,7 @@ void func_8087E34C(BgHakaMeganeBG* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_MeganeBG_InitVars = { ACTOR_BG_HAKA_MEGANEBG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaMeganeBG), @@ -84,11 +84,11 @@ void BgHakaMeganeBG_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_8087DFF8; } else if (thisx->params == 3) { CollisionHeader_GetVirtual(&D_06000118, &colHeader); - thisx->initPosRot.pos.y += 100.0f; + thisx->home.pos.y += 100.0f; if (Flags_GetSwitch(globalCtx, this->unk_168)) { this->actionFunc = func_8087E34C; - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; } else { thisx->flags |= 0x10; this->actionFunc = func_8087E288; @@ -118,7 +118,7 @@ void func_8087DFF8(BgHakaMeganeBG* this, GlobalContext* globalCtx) { if (this->unk_16A == 0) { this->unk_16A = 40; - this->dyna.actor.posRot.rot.y += 0x8000; + this->dyna.actor.world.rot.y += 0x8000; this->actionFunc = func_8087E040; } } @@ -132,11 +132,11 @@ void func_8087E040(BgHakaMeganeBG* this, GlobalContext* globalCtx) { xSub = (sinf(((this->unk_16A * 0.025f) + 0.5f) * M_PI) + 1.0f) * 160.0f; - if (this->dyna.actor.posRot.rot.y != this->dyna.actor.shape.rot.y) { + if (this->dyna.actor.world.rot.y != this->dyna.actor.shape.rot.y) { xSub = 320.0f - xSub; } - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x - xSub; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - xSub; if (this->unk_16A == 0) { this->unk_16A = 20; @@ -157,7 +157,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) { this->unk_16A--; } - if (!Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 640.0f, + if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f, this->dyna.actor.velocity.y)) { func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); } @@ -170,7 +170,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) { } void func_8087E1E0(BgHakaMeganeBG* this, GlobalContext* globalCtx) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 16.0f / 3.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); if (this->unk_16A != 0) { @@ -198,8 +198,8 @@ void func_8087E288(BgHakaMeganeBG* this, GlobalContext* globalCtx) { void func_8087E2D8(BgHakaMeganeBG* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.speedXZ)) { - Actor_SetHeight(&this->dyna.actor, 50.0f); + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speedXZ)) { + Actor_SetFocus(&this->dyna.actor, 50.0f); this->actionFunc = func_8087E34C; } else { func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 0f77b4f89d..9b87dc6b7b 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -31,7 +31,7 @@ extern Gfx D_060021F0[]; const ActorInit Bg_Haka_Sgami_InitVars = { ACTOR_BG_HAKA_SGAMI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaSgami), @@ -41,42 +41,91 @@ const ActorInit Bg_Haka_Sgami_InitVars = { NULL, }; -static ColliderTrisItemInit sTriItemsInit[] = { +static ColliderTrisElementInit sTrisElementsInit[4] = { { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 365.0f, 45.0f, 27.0f }, { 130.0f, 45.0f, 150.0f }, { 290.0f, 45.0f, 145.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 250.0f, 45.0f, 90.0f }, { 50.0f, 45.0f, 80.0f }, { 160.0f, 45.0f, 160.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { -305.0f, 33.0f, -7.0f }, { -220.0f, 33.0f, 40.0f }, { -130.0f, 33.0f, -5.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { -190.0f, 33.0f, 40.0f }, { -30.0f, 33.0f, 15.0f }, { -70.0f, 33.0f, -30.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 4, - sTriItemsInit, + sTrisElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 80, 130, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 4, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 4, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -104,11 +153,11 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderScytheCenter); Collider_SetCylinder(globalCtx, &this->colliderScytheCenter, thisx, &sCylinderInit); - this->colliderScytheCenter.dim.pos.x = thisx->posRot.pos.x; - this->colliderScytheCenter.dim.pos.y = thisx->posRot.pos.y; - this->colliderScytheCenter.dim.pos.z = thisx->posRot.pos.z; + this->colliderScytheCenter.dim.pos.x = thisx->world.pos.x; + this->colliderScytheCenter.dim.pos.y = thisx->world.pos.y; + this->colliderScytheCenter.dim.pos.z = thisx->world.pos.z; - func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); for (i = 0; i < 4; i++) { blureInit.p1StartColor[i] = sP1StartColor[i]; @@ -129,7 +178,7 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { this->requiredObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ICE_OBJECTS); this->colliderScytheCenter.dim.radius = 30; this->colliderScytheCenter.dim.height = 70; - Actor_SetHeight(thisx, 40.0f); + Actor_SetFocus(thisx, 40.0f); } if (this->requiredObjBankIndex < 0) { @@ -174,7 +223,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { f32 actorRotYSin; f32 actorRotYCos; s32 iterateCount; - ColliderTrisItemInit* colliderList; + ColliderTrisElementInit* elementInit; if (this->timer != 0) { this->timer--; @@ -192,42 +241,43 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { iterateCount = (this->actor.params != 0) ? 4 : 2; for (i = iterateCount - 2; i < iterateCount; i++) { - colliderList = &sTrisInit.list[i]; + elementInit = &sTrisInit.elements[i]; for (j = 0; j < 3; j++) { - scytheVertices[j].x = this->actor.posRot.pos.x + colliderList->dim.vtx[j].z * actorRotYSin + - colliderList->dim.vtx[j].x * actorRotYCos; - scytheVertices[j].y = this->actor.posRot.pos.y + colliderList->dim.vtx[j].y; - scytheVertices[j].z = this->actor.posRot.pos.z + colliderList->dim.vtx[j].z * actorRotYCos - - colliderList->dim.vtx[j].x * actorRotYSin; + scytheVertices[j].x = this->actor.world.pos.x + elementInit->dim.vtx[j].z * actorRotYSin + + elementInit->dim.vtx[j].x * actorRotYCos; + scytheVertices[j].y = this->actor.world.pos.y + elementInit->dim.vtx[j].y; + scytheVertices[j].z = this->actor.world.pos.z + elementInit->dim.vtx[j].z * actorRotYCos - + elementInit->dim.vtx[j].x * actorRotYSin; } - func_800627A0(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); for (j = 0; j < 3; j++) { - scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; - scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; } - func_800627A0(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], + &scytheVertices[2]); } if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) { - scytheVertices[0].x = this->actor.posRot.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin + + scytheVertices[0].x = this->actor.world.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin + blureEffectVertices1[this->actor.params].x * actorRotYCos; - scytheVertices[0].y = this->actor.posRot.pos.y + blureEffectVertices1[this->actor.params].y; - scytheVertices[0].z = this->actor.posRot.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos - + scytheVertices[0].y = this->actor.world.pos.y + blureEffectVertices1[this->actor.params].y; + scytheVertices[0].z = this->actor.world.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos - blureEffectVertices1[this->actor.params].x * actorRotYSin; - scytheVertices[1].x = this->actor.posRot.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin + + scytheVertices[1].x = this->actor.world.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin + blureEffectVertices2[this->actor.params].x * actorRotYCos; - scytheVertices[1].y = this->actor.posRot.pos.y + blureEffectVertices2[this->actor.params].y; - scytheVertices[1].z = this->actor.posRot.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos - + scytheVertices[1].y = this->actor.world.pos.y + blureEffectVertices2[this->actor.params].y; + scytheVertices[1].z = this->actor.world.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos - blureEffectVertices2[this->actor.params].x * actorRotYSin; EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[0]), &scytheVertices[0], &scytheVertices[1]); for (j = 0; j < 2; j++) { - scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; - scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; } EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]); diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index 240cb7f07d..fb7f5b9f9c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -17,7 +17,7 @@ typedef struct BgHakaSgami { /* 0x0154 */ s32 blureEffectIndex[2]; /* 0x015C */ ColliderCylinder colliderScytheCenter; /* 0x01A8 */ ColliderTris colliderScythe; - /* 0x01C8 */ ColliderTrisItem colliderScytheItems[4]; + /* 0x01C8 */ ColliderTrisElement colliderScytheItems[4]; } BgHakaSgami; // size = 0x0338 extern const ActorInit Bg_Haka_Sgami_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index a0bca7a21f..abdb8cfa5e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -32,7 +32,7 @@ extern UNK_TYPE D_0600ED7C; /* const ActorInit Bg_Haka_Ship_InitVars = { ACTOR_BG_HAKA_SHIP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaShip), diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 2c85b369ab..a323e52624 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -32,7 +32,7 @@ static UNK_TYPE D_80880F30 = 0; const ActorInit Bg_Haka_Trap_InitVars = { ACTOR_BG_HAKA_TRAP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaTrap), @@ -43,29 +43,64 @@ const ActorInit Bg_Haka_Trap_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x11, 0x0D, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 30, 90, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00020000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00020000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f }, { 1800.0f, 0.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x00, 0x0050, 0x0064, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 100, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), @@ -117,17 +152,17 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->velocity.y = 0.5f; } - thisx->groundY = thisx->initPosRot.pos.y - 225.0f; - this->unk_16A = (thisx->groundY + 50.0f) - 25.0f; + thisx->floorHeight = thisx->home.pos.y - 225.0f; + this->unk_16A = (thisx->floorHeight + 50.0f) - 25.0f; this->colliderCylinder.dim.radius = 10; this->colliderCylinder.dim.height = 40; } else { if (thisx->params == HAKA_TRAP_SPIKED_WALL) { CollisionHeader_GetVirtual(&D_060081D0, &colHeader); - thisx->initPosRot.pos.x -= 200.0f; + thisx->home.pos.x -= 200.0f; } else { - thisx->initPosRot.pos.x += 200.0f; + thisx->home.pos.x += 200.0f; CollisionHeader_GetVirtual(&D_06008D10, &colHeader); } @@ -137,8 +172,8 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { this->colliderCylinder.dim.radius = 18; this->colliderCylinder.dim.height = 115; - this->colliderCylinder.body.toucherFlags = this->colliderCylinder.body.toucherFlags; - this->colliderCylinder.body.toucherFlags |= 0x10; + this->colliderCylinder.info.toucherFlags = this->colliderCylinder.info.toucherFlags; + this->colliderCylinder.info.toucherFlags |= TOUCH_SFX_WOOD; this->actionFunc = func_808801B8; } @@ -151,7 +186,7 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->uncullZoneScale = 500.0f; } - func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, 0, &sColChkInfoInit); } void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -178,7 +213,7 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) { f32 zNonNegative; Player* player = PLAYER; - func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.world.pos); sine = Math_SinS(this->dyna.actor.shape.rot.y); cosine = Math_CosS(this->dyna.actor.shape.rot.y); @@ -192,8 +227,8 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) { sp28.z = zNonNegative * 15.0f; } - this->colliderCylinder.dim.pos.x = this->dyna.actor.posRot.pos.x + sp28.x * cosine + sp28.z * sine; - this->colliderCylinder.dim.pos.z = this->dyna.actor.posRot.pos.z + sp28.x * sine + sp28.z * cosine; + this->colliderCylinder.dim.pos.x = this->dyna.actor.world.pos.x + sp28.x * cosine + sp28.z * sine; + this->colliderCylinder.dim.pos.z = this->dyna.actor.world.pos.z + sp28.x * sine + sp28.z * cosine; } void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { @@ -201,7 +236,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { Player* player = PLAYER; if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) { - if (!Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x, 0.5f)) { + if (!Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x, 0.5f)) { func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) { D_80881018 |= 1; @@ -212,7 +247,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { func_8087FFC0(this, globalCtx); - if (this->colliderSpikes.base.acFlags & 2) { + if (this->colliderSpikes.base.acFlags & AC_HIT) { this->timer = 20; D_80880F30 = 1; this->actionFunc = func_808802D8; @@ -239,9 +274,9 @@ void func_808802D8(BgHakaTrap* this, GlobalContext* globalCtx) { xScale = (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) ? -30.0f : 30.0f; - vector.x = xScale * rand + this->dyna.actor.posRot.pos.x; - vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.posRot.pos.y + 30.0f; - vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.posRot.pos.z; + vector.x = xScale * rand + this->dyna.actor.world.pos.x; + vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.world.pos.y + 30.0f; + vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vector, &zeroVec, &zeroVec, 130, 20, 255, 255, 150, 170, 255, 0, 0, 1, 9, false); @@ -267,8 +302,8 @@ void func_80880484(BgHakaTrap* this, GlobalContext* globalCtx) { this->timer -= 1; } - sp24 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 185.0f, - this->dyna.actor.velocity.y); + sp24 = + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 185.0f, this->dyna.actor.velocity.y); timer = this->timer; if ((timer == 10 && !this->unk_16A) || (timer == 13 && this->unk_16A)) { @@ -295,12 +330,12 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) { } if (this->unk_16A) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 27.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 27.0f); } else { if (this->timer > 20) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 90.0f, 9.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 90.0f, 9.0f); } else { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 4.5f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.5f); } if (this->timer == 20) { @@ -310,7 +345,7 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 20; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; this->dyna.actor.velocity.y = 0.1f; this->actionFunc = func_80880484; } @@ -331,11 +366,11 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { this->timer--; } - vector.x = this->dyna.actor.posRot.pos.x + 90.0f; - vector.y = (this->dyna.actor.posRot.pos.y + 1.0f) + 25.0f; - vector.z = this->dyna.actor.posRot.pos.z; + vector.x = this->dyna.actor.world.pos.x + 90.0f; + vector.y = (this->dyna.actor.world.pos.y + 1.0f) + 25.0f; + vector.z = this->dyna.actor.world.pos.z; - tempf20 = this->dyna.actor.groundY; + tempf20 = this->dyna.actor.floorHeight; for (i = 0; i < 3; i++) { temp = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &sp64, &this->dyna.actor, @@ -348,7 +383,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { vector.x -= 90.0f; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, tempf20, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, tempf20, this->dyna.actor.velocity.y)) { if (this->dyna.actor.velocity.y > 0.01f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); } @@ -362,8 +397,8 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->dyna.actor.velocity.y = 0.0f; this->timer = 30; - this->unk_16A = (s16)this->dyna.actor.posRot.pos.y + 50.0f; - this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.initPosRot.pos.y); + this->unk_16A = (s16)this->dyna.actor.world.pos.y + 50.0f; + this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.home.pos.y); this->actionFunc = func_808808F4; } @@ -375,14 +410,14 @@ void func_808808F4(BgHakaTrap* this, GlobalContext* globalCtx) { } if (this->timer > 20) { - this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->unk_16A, 15.0f); + this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->unk_16A, 15.0f); } else { - this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 20.0f); + this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 20.0f); } if (this->timer == 0) { this->timer = 30; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; this->dyna.actor.velocity.y = 0.5f; this->actionFunc = func_808806BC; } @@ -402,7 +437,7 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) { Player* player = PLAYER; Vec3f sp18; - func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.world.pos); if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) && (PLAYER->currentBoots != PLAYER_BOOTS_IRON)) { @@ -413,23 +448,23 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) { void func_80880AE8(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer != 0) { - if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) { + if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 40; this->actionFunc = func_808809B0; } } else { - if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0x3A00, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) { + if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 100; this->actionFunc = func_80880C0C; } } - this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z; - if (this->dyna.actor.posRot.rot.z >= 0x1801) { + this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; + if (this->dyna.actor.world.rot.z >= 0x1801) { func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); } - func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z); + func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z); } void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) { @@ -444,13 +479,13 @@ void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) { this->actionFunc = func_80880AE8; } - this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z; - func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z); + this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; + func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z); } void BgHakaTrap_Update(Actor* thisx, GlobalContext* globalCtx) { BgHakaTrap* this = THIS; - Vec3f* actorPos = &thisx->posRot.pos; + Vec3f* actorPos = &thisx->world.pos; this->actionFunc(this, globalCtx); @@ -475,13 +510,13 @@ void func_80880D68(BgHakaTrap* this) { Vec3f vec2; Vec3f vec1; - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[0], &vec1); - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[1], &vec2); - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[2], &vec3); - func_800627A0(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3); + Collider_SetTrisVertices(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); - Matrix_MultVec3f(&sTrisItemsInit[1].dim.vtx[2], &vec2); - func_800627A0(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); + Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2); + Collider_SetTrisVertices(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); } void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -508,9 +543,9 @@ void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actionFunc == func_808808F4) && !this->unk_169) { - sp2C.x = thisx->posRot.pos.x; - sp2C.z = thisx->posRot.pos.z; - sp2C.y = thisx->posRot.pos.y + 110.0f; + sp2C.x = thisx->world.pos.x; + sp2C.z = thisx->world.pos.z; + sp2C.y = thisx->world.pos.y + 110.0f; SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &sp2C, &this->unk_16C); func_80078914(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index f7641d44c1..c83a7cd584 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -26,7 +26,7 @@ typedef struct BgHakaTrap { /* 0x016C */ Vec3f unk_16C; /* 0x0178 */ ColliderCylinder colliderCylinder; /* 0x01C4 */ ColliderTris colliderSpikes; - /* 0x01E4 */ ColliderTrisItem colliderSpikesItem[2]; + /* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2]; } BgHakaTrap; // size = 0x029C extern const ActorInit Bg_Haka_Trap_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 17475c9d8b..7dcd20b125 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -20,7 +20,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Tubo_InitVars = { ACTOR_BG_HAKA_TUBO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaTubo), @@ -31,14 +31,42 @@ const ActorInit Bg_Haka_Tubo_InitVars = { }; static ColliderCylinderInit sPotColliderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 25, 60, 30, { 0, 0, 0 } }, }; static ColliderCylinderInit sFlamesColliderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000008, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 60, 45, 235, { 0, 0, 0 } }, }; @@ -85,26 +113,26 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple this->dyna.actor.shape.rot.y += 0x180; - this->dyna.actor.posRot.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f; - this->dyna.actor.posRot.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f; + this->dyna.actor.world.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f; + this->dyna.actor.world.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f; } // Colliding with flame circle - if (this->flamesCollider.base.atFlags & 2) { - this->flamesCollider.base.atFlags &= ~2; - func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsLink, 5.0f); + if (this->flamesCollider.base.atFlags & AT_HIT) { + this->flamesCollider.base.atFlags &= ~AT_HIT; + func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f); } // Colliding with hitbox inside the pot - if (this->potCollider.base.acFlags & 2) { - this->potCollider.base.acFlags &= ~2; + if (this->potCollider.base.acFlags & AC_HIT) { + this->potCollider.base.acFlags &= ~AC_HIT; // If the colliding actor is within a 50 unit radius and 50 unit height cylinder centered // on the actor's position, break the pot - if (func_8002DBB0(&this->dyna.actor, &this->potCollider.base.ac->posRot.pos) < 50.0f && - (this->potCollider.base.ac->posRot.pos.y - this->dyna.actor.posRot.pos.y) < 50.0f) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.z = this->dyna.actor.posRot.pos.z; - pos.y = this->dyna.actor.posRot.pos.y + 80.0f; + if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->potCollider.base.ac->world.pos) < 50.0f && + (this->potCollider.base.ac->world.pos.y - this->dyna.actor.world.pos.y) < 50.0f) { + pos.x = this->dyna.actor.world.pos.x; + pos.z = this->dyna.actor.world.pos.z; + pos.y = this->dyna.actor.world.pos.y + 80.0f; EffectSsBomb2_SpawnLayered(globalCtx, &pos, &sZeroVector, &sZeroVector, 100, 45); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 50, NA_SE_EV_BOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK); EffectSsHahen_SpawnBurst(globalCtx, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, D_0400CD80); this->dropTimer = 5; this->dyna.actor.draw = NULL; @@ -112,8 +140,8 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { this->actionFunc = BgHakaTubo_DropCollectible; } } else { - Collider_CylinderUpdate(&this->dyna.actor, &this->flamesCollider); - Collider_CylinderUpdate(&this->dyna.actor, &this->potCollider); + Collider_UpdateCylinder(&this->dyna.actor, &this->flamesCollider); + Collider_UpdateCylinder(&this->dyna.actor, &this->potCollider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->potCollider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base); @@ -129,9 +157,9 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { this->dropTimer--; if (this->dropTimer == 0) { // Creates a delay between destroying the pot and dropping the collectible - spawnPos.x = this->dyna.actor.posRot.pos.x; - spawnPos.y = this->dyna.actor.posRot.pos.y + 200.0f; - spawnPos.z = this->dyna.actor.posRot.pos.z; + spawnPos.x = this->dyna.actor.world.pos.x; + spawnPos.y = this->dyna.actor.world.pos.y + 200.0f; + spawnPos.z = this->dyna.actor.world.pos.z; if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple rnd = Rand_ZeroOne(); sPotsDestroyed++; @@ -144,14 +172,14 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &spawnPos, i % 3); if (collectible != NULL) { collectible->actor.velocity.y = 15.0f; - collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71); + collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71); } } } else if (rnd < 0.2f) { // Unlucky, no reward and spawn keese collectibleParams = -1; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + 80.0f, this->dyna.actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + 80.0f, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, 2); func_80078884(NA_SE_SY_ERROR); } else { @@ -180,7 +208,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &spawnPos, collectibleParams); if (collectible != NULL) { collectible->actor.velocity.y = 15.0f; - collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y; + collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y; } } Actor_Kill(&this->dyna.actor); @@ -200,8 +228,8 @@ void BgHakaTubo_DrawFlameCircle(BgHakaTubo* this, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_haka_tubo.c", 476); func_80093D84(globalCtx->state.gfxCtx); - Matrix_Translate(this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 235.0f, - this->dyna.actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 235.0f, this->dyna.actor.world.pos.z, + MTXMODE_NEW); Matrix_RotateY(this->dyna.actor.shape.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_Scale(0.07f, 0.04f, 0.07f, MTXMODE_APPLY); if (1) {} diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index 7364aaf237..7b6f9d07ab 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -21,7 +21,7 @@ void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Water_InitVars = { ACTOR_BG_HAKA_WATER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HAKACH_OBJECTS, sizeof(BgHakaWater), @@ -44,8 +44,8 @@ void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); if (Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.home.pos.y -= 200.0f; + this->actor.world.pos.y = this->actor.home.pos.y; } else { this->isLowered = false; } @@ -60,7 +60,7 @@ void func_80881D94(BgHakaWater* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 9; i++) { - globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.posRot.pos.y - 8; + globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.world.pos.y - 8; } } @@ -70,10 +70,10 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) { if (this->isLowered) { this->isLowered = false; this->actor.draw = BgHakaWater_Draw; - this->actor.initPosRot.pos.y += 200.0f; + this->actor.home.pos.y += 200.0f; } else { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; + this->actor.home.pos.y -= 200.0f; } this->actionFunc = BgHakaWater_ChangeWaterLevel; } @@ -82,19 +82,19 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) { void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx) { if (!this->isLowered && Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; + this->actor.home.pos.y -= 200.0f; } else if (this->isLowered && !Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = false; - this->actor.initPosRot.pos.y += 200.0f; + this->actor.home.pos.y += 200.0f; } - if (this->actor.initPosRot.pos.y < this->actor.posRot.pos.y) { + if (this->actor.home.pos.y < this->actor.world.pos.y) { func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f) != 0) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f) != 0) { this->actionFunc = BgHakaWater_Wait; if (this->isLowered) { this->actor.draw = NULL; @@ -119,9 +119,9 @@ void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); if (this->isLowered) { - temp = this->actor.posRot.pos.y - this->actor.initPosRot.pos.y; + temp = this->actor.world.pos.y - this->actor.home.pos.y; } else { - temp = this->actor.posRot.pos.y - (this->actor.initPosRot.pos.y - 200.0f); + temp = this->actor.world.pos.y - (this->actor.home.pos.y - 200.0f); } gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(0.765f * temp)); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 80b7f232ae..7cd25540ef 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -8,20 +8,55 @@ #define FLAGS 0x00000010 +typedef enum { + /* 0x0 */ STA_GIANT_BIRD_STATUE, + /* 0x1 */ STA_BOMBABLE_SKULL_WALL, + /* 0x2 */ STA_BOMBABLE_RUBBLE, + /* 0x3 */ STA_UNKNOWN +} ShadowTempleAssetsType; + #define THIS ((BgHakaZou*)thisx) void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx); void BgHakaZou_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaZou_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_06000A10; -extern UNK_TYPE D_06005E30; -extern UNK_TYPE D_06006F70; +void BgHakaZou_Wait(BgHakaZou* this, GlobalContext* globalCtx); +void func_80882BDC(BgHakaZou* this, GlobalContext* globalCtx); +void func_80883000(BgHakaZou* this, GlobalContext* globalCtx); +void func_80883104(BgHakaZou* this, GlobalContext* globalCtx); +void func_80883144(BgHakaZou* this, GlobalContext* globalCtx); +void func_80883254(BgHakaZou* this, GlobalContext* globalCtx); +void func_80883328(BgHakaZou* this, GlobalContext* globalCtx); +void func_808834D8(BgHakaZou* this, GlobalContext* globalCtx); +void BgHakaZou_DoNothing(BgHakaZou* this, GlobalContext* globalCtx); + +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 5, 60, 0, { 0, 0, 0 } }, +}; + +static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -/* const ActorInit Bg_Haka_Zou_InitVars = { ACTOR_BG_HAKA_ZOU, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaZou), @@ -30,35 +65,349 @@ const ActorInit Bg_Haka_Zou_InitVars = { (ActorFunc)BgHakaZou_Update, NULL, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Destroy.s") +static InitChainEntry sInitChain[] = { + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808828F4.s") +extern Gfx D_06000A10[]; +extern CollisionHeader D_06005E30; +extern CollisionHeader D_06006F70; +extern CollisionHeader D_06000C2C; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882A70.s") +void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx) { + BgHakaZou* this = THIS; + s32 pad; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882BDC.s") + Actor_ProcessInitChain(thisx, sInitChain); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882CC4.s") + this->switchFlag = (thisx->params >> 8) & 0xFF; + thisx->params &= 0xFF; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80882E54.s") + if (thisx->params == STA_UNKNOWN) { + Actor_SetScale(thisx, (Rand_ZeroOne() * 0.005f) + 0.025f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883000.s") + thisx->speedXZ = Rand_ZeroOne(); + thisx->world.rot.y = thisx->shape.rot.y * ((Rand_ZeroOne() < 0.5f) ? -1 : 1) + Rand_CenteredFloat(4096.0f); + this->timer = 20; + thisx->world.rot.x = Rand_S16Offset(0x100, 0x300) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1); + thisx->world.rot.z = Rand_S16Offset(0x400, 0x800) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1); + } else { + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); + Collider_UpdateCylinder(thisx, &this->collider); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883104.s") + DynaPolyActor_Init(&this->dyna, 0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883144.s") + if (thisx->params == STA_GIANT_BIRD_STATUE) { + thisx->uncullZoneForward = 2000.0f; + thisx->uncullZoneScale = 3000.0f; + thisx->uncullZoneDownward = 3000.0f; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883254.s") + this->requiredObjBankIndex = (thisx->params == STA_BOMBABLE_RUBBLE) + ? Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKACH_OBJECTS) + : Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKA_OBJECTS); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883328.s") + if (this->requiredObjBankIndex < 0) { + Actor_Kill(thisx); + } else if ((thisx->params != STA_UNKNOWN) && Flags_GetSwitch(globalCtx, this->switchFlag)) { + if (thisx->params != STA_GIANT_BIRD_STATUE) { + Actor_Kill(thisx); + } else { + thisx->shape.rot.x = -0x4000; + thisx->world.pos.z -= 80.0f; + thisx->world.pos.y -= 54.0f; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808834D8.s") + this->actionFunc = BgHakaZou_Wait; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_80883568.s") +void BgHakaZou_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHakaZou* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Update.s") + if (this->dyna.actor.params != STA_UNKNOWN) { + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); + Collider_DestroyCylinder(globalCtx, &this->collider); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/func_808835B8.s") +void func_808828F4(BgHakaZou* this, GlobalContext* globalCtx) { + Vec3f effectPos; + Vec3f effectVelocity; + f32 rand; + s32 i; + + effectVelocity.x = 0.0f; + effectVelocity.y = 1.0f; + effectVelocity.z = 2.0f; + + for (i = 0; i < 2; i++) { + if (i == 0) { + effectPos.x = this->dyna.actor.world.pos.x - (Rand_CenteredFloat(10.0f) + 112.0f); + } else { + effectPos.x = Rand_CenteredFloat(10.0f) + this->dyna.actor.world.pos.x; + } + + rand = Rand_ZeroOne(); + effectPos.y = this->dyna.actor.world.pos.y + (60.0f * rand); + effectPos.z = this->dyna.actor.world.pos.z + (112.0f * rand); + + func_800286CC(globalCtx, &effectPos, &effectVelocity, &sZeroVec, (Rand_ZeroOne() * 200.0f) + 1000.0f, 100); + } +} + +void BgHakaZou_Wait(BgHakaZou* this, GlobalContext* globalCtx) { + CollisionHeader* colHeader; + + if (Object_IsLoaded(&globalCtx->objectCtx, this->requiredObjBankIndex)) { + this->dyna.actor.objBankIndex = this->requiredObjBankIndex; + this->dyna.actor.draw = BgHakaZou_Draw; + + if (this->dyna.actor.params == STA_UNKNOWN) { + this->actionFunc = func_80882BDC; + return; + } + + Actor_SetObjectDependency(globalCtx, &this->dyna.actor); + + colHeader = NULL; + + if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) { + CollisionHeader_GetVirtual(&D_06006F70, &colHeader); + this->collider.dim.radius = 80; + this->collider.dim.height = 100; + this->collider.dim.yShift = -30; + this->collider.dim.pos.x -= 56; + this->collider.dim.pos.z += 56; + this->dyna.actor.uncullZoneScale = 1500.0f; + } else if (this->dyna.actor.params == STA_BOMBABLE_SKULL_WALL) { + CollisionHeader_GetVirtual(&D_06005E30, &colHeader); + this->collider.dim.yShift = -50; + } else { + CollisionHeader_GetVirtual(&D_06000C2C, &colHeader); + this->collider.dim.radius = 55; + this->collider.dim.height = 20; + } + + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); + + if ((this->dyna.actor.params == STA_GIANT_BIRD_STATUE) && Flags_GetSwitch(globalCtx, this->switchFlag)) { + this->actionFunc = BgHakaZou_DoNothing; + return; + } + + this->actionFunc = func_80883000; + } +} +void func_80882BDC(BgHakaZou* this, GlobalContext* globalCtx) { + if (this->timer != 0) { + this->timer--; + } + + this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x; + this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; + + if (this->dyna.actor.bgCheckFlags & 2) { + if (this->dyna.actor.velocity.y < -8.0f) { + this->dyna.actor.velocity.y *= -0.6f; + this->dyna.actor.velocity.y = (this->dyna.actor.velocity.y > 10.0f) ? 10.0f : this->dyna.actor.velocity.y; + this->dyna.actor.bgCheckFlags &= ~3; + this->dyna.actor.speedXZ = 2.0f; + } else { + Actor_Kill(&this->dyna.actor); + } + } + + if (this->timer == 0) { + Actor_Kill(&this->dyna.actor); + } +} + +void func_80882CC4(BgHakaZou* this, GlobalContext* globalCtx) { + s32 i; + s32 j; + Vec3f actorSpawnPos; + f32 sin; + f32 cos; + s32 pad; + + sin = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f; + cos = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 40.0f; + + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + actorSpawnPos.x = this->dyna.actor.world.pos.x + (j - 1) * sin; + actorSpawnPos.z = this->dyna.actor.world.pos.z + (j - 1) * cos; + actorSpawnPos.y = this->dyna.actor.world.pos.y + (i - 1) * 55; + + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_HAKA_ZOU, actorSpawnPos.x, actorSpawnPos.y, + actorSpawnPos.z, 0, this->dyna.actor.shape.rot.y, 0, this->dyna.actor.params + 2); + func_800286CC(globalCtx, &actorSpawnPos, &sZeroVec, &sZeroVec, 1000, 50); + } + } +} + +void func_80882E54(BgHakaZou* this, GlobalContext* globalCtx) { + Vec3f fragmentPos; + s32 i; + s32 j; + s32 num = 25; + + fragmentPos.x = this->collider.dim.pos.x; + fragmentPos.y = this->collider.dim.pos.y; + fragmentPos.z = this->collider.dim.pos.z; + + EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10); + + for (i = 0; i < 2; i++) { + for (j = 0; j < 2; j++) { + fragmentPos.x = this->collider.dim.pos.x + (((j * 2) - 1) * num); + fragmentPos.z = this->collider.dim.pos.z + (((i * 2) - 1) * num); + EffectSsHahen_SpawnBurst(globalCtx, &fragmentPos, 10.0f, 0, 10, 10, 4, 141, 40, D_06000A10); + func_800286CC(globalCtx, &fragmentPos, &sZeroVec, &sZeroVec, 1000, 50); + } + } +} + +void func_80883000(BgHakaZou* this, GlobalContext* globalCtx) { + if (this->collider.base.acFlags & 2) { + Flags_SetSwitch(globalCtx, this->switchFlag); + + if (this->dyna.actor.params == STA_GIANT_BIRD_STATUE) { + this->timer = 20; + this->actionFunc = func_80883144; + func_800800F8(globalCtx, 3400, 999, &this->dyna.actor, 0); + } else if (this->dyna.actor.params == 2) { + func_80882E54(this, globalCtx); + this->dyna.actor.draw = NULL; + this->timer = 1; + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION); + this->actionFunc = func_80883104; + } else { + func_80882CC4(this, globalCtx); + this->timer = 1; + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); + this->actionFunc = func_80883104; + } + } else { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} + +void func_80883104(BgHakaZou* this, GlobalContext* globalCtx) { + if (this->timer != 0) { + this->timer--; + } + + if (this->timer == 0) { + Actor_Kill(&this->dyna.actor); + } +} + +void func_80883144(BgHakaZou* this, GlobalContext* globalCtx) { + Vec3f explosionPos; + + if (this->timer != 0) { + this->timer--; + } + + if (!(this->timer % 4)) { + explosionPos.x = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.x - 56.0f); + explosionPos.y = (Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.y; + explosionPos.z = Rand_CenteredFloat(200.0f) + (this->dyna.actor.world.pos.z + 56.0f); + + EffectSsBomb2_SpawnLayered(globalCtx, &explosionPos, &sZeroVec, &sZeroVec, 150, 70); + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); + } + + if (this->timer == 0) { + this->timer = 20; + this->actionFunc = func_80883254; + } +} + +void func_80883254(BgHakaZou* this, GlobalContext* globalCtx) { + f32 moveDist = (Rand_ZeroOne() * 0.5f) + 0.5f; + + Math_StepToF(&this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.z - 80.0f, 2.0f * moveDist); + + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 40.0f, moveDist)) { + if (this->timer != 0) { + this->timer--; + } + + if (this->timer == 0) { + this->timer = 60; + this->dyna.actor.world.rot.x = 0x0008; + this->actionFunc = func_80883328; + } + } else { + func_808828F4(this, globalCtx); + } +} + +void func_80883328(BgHakaZou* this, GlobalContext* globalCtx) { + Vec3f effectPos; + s32 i; + s32 j; + + this->dyna.actor.world.rot.x += this->dyna.actor.world.rot.x * 0.125f; + + if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, -0x4000, this->dyna.actor.world.rot.x) != 0) { + effectPos.x = this->dyna.actor.world.pos.x; + effectPos.y = this->dyna.actor.world.pos.y; + + for (j = 0; j < 2; j++) { + effectPos.z = this->dyna.actor.world.pos.z; + + for (i = 0; i < 4; i++) { + effectPos.z -= (i == 2) ? 550.0f : 50.0f; + func_800286CC(globalCtx, &effectPos, &sZeroVec, &sZeroVec, (Rand_ZeroOne() * 200.0f) + 1000.0f, 200); + } + + effectPos.x -= 112.0f; + } + + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); + this->timer = 25; + this->actionFunc = func_808834D8; + } +} + +void func_808834D8(BgHakaZou* this, GlobalContext* globalCtx) { + f32 moveDist; + + if (this->timer != 0) { + this->timer--; + } + + moveDist = ((this->timer % 2) ? 15.0f : -15.0f); + this->dyna.actor.world.pos.y += ((this->timer & 0xFE) * 0.04f * moveDist); + + if (this->timer == 0) { + this->actionFunc = BgHakaZou_DoNothing; + } +} + +void BgHakaZou_DoNothing(BgHakaZou* this, GlobalContext* globalCtx) { +} + +void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHakaZou* this = THIS; + + this->actionFunc(this, globalCtx); + + if (this->dyna.actor.params == 3) { + Actor_MoveForward(&this->dyna.actor); + } +} + +void BgHakaZou_Draw(Actor* thisx, GlobalContext* globalCtx) { + static Gfx* dLists[] = { 0x060064E0, 0x06005CE0, 0x06000A10, 0x06005CE0 }; + + Gfx_DrawDListOpa(globalCtx, dLists[thisx->params]); +} diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index 10f711a035..06e3b7ff62 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -6,9 +6,15 @@ struct BgHakaZou; +typedef void (*BgHakaZouActionFunc)(struct BgHakaZou*, GlobalContext*); + typedef struct BgHakaZou { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x6C]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ BgHakaZouActionFunc actionFunc; + /* 0x0168 */ s8 requiredObjBankIndex; + /* 0x0169 */ u8 switchFlag; + /* 0x016A */ s16 timer; + /* 0x016C */ ColliderCylinder collider; } BgHakaZou; // size = 0x01B8 extern const ActorInit Bg_Haka_Zou_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 0c2cc8af6f..62b5462611 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -29,7 +29,7 @@ void BgHeavyBlock_DoNothing(BgHeavyBlock* this, GlobalContext* globalCtx); const ActorInit Bg_Heavy_Block_InitVars = { ACTOR_BG_HEAVY_BLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HEAVY_OBJECT, sizeof(BgHeavyBlock), @@ -52,9 +52,9 @@ extern Gfx D_06001A30[]; extern Gfx D_060018A0[]; void BgHeavyBlock_SetPieceRandRot(BgHeavyBlock* this, f32 scale) { - this->dyna.actor.posRot.rot.x = Rand_CenteredFloat(1024.0f) * scale; - this->dyna.actor.posRot.rot.y = Rand_CenteredFloat(1024.0f) * scale; - this->dyna.actor.posRot.rot.z = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.x = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.y = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.z = Rand_CenteredFloat(1024.0f) * scale; } void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { @@ -68,12 +68,12 @@ void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { rand = (randChoice < 0.0f) ? randChoice - 2.0f : randChoice + 2.0f; this->dyna.actor.velocity.y = (Rand_ZeroFloat(8.0f) + 4.0f) * scale; this->dyna.actor.velocity.z = Rand_ZeroFloat(-8.0f * scale); - yawSinCos = Math_CosS(this->dyna.actor.posRot.rot.y); + yawSinCos = Math_CosS(this->dyna.actor.world.rot.y); this->dyna.actor.velocity.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand)); - yawSinCos = Math_SinS(this->dyna.actor.posRot.rot.y); + (Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand)); + yawSinCos = Math_SinS(this->dyna.actor.world.rot.y); this->dyna.actor.velocity.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand); + (Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand); BgHeavyBlock_SetPieceRandRot(this, scale); Actor_SetScale(&this->dyna.actor, Rand_CenteredFloat(0.2f) + 1.0f); } @@ -131,12 +131,12 @@ void BgHeavyBlock_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) { this->actionFunc = BgHeavyBlock_DoNothing; - thisx->shape.rot.x = thisx->posRot.rot.x = 0x8AD0; - thisx->shape.rot.y = thisx->posRot.rot.y = 0xC000; - thisx->shape.rot.z = thisx->posRot.rot.z = 0x0; - thisx->posRot.pos.x = 1704.0f; - thisx->posRot.pos.y = 1504.0f; - thisx->posRot.pos.z = 516.0f; + thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; + thisx->shape.rot.y = thisx->world.rot.y = 0xC000; + thisx->shape.rot.z = thisx->world.rot.z = 0x0; + thisx->world.pos.x = 1704.0f; + thisx->world.pos.y = 1504.0f; + thisx->world.pos.z = 516.0f; } this->actionFunc = BgHeavyBlock_Wait; @@ -178,16 +178,16 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) { thisx->velocity.x *= 0.98f; thisx->velocity.z *= 0.98f; func_8002D7EC(thisx); - thisx->shape.rot.x += thisx->posRot.rot.x; - thisx->shape.rot.y += thisx->posRot.rot.y; - thisx->shape.rot.z += thisx->posRot.rot.z; + thisx->shape.rot.x += thisx->world.rot.x; + thisx->shape.rot.y += thisx->world.rot.y; + thisx->shape.rot.z += thisx->world.rot.z; if (!(this->pieceFlags & PIECE_FLAG_HIT_FLOOR)) { - thisx->posRot.pos.y += this->unk_164.y; - thisx->pos4.y += this->unk_164.y; - func_8002E4B4(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5); - thisx->posRot.pos.y -= this->unk_164.y; - thisx->pos4.y -= this->unk_164.y; + thisx->world.pos.y += this->unk_164.y; + thisx->prevPos.y += this->unk_164.y; + Actor_UpdateBgCheckInfo(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5); + thisx->world.pos.y -= this->unk_164.y; + thisx->prevPos.y -= this->unk_164.y; if (thisx->bgCheckFlags & 1) { this->pieceFlags |= PIECE_FLAG_HIT_FLOOR; thisx->velocity.y = Rand_ZeroFloat(4.0f) + 2.0f; @@ -195,7 +195,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) { thisx->velocity.z = Rand_CenteredFloat(8.0f); BgHeavyBlock_SetPieceRandRot(this, 1.0f); Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN); - func_800AA000(thisx->xzDistToLink, 0x96, 0xA, 8); + func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8); } } @@ -297,17 +297,17 @@ void BgHeavyBlock_SpawnPieces(BgHeavyBlock* this, GlobalContext* globalCtx) { f32 sinYaw; f32 cosYaw; - sinPitch = Math_SinS(this->dyna.actor.posRot.rot.x); - cosPitch = Math_CosS(this->dyna.actor.posRot.rot.x); - sinYaw = Math_SinS(this->dyna.actor.posRot.rot.y); - cosYaw = Math_CosS(this->dyna.actor.posRot.rot.y); + sinPitch = Math_SinS(this->dyna.actor.world.rot.x); + cosPitch = Math_CosS(this->dyna.actor.world.rot.x); + sinYaw = Math_SinS(this->dyna.actor.world.rot.y); + cosYaw = Math_CosS(this->dyna.actor.world.rot.y); for (i = 0; i < ARRAY_COUNT(spA4); i++) { pos.z = (spA4[i].y * sinPitch) + (spA4[i].z * cosPitch); - pos.x = this->dyna.actor.posRot.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z); - pos.y = this->dyna.actor.posRot.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch); - pos.z = this->dyna.actor.posRot.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z); + pos.x = this->dyna.actor.world.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z); + pos.y = this->dyna.actor.world.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch); + pos.z = this->dyna.actor.world.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_HEAVY_BLOCK, pos.x, pos.y, pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, 0, 2); @@ -365,9 +365,9 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, GlobalContext* globalCtx) { zOffset = Rand_CenteredFloat(110.0f); cosYaw = Math_CosS(this->dyna.actor.shape.rot.y); - BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.posRot.pos.x + xOffset), - this->dyna.actor.posRot.pos.y + 10.0f, - (cosYaw * -70.0f) + (this->dyna.actor.posRot.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC); + BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.world.pos.x + xOffset), + this->dyna.actor.world.pos.y + 10.0f, + (cosYaw * -70.0f) + (this->dyna.actor.world.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC); } this->timer++; @@ -388,14 +388,14 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) { f32 raycastResult; Actor_MoveForward(&this->dyna.actor); - pos.x = this->dyna.actor.initPosRot.pos.x; - pos.y = this->dyna.actor.initPosRot.pos.y + 1000.0f; - pos.z = this->dyna.actor.initPosRot.pos.z; + pos.x = this->dyna.actor.home.pos.x; + pos.y = this->dyna.actor.home.pos.y + 1000.0f; + pos.z = this->dyna.actor.home.pos.z; raycastResult = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos); - this->dyna.actor.groundY = raycastResult; + this->dyna.actor.floorHeight = raycastResult; - if (this->dyna.actor.initPosRot.pos.y <= raycastResult) { + if (this->dyna.actor.home.pos.y <= raycastResult) { func_800AA000(0.0f, 0xFF, 0x3C, 4); switch (this->dyna.actor.params & 0xFF) { @@ -414,7 +414,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) { Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetCountdown(quakeIndex, 999); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); return; case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); @@ -459,9 +459,9 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 20.0f); Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f); this->dyna.actor.gravity = 0.0f; - this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos; + this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveForward(&this->dyna.actor); - this->dyna.actor.initPosRot.pos = this->dyna.actor.posRot.pos; + this->dyna.actor.home.pos = this->dyna.actor.world.pos; switch (this->dyna.actor.params & 0xFF) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(globalCtx, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, @@ -499,12 +499,12 @@ void BgHeavyBlock_Draw(Actor* thisx, GlobalContext* globalCtx) { func_800D1694(player->leftHandPos.x, player->leftHandPos.y, player->leftHandPos.z, &thisx->shape.rot); Matrix_Translate(-this->unk_164.x, -this->unk_164.y, -this->unk_164.z, MTXMODE_APPLY); } else if ((thisx->gravity == 0.0f) && (BgHeavyBlock_Land == this->actionFunc)) { - func_800D1694(thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, &thisx->shape.rot); + func_800D1694(thisx->home.pos.x, thisx->home.pos.y, thisx->home.pos.z, &thisx->shape.rot); Matrix_Translate(-D_80884ED4.x, -D_80884ED4.y, -D_80884ED4.z, MTXMODE_APPLY); } - Matrix_MultVec3f(&D_80884EC8, &thisx->posRot.pos); - Matrix_MultVec3f(&D_80884ED4, &thisx->initPosRot.pos); + Matrix_MultVec3f(&D_80884EC8, &thisx->world.pos); + Matrix_MultVec3f(&D_80884ED4, &thisx->home.pos); func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_heavy_block.c", 931), diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 6bbad8798c..5713f37bfc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -33,18 +33,32 @@ typedef struct { } BgHidanCurtainParams; // size = 0x10 static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 81, 144, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sCcInfoInit = { 1, 0x50, 0x64, 0xFF }; +static CollisionCheckInfoInit sCcInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, { 46, 88, 0.055f, 88.0f, 3.0f } }; const ActorInit Bg_Hidan_Curtain_InitVars = { ACTOR_BG_HIDAN_CURTAIN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHidanCurtain), @@ -60,7 +74,7 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { BgHidanCurtainParams* hcParams; osSyncPrintf("Curtain (arg_data 0x%04x)\n", this->actor.params); - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->type = (thisx->params >> 0xC) & 0xF; if (this->type > 6) { // Type is not set @@ -83,19 +97,19 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, hcParams->scale); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.dim.pos.x = this->actor.posRot.pos.x; - this->collider.dim.pos.y = this->actor.posRot.pos.y; - this->collider.dim.pos.z = this->actor.posRot.pos.z; + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y; + this->collider.dim.pos.z = this->actor.world.pos.z; this->collider.dim.radius = hcParams->radius; this->collider.dim.height = hcParams->height; - Collider_CylinderUpdate(&this->actor, &this->collider); - func_80061ED4(&thisx->colChkInfo, NULL, &sCcInfoInit); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sCcInfoInit); if (this->type == 0) { this->actionFunc = BgHidanCurtain_WaitForClear; } else { this->actionFunc = BgHidanCurtain_WaitForSwitchOn; if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - hcParams->riseDist; + this->actor.world.pos.y = this->actor.home.pos.y - hcParams->riseDist; } } if (((this->type == 1) && Flags_GetTreasure(globalCtx, this->treasureFlag)) || @@ -149,7 +163,7 @@ void BgHidanCurtain_WaitForSwitchOff(BgHidanCurtain* this, GlobalContext* global void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) { f32 riseSpeed = sHCParams[this->size].riseSpeed; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, riseSpeed)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, riseSpeed)) { Flags_UnsetSwitch(globalCtx, this->actor.params); this->actionFunc = BgHidanCurtain_WaitForSwitchOn; } @@ -158,8 +172,7 @@ void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) { void BgHidanCurtain_TurnOff(BgHidanCurtain* this, GlobalContext* globalCtx) { BgHidanCurtainParams* hcParams = &sHCParams[this->size]; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - hcParams->riseDist, - hcParams->riseSpeed)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - hcParams->riseDist, hcParams->riseSpeed)) { if ((this->type == 0) || (this->type == 6)) { Actor_Kill(&this->actor); } else if (this->type == 5) { @@ -196,25 +209,22 @@ void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx2) { f32 riseProgress; if ((globalCtx->cameraPtrs[0]->setting == 0x28) || (globalCtx->cameraPtrs[0]->setting == 0x38)) { - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } else { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 1.0f); + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f); } if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = - (2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y; + this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y; } this->actionFunc(this, globalCtx); if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = - (2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y; + this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y; } - riseProgress = - (hcParams->riseDist - (this->actor.initPosRot.pos.y - this->actor.posRot.pos.y)) / hcParams->riseDist; + riseProgress = (hcParams->riseDist - (this->actor.home.pos.y - this->actor.world.pos.y)) / hcParams->riseDist; this->alpha = 255.0f * riseProgress; if (this->alpha > 50) { this->collider.dim.height = hcParams->height * riseProgress; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 4b8b2ff229..27bb393c55 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -20,7 +20,7 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Dalm_InitVars = { ACTOR_BG_HIDAN_DALM, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanDalm), @@ -30,34 +30,69 @@ const ActorInit Bg_Hidan_Dalm_InitVars = { (ActorFunc)BgHidanDalm_Draw, }; -static ColliderTrisItemInit sTrisItemInit[4] = { +static ColliderTrisElementInit sTrisElementInit[4] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, -300.0f }, { 305.0f, 600.0f, 300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, 300.0f }, { 305.0f, 0.0f, 300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { -305.0f, 0.0f, -300.0f }, { -305.0f, 600.0f, 300.0f }, { -305.0f, 600.0f, -300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { -305.0f, 0.0f, -300.0f }, { -305.0f, 0.0f, 300.0f }, { -305.0f, 600.0f, 300.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 4, - sTrisItemInit, + sTrisElementInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 65336, ICHAIN_STOP), + ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_STOP), }; extern Gfx D_0600BBF0[]; @@ -95,16 +130,17 @@ void BgHidanDalm_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->collider.base.acFlags & 2) && !Player_InCsMode(globalCtx) && + if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(globalCtx) && (player->swordAnimation == 22 || player->swordAnimation == 23)) { - this->collider.base.acFlags &= ~2; - if (this->collider.list[0].body.bumperFlags & 2 || this->collider.list[1].body.bumperFlags & 2) { - this->dyna.actor.posRot.rot.y -= 0x4000; + this->collider.base.acFlags &= ~AC_HIT; + if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) || + (this->collider.elements[1].info.bumperFlags & BUMP_HIT)) { + this->dyna.actor.world.rot.y -= 0x4000; } else { - this->dyna.actor.posRot.rot.y += 0x4000; + this->dyna.actor.world.rot.y += 0x4000; } - this->dyna.actor.posRot.pos.x += 32.5f * Math_SinS(this->dyna.actor.posRot.rot.y); - this->dyna.actor.posRot.pos.z += 32.5f * Math_CosS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.pos.x += 32.5f * Math_SinS(this->dyna.actor.world.rot.y); + this->dyna.actor.world.pos.z += 32.5f * Math_CosS(this->dyna.actor.world.rot.y); func_8002DF54(globalCtx, &this->dyna.actor, 8); this->dyna.actor.flags |= 0x10; @@ -133,13 +169,13 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx) { this->dyna.actor.scale.y = this->dyna.actor.scale.z = this->dyna.actor.scale.x; - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + this->dyna.actor.scale.x * 160.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.scale.x * 160.0f; + pos.z = this->dyna.actor.world.pos.z; for (i = 0; i < 4; i++) { - velocity.x = 5.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; - velocity.z = 5.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; + velocity.x = 5.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; + velocity.z = 5.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; velocity.y = (Rand_ZeroOne() - 0.5f) * 1.5f; EffectSsKiraKira_SpawnSmallYellow(globalCtx, &pos, &velocity, &accel); } @@ -150,7 +186,7 @@ void BgHidanDalm_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5); } /** @@ -161,19 +197,19 @@ void BgHidanDalm_UpdateCollider(BgHidanDalm* this) { Vec3f pos1; Vec3f pos0; - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[0], &pos0); - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[1], &pos1); - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[2], &pos2); - func_800627A0(&this->collider, 0, &pos0, &pos1, &pos2); - Matrix_MultVec3f(&sTrisItemInit[1].dim.vtx[2], &pos1); - func_800627A0(&this->collider, 1, &pos0, &pos2, &pos1); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[0], &pos0); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[1], &pos1); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[2], &pos2); + Collider_SetTrisVertices(&this->collider, 0, &pos0, &pos1, &pos2); + Matrix_MultVec3f(&sTrisElementInit[1].dim.vtx[2], &pos1); + Collider_SetTrisVertices(&this->collider, 1, &pos0, &pos2, &pos1); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[0], &pos0); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[1], &pos1); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[2], &pos2); - func_800627A0(&this->collider, 2, &pos0, &pos1, &pos2); - Matrix_MultVec3f(&sTrisItemInit[3].dim.vtx[1], &pos2); - func_800627A0(&this->collider, 3, &pos0, &pos2, &pos1); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[0], &pos0); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[1], &pos1); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[2], &pos2); + Collider_SetTrisVertices(&this->collider, 2, &pos0, &pos1, &pos2); + Matrix_MultVec3f(&sTrisElementInit[3].dim.vtx[1], &pos2); + Collider_SetTrisVertices(&this->collider, 3, &pos0, &pos2, &pos1); } void BgHidanDalm_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h index 1044a0b988..50bde8bea9 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h @@ -13,7 +13,7 @@ typedef struct BgHidanDalm { /* 0x0164 */ BgHidanDalmActionFunc actionFunc; /* 0x0168 */ u8 switchFlag; /* 0x016C */ ColliderTris collider; - /* 0x018C */ ColliderTrisItem colliderItems[4]; + /* 0x018C */ ColliderTrisElement colliderItems[4]; } BgHidanDalm; // size = 0x02FC extern const ActorInit Bg_Hidan_Dalm_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 3840b409de..b406f8c025 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -26,7 +26,7 @@ extern Gfx D_0600DA80[]; const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFirewall), @@ -37,17 +37,26 @@ const ActorInit Bg_Hidan_Firewall_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 83, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x01, - 0x0050, - 0x0064, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; static UNK_PTR D_80886D04[] = { 0x06015D20, 0x06016120, 0x06016520, 0x06016920, 0x06016D20, 0x06017120, 0x06017520, 0x06017920, @@ -65,9 +74,9 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.dim.pos.y = this->actor.posRot.pos.y; + this->collider.dim.pos.y = this->actor.world.pos.y; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actionFunc = BgHidanFirewall_Wait; } @@ -83,7 +92,7 @@ s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalC Vec3f distance; player = PLAYER; - func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &distance, &player->actor.world.pos); if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) { return 1; @@ -142,7 +151,7 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* player = PLAYER; - func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &sp30, &player->actor.world.pos); if (sp30.x < -70.0f) { sp30.x = -70.0f; } else { @@ -166,8 +175,8 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* } sp28 = Math_SinS(this->actor.shape.rot.y); temp_ret = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28; - this->collider.dim.pos.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret; + this->collider.dim.pos.x = this->actor.world.pos.x + sp30.x * temp_ret + sp30.z * sp28; + this->collider.dim.pos.z = this->actor.world.pos.z - sp30.x * sp28 + sp30.z * temp_ret; } void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -176,16 +185,16 @@ void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_150 = (this->unk_150 + 1) % 8; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; BgHidanFirewall_Collide(this, globalCtx); } this->actionFunc(this, globalCtx); if (this->actionFunc == BgHidanFirewall_Erupt) { BgHidanFirewall_ColliderFollowPlayer(this, globalCtx); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8002F974(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index f0588fb2b2..3e742991d4 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -24,7 +24,7 @@ extern CollisionHeader D_0600E1E8; const ActorInit Bg_Hidan_Fslift_InitVars = { ACTOR_BG_HIDAN_FSLIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFslift), @@ -51,8 +51,8 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(thisx, DPM_PLAYER); CollisionHeader_GetVirtual(&D_0600E1E8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x, - thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) { + if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->world.pos.x, + thisx->world.pos.y + 40.0f, thisx->world.pos.z + -28.0f, 0, 0, 0, 2) == NULL) { Actor_Kill(thisx); return; } @@ -63,9 +63,9 @@ void func_80886F24(BgHidanFslift* this) { Actor* thisx = &this->dyna.actor; if (thisx->child != NULL && thisx->child->update != NULL) { - thisx->child->posRot.pos.x = thisx->posRot.pos.x; - thisx->child->posRot.pos.y = thisx->posRot.pos.y + 40.0f; - thisx->child->posRot.pos.z = thisx->posRot.pos.z + -28.0f; + thisx->child->world.pos.x = thisx->world.pos.x; + thisx->child->world.pos.y = thisx->world.pos.y + 40.0f; + thisx->child->world.pos.z = thisx->world.pos.z + -28.0f; return; } thisx->child = NULL; @@ -90,7 +90,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { if (this->unk_168 == 0) { heightBool = false; - if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) { + if ((thisx->world.pos.y - thisx->home.pos.y) < 0.5f) { heightBool = true; } if (func_80043590(thisx)) { @@ -108,7 +108,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); } else { @@ -121,7 +121,7 @@ void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (func_80043590(thisx)) { - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y + 790.0f, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); } else { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 1d3007ec35..1bac23a64e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -30,7 +30,7 @@ extern Gfx D_04017BD0[]; const ActorInit Bg_Hidan_Fwbig_InitVars = { ACTOR_BG_HIDAN_FWBIG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFwbig), @@ -41,8 +41,22 @@ const ActorInit Bg_Hidan_Fwbig_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 130, 0, { 0, 0, 0 } }, }; @@ -58,18 +72,18 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->direction = (u16)(thisx->params >> 8); thisx->params &= 0xFF; if (this->direction != 0) { - this->actor.initPosRot.pos.x = 1560.0f; - this->actor.initPosRot.pos.z = 0.0f; - if (player->actor.posRot.pos.z > 300.0f) { + this->actor.home.pos.x = 1560.0f; + this->actor.home.pos.z = 0.0f; + if (player->actor.world.pos.z > 300.0f) { this->direction = -1; - this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x4E38; - } else if (player->actor.posRot.pos.z < -300.0f) { + this->actor.home.rot.y = this->actor.shape.rot.y = -0x4E38; + } else if (player->actor.world.pos.z < -300.0f) { this->direction = 1; - this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x31C8; + this->actor.home.rot.y = this->actor.shape.rot.y = -0x31C8; } else { Actor_Kill(&this->actor); return; @@ -80,7 +94,7 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.flags |= 0x10; this->moveState = FWBIG_MOVE; this->actionFunc = BgHidanFwbig_WaitForPlayer; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y); + this->actor.world.pos.y = this->actor.home.pos.y - (2400.0f * this->actor.scale.y); } else { Actor_SetScale(&this->actor, 0.1f); this->actionFunc = BgHidanFwbig_WaitForSwitch; @@ -97,8 +111,8 @@ void BgHidanFwbig_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanFwbig_UpdatePosition(BgHidanFwbig* this) { s16 startAngle = this->actor.shape.rot.y + this->direction * -0x4000; - this->actor.posRot.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.initPosRot.pos.z; + this->actor.world.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.home.pos.x; + this->actor.world.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.home.pos.z; } void BgHidanFwbig_WaitForSwitch(BgHidanFwbig* this, GlobalContext* globalCtx) { @@ -116,7 +130,7 @@ void BgHidanFwbig_WaitForCs(BgHidanFwbig* this, GlobalContext* globalCtx) { } void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 10.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 10.0f)) { if (this->direction == 0) { Flags_UnsetSwitch(globalCtx, this->actor.params); this->actionFunc = BgHidanFwbig_WaitForSwitch; @@ -127,8 +141,7 @@ void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) { } void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y), - 10.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - (2400.0f * this->actor.scale.y), 10.0f)) { if (this->direction == 0) { this->actionFunc = BgHidanFwbig_WaitForTimer; this->timer = 150; @@ -139,7 +152,7 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) { this->actor.shape.rot.y -= (this->direction * 0x1800); } else { this->moveState = FWBIG_MOVE; - this->actor.shape.rot.y = this->actor.initPosRot.rot.y; + this->actor.shape.rot.y = this->actor.home.rot.y; } BgHidanFwbig_UpdatePosition(this); this->actionFunc = BgHidanFwbig_Rise; @@ -160,7 +173,7 @@ void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, GlobalContext* globalCtx) { void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (player->actor.posRot.pos.x < 1150.0f) { + if (player->actor.world.pos.x < 1150.0f) { this->actionFunc = BgHidanFwbig_Rise; func_800800F8(globalCtx, 0xCDA, -0x63, &this->actor, 0); } @@ -168,8 +181,7 @@ void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) { void BgHidanFwbig_Move(BgHidanFwbig* this, GlobalContext* globalCtx) { if (!Player_InCsMode(globalCtx)) { - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y + (this->direction * 0x6390), - 0x20)) { + if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->direction * 0x6390), 0x20)) { this->moveState = FWBIG_RESET; this->actionFunc = BgHidanFwbig_Lower; } else { @@ -184,7 +196,7 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) { f32 cs; f32 sn; - func_8002DBD0(&this->actor, &projPos, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &projPos, &player->actor.world.pos); projPos.z = ((projPos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f; if (this->direction == 0) { projPos.x = CLAMP(projPos.x, -360.0f, 360.0f); @@ -194,20 +206,20 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) { sn = Math_SinS(this->actor.shape.rot.y); cs = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.posRot.pos.x + (projPos.x * cs) + (projPos.z * sn); - this->collider.dim.pos.z = this->actor.posRot.pos.z - (projPos.x * sn) + (projPos.z * cs); - this->collider.dim.pos.y = this->actor.posRot.pos.y; + this->collider.dim.pos.x = this->actor.world.pos.x + (projPos.x * cs) + (projPos.z * sn); + this->collider.dim.pos.z = this->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs); + this->collider.dim.pos.y = this->actor.world.pos.y; - this->actor.posRot.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; } void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgHidanFwbig* this = THIS; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.posRot.rot.y, 1.0f); + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f); if (this->direction != 0) { this->actionFunc = BgHidanFwbig_Lower; } @@ -219,10 +231,10 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - if ((this->actor.initPosRot.pos.y - 200.0f) < this->actor.posRot.pos.y) { + if ((this->actor.home.pos.y - 200.0f) < this->actor.world.pos.y) { if (gSaveContext.sceneSetupIndex < 4) { func_8002F974(&this->actor, NA_SE_EV_BURNING - SFX_FLAG); - } else if ((s16)this->actor.posRot.pos.x == -513) { + } else if ((s16)this->actor.world.pos.x == -513) { func_8002F974(&this->actor, NA_SE_EV_FLAME_OF_FIRE - SFX_FLAG); } BgHidanFwbig_MoveCollider(this, globalCtx); @@ -244,7 +256,7 @@ void BgHidanFwbig_Draw(Actor* thisx, GlobalContext* globalCtx) { height = thisx->scale.y * 2400.0f; gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 220, 0, - ((height - (thisx->initPosRot.pos.y - thisx->posRot.pos.y)) * 255.0f) / height); + ((height - (thisx->home.pos.y - thisx->world.pos.y)) * 255.0f) / height); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index adceaf2e4c..a8959d8324 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -30,26 +30,47 @@ static f32 sYPosOffsets[] = { -20.0f, -120.0f, -220.0f, -320.0f, -420.0f, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, 20.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, -20.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, - ARRAY_COUNT(sTrisItemsInit), - sTrisItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, + 2, + sTrisElementsInit, }; const ActorInit Bg_Hidan_Hamstep_InitVars = { ACTOR_BG_HIDAN_HAMSTEP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanHamstep), @@ -88,20 +109,20 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx) GlobalContext* globalCtx2 = globalCtx; pos = pos; // Required to match - pos.y = this->dyna.actor.initPosRot.pos.y - 100.0f; + pos.y = this->dyna.actor.home.pos.y - 100.0f; sin = Math_SinS(this->dyna.actor.shape.rot.y + 0x8000); cos = Math_CosS(this->dyna.actor.shape.rot.y + 0x8000); for (i = 0; i < 5; i++) { - pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.initPosRot.pos.x; - pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.initPosRot.pos.z; + pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.home.pos.x; + pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = ((i + 1) & 0xFF); params |= (this->dyna.actor.params & 0xFF00); step = (BgHidanHamstep*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, step, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, - this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, params); + &globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, + this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, params); if (step == NULL) { return 0; @@ -119,7 +140,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i2; BgHidanHamstep* step; - DynaPolyActor_Init(&this->dyna.actor, DPM_PLAYER); + DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if ((this->dyna.actor.params & 0xFF) == 0) { @@ -128,11 +149,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < 2; i++) { for (i2 = 0; i2 < 3; i2++) { - sp48[i2].x = sTrisInit.list[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x; - sp48[i2].y = sTrisInit.list[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y; - sp48[i2].z = sTrisInit.list[i].dim.vtx[i2].z + this->dyna.actor.initPosRot.pos.z; + sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.home.pos.x; + sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.home.pos.y; + sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.home.pos.z; } - func_800627A0(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]); + Collider_SetTrisVertices(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]); } } @@ -146,11 +167,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF)) { if ((this->dyna.actor.params & 0xFF) == 0) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + (-20.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } } else if ((this->dyna.actor.params & 0xFF) == 0) { @@ -174,7 +195,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { while (step != NULL) { Actor_Kill(&step->dyna.actor); - step = step->dyna.actor.child; + step = (BgHidanHamstep*)step->dyna.actor.child; } } } @@ -191,7 +212,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) { - Vec3f pos = step->dyna.actor.posRot.pos; + Vec3f pos = step->dyna.actor.world.pos; s32 i; f32 sin; f32 cos; @@ -203,23 +224,23 @@ void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) { sin = Math_SinS(step->dyna.actor.shape.rot.y + 0x8000); cos = Math_CosS(step->dyna.actor.shape.rot.y + 0x8000); - pos.y = step->dyna.actor.posRot.pos.y; + pos.y = step->dyna.actor.world.pos.y; for (i = 0; i < ARRAY_COUNT(sEffectPositions); i++) { - pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.posRot.pos.x; - pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.posRot.pos.z; + pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.world.pos.x; + pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 0.0f, 0, 150, 150, 0); } } void func_80888638(BgHidanHamstep* this, GlobalContext* globalCtx) { - BgHidanHamstep* child = this->dyna.actor.child; + BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { if ((child->dyna.actor.params & 0xFF) != 0) { func_808884C8(child, globalCtx); } - child = child->dyna.actor.child; + child = (BgHidanHamstep*)child->dyna.actor.child; } } @@ -227,34 +248,34 @@ void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; if ((this->dyna.actor.params & 0xFF) >= 2) { - if (parent->dyna.actor.posRot.pos.y < this->dyna.actor.posRot.pos.y) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y; - } else if ((this->dyna.actor.posRot.pos.y - parent->dyna.actor.posRot.pos.y) < -100.0f) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f; + if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; + } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } } - child = this->dyna.actor.child; + child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if (this->dyna.actor.posRot.pos.y < child->dyna.actor.posRot.pos.y) { - child->dyna.actor.posRot.pos.y = this->dyna.actor.posRot.pos.y; + if (this->dyna.actor.world.pos.y < child->dyna.actor.world.pos.y) { + child->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y; } - child = child->dyna.actor.child; + child = (BgHidanHamstep*)child->dyna.actor.child; } } void func_80888734(BgHidanHamstep* this) { - BgHidanHamstep* parent = this->dyna.actor.parent; + BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent; f32 factor = SREG(30) * 0.5f; if (parent != NULL) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; if ((this->dyna.actor.params & 0xFF) == 1) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f; + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { - this->dyna.actor.posRot.pos.y += (this->dyna.actor.velocity.y * factor); + this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * factor); } func_80888694(this, parent); @@ -262,14 +283,14 @@ void func_80888734(BgHidanHamstep* this) { } void func_808887C4(BgHidanHamstep* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_800800F8(globalCtx, 3310, 100, &this->dyna.actor, 0); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); - this->collider.base.acFlags = 0; + this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -280,13 +301,12 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) < - (-20.0f - this->dyna.actor.minVelocityY)) && + if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < (-20.0f - this->dyna.actor.minVelocityY)) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -20.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -20.0f; BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -299,8 +319,8 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0); Quake_SetCountdown(quakeIndex, 20); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 255, 20, 150); - func_80888638(&this->dyna.actor, globalCtx); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150); + func_80888638(this, globalCtx); osSyncPrintf("A(%d)\n", this->dyna.actor.params); } } @@ -309,14 +329,14 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { void func_808889B8(BgHidanHamstep* this, GlobalContext* globalCtx) { s32 pad; - BgHidanHamstep* parent = this->dyna.actor.parent; + BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent; func_80888734(this); if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { if ((this->dyna.actor.params & 0xFF) == 1) { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -338,14 +358,14 @@ void func_80888A58(BgHidanHamstep* this, GlobalContext* globalCtx) { osSyncPrintf("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } - if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) <= + if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h index e64a91bf93..2ecd7ee2c6 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h @@ -11,7 +11,7 @@ typedef void (*BgHidanHamstepActionFunc)(struct BgHidanHamstep*, GlobalContext*) typedef struct BgHidanHamstep { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem colliderItems[2]; + /* 0x0184 */ ColliderTrisElement colliderItems[2]; /* 0x023C */ BgHidanHamstepActionFunc actionFunc; /* 0x0240 */ s32 action; /* 0x0244 */ s32 unk_244; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 196152636c..ff9ddc313d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_0600D054; /* const ActorInit Bg_Hidan_Hrock_InitVars = { ACTOR_BG_HIDAN_HROCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanHrock), @@ -29,6 +29,44 @@ const ActorInit Bg_Hidan_Hrock_InitVars = { (ActorFunc)BgHidanHrock_Update, (ActorFunc)BgHidanHrock_Draw, }; + +static ColliderTrisElementInit D_80889820[2] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { { { -40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, 40.0f } } }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { { { 40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, -40.0f } } }, + }, +}; + +static ColliderTrisInit D_80889898 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, + 2, + D_80889820, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index f950bdf0d3..5ae6fd14dc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -26,7 +26,7 @@ static f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f }; const ActorInit Bg_Hidan_Kousi_InitVars = { ACTOR_BG_HIDAN_KOUSI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanKousi), @@ -71,7 +71,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, ((s32)thisx->params >> 8) & 0xFF); @@ -82,7 +82,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(D_80889E70[thisx->params & 0xFF], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - thisx->posRot.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; + thisx->world.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); @@ -98,13 +98,13 @@ void BgHidanKousi_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; - Vec3s* rot = &this->dyna.actor.posRot.rot; + Vec3s* rot = &this->dyna.actor.world.rot; f32 temp1 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_SinS(rot->y); f32 temp2 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_CosS(rot->y); - Vec3f* initPos = &this->dyna.actor.initPosRot.pos; + Vec3f* initPos = &this->dyna.actor.home.pos; - this->dyna.actor.posRot.pos.x = initPos->x + temp1; - this->dyna.actor.posRot.pos.z = initPos->z + temp2; + this->dyna.actor.world.pos.x = initPos->x + temp1; + this->dyna.actor.world.pos.z = initPos->z + temp2; } void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) { @@ -117,7 +117,7 @@ void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) { void func_80889BC0(BgHidanKousi* this, GlobalContext* globalCtx) { this->unk_168 -= 1; - if (this->dyna.actor.type == func_8005B198() || (this->unk_168 <= 0)) { + if (this->dyna.actor.category == func_8005B198() || (this->unk_168 <= 0)) { BgHidanKousi_SetupAction(this, func_80889C18); } } @@ -135,7 +135,7 @@ void func_80889C18(BgHidanKousi* this, GlobalContext* globalCtx) { void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx) { func_8002D7EC(&this->dyna.actor); if (D_80889E40[this->dyna.actor.params & 0xFF] < - Math_Vec3f_DistXYZ(&this->dyna.actor.initPosRot.pos, &this->dyna.actor.posRot.pos)) { + Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 3910fbfb97..0c3047112f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -26,7 +26,7 @@ extern Gfx D_05000530[]; const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { ACTOR_BG_HIDAN_KOWARERUKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanKowarerukabe), @@ -38,15 +38,31 @@ const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { static Gfx* sBreakableWallDLists[] = { 0x0600B9C0, 0x0600C038, 0x0600B900 }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, - { 0, { { 0, 0, 0 }, 100 }, 100 }, -} }; +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 100 }, 100 }, + }, +}; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemsInit), - sJntSphItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementsInit, }; void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { @@ -72,15 +88,14 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, GlobalCon Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.list[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; - this->collider.list[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.posRot.pos.y = - actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -128,14 +143,14 @@ void BgHidanKowarerukabe_SpawnDust(BgHidanKowarerukabe* this, GlobalContext* glo s32 pad; Vec3f pos; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 10.0f; func_80033480(globalCtx, &pos, 0.0f, 0, 600, 300, 1); - pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.posRot.pos.y; - pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.world.pos.y; + pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 100.0f, 4, 200, 250, 1); } @@ -153,15 +168,15 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl f32 tmp2; s16 arg9; - pos.y = thisx->posRot.pos.y + 10.0f; + pos.y = thisx->world.pos.y + 10.0f; for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tmp1 = 24 * (i - 2); tmp2 = 24 * (j - 2); - pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->world.pos.x; + pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->world.pos.z; tmp1 = 8.0f * Rand_ZeroOne() * (i - 2); tmp2 = 8.0f * Rand_ZeroOne() * (j - 2); @@ -174,8 +189,8 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl arg5 = (((i == 0) || (i == 4)) && ((j == 0) || (j == 4))) ? 65 : 64; - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, - 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, 100, + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } } @@ -194,12 +209,12 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { s16 arg9; for (i = 0; i < 5; i++) { - pos.y = (20 * i) + thisx->posRot.pos.y; + pos.y = (20 * i) + thisx->world.pos.y; for (j = 0; j < 5; j++) { tmp1 = 16 * (j - 2); - pos.x = (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = -(tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp1 * cos) + thisx->world.pos.x; + pos.z = -(tmp1 * sin) + thisx->world.pos.z; tmp1 = 3.0f * Rand_ZeroOne() * (j - 2); tmp2 = 6.0f * Rand_ZeroOne(); @@ -215,8 +230,8 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { arg5 |= 1; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, - 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, 100, + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } } @@ -235,12 +250,12 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext s16 arg9; for (i = 0; i < 5; i++) { - pos.y = (24 * i) + thisx->posRot.pos.y; + pos.y = (24 * i) + thisx->world.pos.y; for (j = 0; j < 5; j++) { tmp1 = 28 * (j - 2); - pos.x = (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = -(tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp1 * cos) + thisx->world.pos.x; + pos.z = -(tmp1 * sin) + thisx->world.pos.z; tmp1 = 6.0f * Rand_ZeroOne() * (j - 2); tmp2 = 6.0f * Rand_ZeroOne(); @@ -256,7 +271,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext arg5 |= 1; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot, -650, arg5, 20, 20, 0, arg9, 2, 32, 100, + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world, -650, arg5, 20, 20, 0, arg9, 2, 32, 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } @@ -287,9 +302,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); if ((this->dyna.actor.params & 0xFF) == 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } func_80078884(NA_SE_SY_CORRECT_CHIME); @@ -311,7 +326,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[this->dyna.actor.params & 0xFF]); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 573); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h index 692fa4366b..80996a4082 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h @@ -9,7 +9,7 @@ struct BgHidanKowarerukabe; typedef struct BgHidanKowarerukabe { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderItems[1]; } BgHidanKowarerukabe; // size = 0x01C4 extern const ActorInit Bg_Hidan_Kowarerukabe_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index aeb48a58df..3c7b9300e2 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600DF78; /* const ActorInit Bg_Hidan_Rock_InitVars = { ACTOR_BG_HIDAN_ROCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanRock), @@ -27,6 +27,26 @@ const ActorInit Bg_Hidan_Rock_InitVars = { (ActorFunc)BgHidanRock_Update, (ActorFunc)BgHidanRock_Draw, }; + +static ColliderCylinderInit D_8088BF8C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 45, 77, -40, { 3310, 120, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index 77f560850f..5aaf3b9bb8 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -11,7 +11,7 @@ void BgHidanRsekizou_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Rsekizou_InitVars = { ACTOR_BG_HIDAN_RSEKIZOU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanRsekizou), @@ -21,37 +21,86 @@ const ActorInit Bg_Hidan_Rsekizou_InitVars = { (ActorFunc)BgHidanRsekizou_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[6] = { +static ColliderJntSphElementInit sJntSphElementsInit[6] = { { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 0, 30, 40 }, 25 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { -35, 32, 77 }, 32 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { -80, 35, 130 }, 42 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 0, 30, -40 }, 25 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 35, 32, -77 }, 32 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 80, 35, -130 }, 42 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 6, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -81,7 +130,7 @@ void BgHidanRsekizou_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) { - this->collider.list[i].dim.worldSphere.radius = this->collider.list[i].dim.modelSphere.radius; + this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius; } this->burnFrame = 0; this->bendFrame = 0; @@ -97,7 +146,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) { BgHidanRsekizou* this = THIS; s32 i; - ColliderJntSphItem* sphere; + ColliderJntSphElement* sphere; s32 pad; f32 yawSine; f32 yawCosine; @@ -117,14 +166,12 @@ void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) { yawCosine = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) { - sphere = &this->collider.list[i]; - sphere->dim.worldSphere.center.x = this->dyna.actor.initPosRot.pos.x + - yawCosine * sphere->dim.modelSphere.center.x + + sphere = &this->collider.elements[i]; + sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x + yawSine * sphere->dim.modelSphere.center.z; - sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.initPosRot.pos.y + sphere->dim.modelSphere.center.y; - sphere->dim.worldSphere.center.z = - (this->dyna.actor.initPosRot.pos.z - yawSine * sphere->dim.modelSphere.center.x) + - yawCosine * sphere->dim.modelSphere.center.z; + sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y; + sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) + + yawCosine * sphere->dim.modelSphere.center.z; } CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -159,9 +206,9 @@ Gfx* BgHidanRsekizou_DrawFireball(GlobalContext* globalCtx, BgHidanRsekizou* thi mf->xx = mf->yy = mf->zz = (0.7f * fVar6) + 0.5f; tmpf7 = (((((0.7f * fVar6) + 0.5f) * 10.0f) * fVar6) + 20.0f); - mf->wx = (tmpf7 * sins) + this->dyna.actor.posRot.pos.x; - mf->wy = (this->dyna.actor.posRot.pos.y + 30.0f) + (0.699999988079f * fVar6); - mf->wz = (tmpf7 * coss) + this->dyna.actor.posRot.pos.z; + mf->wx = (tmpf7 * sins) + this->dyna.actor.world.pos.x; + mf->wy = (this->dyna.actor.world.pos.y + 30.0f) + (0.699999988079f * fVar6); + mf->wz = (tmpf7 * coss) + this->dyna.actor.world.pos.z; gSPMatrix(displayList++, Matrix_MtxFToMtx(Matrix_CheckFloats(mf, "../z_bg_hidan_rsekizou.c", 543), diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h index 5a4f80a575..465ffeb4aa 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h @@ -11,7 +11,7 @@ typedef struct BgHidanRsekizou { /* 0x0164 */ s16 bendFrame; /* 0x0166 */ s16 burnFrame; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems[6]; + /* 0x0188 */ ColliderJntSphElement colliderItems[6]; } BgHidanRsekizou; // size = 0x0308 extern const ActorInit Bg_Hidan_Rsekizou_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 2f49bb218d..94d5721663 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_0600DC30; /* const ActorInit Bg_Hidan_Sekizou_InitVars = { ACTOR_BG_HIDAN_SEKIZOU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSekizou), @@ -26,6 +26,88 @@ const ActorInit Bg_Hidan_Sekizou_InitVars = { (ActorFunc)BgHidanSekizou_Update, (ActorFunc)BgHidanSekizou_Draw, }; + +static ColliderJntSphElementInit D_8088E180[6] = { + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 30, 40 }, 23 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 32, 87 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 35, 150 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 30, 40 }, 23 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 32, 87 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 35, 150 }, 40 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8088E258 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 6, + D_8088E180, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/func_8088CEC0.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index f303aca374..1ac6679adc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_060120E8; /* const ActorInit Bg_Hidan_Sima_InitVars = { ACTOR_BG_HIDAN_SIMA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSima), @@ -27,6 +27,44 @@ const ActorInit Bg_Hidan_Sima_InitVars = { (ActorFunc)BgHidanSima_Update, (ActorFunc)BgHidanSima_Draw, }; + +static ColliderJntSphElementInit D_8088F1A0[2] = { + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 1, { { 0, 40, 100 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 1, { { 0, 40, 145 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8088F1E8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 2, + D_8088F1A0, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sima/BgHidanSima_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index 2980acdfd1..4c3ec40854 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -21,7 +21,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Syoku_InitVars = { ACTOR_BG_HIDAN_SYOKU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSyoku), @@ -48,7 +48,7 @@ void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_0600E568, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->actionFunc = func_8088F4B8; - this->dyna.actor.initPosRot.pos.y += 540.0f; + this->dyna.actor.home.pos.y += 540.0f; } void BgHidanSyoku_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -74,7 +74,7 @@ void func_8088F514(BgHidanSyoku* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.home.pos.y; if (this->unk_16A == 0) { func_8088F47C(this); } else { @@ -86,7 +86,7 @@ void func_8088F5A0(BgHidanSyoku* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f); if (this->unk_16A == 0) { func_8088F47C(this); } else { @@ -100,7 +100,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx) { } if (this->unk_16A == 0) { this->unk_16A = 0x8c; - if (this->dyna.actor.posRot.pos.y < this->dyna.actor.initPosRot.pos.y) { + if (this->dyna.actor.world.pos.y < this->dyna.actor.home.pos.y) { this->actionFunc = func_8088F514; } else { this->actionFunc = func_8088F5A0; diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index c0d0ba7468..81a806d747 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -29,7 +29,7 @@ static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; const ActorInit Bg_Ice_Objects_InitVars = { ACTOR_BG_ICE_OBJECTS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceObjects), @@ -51,7 +51,7 @@ void BgIceObjects_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_060003F0, &colHeader); - Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.initPosRot.pos); + Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.home.pos); this->actionFunc = BgIceObjects_Idle; this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.actor.params = 0; @@ -89,7 +89,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { s32 i; if ((this->dyna.unk_158 == 0) || (this->dyna.unk_158 == -0x8000)) { - x16 = this->dyna.actor.posRot.pos.x; + x16 = this->dyna.actor.world.pos.x; for (i = 0; i < 7; i++) { if (x16 == sXStarts[i]) { z16 = (this->dyna.unk_158 == 0) ? sZStops[i][0] : sZStops[i][1]; @@ -99,7 +99,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { } this->targetPos.z = (this->dyna.unk_158 == 0) ? -340 : -1260; } else { - z16 = this->dyna.actor.posRot.pos.z; + z16 = this->dyna.actor.world.pos.z; for (i = 0; i < 7; i++) { if (z16 == sZStarts[i]) { x16 = (this->dyna.unk_158 == 0x4000) ? sXStops[i][0] : sXStops[i][1]; @@ -117,17 +117,17 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { void BgIceObjects_CheckPits(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if ((thisx->velocity.y > 0.0f) || ((thisx->posRot.pos.x <= -1660.0f) && (thisx->posRot.pos.z <= -1060.0f)) || - ((thisx->posRot.pos.x <= -1580.0f) && (thisx->posRot.pos.z >= -420.0f)) || - ((thisx->posRot.pos.x >= -980.0f) && (thisx->posRot.pos.z <= -1180.0f)) || - ((thisx->posRot.pos.x >= -860.0f) && (thisx->posRot.pos.z >= -700.0f))) { + if ((thisx->velocity.y > 0.0f) || ((thisx->world.pos.x <= -1660.0f) && (thisx->world.pos.z <= -1060.0f)) || + ((thisx->world.pos.x <= -1580.0f) && (thisx->world.pos.z >= -420.0f)) || + ((thisx->world.pos.x >= -980.0f) && (thisx->world.pos.z <= -1180.0f)) || + ((thisx->world.pos.x >= -860.0f) && (thisx->world.pos.z >= -700.0f))) { thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, -300.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, -300.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 60.0f; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.y = thisx->home.pos.y - 60.0f; + thisx->world.pos.z = thisx->home.pos.z; if (thisx->params != 0) { func_8002DF54(globalCtx, thisx, 7); } @@ -144,7 +144,7 @@ void BgIceObjects_Idle(BgIceObjects* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; if ((this->dyna.unk_150 > 0.0f) && !Player_InCsMode(globalCtx)) { BgIceObjects_SetNextTarget(this, globalCtx); - if (func_8002DBB0(thisx, &this->targetPos) > 1.0f) { + if (Actor_WorldDistXZToPoint(thisx, &this->targetPos) > 1.0f) { thisx->flags |= 0x10; func_8002DF54(globalCtx, thisx, 8); thisx->params = 1; @@ -166,39 +166,35 @@ void BgIceObjects_Slide(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); - atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ); - atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ); + atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); + atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); if (atTarget) { thisx->speedXZ = 0.0f; - this->targetPos.x = thisx->posRot.pos.x; - this->targetPos.z = thisx->posRot.pos.z; + this->targetPos.x = thisx->world.pos.x; + this->targetPos.z = thisx->world.pos.z; if (thisx->velocity.y <= 0.0f) { thisx->flags &= ~0x10; } thisx->params = 0; func_8002DF54(globalCtx, thisx, 7); Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); - if ((fabsf(thisx->posRot.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->posRot.pos.z + 260.0f) < 1.0f)) { + if ((fabsf(thisx->world.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->world.pos.z + 260.0f) < 1.0f)) { this->actionFunc = BgIceObjects_Stuck; } else { this->actionFunc = BgIceObjects_Idle; } - } else if ((thisx->speedXZ > 6.0f) && (thisx->posRot.pos.y >= 0.0f)) { + } else if ((thisx->speedXZ > 6.0f) && (thisx->world.pos.y >= 0.0f)) { spread = Rand_CenteredFloat(120.0f); velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.y = Rand_ZeroOne() + 1.0f; velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); - pos.y = thisx->posRot.pos.y; + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); + pos.y = thisx->world.pos.y; func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); spread = Rand_CenteredFloat(120.0f); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } @@ -213,9 +209,9 @@ void BgIceObjects_Reset(BgIceObjects* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { thisx->flags &= ~0x10; - Math_Vec3f_Copy(&this->targetPos, &thisx->initPosRot.pos); + Math_Vec3f_Copy(&this->targetPos, &thisx->home.pos); this->actionFunc = BgIceObjects_Idle; thisx->speedXZ = 0.0f; } diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index e132947ccb..f86a2d5bb4 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06002920; /* const ActorInit Bg_Ice_Shelter_InitVars = { ACTOR_BG_ICE_SHELTER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceShelter), @@ -27,6 +27,46 @@ const ActorInit Bg_Ice_Shelter_InitVars = { (ActorFunc)BgIceShelter_Update, (ActorFunc)BgIceShelter_Draw, }; + +static ColliderCylinderInit D_8089170C = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80891738 = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s") diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 62c68cd22b..a0cd13ea89 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -21,7 +21,7 @@ void func_80891DD4(BgIceShutter* thisx, GlobalContext* globalCtx); const ActorInit Bg_Ice_Shutter_InitVars = { ACTOR_BG_ICE_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceShutter), @@ -42,12 +42,10 @@ void func_80891AC0(BgIceShutter* this) { f32 sp24; sp24 = Math_SinS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y; - this->dyna.actor.posRot.pos.y = - (Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.initPosRot.pos.y; - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.y = + (Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.z; } void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -85,13 +83,13 @@ void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (sp28 == 2) { temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f; - this->dyna.actor.posRot2.pos.x = - (Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot2.pos.y = this->dyna.actor.initPosRot.pos.y; - this->dyna.actor.posRot2.pos.z = - this->dyna.actor.initPosRot.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6); + this->dyna.actor.focus.pos.x = + (Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x; + this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y; + this->dyna.actor.focus.pos.z = + this->dyna.actor.home.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6); } else { - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); } } @@ -103,7 +101,7 @@ void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetTempClear(globalCtx, this->dyna.actor.room)) { Flags_SetClear(globalCtx, this->dyna.actor.room); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; if (this->dyna.actor.shape.rot.x == 0) { func_80080480(globalCtx, &this->dyna.actor); @@ -113,7 +111,7 @@ void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { void func_80891D6C(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; func_80080480(globalCtx, &this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index e286c7366d..609c55aeb5 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -22,8 +22,22 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx); void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x4FC007CA, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x4FC007CA, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 13, 120, 0, { 0, 0, 0 } }, }; @@ -32,7 +46,7 @@ extern CollisionHeader D_06002594; const ActorInit Bg_Ice_Turara_InitVars = { ACTOR_BG_ICE_TURARA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceTurara), @@ -59,13 +73,13 @@ void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06002594, &colHeader); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if (this->dyna.actor.params == TURARA_STALAGMITE) { this->actionFunc = BgIceTurara_Stalagmite; } else { this->dyna.actor.shape.rot.x = -0x8000; - this->dyna.actor.shape.unk_08 = 1200.0f; + this->dyna.actor.shape.yOffset = 1200.0f; this->actionFunc = BgIceTurara_Wait; } } @@ -86,12 +100,12 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) { s32 j; s32 i; - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ICE_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 2; i++) { for (j = 0; j < 10; j++) { - pos.x = this->dyna.actor.posRot.pos.x + Rand_CenteredFloat(8.0f); - pos.y = this->dyna.actor.posRot.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2); - pos.z = this->dyna.actor.posRot.pos.z + Rand_CenteredFloat(8.0f); + pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f); + pos.y = this->dyna.actor.world.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2); + pos.z = this->dyna.actor.world.pos.z + Rand_CenteredFloat(8.0f); vel.x = Rand_CenteredFloat(7.0f); vel.z = Rand_CenteredFloat(7.0f); @@ -104,7 +118,7 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) { } void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { BgIceTurara_Break(this, globalCtx, 50.0f); Actor_Kill(&this->dyna.actor); return; @@ -113,7 +127,7 @@ void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) { } void BgIceTurara_Wait(BgIceTurara* this, GlobalContext* globalCtx) { - if (this->dyna.actor.xzDistToLink < 60.0f) { + if (this->dyna.actor.xzDistToPlayer < 60.0f) { this->shiverTimer = 10; this->actionFunc = BgIceTurara_Shiver; } @@ -131,32 +145,32 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_SWING); } if (this->shiverTimer == 0) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = this->dyna.actor.initPosRot.pos.z; - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z; + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIceTurara_Fall; } else { sp28 = Rand_ZeroOne(); phi_v0_2 = (Rand_ZeroOne() < 0.5f ? -1 : 1); - this->dyna.actor.posRot.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.x; + this->dyna.actor.world.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.x; sp28 = Rand_ZeroOne(); phi_v0_3 = (Rand_ZeroOne() < 0.5f ? -1 : 1); - this->dyna.actor.posRot.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.z; } } void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { - if ((this->collider.base.atFlags & 2) || (this->dyna.actor.bgCheckFlags & 1)) { - this->collider.base.atFlags &= ~2; + if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) { + this->collider.base.atFlags &= ~AT_HIT; this->dyna.actor.bgCheckFlags &= ~1; - if (this->dyna.actor.posRot.pos.y < this->dyna.actor.groundY) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if (this->dyna.actor.world.pos.y < this->dyna.actor.floorHeight) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } BgIceTurara_Break(this, globalCtx, 40.0f); if (this->dyna.actor.params == TURARA_STALACTITE_REGROW) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 120.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f; func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIceTurara_Regrow; } else { @@ -165,16 +179,16 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { } } else { Actor_MoveForward(&this->dyna.actor); - this->dyna.actor.posRot.pos.y += 40.0f; - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); - this->dyna.actor.posRot.pos.y -= 40.0f; - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + this->dyna.actor.world.pos.y += 40.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); + this->dyna.actor.world.pos.y -= 40.0f; + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f)) { this->actionFunc = BgIceTurara_Wait; this->dyna.actor.velocity.y = 0.0f; } diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 369dc2b3ee..b0028723fb 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -20,7 +20,7 @@ void BgIngate_DoNothing(BgIngate* this, GlobalContext* globalCtx); const ActorInit Bg_Ingate_InitVars = { ACTOR_BG_INGATE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_INGATE, sizeof(BgIngate), @@ -79,7 +79,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 2) == 0) { phi0 = -0x4000; } - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi0; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0; BgIngate_SetupAction(this, &BgIngate_DoNothing); } else if (globalCtx->csCtx.frames >= 10) { csFrames = globalCtx->csCtx.frames - 10; @@ -93,7 +93,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 2) == 0) { phi1 = -phi1; } - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi1; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1; } } diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index e588b79a36..4c0ef12c01 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -28,7 +28,7 @@ static u8 sIsSpawned = false; const ActorInit Bg_Jya_1flift_InitVars = { ACTOR_BG_JYA_1FLIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJya1flift), @@ -39,8 +39,22 @@ const ActorInit Bg_Jya_1flift_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 70, 80, -82, { 0, 0, 0 } }, }; @@ -77,7 +91,7 @@ void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -114,7 +128,7 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80892DB0(BgJya1flift* this) { this->actionFunc = func_80892DCC; - this->dyna.actor.posRot.pos.y = sFinalPositions[0]; + this->dyna.actor.world.pos.y = sFinalPositions[0]; } void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) { @@ -125,7 +139,7 @@ void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) { void func_80892E0C(BgJya1flift* this) { this->actionFunc = BgJya1flift_DoNothing; - this->dyna.actor.posRot.pos.y = sFinalPositions[0]; + this->dyna.actor.world.pos.y = sFinalPositions[0]; } void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx) { @@ -146,9 +160,9 @@ void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx) { } else { tempVelocity = this->dyna.actor.velocity.y; } - if (fabsf(Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f, + if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f, tempVelocity, 1.0f)) < 0.001f) { - this->dyna.actor.posRot.pos.y = sFinalPositions[this->isMovingDown]; + this->dyna.actor.world.pos.y = sFinalPositions[this->isMovingDown]; BgJya1flift_ResetMoveDelay(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { @@ -186,8 +200,8 @@ void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->isLinkRiding = tempIsRiding; - Collider_CylinderUpdate(thisx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } else { Actor_Kill(thisx); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 046ff31eb5..9be1b04676 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -26,7 +26,7 @@ void func_8089350C(BgJyaAmishutter* this); const ActorInit Bg_Jya_Amishutter_InitVars = { ACTOR_BG_JYA_AMISHUTTER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaAmishutter), @@ -79,8 +79,8 @@ void func_808933BC(BgJyaAmishutter* this) { } void func_808933CC(BgJyaAmishutter* this) { - if (this->actor.xzDistToLink < 60.0f) { - if (fabsf(this->actor.yDistToLink) < 30.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { + if (fabsf(this->actor.yDistToPlayer) < 30.0f) { func_80893428(this); } } @@ -91,7 +91,7 @@ void func_80893428(BgJyaAmishutter* this) { } void func_80893438(BgJyaAmishutter* this) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 100.0f, 3.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 100.0f, 3.0f)) { func_808934B0(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); } else { @@ -104,7 +104,7 @@ void func_808934B0(BgJyaAmishutter* this) { } void func_808934C0(BgJyaAmishutter* this) { - if (this->actor.xzDistToLink > 300.0f) { + if (this->actor.xzDistToPlayer > 300.0f) { func_808934FC(this); } } @@ -114,7 +114,7 @@ void func_808934FC(BgJyaAmishutter* this) { } void func_8089350C(BgJyaAmishutter* this) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 3.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 3.0f)) { func_808933BC(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index e8114c167a..6adb5d541c 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -10,13 +10,6 @@ #define THIS ((BgJyaBigmirror*)thisx) -#define BIGMIR_PUZZLE_COBRA1_SOLVED 1 << 0 -#define BIGMIR_PUZZLE_COBRA2_SOLVED 1 << 1 -#define BIGMIR_PUZZLE_BOMBIWA_DESTROYED 1 << 2 -#define BIGMIR_PUZZLE_IN_STATUE_ROOM 1 << 3 -#define BIGMIR_PUZZLE_IN_1ST_TOP_ROOM 1 << 4 -#define BIGMIR_PUZZLE_IN_2ND_TOP_ROOM 1 << 5 - void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx); @@ -26,7 +19,7 @@ static u8 sIsSpawned = false; const ActorInit Bg_Jya_Bigmirror_InitVars = { ACTOR_BG_JYA_BIGMIRROR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBigmirror), @@ -81,7 +74,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) { curCobraInfo = &this->cobraInfo[i]; if (curCobraInfo->cobra != NULL) { - curCobraInfo->rotY = curCobraInfo->cobra->actor.shape.rot.y; + curCobraInfo->rotY = curCobraInfo->cobra->dyna.actor.shape.rot.y; if (curCobraInfo->rotY == curSpawnData->solvedRotY) { this->puzzleFlags |= cobraPuzzleFlags[i]; @@ -89,7 +82,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) { this->puzzleFlags &= ~cobraPuzzleFlags[i]; } - if (curCobraInfo->cobra->actor.update == NULL) { + if (curCobraInfo->cobra->dyna.actor.update == NULL) { // Cobra deleted osSyncPrintf("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203); } @@ -99,7 +92,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) { curSpawnData->pos.y, curSpawnData->pos.z, 0, curCobraInfo->rotY, 0, curSpawnData->params); this->actor.child = NULL; - if (&curCobraInfo->cobra->actor == NULL) { + if (&curCobraInfo->cobra->dyna.actor == NULL) { // Cobra generation failed osSyncPrintf("Error : コブラ発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 221); } @@ -110,11 +103,11 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < 2; i++) { curCobraInfo = &this->cobraInfo[i]; if (curCobraInfo->cobra != NULL) { - if (curCobraInfo->cobra->actor.child != NULL) { - Actor_Kill(curCobraInfo->cobra->actor.child); - curCobraInfo->cobra->actor.child = NULL; + if (curCobraInfo->cobra->dyna.actor.child != NULL) { + Actor_Kill(curCobraInfo->cobra->dyna.actor.child); + curCobraInfo->cobra->dyna.actor.child = NULL; } - Actor_Kill(&curCobraInfo->cobra->actor); + Actor_Kill(&curCobraInfo->cobra->dyna.actor); curCobraInfo->cobra = NULL; } } @@ -229,11 +222,11 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 435); func_80093D84(globalCtx->state.gfxCtx); - lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORTYPE_BG); + lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORCAT_BG); if (lift != NULL) { - this->liftHeight = lift->posRot.pos.y; + this->liftHeight = lift->world.pos.y; } - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, &this->actor.shape.rot); // Second float seems to be either this or 1613/1280 + 0.13: both numerators relate to the lift height Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (973.0f / 1280.0f + 0.63f) /* 1.3901563f */, 0.1f, @@ -244,7 +237,7 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) { if (lift != NULL) { if (1) {} - func_800D1694(lift->posRot.pos.x, lift->posRot.pos.y, lift->posRot.pos.z, &D_80893F4C); + func_800D1694(lift->world.pos.x, lift->world.pos.y, lift->world.pos.z, &D_80893F4C); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index be19136b78..4b5d9f9379 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -5,6 +5,13 @@ #include "global.h" #include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h" +#define BIGMIR_PUZZLE_COBRA1_SOLVED (1 << 0) +#define BIGMIR_PUZZLE_COBRA2_SOLVED (1 << 1) +#define BIGMIR_PUZZLE_BOMBIWA_DESTROYED (1 << 2) +#define BIGMIR_PUZZLE_IN_STATUE_ROOM (1 << 3) +#define BIGMIR_PUZZLE_IN_1ST_TOP_ROOM (1 << 4) +#define BIGMIR_PUZZLE_IN_2ND_TOP_ROOM (1 << 5) + struct BgJyaBigmirror; typedef struct { diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 329c855db7..19be0e33ab 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -17,7 +17,7 @@ void BgJyaBlock_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Jya_Block_InitVars = { ACTOR_BG_JYA_BLOCK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(BgJyaBlock), diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index e6fb1b04db..e22f42b739 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -18,7 +18,7 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC const ActorInit Bg_Jya_Bombchuiwa_InitVars = { ACTOR_BG_JYA_BOMBCHUIWA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBombchuiwa), @@ -28,21 +28,35 @@ const ActorInit Bg_Jya_Bombchuiwa_InitVars = { (ActorFunc)BgJyaBombchuiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { -300, 0, 0 }, 40 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x21, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), @@ -77,7 +91,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, GlobalContext* globalCtx) { } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, globalCtx); } - Actor_SetHeight(thisx, 0.0f); + Actor_SetFocus(thisx, 0.0f); } void BgJyaBombchuiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) { @@ -97,9 +111,9 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 20; i++) { - pos.x = Rand_ZeroOne() * 10.0f + this->actor.posRot.pos.x - 10.0f; - pos.y = Rand_ZeroOne() * 40.0f + this->actor.posRot.pos.y - 20.0f; - pos.z = Rand_ZeroOne() * 50.0f + this->actor.posRot.pos.z - 25.0f; + pos.x = Rand_ZeroOne() * 10.0f + this->actor.world.pos.x - 10.0f; + pos.y = Rand_ZeroOne() * 40.0f + this->actor.world.pos.y - 20.0f; + pos.z = Rand_ZeroOne() * 50.0f + this->actor.world.pos.z - 25.0f; velocity.x = Rand_ZeroOne() * 3.0f - 0.3f; velocity.y = Rand_ZeroOne() * 18.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 15.0f; @@ -125,7 +139,7 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -300, arg5, arg6, arg7, 0, scale, 1, 15, 80, KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0); } - func_80033480(globalCtx, &this->actor.posRot.pos, 100.0f, 8, 100, 160, 0); + func_80033480(globalCtx, &this->actor.world.pos, 100.0f, 8, 100, 160, 0); } void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { @@ -135,7 +149,7 @@ void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* } void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) || (this->timer > 0)) { + if ((this->collider.base.acFlags & AC_HIT) || (this->timer > 0)) { if (this->timer == 0) { func_800800F8(globalCtx, 3410, -99, &this->actor, 0); } @@ -143,11 +157,11 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* glob if (this->timer > 10) { BgJyaBombchuiwa_Break(this, globalCtx); BgJyaBombchuiwa_CleanUpAfterExplosion(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -162,7 +176,7 @@ void BgJyaBombchuiwa_CleanUpAfterExplosion(BgJyaBombchuiwa* this, GlobalContext* void func_808949B8(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { this->timer++; if (this->timer & 4) { - func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 3, 100, 100, 0); + func_80033480(globalCtx, &this->actor.world.pos, 60.0f, 3, 100, 100, 0); } if (Math_StepToF(&this->lightRayIntensity, 1.0f, 0.028)) { BgJyaBombchuiwa_SpawnLightRay(this, globalCtx); @@ -173,8 +187,8 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC this->actionFunc = NULL; this->lightRayIntensity = 153.0f; BgJyaBombchuiwa_SetDrawFlags(this, 4); - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0) == NULL) { + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0) == NULL) { // Occurrence failure osSyncPrintf("Error : Mir_Ray 発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombchuiwa.c", 410, this->actor.params); @@ -220,7 +234,7 @@ void BgJyaBombchuiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->drawFlags & 1) { Gfx_DrawDListOpa(globalCtx, &D_0600E8D0); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if (this->drawFlags & 2) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h index d9e9a2353a..3b03360be0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h @@ -12,7 +12,7 @@ typedef struct BgJyaBombchuiwa { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaBombchuiwaActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems; + /* 0x0170 */ ColliderJntSphElement colliderItems; /* 0x01B0 */ f32 lightRayIntensity; /* 0x01B4 */ s16 timer; /* 0x01B6 */ u8 drawFlags; // Used to determine how the actor is drawn. diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index c3d6266c3d..a05957023a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -13,7 +13,7 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Jya_Bombiwa_InitVars = { ACTOR_BG_JYA_BOMBIWA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBombiwa), @@ -23,16 +23,30 @@ const ActorInit Bg_Jya_Bombiwa_InitVars = { (ActorFunc)BgJyaBombiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 50 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + &sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -106,9 +120,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) { s16 scale; for (i = 0; i < 16; i++) { - pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.x) - 40.0f; - pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.posRot.pos.y; - pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.z) - 40.0f; + pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.x) - 40.0f; + pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.world.pos.y; + pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.z) - 40.0f; velocity.x = (Rand_ZeroOne() - 0.5f) * 10.0f; velocity.y = Rand_ZeroOne() * 12.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 10.0f; @@ -134,22 +148,22 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, arg6, arg7, 0, scale, 1, 20, 80, KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0); } - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 70.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 70.0f; + pos.z = this->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 100.0f, 0xA, 0x64, 0xA0, 1); } void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { BgJyaBombiwa* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -157,5 +171,5 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaBombiwa* this = THIS; Gfx_DrawDListOpa(globalCtx, D_0600E490); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h index 965c3a2ccd..c42747f557 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h @@ -11,7 +11,7 @@ typedef struct BgJyaBombiwa { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ s32 unk_164; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems; + /* 0x0188 */ ColliderJntSphElement colliderItems; } BgJyaBombiwa; // size = 0x01C8 extern const ActorInit Bg_Jya_Bombiwa_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index f2351276aa..d7e949f023 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -1,4 +1,7 @@ #include "z_bg_jya_cobra.h" +#include "overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h" +#include "overlays/actors/ovl_Mir_Ray/z_mir_ray.h" +#include "vt.h" #define FLAGS 0x00000010 @@ -9,15 +12,38 @@ void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx); void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_06010790; -extern UNK_TYPE D_06010C20; -extern UNK_TYPE D_0601167C; -extern UNK_TYPE D_060117D0; +void func_80896918(BgJyaCobra* this, GlobalContext* globalCtx); +void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx); +void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx); +void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx); + +extern Gfx D_06010790[]; +extern Gfx D_06010C20[]; +extern UNK_TYPE D_0601167C; +extern Gfx D_060117D0[]; + +Vtx D_80897270[] = { + VTX(-800, 0, -800, 0, 2048, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(800, 0, -800, 2048, 2048, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(800, 0, 800, 2048, 0, 0xFF, 0xFF, 0xFF, 0xFF), + VTX(-800, 0, 800, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF), +}; + +Gfx D_808972B0[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), + gsDPSetRenderMode(AA_EN | Z_CMP | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_DEC | FORCE_BL | + GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1), + G_RM_AA_ZB_XLU_DECAL2), + gsSPClearGeometryMode(G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), + gsSPVertex(D_80897270, 4, 0), + gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), + gsSPEndDisplayList(), +}; -/* const ActorInit Bg_Jya_Cobra_InitVars = { ACTOR_BG_JYA_COBRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaCobra), @@ -26,41 +52,637 @@ const ActorInit Bg_Jya_Cobra_InitVars = { (ActorFunc)BgJyaCobra_Update, (ActorFunc)BgJyaCobra_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808958F0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_8089593C.s") +s16 D_80897308[] = { 0, 0, 0, 0 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808959C4.s") +u8 D_80897310[] = { 1, 0, 1, 0 }; +s16 D_80897314[] = { -0x4000, 0000, 0x4000, 0000 }; + +u8 D_8089731C[11][11] = { + { 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 }, + { 0x00, 0x20, 0x80, 0xA0, 0xA3, 0xA3, 0xA3, 0xA0, 0x80, 0x20, 0x00 }, + { 0x20, 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80, 0x20 }, + { 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80 }, + { 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 }, + { 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 }, + { 0x80, 0xA3, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA3, 0x80 }, + { 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80 }, + { 0x20, 0x80, 0xA0, 0xA5, 0xA6, 0xA6, 0xA6, 0xA5, 0xA0, 0x80, 0x20 }, + { 0x00, 0x20, 0x80, 0xA0, 0xA3, 0xA3, 0xA3, 0xA0, 0x80, 0x20, 0x00 }, + { 0x00, 0x00, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x00, 0x00 }, +}; + +u8 D_80897398[3][3] = { + { 0x20, 0x80, 0x20 }, + { 0x80, 0xA0, 0x80 }, + { 0x20, 0x80, 0x20 }, +}; + +Vec3f D_808973A4[] = { + { -6.0f, 100.0f, 7.6f }, + { -12.6f, 69.200005f, -10.0f }, + { -9.0f, 43.0f, -1.0f }, + { -3.0f, 15.0f, 8.6f }, + { -8.6f, 15.0f, 13.5f }, + { -6.6f, 26.0f, 11.6f }, + { -12.5f, 43.0f, 8.0f }, + { -17.2f, 70.0f, 0.6f }, + { -8.0f, 100.0f, 7.6f }, + { 6.0f, 100.0f, 7.6f }, + { 12.6f, 69.200005f, -10.0f }, + { 9.0f, 43.0f, -1.0f }, + { 3.0f, 15.0f, 8.6f }, + { 8.6f, 15.0f, 13.5f }, + { 6.6f, 26.0f, 11.6f }, + { 12.5f, 43.0f, 8.0f }, + { 17.2f, 70.0f, 0.6f }, + { 8.0f, 100.0f, 7.6f }, + { 0.0f, 70.0f, -11.3f }, + { 0.0f, 44.6000023f, -2.0f }, + { 0.0f, 15.0f, 10.6f }, + { 0.0f, 15.0f, 0.3f }, + { 0.0f, 26.0f, 11.6f }, + { 0.0f, 88.4f, -1.4f }, + { 0.0f, 95.700005f, 14.900001f }, + { 0.0f, 101.4f, 5.0f }, +}; + +Vec3f D_808974DC[] = { + { 12.0f, 21.3000011f, -2.5f }, { 30.0f, 21.3000011f, -2.5f }, { -15.0f, 21.3000011f, -2.5f }, + { -30.0f, 21.3000011f, -2.5f }, { 12.0f, 21.3000011f, -2.5f }, +}; + +s32 D_80897518[] = { 0x80, 0xA0, 0xA0, 0x80 }; + +InitChainEntry D_80897528[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), +}; + +Vec3s D_80897538 = { 0, -0x4000, 0 }; + +Vec3s D_80897540 = { 0, 0x4000, 0 }; + +Vec3f D_80897548[] = { + { 0.1f, 0.1f, 0.1f }, + { 0.072f, 0.072f, 0.072f }, + { 0.1f, 0.1f, 0.132f }, +}; + +void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) { + dest->x = (src->z * arg2) + (src->x * arg3); + dest->y = src->y; + dest->z = (src->z * arg3) - (src->x * arg2); +} + +void BgJyaCobra_InitDynapoly(BgJyaCobra* this, GlobalContext* globalCtx, void* arg2, DynaPolyMoveFlag flags) { + s32 pad; + CollisionHeader* colHeader = NULL; + s32 pad2; + + DynaPolyActor_Init(&this->dyna, flags); + CollisionHeader_GetVirtual(arg2, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); + if (this->dyna.bgId == BG_ACTOR_MAX) { + // Warning : move BG Registration Failure + osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_cobra.c", 247, + this->dyna.actor.id, this->dyna.actor.params); + } +} + +void BgJyaCobra_SpawnRay(BgJyaCobra* this, GlobalContext* globalCtx) { + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6); + if (this->dyna.actor.child == NULL) { + osSyncPrintf(VT_FGCOL(RED)); + // Error : Mir Ray occurrence failure + osSyncPrintf("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270); + osSyncPrintf(VT_RST); + } +} + +#ifdef NON_MATCHING +// minor register and stack diffs +void func_80895A70(BgJyaCobra* this) { + s32 pad; + BgJyaBigmirror* temp_v1; + MirRay* phi_v0; + Vec3f sp28; + MirRay* temp; + + temp_v1 = (BgJyaBigmirror*)this->dyna.actor.parent; + + switch (this->dyna.actor.params & 3) { + case 0: + temp = (MirRay*)this->dyna.actor.child; + if (this->dyna.actor.child != NULL) { + phi_v0 = temp; + if (phi_v0->actor.update == NULL) { + this->dyna.actor.child = NULL; + return; + } + } else { + return; + } + break; + case 1: + phi_v0 = temp_v1->lightBeams[1]; + if (phi_v0 == NULL) { + return; + } + break; + case 2: + phi_v0 = temp_v1->lightBeams[2]; + if (phi_v0 == NULL) { + return; + } + break; + } + + if (this->unk_18C <= 0.0f) { + phi_v0->unLit = 1; + return; + } + + phi_v0->unLit = 0; + Math_Vec3f_Copy(&phi_v0->sourcePt, &this->unk_180); + Matrix_RotateY(this->dyna.actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_NEW); + Matrix_RotateX(D_80897308[this->dyna.actor.params & 3] * (M_PI / 0x8000), MTXMODE_APPLY); + sp28.x = 0.0f; + sp28.y = 0.0; + sp28.z = this->unk_190 * 2800.0f; + Matrix_MultVec3f(&sp28, &phi_v0->poolPt); + Math_Vec3f_Sum(&phi_v0->sourcePt, &phi_v0->poolPt, &phi_v0->poolPt); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895A70.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895BEC.s") +void func_80895BEC(BgJyaCobra* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + s32 pad; + Vec3f sp2C; + func_808958F0(&sp2C, &this->unk_174, Math_SinS(this->unk_170), Math_CosS(this->unk_170)); + player->actor.world.pos.x = this->dyna.actor.world.pos.x + sp2C.x; + player->actor.world.pos.y = this->dyna.actor.world.pos.y + sp2C.y; + player->actor.world.pos.z = this->dyna.actor.world.pos.z + sp2C.z; +} + +#ifdef NON_MATCHING +// Small stack diffs +void func_80895C74(BgJyaCobra* this, GlobalContext* globalCtx) { + s16 phi_v0; + s32 params = this->dyna.actor.params; + BgJyaBigmirror* parent = (BgJyaBigmirror*)this->dyna.actor.parent; + f32 phi_f0; + + if ((params & 3) == 2 && parent != NULL && + (!(parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) || + !(parent->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) { + Math_StepToF(&this->unk_18C, 0.0f, 0.05f); + } else { + this->unk_18C = 1.0f; + if (D_80897310[(params & 3)] != 0) { + phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[(params & 3)]; + phi_v0 = ABS(phi_v0); + if (phi_v0 < 0x2000 && phi_v0 != -0x8000) { + this->unk_18C += ((phi_v0 - 0x2000) * 0.00018310547f); + if (this->unk_18C < 0.0f) { + this->unk_18C = 0.0f; + } + } + } + } + + this->unk_180.x = this->dyna.actor.world.pos.x; + this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f; + this->unk_180.z = this->dyna.actor.world.pos.z; + + if (!(params & 3)) { + this->unk_190 = 0.1f; + } else if ((params & 3) == 1) { + phi_f0 = 0.1f; + phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; + if (phi_v0 < 0x500 && phi_v0 > -0x500) { + phi_f0 = 0.34f; + } else { + phi_v0 = this->dyna.actor.shape.rot.y - 0x4000; + if (phi_v0 < 0x500 && phi_v0 > -0x500 && parent != NULL && + (parent->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED)) { + phi_f0 = 0.34f; + } + } + Math_StepToF(&this->unk_190, phi_f0, 0.04f); + } else if ((params & 3) == 2) { + phi_f0 = 0.1f; + phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; + if (phi_v0 < 0x500 && phi_v0 > -0x500) { + phi_f0 = 0.34f; + } else { + phi_v0 = this->dyna.actor.shape.rot.y + 0xFFFF4000; + if (phi_v0 < 0x500 && phi_v0 > -0x500) { + phi_f0 = 0.34f; + } + } + Math_StepToF(&this->unk_190, phi_f0, 0.04f); + } +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895C74.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80895EF0.s") +#ifdef NON_MATCHING +// Repeatedly calculates temp_z * 0x40 for temp_s2[temp_z] rather than calculating it once when temp_z is assigned. +// Making temp_z volatile or accessing through a pointer variable in if (!(temp_z & ~0x3F)) fix the above issue but are +// obviously wrong. +/* + * Updates the shadow with light coming from the side of the mirror + */ +void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { + Vec3f spD4; + Vec3f spC8; + Vec3f spBC; + u8(*temp_s2)[0x40]; + s32 temp_x; + s32 temp_z; + s32 x; + s32 z; + s32 i; + s32 j; + s32 k; + s32 l; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896518.s") + temp_s2 = (u8(*)[0x40])ALIGN16((s32)(&this->shadowTexture)); + Lib_MemSet((u8*)temp_s2, 0x1000, 0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Init.s") + Matrix_RotateX((M_PI / 4), MTXMODE_NEW); + Matrix_RotateY((!(this->dyna.actor.params & 3) ? (s16)(this->dyna.actor.shape.rot.y + 0x4000) + : (s16)(this->dyna.actor.shape.rot.y - 0x4000)) * + (M_PI / 0x8000), + MTXMODE_APPLY); + Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Destroy.s") + for (i = 0; i < 25; i++) { + Math_Vec3f_Diff(&D_808973A4[i + 1], &D_808973A4[i], &spD4); + spD4.x *= 0.5f; + spD4.y *= 0.5f; + spD4.z *= 0.5f; + for (j = 0; j < 2; j++) { + spC8.x = D_808973A4[i].x + (spD4.x * j); + spC8.y = D_808973A4[i].y + (spD4.y * j); + spC8.z = D_808973A4[i].z + (spD4.z * j); + Matrix_MultVec3f(&spC8, &spBC); + x = (s32)(((spBC.x + 50.0f) * 0.64f) + 0.5f); + z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f); + for (k = 0; k < 11; k++) { + temp_z = z - 5 + k; + if (!(temp_z & ~0x3F)) { + for (l = 0; l < 11; l++) { + temp_x = (x - 5 + l); + if (!(temp_x & ~0x3F)) { + temp_s2[temp_z][temp_x] |= D_8089731C[k][l]; + } + } + } + } + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896918.s") + for (i = 0; i < 4; i++) { + Math_Vec3f_Diff(&D_808974DC[i + 1], &D_808974DC[i], &spD4); + spD4.x = spD4.x * 0.2f; + spD4.y = spD4.y * 0.2f; + spD4.z = spD4.z * 0.2f; + for (j = 0; j < 5; j++) { + spC8.x = D_808974DC[i].x + (spD4.x * j); + spC8.y = D_808974DC[i].y + (spD4.y * j); + spC8.z = D_808974DC[i].z + (spD4.z * j); + Matrix_MultVec3f(&spC8, &spBC); + x = (s32)(((spBC.x + 50.0f) * 0.64f) + 0.5f); + z = (s32)(((88.0f - spBC.z) * 0.64f) + 0.5f); + for (k = 0; k < 3; k++) { + temp_z = z - 1 + k; + if (!(temp_z & ~0x3F)) { + for (l = 0; l < 3; l++) { + temp_x = x - 1 + l; + if (!(temp_x & ~0x3F)) { + temp_s2[temp_z][temp_x] |= D_80897398[k][l]; + } + } + } + } + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896950.s") + for (i = 0; i < 0x40; i++) { + temp_s2[0][i] = 0; + temp_s2[0x3F][i] = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_808969F8.s") + for (j = 1; j < 0x3F; j++) { + temp_s2[j][0] = 0; + temp_s2[j][0x3F] = 0; + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromSide.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896ABC.s") +#ifdef NON_MATCHING +// minor register and stack diffs +/* + * Updates the shadow with light coming from above the mirror + */ +void BgJyaCobra_UpdateShadowFromTop(BgJyaCobra* this) { + f32 sp58[0x40]; + f32 temp_f12; + f32 temp_f2; + u8* temp_s0; + s32 i_copy; + u8* phi_a3; + s32 counter; + s32 i; + s32 j; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Update.s") + for (i = 0; i < 0x40; i++) { + sp58[i] = SQ(i - 31.5f); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896CB4.s") + temp_s0 = (u8*)ALIGN16((s32)(&this->shadowTexture)); + phi_a3 = temp_s0; + Lib_MemSet(temp_s0, 0x1000, 0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896D78.s") + for (i = 0; i != 0x40; i++) { + temp_f12 = sp58[i]; + for (j = 0; j < 0x40; j++) { + temp_f2 = (sp58[j] * 0.5f) + temp_f12; + if (temp_f2 < 300.0f) { + *phi_a3 |= CLAMP_MAX(640 - (s32)(temp_f2 * 2.0f), 166); + } + phi_a3++; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/func_80896EE4.s") + for (counter = 0, i = 0x780; counter < 4; counter++, i += 0x40) { + i_copy = i; + for (j = 4; j < 0x3C; j++) { + if (temp_s0[i + j] < D_80897518[counter]) { + temp_s0[i + j] = D_80897518[counter]; + } + } + temp_s0[i_copy + 0x3C] = 0x20; + temp_s0[i_copy + 0x3] = 0x20; + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_UpdateShadowFromTop.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Cobra/BgJyaCobra_Draw.s") +void BgJyaCobra_Init(Actor* thisx, GlobalContext* globalCtx) { + BgJyaCobra* this = THIS; + + BgJyaCobra_InitDynapoly(this, globalCtx, &D_0601167C, DPM_UNK); + Actor_ProcessInitChain(&this->dyna.actor, D_80897528); + if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(globalCtx, ((s32)this->dyna.actor.params >> 8) & 0x3F)) { + this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; + } + + if (!(this->dyna.actor.params & 3)) { + BgJyaCobra_SpawnRay(this, globalCtx); + } + + func_80896918(this, globalCtx); + + if ((this->dyna.actor.params & 3) == 1 || (this->dyna.actor.params & 3) == 2) { + this->dyna.actor.room = -1; + } + + if ((this->dyna.actor.params & 3) == 1) { + BgJyaCobra_UpdateShadowFromTop(this); + } + + // (jya cobra) + osSyncPrintf("(jya コブラ)(arg_data 0x%04x)(act %x)(txt %x)(txt16 %x)\n", this->dyna.actor.params, this, + &this->shadowTexture, ALIGN16((s32)(&this->shadowTexture))); +} + +void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgJyaCobra* this = THIS; + + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} + +void func_80896918(BgJyaCobra* this, GlobalContext* globalCtx) { + this->actionFunc = &func_80896950; + this->unk_168 = 0; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y = + (s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y); +} + +void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + + if (this->dyna.unk_150 > 0.001f) { + this->unk_168++; + if (this->unk_168 >= 15) { + func_808969F8(this, globalCtx); + } + } else { + this->unk_168 = 0; + } + + if (fabsf(this->dyna.unk_150) > 0.001f) { + this->dyna.unk_150 = 0.0f; + player->stateFlags2 &= ~0x10; + } +} + +void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx) { + Player* player; + s32 phi_a3; + s16 temp2; + + player = PLAYER; + this->actionFunc = func_80896ABC; + temp2 = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; + phi_a3 = (s16)(this->dyna.actor.shape.rot.y - this->dyna.unk_158); + phi_a3 = ABS(phi_a3); + + if (temp2 > 0) { + if (phi_a3 > 0x4000) { + this->unk_16A = 1; + } else { + this->unk_16A = -1; + } + } else { + if (phi_a3 > 0x4000) { + this->unk_16A = -1; + } else { + this->unk_16A = 1; + } + } + + this->unk_174.x = player->actor.world.pos.x - this->dyna.actor.world.pos.x; + this->unk_174.y = player->actor.world.pos.y - this->dyna.actor.world.pos.y; + this->unk_174.z = player->actor.world.pos.z - this->dyna.actor.world.pos.z; + this->unk_170 = this->unk_16E = 0; + this->unk_172 = 1; +} + +void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) { + s16 temp_v0; + Player* player; + + player = PLAYER; + + temp_v0 = (s16)((this->unk_16C << 0xD) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y; + if (ABS(temp_v0) < 7424) { + Math_StepToS(&this->unk_16E, 106, 4); + } else { + Math_StepToS(&this->unk_16E, 21, 10); + } + + if (Math_ScaledStepToS(&this->unk_170, (s16)(this->unk_16A << 0xd), this->unk_16E) != 0) { + this->unk_16C = (this->unk_16C + this->unk_16A) & 7; + player->stateFlags2 &= ~0x10; + this->dyna.unk_150 = 0.0f; + func_80896918(this, globalCtx); + } else { + temp_v0 = (this->unk_16C << 0xD) + this->dyna.actor.home.rot.y + this->unk_170; + this->dyna.actor.world.rot.y = temp_v0; + this->dyna.actor.shape.rot.y = temp_v0; + } + + if (player->stateFlags2 & 0x10) { + if (this->unk_172 != 0) { + func_80895BEC(this, globalCtx); + } + } else if (fabsf(this->dyna.unk_150) < 0.001f) { + this->unk_172 = 0; + } + + this->dyna.unk_150 = 0.0f; + func_8002F974(&this->dyna.actor, 0x200A); +} + +void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx) { + BgJyaCobra* this = THIS; + s32 params; + + this->actionFunc(this, globalCtx); + + func_80895C74(this, globalCtx); + func_80895A70(this); + + params = this->dyna.actor.params & 3; + if (params == 0 || params == 2) { + BgJyaCobra_UpdateShadowFromSide(this); + } +} + +void func_80896CB4(GlobalContext* globalCtx) { + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 864); + + func_80093D84(globalCtx->state.gfxCtx); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 867), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, D_06010C20); + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 872); +} + +void func_80896D78(BgJyaCobra* this, GlobalContext* globalCtx) { + s32 pad; + Vec3s sp44; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 924); + func_80093D84(globalCtx->state.gfxCtx); + + sp44.x = D_80897308[this->dyna.actor.params & 3] + this->dyna.actor.shape.rot.x; + sp44.y = this->dyna.actor.shape.rot.y; + sp44.z = this->dyna.actor.shape.rot.z; + func_800D1694(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44); + + Matrix_Scale(0.1f, 0.1f, this->unk_190, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 939), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)(this->unk_18C * 140.0f)); + gSPDisplayList(POLY_XLU_DISP++, D_060117D0); + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 947); +} + +void BgJyaCobra_DrawShadow(BgJyaCobra* this, GlobalContext* globalCtx) { + u32 pad; + s16 params; + Vec3f sp64; + Vec3s* phi_a3; + + if (1) {} + + params = this->dyna.actor.params & 3; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 966); + + func_80094044(globalCtx->state.gfxCtx); + + if (params == 0) { + sp64.x = this->dyna.actor.world.pos.x - 50.0f; + sp64.y = this->dyna.actor.world.pos.y; + sp64.z = this->dyna.actor.world.pos.z; + phi_a3 = &D_80897538; + } else { + phi_a3 = &this->dyna.actor.shape.rot; + if (params == 2) { + sp64.x = this->dyna.actor.world.pos.x + 70.0f; + sp64.y = this->dyna.actor.world.pos.y; + sp64.z = this->dyna.actor.world.pos.z; + phi_a3 = &D_80897540; + // params == 1 + } else { + Math_Vec3f_Copy(&sp64, &this->dyna.actor.world.pos); + } + } + func_800D1694(sp64.x, sp64.y, sp64.z, phi_a3); + + Matrix_Scale(D_80897548[params].x, D_80897548[params].y, D_80897548[params].z, MTXMODE_APPLY); + Matrix_Translate(0.0f, 0.0f, 40.0f, MTXMODE_APPLY); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 120); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 994), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gDPLoadTextureBlock(POLY_XLU_DISP++, ALIGN16((s32)(&this->shadowTexture)), G_IM_FMT_I, G_IM_SIZ_8b, 0x40, 0x40, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + gSPDisplayList(POLY_XLU_DISP++, D_808972B0); + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_cobra.c", 1006); +} + +void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgJyaCobra* this = THIS; + + func_80896CB4(globalCtx); + Gfx_DrawDListOpa(globalCtx, D_06010790); + + if (this->unk_18C > 0.0f) { + func_80896D78(this, globalCtx); + } + + if ((this->dyna.actor.params & 3) == 2) { + BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; + + if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) && + (mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED)) { + BgJyaCobra_DrawShadow(this, globalCtx); + } + } else { + BgJyaCobra_DrawShadow(this, globalCtx); + } +} diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h index 54ef603506..4ef6562ce8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h @@ -6,9 +6,22 @@ struct BgJyaCobra; +typedef void (*BgJyaCobraActionFunc)(struct BgJyaCobra*, GlobalContext*); + typedef struct BgJyaCobra { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x1058]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ BgJyaCobraActionFunc actionFunc; + /* 0x0168 */ s16 unk_168; + /* 0x016A */ s16 unk_16A; + /* 0x016C */ s16 unk_16C; + /* 0x016E */ s16 unk_16E; + /* 0x0170 */ s16 unk_170; + /* 0x0172 */ u8 unk_172; + /* 0x0174 */ Vec3f unk_174; + /* 0x0180 */ Vec3f unk_180; + /* 0x018C */ f32 unk_18C; + /* 0x0190 */ f32 unk_190; + /* 0x0194 */ u8 shadowTexture[0x1010]; } BgJyaCobra; // size = 0x11A4 extern const ActorInit Bg_Jya_Cobra_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index b9f0b0b85f..b4b230d252 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -26,7 +26,7 @@ void func_80897970(BgJyaGoroiwa* this); const ActorInit Bg_Jya_Goroiwa_InitVars = { ACTOR_BG_JYA_GOROIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GOROIWA, sizeof(BgJyaGoroiwa), @@ -37,20 +37,34 @@ const ActorInit Bg_Jya_Goroiwa_InitVars = { }; extern Gfx D_060006B0[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 58 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x01, 0xF, 0x0, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 0, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -60,11 +74,11 @@ static InitChainEntry sInitChain[] = { }; void func_80897970(BgJyaGoroiwa* this) { - Sphere16* worldSphere = &this->collider.list->dim.worldSphere; + Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; - worldSphere->center.x = this->actor.posRot.pos.x; - worldSphere->center.y = (s32)(this->actor.posRot.pos.y + 59.5f); - worldSphere->center.z = this->actor.posRot.pos.z; + worldSphere->center.x = this->actor.world.pos.x; + worldSphere->center.y = (s32)(this->actor.world.pos.y + 59.5f); + worldSphere->center.z = this->actor.world.pos.z; } void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) { @@ -73,15 +87,13 @@ void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem); func_80897970(this); - this->collider.list->dim.worldSphere.radius = 0x3A; + this->collider.elements[0].dim.worldSphere.radius = 58; } void func_80897A2C(BgJyaGoroiwa* this) { - Actor* thisx = &this->actor; - f32 rotFactor = 175.30046f; - f32 posDiff = thisx->posRot.pos.x - thisx->pos4.x; + f32 posDiff = this->actor.world.pos.x - this->actor.prevPos.x; - thisx->shape.rot.z -= rotFactor * posDiff; + this->actor.shape.rot.z -= 0x10000 / (119 * M_PI) * posDiff; } void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -89,12 +101,10 @@ void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); func_808979C0(this, globalCtx); - this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.shape.rot.z; - this->actor.shape.rot.x = this->actor.shape.rot.z; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 595.0f, &ActorShadow_DrawFunc_Circle, 9.0f); - this->actor.shape.unk_14 = 0x80; + this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0; + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + ActorShape_Init(&this->actor.shape, 595.0f, ActorShadow_DrawCircle, 9.0f); + this->actor.shape.shadowAlpha = 128; func_80897B1C(this); } @@ -106,7 +116,7 @@ void BgJyaGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80897B1C(BgJyaGoroiwa* this) { this->actionFunc = func_80897B48; - this->collider.base.atFlags = this->collider.base.atFlags | 1; + this->collider.base.atFlags |= AT_ON; this->unk_1B4 = 0; this->unk_1B0 = 1.0f; } @@ -115,37 +125,37 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; f32 tmpf2; s16 tmp16; - f32 tmpf1 = (-100.0f - thisx->posRot.pos.y) * 2.5f; + f32 tmpf1 = (-100.0f - thisx->world.pos.y) * 2.5f; if (tmpf1 < 0.01f) { tmpf1 = 0.01f; } thisx->speedXZ = (sqrtf(tmpf1) * this->unk_1B0); - thisx->velocity.x = (Math_SinS(thisx->posRot.rot.y) * thisx->speedXZ); + thisx->velocity.x = (Math_SinS(thisx->world.rot.y) * thisx->speedXZ); - tmpf2 = Math_CosS(thisx->posRot.rot.y) * thisx->speedXZ; + tmpf2 = Math_CosS(thisx->world.rot.y) * thisx->speedXZ; thisx->velocity.z = tmpf2; - thisx->posRot.pos.x = thisx->posRot.pos.x + thisx->velocity.x; - thisx->posRot.pos.z = thisx->posRot.pos.z + tmpf2; + thisx->world.pos.x = thisx->world.pos.x + thisx->velocity.x; + thisx->world.pos.z = thisx->world.pos.z + tmpf2; - if ((1466.0f < thisx->posRot.pos.x) && (thisx->posRot.pos.x < 1673.0f)) { - thisx->posRot.pos.y = -129.5f; + if ((1466.0f < thisx->world.pos.x) && (thisx->world.pos.x < 1673.0f)) { + thisx->world.pos.y = -129.5f; } else { - tmpf2 = 1569.0f - thisx->posRot.pos.x; + tmpf2 = 1569.0f - thisx->world.pos.x; tmpf1 = fabsf(tmpf2) - 103.0f; - thisx->posRot.pos.y = (0.38043478f * tmpf1) - 129.5f; + thisx->world.pos.y = (0.38043478f * tmpf1) - 129.5f; } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~3; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT & ~AT_ON; - tmp16 = thisx->yawTowardsLink - thisx->posRot.rot.y; + tmp16 = thisx->yawTowardsPlayer - thisx->world.rot.y; if ((tmp16 >= -0x3FFF) && (tmp16 < 0x4000)) { - thisx->posRot.rot.y += 0x8000; + thisx->world.rot.y += 0x8000; } - func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsLink, 0.0f, 0); + func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); this->unk_1B8 = 10.0f; @@ -155,19 +165,19 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) { if (this->unk_1B4) { this->unk_1B8 -= 1.5f; - thisx->shape.unk_08 += this->unk_1B8 * 10.0f; - if (thisx->shape.unk_08 < 595.0f) { - thisx->shape.unk_08 = 595.0f; + thisx->shape.yOffset += this->unk_1B8 * 10.0f; + if (thisx->shape.yOffset < 595.0f) { + thisx->shape.yOffset = 595.0f; func_80897DDC(this); } } else { Math_StepToF(&this->unk_1B0, 1.0f, 0.04f); } - if (thisx->posRot.pos.x > 1745.0f) { - thisx->posRot.rot.y = -0x4000; - } else if (thisx->posRot.pos.x < 1393.0f) { - thisx->posRot.rot.y = 0x4000; + if (thisx->world.pos.x > 1745.0f) { + thisx->world.rot.y = -0x4000; + } else if (thisx->world.pos.x < 1393.0f) { + thisx->world.rot.y = 0x4000; } Audio_PlayActorSound2(thisx, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); @@ -196,13 +206,13 @@ void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x300000C0)) { this->actionFunc(this, globalCtx); func_80897A2C(this); - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 59.5f; - pos.z = this->actor.posRot.pos.z; - this->actor.groundY = + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 59.5f; + pos.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &pos); func_80897970(this); - if (this->collider.base.atFlags & 1) { + if (this->collider.base.atFlags & AT_ON) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h index 7859396a1e..5641aea257 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h @@ -12,7 +12,7 @@ typedef struct BgJyaGoroiwa { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaGoroiwaFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItem; + /* 0x0170 */ ColliderJntSphElement colliderItem; /* 0x01B0 */ f32 unk_1B0; /* 0x01B4 */ s16 unk_1B4; /* 0x01B6 */ s16 unk_1B6; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index f027aa244f..5e2faf70ea 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -25,7 +25,7 @@ void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx const ActorInit Bg_Jya_Haheniron_InitVars = { ACTOR_BG_JYA_HAHENIRON, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_IRON, sizeof(BgJyaHaheniron), @@ -35,17 +35,31 @@ const ActorInit Bg_Jya_Haheniron_InitVars = { (ActorFunc)BgJyaHaheniron_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 10 }, 100 }, }, }; -static ColliderJntSphInit D_80898764 = { - { COLTYPE_UNK10, 0x11, 0x01, 0x00, 0x00, COLSHAPE_JNTSPH }, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static s16 sKakeraScales[] = { 5, 8, 11, 14, 17 }; @@ -68,7 +82,7 @@ void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, GlobalContext* globalCtx) s32 pad; Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &D_80898764, this->colliderItems); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); } void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* vec2) { @@ -95,7 +109,7 @@ void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* } EffectSsKakera_Spawn(globalCtx, vec1, &vel, vec1, -350, arg5, 40, 4, 0, sKakeraScales[i], 0, 20, 40, - KAKERA_COLOR_NONE, OBJECT_JYA_IRON, &D_06000880); + KAKERA_COLOR_NONE, OBJECT_JYA_IRON, D_06000880); angle += 0x3333; } pos.x = vec1->x + (vec2->x * 5.0f); @@ -138,18 +152,18 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx) Vec3f vec; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); - if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & 2) && (this->collider.base.at != NULL) && - (this->collider.base.at->type == ACTORTYPE_PLAYER))) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); + if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) && + (this->collider.base.at->category == ACTORCAT_PLAYER))) { vec.x = -Rand_ZeroOne() * this->actor.velocity.x; vec.y = -Rand_ZeroOne() * this->actor.velocity.y; vec.z = -Rand_ZeroOne() * this->actor.velocity.z; - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, &vec); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, &vec); Actor_Kill(&this->actor); } else if (this->timer > 60) { Actor_Kill(&this->actor); } else { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } this->actor.shape.rot.y += 0x4B0; this->actor.shape.rot.x += 0xFA0; @@ -163,7 +177,7 @@ void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx if (this->timer >= 8) { Actor_MoveForward(&this->actor); } else if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, D_808987A0); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987A0); Actor_Kill(&this->actor); } this->actor.shape.rot.y += 0x258; @@ -176,8 +190,8 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) { void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx) { if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, D_808987AC); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987AC); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); Actor_Kill(&this->actor); } } @@ -196,7 +210,7 @@ void BgJyaHaheniron_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaHaheniron* this = THIS; if (this->actor.params == 0) { - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } Gfx_DrawDListOpa(globalCtx, dLists[this->actor.params]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h index dc698b72ca..c25b443dfe 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h @@ -12,7 +12,7 @@ typedef struct BgJyaHaheniron { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaHahenironActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 timer; } BgJyaHaheniron; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 0fcf2c89d8..0a37766a4f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_06000880; /* const ActorInit Bg_Jya_Ironobj_InitVars = { ACTOR_BG_JYA_IRONOBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_IRON, sizeof(BgJyaIronobj), @@ -23,6 +23,26 @@ const ActorInit Bg_Jya_Ironobj_InitVars = { (ActorFunc)BgJyaIronobj_Update, (ActorFunc)BgJyaIronobj_Draw, }; + +static ColliderCylinderInit D_808994AC = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 150, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s") diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index dcc6cb6f9f..d3162b574d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -23,7 +23,7 @@ void func_80899A08(BgJyaKanaami* this); const ActorInit Bg_Jya_Kanaami_InitVars = { ACTOR_BG_JYA_KANAAMI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaKanaami), @@ -83,7 +83,7 @@ void func_80899880(BgJyaKanaami* this) { void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) || this->unk_16A > 0) { - if (this->actor.posRot.pos.x > -1000.0f && this->unk_16A == 0) { + if (this->actor.world.pos.x > -1000.0f && this->unk_16A == 0) { func_800800F8(globalCtx, 0xD7A, -0x63, &this->actor, 0); } this->unk_16A += 1; @@ -102,7 +102,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) { s32 pad[2]; s32 var; this->unk_168 += 0x20; - if (Math_ScaledStepToS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) { + if (Math_ScaledStepToS(&this->actor.world.rot.x, 0x4000, this->unk_168)) { func_80899A08(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRAP_BOUND); var = Quake_Add(ACTIVE_CAM, 3); @@ -114,7 +114,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) { void func_80899A08(BgJyaKanaami* this) { this->actionFunc = 0; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; } void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -123,7 +123,7 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } - this->actor.shape.rot.x = this->actor.posRot.rot.x; + this->actor.shape.rot.x = this->actor.world.rot.x; } void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 8139f87a0c..db6549f6db 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -27,7 +27,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Jya_Lift_InitVars = { ACTOR_BG_JYA_LIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaLift), @@ -94,7 +94,7 @@ void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgJyaLift_SetInitPosY(BgJyaLift* this) { this->actionFunc = BgJyaLift_DelayMove; - this->dyna.actor.posRot.pos.y = 1613.0f; + this->dyna.actor.world.pos.y = 1613.0f; this->moveDelay = 0; } @@ -118,8 +118,8 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 4.0f, 0.1f, 1.0f, 0.0f); tempVelocity = (this->dyna.actor.velocity.y < 0.2f) ? 0.2f : this->dyna.actor.velocity.y; - distFromBottom = Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f); - if ((this->dyna.actor.posRot.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.pos4.y)) { + distFromBottom = Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f); + if ((this->dyna.actor.world.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.prevPos.y)) { func_8005B1A4(ACTIVE_CAM); } if (fabsf(distFromBottom) < 0.001f) { @@ -132,7 +132,7 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) { void BgJyaLift_SetFinalPosY(BgJyaLift* this) { this->actionFunc = NULL; - this->dyna.actor.posRot.pos.y = 973.0f; + this->dyna.actor.world.pos.y = 973.0f; } void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 13fcc1ce60..f7bb8ff55f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -29,7 +29,7 @@ typedef struct { const ActorInit Bg_Jya_Megami_InitVars = { ACTOR_BG_JYA_MEGAMI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaMegami), @@ -39,17 +39,31 @@ const ActorInit Bg_Jya_Megami_InitVars = { (ActorFunc)BgJyaMegami_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, - { 0x00, { { 0x0000, 0xFDA8, 0xFF38 }, 0x003C }, 0x0064 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00200000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, -600, -200 }, 60 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static BgJyaMegamiPieceInit sPiecesInit[] = { @@ -150,7 +164,7 @@ void func_8089A41C(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) { for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { if (Rand_ZeroOne() < arg2) { - Math_Vec3f_Sum(&this->dyna.actor.posRot.pos, &sPiecesInit[i].unk_00, &sp50); + Math_Vec3f_Sum(&this->dyna.actor.world.pos, &sPiecesInit[i].unk_00, &sp50); sp50.z += 15.0f; func_8089A1DC(globalCtx, &sp50, &D_8089B184, 1, 0); } @@ -166,7 +180,7 @@ void BgJyaMegami_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetHeight(&this->dyna.actor, -50.0f); + Actor_SetFocus(&this->dyna.actor, -50.0f); BgJyaMegami_SetupDetectLight(this); } } @@ -185,9 +199,9 @@ void BgJyaMegami_SetupDetectLight(BgJyaMegami* this) { } void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 0x2) { + if (this->collider.base.acFlags & AC_HIT) { this->lightTimer++; - this->collider.base.acFlags &= ~0x2; + this->collider.base.acFlags &= ~AC_HIT; if (globalCtx->gameplayFrames % 4 == 0) { func_8089A41C(this, globalCtx, (this->crumbleIndex * 0.04f) + 0.05f); } @@ -198,7 +212,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) { if (this->lightTimer > 40) { Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); BgJyaMegami_SetupExplode(this); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); func_800800F8(globalCtx, 0xD70, -0x63, &this->dyna.actor, 0); } else { if (this->lightTimer < 8) { @@ -221,7 +235,7 @@ void BgJyaMegami_SetupExplode(BgJyaMegami* this) { this->actionFunc = BgJyaMegami_Explode; for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { - Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.posRot.pos); + Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.world.pos); this->pieces[i].vel.x = sPiecesInit[i].velX; } this->explosionTimer = 0; @@ -236,7 +250,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) { this->explosionTimer++; if (this->explosionTimer == 30) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_BREAKDOWN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN); } for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { @@ -266,15 +280,15 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) { if ((this->explosionTimer % 4 == 0) && (this->explosionTimer > 30) && (this->explosionTimer < 80) && (this->explosionTimer > 40)) { - sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.posRot.pos.x; - sp8C.y = (this->dyna.actor.posRot.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f; - sp8C.z = this->dyna.actor.posRot.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f); + sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.world.pos.x; + sp8C.y = (this->dyna.actor.world.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f; + sp8C.z = this->dyna.actor.world.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f); func_8089A1DC(globalCtx, &sp8C, &sVec, 1, 0); } if (this->explosionTimer < ARRAY_COUNT(this->pieces)) { - sp8C.x = this->dyna.actor.posRot.pos.x; - sp8C.y = this->dyna.actor.posRot.pos.y - 60.0f; - sp8C.z = this->dyna.actor.posRot.pos.z; + sp8C.x = this->dyna.actor.world.pos.x; + sp8C.y = this->dyna.actor.world.pos.y - 60.0f; + sp8C.z = this->dyna.actor.world.pos.z; func_80033480(globalCtx, &sp8C, 100.0f, 1, 150, 100, 1); } if (this->explosionTimer == 60) { @@ -334,7 +348,7 @@ void BgJyaMegami_DrawExplode(BgJyaMegami* this, GlobalContext* globalCtx) { void BgJyaMegami_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaMegami* this = THIS; - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); if (this->actionFunc == BgJyaMegami_Explode) { BgJyaMegami_DrawExplode(this, globalCtx); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index 7a52d11a28..4e6450d53d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -19,7 +19,7 @@ typedef struct BgJyaMegami { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ BgJyaMegamiActionFunc actionFunc; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItem; + /* 0x0188 */ ColliderJntSphElement colliderItem; /* 0x01C8 */ s16 lightTimer; /* 0x01CA */ s16 explosionTimer; /* 0x01CC */ s16 crumbleIndex; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 59b640a4d7..a9d78688b1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -26,7 +26,7 @@ static f32 D_8089B9C0[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; const ActorInit Bg_Jya_Zurerukabe_InitVars = { ACTOR_BG_JYA_ZURERUKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaZurerukabe), @@ -85,7 +85,7 @@ void func_8089B4C8(BgJyaZurerukabe* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < ARRAY_COUNT(D_8089BA18); i++) { - f32 posY = player->actor.posRot.pos.y; + f32 posY = player->actor.world.pos.y; if ((posY >= D_8089BA18[i][0]) && (posY <= D_8089BA18[i][1])) { break; } @@ -118,7 +118,7 @@ void BgJyaZurerukabe_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); for (i = 0; i < ARRAY_COUNT(D_8089B9F0); i++) { - if (fabsf(D_8089B9F0[i] - this->dyna.actor.initPosRot.pos.y) < 1.0f) { + if (fabsf(D_8089B9F0[i] - this->dyna.actor.home.pos.y) < 1.0f) { this->unk_168 = i; break; } @@ -166,7 +166,7 @@ void func_8089B80C(BgJyaZurerukabe* this) { } void func_8089B870(BgJyaZurerukabe* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x + (this->unk_16C * 75), + if (Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + (this->unk_16C * 75), D_8089BA08[this->unk_168])) { func_8089B7B4(this); } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 7b7574c589..8064bc9110 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -17,7 +17,7 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Eye_InitVars = { ACTOR_BG_MENKURI_EYE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriEye), @@ -30,17 +30,31 @@ const ActorInit Bg_Menkuri_Eye_InitVars = { extern Gfx D_06002D20[]; static s32 D_8089C1A0; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 0, 0 }, 14 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -49,15 +63,15 @@ static InitChainEntry sInitChain[] = { void BgMenkuriEye_Init(Actor* thisx, GlobalContext* globalCtx) { BgMenkuriEye* this = THIS; - ColliderJntSphItem* colliderList; + ColliderJntSphElement* colliderList; Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; - colliderList = this->collider.list; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; + colliderList = this->collider.elements; colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius; if (!Flags_GetSwitch(globalCtx, this->actor.params)) { D_8089C1A0 = 0; @@ -85,9 +99,9 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) { } } } - if ((this->collider.base.acFlags & 2) && - (ABS((s16)(this->collider.base.ac->posRot.rot.y - this->actor.shape.rot.y)) > 0x5000)) { - this->collider.base.acFlags &= ~0x2; + if ((this->collider.base.acFlags & AC_HIT) && + (ABS((s16)(this->collider.base.ac->world.rot.y - this->actor.shape.rot.y)) > 0x5000)) { + this->collider.base.acFlags &= ~AC_HIT; if (this->framesUntilDisable == -1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_AMOS_DAMAGE); D_8089C1A0 += 1; @@ -102,7 +116,7 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->framesUntilDisable == -1) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -118,8 +132,8 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) { } else { gDPSetEnvColor(POLY_XLU_DISP++, 200, 0, 0, 255); } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_menkuri_eye.c", 331), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h index 07b5fba7e9..8bea99133e 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h @@ -10,7 +10,7 @@ typedef struct BgMenkuriEye { /* 0x0000 */ Actor actor; /* 0x014C */ s16 framesUntilDisable; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; } BgMenkuriEye; // size = 0x01B0 extern const ActorInit Bg_Menkuri_Eye_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index eea442bce0..228e283894 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -17,7 +17,7 @@ void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Kaiten_InitVars = { ACTOR_BG_MENKURI_KAITEN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriKaiten), diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index e61c58ee36..76668f9744 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -17,7 +17,7 @@ void BgMenkuriNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Nisekabe_InitVars = { ACTOR_BG_MENKURI_NISEKABE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriNisekabe), diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 55d4fb12eb..cebddb99a5 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -21,7 +21,7 @@ void BgMizuBwall_DoNothing(BgMizuBwall* this, GlobalContext* globalCtx); const ActorInit Bg_Mizu_Bwall_InitVars = { ACTOR_BG_MIZU_BWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuBwall), @@ -31,55 +31,118 @@ const ActorInit Bg_Mizu_Bwall_InitVars = { (ActorFunc)BgMizuBwall_Draw, }; -static ColliderTrisItemInit sTrisElementInitFloor[2] = { +static ColliderTrisElementInit sTrisElementInitFloor[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -40.0f, 0.0f, -40.0f }, { -40.0f, 0.0f, 40.0f }, { 40.0f, 0.0f, 40.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -40.0f, 0.0f, -40.0f }, { 40.0f, 0.0f, 40.0f }, { 40.0f, 0.0f, -40.0f } } }, }, }; static ColliderTrisInit sTrisInitFloor = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitFloor, }; -static ColliderTrisItemInit sTrisElementInitRutoWall[1] = { +static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 116.0f, 0.0f }, { 0.0f, 0.0f, 70.0f }, { 0.0f, 0.0f, -70.0f } } }, }, }; static ColliderTrisInit sTrisInitRutoWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 1, sTrisElementInitRutoWall, }; -static ColliderTrisItemInit sTrisElementInitWall[2] = { +static ColliderTrisElementInit sTrisElementInitWall[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 120.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 60.0f, 0.0f, 0.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 120.0f, 0.0f }, { 60.0f, 0.0f, 0.0f }, { 60.0f, 120.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInitUnusedWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitWall, }; static ColliderTrisInit sTrisInitStingerWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitWall, }; @@ -110,7 +173,7 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, D_8089D854); - this->yRot = this->dyna.actor.posRot.pos.y; + this->yRot = this->dyna.actor.world.pos.y; this->dList = sDLists[(u16)this->dyna.actor.params & 0xF]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); CollisionHeader_GetVirtual(sColHeaders[(u16)this->dyna.actor.params & 0xF], &colHeader); @@ -138,15 +201,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -174,15 +237,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { for (j = 0; j < 3; j++) { - offset.x = sTrisInitRutoWall.list[i].dim.vtx[j].x; - offset.y = sTrisInitRutoWall.list[i].dim.vtx[j].y; - offset.z = sTrisInitRutoWall.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitRutoWall.elements[i].dim.vtx[j].x; + offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y; + offset.z = sTrisInitRutoWall.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -212,15 +275,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitUnusedWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -250,15 +313,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -288,15 +351,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -351,7 +414,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, GlobalContext* globalCtx) { s32 pad; s16 rand1; s16 rand2; - Vec3f* thisPos = &this->dyna.actor.posRot.pos; + Vec3f* thisPos = &this->dyna.actor.world.pos; Vec3f debrisPos; f32 tempx; f32 tempz; @@ -399,8 +462,8 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, GlobalContext* globalCtx) { void BgMizuBwall_Idle(BgMizuBwall* this, GlobalContext* globalCtx) { BgMizuBwall_SetAlpha(this, globalCtx); - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; Flags_SetSwitch(globalCtx, ((u16)this->dyna.actor.params >> 8) & 0x3F); this->breakTimer = 1; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); @@ -409,7 +472,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->actionFunc = BgMizuBwall_Break; - } else if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index 5814be5942..2b01ce9f57 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -11,7 +11,7 @@ typedef void (*BgMizuBwallActionFunc)(struct BgMizuBwall*, GlobalContext*); typedef struct BgMizuBwall { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem elements[3]; // only ever uses 2 + /* 0x0184 */ ColliderTrisElement elements[3]; // only ever uses 2 /* 0x0298 */ BgMizuBwallActionFunc actionFunc; /* 0x029C */ f32 yRot; /* 0x02A0 */ s32 scrollAlpha1; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index b52688f22f..d0dfd33554 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -12,7 +12,7 @@ void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Movebg_InitVars = { ACTOR_BG_MIZU_MOVEBG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuMovebg), diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index 402a37fc7e..2150cacc0e 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -19,7 +19,7 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx const ActorInit Bg_Mizu_Shutter_InitVars = { ACTOR_BG_MIZU_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuShutter), @@ -55,22 +55,22 @@ void BgMizuShutter_Init(BgMizuShutter* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(sCollisionHeaders[SIZE_PARAM], &sp30); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp30); if ((SIZE_PARAM == BGMIZUSHUTTER_SMALL) || (SIZE_PARAM == BGMIZUSHUTTER_LARGE)) { - this->closedPos = this->dyna.actor.posRot.pos; + this->closedPos = this->dyna.actor.world.pos; this->timer = 0; this->timerMax = TIMER_PARAM * 20; - Matrix_RotateY(this->dyna.actor.posRot.rot.y * (M_PI / 0x8000), 0); - Matrix_RotateX(this->dyna.actor.posRot.rot.x * (M_PI / 0x8000), 1); - Matrix_RotateZ(this->dyna.actor.posRot.rot.z * (M_PI / 0x8000), 1); + Matrix_RotateY(this->dyna.actor.world.rot.y * (M_PI / 0x8000), 0); + Matrix_RotateX(this->dyna.actor.world.rot.x * (M_PI / 0x8000), 1); + Matrix_RotateZ(this->dyna.actor.world.rot.z * (M_PI / 0x8000), 1); Matrix_MultVec3f(&sDisplacements[SIZE_PARAM], &this->openPos); - this->openPos.x += this->dyna.actor.posRot.pos.x; - this->openPos.y += this->dyna.actor.posRot.pos.y; - this->openPos.z += this->dyna.actor.posRot.pos.z; + this->openPos.x += this->dyna.actor.world.pos.x; + this->openPos.y += this->dyna.actor.world.pos.y; + this->openPos.z += this->dyna.actor.world.pos.z; if (this->timerMax != 0x3F * 20) { Flags_UnsetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F); - this->dyna.actor.posRot.pos = this->closedPos; + this->dyna.actor.world.pos = this->closedPos; } if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - this->dyna.actor.posRot.pos = this->openPos; + this->dyna.actor.world.pos = this->openPos; this->actionFunc = BgMizuShutter_WaitForTimer; } else { this->actionFunc = BgMizuShutter_WaitForSwitch; @@ -87,7 +87,7 @@ void BgMizuShutter_Destroy(BgMizuShutter* thisx, GlobalContext* globalCtx) { void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - if (ABS(this->dyna.actor.posRot.rot.x) > 0x2C60) { + if (ABS(this->dyna.actor.world.rot.x) > 0x2C60) { func_800800F8(globalCtx, 0x119E, -0x63, &this->dyna.actor, 0); } else { func_80080480(globalCtx, &this->dyna.actor); @@ -106,23 +106,23 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx void BgMizuShutter_Move(BgMizuShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); - if ((this->dyna.actor.posRot.pos.x == this->openPos.x) && (this->dyna.actor.posRot.pos.y == this->openPos.y) && - (this->dyna.actor.posRot.pos.z == this->openPos.z)) { + Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); + if ((this->dyna.actor.world.pos.x == this->openPos.x) && (this->dyna.actor.world.pos.y == this->openPos.y) && + (this->dyna.actor.world.pos.z == this->openPos.z)) { this->timer = this->timerMax; this->actionFunc = BgMizuShutter_WaitForTimer; } } else { Math_SmoothStepToF(&this->maxSpeed, 20.0f, 1.0f, 3.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f); - if ((this->dyna.actor.posRot.pos.x == this->closedPos.x) && - (this->dyna.actor.posRot.pos.y == this->closedPos.y) && - (this->dyna.actor.posRot.pos.z == this->closedPos.z)) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f); + if ((this->dyna.actor.world.pos.x == this->closedPos.x) && + (this->dyna.actor.world.pos.y == this->closedPos.y) && + (this->dyna.actor.world.pos.z == this->closedPos.z)) { + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); this->actionFunc = BgMizuShutter_WaitForSwitch; } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 25545d2d00..50aa184706 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -17,7 +17,7 @@ void BgMizuUzu_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Mizu_Uzu_InitVars = { ACTOR_BG_MIZU_UZU, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuUzu), diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 1f03aeb282..760c5aceff 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -34,7 +34,7 @@ static WaterLevel sWaterLevels[] = { const ActorInit Bg_Mizu_Water_InitVars = { ACTOR_BG_MIZU_WATER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuWater), @@ -101,7 +101,7 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { this->type = this->actor.params & 0xFF; this->switchFlag = (this->actor.params >> 8) & 0xFF; Actor_ProcessInitChain(&this->actor, sInitChain); - initialActorY = this->actor.posRot.pos.y; + initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; this->targetY = initialActorY; @@ -112,8 +112,8 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { Flags_GetSwitch(globalCtx, 0x1D), Flags_GetSwitch(globalCtx, 0x1E)); } waterLevelActionIndex = BgMizuWater_GetWaterLevelActionIndex(-1, globalCtx); - this->actor.posRot.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY; - BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.posRot.pos.y); + this->actor.world.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY; + BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.world.pos.y); this->actor.params = sWaterLevels[waterLevelActionIndex].switchFlag; Flags_UnsetSwitch(globalCtx, 0x1C); Flags_UnsetSwitch(globalCtx, 0x1D); @@ -131,31 +131,31 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, 0x1C); break; } - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; break; case 1: break; case 2: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 85.0f; + this->actor.world.pos.y = this->baseY + 85.0f; } - waterBoxes[6].ySurface = this->actor.posRot.pos.y; + waterBoxes[6].ySurface = this->actor.world.pos.y; break; case 3: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 110.0f; + this->actor.world.pos.y = this->baseY + 110.0f; if (1) {} - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; } - waterBoxes[8].ySurface = this->actor.posRot.pos.y; + waterBoxes[8].ySurface = this->actor.world.pos.y; break; case 4: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 160.0f; + this->actor.world.pos.y = this->baseY + 160.0f; if (1) {} - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; } - waterBoxes[16].ySurface = this->actor.posRot.pos.y; + waterBoxes[16].ySurface = this->actor.world.pos.y; break; } @@ -209,7 +209,7 @@ void BgMizuWater_WaitForAction(BgMizuWater* this, GlobalContext* globalCtx) { } } - if (this->targetY != this->actor.posRot.pos.y) { + if (this->targetY != this->actor.world.pos.y) { this->actionFunc = BgMizuWater_ChangeWaterLevel; } } @@ -236,12 +236,12 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { Flags_UnsetSwitch(globalCtx, prevSwitchFlag); } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 5.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; func_80106CCC(globalCtx); } - BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.posRot.pos.y); + BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.world.pos.y); break; case 1: break; @@ -251,11 +251,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[6].ySurface = this->actor.posRot.pos.y; + waterBoxes[6].ySurface = this->actor.world.pos.y; break; case 3: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -263,11 +263,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[8].ySurface = this->actor.posRot.pos.y; + waterBoxes[8].ySurface = this->actor.world.pos.y; break; case 4: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -275,18 +275,18 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[16].ySurface = this->actor.posRot.pos.y; + waterBoxes[16].ySurface = this->actor.world.pos.y; break; } - if (this->targetY < this->actor.posRot.pos.y) { + if (this->targetY < this->actor.world.pos.y) { func_800AA000(0.0f, 0x78, 0x14, 0xA); func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); - } else if (this->targetY > this->actor.posRot.pos.y) { + } else if (this->targetY > this->actor.world.pos.y) { func_800AA000(0.0f, 0x78, 0x14, 0xA); func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } @@ -305,7 +305,7 @@ void BgMizuWater_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->type == 0) { - posY = this->actor.posRot.pos.y; + posY = this->actor.world.pos.y; unk0 = 0; unk1 = 0; if (posY < -15.0f) { diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index 4bac9fa56c..a41cabb3e0 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -20,7 +20,7 @@ void func_808A0920(BgMjin* this, GlobalContext* globalCtx); const ActorInit Bg_Mjin_InitVars = { ACTOR_BG_MJIN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgMjin), diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index cc7960212b..9a853a8225 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -33,7 +33,7 @@ extern Gfx D_06001E50[]; const ActorInit Bg_Mori_Bigst_InitVars = { ACTOR_BG_MORI_BIGST, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriBigst), @@ -77,7 +77,7 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F), Flags_GetTempClear(globalCtx, this->dyna.actor.room), Flags_GetClear(globalCtx, this->dyna.actor.room), - PLAYER->actor.posRot.pos.y); + PLAYER->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, globalCtx, &D_0600221C, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX); @@ -89,11 +89,11 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) { return; } if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 270.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; } - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); BgMoriBigst_SetupWaitForMoriTex(this, globalCtx); } @@ -113,7 +113,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) { thisx->draw = BgMoriBigst_Draw; - if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.posRot.pos.y > 700.0f)) { + if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.world.pos.y > 700.0f)) { if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) { BgMoriBigst_SetupDone(this, globalCtx); } else { @@ -138,7 +138,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) -3320.0f, 0, 0, 0, 1); if (stalfos != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Second Stalfos failure osSyncPrintf("Warning : 第2スタルフォス発生失敗\n"); @@ -149,8 +149,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) void BgMoriBigst_StalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->dyna.actor.initPosRot.rot.z == 0) && - ((this->dyna.actor.initPosRot.pos.y - 5.0f) <= PLAYER->actor.posRot.pos.y)) { + if ((this->dyna.actor.home.rot.z == 0) && ((this->dyna.actor.home.pos.y - 5.0f) <= PLAYER->actor.world.pos.y)) { BgMoriBigst_SetupFall(this, globalCtx); func_800800F8(globalCtx, 0xC94, 0x48, &this->dyna.actor, 0); } @@ -162,8 +161,8 @@ void BgMoriBigst_SetupFall(BgMoriBigst* this, GlobalContext* globalCtx) { void BgMoriBigst_Fall(BgMoriBigst* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - if (this->dyna.actor.posRot.pos.y <= this->dyna.actor.initPosRot.pos.y) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; BgMoriBigst_SetupLanding(this, globalCtx); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); func_800800F8(globalCtx, 0x3FC, 8, &this->dyna.actor, 0); @@ -199,7 +198,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC -3383.0f, 0, 0, 0, 5); if (stalfos1 != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Warning: 3-1 Stalfos failure osSyncPrintf("Warning : 第3-1スタルフォス発生失敗\n"); @@ -208,7 +207,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC -3260.0f, 0, 0, 0, 5); if (stalfos2 != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Warning: 3-2 Stalfos failure osSyncPrintf("Warning : 第3-2スタルフォス発生失敗\n"); @@ -217,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC } void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, GlobalContext* globalCtx) { - if ((this->dyna.actor.initPosRot.rot.z == 0) && !Player_InCsMode(globalCtx)) { + if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(globalCtx)) { Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); BgMoriBigst_SetupDone(this, globalCtx); } @@ -231,7 +230,7 @@ void BgMoriBigst_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMoriBigst* this = THIS; - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); if (this->waitTimer > 0) { this->waitTimer--; } diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index a435ef5977..425651359d 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -22,7 +22,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Mori_Elevator_InitVars = { ACTOR_BG_MORI_ELEVATOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriElevator), @@ -129,7 +129,7 @@ void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) { s32 BgMoriElevator_IsPlayerRiding(BgMoriElevator* this, GlobalContext* globalCtx) { return ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2) && - ((PLAYER->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y) < 80.0f)); + ((PLAYER->actor.world.pos.y - this->dyna.actor.world.pos.y) < 80.0f)); } void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { @@ -140,7 +140,7 @@ void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, GlobalContext* globalCtx if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { if (globalCtx->roomCtx.curRoom.num == 2) { - this->dyna.actor.posRot.pos.y = 73.0f; + this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); } else { // Error: Forest Temple obj elevator Room setting is dangerous @@ -161,7 +161,7 @@ void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, GlobalContext* globalCt f32 distToTarget; func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f); - distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); + distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); if (fabsf(distToTarget) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); @@ -180,7 +180,7 @@ void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, GlobalContext* globalC f32 distToTarget; func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f); - distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); + distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); if (fabsf(distToTarget) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); @@ -207,10 +207,10 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, GlobalContext* globalCtx) // Error:Forest Temple obj elevator Room setting is dangerous(% s % d) osSyncPrintf("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n", "../z_bg_mori_elevator.c", 479); } - } else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.posRot.pos.y < -275.0f)) { + } else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.world.pos.y < -275.0f)) { this->targetY = 233.0f; BgMoriElevator_StopMovement(this); - } else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.posRot.pos.y)) { + } else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); } else if ((globalCtx->roomCtx.curRoom.num == 2) && Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F) && @@ -233,7 +233,7 @@ void func_808A2008(BgMoriElevator* this, GlobalContext* globalCtx) { f32 distTo; func_808A1800(&this->dyna.actor.velocity.y, 12.0f, 0.1f, 1.0f, 0.0f); - distTo = func_808A1800(&this->dyna.actor.posRot.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f); + distTo = func_808A1800(&this->dyna.actor.world.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f); if (fabsf(distTo) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 727c869fb7..060f8b2991 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -31,7 +31,7 @@ extern Gfx D_06004770[]; const ActorInit Bg_Mori_Hashigo_InitVars = { ACTOR_BG_MORI_HASHIGO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriHashigo), @@ -41,26 +41,37 @@ const ActorInit Bg_Mori_Hashigo_InitVars = { NULL, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 25 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChainClasp[] = { - ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 40, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), + ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 40, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; static InitChainEntry sInitChainLadder[] = { @@ -94,10 +105,10 @@ void BgMoriHashigo_InitCollider(BgMoriHashigo* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.list[0].dim.worldSphere.center.x = (s16)this->dyna.actor.posRot.pos.x; - this->collider.list[0].dim.worldSphere.center.y = (s16)this->dyna.actor.posRot.pos.y + 21; - this->collider.list[0].dim.worldSphere.center.z = (s16)this->dyna.actor.posRot.pos.z; - this->collider.list[0].dim.worldSphere.radius = 19; + this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.world.pos.y + 21; + this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.world.pos.z; + this->collider.elements[0].dim.worldSphere.radius = 19; } s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { @@ -109,13 +120,13 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { cs = Math_CosS(this->dyna.actor.shape.rot.y); sn = Math_SinS(this->dyna.actor.shape.rot.y); - pos.x = 6.0f * sn + this->dyna.actor.posRot.pos.x; - pos.y = -210.0f + this->dyna.actor.posRot.pos.y; - pos.z = 6.0f * cs + this->dyna.actor.posRot.pos.z; + pos.x = 6.0f * sn + this->dyna.actor.world.pos.x; + pos.y = -210.0f + this->dyna.actor.world.pos.y; + pos.z = 6.0f * cs + this->dyna.actor.world.pos.z; ladder = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_MORI_HASHIGO, pos.x, pos.y, - pos.z, this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, - this->dyna.actor.posRot.rot.z, 0); + pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, + this->dyna.actor.world.rot.z, 0); if (ladder != NULL) { return true; } else { @@ -129,7 +140,7 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChainClasp); this->dyna.actor.flags |= 1; - Actor_SetHeight(&this->dyna.actor, 55.0f); + Actor_SetFocus(&this->dyna.actor, 55.0f); BgMoriHashigo_InitCollider(this, globalCtx); if ((this->dyna.actor.params == -1) && !BgMoriHashigo_SpawnLadder(this, globalCtx)) { return false; @@ -205,8 +216,8 @@ void BgMoriHashigo_SetupClasp(BgMoriHashigo* this) { void BgMoriHashigo_Clasp(BgMoriHashigo* this, GlobalContext* globalCtx) { if (this->hitTimer <= 0) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->hitTimer = 10; } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -243,12 +254,12 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, GlobalContext* globalCtx) { if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) { BgMoriHashigo_SetupLadderRest(this); } else { - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); thisx->velocity.y = bounceSpeed[this->bounceCounter]; this->bounceCounter++; } } else { - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); } } @@ -256,7 +267,7 @@ void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) { this->actionFunc = NULL; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } void BgMoriHashigo_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index 0cb728dd98..aeeea7fc71 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -11,7 +11,7 @@ typedef void (*BgMoriHashigoActionFunc)(struct BgMoriHashigo*, GlobalContext*); typedef struct BgMoriHashigo { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderItems[1]; /* 0x01C4 */ BgMoriHashigoActionFunc actionFunc; /* 0x01C8 */ s16 hitTimer; /* 0x01CA */ s16 bounceCounter; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index 8947b7a110..29c4555ade 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -27,7 +27,7 @@ extern CollisionHeader D_060089E0; const ActorInit Bg_Mori_Hashira4_InitVars = { ACTOR_BG_MORI_HASHIRA4, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriHashira4), @@ -95,7 +95,7 @@ void BgMoriHashira4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->dyna.actor); return; } - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); BgMoriHashira4_SetupWaitForMoriTex(this); // (4 pillars of the Forest Temple) Bank danger osSyncPrintf("(森の神殿 4本柱)(arg_data 0x%04x)\n", this->dyna.actor.params); @@ -130,7 +130,7 @@ void BgMoriHashira4_SetupPillarsRotate(BgMoriHashira4* this) { } void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, GlobalContext* globalCtx) { - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y += 0x96; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y += 0x96; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); } @@ -147,7 +147,7 @@ void BgMoriHashira4_GateWait(BgMoriHashira4* this, GlobalContext* globalCtx) { } void BgMoriHashira4_GateOpen(BgMoriHashira4* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 10.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 10.0f)) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 20db1be8b6..78ff4335a7 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -26,7 +26,7 @@ static s16 D_808A43E0 = -1; const ActorInit Bg_Mori_Hineri_InitVars = { ACTOR_BG_MORI_HINERI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgMoriHineri), @@ -162,8 +162,8 @@ void BgMoriHineri_DoNothing(BgMoriHineri* this, GlobalContext* globalCtx) { } void BgMoriHineri_SpawnBossKeyChest(BgMoriHineri* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.posRot.pos.x + 147.0f, - this->dyna.actor.posRot.pos.y + -245.0f, this->dyna.actor.posRot.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.world.pos.x + 147.0f, + this->dyna.actor.world.pos.y + -245.0f, this->dyna.actor.world.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE); this->actionFunc = BgMoriHineri_DoNothing; } @@ -171,7 +171,7 @@ void func_808A3C8C(BgMoriHineri* this, GlobalContext* globalCtx) { f32 f0; Player* player = PLAYER; - f0 = 1100.0f - (player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z); + f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z); this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f; Camera_ChangeSetting(globalCtx->cameraPtrs[0], CAM_SET_DUNGEON1); if (this->dyna.actor.params != 0) { @@ -215,7 +215,7 @@ void func_808A3E54(BgMoriHineri* this, GlobalContext* globalCtx) { D_808A43E0 = -1; } } - if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.posRot.pos.z) < 1100.0f)) { + if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.world.pos.z) < 1100.0f)) { func_8002F948(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index f6eaec9da8..d43f5c1a87 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -26,7 +26,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Mori_Idomizu_InitVars = { ACTOR_BG_MORI_IDOMIZU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriIdomizu), @@ -59,14 +59,14 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = 1.1f; this->actor.scale.y = 1.0f; this->actor.scale.z = 1.0f; - this->actor.posRot.pos.x = 119.0f; - this->actor.posRot.pos.z = -1820.0f; + this->actor.world.pos.x = 119.0f; + this->actor.world.pos.z = -1820.0f; this->prevSwitchFlagSet = Flags_GetSwitch(globalCtx, this->actor.params & 0x3F); if (this->prevSwitchFlagSet != 0) { - this->actor.posRot.pos.y = -282.0f; + this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(globalCtx, -282); } else { - this->actor.posRot.pos.y = 184.0f; + this->actor.world.pos.y = 184.0f; BgMoriIdomizu_SetWaterLevel(globalCtx, 184); } this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX); @@ -127,13 +127,13 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) { } else if (!switchFlagSet && this->prevSwitchFlagSet) { func_800800F8(globalCtx, 0xCA8, 0x46, thisx, 0); this->drainTimer = 90; - thisx->posRot.pos.y = 0.0f; + thisx->world.pos.y = 0.0f; } this->drainTimer--; if ((roomNum == 7) || (roomNum == 8) || (roomNum == 9)) { if (this->drainTimer < 70) { - Math_StepToF(&thisx->posRot.pos.y, this->targetWaterLevel, 3.5f); - BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y); + Math_StepToF(&thisx->world.pos.y, this->targetWaterLevel, 3.5f); + BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y); if (this->drainTimer > 0) { if (switchFlagSet) { func_800788CC(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); @@ -143,8 +143,8 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) { } } } else { - thisx->posRot.pos.y = this->targetWaterLevel; - BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y); + thisx->world.pos.y = this->targetWaterLevel; + BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y); Actor_Kill(thisx); return; } diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 7ebf95bb22..edb1419290 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -26,7 +26,7 @@ extern Gfx D_060056B0[]; const ActorInit Bg_Mori_Kaitenkabe_InitVars = { ACTOR_BG_MORI_KAITENKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriKaitenkabe), @@ -100,13 +100,13 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { if ((this->timer > 28) && !Player_InCsMode(globalCtx)) { BgMoriKaitenkabe_SetupRotate(this); func_8002DF54(globalCtx, &this->dyna.actor, 8); - Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.posRot.pos); + Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos); push.x = Math_SinS(this->dyna.unk_158); push.y = 0.0f; push.z = Math_CosS(this->dyna.unk_158); - leverArm.x = this->dyna.actor.posRot.pos.x - player->actor.posRot.pos.x; + leverArm.x = this->dyna.actor.world.pos.x - player->actor.world.pos.x; leverArm.y = 0.0f; - leverArm.z = this->dyna.actor.posRot.pos.z - player->actor.posRot.pos.z; + leverArm.z = this->dyna.actor.world.pos.z - player->actor.world.pos.z; BgMoriKaitenkabe_CrossProduct(&torque, &push, &leverArm); this->rotDirection = (torque.y > 0.0f) ? 1.0f : -1.0f; } @@ -135,22 +135,22 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { BgMoriKaitenkabe_SetupWait(this); func_8002DF54(globalCtx, thisx, 7); if (this->rotDirection > 0.0f) { - thisx->initPosRot.rot.y += 0x2000; + thisx->home.rot.y += 0x2000; } else { - thisx->initPosRot.rot.y -= 0x2000; + thisx->home.rot.y -= 0x2000; } - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y; + thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y; func_800788CC(NA_SE_EV_STONEDOOR_STOP); } else { rotY = this->rotYdeg * (0x10000 / 360.0f); - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y + rotY; + thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y + rotY; func_800788CC(NA_SE_EV_WALL_SLIDE - SFX_FLAG); } if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; } - Math_Vec3f_Copy(&player->actor.posRot.pos, &this->lockedPlayerPos); + Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos); } void BgMoriKaitenkabe_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index b4b110cf89..9fc70adb64 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -33,7 +33,7 @@ static s16 sCamSetting = 0; const ActorInit Bg_Mori_Rakkatenjo_InitVars = { ACTOR_BG_MORI_RAKKATENJO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriRakkatenjo), @@ -56,14 +56,14 @@ void BgMoriRakkatenjo_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); // Forest Temple obj. Falling Ceiling - osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.initPosRot.pos.y); - if ((fabsf(1991.0f - this->dyna.actor.initPosRot.pos.x) > 0.001f) || - (fabsf(683.0f - this->dyna.actor.initPosRot.pos.y) > 0.001f) || - (fabsf(-2520.0f - this->dyna.actor.initPosRot.pos.z) > 0.001f)) { + osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); + if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) || + (fabsf(683.0f - this->dyna.actor.home.pos.y) > 0.001f) || + (fabsf(-2520.0f - this->dyna.actor.home.pos.z) > 0.001f)) { // The set position has been changed. Let's fix the program. osSyncPrintf("Warning : セット位置が変更されています。プログラムを修正しましょう。\n"); } - if (this->dyna.actor.initPosRot.rot.y != 0x8000) { + if (this->dyna.actor.home.rot.y != 0x8000) { // The set Angle has changed. Let's fix the program. osSyncPrintf("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n"); } @@ -89,13 +89,13 @@ void BgMoriRakkatenjo_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 BgMoriRakkatenjo_IsLinkUnder(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { - Vec3f* pos = &PLAYER->actor.posRot.pos; + Vec3f* pos = &PLAYER->actor.world.pos; return (-3300.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f); } s32 BgMoriRakkatenjo_IsLinkClose(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { - Vec3f* pos = &PLAYER->actor.posRot.pos; + Vec3f* pos = &PLAYER->actor.world.pos; return (-3360.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f); } @@ -113,7 +113,7 @@ void BgMoriRakkatenjo_WaitForMoriTex(BgMoriRakkatenjo* this, GlobalContext* glob void BgMoriRakkatenjo_SetupWait(BgMoriRakkatenjo* this) { this->timer = (this->fallCount > 0) ? 100 : 21; - this->dyna.actor.posRot.pos.y = 683.0f; + this->dyna.actor.world.pos.y = 683.0f; this->actionFunc = BgMoriRakkatenjo_Wait; } @@ -153,17 +153,17 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { s32 quake; Actor_MoveForward(thisx); - if ((thisx->velocity.y < 0.0f) && (thisx->posRot.pos.y <= 403.0f)) { + if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) { if (this->bounceCount >= ARRAY_COUNT(bounceVel)) { BgMoriRakkatenjo_SetupRest(this); } else { if (this->bounceCount == 0) { this->fallCount++; func_800788CC(NA_SE_EV_STONE_BOUND); - func_800AA000(SQ(thisx->yDistToLink), 0xFF, 0x14, 0x96); + func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96); } - thisx->posRot.pos.y = - 403.0f - (thisx->posRot.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y); + thisx->world.pos.y = + 403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y); thisx->velocity.y = bounceVel[this->bounceCount]; this->bounceCount++; quake = Quake_Add(ACTIVE_CAM, 3); @@ -176,7 +176,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { void BgMoriRakkatenjo_SetupRest(BgMoriRakkatenjo* this) { this->actionFunc = BgMoriRakkatenjo_Rest; - this->dyna.actor.posRot.pos.y = 403.0f; + this->dyna.actor.world.pos.y = 403.0f; this->timer = 20; } @@ -193,8 +193,8 @@ void BgMoriRakkatenjo_SetupRise(BgMoriRakkatenjo* this) { void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 5.0f, 0.06f, 0.1f, 0.0f); - this->dyna.actor.posRot.pos.y += this->dyna.actor.velocity.y; - if (this->dyna.actor.posRot.pos.y >= 683.0f) { + this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; + if (this->dyna.actor.world.pos.y >= 683.0f) { BgMoriRakkatenjo_SetupWait(this); } } diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 0a4841443e..4f3ce13360 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -38,7 +38,7 @@ extern CollisionHeader D_06007860; const ActorInit Bg_Po_Event_InitVars = { ACTOR_BG_PO_EVENT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PO_SISTERS, sizeof(BgPoEvent), @@ -48,21 +48,42 @@ const ActorInit Bg_Po_Event_InitVars = { (ActorFunc)BgPoEvent_Draw, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 25.0f, 33.0f, 0.0f }, { -25.0f, 33.0f, 0.0f }, { -25.0f, -33.0f, 0.0f } } }, }, { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 25.0f, 33.0f, 0.0f }, { -25.0f, -33.0f, 0.0f }, { 25.0f, -33.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; static u8 sBlocksAtRest = 0; @@ -75,7 +96,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { static s16 paintingPosX[] = { -1302, -866, 1421, 985 }; static s16 paintingPosY[] = { 1107, 1091 }; static s16 paintingPosZ[] = { -3384, -3252 }; - ColliderTrisItemInit* item; + ColliderTrisElementInit* item; Vec3f* vtxVec; s32 i1; s32 i2; @@ -96,15 +117,15 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { scaleY = 1.0f; } for (i1 = 0; i1 < sTrisInit.count; i1++) { - item = &sTrisInit.list[i1]; + item = &sTrisInit.elements[i1]; if (1) {} // This section looks like a macro of some sort. for (i2 = 0; i2 < 3; i2++) { vtxVec = &item->dim.vtx[i2]; - sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.initPosRot.pos.x + (sins * vtxVec->z)); - sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.initPosRot.pos.y; - sp9C[i2].z = this->dyna.actor.initPosRot.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); + sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z)); + sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y; + sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); } - func_800627A0(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]); + Collider_SetTrisVertices(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]); } if ((this->type != 4) && (this->index != 2)) { phi_t2 = (this->type == 2) ? this->index : this->index + 2; @@ -147,7 +168,7 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if ((this->type == 0) && (this->index != 3)) { newBlock = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_PO_EVENT, - blockPosX[this->index], this->dyna.actor.posRot.pos.y, blockPosZ[this->index], 0, + blockPosX[this->index], this->dyna.actor.world.pos.y, blockPosZ[this->index], 0, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z - 0x4000, ((this->index + 1) << 0xC) + (this->type << 8) + this->dyna.actor.params); if (newBlock == NULL) { @@ -168,9 +189,9 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.child->child->child->child = &this->dyna.actor; } } - this->dyna.actor.posRot.pos.y = 833.0f; - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, - &this->dyna.actor, &this->dyna.actor.posRot.pos); + this->dyna.actor.world.pos.y = 833.0f; + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, + &this->dyna.actor, &this->dyna.actor.world.pos); this->actionFunc = BgPoEvent_BlockWait; } @@ -220,14 +241,14 @@ void BgPoEvent_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { - this->dyna.actor.posRot.pos.y = 833.0f; + this->dyna.actor.world.pos.y = 833.0f; if (sPuzzleState == 0x3F) { if (this->type == 1) { func_800800F8(globalCtx, 0xC4E, 0x41, NULL, 0); } this->timer = 45; this->actionFunc = BgPoEvent_BlockShake; - } else if (this->dyna.actor.xzDistToLink > 50.0f) { + } else if (this->dyna.actor.xzDistToPlayer > 50.0f) { if (this->type != 1) { sPuzzleState |= (1 << this->index); } else { @@ -243,13 +264,13 @@ void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { void BgPoEvent_BlockShake(BgPoEvent* this, GlobalContext* globalCtx) { DECR(this->timer); if (this->timer < 15) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x + 2.0f * ((this->timer % 3) - 1); + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + 2.0f * ((this->timer % 3) - 1); if (!(this->timer % 4)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); } } if (this->timer == 0) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; sPuzzleState = 0; this->timer = 60; this->actionFunc = BgPoEvent_BlockFall; @@ -263,24 +284,24 @@ void BgPoEvent_CheckBlock(BgPoEvent* this) { s32 phi_a3; if ((this->index == 3) || (this->index == 1)) { - phi_v1 = this->dyna.actor.posRot.pos.z; - phi_a1 = this->dyna.actor.child->posRot.pos.z; + phi_v1 = this->dyna.actor.world.pos.z; + phi_a1 = this->dyna.actor.child->world.pos.z; if (this->index == 3) { - phi_a3 = this->dyna.actor.posRot.pos.x; - phi_t0 = this->dyna.actor.child->posRot.pos.x; + phi_a3 = this->dyna.actor.world.pos.x; + phi_t0 = this->dyna.actor.child->world.pos.x; } else { // this->index == 1 - phi_a3 = this->dyna.actor.child->posRot.pos.x; - phi_t0 = this->dyna.actor.posRot.pos.x; + phi_a3 = this->dyna.actor.child->world.pos.x; + phi_t0 = this->dyna.actor.world.pos.x; } } else { - phi_v1 = this->dyna.actor.posRot.pos.x; - phi_a1 = this->dyna.actor.child->posRot.pos.x; + phi_v1 = this->dyna.actor.world.pos.x; + phi_a1 = this->dyna.actor.child->world.pos.x; if (this->index == 0) { - phi_a3 = this->dyna.actor.posRot.pos.z; - phi_t0 = this->dyna.actor.child->posRot.pos.z; + phi_a3 = this->dyna.actor.world.pos.z; + phi_t0 = this->dyna.actor.child->world.pos.z; } else { // this->index == 2 - phi_a3 = this->dyna.actor.child->posRot.pos.z; - phi_t0 = this->dyna.actor.posRot.pos.z; + phi_a3 = this->dyna.actor.child->world.pos.z; + phi_t0 = this->dyna.actor.world.pos.z; } } if ((phi_v1 == phi_a1) && ((phi_t0 - phi_a3) == 60)) { @@ -294,7 +315,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, GlobalContext* globalCtx) { static s32 firstFall = 0; this->dyna.actor.velocity.y++; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 433.0f, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 433.0f, this->dyna.actor.velocity.y)) { this->dyna.actor.flags &= ~0x20; this->dyna.actor.velocity.y = 0.0f; sBlocksAtRest++; @@ -323,8 +344,8 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { this->actionFunc = BgPoEvent_BlockSolved; if ((this->type == 0) && (this->index == 0)) { amy = - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.posRot.pos.x + 30.0f, - this->dyna.actor.posRot.pos.y - 30.0f, this->dyna.actor.posRot.pos.z + 30.0f, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.world.pos.x + 30.0f, + this->dyna.actor.world.pos.y - 30.0f, this->dyna.actor.world.pos.z + 30.0f, 0, this->dyna.actor.shape.rot.y, 0, this->dyna.actor.params + 0x300); if (amy != NULL) { func_800800F8(globalCtx, 0xC62, 0x1E, amy, 0); @@ -339,7 +360,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { sBlocksAtRest = 0; } if ((sPuzzleState == 0x40) || ((sPuzzleState == 0x10) && !Player_InCsMode(globalCtx))) { - this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z; + this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; this->actionFunc = BgPoEvent_BlockReset; if (sPuzzleState == 0x10) { sPuzzleState = 0x40; @@ -377,16 +398,16 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ); displacement = this->direction * blockPushDist; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z; if (blockStop) { player->stateFlags2 &= ~0x10; if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(globalCtx, &this->dyna, 0x1E, 0x32, -0x14) == 0)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } this->dyna.unk_150 = 0.0f; - this->dyna.actor.initPosRot.pos.x = this->dyna.actor.posRot.pos.x; - this->dyna.actor.initPosRot.pos.z = this->dyna.actor.posRot.pos.z; + this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; + this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; blockPushDist = 0.0f; this->dyna.actor.speedXZ = 0.0f; this->direction = 5; @@ -408,8 +429,8 @@ void BgPoEvent_BlockReset(BgPoEvent* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 493.0f, 1.0f) && - Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.posRot.rot.z - 0x4000, 0x400)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 493.0f, 1.0f) && + Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.world.rot.z - 0x4000, 0x400)) { this->index = (this->index + 1) % 4; this->actionFunc = BgPoEvent_BlockFall; @@ -427,14 +448,14 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { player->stateFlags2 &= ~0x10; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 369.0f, 2.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 369.0f, 2.0f)) { sPuzzleState = 0x20; Actor_Kill(&this->dyna.actor); } } void BgPoEvent_AmyWait(BgPoEvent* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { sPuzzleState |= 0x20; this->timer = 5; func_8003426C(&this->dyna.actor, 0x4000, 0xFF, 0, 5); @@ -447,9 +468,9 @@ void BgPoEvent_AmyPuzzle(BgPoEvent* this, GlobalContext* globalCtx) { Vec3f pos; if (sPuzzleState == 0xF) { - pos.x = this->dyna.actor.posRot.pos.x - 5.0f; - pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x - 5.0f; + pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.y; + pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &pos, &sZeroVec, &sZeroVec, 170, 0, 200, 255, 100, 170, 0, 255, 0, 1, 9, true); } else if (sPuzzleState == 0x20) { Actor_Kill(&this->dyna.actor); @@ -504,9 +525,9 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) { DECR(this->timer); - if (((this->timer == 0) || ((thisx->xzDistToLink < 150.0f) && (thisx->yDistToLink < 50.0f)) || - (func_8002DD78(player) && (thisx->xzDistToLink < 320.0f) && - ((this->index != 2) ? (thisx->yDistToLink < 100.0f) : (thisx->yDistToLink < 0.0f)) && + if (((this->timer == 0) || ((thisx->xzDistToPlayer < 150.0f) && (thisx->yDistToPlayer < 50.0f)) || + (func_8002DD78(player) && (thisx->xzDistToPlayer < 320.0f) && + ((this->index != 2) ? (thisx->yDistToPlayer < 100.0f) : (thisx->yDistToPlayer < 0.0f)) && func_8002DFC8(thisx, 0x2000, globalCtx))) && ((thisx->parent != NULL) || (thisx->child != NULL))) { /*The third condition in the || is checking if @@ -518,10 +539,10 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) { this->timer = 0; Audio_PlayActorSound2(thisx, NA_SE_EN_PO_LAUGH); this->actionFunc = BgPoEvent_PaintingVanish; - } else if (this->collider.base.acFlags & 2) { + } else if (this->collider.base.acFlags & AC_HIT) { if (!BgPoEvent_NextPainting(this)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x, - thisx->posRot.pos.y - 40.0f, thisx->posRot.pos.z, 0, thisx->shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->world.pos.x, + thisx->world.pos.y - 40.0f, thisx->world.pos.z, 0, thisx->shape.rot.y, 0, thisx->params + ((this->type - 1) << 8)); func_800800F8(globalCtx, 0xC58, 0x50, thisx, 0); func_80078884(NA_SE_SY_CORRECT_CHIME); @@ -547,9 +568,9 @@ void BgPoEvent_PaintingBurn(BgPoEvent* this, GlobalContext* globalCtx) { Vec3f sp54; this->timer--; - sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.posRot.pos.x; - sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.posRot.pos.y; - sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.posRot.pos.z; + sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.world.pos.x; + sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.world.pos.y; + sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.world.pos.z; if (this->timer >= 0) { if (this->type == 2) { EffectSsDeadDb_Spawn(globalCtx, &sp54, &sZeroVec, &sZeroVec, 100, 0, 255, 255, 150, 170, 255, 0, 0, 1, 9, @@ -605,11 +626,11 @@ void BgPoEvent_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_po_event.c", 1508); if ((this->type == 0) || (this->type == 1)) { - sp48 = (833.0f - this->dyna.actor.posRot.pos.y) * 0.0025f; + sp48 = (833.0f - this->dyna.actor.world.pos.y) * 0.0025f; if (!(sp48 > 1.0f)) { - sp58.x = this->dyna.actor.posRot.pos.x; - sp58.y = this->dyna.actor.posRot.pos.y - 30.0f; - sp58.z = this->dyna.actor.posRot.pos.z; + sp58.x = this->dyna.actor.world.pos.x; + sp58.y = this->dyna.actor.world.pos.y - 30.0f; + sp58.z = this->dyna.actor.world.pos.z; sp4C.y = 1.0f; sp4C.x = sp4C.z = (sp48 * 0.3f) + 0.4f; func_80033C30(&sp58, &sp4C, (u8)(155.0f + sp48 * 100.0f), globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h index a22b332cc0..e742d4cbd6 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h @@ -16,7 +16,7 @@ typedef struct BgPoEvent { /* 0x016A */ s8 direction; /* 0x016C */ s16 timer; /* 0x0170 */ ColliderTris collider; - /* 0x0190 */ ColliderTrisItem colliderItems[2]; + /* 0x0190 */ ColliderTrisElement colliderItems[2]; } BgPoEvent; // size = 0x0248 extern const ActorInit Bg_Po_Event_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index fd90ab6168..52c4b8f279 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -25,8 +25,22 @@ void BgPoSyokudai_Update(Actor* thisx, GlobalContext* globalCtx); void BgPoSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; @@ -46,7 +60,7 @@ static Color_RGBA8 sEnvColors[] = { const ActorInit Bg_Po_Syokudai_InitVars = { ACTOR_BG_PO_SYOKUDAI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SYOKUDAI, sizeof(BgPoSyokudai), @@ -72,18 +86,18 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { this->flameColor = (thisx->params >> 8) & 0xFF; thisx->params &= 0x3F; - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, thisx->posRot.pos.x, (s16)thisx->posRot.pos.y + 65, thisx->posRot.pos.z, - 0, 0, 0, 0); + Lights_PointGlowSetInfo(&this->lightInfo, thisx->world.pos.x, (s16)thisx->world.pos.y + 65, thisx->world.pos.z, 0, + 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - this->collider.dim.pos.x = thisx->posRot.pos.x; - this->collider.dim.pos.y = thisx->posRot.pos.y; - this->collider.dim.pos.z = thisx->posRot.pos.z; + this->collider.dim.pos.x = thisx->world.pos.x; + this->collider.dim.pos.y = thisx->world.pos.y; + this->collider.dim.pos.z = thisx->world.pos.z; if (this->flameColor == POE_FLAME_PURPLE && Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_GREEN) && Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_BLUE) && @@ -95,8 +109,8 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { } else if (!Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_PURPLE) && !Flags_GetSwitch(globalCtx, 0x1B)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x, - thisx->posRot.pos.y + 52.0f, thisx->posRot.pos.z, 0, 0, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->world.pos.x, + thisx->world.pos.y + 52.0f, thisx->world.pos.z, 0, 0, 0, (this->flameColor << 8) + thisx->params + 0x1000); } else if (!Flags_GetSwitch(globalCtx, thisx->params)) { diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index f3be709087..d8d385a3ee 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -19,7 +19,7 @@ void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx); const ActorInit Bg_Pushbox_InitVars = { ACTOR_BG_PUSHBOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(BgPushbox), @@ -66,9 +66,9 @@ void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) { thisx->speedXZ += this->dyna.unk_150 * 0.2f; thisx->speedXZ = (thisx->speedXZ < -1.0f) ? -1.0f : ((thisx->speedXZ > 1.0f) ? 1.0f : thisx->speedXZ); Math_StepToF(&thisx->speedXZ, 0.0f, 0.2f); - thisx->posRot.rot.y = this->dyna.unk_158; + thisx->world.rot.y = this->dyna.unk_158; Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); } void BgPushbox_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 3c1a094103..551925a329 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -34,7 +34,7 @@ extern UNK_TYPE D_060025FC; const ActorInit Bg_Relay_Objects_InitVars = { ACTOR_BG_RELAY_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_RELAY_OBJECTS, sizeof(BgRelayObjects), @@ -62,9 +62,9 @@ void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&D_060025FC, &colHeader); if (gSaveContext.eventChkInf[6] & 0x20) { - thisx->posRot.rot.y = 0x400; + thisx->world.rot.y = 0x400; } else { - thisx->posRot.rot.y = 0x80; + thisx->world.rot.y = 0x80; } func_800F5718(); thisx->room = -1; @@ -103,7 +103,7 @@ void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx) { } else { Flags_SetSwitch(globalCtx, this->switchFlag); this->actionFunc = func_808A91AC; - thisx->posRot.pos.y += 120.0f; + thisx->world.pos.y += 120.0f; D_808A9508 |= 1; } } @@ -129,7 +129,7 @@ void func_808A90F4(BgRelayObjects* this, GlobalContext* globalCtx) { this->timer = 160; } } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 12.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 12.0f)) { this->actionFunc = func_808A91AC; } } @@ -150,8 +150,8 @@ void func_808A91AC(BgRelayObjects* this, GlobalContext* globalCtx) { void func_808A9234(BgRelayObjects* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y += this->dyna.actor.gravity; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 180, 20, 100); + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); if (this->unk_169 != globalCtx->roomCtx.curRoom.num) { func_800788CC(NA_SE_EN_PO_LAUGH); @@ -189,13 +189,13 @@ void func_808A939C(BgRelayObjects* this, GlobalContext* globalCtx) { gSaveContext.eventChkInf[6] |= 0x20; } if (gSaveContext.eventChkInf[6] & 0x20) { - Math_ScaledStepToS(&this->dyna.actor.posRot.rot.y, 0x400, 8); + Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x400, 8); } else { - Math_ScaledStepToS(&this->dyna.actor.posRot.rot.y, 0x80, 8); + Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x80, 8); } - this->dyna.actor.shape.rot.y += this->dyna.actor.posRot.rot.y; + this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y; func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WOOD_GEAR - SFX_FLAG, - ((this->dyna.actor.posRot.rot.y - 0x80) * (1.0f / 0x380)) + 1.0f); + ((this->dyna.actor.world.rot.y - 0x80) * (1.0f / 0x380)) + 1.0f); } void BgRelayObjects_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index 9a67b2d18b..e7545e9061 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -17,7 +17,7 @@ void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot00_Break_InitVars = { ACTOR_BG_SPOT00_BREAK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT00_BREAK, sizeof(BgSpot00Break), diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index fc86d2dd32..3337507fd1 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_060005E0; /* const ActorInit Bg_Spot00_Hanebasi_InitVars = { ACTOR_BG_SPOT00_HANEBASI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT00_OBJECTS, sizeof(BgSpot00Hanebasi), diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index e2fdbc4fc4..3d593c0493 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -19,7 +19,7 @@ void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Fusya_InitVars = { ACTOR_BG_SPOT01_FUSYA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Fusya), diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index b6dba4efbb..7fa6fed6a9 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -40,7 +40,7 @@ static BgSpot01IdohashiraDrawFunc sDrawFuncs[] = { const ActorInit Bg_Spot01_Idohashira_InitVars = { ACTOR_BG_SPOT01_IDOHASHIRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Idohashira), @@ -58,7 +58,7 @@ void BgSpot01Idohashira_PlayBreakSfx1(BgSpot01Idohashira* this) { } void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, GlobalContext* globalCtx) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 60, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK); } void func_808AAD3C(GlobalContext* globalCtx, Vec3f* vec, u32 arg2) { @@ -112,7 +112,7 @@ void func_808AAD3C(GlobalContext* globalCtx, Vec3f* vec, u32 arg2) { void func_808AAE6C(BgSpot01Idohashira* this, GlobalContext* globalCtx) { s32 pad; - Vec3f sp30 = this->dyna.actor.posRot.pos; + Vec3f sp30 = this->dyna.actor.world.pos; sp30.y += kREG(15); func_80033480(globalCtx, &sp30, kREG(11) + 350.0f, kREG(12) + 5, kREG(13) + 0x7D0, kREG(14) + 0x320, 0); @@ -203,11 +203,11 @@ s32 func_808AB29C(BgSpot01Idohashira* this, GlobalContext* globalCtx) { npcAction = BgSpot01Idohashira_GetNpcAction(globalCtx, 2); if (npcAction != NULL) { temp_f0 = func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames); - initPos = this->dyna.actor.initPosRot.pos; + initPos = this->dyna.actor.home.pos; endX = npcAction->endPos.x; tempY = ((kREG(10) + 1100.0f) / 10.0f) + npcAction->endPos.y; endZ = npcAction->endPos.z; - thisPos = &this->dyna.actor.posRot.pos; + thisPos = &this->dyna.actor.world.pos; thisPos->x = ((endX - initPos.x) * temp_f0) + initPos.x; thisPos->y = func_808AB1DC(initPos.y, tempY, npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames) + @@ -314,7 +314,7 @@ void BgSpot01Idohashira_Init(Actor* thisx, GlobalContext* globalCtx) { } } else if (gSaveContext.sceneSetupIndex == 4) { this->action = 1; - this->dyna.actor.shape.unk_08 = -(kREG(10) + 1100.0f); + this->dyna.actor.shape.yOffset = -(kREG(10) + 1100.0f); } else if (gSaveContext.sceneSetupIndex == 6) { this->action = 0; } else { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index b0bf447d73..604c22a284 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -19,7 +19,7 @@ void func_808ABB84(BgSpot01Idomizu* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Idomizu_InitVars = { ACTOR_BG_SPOT01_IDOMIZU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Idomizu), @@ -45,7 +45,7 @@ void BgSpot01Idomizu_Init(Actor* thisx, GlobalContext* globalCtx) { this->waterHeight = 52.0f; } this->actionFunc = func_808ABB84; - this->actor.posRot.pos.y = this->waterHeight; + this->actor.world.pos.y = this->waterHeight; } void BgSpot01Idomizu_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -55,12 +55,12 @@ void func_808ABB84(BgSpot01Idomizu* this, GlobalContext* globalCtx) { if (gSaveContext.eventChkInf[6] & 0x80) { this->waterHeight = -550.0f; } - globalCtx->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.posRot.pos.y; - if (this->waterHeight < this->actor.posRot.pos.y) { + globalCtx->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; + if (this->waterHeight < this->actor.world.pos.y) { Audio_PlaySoundGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - Math_ApproachF(&this->actor.posRot.pos.y, this->waterHeight, 1.0f, 2.0f); + Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f); } void BgSpot01Idomizu_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index c7ccbc0763..efc8cd061d 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -19,7 +19,7 @@ void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Idosoko_InitVars = { ACTOR_BG_SPOT01_IDOSOKO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_MATOYA, sizeof(BgSpot01Idosoko), diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index f3b5198b97..1735959f8c 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -20,7 +20,7 @@ void func_808AC4A4(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Objects2_InitVars = { ACTOR_BG_SPOT01_OBJECTS2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgSpot01Objects2), @@ -110,8 +110,8 @@ void func_808AC2BC(BgSpot01Objects2* this, GlobalContext* globalCtx) { if (gSaveContext.nightFlag == 0) { func_808AC22C(globalCtx->setupPathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0); Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_EN_DAIKU_KAKARIKO, position.x, - position.y, position.z, thisx->posRot.rot.x, thisx->posRot.rot.y, - thisx->posRot.rot.z, ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); + position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, + thisx->world.rot.z, ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); } break; case 0: // Potion Shop Poster diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index b75135ea36..04b171796e 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060133EC; /* const ActorInit Bg_Spot02_Objects_InitVars = { ACTOR_BG_SPOT02_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT02_OBJECTS, sizeof(BgSpot02Objects), diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index f76f3a9302..46cf0846b2 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -19,7 +19,7 @@ void func_808ADEF0(BgSpot03Taki* this, GlobalContext* globalCtx); const ActorInit Bg_Spot03_Taki_InitVars = { ACTOR_BG_SPOT03_TAKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT03_OBJECT, sizeof(BgSpot03Taki), diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index e5f413b0bb..07993ca848 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -23,7 +23,7 @@ extern CollisionHeader D_060012C0; const ActorInit Bg_Spot05_Soko_InitVars = { ACTOR_BG_SPOT05_SOKO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT05_OBJECTS, sizeof(BgSpot05Soko), @@ -85,8 +85,8 @@ void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE); - Actor_SetHeight(thisx, 50.0f); + Audio_PlaySoundAtPosition(globalCtx, &thisx->world.pos, 30, NA_SE_EV_METALDOOR_CLOSE); + Actor_SetFocus(thisx, 50.0f); func_80080480(globalCtx, &this->dyna.actor); this->actionFunc = func_808AE630; thisx->speedXZ = 0.5f; @@ -97,7 +97,7 @@ void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->speedXZ *= 1.5f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 120.0f, thisx->speedXZ) != 0) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 120.0f, thisx->speedXZ) != 0) { Actor_Kill(thisx); } } diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 4acfdaa789..c0d75f7642 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -1,26 +1,61 @@ +/* + * File: z_bg_spot06_objects.c + * Overlay: ovl_Bg_Spot06_Objects + * Description: Lake Hylia Objects + */ + #include "z_bg_spot06_objects.h" #define FLAGS 0x00000200 #define THIS ((BgSpot06Objects*)thisx) +typedef enum { + /* 0x0 */ LHO_WATER_TEMPLE_ENTRACE_GATE, + /* 0x1 */ LHO_WATER_TEMPLE_ENTRANCE_LOCK, + /* 0x2 */ LHO_WATER_PLANE, + /* 0x3 */ LHO_ICE_BLOCK +} LakeHyliaObjectsType; + +typedef enum { + /* 0x0 */ LHWB_GERUDO_VALLEY_RIVER_UPPER, // entrance from Gerudo Valley + /* 0x1 */ LHWB_GERUDO_VALLEY_RIVER_LOWER, // river flowing from Gerudo Valley + /* 0x2 */ LHWB_MAIN_1, // main water box + /* 0x3 */ LHWB_MAIN_2 // extension of main water box +} LakeHyliaWaterBoxIndices; + +// Lake Hylia water plane levels +#define WATER_LEVEL_RAISED (-1313) +#define WATER_LEVEL_RIVER_RAISED (WATER_LEVEL_RAISED + 200) +#define WATER_LEVEL_LOWERED (WATER_LEVEL_RAISED - 680) +#define WATER_LEVEL_RIVER_LOWERED (WATER_LEVEL_RIVER_RAISED - 80) + void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx); void BgSpot06Objects_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgSpot06Objects_Update(Actor* thisx, GlobalContext* globalCtx); void BgSpot06Objects_Draw(Actor* thisx, GlobalContext* globalCtx); +void BgSpot06Objects_GateWaitForSwitch(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_GateWaitToOpen(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_GateOpen(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_DoNothing(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_LockWait(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_LockPullOutward(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_LockFloat(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_WaterPlaneCutsceneWait(BgSpot06Objects* this, GlobalContext* globalCtx); +void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, GlobalContext* globalCtx); -extern UNK_TYPE D_06000120; -extern UNK_TYPE D_06000470; -extern UNK_TYPE D_06000E10; -extern UNK_TYPE D_06000EE8; -extern UNK_TYPE D_06001160; -extern UNK_TYPE D_06001238; -extern UNK_TYPE D_06002490; +extern Gfx D_06000120[]; // Lake Hylia lowered water +extern Gfx D_06000470[]; // Lake Hylia raised water +extern Gfx D_06000E10[]; // Water Temple entrance gate +extern CollisionHeader D_06000EE8; // Water Temple entrance gate collision +extern Gfx D_06001160[]; // Zora's Domain entrance block of ice +extern CollisionHeader D_06001238; // Zora's Domain entrance block of ice collision +extern Gfx D_06002490[]; // Water Temple entrance lock -/* const ActorInit Bg_Spot06_Objects_InitVars = { ACTOR_BG_SPOT06_OBJECTS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT06_OBJECTS, sizeof(BgSpot06Objects), @@ -29,39 +64,454 @@ const ActorInit Bg_Spot06_Objects_InitVars = { (ActorFunc)BgSpot06Objects_Update, (ActorFunc)BgSpot06Objects_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Destroy.s") +static ColliderJntSphElementInit sJntSphItemsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000080, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 1, { { 0, 0, -160 }, 18 }, 100 }, + }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEBC0.s") +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphItemsInit, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AECB4.s") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED48.s") +static InitChainEntry sInitChainWaterPlane[] = { + ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AED7C.s") +void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot06Objects* this = THIS; + s32 pad; + CollisionHeader* colHeader = NULL; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE00.s") + this->switchFlag = thisx->params & 0xFF; + thisx->params = (thisx->params >> 8) & 0xFF; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE0C.s") + osSyncPrintf("spot06 obj nthisx->arg_data=[%d]", thisx->params); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEE6C.s") + switch (thisx->params) { + case LHO_WATER_TEMPLE_ENTRACE_GATE: + Actor_ProcessInitChain(thisx, sInitChain); + DynaPolyActor_Init(thisx, DPM_UNK); + CollisionHeader_GetVirtual(&D_06000EE8, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AEEFC.s") + if (LINK_IS_ADULT && Flags_GetSwitch(globalCtx, this->switchFlag)) { + thisx->world.pos.y = thisx->home.pos.y + 120.0f; + this->actionFunc = BgSpot06Objects_DoNothing; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF120.s") + } else { + this->actionFunc = BgSpot06Objects_GateWaitForSwitch; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF1D8.s") + break; + case LHO_WATER_TEMPLE_ENTRANCE_LOCK: + Actor_ProcessInitChain(thisx, sInitChain); + Collider_InitJntSph(globalCtx, &this->collider); + Collider_SetJntSph(globalCtx, &this->collider, thisx, &sJntSphInit, &this->colliderItem); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF450.s") + if (LINK_IS_ADULT && Flags_GetSwitch(globalCtx, this->switchFlag)) { + if (!(gSaveContext.eventChkInf[6] & 0x200)) { + thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_LOWERED; + } else { + thisx->home.pos.y = thisx->world.pos.y = WATER_LEVEL_RAISED; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s") + this->actionFunc = BgSpot06Objects_LockFloat; + thisx->world.pos.z -= 100.0f; + thisx->home.pos.z = thisx->world.pos.z + 16.0f; + this->collider.elements[0].dim.worldSphere.radius = + this->collider.elements[0].dim.modelSphere.radius * 2; + this->collider.elements[0].dim.worldSphere.center.z = thisx->world.pos.z + 16.0f; + } else { + this->actionFunc = BgSpot06Objects_LockWait; + this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.center.z = thisx->world.pos.z; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF524.s") + this->collider.elements[0].dim.worldSphere.center.x = thisx->world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = thisx->world.pos.y; + thisx->colChkInfo.mass = MASS_IMMOVABLE; + break; + case LHO_WATER_PLANE: + Actor_ProcessInitChain(thisx, sInitChainWaterPlane); + thisx->flags = 0x30; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s") + if (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200)) { + if (gSaveContext.sceneSetupIndex < 4) { + this->lakeHyliaWaterLevel = -681.0f; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = + WATER_LEVEL_RIVER_LOWERED; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].zMin -= 50; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_MAIN_1].ySurface = WATER_LEVEL_LOWERED; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_MAIN_2].ySurface = WATER_LEVEL_LOWERED; + this->actionFunc = BgSpot06Objects_DoNothing; + } else { + thisx->world.pos.y = this->lakeHyliaWaterLevel = -681.0f; + thisx->world.pos.y += WATER_LEVEL_RAISED; + this->actionFunc = BgSpot06Objects_WaterPlaneCutsceneWait; + } + } else { + this->lakeHyliaWaterLevel = 0.0f; + this->actionFunc = BgSpot06Objects_DoNothing; + } + break; + case LHO_ICE_BLOCK: + Actor_ProcessInitChain(thisx, sInitChain); + DynaPolyActor_Init(thisx, DPM_UNK); + CollisionHeader_GetVirtual(&D_06001238, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); + this->actionFunc = BgSpot06Objects_DoNothing; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF7FC.s") + if (LINK_IS_CHILD) { + Actor_Kill(thisx); + } + break; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/func_808AF824.s") +void BgSpot06Objects_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot06Objects* this = THIS; + + switch (this->dyna.actor.params) { + case LHO_WATER_TEMPLE_ENTRACE_GATE: + case LHO_ICE_BLOCK: + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); + break; + case LHO_WATER_TEMPLE_ENTRANCE_LOCK: + Collider_DestroyJntSph(globalCtx, &this->collider.base); + break; + case LHO_WATER_PLANE: + break; + } +} + +/** + * Water Temple entrance gate effect functions + */ +void BgSpot06Objects_GateSpawnBubbles(BgSpot06Objects* this, GlobalContext* globalCtx) { + Vec3f sp34; + f32 tmp; + + if ((globalCtx->gameplayFrames % 3) == 0) { + tmp = Rand_CenteredFloat(160.0f); + sp34.x = (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * tmp) + this->dyna.actor.world.pos.x; + sp34.y = this->dyna.actor.world.pos.y; + sp34.z = (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * tmp) + this->dyna.actor.world.pos.z; + EffectSsBubble_Spawn(globalCtx, &sp34.x, 50.0f, 70.0f, 10.0f, (Rand_ZeroOne() * 0.05f) + 0.175f); + } +} + +/** + * This is where the gate waits for the switch to be set by the fish shaped lock. + */ +void BgSpot06Objects_GateWaitForSwitch(BgSpot06Objects* this, GlobalContext* globalCtx) { + s32 i; + + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { + this->timer = 100; + this->dyna.actor.world.pos.y += 3.0f; + this->actionFunc = BgSpot06Objects_GateWaitToOpen; + + for (i = 0; i < 15; i++) { + BgSpot06Objects_GateSpawnBubbles(this, globalCtx); + } + } +} + +/** + * This is where the gate waits a few frames before rising after the switch is set. + */ +void BgSpot06Objects_GateWaitToOpen(BgSpot06Objects* this, GlobalContext* globalCtx) { + if (this->timer != 0) { + this->timer--; + } + + if (this->timer == 0) { + this->actionFunc = BgSpot06Objects_GateOpen; + } +} + +/** + * This is where the gate finally rises upward. + */ +void BgSpot06Objects_GateOpen(BgSpot06Objects* this, GlobalContext* globalCtx) { + BgSpot06Objects_GateSpawnBubbles(this, globalCtx); + + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 0.6f)) { + this->actionFunc = BgSpot06Objects_DoNothing; + this->timer = 0; + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); + } else { + func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + } +} + +void BgSpot06Objects_DoNothing(BgSpot06Objects* this, GlobalContext* globalCtx) { +} + +/** + * Fish shaped lock effect functions + */ +void BgSpot06Objects_LockSpawnWaterRipples(BgSpot06Objects* this, GlobalContext* globalCtx, s32 flag) { + if (flag || !(globalCtx->gameplayFrames % 7)) { + EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.home, 300, 700, 0); + } +} + +void BgSpot06Objects_LockSpawnBubbles(BgSpot06Objects* this, GlobalContext* globalCtx, s32 flag) { + if (!(globalCtx->gameplayFrames % 7) || flag) { + EffectSsBubble_Spawn(globalCtx, &this->dyna.actor.world, 0.0f, 40.0f, 30.0f, (Rand_ZeroOne() * 0.05f) + 0.175f); + } +} + +/** + * This is where the fish shaped lock waits to be pulled out by the hookshot. Once it does it will spawn bubbles. + */ +void BgSpot06Objects_LockWait(BgSpot06Objects* this, GlobalContext* globalCtx) { + s32 pad; + s32 i; + s32 pad2; + Vec3f effectPos; + f32 sin; + f32 cos; + + if (this->collider.base.acFlags & 2) { + this->timer = 130; + this->dyna.actor.flags |= 0x10; + sin = Math_SinS(this->dyna.actor.world.rot.y); + cos = Math_CosS(this->dyna.actor.world.rot.y); + this->dyna.actor.world.pos.x += (3.0f * sin); + this->dyna.actor.world.pos.z += (3.0f * cos); + + for (i = 0; i < 20; i++) { + BgSpot06Objects_LockSpawnBubbles(this, globalCtx, 1); + } + + effectPos.x = this->dyna.actor.world.pos.x + (5.0f * sin); + effectPos.y = this->dyna.actor.world.pos.y; + effectPos.z = this->dyna.actor.world.pos.z + (5.0f * cos); + + for (i = 0; i < 3; i++) { + EffectSsBubble_Spawn(globalCtx, &effectPos, 0.0f, 20.0f, 20.0f, (Rand_ZeroOne() * 0.1f) + 0.7f); + } + + EffectSsGSplash_Spawn(globalCtx, &this->dyna.actor.world, NULL, NULL, 1, 700); + this->collider.elements->dim.worldSphere.radius = 45; + this->actionFunc = BgSpot06Objects_LockPullOutward; + Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Flags_SetSwitch(globalCtx, this->switchFlag); + func_800800F8(globalCtx, 0x1018, 170, &this->dyna.actor, 0); + } else { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + } +} + +/** + * Once the fish shaped lock is pulled out from the Hookshot it will move outward. + */ +void BgSpot06Objects_LockPullOutward(BgSpot06Objects* this, GlobalContext* globalCtx) { + if (this->timer != 0) { + this->timer--; + } + + this->dyna.actor.world.pos.x += (0.3f * Math_SinS(this->dyna.actor.world.rot.y)); + this->dyna.actor.world.pos.z += (0.3f * Math_CosS(this->dyna.actor.world.rot.y)); + BgSpot06Objects_LockSpawnBubbles(this, globalCtx, 0); + + if (this->timer == 0) { + this->dyna.actor.velocity.y = 0.5f; + this->dyna.actor.flags &= ~0x2000; + + this->actionFunc = BgSpot06Objects_LockSwimToSurface; + } +} + +/** + * After being pulled all the way out the fish shaped lock will rise to the surface, creating bubbles in the water as it + * does so. + */ +void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, GlobalContext* globalCtx) { + f32 cos; + f32 pad; + + this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; + + if (this->dyna.actor.velocity.y <= 0.0f) { + cos = Math_CosS(this->dyna.actor.shape.rot.x) * 4.3f; + this->dyna.actor.world.pos.x += (cos * Math_SinS(this->dyna.actor.shape.rot.y)); + this->dyna.actor.world.pos.z += (cos * Math_CosS(this->dyna.actor.shape.rot.y)); + this->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y - 1.3f; + BgSpot06Objects_LockSpawnWaterRipples(this, globalCtx, 0); + + if (Math_ScaledStepToS(&this->dyna.actor.shape, 0, 0x260) != 0) { + this->dyna.actor.home.pos.x = + this->dyna.actor.world.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y) * 16.0f); + this->dyna.actor.home.pos.z = + this->dyna.actor.world.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y) * 16.0f); + this->dyna.actor.world.pos.y = -1993.0f; + this->timer = 32; + this->dyna.actor.flags &= ~0x10; + this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius * 2; + this->actionFunc = BgSpot06Objects_LockFloat; + } + } else { + if (this->dyna.actor.world.pos.y >= -1973.0f) { + this->dyna.actor.velocity.y = 0.0f; + BgSpot06Objects_LockSpawnWaterRipples(this, globalCtx, 1); + EffectSsGSplash_Spawn(globalCtx, &this->dyna.actor.home, NULL, NULL, 1, 700); + } else if (this->dyna.actor.shape.rot.x == -0x4000) { + this->dyna.actor.velocity.y += 0.02f; + this->dyna.actor.world.pos.x = Rand_CenteredFloat(1.0f) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = Rand_CenteredFloat(1.0f) + this->dyna.actor.home.pos.z; + this->dyna.actor.velocity.y = + (this->dyna.actor.velocity.y > 10.0f) ? (10.0f) : (this->dyna.actor.velocity.y); + BgSpot06Objects_LockSpawnBubbles(this, globalCtx, 0); + } else { + BgSpot06Objects_LockSpawnBubbles(this, globalCtx, 0); + + if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, -0x4000, 0x30)) { + this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; + this->dyna.actor.home.pos.y = -1993.0f; + this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; + } + } + } +} + +/** + * Once the fish shaped lock finishes rising to the surface it will float and create ripples in the water every few + * frames. + */ +void BgSpot06Objects_LockFloat(BgSpot06Objects* this, GlobalContext* globalCtx) { + BgSpot06Objects_LockSpawnWaterRipples(this, globalCtx, 0); + + if (this->timer != 0) { + this->timer--; + } + + this->dyna.actor.world.pos.y = (2.0f * sinf(this->timer * (M_PI / 16.0f))) + this->dyna.actor.home.pos.y; + + if (this->timer == 0) { + this->timer = 32; + } +} + +void BgSpot06Objects_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot06Objects* this = THIS; + + this->actionFunc(this, globalCtx); + + if (thisx->params == LHO_WATER_TEMPLE_ENTRANCE_LOCK) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} + +/** + * Draw the Lake Hylia water plane, and scroll its texture + */ +void BgSpot06Objects_DrawLakeHyliaWater(BgSpot06Objects* this, GlobalContext* globalCtx) { + s32 pad; + s32 gameplayFrames; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_spot06_objects.c", 844); + + func_80093D84(globalCtx->state.gfxCtx); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot06_objects.c", 850), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gameplayFrames = globalCtx->state.frames; + + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, -gameplayFrames, gameplayFrames, 32, 32, 1, gameplayFrames, + gameplayFrames, 32, 32)); + gSPSegment(POLY_XLU_DISP++, 0x09, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, -gameplayFrames, gameplayFrames * 6, 32, 32, 1, + gameplayFrames, gameplayFrames * 6, 32, 32)); + + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); + + if ((this->lakeHyliaWaterLevel < -680.0f) && (gSaveContext.sceneSetupIndex < 4)) { + gSPDisplayList(POLY_XLU_DISP++, D_06000120); + } else { + gSPDisplayList(POLY_XLU_DISP++, D_06000470); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_spot06_objects.c", 879); +} + +void BgSpot06Objects_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgSpot06Objects* this = THIS; + + switch (this->dyna.actor.params) { + case LHO_WATER_TEMPLE_ENTRACE_GATE: + Gfx_DrawDListOpa(globalCtx, D_06000E10); + break; + case LHO_WATER_TEMPLE_ENTRANCE_LOCK: + Gfx_DrawDListOpa(globalCtx, D_06002490); + + if (this->actionFunc == BgSpot06Objects_LockSwimToSurface) { + Collider_UpdateSpheres(1, &this->collider); + } + break; + case LHO_WATER_PLANE: + BgSpot06Objects_DrawLakeHyliaWater(this, globalCtx); + break; + case LHO_ICE_BLOCK: + Gfx_DrawDListOpa(globalCtx, D_06001160); + break; + } +} + +/** + * This is where the Lake Hylia water plane waits for the cutscene to set the water risen flag after the Water Temple is + * cleared. + */ +void BgSpot06Objects_WaterPlaneCutsceneWait(BgSpot06Objects* this, GlobalContext* globalCtx) { + if (gSaveContext.eventChkInf[6] & 0x200) { + this->actionFunc = BgSpot06Objects_WaterPlaneCutsceneRise; + } +} + +/** + * This is where the Lake Hylia water plane rises in the cutscene after the Water Temple is cleared. + */ +void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, GlobalContext* globalCtx) { + s32 pad; + + this->dyna.actor.world.pos.y = this->lakeHyliaWaterLevel + WATER_LEVEL_RAISED; + + if (this->lakeHyliaWaterLevel >= 0.0001f) { + this->dyna.actor.world.pos.y = WATER_LEVEL_RAISED; + this->actionFunc = BgSpot06Objects_DoNothing; + } else { + Math_SmoothStepToF(&this->lakeHyliaWaterLevel, 1.0f, 0.1f, 1.0f, 0.001f); + globalCtx->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = WATER_LEVEL_RIVER_LOWERED; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_MAIN_1].ySurface = this->dyna.actor.world.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[LHWB_MAIN_2].ySurface = this->dyna.actor.world.pos.y; + } + + func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); +} diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h index 03fb0b2f1c..6be355d1ed 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h @@ -6,9 +6,16 @@ struct BgSpot06Objects; +typedef void (*BgSpot06ObjectsActionFunc)(struct BgSpot06Objects*, GlobalContext*); + typedef struct BgSpot06Objects { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x84]; + /* 0x0000 */ DynaPolyActor dyna; + /* 0x0164 */ BgSpot06ObjectsActionFunc actionFunc; + /* 0x0168 */ s16 switchFlag; + /* 0x016A */ s16 timer; + /* 0x016C */ f32 lakeHyliaWaterLevel; + /* 0x0170 */ ColliderJntSph collider; + /* 0x0190 */ ColliderJntSphElement colliderItem[1]; } BgSpot06Objects; // size = 0x01D0 extern const ActorInit Bg_Spot06_Objects_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index 72636b9794..83db881f38 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -27,7 +27,7 @@ extern UNK_TYPE D_060038FC; /* const ActorInit Bg_Spot07_Taki_InitVars = { ACTOR_BG_SPOT07_TAKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT07_OBJECT, sizeof(BgSpot07Taki), diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index ad5bac8e6b..683a78a1db 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -21,7 +21,7 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); const ActorInit Bg_Spot08_Bakudankabe_InitVars = { ACTOR_BG_SPOT08_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT08_OBJ, sizeof(BgSpot08Bakudankabe), @@ -35,25 +35,53 @@ extern Gfx D_0500A880[]; extern CollisionHeader D_060039D4; extern Gfx D_06003898[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 50, 50 }, 70 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { -100, 50, 50 }, 70 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 100, 50, 50 }, 70 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 3, - sJntSphItemsInit, + sJntSphElementsInit, }; static Vec3f D_808B08AC[] = { @@ -99,9 +127,9 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { temp1 = (Rand_ZeroOne() - 0.5f) * 440.0f; temp2 = (Rand_ZeroOne() - 0.5f) * 20.0f; - burstDepthY.x = this->dyna.actor.posRot.pos.x + temp2 * sinY + (temp1 * cosY); - burstDepthY.y = (this->dyna.actor.posRot.pos.y + 20.0f) + (i * 5.4166665f); - burstDepthY.z = this->dyna.actor.posRot.pos.z + temp2 * cosY - (temp1 * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + temp2 * sinY + (temp1 * cosY); + burstDepthY.y = (this->dyna.actor.world.pos.y + 20.0f) + (i * 5.4166665f); + burstDepthY.z = this->dyna.actor.world.pos.z + temp2 * cosY - (temp1 * sinY); burstDepthX.y = (Rand_ZeroOne() - 0.2f) * 12.0f; scale = Rand_ZeroOne() * 75.0f + 10.0f; @@ -125,9 +153,9 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { } for (i = 0; i < ARRAY_COUNT(D_808B08AC); i++) { - burstDepthY.x = this->dyna.actor.posRot.pos.x + D_808B08AC[i].z * sinY + D_808B08AC[i].x * cosY; - burstDepthY.y = this->dyna.actor.posRot.pos.y + D_808B08AC[i].y; - burstDepthY.z = this->dyna.actor.posRot.pos.z + D_808B08AC[i].z * cosY - (D_808B08AC[i].x * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + D_808B08AC[i].z * sinY + D_808B08AC[i].x * cosY; + burstDepthY.y = this->dyna.actor.world.pos.y + D_808B08AC[i].y; + burstDepthY.z = this->dyna.actor.world.pos.z + D_808B08AC[i].z * cosY - (D_808B08AC[i].x * sinY); func_80033480(globalCtx, &burstDepthY, 120.0f, 4, 0x78, 0xA0, 1); } } @@ -158,13 +186,13 @@ void BgSpot08Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot08Bakudankabe* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); - } else if (this->dyna.actor.xzDistToLink < 800.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 800.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -172,8 +200,8 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { void BgSpot08Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx) { BgSpot08Bakudankabe* this = THIS; - func_800628A4(0, &this->collider); - func_800628A4(1, &this->collider); - func_800628A4(2, &this->collider); + Collider_UpdateSpheres(0, &this->collider); + Collider_UpdateSpheres(1, &this->collider); + Collider_UpdateSpheres(2, &this->collider); Gfx_DrawDListOpa(globalCtx, D_06003898); } diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 65c6f28858..eb166e19f6 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -9,7 +9,7 @@ struct BgSpot08Bakudankabe; typedef struct BgSpot08Bakudankabe { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[3]; + /* 0x0184 */ ColliderJntSphElement colliderItems[3]; } BgSpot08Bakudankabe; // size = 0x0244 extern const ActorInit Bg_Spot08_Bakudankabe_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 737531d1f1..f37a728eeb 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_06001904; /* const ActorInit Bg_Spot08_Iceblock_InitVars = { ACTOR_BG_SPOT08_ICEBLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT08_OBJ, sizeof(BgSpot08Iceblock), diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 478912e70d..b63443cc53 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -22,7 +22,7 @@ s32 func_808B1BEC(BgSpot09Obj* this, GlobalContext* globalCtx); const ActorInit Bg_Spot09_Obj_InitVars = { ACTOR_BG_SPOT09_OBJ, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT09_OBJ, sizeof(BgSpot09Obj), diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index cbaba02def..696a3bf0b3 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -19,7 +19,7 @@ void BgSpot11Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot11_Bakudankabe_InitVars = { ACTOR_BG_SPOT11_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT11_OBJ, sizeof(BgSpot11Bakudankabe), @@ -30,8 +30,22 @@ const ActorInit Bg_Spot11_Bakudankabe_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 40, 80, 0, { 2259, 108, -1580 } }, }; @@ -45,9 +59,9 @@ void func_808B2180(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - this->collider.dim.pos.x += (s16)this->dyna.actor.posRot.pos.x; - this->collider.dim.pos.y += (s16)this->dyna.actor.posRot.pos.y; - this->collider.dim.pos.z += (s16)this->dyna.actor.posRot.pos.z; + this->collider.dim.pos.x += (s16)this->dyna.actor.world.pos.x; + this->collider.dim.pos.y += (s16)this->dyna.actor.world.pos.y; + this->collider.dim.pos.z += (s16)this->dyna.actor.world.pos.z; } void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { @@ -64,7 +78,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { s32 gravityInfluence; s32 rotationSpeed; - Math_Vec3f_Sum(&thisx->posRot.pos, &D_808B272C, &burstDepthY); + Math_Vec3f_Sum(&thisx->world.pos, &D_808B272C, &burstDepthY); burstDepthY.x += (Rand_ZeroOne() - 0.5f) * 120.0f; burstDepthY.y += (30.0f + (i * 6.5f)); @@ -88,7 +102,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E, 4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880); } - Math_Vec3f_Sum(&thisx->posRot.pos, &D_808B272C, &burstDepthY); + Math_Vec3f_Sum(&thisx->world.pos, &D_808B272C, &burstDepthY); func_80033480(globalCtx, &burstDepthY, 70, 4, 110, 160, 1); burstDepthY.y += 40; func_80033480(globalCtx, &burstDepthY, 70, 5, 110, 160, 1); @@ -123,7 +137,7 @@ void BgSpot11Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot11Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot11Bakudankabe* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); Audio_PlaySoundAtPosition(globalCtx, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index 2e515329b0..2024014aed 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -17,7 +17,7 @@ void func_808B2AB8(BgSpot11Oasis* this, GlobalContext* globalCtx); const ActorInit Bg_Spot11_Oasis_InitVars = { ACTOR_BG_SPOT11_OASIS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT11_OBJ, sizeof(BgSpot11Oasis), @@ -70,8 +70,7 @@ s32 func_808B280C(GlobalContext* globalCtx) { sp4C.z = D_808B2E10[i][1]; sp40.x = D_808B2E10[i + 1][0]; sp40.z = D_808B2E10[i + 1][1]; - if (Math3D_TriChkPointParaYSlopedY(&sp58, &sp4C, &sp40, player->actor.posRot.pos.z, - player->actor.posRot.pos.x)) { + if (Math3D_TriChkPointParaYSlopedY(&sp58, &sp4C, &sp40, player->actor.world.pos.z, player->actor.world.pos.x)) { return 1; } } @@ -83,7 +82,7 @@ void BgSpot11Oasis_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); func_808B2970(this); - this->actor.posRot.pos.y = -100.0f; + this->actor.world.pos.y = -100.0f; func_808B27F0(globalCtx, -100); } @@ -103,13 +102,13 @@ void func_808B29E0(BgSpot11Oasis* this) { } void func_808B29F0(BgSpot11Oasis* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, 0.0f, 0.7f)) { + if (Math_StepToF(&this->actor.world.pos.y, 0.0f, 0.7f)) { func_808B2AA8(this); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_SPAWNER); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_SPAWNER); func_80078884(NA_SE_SY_CORRECT_CHIME); } - func_808B27F0(globalCtx, this->actor.posRot.pos.y); + func_808B27F0(globalCtx, this->actor.world.pos.y); } void func_808B2AA8(BgSpot11Oasis* this) { @@ -134,7 +133,7 @@ void BgSpot11Oasis_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_150 && (this->actor.projectedPos.z < 400.0f) && (this->actor.projectedPos.z > -40.0f)) { gameplayFrames = globalCtx->gameplayFrames; if (gameplayFrames & 4) { - Math_Vec3f_Sum(&this->actor.posRot.pos, &D_808B2E34[this->unk_151], &sp30); + Math_Vec3f_Sum(&this->actor.world.pos, &D_808B2E34[this->unk_151], &sp30); EffectSsBubble_Spawn(globalCtx, &sp30, 0.0f, 15.0f, 50.0f, (Rand_ZeroOne() * 0.12f) + 0.02f); if (Rand_ZeroOne() < 0.3f) { this->unk_151 = Rand_ZeroOne() * 4.9f; diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index e369dd4661..6d673286cc 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -26,7 +26,7 @@ void func_808B3298(BgSpot12Gate* this, GlobalContext* globalCtx); const ActorInit Bg_Spot12_Gate_InitVars = { ACTOR_BG_SPOT12_GATE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT12_OBJ, sizeof(BgSpot12Gate), @@ -83,7 +83,7 @@ void func_808B30C0(BgSpot12Gate* this) { Actor* thisx = &this->dyna.actor; this->actionFunc = func_808B30D8; - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; } void func_808B30D8(BgSpot12Gate* this, GlobalContext* globalCtx) { @@ -115,7 +115,7 @@ void func_808B318C(BgSpot12Gate* this, GlobalContext* globalCtx) { s32 var; Math_StepToF(&thisx->velocity.y, 1.6f, 0.03f); - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 200.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y + 200.0f, thisx->velocity.y)) { func_808B3274(this); var = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(var, -0x3CB0); @@ -131,7 +131,7 @@ void func_808B3274(BgSpot12Gate* this) { Actor* thisx = &this->dyna.actor; this->actionFunc = func_808B3298; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 200.0f; + thisx->world.pos.y = thisx->home.pos.y + 200.0f; } void func_808B3298(BgSpot12Gate* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 9a7c70869f..546a4211f8 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -24,7 +24,7 @@ void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx); const ActorInit Bg_Spot12_Saku_InitVars = { ACTOR_BG_SPOT12_SAKU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT12_OBJ, sizeof(BgSpot12Saku), @@ -81,8 +81,8 @@ void func_808B3550(BgSpot12Saku* this) { this->actionFunc = func_808B357C; thisx->scale.x = 0.1f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.z = thisx->home.pos.z; } void func_808B357C(BgSpot12Saku* this, GlobalContext* globalCtx) { @@ -105,10 +105,10 @@ void func_808B3604(BgSpot12Saku* this, GlobalContext* globalCtx) { f32 temp_ret = Math_SmoothStepToF(&this->dyna.actor.scale.x, 0.001f / 0.14f, 0.16f, 0.0022f, 0.001f); f32 temp_f18 = ((0.1f - this->dyna.actor.scale.x) * 840.0f); - this->dyna.actor.posRot.pos.x = - this->dyna.actor.initPosRot.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); - this->dyna.actor.posRot.pos.z = - this->dyna.actor.initPosRot.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + this->dyna.actor.world.pos.x = + this->dyna.actor.home.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + this->dyna.actor.world.pos.z = + this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); if (fabsf(temp_ret) < 0.0001f) { func_808B3714(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); @@ -122,8 +122,8 @@ void func_808B3714(BgSpot12Saku* this) { this->actionFunc = func_808B37AC; thisx->scale.x = 0.001f / 0.14f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x - (Math_SinS(thisx->shape.rot.y + 0x4000) * 78.0f); - thisx->posRot.pos.z = thisx->initPosRot.pos.z - (Math_CosS(thisx->shape.rot.y + 0x4000) * 78.0f); + thisx->world.pos.x = thisx->home.pos.x - (Math_SinS(thisx->shape.rot.y + 0x4000) * 78.0f); + thisx->world.pos.z = thisx->home.pos.z - (Math_CosS(thisx->shape.rot.y + 0x4000) * 78.0f); } void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 4d695ad22b..0c24a2c497 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -25,7 +25,7 @@ extern Gfx D_06000180[]; const ActorInit Bg_Spot15_Rrbox_InitVars = { ACTOR_BG_SPOT15_RRBOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT15_OBJ, sizeof(BgSpot15Rrbox), @@ -81,9 +81,8 @@ void func_808B3A34(BgSpot15Rrbox* this) { s32 func_808B3A40(BgSpot15Rrbox* this, GlobalContext* globalCtx) { DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->bgId); - if (dynaPolyActor != NULL && - Math3D_Dist2DSq(dynaPolyActor->actor.posRot.pos.x, dynaPolyActor->actor.posRot.pos.z, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.z) < 0.01f) { + if (dynaPolyActor != NULL && Math3D_Dist2DSq(dynaPolyActor->actor.world.pos.x, dynaPolyActor->actor.world.pos.z, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z) < 0.01f) { return true; } return false; @@ -99,11 +98,11 @@ s32 func_808B3AAC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { return false; } - if (actor->posRot.pos.x <= 930.0f && actor->posRot.pos.z >= -360.0f) { + if (actor->world.pos.x <= 930.0f && actor->world.pos.z >= -360.0f) { if (this->dyna.unk_150 >= 0.0f) { - rotY = actor->posRot.rot.y; + rotY = actor->world.rot.y; } else { - rotY = actor->posRot.rot.y + 0x8000; + rotY = actor->world.rot.y + 0x8000; } if (rotY < 0x2000 && rotY > -0x6000) { @@ -123,7 +122,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, GlobalContext* globalCtx) { func_808B3A34(this); if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) { func_808B44B8(this, globalCtx); - this->dyna.actor.posRot.pos = D_808B45C4[D_808B4590]; + this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; } else { func_808B4084(this, globalCtx); @@ -151,15 +150,15 @@ s32 func_808B3CA0(BgSpot15Rrbox* this, GlobalContext* globalCtx, s32 arg2) { func_808B39E8(&actorPosition, &actorScale, this->unk_16C, this->unk_170); - actorPosition.x += this->dyna.actor.posRot.pos.x; - actorPosition.y += this->dyna.actor.pos4.y; - actorPosition.z += this->dyna.actor.posRot.pos.z; + actorPosition.x += this->dyna.actor.world.pos.x; + actorPosition.y += this->dyna.actor.prevPos.y; + actorPosition.z += this->dyna.actor.world.pos.z; - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &this->bgId, - &this->dyna.actor, &actorPosition, chkDist); + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &this->dyna.actor.floorPoly, + &this->bgId, &this->dyna.actor, &actorPosition, chkDist); - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return true; } return false; @@ -182,9 +181,9 @@ f32 func_808B3DDC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { func_808B39E8(&position, &scale, this->unk_16C, this->unk_170); - position.x += actor->posRot.pos.x; - position.y += actor->pos4.y; - position.z += actor->posRot.pos.z; + position.x += actor->world.pos.x; + position.y += actor->prevPos.y; + position.z += actor->world.pos.z; yIntersect = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &actor->floorPoly, &bgId, actor, &position, 0); @@ -266,12 +265,12 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { sign = this->unk_17C >= 0.0f ? 1.0f : -1.0f; tempUnk178 = (f32)sign * this->unk_178; - actor->posRot.pos.x = actor->initPosRot.pos.x + (tempUnk178 * this->unk_16C); - actor->posRot.pos.z = actor->initPosRot.pos.z + (tempUnk178 * this->unk_170); + actor->world.pos.x = actor->home.pos.x + (tempUnk178 * this->unk_16C); + actor->world.pos.z = actor->home.pos.z + (tempUnk178 * this->unk_170); if (!func_808B3F58(this, globalCtx)) { - actor->initPosRot.pos.x = actor->posRot.pos.x; - actor->initPosRot.pos.z = actor->posRot.pos.z; + actor->home.pos.x = actor->world.pos.x; + actor->home.pos.z = actor->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; @@ -285,8 +284,8 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { if (func_808B3A40(this, globalCtx)) { func_80078884(NA_SE_SY_CORRECT_CHIME); } - actor->initPosRot.pos.x = actor->posRot.pos.x; - actor->initPosRot.pos.z = actor->posRot.pos.z; + actor->home.pos.x = actor->world.pos.x; + actor->home.pos.z = actor->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; @@ -302,12 +301,12 @@ void func_808B4380(BgSpot15Rrbox* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.gravity = -1.0f; - this->dyna.actor.groundY = func_808B3DDC(this, globalCtx); + this->dyna.actor.floorHeight = func_808B3DDC(this, globalCtx); this->actionFunc = func_808B43D0; } void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { - f32 groundY; + f32 floorHeight; Player* player = PLAYER; Actor* actor = &this->dyna.actor; @@ -318,7 +317,7 @@ void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { Actor_MoveForward(actor); - if (actor->posRot.pos.y <= -31990.0f) { + if (actor->world.pos.y <= -31990.0f) { osSyncPrintf("Warning : ロンロン木箱落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 599, actor->params); @@ -327,10 +326,10 @@ void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { return; } - groundY = actor->groundY; + floorHeight = actor->floorHeight; - if ((groundY - actor->posRot.pos.y) >= -0.001f) { - actor->posRot.pos.y = groundY; + if ((floorHeight - actor->world.pos.y) >= -0.001f) { + actor->world.pos.y = floorHeight; func_808B4084(this, globalCtx); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WOOD_BOUND); } @@ -353,9 +352,9 @@ void BgSpot15Rrbox_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_168 > 0) { this->unk_168--; } - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; - this->unk_16C = Math_SinS(this->dyna.actor.posRot.rot.y); - this->unk_170 = Math_CosS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.rot.y = this->dyna.unk_158; + this->unk_16C = Math_SinS(this->dyna.actor.world.rot.y); + this->unk_170 = Math_CosS(this->dyna.actor.world.rot.y); this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 5ad99f068c..130280a4a4 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -21,7 +21,7 @@ void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx); const ActorInit Bg_Spot15_Saku_InitVars = { ACTOR_BG_SPOT15_SAKU, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_SPOT15_OBJ, sizeof(BgSpot15Saku), @@ -45,11 +45,11 @@ void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = 0.1f; thisx->scale.y = 0.1f; thisx->scale.z = 0.1f; - this->unk_170 = thisx->posRot.pos.x; - this->unk_174 = thisx->posRot.pos.y; - this->unk_178 = thisx->posRot.pos.z; + this->unk_170 = thisx->world.pos.x; + this->unk_174 = thisx->world.pos.y; + this->unk_178 = thisx->world.pos.z; if ((gSaveContext.infTable[7] & 2) != 0) { - thisx->posRot.pos.z = 2659.0f; + thisx->world.pos.z = 2659.0f; } this->actionFunc = func_808B4930; } @@ -71,8 +71,8 @@ void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (!this->unk_17C) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.z -= 2.0f; - if (thisx->posRot.pos.z < 2660.0f) { + thisx->world.pos.z -= 2.0f; + if (thisx->world.pos.z < 2660.0f) { Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_17C = 0x1E; this->actionFunc = func_808B4A04; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d684c39f9c..044cfa5516 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -36,22 +36,50 @@ static s16 D_808B5DD8[][10] = { { 0x0006, 0x0009, 0x0028, 0x0000, 0x0BB8, 0xD8F0, 0x001E, 0x0000, 0x0000, 0x0000 }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 50, 0 }, 288 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 190, 80, 0, { 10, 0, 50 } }, }; @@ -86,7 +114,7 @@ static s16 D_808B5EB0[][7] = { const ActorInit Bg_Spot16_Bombstone_InitVars = { ACTOR_BG_SPOT16_BOMBSTONE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT16_OBJ, sizeof(BgSpot16Bombstone), @@ -127,11 +155,11 @@ void func_808B4C4C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 pad; Collider_InitJntSph(globalCtx, &this->colliderJntSph); - Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphItems); - this->colliderJntSph.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderJntSph.list->dim.worldSphere.center.y = this->actor.posRot.pos.y + 50.0f; - this->colliderJntSph.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; - this->colliderJntSph.list->dim.worldSphere.radius = 120; + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderElements); + this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + 50.0f; + this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; + this->colliderJntSph.elements[0].dim.worldSphere.radius = 120; } void func_808B4D04(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -139,9 +167,9 @@ void func_808B4D04(BgSpot16Bombstone* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderCylinder); Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); - this->colliderCylinder.dim.pos.x += (s16)this->actor.posRot.pos.x; - this->colliderCylinder.dim.pos.y += (s16)this->actor.posRot.pos.y; - this->colliderCylinder.dim.pos.z += (s16)this->actor.posRot.pos.z; + this->colliderCylinder.dim.pos.x += (s16)this->actor.world.pos.x; + this->colliderCylinder.dim.pos.y += (s16)this->actor.world.pos.y; + this->colliderCylinder.dim.pos.z += (s16)this->actor.world.pos.z; } s32 func_808B4D9C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -151,7 +179,7 @@ s32 func_808B4D9C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { } Actor_ProcessInitChain(&this->actor, sInitChainBoulder); Actor_SetScale(&this->actor, 0.4f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; func_808B4C4C(this, globalCtx); func_808B4D04(this, globalCtx); this->sinRotation = Math_SinS(this->actor.shape.rot.y); @@ -179,14 +207,14 @@ s32 func_808B4E58(BgSpot16Bombstone* this, GlobalContext* globalctx) { this->unk_210 = (f32)D_808B5DD8[actor->params][3]; this->unk_212 = (f32)D_808B5DD8[actor->params][4]; - actor->posRot.rot.y = D_808B5DD8[actor->params][5]; + actor->world.rot.y = D_808B5DD8[actor->params][5]; - sinValue = Math_SinS(this->actor.posRot.rot.y); - cosValue = Math_CosS(this->actor.posRot.rot.y); + sinValue = Math_SinS(this->actor.world.rot.y); + cosValue = Math_CosS(this->actor.world.rot.y); - actor->posRot.pos.x = (sinValue * sinCosPosFactor) + actor->initPosRot.pos.x; - actor->posRot.pos.y = D_808B5DD8[actor->params][6] + actor->initPosRot.pos.y; - actor->posRot.pos.z = (cosValue * sinCosPosFactor) + actor->initPosRot.pos.z; + actor->world.pos.x = (sinValue * sinCosPosFactor) + actor->home.pos.x; + actor->world.pos.y = D_808B5DD8[actor->params][6] + actor->home.pos.y; + actor->world.pos.z = (cosValue * sinCosPosFactor) + actor->home.pos.z; actor->shape.rot.x = D_808B5DD8[actor->params][7]; actor->shape.rot.y = D_808B5DD8[actor->params][8]; @@ -214,7 +242,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case 0xFF: // The boulder is intact - shouldLive = func_808B4D9C(thisx, globalCtx); + shouldLive = func_808B4D9C(this, globalCtx); break; case 0: case 1: @@ -223,7 +251,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { case 4: case 5: // The boulder is debris - shouldLive = func_808B4E58(thisx, globalCtx); + shouldLive = func_808B4E58(this, globalCtx); break; default: osSyncPrintf("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668, @@ -233,7 +261,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { } if (!shouldLive) { - Actor_Kill(thisx); + Actor_Kill(&this->actor); return; } osSyncPrintf("Spot16 obj 爆弾石 (scaleX %f)(arg_data 0x%04x)\n", this->actor.scale.x, this->actor.params); @@ -252,13 +280,13 @@ void BgSpot16Bombstone_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot16Bombstone_SpawnDust(BgSpot16Bombstone* this, GlobalContext* globalCtx) { f32 scaleX1 = this->actor.scale.x * 150; s16 scaleX2 = this->actor.scale.x * 250; - Vec3f posRot; + Vec3f world; - posRot.x = this->actor.posRot.pos.x; - posRot.y = this->actor.posRot.pos.y + 50.0f; - posRot.z = this->actor.posRot.pos.z; + world.x = this->actor.world.pos.x; + world.y = this->actor.world.pos.y + 50.0f; + world.z = this->actor.world.pos.z; - func_80033480(globalCtx, &posRot, scaleX1, 2, scaleX2, 0xA0, 1); + func_80033480(globalCtx, &world, scaleX1, 2, scaleX2, 0xA0, 1); } void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -266,10 +294,12 @@ void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { f32 tempUnk2; s16 index; Vec3f position; - Vec3f* actorPosition = &this->actor.posRot.pos; + Vec3f* actorPosition = &this->actor.world.pos; if (1) {} + // for(;this->unk_158 < ARRAY_COUNTU(D_808B5EB0); this->unk_158++) + while (true) { if (this->unk_158 >= ARRAY_COUNTU(D_808B5EB0) || this->unk_154 < D_808B5EB0[this->unk_158][0]) { break; @@ -299,8 +329,8 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl s16 scale; if (this->actor.params == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 5); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 5); index = 3; } else { index = 0; @@ -308,9 +338,9 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl if (index < ARRAY_COUNT(D_808B6074)) { do { - pos.x = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.posRot.pos.x; - pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.posRot.pos.y) + 8.0f; - pos.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.posRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.x; + pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.world.pos.y) + 8.0f; + pos.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.z; velocity.x = (Rand_ZeroOne() - 0.5f) * 16.0f; velocity.y = (Rand_ZeroOne() * 14.0) + (fabsf(this->actor.velocity.y) * velocityYMultiplier); @@ -318,7 +348,7 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl scale = D_808B6074[index] * this->actor.scale.x * 3; - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, -420, 0x31, 0xF, 0xF, 0, scale, 2, + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, -420, 0x31, 0xF, 0xF, 0, scale, 2, 0x40, 160, KAKERA_COLOR_NONE, OBJECT_BOMBIWA, D_060009E0); index += 1; } while (index != ARRAY_COUNT(D_808B6074)); @@ -327,12 +357,12 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl void func_808B561C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 index; - PosRot* posRot; + PosRot* world; - posRot = &this->actor.posRot; + world = &this->actor.world; for (index = 0; index < ARRAY_COUNT(D_808B6088); index++) { - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, posRot->pos.x, posRot->pos.y, - posRot->pos.z, 0, 0, 0, D_808B6088[index]) == NULL) { + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, world->pos.x, world->pos.y, + world->pos.z, 0, 0, 0, D_808B6088[index]) == NULL) { break; } } @@ -345,18 +375,19 @@ void func_808B56BC(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 yawDiff; s32 absYawDiff; - if (this->actor.xzDistToLink < 130.0f && this->actor.yDistToLink < 160.0f && this->actor.yDistToLink >= -10.0f) { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer < 130.0f && this->actor.yDistToPlayer < 160.0f && + this->actor.yDistToPlayer >= -10.0f) { + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; absYawDiff = ABS(yawDiff); adjustedYawDiff = absYawDiff - 0x3FFF; if (adjustedYawDiff > 0) { - sinValue = Math_SinS(adjustedYawDiff) * this->actor.xzDistToLink; + sinValue = Math_SinS(adjustedYawDiff) * this->actor.xzDistToPlayer; if (sinValue >= 0.0f) { - player->actor.posRot.pos.x += sinValue * this->sinRotation; - player->actor.posRot.pos.z += sinValue * this->cosRotation; + player->actor.world.pos.x += sinValue * this->sinRotation; + player->actor.world.pos.z += sinValue * this->cosRotation; } else { osSyncPrintf("Error 補正出来ない(%s %d)(arg_data 0x%04x)(hosei_angY %x)\n", "../z_bg_spot16_bombstone.c", 935, this->actor.params, adjustedYawDiff); @@ -377,9 +408,9 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (sPlayerBomb != NULL) { if (sPlayerBomb->actor.update == NULL) { sPlayerBomb = NULL; - } else if (sTimer <= 0 && sPlayerBomb->actor.posRot.pos.y < 1400.0f && - Math3D_Dist1DSq(sPlayerBomb->actor.posRot.pos.x + 1579.0f, - sPlayerBomb->actor.posRot.pos.z + 790.0f) < SQ(400.0f) && + } else if (sTimer <= 0 && sPlayerBomb->actor.world.pos.y < 1400.0f && + Math3D_Dist1DSq(sPlayerBomb->actor.world.pos.x + 1579.0f, sPlayerBomb->actor.world.pos.z + 790.0f) < + SQ(400.0f) && sPlayerBomb->actor.params == 0) { currentBomb = sPlayerBomb; if (currentBomb->timer > 0) { @@ -389,9 +420,9 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { } } else if (player->stateFlags1 & 0x800) { playerHeldActor = player->heldActor; - if (playerHeldActor != NULL && playerHeldActor->type == ACTORTYPE_EXPLOSIVES && + if (playerHeldActor != NULL && playerHeldActor->category == ACTORCAT_EXPLOSIVE && playerHeldActor->id == ACTOR_EN_BOMBF) { - sPlayerBomb = playerHeldActor; + sPlayerBomb = (EnBombf*)playerHeldActor; } } } @@ -409,8 +440,8 @@ void func_808B5950(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (globalCtx) {} - if (this->colliderCylinder.base.acFlags & 2) { - this->colliderCylinder.base.acFlags &= ~2; + if (this->colliderCylinder.base.acFlags & AC_HIT) { + this->colliderCylinder.base.acFlags &= ~AC_HIT; func_808B561C(this, globalCtx); @@ -421,9 +452,9 @@ void func_808B5950(BgSpot16Bombstone* this, GlobalContext* globalCtx) { func_808B5A78(this); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph.base); } if (mREG(64) == 1) { @@ -486,12 +517,12 @@ void func_808B5B6C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 8 || (actor->bgCheckFlags & 1 && actor->velocity.y < 0.0f)) { BgSpot16Bombstone_SpawnFragments(this, globalCtx); BgSpot16Bombstone_SpawnDust(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &actor->posRot, 20, NA_SE_EV_ROCK_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN); Actor_Kill(actor); return; } - func_8002E4B4(globalCtx, actor, 17.5f, 35.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, actor, 17.5f, 35.0f, 0.0f, 5); } void BgSpot16Bombstone_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 90bd7e4f57..9ebec63a10 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -18,7 +18,7 @@ typedef struct BgSpot16Bombstone { /* 0x015C */ f32 sinRotation; /* 0x0160 */ f32 cosRotation; /* 0x0164 */ ColliderJntSph colliderJntSph; - /* 0x0184 */ ColliderJntSphItem colliderJntSphItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderElements[1]; /* 0x01C4 */ ColliderCylinder colliderCylinder; /* 0x0210 */ s16 unk_210; /* 0x0212 */ s16 unk_212; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index afde11bf87..00fc830817 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -21,7 +21,7 @@ void BgSpot16Doughnut_DrawExpanding(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot16_Doughnut_InitVars = { ACTOR_BG_SPOT16_DOUGHNUT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_EFC_DOUGHNUT, sizeof(BgSpot16Doughnut), diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index a6fa3f63b8..e67a642ee6 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -18,7 +18,7 @@ void BgSpot17Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot17_Bakudankabe_InitVars = { ACTOR_BG_SPOT17_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT17_OBJ, sizeof(BgSpot17Bakudankabe), @@ -64,9 +64,9 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) { temp1 = (Rand_ZeroOne() - 0.5f) * 140.0f; temp2 = (Rand_ZeroOne() - 0.5f) * 20.0f; - burstDepthY.x = this->dyna.actor.posRot.pos.x + temp2 * sinY + (temp1 * cosY); - burstDepthY.y = this->dyna.actor.posRot.pos.y + 30.0f + (i * 6.5f); - burstDepthY.z = this->dyna.actor.posRot.pos.z + temp2 * cosY - (temp1 * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + temp2 * sinY + (temp1 * cosY); + burstDepthY.y = this->dyna.actor.world.pos.y + 30.0f + (i * 6.5f); + burstDepthY.z = this->dyna.actor.world.pos.z + temp2 * cosY - (temp1 * sinY); burstDepthX.y = (Rand_ZeroOne() - 0.2f) * 12.0f; scale = Rand_ZeroOne() * 55.0f + 8.0f; @@ -87,7 +87,7 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E, 4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880); } - Math_Vec3f_Copy(&burstDepthY, &this->dyna.actor.posRot.pos); + Math_Vec3f_Copy(&burstDepthY, &this->dyna.actor.world.pos); func_80033480(globalCtx, &burstDepthY, 60.0f, 4, 110, 160, 1); burstDepthY.y += 40.0f; func_80033480(globalCtx, &burstDepthY, 60.0f, 4, 120, 160, 1); @@ -117,10 +117,10 @@ void BgSpot17Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot17Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot17Bakudankabe* this = THIS; - if (this->dyna.actor.xzDistToLink < 650.0f && func_80033684(globalCtx, &this->dyna.actor) != NULL) { + if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(globalCtx, &this->dyna.actor) != NULL) { func_808B6BC0(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index 86ec989efd..87e7de0e07 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -19,7 +19,7 @@ void func_808B7478(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot17_Funen_InitVars = { ACTOR_BG_SPOT17_FUNEN, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_SPOT17_OBJ, sizeof(BgSpot17Funen), diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index d14cf84aa0..c7d3920b1b 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -28,7 +28,7 @@ extern Gfx D_060018B0[]; const ActorInit Bg_Spot18_Basket_InitVars = { ACTOR_BG_SPOT18_BASKET, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Basket), @@ -38,21 +38,42 @@ const ActorInit Bg_Spot18_Basket_InitVars = { (ActorFunc)BgSpot18Basket_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[2] = { +static ColliderJntSphElementInit sJntSphElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 2040, 0 }, 54 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 1400, 0 }, 13 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 2, - sJntSphItemsInit, + sJntSphElementsInit, }; static s16 D_808B85C8[] = { 0x8000, 0x2AAA, 0xD555, 0x0000 }; @@ -61,8 +82,9 @@ void func_808B7710(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Basket* this = THIS; Collider_InitJntSph(globalCtx, &this->colliderJntSph); - Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, &this->colliderJntSphItems); - this->dyna.actor.colChkInfo.mass = 0xFF; + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, + &this->ColliderJntSphElements); + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } void func_808B7770(BgSpot18Basket* this, GlobalContext* globalCtx, f32 arg2) { @@ -86,9 +108,9 @@ void func_808B7770(BgSpot18Basket* this, GlobalContext* globalCtx, f32 arg2) { randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; - position.x = (randomValue * sinValue) + this->dyna.actor.posRot.pos.x; - position.y = this->dyna.actor.posRot.pos.y + 10.0f; - position.z = (randomValue * cosValue) + this->dyna.actor.posRot.pos.z; + position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; + position.y = this->dyna.actor.world.pos.y + 10.0f; + position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; velocity.x = sinValue; velocity.y = 0.0f; @@ -123,9 +145,9 @@ void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, actor, colHeader); Actor_ProcessInitChain(actor, sInitChain); - ActorShape_Init(&actor->shape, 0.0f, ActorShadow_DrawFunc_Circle, 15.0f); - actor->initPosRot.pos.y += 0.01f; - actor->posRot.pos.y = actor->initPosRot.pos.y; + ActorShape_Init(&actor->shape, 0.0f, ActorShadow_DrawCircle, 15.0f); + actor->home.pos.y += 0.01f; + actor->world.pos.y = actor->home.pos.y; if (Flags_GetSwitch(globalCtx, (actor->params >> 8) & 0x3F)) { func_808B7BB0(this); @@ -133,8 +155,8 @@ void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx) { } func_808B7AEC(this); - Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_BG_SPOT18_FUTA, actor->posRot.pos.x, - actor->posRot.pos.y, actor->posRot.pos.z, actor->shape.rot.x, actor->shape.rot.y + 0x1555, + Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_BG_SPOT18_FUTA, actor->world.pos.x, + actor->world.pos.y, actor->world.pos.z, actor->shape.rot.x, actor->shape.rot.y + 0x1555, actor->shape.rot.z, -1); if (actor->child == NULL) { @@ -194,18 +216,18 @@ void func_808B7BCC(BgSpot18Basket* this, GlobalContext* globalCtx) { this->unk_20E += this->unk_20C; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; - if (this->colliderJntSph.base.acFlags & 2) { + if (this->colliderJntSph.base.acFlags & AC_HIT) { colliderBaseAc = this->colliderJntSph.base.ac; if (colliderBaseAc != NULL) { - positionDiff = colliderBaseAc->posRot.pos.y - this->dyna.actor.posRot.pos.y; + positionDiff = colliderBaseAc->world.pos.y - this->dyna.actor.world.pos.y; if (positionDiff > 120.0f && positionDiff < 200.0f) { - if (Math3D_Dist2DSq(colliderBaseAc->posRot.pos.z, this->colliderJntSph.base.ac->posRot.pos.x, - this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.pos.x) < SQ(32.0f)) { + if (Math3D_Dist2DSq(colliderBaseAc->world.pos.z, this->colliderJntSph.base.ac->world.pos.x, + this->dyna.actor.world.pos.z, this->dyna.actor.world.pos.x) < SQ(32.0f)) { func_800800F8(globalCtx, 4210, 240, this, 0); func_808B7D38(this); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); @@ -244,8 +266,8 @@ void func_808B7D50(BgSpot18Basket* this, GlobalContext* globalCtx) { this->unk_20E += this->unk_20C; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; this->unk_212 += 0xBB8; @@ -347,16 +369,16 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { EnItem00* collectible; if (this->unk_216 == 1) { - tempVector.x = actor->posRot.pos.x; - tempVector.y = actor->posRot.pos.y + 170.0f; - tempVector.z = actor->posRot.pos.z; + tempVector.x = actor->world.pos.x; + tempVector.y = actor->world.pos.y + 170.0f; + tempVector.z = actor->world.pos.z; if (this->unk_218 == 0) { for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_BOMBS_A); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[i]; + collectible->actor.world.rot.y = D_808B85E4[i]; } } } else if (this->unk_218 == 1) { @@ -364,7 +386,7 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_GREEN); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[i]; + collectible->actor.world.rot.y = D_808B85E4[i]; } } } else if (this->unk_218 == 2) { @@ -372,14 +394,14 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[1]; + collectible->actor.world.rot.y = D_808B85E4[1]; } } else { collectible = Item_DropCollectible(globalCtx, &tempVector, ((actor->params & 0x3F) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[1]; + collectible->actor.world.rot.y = D_808B85E4[1]; this->unk_21A = 1; } } @@ -387,13 +409,13 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_RED); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[0]; + collectible->actor.world.rot.y = D_808B85E4[0]; } collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_BLUE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[2]; + collectible->actor.world.rot.y = D_808B85E4[2]; } } } else if (this->unk_216 == 2) { @@ -413,12 +435,12 @@ void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_216++; this->actionFunc(this, globalCtx); - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &temp, - &this->dyna.actor, &this->dyna.actor.posRot); + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &temp, + &this->dyna.actor, &this->dyna.actor.world); if (this->actionFunc != func_808B7AFC) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); if (this->actionFunc != func_808B7B6C) { - this->colliderJntSph.base.acFlags &= ~2; + this->colliderJntSph.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); } } @@ -427,7 +449,7 @@ void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx) { void BgSpot18Basket_Draw(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Basket* this = THIS; - func_800628A4(0, &this->colliderJntSph); - func_800628A4(1, &this->colliderJntSph); + Collider_UpdateSpheres(0, &this->colliderJntSph); + Collider_UpdateSpheres(1, &this->colliderJntSph); Gfx_DrawDListOpa(globalCtx, D_060018B0); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h index c95658e36f..00dc9eb606 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h @@ -11,7 +11,7 @@ typedef void (*BgSpot18BasketActionFunc)(struct BgSpot18Basket*, GlobalContext*) typedef struct BgSpot18Basket { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph colliderJntSph; - /* 0x0184 */ ColliderJntSphItem colliderJntSphItems[2]; + /* 0x0184 */ ColliderJntSphElement ColliderJntSphElements[2]; /* 0x0204 */ BgSpot18BasketActionFunc actionFunc; /* 0x0208 */ f32 unk_208; /* 0x020C */ s16 unk_20C; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index 224b8f9605..1e32042c28 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -17,7 +17,7 @@ void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Futa_InitVars = { ACTOR_BG_SPOT18_FUTA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Futa), diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index c1741f25b3..e638ce8286 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -32,7 +32,7 @@ void func_808B9040(BgSpot18Obj* this, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Obj_InitVars = { ACTOR_BG_SPOT18_OBJ, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Obj), @@ -163,10 +163,8 @@ s32 func_808B8BB4(BgSpot18Obj* this, GlobalContext* globalCtx) { func_808B9030(this); } else if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { func_808B9030(this); - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; } else { func_808B8E64(this); } @@ -212,7 +210,7 @@ void func_808B8DD0(BgSpot18Obj* this, GlobalContext* globalCtx) { } void func_808B8DDC(BgSpot18Obj* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->dyna.actor, 20.0f, 46.0f, 0.0f, 28); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 20.0f, 46.0f, 0.0f, 28); } void func_808B8E20(BgSpot18Obj* this, GlobalContext* globalCtx) { @@ -242,7 +240,7 @@ void func_808B8E7C(BgSpot18Obj* this, GlobalContext* globalCtx) { void func_808B8EE0(BgSpot18Obj* this) { this->actionFunc = func_808B8F08; - this->dyna.actor.posRot.rot.y = 0; + this->dyna.actor.world.rot.y = 0; this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.velocity.y = 0.0f; @@ -257,13 +255,11 @@ void func_808B8F08(BgSpot18Obj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); func_808B8DDC(this, globalCtx); - if (Math3D_Dist2DSq(this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.z, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.z) >= 6400.0f) { + if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.z) >= 6400.0f) { func_808B9030(this); - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index abd162665b..eb1db394c0 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -23,7 +23,7 @@ void func_808B971C(BgSpot18Shutter* this, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Shutter_InitVars = { ACTOR_BG_SPOT18_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Shutter), @@ -53,22 +53,22 @@ void BgSpot18Shutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { if (gSaveContext.infTable[16] & 0x200) { this->actionFunc = func_808B95AC; - this->dyna.actor.posRot.pos.y += 180.0f; + this->dyna.actor.world.pos.y += 180.0f; } else { this->actionFunc = func_808B9618; } } else { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { this->actionFunc = func_808B95AC; - this->dyna.actor.posRot.pos.y += 180.0f; + this->dyna.actor.world.pos.y += 180.0f; } else { this->actionFunc = func_808B95B8; } } } else { if (gSaveContext.infTable[16] & 0x200) { - this->dyna.actor.posRot.pos.x += 125.0f * Math_CosS(this->dyna.actor.posRot.rot.y); - this->dyna.actor.posRot.pos.z -= 125.0f * Math_SinS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.pos.x += 125.0f * Math_CosS(this->dyna.actor.world.rot.y); + this->dyna.actor.world.pos.z -= 125.0f * Math_SinS(this->dyna.actor.world.rot.y); this->actionFunc = func_808B95AC; } else { this->actionFunc = func_808B9618; @@ -90,7 +90,7 @@ void func_808B95AC(BgSpot18Shutter* this, GlobalContext* globalCtx) { void func_808B95B8(BgSpot18Shutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { - Actor_SetHeight(&this->dyna.actor, 70.0f); + Actor_SetFocus(&this->dyna.actor, 70.0f); func_80080480(globalCtx, this); this->actionFunc = func_808B9698; } @@ -98,7 +98,7 @@ void func_808B95B8(BgSpot18Shutter* this, GlobalContext* globalCtx) { void func_808B9618(BgSpot18Shutter* this, GlobalContext* globalCtx) { if (gSaveContext.infTable[16] & 0x200) { - Actor_SetHeight(&this->dyna.actor, 70.0f); + Actor_SetFocus(&this->dyna.actor, 70.0f); if (((this->dyna.actor.params >> 8) & 1) == 0) { this->actionFunc = func_808B9698; } else { @@ -109,7 +109,7 @@ void func_808B9618(BgSpot18Shutter* this, GlobalContext* globalCtx) { } void func_808B9698(BgSpot18Shutter* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 180.0f, 1.44f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 180.0f, 1.44f)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = func_808B95AC; } else { @@ -118,13 +118,11 @@ void func_808B9698(BgSpot18Shutter* this, GlobalContext* globalCtx) { } void func_808B971C(BgSpot18Shutter* this, GlobalContext* globalCtx) { - f32 sin = Math_SinS(this->dyna.actor.posRot.rot.y); - f32 cos = Math_CosS(this->dyna.actor.posRot.rot.y); + f32 sin = Math_SinS(this->dyna.actor.world.rot.y); + f32 cos = Math_CosS(this->dyna.actor.world.rot.y); s32 flag = - Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x + (125.0f * cos), fabsf(cos)) & - 1; - flag &= - Math_StepToF(&this->dyna.actor.posRot.pos.z, this->dyna.actor.initPosRot.pos.z - (125.0f * sin), fabsf(sin)); + Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + (125.0f * cos), fabsf(cos)) & 1; + flag &= Math_StepToF(&this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.z - (125.0f * sin), fabsf(sin)); if (flag) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index 813ab28625..290f41f2ac 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -12,7 +12,7 @@ void BgSstFloor_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Sst_Floor_InitVars = { ACTOR_BG_SST_FLOOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SST, sizeof(BgSstFloor), diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index ec0d7c3cde..18ee20f61a 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06008190; /* const ActorInit Bg_Toki_Hikari_InitVars = { ACTOR_BG_TOKI_HIKARI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(BgTokiHikari), diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 5a4cebe0be..a6067aa3d3 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -27,7 +27,7 @@ extern CutsceneData D_808BBD90[]; const ActorInit Bg_Toki_Swd_InitVars = { ACTOR_BG_TOKI_SWD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(BgTokiSwd), @@ -37,18 +37,25 @@ const ActorInit Bg_Toki_Swd_InitVars = { (ActorFunc)BgTokiSwd_Draw, }; -static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 10, 70, 0, { 0 } } -}; +static ColliderCylinderInit sCylinderInit = { { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 70, 0, { 0 } } }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x0A, - 0x0023, - 0x0064, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), @@ -63,7 +70,7 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(thisx, sInitChain); - this->actor.shape.unk_08 = 800.0f; + this->actor.shape.yOffset = 800.0f; BgTokiSwd_SetupAction(thisx, func_808BAF40); if (LINK_IS_ADULT) { @@ -76,8 +83,8 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - Collider_CylinderUpdate(thisx, &this->collider); - func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit); + Collider_UpdateCylinder(thisx, &this->collider); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); } void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -149,7 +156,7 @@ void BgTokiSwd_Update(Actor* thisx, GlobalContext* globalCtx) { BgTokiSwd* this = THIS; this->actionFunc(this, globalCtx); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index aeffc0b3ed..48a52c1a92 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -29,7 +29,7 @@ void func_808BCAF0(BgTreemouth* this, GlobalContext* globalCtx); const ActorInit Bg_Treemouth_InitVars = { ACTOR_BG_TREEMOUTH, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT04_OBJECTS, sizeof(BgTreemouth), @@ -40,7 +40,7 @@ const ActorInit Bg_Treemouth_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 5, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 8000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), @@ -69,7 +69,7 @@ void BgTreemouth_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06000E94, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); if ((gSaveContext.sceneSetupIndex < 4) && LINK_IS_CHILD) { BgTreemouth_SetupAction(this, func_808BC8B8); @@ -144,7 +144,7 @@ void func_808BC8B8(BgTreemouth* this, GlobalContext* globalCtx) { if (Flags_GetEventChkInf(0xC)) { if (func_8002E12C(&this->dyna.actor, 1658.0f, 0x7530)) { this->dyna.actor.flags |= 1; - if (this->dyna.actor.unk_10C != 0) { + if (this->dyna.actor.isTargeted) { this->dyna.actor.flags &= ~1; globalCtx->csCtx.segment = D_808BD2A0; gSaveContext.cutsceneTrigger = 1; @@ -168,9 +168,9 @@ void func_808BC9EC(BgTreemouth* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state == 3) { if (func_8002E12C(&this->dyna.actor, 350.0f, 0x7530)) { - player->actor.posRot.pos.x = 3827.0f; - player->actor.posRot.pos.y = -161.0f; - player->actor.posRot.pos.z = -1142.0f; + player->actor.world.pos.x = 3827.0f; + player->actor.world.pos.y = -161.0f; + player->actor.world.pos.z = -1142.0f; } globalCtx->csCtx.frames = 0; @@ -219,9 +219,9 @@ void BgTreemouth_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); unk_168 = this->unk_168; - thisx->posRot.pos.x = (unk_168 * -160.0f) + 4029.0f; - thisx->posRot.pos.y = (unk_168 * -399.0f) + 136.0f; - thisx->posRot.pos.z = (unk_168 * 92.0f) + -1255.0f; + thisx->world.pos.x = (unk_168 * -160.0f) + 4029.0f; + thisx->world.pos.y = (unk_168 * -399.0f) + 136.0f; + thisx->world.pos.z = (unk_168 * 92.0f) + -1255.0f; } void BgTreemouth_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index a2e97d9783..1d7a51e0ec 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -17,7 +17,7 @@ void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Umajump_InitVars = { ACTOR_BG_UMAJUMP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_UMAJUMP, sizeof(BgUmaJump), diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index 8bc1271a91..22bf754a2b 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -12,7 +12,7 @@ void BgVbSima_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Vb_Sima_InitVars = { ACTOR_BG_VB_SIMA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_FD, sizeof(BgVbSima), diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 7314922868..712c57326f 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -23,7 +23,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx); const ActorInit Bg_Ydan_Hasi_InitVars = { ACTOR_BG_YDAN_HASI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanHasi), @@ -58,9 +58,9 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); if (thisx->params == 1) { // Water the moving platform floats on in B1. Never runs in Master Quest - thisx->initPosRot.pos.y = (thisx->initPosRot.pos.y + -5.0f); - thisx->posRot.pos.y = thisx->initPosRot.pos.y; - waterBox->ySurface = thisx->initPosRot.pos.y; + thisx->home.pos.y = (thisx->home.pos.y + -5.0f); + thisx->world.pos.y = thisx->home.pos.y; + waterBox->ySurface = thisx->home.pos.y; this->actionFunc = BgYdanHasi_InitWater; } else { if (thisx->params == 0) { @@ -68,14 +68,14 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06007798, &colHeader); thisx->scale.z = 0.15f; thisx->scale.x = 0.15f; - thisx->posRot.pos.y = (waterBox->ySurface + 20.0f); + thisx->world.pos.y = (waterBox->ySurface + 20.0f); this->actionFunc = BgYdanHasi_UpdateFloatingBlock; } else { // 3 platforms on 2F CollisionHeader_GetVirtual(&D_06005780, &colHeader); thisx->draw = NULL; this->actionFunc = BgYdanHasi_SetupThreeBlocks; - Actor_SetHeight(thisx, 40.0f); + Actor_SetFocus(thisx, 40.0f); } this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); } @@ -95,12 +95,12 @@ void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx) WaterBox* waterBox; framesAfterMath = sinf((globalCtx->gameplayFrames & 0xFF) * 0.024543693f) * 165.0f; - this->dyna.actor.posRot.pos.x = - ((Math_SinS(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.x); - this->dyna.actor.posRot.pos.z = - ((Math_CosS(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.z); + this->dyna.actor.world.pos.x = + ((Math_SinS(this->dyna.actor.world.rot.y) * framesAfterMath) + this->dyna.actor.home.pos.x); + this->dyna.actor.world.pos.z = + ((Math_CosS(this->dyna.actor.world.rot.y) * framesAfterMath) + this->dyna.actor.home.pos.z); waterBox = &globalCtx->colCtx.colHeader->waterBoxes[1]; - this->dyna.actor.posRot.pos.y = waterBox->ySurface + 20.0f; + this->dyna.actor.world.pos.y = waterBox->ySurface + 20.0f; if (this->timer != 0) { this->timer--; } @@ -108,7 +108,7 @@ void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx) this->timer = 50; } posOffset = sinf(this->timer * 0.12566371f); - this->dyna.actor.posRot.pos.y = (this->dyna.actor.posRot.pos.y + (posOffset + posOffset)); + this->dyna.actor.world.pos.y = (this->dyna.actor.world.pos.y + (posOffset + posOffset)); } void BgYdanHasi_InitWater(BgYdanHasi* this, GlobalContext* globalCtx) { @@ -122,19 +122,19 @@ WaterBox* BgYdanHasi_MoveWater(BgYdanHasi* this, GlobalContext* globalCtx) { WaterBox* waterBox; if (this->timer == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f) != 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f) != 0) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->actionFunc = BgYdanHasi_InitWater; } func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 47.0f, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 47.0f, 0.5f)) { this->actionFunc = BgYdanHasi_DecWaterTimer; } func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } waterBox = globalCtx->colCtx.colHeader->waterBoxes; - globalCtx->colCtx.colHeader->waterBoxes[1].ySurface = this->dyna.actor.posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[1].ySurface = this->dyna.actor.world.pos.y; if (1) {} return waterBox + 0x1; } @@ -165,7 +165,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) { this->timer--; } if (this->timer == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 3.0f) != 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f) != 0) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->dyna.actor.draw = NULL; this->actionFunc = BgYdanHasi_SetupThreeBlocks; @@ -174,7 +174,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) { func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); return; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 3.0f) == 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 3.0f) == 0) { func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); return; } diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index c5fde6dfa4..f42995c7e3 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -23,7 +23,7 @@ void func_808BF1EC(BgYdanMaruta* this, GlobalContext* globalCtx); const ActorInit Bg_Ydan_Maruta_InitVars = { ACTOR_BG_YDAN_MARUTA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanMaruta), @@ -33,21 +33,42 @@ const ActorInit Bg_Ydan_Maruta_InitVars = { (ActorFunc)BgYdanMaruta_Draw, }; -static ColliderTrisItemInit sTrisItemInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, 0x11, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_NONE, + }, { { { 220.0f, -10.0f, 0.0f }, { 220.0f, 10.0f, 0.0f }, { -220.0f, 10.0f, 0.0f } } }, }, { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, 0x11, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_NONE, + }, { { { 16.0f, 0.0f, 0.0f }, { 16.0f, 135.0f, 0.0f }, { -16.0f, 135.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemInit, + sTrisElementsInit, }; static InitChainEntry sInitChain[] = { @@ -66,26 +87,26 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { f32 sinRotY; f32 cosRotY; CollisionHeader* colHeader = NULL; - ColliderTrisItemInit* items; + ColliderTrisElementInit* triInit; Actor_ProcessInitChain(thisx, sInitChain); Collider_InitTris(globalCtx, &this->collider); - Collider_SetTris(globalCtx, &this->collider, thisx, &sTrisInit, &this->colliderItems); + Collider_SetTris(globalCtx, &this->collider, thisx, &sTrisInit, &this->elements); this->unk_168 = thisx->params & 0xFFFF; thisx->params = (thisx->params >> 8) & 0xFF; if (thisx->params == 0) { - items = &sTrisItemInit[0]; + triInit = &sTrisElementsInit[0]; this->actionFunc = func_808BEFF4; } else { - items = &sTrisItemInit[1]; + triInit = &sTrisElementsInit[1]; DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_060066A8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - thisx->initPosRot.pos.y += -280.0f; + thisx->home.pos.y += -280.0f; if (Flags_GetSwitch(globalCtx, this->unk_168)) { - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; this->actionFunc = BgYdanMaruta_DoNothing; } else { this->actionFunc = func_808BF078; @@ -96,18 +117,18 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { cosRotY = Math_CosS(thisx->shape.rot.y); for (i = 0; i < 3; i++) { - sp4C[i].x = (items->dim.vtx[i].x * cosRotY) + thisx->posRot.pos.x; - sp4C[i].y = items->dim.vtx[i].y + thisx->posRot.pos.y; - sp4C[i].z = thisx->posRot.pos.z - (items->dim.vtx[i].x * sinRotY); + sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + thisx->world.pos.x; + sp4C[i].y = triInit->dim.vtx[i].y + thisx->world.pos.y; + sp4C[i].z = thisx->world.pos.z - (triInit->dim.vtx[i].x * sinRotY); } - func_800627A0(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); + Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); - sp4C[1].x = (items->dim.vtx[2].x * cosRotY) + thisx->posRot.pos.x; - sp4C[1].y = items->dim.vtx[0].y + thisx->posRot.pos.y; - sp4C[1].z = thisx->posRot.pos.z - (items->dim.vtx[2].x * sinRotY); + sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + thisx->world.pos.x; + sp4C[1].y = triInit->dim.vtx[0].y + thisx->world.pos.y; + sp4C[1].z = thisx->world.pos.z - (triInit->dim.vtx[2].x * sinRotY); - func_800627A0(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); + Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); } void BgYdanMaruta_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -120,23 +141,23 @@ void BgYdanMaruta_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808BEFF4(BgYdanMaruta* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { func_8002F71C(globalCtx, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f); } this->dyna.actor.shape.rot.x += 0x360; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8002F974(&this->dyna.actor, NA_SE_EV_TOGE_STICK_ROLLING - SFX_FLAG); } void func_808BF078(BgYdanMaruta* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { this->unk_16A = 20; Flags_SetSwitch(globalCtx, this->unk_168); func_80078884(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_808BF108; func_800800F8(globalCtx, 0xBC2, 0x32, &this->dyna.actor, 0); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -159,17 +180,15 @@ void func_808BF108(BgYdanMaruta* this, GlobalContext* globalCtx) { temp *= 2; } - this->dyna.actor.posRot.pos.x = - (Math_CosS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_SinS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_CosS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_SinS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.z; func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } void func_808BF1EC(BgYdanMaruta* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y += 1.0f; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_LADDER_DOUND); this->actionFunc = BgYdanMaruta_DoNothing; } diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h index 4b6af1c4c4..29bc4393d3 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h @@ -14,7 +14,7 @@ typedef struct BgYdanMaruta { /* 0x0168 */ u8 unk_168; /* 0x016A */ s16 unk_16A; /* 0x016C */ ColliderTris collider; - /* 0x018C */ ColliderTrisItem colliderItems[2]; + /* 0x018C */ ColliderTrisElement elements[2]; } BgYdanMaruta; // size = 0x0244 extern const ActorInit Bg_Ydan_Maruta_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index c3ad198afb..4cce5d3734 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06006460; /* const ActorInit Bg_Ydan_Sp_InitVars = { ACTOR_BG_YDAN_SP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanSp), @@ -27,6 +27,44 @@ const ActorInit Bg_Ydan_Sp_InitVars = { (ActorFunc)BgYdanSp_Update, (ActorFunc)BgYdanSp_Draw, }; + +static ColliderTrisElementInit D_808C0930[2] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 75.0f, -8.0f, 75.0f }, { -75.0f, -8.0f, 75.0f }, { -75.0f, -8.0f, -75.0f } } }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 140.0f, 288.79998779296875f, 0.0f }, { -140.0f, 288.0f, 0.0f }, { -140.0f, 0.0f, 0.0f } } }, + }, +}; + +static ColliderTrisInit D_808C09A8 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, + 2, + D_808C0930, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index acbf71e78f..5dedabfe46 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -38,7 +38,7 @@ static BgZgDrawFunc sDrawFuncs[] = { const ActorInit Bg_Zg_InitVars = { ACTOR_BG_ZG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZG, sizeof(BgZg), @@ -85,8 +85,8 @@ void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) { void func_808C0D08(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - thisx->posRot.pos.y += (kREG(16) + 20.0f) * 1.2f; - if ((((kREG(17) + 200.0f) * 1.2f) + thisx->initPosRot.pos.y) <= thisx->posRot.pos.y) { + thisx->world.pos.y += (kREG(16) + 20.0f) * 1.2f; + if ((((kREG(17) + 200.0f) * 1.2f) + thisx->home.pos.y) <= thisx->world.pos.y) { Actor_Kill(thisx); } } diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index e4c336bc46..f287ff3393 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -41,7 +41,7 @@ extern UNK_TYPE D_0601D934; /* const ActorInit Boss_Dodongo_InitVars = { ACTOR_EN_DODONGO, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_KINGDODONGO, sizeof(BossDodongo), @@ -50,6 +50,231 @@ const ActorInit Boss_Dodongo_InitVars = { (ActorFunc)BossDodongo_Update, (ActorFunc)BossDodongo_Draw, }; + +static ColliderJntSphElementInit D_808C7100[19] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 8500, 1200, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 33, { { 2000, -2000, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 22, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 23, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 24, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 29, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 30, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 31, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 32, { { 0, 0, 0 }, 50 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 38, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 39, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 0, 0, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 45, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 46, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 47, { { 0, 0, 0 }, 40 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808C73AC = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_808C7100, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C1190.s") diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 094a9ce29e..3c3e115a71 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,7 +12,7 @@ void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd_InitVars = { ACTOR_BOSS_FD, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD, sizeof(BossFd), @@ -21,6 +21,231 @@ const ActorInit Boss_Fd_InitVars = { (ActorFunc)BossFd_Update, (ActorFunc)BossFd_Draw, }; + +static ColliderJntSphElementInit D_808D1660[19] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 18 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 16 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 14 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 18, { { 0, 0, 0 }, 10 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808D190C = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_808D1660, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CADC0.s") diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index e07569343c..fa31868e05 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -12,7 +12,7 @@ void BossFd2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd2_InitVars = { ACTOR_BOSS_FD2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD2, sizeof(BossFd2), @@ -21,6 +21,121 @@ const ActorInit Boss_Fd2_InitVars = { (ActorFunc)BossFd2_Update, (ActorFunc)BossFd2_Draw, }; + +static ColliderJntSphElementInit D_808D5FD0[9] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 35, { { 6000, 0, 0 }, 21 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 18, { { 4000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 19, { { 3000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 20, { { 4000, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 24, { { 4000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 25, { { 3000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 26, { { 3500, 1500, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 26 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 30, { { 0, 0, 0 }, 17 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808D6114 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 9, + D_808D5FD0, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D2670.s") diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 9eb05740c6..d9dbe0aeb9 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -59,7 +59,7 @@ extern UNK_TYPE D_060114E8; /* const ActorInit Boss_Ganon_InitVars = { ACTOR_BOSS_GANON, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON, sizeof(BossGanon), @@ -68,6 +68,46 @@ const ActorInit Boss_Ganon_InitVars = { (ActorFunc)BossGanon_Update, (ActorFunc)BossGanon_Draw, }; + +static ColliderCylinderInit D_808E4C00 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 20, 80, -50, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_808E4C2C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK6, + { 0x00100700, 0x00, 0x08 }, + { 0x0D900740, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808D6870.s") diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 06118cfef6..59750dba52 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -42,7 +42,7 @@ extern UNK_TYPE D_060353C0; /* const ActorInit Boss_Ganon2_InitVars = { ACTOR_BOSS_GANON2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON2, sizeof(BossGanon2), @@ -51,6 +51,236 @@ const ActorInit Boss_Ganon2_InitVars = { (ActorFunc)BossGanon2_Update, (ActorFunc)BossGanon2_Draw, }; + +static ColliderJntSphElementInit D_80906D7C[16] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80906FBC = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_FIRST_ONLY | OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 16, + D_80906D7C, +}; + +static ColliderJntSphElementInit D_80906FCC[2] = { + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 45 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 45 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80907014 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + D_80906FCC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_808FCF40.s") diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 927ec6bad1..d2e3fe6a52 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -12,7 +12,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Ganondrof_InitVars = { ACTOR_BOSS_GANONDROF, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GND, sizeof(BossGanondrof), @@ -21,6 +21,46 @@ const ActorInit Boss_Ganondrof_InitVars = { (ActorFunc)BossGanondrof_Update, (ActorFunc)BossGanondrof_Draw, }; + +static ColliderCylinderInit D_80914CD0 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 30, 90, -50, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80914CFC = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, -20, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80910640.s") diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index cfd515eb7c..1d896cd6b8 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -12,7 +12,7 @@ void BossGoma_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Goma_InitVars = { ACTOR_BOSS_GOMA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GOMA, sizeof(BossGoma), @@ -21,6 +21,165 @@ const ActorInit Boss_Goma_InitVars = { (ActorFunc)BossGoma_Update, (ActorFunc)BossGoma_Draw, }; + +static ColliderJntSphElementInit D_8091AE60[13] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 1200 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 22, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 23, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 29, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 57, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 64, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 74, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 75, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 81, { { 0, 0, 0 }, 15 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8091B034 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 13, + D_8091AE60, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80915A10.s") diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index ad286f44b6..c57bec444f 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -12,7 +12,7 @@ void BossMo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Mo_InitVars = { ACTOR_BOSS_MO, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_MO, sizeof(BossMo), @@ -21,6 +21,251 @@ const ActorInit Boss_Mo_InitVars = { (ActorFunc)BossMo_Update, (ActorFunc)BossMo_Draw, }; + +static ColliderCylinderInit D_8092603C = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 20, 40, -20, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80925D80[19] = { + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 0 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 0 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 24 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 18 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 16 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 14 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 18, { { 0, 0, 0 }, 10 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8092602C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_80925D80, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_8091BB00.s") diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 08bbca0fb1..4d5ab239ca 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -12,7 +12,7 @@ void BossSst_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Sst_InitVars = { ACTOR_BOSS_SST, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_SST, sizeof(BossSst), @@ -21,6 +21,320 @@ const ActorInit Boss_Sst_InitVars = { (ActorFunc)BossSst_Update, (ActorFunc)BossSst_Draw, }; + +static ColliderJntSphElementInit D_80937630[11] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 1500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 75 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 5000, 0, 0 }, 120 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { -2500, 0, 0 }, 150 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 43, { { 1500, 0, 0 }, 80 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 43, { { 7500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 44, { { 3000, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 1500, 0, 0 }, 80 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 7500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 41, { { 3000, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0x00000080, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 8, { { 1500, 0, 0 }, 70 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809377BC = { + { + COLTYPE_HARD, + AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + D_80937630, +}; + +static ColliderCylinderInit D_809377CC = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 85, 100, -50, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80937494[11] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 2000, -1500, 250 }, 65 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 500, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { -250, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 500, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, { { 250, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 21, { { 500, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 25, { { 0, 0, 0 }, 27 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 26, { { 750, 0, 0 }, 26 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 750, -150, 0 }, 21 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 750, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80937620 = { + { + COLTYPE_HIT0, + AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + D_80937494, +}; + +static ColliderCylinderInit D_809377F8 = { + { + COLTYPE_NONE, + AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x04, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 85, 1, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s") diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index aca2a89971..0f29c3f27e 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -86,7 +86,7 @@ extern UNK_TYPE D_0603A2D0; /* const ActorInit Boss_Tw_InitVars = { ACTOR_BOSS_TW, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_TW, sizeof(BossTw), @@ -95,6 +95,66 @@ const ActorInit Boss_Tw_InitVars = { (ActorFunc)BossTw_Update, (ActorFunc)BossTw_Draw, }; + +static ColliderCylinderInit D_8094A7E8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ALL, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x30 }, + { 0x00100000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 25, 35, -17, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8094A814 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 45, 120, -30, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8094A840 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 45, 120, -30, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80938CD0.s") diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 9071d779c4..47acd0531d 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -50,7 +50,7 @@ extern UNK_TYPE D_060199A0; /* const ActorInit Boss_Va_InitVars = { ACTOR_BOSS_VA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_BV, sizeof(BossVa), @@ -59,6 +59,120 @@ const ActorInit Boss_Va_InitVars = { (ActorFunc)BossVa_Update, (ActorFunc)BossVa_Draw, }; + +static ColliderCylinderInit D_8095BF60 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFEF, 0x03, 0x08 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 85, 120, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_8095BF8C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 25 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8095BFB0 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_8095BF8C, +}; + +static ColliderQuadInit D_8095BFF4 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x03, 0x04 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderJntSphElementInit D_8095BFC0[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8095BFE4 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_8095BFC0, +}; + +static ColliderQuadInit D_8095BFF4 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x03, 0x04 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8094F2C0.s") diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index dea4149e46..cb9a55e3ed 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060039D0; /* const ActorInit Demo_6K_InitVars = { ACTOR_DEMO_6K, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(Demo6K), diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index add0640eac..49ed284eed 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06012014; /* const ActorInit Demo_Du_InitVars = { ACTOR_DEMO_DU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DU, sizeof(DemoDu), diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 314f8b03a1..30ceec946c 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -177,7 +177,7 @@ s32 DemoEc_UpdateSkelAnime(DemoEc* this) { } void DemoEc_UpdateBgFlags(DemoEc* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 30.0f, 25.0f, 30.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 25.0f, 30.0f, 7); } void func_8096D594(DemoEc* this, GlobalContext* globalCtx) { @@ -349,11 +349,11 @@ void DemoEc_SetNpcActionPosRot(DemoEc* this, GlobalContext* globalCtx, s32 actio CsCmdActorAction* npcAction = DemoEc_GetNpcAction(globalCtx, actionIndex); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -363,7 +363,7 @@ void DemoEc_InitIngo(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_060048F4, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_INGO; this->drawConfig = EC_DRAW_INGO; } @@ -384,7 +384,7 @@ void DemoEc_InitTalon(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600BD38, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_TALON; this->drawConfig = EC_DRAW_TALON; } @@ -405,7 +405,7 @@ void DemoEc_InitWindmillMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600196C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_WINDMILL_MAN; this->drawConfig = EC_DRAW_WINDMILL_MAN; } @@ -426,7 +426,7 @@ void DemoEc_InitKokiriBoy(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KOKIRI_BOY; this->drawConfig = EC_DRAW_KOKIRI_BOY; } @@ -437,7 +437,7 @@ void DemoEc_InitDancingKokiriBoy(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_KOKIRI_BOY; this->drawConfig = EC_DRAW_KOKIRI_BOY; } @@ -465,7 +465,7 @@ void DemoEc_InitKokiriGirl(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KOKIRI_GIRL; this->drawConfig = EC_DRAW_KOKIRI_GIRL; } @@ -476,7 +476,7 @@ void DemoEc_InitDancingKokiriGirl(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_KOKIRI_GIRL; this->drawConfig = EC_DRAW_KOKIRI_GIRL; } @@ -507,7 +507,7 @@ void DemoEc_InitOldMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_OLD_MAN; this->drawConfig = EC_DRAW_OLD_MAN; } @@ -535,7 +535,7 @@ void DemoEc_InitBeardedMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BEARDED_MAN; this->drawConfig = EC_DRAW_BEARDED_MAN; } @@ -563,7 +563,7 @@ void DemoEc_InitWoman(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_WOMAN; this->drawConfig = EC_DRAW_WOMAN; } @@ -589,7 +589,7 @@ void DemoEc_InitOldWoman(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_OLD_WOMAN; this->drawConfig = EC_DRAW_OLD_WOMAN; } @@ -610,7 +610,7 @@ void DemoEc_InitBossCarpenter(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BOSS_CARPENTER; this->drawConfig = EC_DRAW_BOSS_CARPENTER; } @@ -631,7 +631,7 @@ void DemoEc_InitCarpenter(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CARPENTER; this->drawConfig = EC_DRAW_CARPENTER; } @@ -704,7 +704,7 @@ void DemoEc_InitGerudo(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06002254, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_GERUDO; this->drawConfig = EC_DRAW_GERUDO; } @@ -755,7 +755,7 @@ void DemoEc_InitDancingZora(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600C918, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_ZORA; this->drawConfig = EC_DRAW_DANCING_ZORA; } @@ -781,7 +781,7 @@ void DemoEc_InitKingZora(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06006C40, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KING_ZORA; this->drawConfig = EC_DRAW_KING_ZORA; DemoEc_SetEyeTexIndex(this, 3); @@ -866,7 +866,7 @@ void DemoEc_InitMido(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_060095DC, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MIDO; this->drawConfig = EC_DRAW_MIDO; DemoEc_SetEyeTexIndex(this, 3); @@ -942,7 +942,7 @@ void DemoEc_InitCucco(DemoEc* this, GlobalContext* globalCtx) { DemoEc_ChangeAnimation(this, animation, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CUCCO; this->drawConfig = EC_DRAW_CUCCO; } @@ -963,7 +963,7 @@ void DemoEc_InitCuccoLady(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06000CD8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CUCCO_LADY; this->drawConfig = EC_DRAW_CUCCO_LADY; } @@ -989,7 +989,7 @@ void DemoEc_InitPotionShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_POTION_SHOP_OWNER; this->drawConfig = EC_DRAW_POTION_SHOP_OWNER; } @@ -1015,7 +1015,7 @@ void DemoEc_InitMaskShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MASK_SHOP_OWNER; this->drawConfig = EC_DRAW_MASK_SHOP_OWNER; } @@ -1036,7 +1036,7 @@ void DemoEc_InitFishingMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_FISHING_MAN; this->drawConfig = EC_DRAW_FISHING_MAN; } @@ -1071,7 +1071,7 @@ void DemoEc_InitBombchuShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BOMBCHU_SHOP_OWNER; this->drawConfig = EC_DRAW_BOMBCHU_SHOP_OWNER; } @@ -1121,7 +1121,7 @@ void DemoEc_InitGorons(DemoEc* this, GlobalContext* globalCtx) { scale->z *= goronScale; func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_GORON; this->drawConfig = EC_DRAW_GORON; } @@ -1147,7 +1147,7 @@ void DemoEc_InitMalon(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06009EE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MALON; this->drawConfig = EC_DRAW_MALON; } @@ -1332,7 +1332,7 @@ void DemoEc_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Ec_InitVars = { ACTOR_DEMO_EC, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_EC, sizeof(DemoEc), diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 1125f737e8..70962d802f 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -78,7 +78,7 @@ extern SkelCurveLimbList D_060012E8; // timewarpLimbList const ActorInit Demo_Effect_InitVars = { ACTOR_DEMO_EFFECT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoEffect), @@ -417,16 +417,16 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.020f); crystalLight = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_CRYSTAL_LIGHT); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_CRYSTAL_LIGHT); if (crystalLight != NULL) { Actor_SetScale(&crystalLight->actor, 0.6f); } lightRing = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, &crystalLight->actor, globalCtx2, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_TRIFORCE); + &globalCtx2->actorCtx, &crystalLight->actor, globalCtx2, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_TRIFORCE); if (lightRing != NULL) { Actor_SetScale(&lightRing->actor, 0.4f); @@ -503,7 +503,7 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { this->jewel.type = DEMO_EFFECT_JEWEL_ZORA; this->jewel.isPositionInit = 0; DemoEffect_InitJewel(globalCtx, this); - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTOR_EN_DOOR); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTOR_EN_DOOR); if ((globalCtx->sceneNum == SCENE_BDAN) && (gSaveContext.infTable[20] & 0x20)) { Actor_Kill(&this->actor); return; @@ -561,9 +561,9 @@ void DemoEffect_Wait(DemoEffect* this, GlobalContext* globalCtx) { void DemoEffect_UpdatePositionToParent(DemoEffect* this, GlobalContext* globalCtx) { if (this->actor.parent != NULL) { // Struct copy affects regalloc - this->actor.posRot.pos.x = this->actor.parent->posRot.pos.x; - this->actor.posRot.pos.y = this->actor.parent->posRot.pos.y; - this->actor.posRot.pos.z = this->actor.parent->posRot.pos.z; + this->actor.world.pos.x = this->actor.parent->world.pos.x; + this->actor.world.pos.y = this->actor.parent->world.pos.y; + this->actor.world.pos.z = this->actor.parent->world.pos.z; } } @@ -575,7 +575,7 @@ void DemoEffect_UpdatePositionToParent(DemoEffect* this, GlobalContext* globalCt */ void DemoEffect_UpdateCrystalLight(DemoEffect* this, GlobalContext* globalCtx) { DemoEffect_UpdatePositionToParent(this, globalCtx); - this->actor.posRot.pos.y += 14.0f; + this->actor.world.pos.y += 14.0f; } /** @@ -611,9 +611,9 @@ void DemoEffect_MedalSparkle(DemoEffect* this, GlobalContext* globalCtx, s32 isS velocity.z = (Rand_ZeroOne() - 0.5f) * 2.0f; } - pos.x = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.x; - pos.y = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.z; + pos.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x; + pos.y = Rand_CenteredFloat(10.0f) + this->actor.world.pos.y; + pos.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 1000, 16); } @@ -929,8 +929,8 @@ void DemoEffect_UpdateLightRingTriforce(DemoEffect* this, GlobalContext* globalC if (globalCtx->csCtx.npcActions[this->csActionId] != NULL && globalCtx->csCtx.npcActions[this->csActionId]->action == 2) { blueOrb = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); if (blueOrb != NULL) { Actor_SetScale(&blueOrb->actor, 0.0f); @@ -959,22 +959,21 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, GlobalContext* globalCt return; } - effect = - (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.0f); } - effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_EXPANDING); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.1f); } - effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_SHRINKING); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.2f); @@ -992,7 +991,7 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, GlobalContext* globalCt void DemoEffect_InitCreationFireball(DemoEffect* this, GlobalContext* globalCtx) { Actor* parent = this->actor.parent; - this->actor.posRot.rot.y = parent->shape.rot.y; + this->actor.world.rot.y = parent->shape.rot.y; this->fireBall.timer = 50; this->actor.speedXZ = 1.5f; this->actor.minVelocityY = -1.5f; @@ -1158,8 +1157,8 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[this->csActionId]->action == 3) { fireBall = (DemoEffect*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_FIRE_BALL); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_FIRE_BALL); if (fireBall != NULL) { fireBall->initUpdateFunc = DemoEffect_InitCreationFireball; @@ -1212,9 +1211,9 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, GlobalContext* globalCtx) { } else { this->godLgt.lightRingSpawnTimer = this->godLgt.lightRingSpawnDelay; lightRing = (DemoEffect*)Actor_Spawn( - &globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.posRot.rot.x + 0x4000, - this->actor.posRot.rot.y, this->actor.posRot.rot.z, DEMO_EFFECT_LIGHTRING_EXPANDING); + &globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x + 0x4000, + this->actor.world.rot.y, this->actor.world.rot.z, DEMO_EFFECT_LIGHTRING_EXPANDING); if (lightRing != NULL) { Actor_SetScale(&lightRing->actor, 1.0f); @@ -1269,8 +1268,8 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[this->csActionId]->action == 3) { lgtShower = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y - 150.0f, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_LGT_SHOWER); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y - 150.0f, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LGT_SHOWER); if (lgtShower != NULL) { lgtShower->actor.scale.x = 0.23f; @@ -1310,9 +1309,9 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, GlobalContext* globalCtx) { * Moves this actor towards the target position with a given speed. */ void DemoEffect_MoveTowardTarget(Vec3f targetPos, DemoEffect* this, f32 speed) { - this->actor.posRot.pos.x += (targetPos.x - this->actor.posRot.pos.x) * speed; - this->actor.posRot.pos.y += (targetPos.y - this->actor.posRot.pos.y) * speed; - this->actor.posRot.pos.z += (targetPos.z - this->actor.posRot.pos.z) * speed; + this->actor.world.pos.x += (targetPos.x - this->actor.world.pos.x) * speed; + this->actor.world.pos.y += (targetPos.y - this->actor.world.pos.y) * speed; + this->actor.world.pos.z += (targetPos.z - this->actor.world.pos.z) * speed; } /** @@ -1395,15 +1394,15 @@ void DemoEffect_SetJewelColor(DemoEffect* this, f32 alpha) { * Moves the Jewel Actor during the activation of the Door of Time cutscene. * This is used once the Jewel Actor is done orbiting Link and split up to move into the pedastal slots. */ -void DemoEffect_MoveJewelSplit(PosRot* posRot, DemoEffect* this) { +void DemoEffect_MoveJewelSplit(PosRot* world, DemoEffect* this) { switch (this->jewel.type) { case DEMO_EFFECT_JEWEL_KOKIRI: - posRot->pos.x -= 40.0f; + world->pos.x -= 40.0f; break; case DEMO_EFFECT_JEWEL_GORON: break; case DEMO_EFFECT_JEWEL_ZORA: - posRot->pos.x += 40.0f; + world->pos.x += 40.0f; break; } } @@ -1424,25 +1423,25 @@ void DemoEffect_MoveJewelSpherical(f32 degrees, f32 frameDivisor, Vec3f startPos distance = frameDivisor * sqrtf(SQ(endPos.x - startPos.x) + SQ(endPos.y - startPos.y) + SQ(endPos.z - startPos.z)); - this->actor.posRot.pos.x = radius * cosf(degrees * (M_PI / 180.0f)); - this->actor.posRot.pos.y = distance; - this->actor.posRot.pos.z = radius * sinf(degrees * (M_PI / 180.0f)); + this->actor.world.pos.x = radius * cosf(degrees * (M_PI / 180.0f)); + this->actor.world.pos.y = distance; + this->actor.world.pos.z = radius * sinf(degrees * (M_PI / 180.0f)); - xPos = this->actor.posRot.pos.x; - ySpherical = (this->actor.posRot.pos.y * cosf(rotation.x * (M_PI / 0x8000))) - - (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.posRot.pos.z); - xzSpherical = (this->actor.posRot.pos.z * cosf(rotation.x * (M_PI / 0x8000))) + - (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.posRot.pos.y); + xPos = this->actor.world.pos.x; + ySpherical = (this->actor.world.pos.y * cosf(rotation.x * (M_PI / 0x8000))) - + (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.world.pos.z); + xzSpherical = (this->actor.world.pos.z * cosf(rotation.x * (M_PI / 0x8000))) + + (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.world.pos.y); - this->actor.posRot.pos.x = + this->actor.world.pos.x = (xPos * cosf(rotation.y * (M_PI / 0x8000))) - (sinf(rotation.y * (M_PI / 0x8000)) * xzSpherical); - this->actor.posRot.pos.y = ySpherical; - this->actor.posRot.pos.z = + this->actor.world.pos.y = ySpherical; + this->actor.world.pos.z = (xzSpherical * cosf(rotation.y * (M_PI / 0x8000))) + (sinf(rotation.y * (M_PI / 0x8000)) * xPos); - this->actor.posRot.pos.x += startPos.x; - this->actor.posRot.pos.y += startPos.y; - this->actor.posRot.pos.z += startPos.z; + this->actor.world.pos.x += startPos.x; + this->actor.world.pos.y += startPos.y; + this->actor.world.pos.z += startPos.z; } /** @@ -1527,7 +1526,7 @@ void DemoEffect_JewelSparkle(DemoEffect* this, GlobalContext* globalCtx, s32 spa velocity.x = (Rand_ZeroOne() - 0.5f) * 1.5f; velocity.z = (Rand_ZeroOne() - 0.5f) * 1.5f; - EffectSsKiraKira_SpawnDispersed(globalCtx, &this->actor.posRot.pos, &velocity, &accel, &primColor, &envColor, + EffectSsKiraKira_SpawnDispersed(globalCtx, &this->actor.world.pos, &velocity, &accel, &primColor, &envColor, 3000, 16); } } @@ -1586,13 +1585,13 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, GlobalContext* globalCtx) { case 4: if (this->jewel.isPositionInit) { DemoEffect_MoveToCsEndpoint(this, globalCtx, this->csActionId, 0); - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); if ((globalCtx->gameplayFrames & 1) == 0) { DemoEffect_JewelSparkle(this, globalCtx, 1); } } else { DemoEffect_InitPositionFromCsAction(this, globalCtx, this->csActionId); - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); this->jewel.isPositionInit = 1; } break; @@ -1602,7 +1601,7 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, GlobalContext* globalCtx) { default: DemoEffect_MoveToCsEndpoint(this, globalCtx, this->csActionId, 0); if (gSaveContext.entranceIndex == 0x0053) { - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); } break; } @@ -1635,7 +1634,7 @@ void DemoEffect_UpdateDust(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state != 0 && globalCtx->csCtx.npcActions[this->csActionId] != NULL && globalCtx->csCtx.npcActions[this->csActionId]->action == 2) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += 600.0f; pos.x += Rand_CenteredFloat(300.0f); @@ -2131,9 +2130,9 @@ void DemoEffect_MoveToCsEndpoint(DemoEffect* this, GlobalContext* globalCtx, s32 speed = DemoEffect_InterpolateCsFrames(globalCtx, csActionId); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * speed) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * speed) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * speed) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * speed) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * speed) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * speed) + startPos.z; if (shouldUpdateFacing) { DemoEffect_FaceToCsEndpoint(this, startPos, endPos); @@ -2159,7 +2158,7 @@ void DemoEffect_InitPositionFromCsAction(DemoEffect* this, GlobalContext* global f32 y = globalCtx->csCtx.npcActions[csActionIndex]->startPos.y; f32 z = globalCtx->csCtx.npcActions[csActionIndex]->startPos.z; - this->actor.posRot.pos.x = x; - this->actor.posRot.pos.y = y; - this->actor.posRot.pos.z = z; + this->actor.world.pos.x = x; + this->actor.world.pos.y = y; + this->actor.world.pos.z = z; } diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index b648a96756..31d2df022a 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -69,10 +69,10 @@ void DemoExt_SetupMaintainVortex(DemoExt* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = DemoExt_GetNpcAction(globalCtx, 5); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } this->action = EXT_MAINTAIN; this->drawMode = EXT_DRAW_VORTEX; @@ -238,7 +238,7 @@ void DemoExt_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Ext_InitVars = { ACTOR_DEMO_EXT, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FHG, sizeof(DemoExt), diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 0f1f01ba54..0f990bd49d 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -45,7 +45,7 @@ static DemoGeffDrawFunc sDrawFuncs[] = { const ActorInit Demo_Geff_InitVars = { ACTOR_DEMO_GEFF, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GEFF, sizeof(DemoGeff), @@ -137,7 +137,7 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) { Actor* propIt; if (this->demoGt == NULL) { - propIt = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + propIt = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; if ((this->actor.params != 0) && (this->actor.params != 1) && (this->actor.params != 2)) { targetParams = 2; } else { @@ -145,9 +145,9 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) { } while (propIt != NULL) { if (propIt->id == ACTOR_DEMO_GT && propIt->params == targetParams) { - this->deltaPosX = this->actor.posRot.pos.x - propIt->posRot.pos.x; - this->deltaPosY = this->actor.posRot.pos.y - propIt->posRot.pos.y; - this->deltaPosZ = this->actor.posRot.pos.z - propIt->posRot.pos.z; + this->deltaPosX = this->actor.world.pos.x - propIt->world.pos.x; + this->deltaPosY = this->actor.world.pos.y - propIt->world.pos.y; + this->deltaPosZ = this->actor.world.pos.z - propIt->world.pos.z; this->demoGt = propIt; } propIt = propIt->next; @@ -159,9 +159,9 @@ void func_809782A0(DemoGeff* this, GlobalContext* globalCtx) { DemoGt* demoGt = this->demoGt; s16 params = this->actor.params; if (demoGt != NULL && (params != 6) && (params != 7) && (params != 8)) { - this->actor.posRot.pos.x = demoGt->dyna.actor.posRot.pos.x + this->deltaPosX; - this->actor.posRot.pos.y = demoGt->dyna.actor.posRot.pos.y + this->deltaPosY; - this->actor.posRot.pos.z = demoGt->dyna.actor.posRot.pos.z + this->deltaPosZ; + this->actor.world.pos.x = demoGt->dyna.actor.world.pos.x + this->deltaPosX; + this->actor.world.pos.y = demoGt->dyna.actor.world.pos.y + this->deltaPosY; + this->actor.world.pos.z = demoGt->dyna.actor.world.pos.z + this->deltaPosZ; } } diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 1f18593df2..6c2d878225 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -30,7 +30,7 @@ extern UNK_TYPE D_06003AF0; /* const ActorInit Demo_Gj_InitVars = { ACTOR_DEMO_GJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GJ, sizeof(DemoGj), @@ -39,6 +39,63 @@ const ActorInit Demo_Gj_InitVars = { (ActorFunc)DemoGj_Update, (ActorFunc)DemoGj_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 100, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 25, 110, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 25, 200, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_80978930.s") diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index aa2e15d050..fe32fd58f3 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -40,7 +40,7 @@ static DemoGoDrawFunc D_8097D468[] = { const ActorInit Demo_Go_InitVars = { ACTOR_DEMO_GO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(DemoGo), @@ -81,7 +81,7 @@ void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) { Vec3f* sp1C; if ((thisx->params == 0) || (thisx->params == 1)) { - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &thisx->posRot.pos, &sp20, &sp1C); + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &thisx->world.pos, &sp20, &sp1C); Audio_PlaySoundAtPosition(globalCtx, &sp20, 20, NA_SE_EV_OBJECT_FALL); } } @@ -118,19 +118,19 @@ void func_8097C9DC(DemoGo* this) { } void func_8097CA30(DemoGo* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } void func_8097CA78(DemoGo* this, GlobalContext* globalCtx) { s16 pad; - Vec3f vec = this->actor.posRot.pos; + Vec3f vec = this->actor.world.pos; func_80033480(globalCtx, &vec, kREG(11) + 100.0f, kREG(12) + 0xA, kREG(13) + 0x12C, kREG(14), 0); func_8097C9B8(this); } void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - PosRot* posRot = &thisx->posRot; + PosRot* world = &thisx->world; CutsceneContext* csCtx = &globalCtx->csCtx; CsCmdActorAction* npcAction; f32 temp_ret; @@ -148,10 +148,10 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) { endPos.x = npcAction->endPos.x; endPos.y = npcAction->endPos.y; endPos.z = npcAction->endPos.z; - posRot->pos.x = (((endPos.x - startPos.x) * temp_ret) + startPos.x); - posRot->pos.y = (((endPos.y - startPos.y) * temp_ret) + startPos.y); - posRot->pos.z = (((endPos.z - startPos.z) * temp_ret) + startPos.z); - posRot->rot.y = thisx->shape.rot.y = npcAction->rot.y; + world->pos.x = (((endPos.x - startPos.x) * temp_ret) + startPos.x); + world->pos.y = (((endPos.y - startPos.y) * temp_ret) + startPos.y); + world->pos.z = (((endPos.z - startPos.z) * temp_ret) + startPos.z); + world->rot.y = thisx->shape.rot.y = npcAction->rot.y; } } } @@ -180,7 +180,7 @@ void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state != 0) { npcAction = globalCtx->csCtx.npcActions[func_8097C870(this)]; if (npcAction != NULL) { - thisRotY = thisx->posRot.rot.y; + thisRotY = thisx->world.rot.y; rotYDelta = npcAction->rot.y - thisRotY; if ((rotYDelta > -(kREG(16) + 0x96)) && (rotYDelta < kREG(16) + 0x96)) { newRotY = npcAction->rot.y; @@ -190,7 +190,7 @@ void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) { newRotY = (thisRotY - kREG(16)) - 0x96; } thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; } } } @@ -318,7 +318,7 @@ void DemoGo_Init(Actor* thisx, GlobalContext* globalCtx) { DemoGo* this = THIS; AnimationHeader* animation = &D_06004930; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600FEF0, NULL, NULL, NULL, 0); Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); this->action = 0; diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 60c4a3ad8a..6bf57baef8 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -334,7 +334,7 @@ u8 func_8097E704(GlobalContext* globalCtx, u16 arg1, s32 arg2) { void func_8097E744(DemoGt* this, GlobalContext* globalCtx, u32 actionIdx) { CsCmdActorAction* npcAction = DemoGt_GetNpcAction(globalCtx, actionIdx); - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -362,7 +362,7 @@ void func_8097E824(DemoGt* this, s32 arg1) { s16 phi_a1; s16 phi_a2; s16 phi_a3; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3s* unk16C = &this->unk_16C; s32 pad; f32 tempf3; @@ -513,7 +513,7 @@ void func_8097EF40(DemoGt* this, GlobalContext* globalCtx) { Vec3f dustPos; Vec3f velocity = { 0.0f, -16.0f, 0.0f }; Vec3f accel = { 0.0f, 1.20000004768f, 0.0f }; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; s32 pad; if ((kREG(1) == 20) || (frames == 220)) { @@ -540,16 +540,16 @@ void func_8097F0AC(DemoGt* this, GlobalContext* globalCtx) { s32 pad2; if ((frames == 140) || (kREG(1) == 19)) { - sp38.x = this->dyna.actor.posRot.pos.x + 260.0f; - sp38.y = this->dyna.actor.posRot.pos.y + 340.0f; - sp38.z = this->dyna.actor.posRot.pos.z + 45.0f; + sp38.x = this->dyna.actor.world.pos.x + 260.0f; + sp38.y = this->dyna.actor.world.pos.y + 340.0f; + sp38.z = this->dyna.actor.world.pos.z + 45.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &sp38, 2.0f); } if (frames == 176) { - sp24.x = this->dyna.actor.posRot.pos.x + 260.0f; - sp24.y = this->dyna.actor.posRot.pos.y + 840.0f; - sp24.z = this->dyna.actor.posRot.pos.z + 45.0f; + sp24.x = this->dyna.actor.world.pos.x + 260.0f; + sp24.y = this->dyna.actor.world.pos.y + 840.0f; + sp24.z = this->dyna.actor.world.pos.z + 45.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &sp24, 2.0f); } } @@ -720,17 +720,17 @@ void func_8097F96C(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if (((frames > 1059) && (frames < 1062)) || kREG(1) == 17) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 612.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 612.0f; + pos.z = this->dyna.actor.world.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 2); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -739,7 +739,7 @@ void func_8097FA1C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { -12.0f, -17.0, 5.0 }; s32 pad1[3]; @@ -765,7 +765,7 @@ void func_8097FAFC(DemoGt* this, GlobalContext* globalCtx) { f32 new_var = -200.0; if (((frames > 582) && (frames < 683)) || (kREG(1) == 6)) { - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 680.0f; if (frames == 682) { @@ -782,7 +782,7 @@ void func_8097FC1C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -800,9 +800,9 @@ void func_8097FCE4(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if (frames == 0x1F7 || kREG(1) == 4) { - vec.x = this->dyna.actor.posRot.pos.x + 300.0f; - vec.y = this->dyna.actor.posRot.pos.y + 560.0f; - vec.z = this->dyna.actor.posRot.pos.z - 377.0f; + vec.x = this->dyna.actor.world.pos.x + 300.0f; + vec.y = this->dyna.actor.world.pos.y + 560.0f; + vec.z = this->dyna.actor.world.pos.z - 377.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &vec, 2.0f); } } @@ -900,17 +900,17 @@ void func_80980184(DemoGt* this, GlobalContext* globalCtx) { Actor* actor; if ((globalCtx->csCtx.frames > 1027) && (globalCtx->csCtx.frames < 1031)) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 247.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 247.0f; + pos.z = this->dyna.actor.world.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 3); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -922,17 +922,17 @@ void func_80980218(DemoGt* this, GlobalContext* globalCtx) { Actor* actor; if ((globalCtx->csCtx.frames > 997) && (globalCtx->csCtx.frames < 1001)) { - pos.x = this->dyna.actor.initPosRot.pos.x; - pos.y = this->dyna.actor.initPosRot.pos.y + 38.0f; - pos.z = this->dyna.actor.initPosRot.pos.z; + pos.x = this->dyna.actor.home.pos.x; + pos.y = this->dyna.actor.home.pos.y + 38.0f; + pos.z = this->dyna.actor.home.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 4); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -941,7 +941,7 @@ void func_809802AC(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 0.0f, 0.0f, -10.0f }; s32 pad1[3]; @@ -957,14 +957,14 @@ void func_8098036C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* posRot = &this->dyna.actor.posRot.pos; + Vec3f* world = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; s32 pad1[3]; if ((frames > 284) && (frames < 421)) { - dustPos.x = posRot->x + 760.0f; - dustPos.y = posRot->y - 40.0f; - dustPos.z = posRot->z - 240.0f; + dustPos.x = world->x + 760.0f; + dustPos.y = world->y - 40.0f; + dustPos.z = world->z - 240.0f; func_8097D7D8(globalCtx, &dustPos, &velOffset, 6.0f, 6, 1, 35); } } @@ -973,7 +973,7 @@ void func_80980430(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; s32 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; s32 pad1[3]; @@ -989,7 +989,7 @@ void func_80980504(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1005,7 +1005,7 @@ void func_809805D8(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* homePos = &this->dyna.actor.initPosRot.pos; + Vec3f* homePos = &this->dyna.actor.home.pos; Vec3f velOffset = { 15.0f, -26.0, 0.0f }; s32 pad1[3]; @@ -1021,7 +1021,7 @@ void func_809806B8(DemoGt* this, GlobalContext* globalContext) { s32 pad[3]; Vec3f dustPos; u16 frames = globalContext->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1037,7 +1037,7 @@ void func_8098078C(DemoGt* this, GlobalContext* globalContext) { s32 pad[3]; Vec3f dustPos; u16 frames = globalContext->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1053,7 +1053,7 @@ void func_8098085C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f sp28; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; if ((frames == 58) || (kREG(1) == 1)) { sp28.x = pos->x + 900.0f; @@ -1086,9 +1086,9 @@ void func_809809C0(DemoGt* this, GlobalContext* globalCtx) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; s16 pad2[3]; - sp54.x = this2->dyna.actor.posRot.pos.x + 790.0f; - sp54.y = this2->dyna.actor.posRot.pos.y + 60.0f; - sp54.z = this2->dyna.actor.posRot.pos.z + 23.0f; + sp54.x = this2->dyna.actor.world.pos.x + 790.0f; + sp54.y = this2->dyna.actor.world.pos.y + 60.0f; + sp54.z = this2->dyna.actor.world.pos.z + 23.0f; if (ABS(gameplayFrames % 12) == 0) { DemoGt_SpawnExplosionNoSound(globalCtx2, &sp54, &sp40, &sp34, 2.0f); @@ -1102,9 +1102,9 @@ void func_80980AD4(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 477) || (kREG(2) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 790.0f; - pos.y = this->dyna.actor.posRot.pos.y + 60.0f; - pos.z = this->dyna.actor.posRot.pos.z + 23.0f; + pos.x = this->dyna.actor.world.pos.x + 790.0f; + pos.y = this->dyna.actor.world.pos.y + 60.0f; + pos.z = this->dyna.actor.world.pos.z + 23.0f; func_8097DAC8(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); @@ -1117,9 +1117,9 @@ void func_80980B68(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 317) || (kREG(3) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 980.0f; - pos.y = this->dyna.actor.posRot.pos.y + 410.0f; - pos.z = this->dyna.actor.posRot.pos.z - 177.0f; + pos.x = this->dyna.actor.world.pos.x + 980.0f; + pos.y = this->dyna.actor.world.pos.y + 410.0f; + pos.z = this->dyna.actor.world.pos.z - 177.0f; func_8097DD28(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); } @@ -1131,9 +1131,9 @@ void func_80980BFC(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 740) || (kREG(4) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 790.0f; - pos.y = this->dyna.actor.posRot.pos.y + 60.0f; - pos.z = this->dyna.actor.posRot.pos.z + 23.0f; + pos.x = this->dyna.actor.world.pos.x + 790.0f; + pos.y = this->dyna.actor.world.pos.y + 60.0f; + pos.z = this->dyna.actor.world.pos.z + 23.0f; func_8097DF70(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); @@ -1783,7 +1783,7 @@ void DemoGt_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Gt_InitVars = { ACTOR_DEMO_GT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GT, sizeof(DemoGt), diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 1aea5a3b2f..f974cb2461 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -32,7 +32,7 @@ extern UNK_TYPE D_06000900; /* const ActorInit Demo_Ik_InitVars = { ACTOR_DEMO_IK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IK, sizeof(DemoIk), diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 6af3c9bb64..506f27fa2f 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -59,8 +59,14 @@ static UNK_PTR D_80987830[] = { static u32 D_8098783C = 0; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -85,7 +91,7 @@ static DemoImDrawFunc sDrawFuncs[] = { const ActorInit Demo_Im_InitVars = { ACTOR_DEMO_IM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IM, sizeof(DemoIm), @@ -129,7 +135,7 @@ void func_80984C68(DemoIm* this) { this->drawConfig = 0; this->unk_26C = 0; this->unk_270 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_268 = 0.0f; } @@ -154,7 +160,7 @@ void func_80984D00(Actor* thisx, GlobalContext* globalCtx) { DemoIm* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80984D4C(Actor* thisx, GlobalContext* globalCtx) { @@ -166,7 +172,7 @@ void func_80984D4C(Actor* thisx, GlobalContext* globalCtx) { void func_80984D74(DemoIm* this, GlobalContext* globalCtx) { s32 pad[5]; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -187,10 +193,10 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) { s16 yawDiff; s16 phi_a3; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 4.0f; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; phi_a3 = (ABS(yawDiff) < 0x18E3) ? 2 : 1; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, phi_a3); } @@ -198,7 +204,7 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) { void func_80984F10(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 12.0f; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 2); @@ -207,13 +213,13 @@ void func_80984F10(DemoIm* this, GlobalContext* globalCtx) { void func_80984F94(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 4.0f; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 4); } void func_80985018(DemoIm* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80985060(DemoIm* this) { @@ -263,10 +269,10 @@ void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -274,10 +280,10 @@ void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -302,22 +308,22 @@ void func_80985280(DemoIm* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 tr void func_80985310(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void func_80985358(DemoIm* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_809853B4(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerY = player->actor.posRot.pos.y + 80.0f; - f32 playerZ = player->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerY = player->actor.world.pos.y + 80.0f; + f32 playerZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0, 0, 0, 0xD); @@ -325,7 +331,7 @@ void func_809853B4(DemoIm* this, GlobalContext* globalCtx) { } void func_80985430(DemoIm* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 250.0f / 3.0f; + this->actor.shape.yOffset += 250.0f / 3.0f; } void func_8098544C(DemoIm* this, GlobalContext* globalCtx) { @@ -338,7 +344,7 @@ void func_8098544C(DemoIm* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_8098786C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_SHADOW); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -354,9 +360,9 @@ void func_809854DC(DemoIm* this, GlobalContext* globalCtx) { } void func_8098557C(DemoIm* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -432,7 +438,7 @@ void func_80985830(DemoIm* this, GlobalContext* globalCtx) { void func_80985860(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_809858A8(void) { @@ -440,8 +446,8 @@ void func_809858A8(void) { } void func_809858C8(DemoIm* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - (kREG(17) + 24.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 6); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + (kREG(17) + 24.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 6); } void func_80985948(DemoIm* this, GlobalContext* globalCtx) { @@ -451,7 +457,7 @@ void func_80985948(DemoIm* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->unk_26C = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_268 = 0.0f; func_809858A8(); } @@ -467,7 +473,7 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) { this->action = 9; this->drawConfig = 1; *unk_268 = kREG(5) + 10.0f; - this->unk_26C = this->actor.shape.unk_14 = alpha; + this->unk_26C = this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -477,11 +483,11 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_268 = 0.0f; this->unk_26C = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } - this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f; + this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f; } void func_80985B34(DemoIm* this, GlobalContext* globalCtx) { @@ -496,7 +502,7 @@ void func_80985B34(DemoIm* this, GlobalContext* globalCtx) { func_809858C8(this, globalCtx); this->unk_270 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -724,7 +730,7 @@ void func_80986570(DemoIm* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(&this->skelAnime, 7.0f)) && (this->actor.bgCheckFlags & 1)) { u32 sfxId = SFX_FLAG; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } @@ -737,7 +743,7 @@ void func_809865F8(DemoIm* this, GlobalContext* globalCtx, s32 arg2) { if (*unk_278 >= 0.0f) { if (this->unk_27C == 0) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; s16 shapeRotY = this->actor.shape.rot.y; f32 spawnPosX = thisPos->x + (Math_SinS(shapeRotY) * 30.0f); f32 spawnPosY = thisPos->y; @@ -827,13 +833,13 @@ void func_80986948(DemoIm* this, GlobalContext* globalCtx) { void func_809869B0(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 18; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerPosX = player->actor.posRot.pos.x; - f32 thisPosX = this->actor.posRot.pos.x; + f32 playerPosX = player->actor.world.pos.x; + f32 thisPosX = this->actor.world.pos.x; if ((thisPosX - (kREG(16) + 30.0f) > playerPosX) && (!(this->actor.flags & 0x40))) { return 1; @@ -843,8 +849,8 @@ s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) { s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerPosX = player->actor.posRot.pos.x; - f32 thisPosX = this->actor.posRot.pos.x; + f32 playerPosX = player->actor.world.pos.x; + f32 thisPosX = this->actor.world.pos.x; if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) { return 1; @@ -879,7 +885,7 @@ void func_80986BA0(DemoIm* this, GlobalContext* globalCtx) { this->action = 21; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -894,7 +900,7 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) { this->action = 24; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -913,7 +919,7 @@ void func_80986CC8(DemoIm* this) { this->action = 26; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -998,7 +1004,7 @@ void func_80987018(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 27; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80987064(DemoIm* this) { @@ -1010,9 +1016,9 @@ void func_80987064(DemoIm* this) { temp = kREG(17) + 10.0f; if (*unk_268 >= temp) { - this->actor.shape.unk_14 = this->unk_26C = alpha; + this->actor.shape.shadowAlpha = this->unk_26C = alpha; } else { - this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / temp) * 255.0f; + this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / temp) * 255.0f; } } @@ -1104,7 +1110,7 @@ void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx) { void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) { DemoIm* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); func_80984D00(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600F788, NULL, this->jointTable, this->morphTable, 17); thisx->flags &= ~1; @@ -1170,12 +1176,12 @@ void func_809875C0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Vec3f dest; Matrix_MultVec3f(&sp28, &dest); - this->actor.posRot2.pos.x = dest.x; - this->actor.posRot2.pos.y = dest.y; - this->actor.posRot2.pos.z = dest.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = dest.x; + this->actor.focus.pos.y = dest.y; + this->actor.focus.pos.z = dest.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index f3f5aa370a..8225aa46d5 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06008390; /* const ActorInit Demo_Kankyo_InitVars = { ACTOR_DEMO_KANKYO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoKankyo), diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 9d8ffb9a95..7d37fc17dd 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06005CB0; /* const ActorInit Demo_Kekkai_InitVars = { ACTOR_DEMO_KEKKAI, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(DemoKekkai), @@ -27,6 +27,26 @@ const ActorInit Demo_Kekkai_InitVars = { (ActorFunc)DemoKekkai_Update, (ActorFunc)DemoKekkai_Draw, }; + +static ColliderCylinderInit D_8098E0B0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x07, 0x04 }, + { 0x00002000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 680, 220, 120, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098CFD0.s") diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 47d44c19f2..f224bffec6 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -70,7 +70,7 @@ static DemoSaDrawFunc sDrawFuncs[] = { const ActorInit Demo_Sa_InitVars = { ACTOR_DEMO_SA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SA, sizeof(DemoSa), @@ -128,7 +128,7 @@ void func_8098E530(DemoSa* this) { this->drawConfig = 0; this->alpha = 0; this->unk_1A8 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_1A0 = 0.0f; } @@ -148,7 +148,7 @@ void func_8098E554(DemoSa* this, GlobalContext* globalCtx) { } void func_8098E5C8(DemoSa* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 DemoSa_FrameUpdateMatrix(DemoSa* this) { @@ -184,10 +184,10 @@ void func_8098E6EC(DemoSa* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = DemoSa_GetNpcAction(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -213,25 +213,25 @@ void func_8098E76C(DemoSa* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 tr void func_8098E7FC(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_060021D8, NULL, NULL, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; func_8098E508(this, 1); func_8098E51C(this, 0); } void func_8098E86C(DemoSa* this, GlobalContext* globalCtx) { - Vec3f* posRot = &this->actor.posRot.pos; - f32 posX = posRot->x; - f32 posY = posRot->y; - f32 posZ = posRot->z; + Vec3f* world = &this->actor.world.pos; + f32 posX = world->x; + f32 posY = world->y; + f32 posZ = world->z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 80.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 80.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xB); @@ -239,7 +239,7 @@ void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) { } void func_8098E944(DemoSa* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += (250.0f / 3.0f); + this->actor.shape.yOffset += (250.0f / 3.0f); } void func_8098E960(DemoSa* this, GlobalContext* globalCtx) { @@ -252,7 +252,7 @@ void func_8098E960(DemoSa* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_8099010C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_FOREST); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -270,9 +270,9 @@ void func_8098E9EC(DemoSa* this, GlobalContext* globalCtx) { } void func_8098EA3C(DemoSa* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -353,7 +353,7 @@ void func_8098ECF4(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, skelAnime, &D_0600B1A0, NULL, NULL, NULL, 0); Animation_Change(skelAnime, &D_06001334, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; func_8098E508(this, 2); func_8098E51C(this, 2); } @@ -372,8 +372,8 @@ void func_8098EE08(void) { } void func_8098EE28(DemoSa* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - (kREG(23) + 25.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 4); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + (kREG(23) + 25.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 4); } void func_8098EEA8(DemoSa* this, GlobalContext* globalCtx) { @@ -381,7 +381,7 @@ void func_8098EEA8(DemoSa* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_1A0 = 0.0f; func_8098EE08(); } @@ -398,7 +398,7 @@ void func_8098EEFC(DemoSa* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_1A0 = kREG(5) + 10.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -408,11 +408,11 @@ void func_8098EEFC(DemoSa* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_1A0 = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / (kREG(5) + 10.0f)) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / (kREG(5) + 10.0f)) * 255.0f; } void func_8098F050(DemoSa* this, GlobalContext* globalCtx) { @@ -425,7 +425,7 @@ void func_8098F050(DemoSa* this, GlobalContext* globalCtx) { func_8098EE28(this, globalCtx); this->unk_1A8 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -491,7 +491,7 @@ void func_8098F420(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_0600FFD4, NULL, NULL, 0); this->action = 11; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_8098F480(DemoSa* this) { @@ -503,9 +503,9 @@ void func_8098F480(DemoSa* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_1A0) { - this->actor.shape.unk_14 = this->alpha = alpha; + this->actor.shape.shadowAlpha = this->alpha = alpha; } else { - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; } } @@ -602,14 +602,14 @@ void func_8098F7FC(DemoSa* this, GlobalContext* globalCtx) { } void func_8098F83C(DemoSa* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_0601113C, NULL, NULL, 0); Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, thisPos->x, thisPos->y, thisPos->z, 0, 0, 0, FAIRY_KOKIRI); this->action = 16; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; func_8098E508(this, 4); func_8098E51C(this, 2); } @@ -623,16 +623,16 @@ void func_8098F8F8(DemoSa* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_1A0) { - this->actor.shape.unk_14 = this->alpha = alpha; + this->actor.shape.shadowAlpha = this->alpha = alpha; } else { - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; } } void func_8098F984(DemoSa* this) { this->action = 16; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_8098F998(DemoSa* this, GlobalContext* globalCtx) { @@ -641,13 +641,13 @@ void func_8098F998(DemoSa* this, GlobalContext* globalCtx) { this->action = 17; this->drawConfig = 2; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } else { func_8098E76C(this, &D_0601113C, 0, 0.0f, 0); this->action = 18; this->drawConfig = 1; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } func_8098E508(this, 4); } @@ -657,7 +657,7 @@ void func_8098FA2C(DemoSa* this) { this->action = 18; this->drawConfig = 1; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -666,7 +666,7 @@ void func_8098FA84(DemoSa* this) { this->action = 19; this->drawConfig = 1; this->unk_1B0 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_8098E508(this, 2); } @@ -675,7 +675,7 @@ void func_8098FAE0(DemoSa* this) { this->action = 20; this->drawConfig = 1; this->unk_1B0 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_8098FB34(DemoSa* this, s32 arg1) { @@ -756,7 +756,7 @@ void DemoSa_Update(Actor* thisx, GlobalContext* globalCtx) { void DemoSa_Init(Actor* thisx, GlobalContext* globalCtx) { DemoSa* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); switch (this->actor.params) { case 2: diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 4ad7d474ec..396f0d03df 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -19,7 +19,7 @@ void func_80991298(DemoShd* this, GlobalContext* globalCtx); const ActorInit Demo_Shd_InitVars = { ACTOR_DEMO_SHD, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoShd), @@ -41,8 +41,8 @@ void DemoShd_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_14C = 0; DemoShd_SetupAction(this, func_80991298); Actor_SetScale(&this->actor, 0.4f); - this->actor.posRot.pos.y = 0.0f; - this->actor.posRot.pos.x = 0.0f; + this->actor.world.pos.y = 0.0f; + this->actor.world.pos.x = 0.0f; } void DemoShd_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index 17d8bb1e8f..1350033b29 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -31,7 +31,7 @@ static DemoTreLgtInfo sDemoTreLgtInfo[] = { const ActorInit Demo_Tre_Lgt_InitVars = { ACTOR_DEMO_TRE_LGT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_BOX, sizeof(DemoTreLgt), diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 6d536961b8..afe992c09b 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -21,7 +21,7 @@ void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx); const ActorInit Door_Ana_InitVars = { ACTOR_DOOR_ANA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(DoorAna), @@ -32,8 +32,22 @@ const ActorInit Door_Ana_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 10, 0, { 0 } }, }; @@ -68,7 +82,7 @@ void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) { } else { DoorAna_SetupAction(this, DoorAna_WaitOpen); } - this->actor.unk_1F = 0; + this->actor.targetMode = 0; } void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -83,20 +97,20 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { // update routine for grottos that are currently "hidden"/unopened void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) { u32 openGrotto = false; - if ((this->actor.params & 0x200) == 0) { + if (!(this->actor.params & 0x200)) { // opening with song of storms - if (this->actor.xyzDistToLinkSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) { + if (this->actor.xyzDistToPlayerSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) { openGrotto = true; this->actor.flags &= ~0x10; } } else { // bombing/hammering open a grotto - if ((this->collider.base.acFlags & 2) != 0) { + if (this->collider.base.acFlags & AC_HIT) { openGrotto = true; Collider_DestroyCylinder(globalCtx, &this->collider); } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } // open the grotto @@ -114,27 +128,27 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { s32 destinationIdx; player = PLAYER; - if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f) != 0) { - if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && + if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { + if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF); - gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.posRot.pos.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.initPosRot.rot.y; + gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; + gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; if (destinationIdx < 0) { - destinationIdx = this->actor.initPosRot.rot.z + 1; + destinationIdx = this->actor.home.rot.z + 1; } globalCtx->nextEntranceIndex = entrances[destinationIdx]; DoorAna_SetupAction(this, DoorAna_GrabLink); } else { if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & 0x8800000) && - this->actor.xzDistToLink <= 15.0f && -50.0f <= this->actor.yDistToLink && - this->actor.yDistToLink <= 15.0f) { + this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && + this->actor.yDistToPlayer <= 15.0f) { player->stateFlags1 |= 0x80000000; - this->actor.unk_1F = 1; + this->actor.targetMode = 1; } else { - this->actor.unk_1F = 0; + this->actor.targetMode = 0; } } } @@ -145,10 +159,10 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) { Player* player; - if (this->actor.yDistToLink <= 0.0f && 15.0f < this->actor.xzDistToLink) { + if (this->actor.yDistToPlayer <= 0.0f && 15.0f < this->actor.xzDistToPlayer) { player = PLAYER; - player->actor.posRot.pos.x = Math_SinS(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.x; - player->actor.posRot.pos.z = Math_CosS(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.z; + player->actor.world.pos.x = Math_SinS(this->actor.yawTowardsPlayer) * 15.0f + this->actor.world.pos.x; + player->actor.world.pos.z = Math_CosS(this->actor.yawTowardsPlayer) * 15.0f + this->actor.world.pos.z; } } diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index e9a289b9ac..49c7cef99c 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -22,7 +22,7 @@ void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx); const ActorInit Door_Gerudo_InitVars = { ACTOR_DOOR_GERUDO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_DOOR_GERUDO, sizeof(DoorGerudo), @@ -51,7 +51,7 @@ void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { this->actionFunc = func_8099485C; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 200.0f; + thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { this->actionFunc = func_8099485C; this->unk_166 = 10; @@ -69,9 +69,9 @@ f32 func_809946BC(GlobalContext* globalCtx, DoorGerudo* this, f32 arg2, f32 arg3 Vec3f playerPos; Vec3f sp1C; - playerPos.x = player->actor.posRot.pos.x; - playerPos.y = player->actor.posRot.pos.y + arg2; - playerPos.z = player->actor.posRot.pos.z; + playerPos.x = player->actor.world.pos.x; + playerPos.y = player->actor.world.pos.y + arg2; + playerPos.z = player->actor.world.pos.z; func_8002DBD0(&this->dyna.actor, &sp1C, &playerPos); if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) { @@ -136,8 +136,7 @@ void func_8099496C(DoorGerudo* this, GlobalContext* globalCtx) { void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f); - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 200.0f, - this->dyna.actor.velocity.y); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y); } void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 7caae0a96e..e44f5375f7 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -13,7 +13,7 @@ extern UNK_TYPE D_06001BC8; /* const ActorInit Door_Killer_InitVars = { ACTOR_DOOR_KILLER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DOOR_KILLER, sizeof(DoorKiller), @@ -22,6 +22,53 @@ const ActorInit Door_Killer_InitVars = { (ActorFunc)DoorKiller_Update, NULL, }; + +static ColliderCylinderInit D_80995FB0 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x0001FFEE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 100, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80995FDC[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 100 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80996000 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + D_80995FDC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Killer/DoorKiller_Init.s") diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 0fcf0749d5..36da6c7776 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -34,7 +34,7 @@ void func_80997744(DoorShutter* this, GlobalContext* globalCtx); const ActorInit Door_Shutter_InitVars = { ACTOR_DOOR_SHUTTER, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DoorShutter), @@ -158,7 +158,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, GlobalContext* globalCtx) { if (doorType != SHUTTER_KEY_LOCKED) { if (frontRoom == transitionEntry->sides[1].room) { - if (ABS((s16)(this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsLink)) < 0x4000) { + if (ABS((s16)(this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsPlayer)) < 0x4000) { frontRoom = -1; } } @@ -203,7 +203,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->dyna.actor.initPosRot.pos.z = this->dyna.actor.shape.unk_08; + this->dyna.actor.home.pos.z = this->dyna.actor.shape.yOffset; DynaPolyActor_Init(&this->dyna, DPM_UNK); this->doorType = (this->dyna.actor.params >> 6) & 0xF; phi_a3 = D_80998224[this->doorType]; @@ -239,14 +239,14 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx2, this->dyna.actor.params & 0x3F)) { this->unk_16E = 10; } - Actor_SetHeight(&this->dyna.actor, 60.0f); + Actor_SetFocus(&this->dyna.actor, 60.0f); } else if (phi_a3 == 4) { Actor_SetScale(&this->dyna.actor, 0.1f); this->unk_166 = 100; this->dyna.actor.uncullZoneScale = 200.0f; - Actor_SetHeight(&this->dyna.actor, 0.0f); + Actor_SetFocus(&this->dyna.actor, 0.0f); } else { - Actor_SetHeight(&this->dyna.actor, 60.0f); + Actor_SetFocus(&this->dyna.actor, 60.0f); } } @@ -293,9 +293,9 @@ f32 func_80996840(GlobalContext* globalCtx, DoorShutter* this, f32 arg2, f32 arg Vec3f sp1C; Player* player = PLAYER; - sp28.x = player->actor.posRot.pos.x; - sp28.y = player->actor.posRot.pos.y + arg2; - sp28.z = player->actor.posRot.pos.z; + sp28.x = player->actor.world.pos.x; + sp28.y = player->actor.world.pos.y + arg2; + sp28.z = player->actor.world.pos.z; func_8002DBD0(&this->dyna.actor, &sp1C, &sp28); if (arg3 < fabsf(sp1C.x) || arg4 < fabsf(sp1C.y)) { return FLT_MAX; @@ -381,7 +381,7 @@ void func_80996B0C(DoorShutter* this, GlobalContext* globalCtx) { } void func_80996C60(DoorShutter* this, GlobalContext* globalCtx) { - if (this->dyna.actor.type == ACTORTYPE_DOOR) { + if (this->dyna.actor.category == ACTORCAT_DOOR) { Player* player = PLAYER; s32 sp38 = this->unk_16C; s32 sp34 = 0xF; @@ -403,7 +403,7 @@ s32 func_80996D14(DoorShutter* this, GlobalContext* globalCtx) { func_80996C60(this, globalCtx); } Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 200.0f, + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y)) { return true; } @@ -465,7 +465,7 @@ void func_80996F98(DoorShutter* this, GlobalContext* globalCtx) { void func_80997004(DoorShutter* this, GlobalContext* globalCtx) { if (DECR(this->unk_16E) == 0 && globalCtx->roomCtx.status == 0 && func_80996D14(this, globalCtx) != 0) { - if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToLink) { + if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToPlayer) { if (DoorShutter_SetupDoor(this, globalCtx)) { this->dyna.actor.velocity.y = 30.0f; } @@ -490,7 +490,7 @@ void func_80997150(DoorShutter* this, GlobalContext* globalCtx) { if (globalCtx->state.frames % 2 != 0) { this->unk_16F++; } - if (this->dyna.actor.type == func_8005B198() || this->unk_16F == 0) { + if (this->dyna.actor.category == func_8005B198() || this->unk_16F == 0) { this->unk_16F = 5; } } else { @@ -513,7 +513,7 @@ void func_80997220(DoorShutter* this, GlobalContext* globalCtx) { if (this->dyna.actor.room >= 0) { Vec3f vec; - func_8002DBD0(&this->dyna.actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &vec, &player->actor.world.pos); this->dyna.actor.room = globalCtx->transitionActorList[(u16)this->dyna.actor.params >> 0xA].sides[(vec.z < 0.0f) ? 0 : 1].room; if (room != this->dyna.actor.room) { @@ -540,17 +540,17 @@ void func_809973E8(DoorShutter* this, GlobalContext* globalCtx) { if (this->dyna.actor.velocity.y < 20.0f) { Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f); } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { if (this->dyna.actor.velocity.y > 20.0f) { - this->dyna.actor.groundY = this->dyna.actor.initPosRot.pos.y; - func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.posRot.pos, 45.0f, 0xA, 8.0f, 0x1F4, 0xA, 0); + this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y; + func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 45.0f, 0xA, 8.0f, 0x1F4, 0xA, 0); } Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); quakeId = Quake_Add(Gameplay_GetCamera(globalCtx, 0), 3); Quake_SetSpeed(quakeId, -32536); Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetCountdown(quakeId, 10); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0xB4, 0x14, 0x64); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64); func_80997220(this, globalCtx); } } @@ -570,7 +570,7 @@ void func_80997568(DoorShutter* this, GlobalContext* globalCtx) { void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); if (this->dyna.actor.bgCheckFlags & 1) { DoorShutter_SetupAction(this, func_809976B8); if (!(gSaveContext.eventChkInf[7] & 1)) { @@ -579,7 +579,7 @@ void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) { this->unk_164 = 10; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); func_8099803C(globalCtx, 2, 10, parent->subCameraId); - func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.posRot.pos, 70.0f, 20, 8.0f, 500, 10, 1); + func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10, 1); } } } @@ -590,7 +590,7 @@ void func_809976B8(DoorShutter* this, GlobalContext* globalCtx) { if (this->unk_164 != 0) { this->unk_164--; mult = sinf(this->unk_164 * 250.0f / 100.0f); - this->dyna.actor.shape.unk_08 = this->unk_164 * 3.0f / 10.0f * mult; + this->dyna.actor.shape.yOffset = this->unk_164 * 3.0f / 10.0f * mult; } } @@ -602,7 +602,7 @@ void func_80997744(DoorShutter* this, GlobalContext* globalCtx) { this->unk_164--; } phi_f0 = (this->unk_164 % 2 != 0) ? -3.0f : 0.0f; - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, -34.0f + phi_f0, 1.0f, 20.0f, 0.0f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, -34.0f + phi_f0, 1.0f, 20.0f, 0.0f); osSyncPrintf("FHG SAKU END !!\n"); } @@ -650,8 +650,8 @@ s32 func_80997A34(DoorShutter* this, GlobalContext* globalCtx) { if (Player_InCsMode(globalCtx)) { return true; } - phi_a0 = (s16)(func_8002DAC0(&this->dyna.actor, &globalCtx->view.eye) - this->dyna.actor.shape.rot.y); - phi_a1 = (s16)(this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y); + phi_a0 = (s16)(Actor_WorldYawTowardPoint(&this->dyna.actor, &globalCtx->view.eye) - this->dyna.actor.shape.rot.y); + phi_a1 = (s16)(this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y); phi_a0 = ABS(phi_a0); phi_a1 = ABS(phi_a1); if ((phi_a1 < 0x4000 && phi_a0 > 0x4000) || (phi_a1 > 0x4000 && phi_a0 < 0x4000)) { @@ -690,7 +690,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->roomCtx.prevRoom.num >= 0 || transitionEntry->sides[0].room == transitionEntry->sides[1].room) { - s32 yaw = Math_Vec3f_Yaw(&globalCtx->view.eye, &this->dyna.actor.posRot.pos); + s32 yaw = Math_Vec3f_Yaw(&globalCtx->view.eye, &this->dyna.actor.world.pos); if (ABS((s16)(this->dyna.actor.shape.rot.y - yaw)) < 0x4000) { Matrix_RotateY(M_PI, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index b93796e505..9224fe3beb 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -16,7 +16,7 @@ void DoorToki_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Door_Toki_InitVars = { ACTOR_DOOR_TOKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(DoorToki), diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 0a36f15f77..1c309a8c09 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06002CA8; /* const ActorInit Door_Warp1_InitVars = { ACTOR_DOOR_WARP1, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_WARP1, sizeof(DoorWarp1), diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index b77a244d32..52e620c2ee 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_060027D8; /* const ActorInit Efc_Erupc_InitVars = { ACTOR_EFC_ERUPC, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_EFC_ERUPC, sizeof(EfcErupc), diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index b924230cca..5aca1ee3fd 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -21,7 +21,7 @@ extern Gfx D_04037880[]; const ActorInit Eff_Dust_InitVars = { ACTOR_EFF_DUST, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EffDust), diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 497849a7f9..6f4ae05a5f 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -22,7 +22,7 @@ void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx); const ActorInit Elf_Msg_InitVars = { ACTOR_ELF_MSG, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ElfMsg), @@ -97,8 +97,8 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) { */ s32 ElfMsg_KillCheck(ElfMsg* this, GlobalContext* globalCtx) { - if ((this->actor.posRot.rot.y > 0) && (this->actor.posRot.rot.y < 0x41) && - (Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 1))) { + if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && + (Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 1))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg.c", 161); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -106,7 +106,7 @@ s32 ElfMsg_KillCheck(ElfMsg* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.posRot.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg.c", 172); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -136,17 +136,17 @@ void ElfMsg_Init(Actor* thisx, GlobalContext* globalCtx) { if (!ElfMsg_KillCheck(this, globalCtx)) { Actor_ProcessInitChain(thisx, sInitChain); - if (thisx->posRot.rot.x == 0) { + if (thisx->world.rot.x == 0) { thisx->scale.z = 0.4f; thisx->scale.x = 0.4f; } else { - thisx->scale.x = thisx->scale.z = thisx->posRot.rot.x * 0.04f; + thisx->scale.x = thisx->scale.z = thisx->world.rot.x * 0.04f; } - if (thisx->posRot.rot.z == 0) { + if (thisx->world.rot.z == 0) { thisx->scale.y = 0.4f; } else { - thisx->scale.y = thisx->posRot.rot.z * 0.04f; + thisx->scale.y = thisx->world.rot.z * 0.04f; } if (thisx->params & 0x4000) { @@ -175,10 +175,10 @@ void ElfMsg_CallNaviCuboid(ElfMsg* this, GlobalContext* globalCtx) { Player* player = PLAYER; EnElf* navi = (EnElf*)player->naviActor; - if ((fabsf(player->actor.posRot.pos.x - this->actor.posRot.pos.x) < (100.0f * this->actor.scale.x)) && - (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) && - ((player->actor.posRot.pos.y - this->actor.posRot.pos.y) < (100.0f * this->actor.scale.y)) && - (fabsf(player->actor.posRot.pos.z - this->actor.posRot.pos.z) < (100.0f * this->actor.scale.z))) { + if ((fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) && + (this->actor.world.pos.y <= player->actor.world.pos.y) && + ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y)) && + (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z))) { player->naviTextId = ElfMsg_GetMessageId(this); navi->elfMsg = this; } @@ -192,9 +192,9 @@ void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx) { Player* player = PLAYER; EnElf* navi = (EnElf*)player->naviActor; - if (ElfMsg_WithinXZDistance(&player->actor.posRot.pos, &this->actor.posRot.pos, this->actor.scale.x * 100.0f) && - (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) && - ((player->actor.posRot.pos.y - this->actor.posRot.pos.y) < (100.0f * this->actor.scale.y))) { + if (ElfMsg_WithinXZDistance(&player->actor.world.pos, &this->actor.world.pos, this->actor.scale.x * 100.0f) && + (this->actor.world.pos.y <= player->actor.world.pos.y) && + ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y))) { player->naviTextId = ElfMsg_GetMessageId(this); navi->elfMsg = this; } @@ -211,8 +211,8 @@ void ElfMsg_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - if ((this->actor.posRot.rot.y <= 0x41) || (this->actor.posRot.rot.y > 0x80) || - Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 0x41)) { + if ((this->actor.world.rot.y <= 0x41) || (this->actor.world.rot.y > 0x80) || + Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 0x41)) { this->actionFunc(this, globalCtx); } } diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 27b386514f..b9a5073d2a 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -22,7 +22,7 @@ void ElfMsg2_WaitForTextRead(ElfMsg2* this, GlobalContext* globalCtx); const ActorInit Elf_Msg2_InitVars = { ACTOR_ELF_MSG2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ElfMsg2), @@ -74,8 +74,8 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) { */ s32 ElfMsg2_KillCheck(ElfMsg2* this, GlobalContext* globalCtx) { - if ((this->actor.posRot.rot.y > 0) && (this->actor.posRot.rot.y < 0x41) && - (Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 1))) { + if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && + (Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 1))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -83,7 +83,7 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.posRot.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { // "Mutual destruction 2" LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -107,11 +107,11 @@ void ElfMsg2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(CYAN) " Elf_Msg2_Actor_ct %04x\n\n" VT_RST, this->actor.params); if (!ElfMsg2_KillCheck(this, globalCtx)) { - if ((this->actor.posRot.rot.x > 0) && (this->actor.posRot.rot.x < 8)) { - this->actor.unk_1F = this->actor.posRot.rot.x - 1; + if ((this->actor.world.rot.x > 0) && (this->actor.world.rot.x < 8)) { + this->actor.targetMode = this->actor.world.rot.x - 1; } Actor_ProcessInitChain(thisx, sInitChain); - if (this->actor.posRot.rot.y >= 0x41) { + if (this->actor.world.rot.y >= 0x41) { ElfMsg2_SetupAction(this, ElfMsg2_WaitUntilActivated); } else { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); @@ -137,7 +137,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, GlobalContext* globalCtx) { s32 switchFlag; if (func_8002F334(&this->actor, globalCtx)) { - if (this->actor.posRot.rot.z != 1) { + if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); switchFlag = (this->actor.params >> 8) & 0x3F; if (switchFlag != 0x3F) { @@ -162,10 +162,10 @@ void ElfMsg2_WaitForTextRead(ElfMsg2* this, GlobalContext* globalCtx) { * Idles until a switch flag is set, at which point the actor becomes interactable */ void ElfMsg2_WaitUntilActivated(ElfMsg2* this, GlobalContext* globalCtx) { - // If (y >= 0x41) && (y <= 0x80), Idles until switch flag (actor.posRot.rot.y - 0x41) is set + // If (y >= 0x41) && (y <= 0x80), Idles until switch flag (actor.world.rot.y - 0x41) is set // If (y > 0x80), Idles forever (Bug?) - if ((this->actor.posRot.rot.y >= 0x41) && (this->actor.posRot.rot.y <= 0x80) && - (Flags_GetSwitch(globalCtx, (this->actor.posRot.rot.y - 0x41)))) { + if ((this->actor.world.rot.y >= 0x41) && (this->actor.world.rot.y <= 0x80) && + (Flags_GetSwitch(globalCtx, (this->actor.world.rot.y - 0x41)))) { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); this->actor.flags |= 0x00040001; // Make actor targetable and Navi-checkable this->actor.textId = ElfMsg2_GetMessageId(this); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 47540f90c4..5807df3ec9 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06005B3C; /* const ActorInit En_Am_InitVars = { ACTOR_EN_AM, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_AM, sizeof(EnAm), @@ -33,6 +33,66 @@ const ActorInit En_Am_InitVars = { (ActorFunc)EnAm_Update, (ActorFunc)EnAm_Draw, }; + +static ColliderCylinderInit D_809AFF80 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 15, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_809AFFAC = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00400106, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_809AFFD8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF20.s") diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 41046b80ca..cd4a99dd1f 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -34,7 +34,7 @@ extern AnimationHeader D_060076EC; const ActorInit En_Ani_InitVars = { ACTOR_EN_ANI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ANI, sizeof(EnAni), @@ -45,8 +45,22 @@ const ActorInit En_Ani_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0 } }, }; @@ -72,12 +86,12 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->jointTable, this->morphTable, 0x10); Animation_PlayOnce(&this->skelAnime, &D_060076EC); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; if (LINK_IS_CHILD) { EnAni_SetupAction(this, func_809B064C); } else { @@ -150,7 +164,7 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { // "...all I can do is look at Death Mountain." } - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx) != 0) { if (this->actor.textId == 0x5056) { // "To get a good view..." EnAni_SetupAction(this, func_809B04F0); @@ -159,14 +173,14 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { } else { EnAni_SetupAction(this, func_809B04F0); } - } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToLink < 150.0f && - -80.0f < this->actor.yDistToLink) { + } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && + -80.0f < this->actor.yDistToPlayer) { if (gSaveContext.itemGetInf[1] & 0x20) { EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." } else { EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." } - } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToLink < 350.0f) { + } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { EnAni_SetText(this, globalCtx, textId); } } @@ -176,7 +190,7 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { s16 yawDiff; u16 textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx) != 0) { if (this->actor.textId == 0x5056) { // "To get a good view..." EnAni_SetupAction(this, func_809B0524); @@ -185,14 +199,14 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { } else { EnAni_SetupAction(this, func_809B0524); } - } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToLink < 150.0f && - -80.0f < this->actor.yDistToLink) { + } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && + -80.0f < this->actor.yDistToPlayer) { if ((gSaveContext.itemGetInf[1] & 0x20) != 0) { EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." } else { EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." } - } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToLink < 350.0f) { + } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { if ((gSaveContext.eventChkInf[2] & 0x8000) == 0) { textId = 0x5052; // "...Something is happening on Death Mountain!" } else { @@ -211,7 +225,7 @@ void func_809B0994(EnAni* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_060070F0, 1.0f, 0.0f, Animation_GetLastFrame(&D_060070F0), ANIMMODE_ONCE, -4.0f); this->unk_2AA++; - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } } @@ -228,7 +242,7 @@ void func_809B0A6C(EnAni* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[0]->action == 2) { Animation_Change(&this->skelAnime, &D_060067B8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060067B8), ANIMMODE_ONCE, 0.0f); - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; this->unk_2AA++; } } @@ -237,10 +251,10 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { EnAni* this = THIS; s32 pad[2]; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.npcActions[0] != NULL)) { switch (this->unk_2AA) { case 0: @@ -271,7 +285,7 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_2A8 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A2.z = 0; this->unk_2A2.y = this->unk_2A2.z; this->unk_2A2.x = this->unk_2A2.z; @@ -305,7 +319,7 @@ void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnAni* this = THIS; if (limbIndex == 15) { - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 697007b1eb..532e66b646 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06003990; /* const ActorInit En_Anubice_InitVars = { ACTOR_EN_ANUBICE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ANUBICE, sizeof(EnAnubice), @@ -33,6 +33,26 @@ const ActorInit En_Anubice_InitVars = { (ActorFunc)EnAnubice_Update, (ActorFunc)EnAnubice_Draw, }; + +static ColliderCylinderInit D_809B22D0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 29, 103, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Anubice/func_809B1120.s") diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index e6d83de004..cd699e9042 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06003510; /* const ActorInit En_Anubice_Fire_InitVars = { ACTOR_EN_ANUBICE_FIRE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ANUBICE, sizeof(EnAnubiceFire), @@ -29,6 +29,26 @@ const ActorInit En_Anubice_Fire_InitVars = { (ActorFunc)EnAnubiceFire_Update, (ActorFunc)EnAnubiceFire_Draw, }; + +static ColliderCylinderInit D_809B31E0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Init.s") diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index 58409292a0..1bbd04922f 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -21,7 +21,7 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx); const ActorInit En_Anubice_Tag_InitVars = { ACTOR_EN_ANUBICE_TAG, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnAnubiceTag), @@ -52,8 +52,8 @@ void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { this->anubis = - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 0); if (this->anubis != NULL) { this->actionFunc = EnAnubiceTag_ManageAnubis; @@ -79,14 +79,14 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink < (200.0f + this->triggerRange)) { + if (this->actor.xzDistToPlayer < (200.0f + this->triggerRange)) { if (anubis->unk_260 == 0) { if (anubis->unk_262 == 0) { anubis->unk_25E = 1; - offset.x = -Math_SinS(this->actor.yawTowardsLink) * this->actor.xzDistToLink; - offset.z = -Math_CosS(this->actor.yawTowardsLink) * this->actor.xzDistToLink; - Math_ApproachF(&anubis->actor.posRot.pos.x, (this->actor.posRot.pos.x + offset.x), 0.3f, 10.0f); - Math_ApproachF(&anubis->actor.posRot.pos.z, (this->actor.posRot.pos.z + offset.z), 0.3f, 10.0f); + offset.x = -Math_SinS(this->actor.yawTowardsPlayer) * this->actor.xzDistToPlayer; + offset.z = -Math_CosS(this->actor.yawTowardsPlayer) * this->actor.xzDistToPlayer; + Math_ApproachF(&anubis->actor.world.pos.x, (this->actor.world.pos.x + offset.x), 0.3f, 10.0f); + Math_ApproachF(&anubis->actor.world.pos.z, (this->actor.world.pos.z + offset.z), 0.3f, 10.0f); return; } } @@ -107,8 +107,8 @@ void EnAnubiceTag_Draw(Actor* thisx, GlobalContext* globalCtx) { EnAnubiceTag* this = THIS; if (BREG(0) != 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0, 0xFF, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c index 9385c1f62c..b50b2a33ad 100644 --- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c +++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c @@ -16,7 +16,7 @@ void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Arow_Trap_InitVars = { ACTOR_EN_AROW_TRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnArowTrap), @@ -32,7 +32,7 @@ void EnArowTrap_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01); this->unk_14C = 0; this->attackTimer = 80; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; } void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -41,12 +41,12 @@ void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx) { EnArowTrap* this = THIS; - if (this->actor.xzDistToLink <= 400) { + if (this->actor.xzDistToPlayer <= 400) { this->attackTimer--; if (this->attackTimer == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0xFFFFFFFF); this->attackTimer = 80; } diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 84732bce24..c99c478af5 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -23,7 +23,7 @@ extern UNK_TYPE D_04037880; /* const ActorInit En_Arrow_InitVars = { ACTOR_EN_ARROW, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnArrow), @@ -32,6 +32,26 @@ const ActorInit En_Arrow_InitVars = { (ActorFunc)EnArrow_Update, (ActorFunc)EnArrow_Draw, }; + +static ColliderQuadInit D_809B4D50 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000020, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Arrow/func_809B3920.s") diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 6ddf930932..cdec504fa2 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -25,7 +25,7 @@ extern FlexSkeletonHeader D_06002530; const ActorInit En_Attack_Niw_InitVars = { ACTOR_EN_ATTACK_NIW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_NIW, sizeof(EnAttackNiw), @@ -36,9 +36,9 @@ const ActorInit En_Attack_Niw_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -46,7 +46,7 @@ void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); if (this->actor.params < 0) { this->actor.params = 0; @@ -58,7 +58,7 @@ void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_298.z = Rand_CenteredFloat(100.0f); Actor_SetScale(&this->actor, 0.01f); this->actor.flags &= ~1; - this->actor.shape.rot.y = this->actor.posRot.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f; + this->actor.shape.rot.y = this->actor.world.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f; this->actionFunc = func_809B5670; } @@ -171,7 +171,7 @@ s32 func_809B55EC(EnAttackNiw* this, GlobalContext* globalCtx) { s16 sp1E; s16 sp1C; - Actor_SetHeight(&this->actor, this->unk_2E4); + Actor_SetFocus(&this->actor, this->unk_2E4); func_8002F374(globalCtx, &this->actor, &sp1E, &sp1C); if ((this->actor.projectedPos.z < -20.0f) || (sp1E < 0) || (sp1E > SCREEN_WIDTH) || (sp1C < 0) || (sp1C > SCREEN_HEIGHT)) { @@ -199,19 +199,19 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) { sp34.y = globalCtx->view.lookAt.y + tmpf2; sp34.z = globalCtx->view.lookAt.z + tmpf3; - this->unk_2D4 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp34); - this->unk_2D0 = Math_Vec3f_Pitch(&this->actor.posRot.pos, &sp34) * -1.0f; + this->unk_2D4 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp34); + this->unk_2D0 = Math_Vec3f_Pitch(&this->actor.world.pos, &sp34) * -1.0f; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_2D4, 5, this->unk_2DC, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 5000.0f, 1.0f, 100.0f); - Actor_SetHeight(&this->actor, this->unk_2E4); + Actor_SetFocus(&this->actor, this->unk_2E4); func_8002F374(globalCtx, &this->actor, &sp4E, &sp4C); if (this->actor.bgCheckFlags & 8) { - this->unk_2D4 = this->actor.yawTowardsLink; - this->unk_2D0 = this->actor.posRot.rot.x - 3000.0f; + this->unk_2D4 = this->actor.yawTowardsPlayer; + this->unk_2D0 = this->actor.world.rot.x - 3000.0f; this->unk_2DC = 0.0f; this->unk_284 = 0.0f; this->unk_27C = 0.0f; @@ -221,13 +221,13 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) { this->unk_2E0 = 5.0f; this->unk_288 = 0.0f; this->actionFunc = func_809B59B0; - } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.posRot.pos.x) < 50.0f) && - (fabsf(sp34.y - this->actor.posRot.pos.y) < 50.0f) && - (fabsf(sp34.z - this->actor.posRot.pos.z) < 50.0f)) || + } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.world.pos.x) < 50.0f) && + (fabsf(sp34.y - this->actor.world.pos.y) < 50.0f) && + (fabsf(sp34.z - this->actor.world.pos.z) < 50.0f)) || (this->actor.bgCheckFlags & 1)) { - this->unk_2D4 = this->actor.yawTowardsLink; - this->unk_2D0 = this->actor.posRot.rot.x - 2000.0f; + this->unk_2D4 = this->actor.yawTowardsPlayer; + this->unk_2D0 = this->actor.world.rot.x - 2000.0f; this->unk_2DC = 0.0f; this->unk_27C = 0.0f; this->unk_284 = 0.0f; @@ -258,17 +258,17 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) { if (this->actor.gravity != -2.0f) { this->unk_280 = this->unk_278 = 14000.0f; this->unk_2D0 = this->unk_26C = this->unk_268 = this->unk_284 = this->unk_27C = 0.0f; - this->unk_2D4 = this->actor.yawTowardsLink; + this->unk_2D4 = this->actor.yawTowardsPlayer; this->unk_262 = 0x32; this->unk_25C = 0x64; this->actor.gravity = -2.0f; } } if (this->unk_25C == 0x32) { - this->unk_2D4 = Rand_CenteredFloat(200.0f) + this->actor.yawTowardsLink; + this->unk_2D4 = Rand_CenteredFloat(200.0f) + this->actor.yawTowardsPlayer; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_2D4, 2, this->unk_2DC, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 2, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 2, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 2, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->actor.speedXZ, this->unk_2E0, 0.9f, 1.0f); if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) && @@ -276,7 +276,7 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) { this->unk_2E0 = 0.0f; this->actor.gravity = 0.0f; this->unk_2DC = 0.0f; - this->unk_2D0 = this->actor.posRot.rot.x - 5000.0f; + this->unk_2D0 = this->actor.world.rot.x - 5000.0f; this->actionFunc = func_809B5C18; } else if (this->actor.bgCheckFlags & 1) { func_809B5268(this, globalCtx, 5); @@ -290,7 +290,7 @@ void func_809B5C18(EnAttackNiw* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 5000.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.velocity.y, 5.0f, 0.3f, 1.0f); func_809B5268(this, globalCtx, 2); @@ -328,10 +328,10 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_262--; } - this->actor.shape.rot = this->actor.posRot.rot; - this->actor.shape.unk_10 = 15.0f; + this->actor.shape.rot = this->actor.world.rot; + this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx2); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->actionFunc == func_809B5670) { func_8002D97C(&this->actor); @@ -339,29 +339,29 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); } - if (this->actor.groundY <= BGCHECK_Y_MIN) { + if (this->actor.floorHeight <= BGCHECK_Y_MIN) { Actor_Kill(&this->actor); return; } if ((this->actor.bgCheckFlags & 0x20) && (this->actionFunc != func_809B5C18)) { - Math_Vec3f_Copy(&sp30, &this->actor.posRot.pos); + Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.yDistToWater; EffectSsGSplash_Spawn(globalCtx, &sp30, 0, 0, 0, 0x190); this->unk_2DC = 0.0f; this->actor.gravity = 0.0f; this->unk_2E0 = 0.0f; - this->unk_2D0 = this->actor.posRot.rot.x - 5000.0f; + this->unk_2D0 = this->actor.world.rot.x - 5000.0f; this->actionFunc = func_809B5C18; return; } tmpf1 = 20.0f; - if (this->actor.xyzDistToLinkSq < SQ(tmpf1)) { + if (this->actor.xyzDistToPlayerSq < SQ(tmpf1)) { cucco = (EnNiw*)this->actor.parent; if ((this->actor.parent->update != NULL) && (this->actor.parent != NULL) && (cucco != NULL) && (cucco->timer9 == 0) && (player->invincibilityTimer == 0)) { - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.posRot.rot.y, 0.0f, 0x10); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.world.rot.y, 0.0f, 0x10); cucco->timer9 = 0x46; } } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 1064c084c3..117643d1df 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06001D80; /* const ActorInit En_Ba_InitVars = { ACTOR_EN_BA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BXA, sizeof(EnBa), @@ -30,6 +30,44 @@ const ActorInit En_Ba_InitVars = { (ActorFunc)EnBa_Update, (ActorFunc)EnBa_Draw, }; + +static ColliderJntSphElementInit D_809B808C[2] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 13, { { 0, 0, 0 }, 25 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809B80D4 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 2, + D_809B808C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6350.s") diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 50192b42d3..1055b920e3 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -96,23 +96,113 @@ extern AnimationHeader D_06000444; extern SkeletonHeader D_06001A30; static DamageTable sDamageTableBlueGreen = { - 0xF0, 0x02, 0x01, 0xA2, 0xF0, 0xE2, 0xA2, 0xF0, 0x01, 0x02, 0x04, 0xE2, 0xC4, 0xB4, 0x00, 0x00, - 0x00, 0x60, 0x93, 0x83, 0xA0, 0xA0, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xF), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0xC), + /* Light arrow */ DMG_ENTRY(4, 0xB), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0x9), + /* Light magic */ DMG_ENTRY(3, 0x8), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sDamageTableRed = { - 0xD0, 0xD0, 0xD0, 0xA2, 0xD0, 0xE2, 0xA2, 0xD0, 0xD0, 0xE2, 0xE4, 0xE2, 0x94, 0xE2, 0xE4, 0xE2, - 0xE2, 0x60, 0x93, 0x60, 0xA0, 0xA0, 0x01, 0xE4, 0xE2, 0x02, 0xE8, 0xE4, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xD), + /* Deku stick */ DMG_ENTRY(0, 0xD), + /* Slingshot */ DMG_ENTRY(0, 0xD), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xD), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xD), + /* Kokiri sword */ DMG_ENTRY(0, 0xD), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0x9), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0x9), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sDamageTableWhite = { - 0xF0, 0xE2, 0xE1, 0xA2, 0xF0, 0xE2, 0xA2, 0xF0, 0xE1, 0xE2, 0xE4, 0x54, 0xE2, 0xE2, 0xE4, 0xE2, - 0xE2, 0x74, 0x60, 0x60, 0xA0, 0xA0, 0xE1, 0xE4, 0xE2, 0xE2, 0xE8, 0xE4, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0xE), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xF), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(4, 0x5), + /* Ice arrow */ DMG_ENTRY(2, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(4, 0x7), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0xE), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; const ActorInit En_Bb_InitVars = { ACTOR_EN_BB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BB, sizeof(EnBb), @@ -122,21 +212,35 @@ const ActorInit En_Bb_InitVars = { (ActorFunc)EnBb_Draw, }; -static ColliderJntSphItemInit sJntSphElementInit[1] = { +static ColliderJntSphElementInit sJntSphElementInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, -120, 0 }, 4 }, 300 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x09, 0x10, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphElementInit), + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, sJntSphElementInit, }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 10, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP), }; void EnBb_SetupAction(EnBb* this, EnBbActionFunc actionFunc) { @@ -144,7 +248,7 @@ void EnBb_SetupAction(EnBb* this, EnBbActionFunc actionFunc) { } Actor* EnBb_FindExplosive(GlobalContext* globalCtx, EnBb* this, f32 range) { - Actor* explosive = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dist; while (explosive != NULL) { @@ -152,7 +256,7 @@ Actor* EnBb_FindExplosive(GlobalContext* globalCtx, EnBb* this, f32 range) { explosive = explosive->next; continue; } - dist = func_8002DB48(&this->actor, explosive); + dist = Actor_WorldDistXYZToActor(&this->actor, explosive); if ((explosive->params == 0) && (dist <= range)) { return explosive; } @@ -167,8 +271,8 @@ void EnBb_SpawnFlameTrail(GlobalContext* globalCtx, EnBb* this, s16 startAtZero) s32 i; for (i = 0; i < 5; i++) { - next = (EnBb*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BB, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + next = (EnBb*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BB, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (next != NULL) { now->actor.child = &next->actor; next->actor.parent = &now->actor; @@ -224,15 +328,15 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->params |= 0xFF00; } if (thisx->params <= ENBB_BLUE) { - ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } if (thisx->params & 0xFF00) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; - this->collider.list[0].body.toucherFlags = 9; - this->collider.list[0].body.toucher.flags = 0xFFCFFFFF; - this->collider.list[0].body.toucher.damage = 8; + this->collider.elements[0].info.toucherFlags = TOUCH_ON | TOUCH_SFX_HARD; + this->collider.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider.elements[0].info.toucher.damage = 8; this->bobSize = this->actionState * 20.0f; this->flamePrimAlpha = 255; this->moveMode = BBMOVE_NORMAL; @@ -242,7 +346,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->naviEnemyId = 0x1C; thisx->colChkInfo.damageTable = &sDamageTableBlueGreen; this->flamePrimBlue = this->flameEnvColor.b = 255; - thisx->posRot.pos.y += 50.0f; + thisx->world.pos.y += 50.0f; EnBb_SetupBlue(this); thisx->flags |= 0x4000; break; @@ -250,7 +354,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->naviEnemyId = 0x24; thisx->colChkInfo.damageTable = &sDamageTableRed; this->flameEnvColor.r = 255; - this->collider.list[0].body.toucher.effect = 1; + this->collider.elements[0].info.toucher.effect = 1; EnBb_SetupRed(globalCtx, this); break; case ENBB_WHITE: @@ -277,7 +381,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { break; case ENBB_GREEN_BIG: this->path = this->actionState >> 4; - this->collider.list[0].dim.modelSphere.radius = 0x16; + this->collider.elements[0].dim.modelSphere.radius = 0x16; Actor_SetScale(thisx, 0.03f); case ENBB_GREEN: thisx->naviEnemyId = 0x1E; @@ -289,12 +393,12 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { EnBb_InitGreen(this, globalCtx); break; } - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; } else { EnBb_SetupFlameTrail(this); } - this->collider.list[0].dim.worldSphere.radius = - this->collider.list[0].dim.modelSphere.radius * this->collider.list[0].dim.scale; + this->collider.elements[0].dim.worldSphere.radius = + this->collider.elements[0].dim.modelSphere.radius * this->collider.elements[0].dim.scale; } void EnBb_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -340,10 +444,10 @@ void EnBb_FlameTrail(EnBb* this, GlobalContext* globalCtx) { this->flamePrimAlpha -= 20; } } - this->actor.posRot.pos = this->actor.parent->pos4; + this->actor.world.pos = this->actor.parent->prevPos; } else { this->timer--; - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.parent->posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.parent->world.rot.y; } } if (this->actor.parent != NULL) { @@ -353,7 +457,7 @@ void EnBb_FlameTrail(EnBb* this, GlobalContext* globalCtx) { void EnBb_SetupDeath(EnBb* this, GlobalContext* globalCtx) { if (this->actor.params <= ENBB_BLUE) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = -7.0f; this->timer = 5; this->actor.shape.rot.x += 0x4E20; @@ -385,7 +489,7 @@ void EnBb_Death(EnBb* this, GlobalContext* globalCtx) { if (!func_8003305C(&this->actor, &this->enPartInfo, globalCtx, sp4E)) { return; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xD0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xD0); } else { if (this->flamePrimAlpha) { if (this->flamePrimAlpha <= 20) { @@ -403,11 +507,11 @@ void EnBb_SetupDamage(EnBb* this) { this->action = BB_DAMAGE; Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE); if (this->actor.params > ENBB_GREEN) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if ((this->actor.bgCheckFlags & 8) == 0) { this->actor.speedXZ = -7.0f; } - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; } if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); @@ -420,7 +524,7 @@ void EnBb_SetupDamage(EnBb* this) { void EnBb_Damage(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); if (this->actor.speedXZ == 0.0f) { - this->actor.shape.unk_08 = 200.0f; + this->actor.shape.yOffset = 200.0f; EnBb_SetupDown(this); } } @@ -443,8 +547,8 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f); - if (this->actor.groundY > -32000.0f) { - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 50.0f + this->flyHeightMod, 1.0f, 0.5f, + if (this->actor.floorHeight > -32000.0f) { + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 50.0f + this->flyHeightMod, 1.0f, 0.5f, 0.0f); } SkelAnime_Update(&this->skelAnime); @@ -455,13 +559,13 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->bobSpeedMod = Rand_ZeroOne() * 4.0f; } } - this->actor.posRot.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod); + this->actor.world.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod); this->bobPhase += 0.2f; Math_SmoothStepToF(&this->actor.speedXZ, this->maxSpeed, 1.0f, 0.5f, 0.0f); - if (Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 300.0f) { - this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); + if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 300.0f) { + this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); } else { this->timer--; if (this->timer <= 0) { @@ -469,10 +573,10 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->flyHeightMod = (s16)(Math_CosF(this->bobPhase) * 10.0f); this->actor.speedXZ = 0.0f; if (this->charge && (this->targetActor == NULL)) { - this->vMoveAngleY = this->actor.posRot.rot.y; - if (this->actor.xzDistToLink < 200.0f) { + this->vMoveAngleY = this->actor.world.rot.y; + if (this->actor.xzDistToPlayer < 200.0f) { Animation_PlayLoop(&this->skelAnime, &D_06000184); - this->vMoveAngleY = this->actor.yawTowardsLink; + this->vMoveAngleY = this->actor.yawTowardsPlayer; } this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; @@ -484,16 +588,16 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->vMoveAngleY = Math_SinF(this->bobPhase) * 65535.0f; } } - if ((this->actor.xzDistToLink < 150.0f) && (this->actionState != BBBLUE_NORMAL)) { + if ((this->actor.xzDistToPlayer < 150.0f) && (this->actionState != BBBLUE_NORMAL)) { if (!this->charge) { Animation_PlayLoop(&this->skelAnime, &D_06000184); this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; - this->vMoveAngleY = this->actor.yawTowardsLink; + this->vMoveAngleY = this->actor.yawTowardsPlayer; this->actionState = this->charge = true; // Sets actionState to BBBLUE_AGGRO } - } else if (this->actor.xzDistToLink < 200.0f) { - this->vMoveAngleY = this->actor.yawTowardsLink; + } else if (this->actor.xzDistToPlayer < 200.0f) { + this->vMoveAngleY = this->actor.yawTowardsPlayer; } if (this->targetActor == NULL) { explosive = EnBb_FindExplosive(globalCtx, this, 300.0f); @@ -503,36 +607,36 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { explosive = NULL; } if (explosive != NULL) { - this->vMoveAngleY = func_8002DA78(&this->actor, explosive); + this->vMoveAngleY = Actor_WorldYawTowardActor(&this->actor, explosive); if ((this->vBombHopPhase == 0) && (explosive != this->targetActor)) { this->vBombHopPhase = -0x8000; this->targetActor = explosive; this->actor.speedXZ *= 0.5f; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x1388, 0); - Math_SmoothStepToF(&this->actor.posRot.pos.x, explosive->posRot.pos.x, 1.0f, 1.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, explosive->posRot.pos.y + 40.0f, 1.0f, 1.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, explosive->posRot.pos.z, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x1388, 0); + Math_SmoothStepToF(&this->actor.world.pos.x, explosive->world.pos.x, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, explosive->world.pos.y + 40.0f, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, explosive->world.pos.z, 1.0f, 1.5f, 0.0f); } else { this->targetActor = NULL; } if (this->vBombHopPhase != 0) { - this->actor.posRot.pos.y += -Math_CosS(this->vBombHopPhase) * 10.0f; + this->actor.world.pos.y += -Math_CosS(this->vBombHopPhase) * 10.0f; this->vBombHopPhase += 0x1000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); } - thisYawToWall = this->actor.wallPolyRot - this->actor.posRot.rot.y; - moveYawToWall = this->actor.wallPolyRot - this->vMoveAngleY; + thisYawToWall = this->actor.wallYaw - this->actor.world.rot.y; + moveYawToWall = this->actor.wallYaw - this->vMoveAngleY; if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & 8) && (ABS(thisYawToWall) > 0x4000 || ABS(moveYawToWall) > 0x4000)) { - this->vMoveAngleY = this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0xBB8, 0); + this->vMoveAngleY = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0xBB8, 0); } } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x3E8, 0); - if ((this->collider.base.acFlags & 2) || (this->collider.base.atFlags & 2)) { - this->vMoveAngleY = this->actor.yawTowardsLink + 0x8000; - if (this->collider.base.acFlags & 2) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x3E8, 0); + if ((this->collider.base.acFlags & AC_HIT) || (this->collider.base.atFlags & AT_HIT)) { + this->vMoveAngleY = this->actor.yawTowardsPlayer + 0x8000; + if (this->collider.base.acFlags & AC_HIT) { afterHitAngle = -0x8000; } else { afterHitAngle = 0x4000; @@ -541,9 +645,9 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { afterHitAngle = -0x4000; } } - this->actor.posRot.rot.y = this->actor.yawTowardsLink + afterHitAngle; - this->collider.base.acFlags &= ~2; - this->collider.base.atFlags &= ~2; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + afterHitAngle; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.base.atFlags &= ~AT_HIT; } if (this->maxSpeed >= 6.0f) { @@ -560,14 +664,14 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { if (((s32)this->skelAnime.curFrame == 0) && (Rand_ZeroOne() < 0.1f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_LAUGH); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnBb_SetupDown(EnBb* this) { Animation_PlayLoop(&this->skelAnime, &D_06000444); this->action = BB_DOWN; this->timer = 200; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actor.bgCheckFlags &= ~1; this->actor.speedXZ = 3.0f; this->flameScaleX = 0.0f; @@ -578,19 +682,18 @@ void EnBb_SetupDown(EnBb* this) { } void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { - s16 yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 8) { if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } if (this->actor.bgCheckFlags & 3) { if (this->actor.params == ENBB_RED) { - s32 floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + s32 floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorType == 2) || (floorType == 3) || (floorType == 9)) { this->moveMode = BBMOVE_HIDDEN; @@ -609,10 +712,10 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 10.0f; } this->actor.bgCheckFlags &= ~1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 7.0f, 2, 2.0f, 0, 0, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.y, -this->actor.yawTowardsLink, 1, 0xBB8, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, -this->actor.yawTowardsPlayer, 1, 0xBB8, 0); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if ((s32)this->skelAnime.curFrame == 5) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_WING); } @@ -634,7 +737,7 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; EnBb_SetupWhite(globalCtx, this); - this->actor.posRot.pos.y -= 60.0f; + this->actor.world.pos.y -= 60.0f; break; } } else { @@ -657,8 +760,8 @@ void EnBb_SetupRed(GlobalContext* globalCtx, EnBb* this) { this->timer = 0; this->actionState = BBRED_WAIT; this->moveMode = BBMOVE_HIDDEN; - this->actor.posRot.pos.y -= 80.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.world.pos.y -= 80.0f; + this->actor.home.pos = this->actor.world.pos; this->actor.velocity.y = this->actor.gravity = this->actor.speedXZ = 0.0f; this->actor.bgCheckFlags &= ~1; this->actor.flags &= ~1; @@ -677,10 +780,10 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { this->timer--; } - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; switch (this->actionState) { case BBRED_WAIT: - if ((func_8002DB48(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) && + if ((Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) && (this->timer == 0)) { this->actor.speedXZ = 5.0f; this->actor.gravity = -1.0f; @@ -701,15 +804,15 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f); if (this->actor.bgCheckFlags & 8) { - yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + yawDiff = this->actor.world.rot.y - this->actor.wallYaw; if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = + this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } if (this->actor.bgCheckFlags & 1) { - floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorType == 2) || (floorType == 3) || (floorType == 9)) { this->moveMode = BBMOVE_HIDDEN; this->timer = 10; @@ -720,11 +823,11 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { if (this->actor.velocity.y > 13.0f) { this->actor.velocity.y = 13.0f; } - this->actor.posRot.rot.y = Math_SinF(this->bobPhase) * 65535.0f; + this->actor.world.rot.y = Math_SinF(this->bobPhase) * 65535.0f; } this->actor.bgCheckFlags &= ~1; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (Actor_GetCollidedExplosive(globalCtx, &this->collider.base) != NULL) { EnBb_SetupDown(this); } @@ -736,8 +839,8 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actionState = BBRED_WAIT; this->timer = 120; - this->actor.posRot.pos = this->actor.initPosRot.pos; - this->actor.shape.rot = this->actor.posRot.rot = this->actor.initPosRot.rot; + this->actor.world.pos = this->actor.home.pos; + this->actor.shape.rot = this->actor.world.rot = this->actor.home.rot; EnBb_KillFlameTrail(this); } break; @@ -751,7 +854,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { } void EnBb_FaceWaypoint(EnBb* this) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); } void EnBb_SetWaypoint(EnBb* this, GlobalContext* globalCtx) { @@ -772,7 +875,7 @@ void EnBb_SetWaypoint(EnBb* this, GlobalContext* globalCtx) { void EnBb_SetupWhite(GlobalContext* globalCtx, EnBb* this) { Animation_PlayLoop(&this->skelAnime, &D_06000444); this->actor.speedXZ = 0.0f; - this->actor.posRot.pos.y += 60.0f; + this->actor.world.pos.y += 60.0f; this->flameScaleX = 100.0f; this->action = BB_WHITE; this->waypoint = 0; @@ -786,15 +889,15 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { f32 distL1; f32 vx; f32 vz; - s16 pitch = Math_Vec3f_Pitch(&this->actor.posRot.pos, &this->waypointPos); + s16 pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &this->waypointPos); f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeed; vx = Math_SinS(this->actor.shape.rot.y) * vxz; vz = Math_CosS(this->actor.shape.rot.y) * vxz; - distL1 = Math_SmoothStepToF(&this->actor.posRot.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); - distL1 += Math_SmoothStepToF(&this->actor.posRot.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); - distL1 += Math_SmoothStepToF(&this->actor.posRot.pos.z, this->waypointPos.z, 1.0f, ABS(vz), 0.0f); + distL1 = Math_SmoothStepToF(&this->actor.world.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); + distL1 += Math_SmoothStepToF(&this->actor.world.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); + distL1 += Math_SmoothStepToF(&this->actor.world.pos.z, this->waypointPos.z, 1.0f, ABS(vz), 0.0f); this->bobPhase += (0.05f + (Rand_ZeroOne() * 0.01f)); if (distL1 == 0.0f) { this->timer--; @@ -807,7 +910,7 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { if (this->moveMode != BBMOVE_NORMAL) { Animation_PlayLoop(&this->skelAnime, &D_06000444); } - this->actor.posRot.rot.y += 0x1F40; + this->actor.world.rot.y += 0x1F40; } this->moveMode = BBMOVE_NORMAL; this->maxSpeed = 0.0f; @@ -815,11 +918,11 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { this->moveMode = BBMOVE_NOCLIP; this->maxSpeed = 10.0f; } - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_BITE); - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { EnBb_FaceWaypoint(this); } @@ -843,17 +946,16 @@ void EnBb_InitGreen(EnBb* this, GlobalContext* globalCtx) { this->actionState = BBGREEN_FLAME_ON; this->bobPhase = Rand_ZeroOne(); this->actor.shape.rot.x = this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.params == ENBB_GREEN_BIG) { EnBb_SetWaypoint(this, globalCtx); EnBb_FaceWaypoint(this); } - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, 0, MTXMODE_APPLY); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, 0, MTXMODE_APPLY); Matrix_RotateZ(this->bobPhase, MTXMODE_APPLY); bobOffset.y = this->bobSize; - Matrix_MultVec3f(&bobOffset, &this->actor.posRot.pos); + Matrix_MultVec3f(&bobOffset, &this->actor.world.pos); this->targetActor = NULL; this->action = BB_GREEN; this->actor.speedXZ = 0.0f; @@ -870,41 +972,41 @@ void EnBb_SetupGreen(EnBb* this) { this->actor.speedXZ = 0.0f; this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f; this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; EnBb_SetupAction(this, EnBb_Green); } void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f bobOffset = { 0.0f, 0.0f, 0.0f }; - Vec3f nextPos = player->actor.posRot.pos; + Vec3f nextPos = player->actor.world.pos; nextPos.y += 30.0f; if (this->actor.params == ENBB_GREEN_BIG) { if (this->actor.speedXZ == 0.0f) { - s16 pitch = Math_Vec3f_Pitch(&this->actor.initPosRot.pos, &this->waypointPos); - s16 yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->waypointPos); + s16 pitch = Math_Vec3f_Pitch(&this->actor.home.pos, &this->waypointPos); + s16 yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &this->waypointPos); f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeed; f32 vz; f32 vx; f32 distL1; - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 1, 0x3E8, 0); - vx = Math_SinS(this->actor.posRot.rot.y) * vxz; - distL1 = Math_CosS(this->actor.posRot.rot.y) * vxz; - vz = Math_SmoothStepToF(&this->actor.initPosRot.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); - vz += Math_SmoothStepToF(&this->actor.initPosRot.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); - vz += Math_SmoothStepToF(&this->actor.initPosRot.pos.z, this->waypointPos.z, 1.0f, ABS(distL1), 0.0f); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 0x3E8, 0); + vx = Math_SinS(this->actor.world.rot.y) * vxz; + distL1 = Math_CosS(this->actor.world.rot.y) * vxz; + vz = Math_SmoothStepToF(&this->actor.home.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); + vz += Math_SmoothStepToF(&this->actor.home.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); + vz += Math_SmoothStepToF(&this->actor.home.pos.z, this->waypointPos.z, 1.0f, ABS(distL1), 0.0f); this->bobPhase += (0.05f + (Rand_ZeroOne() * 0.01f)); if (vz == 0.0f) { EnBb_SetWaypoint(this, globalCtx); } this->moveMode = BBMOVE_NOCLIP; this->maxSpeed = 10.0f; - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_BITE); - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } if (Math_CosF(this->bobPhase) == 0.0f) { if (this->charge) { @@ -914,33 +1016,32 @@ void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_LAUGH); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { EnBb_FaceWaypoint(this); } } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 0); - Math_SmoothStepToS(&this->actor.shape.rot.x, Math_Vec3f_Pitch(&this->actor.posRot.pos, &nextPos), 1, 0xFA0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &nextPos), 1, 0xFA0, 0); } SkelAnime_Update(&this->skelAnime); if (Math_CosF(this->bobPhase) <= 0.002f) { this->bobSpeedMod = Rand_ZeroOne() * 0.05f; } - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, 0, MTXMODE_APPLY); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, 0, MTXMODE_APPLY); Matrix_RotateZ(this->bobPhase, MTXMODE_APPLY); bobOffset.y = this->bobSize; Matrix_MultVec3f(&bobOffset, &nextPos); - Math_SmoothStepToF(&this->actor.posRot.pos.x, nextPos.x, 1.0f, this->bobPhase * 0.75f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, nextPos.y, 1.0f, this->bobPhase * 0.75f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, nextPos.z, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, nextPos.x, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, nextPos.y, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, nextPos.z, 1.0f, this->bobPhase * 0.75f, 0.0f); this->bobPhase += 0.1f + this->bobSpeedMod; if (Actor_GetCollidedExplosive(globalCtx, &this->collider.base) || (--this->vFlameTimer == 0)) { this->actionState++; this->timer = (Rand_ZeroOne() * 30.0f) + 60.0f; if (this->vFlameTimer != 0) { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DOWN); } @@ -971,7 +1072,7 @@ void EnBb_SetupStunned(EnBb* this) { if (this->actor.params != ENBB_RED) { if (this->actor.params > ENBB_GREEN) { this->actor.gravity = -2.0f; - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; } this->actor.speedXZ = 0.0f; this->flameScaleX = 0.0f; @@ -996,12 +1097,11 @@ void EnBb_SetupStunned(EnBb* this) { } void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { - s16 yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; if (this->actor.bgCheckFlags & 8) { if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } @@ -1012,10 +1112,10 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { } else { this->actor.velocity.y = 0.0f; } - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 7.0f, 2, 2.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); } - if (this->actor.dmgEffectTimer == 0) { - this->actor.shape.unk_08 = 200.0f; + if (this->actor.colorFilterTimer == 0) { + this->actor.shape.yOffset = 200.0f; if (this->actor.colChkInfo.health != 0) { if ((this->actor.params == ENBB_GREEN) || (this->actor.params == ENBB_GREEN_BIG)) { EnBb_SetupGreen(this); @@ -1033,11 +1133,11 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { } void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; if (this->action != BB_DOWN) { if (this->actor.params >= ENBB_RED) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer + 0x8000; if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); } @@ -1047,13 +1147,13 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { this->actionVar2 = 1; } } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->dmgEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->collider.list[0].body, 0); + func_80035650(&this->actor, &this->collider.elements[0].info, 0); switch (this->dmgEffect) { case 7: - this->actor.freezeTimer = this->collider.list[0].body.acHitItem->toucher.damage; + this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; case 5: this->fireIceTimer = 0x30; //! @bug @@ -1062,7 +1162,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { //! Din's Fire on a white bubble will do just that. The mechanism is complex and described below. goto block_15; case 6: - this->actor.freezeTimer = this->collider.list[0].body.acHitItem->toucher.damage; + this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; break; case 8: case 9: @@ -1087,7 +1187,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { ((this->actor.params != ENBB_WHITE) && (this->flameScaleX < 20.0f))) { Actor_ApplyDamage(&this->actor); } else { - this->collider.base.acFlags |= 2; + this->collider.base.acFlags |= AC_HIT; } } if (this->actor.colChkInfo.health == 0) { @@ -1098,7 +1198,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { EnBb_SetupDeath(this, globalCtx); //! @bug //! Because Din's Fire kills the bubble in a single hit, func_8003426C is never called and - //! dmgEffectParams is never set. And because Din's Fire halts updating during its cutscene, + //! colorFilterParams is never set. And because Din's Fire halts updating during its cutscene, //! EnBb_Death doesn't kill the bubble on the next frame like it should. This combines with //! the bug in EnBb_Draw below to crash the game. } else if ((this->actor.params == ENBB_WHITE) && @@ -1106,7 +1206,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0xC); this->actor.speedXZ = -8.0f; this->maxSpeed = 0.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE); } else if (((this->action == BB_DOWN) && (this->timer < 190)) || ((this->actor.params != ENBB_WHITE) && (this->flameScaleX < 20.0f))) { @@ -1137,22 +1237,22 @@ void EnBb_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_MoveForward(&this->actor); } if (this->moveMode == BBMOVE_NORMAL) { - if ((this->actor.posRot.pos.y - 20.0f) <= this->actor.groundY) { + if ((this->actor.world.pos.y - 20.0f) <= this->actor.floorHeight) { sp34 = 20.0f; } - func_8002E4B4(globalCtx, &this->actor, sp34, 25.0f, 20.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, sp34, 25.0f, 20.0f, 5); } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = - this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y); - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->actor.focus.pos = this->actor.world.pos; + this->collider.elements->dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements->dim.worldSphere.center.y = + this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); + this->collider.elements->dim.worldSphere.center.z = this->actor.world.pos.z; if ((this->action > BB_KILL) && ((this->actor.speedXZ != 0.0f) || (this->action == BB_GREEN))) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if ((this->action > BB_FLAME_TRAIL) && - ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000)) && + ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000)) && (this->moveMode != BBMOVE_HIDDEN)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -1191,21 +1291,21 @@ void EnBb_Draw(Actor* thisx, GlobalContext* globalCtx) { this); if (this->fireIceTimer != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; //! @bug: - //! The purpose of this is to counteract Actor_UpdateAll decrementing dmgEffectTimer. However, + //! The purpose of this is to counteract Actor_UpdateAll decrementing colorFilterTimer. However, //! the above bugs mean unk_2A8 can be nonzero without damage effects ever having been set. - //! This routine will then increment dmgEffectTimer, and on the next frame Actor_Draw will try - //! to draw the unset dmgEffectParams. This causes a divide-by-zero error, crashing the game. + //! This routine will then increment colorFilterTimer, and on the next frame Actor_Draw will try + //! to draw the unset colorFilterParams. This causes a divide-by-zero error, crashing the game. if (1) {} this->fireIceTimer--; if ((this->fireIceTimer % 4) == 0) { Vec3f sp70; s32 index = this->fireIceTimer >> 2; - sp70.x = this->actor.posRot.pos.x + sFireIceOffsets[index].x; - sp70.y = this->actor.posRot.pos.y + sFireIceOffsets[index].y; - sp70.z = this->actor.posRot.pos.z + sFireIceOffsets[index].z; + sp70.x = this->actor.world.pos.x + sFireIceOffsets[index].x; + sp70.y = this->actor.world.pos.y + sFireIceOffsets[index].y; + sp70.z = this->actor.world.pos.z + sFireIceOffsets[index].z; if ((this->dmgEffect != 7) && (this->dmgEffect != 5)) { EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &sp70, 0x96, 0x96, 0x96, 0xFA, 0xEB, diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index c76f3f6abf..d12fd825fe 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -41,7 +41,7 @@ typedef struct EnBb { /* 0x02A8 */ s16 fireIceTimer; /* 0x02AA */ u8 dmgEffect; /* 0x02AC */ ColliderJntSph collider; - /* 0x02CC */ ColliderJntSphItem elements[1]; + /* 0x02CC */ ColliderJntSphElement elements[1]; /* 0x030C */ struct_80032E24 enPartInfo; /* 0x0324 */ Actor* targetActor; } EnBb; // size = 0x0328 diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index ba34146f4b..d7b3473eda 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_0601D950; /* const ActorInit En_Bdfire_InitVars = { 0, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_KINGDODONGO, sizeof(EnBdfire), diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 028ee627db..8dbad73d8a 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06006BC0; /* const ActorInit En_Bigokuta_InitVars = { ACTOR_EN_BIGOKUTA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BIGOKUTA, sizeof(EnBigokuta), @@ -28,6 +28,53 @@ const ActorInit En_Bigokuta_InitVars = { (ActorFunc)EnBigokuta_Update, (ActorFunc)EnBigokuta_Draw, }; + +static ColliderJntSphElementInit D_809BF3D4[1] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 45, -30 }, 75 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809BF3F8 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_809BF3D4, +}; + +static ColliderCylinderInit D_809BF408 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x08 }, + { 0xFFCFFFE7, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 50, 100, 0, { 30, 0, 12 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s") diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 602f82a146..0c0681cec2 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_06005848; /* const ActorInit En_Bili_InitVars = { ACTOR_EN_BILI, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BL, sizeof(EnBili), @@ -26,6 +26,26 @@ const ActorInit En_Bili_InitVars = { (ActorFunc)EnBili_Update, (ActorFunc)EnBili_Draw, }; + +static ColliderCylinderInit D_809C1640 = { + { + COLTYPE_HIT8, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 9, 28, -20, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s") diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c index 23216f98c1..88c48dd12d 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -22,7 +22,7 @@ void func_809C1CAC(EnBird* this, s16 params); const ActorInit En_Bird_InitVars = { ACTOR_EN_BIRD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BIRD, sizeof(EnBird), @@ -33,7 +33,7 @@ const ActorInit En_Bird_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), }; extern AnimationHeader D_0600006C; @@ -49,7 +49,7 @@ void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, NULL, NULL, 0); - ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawFunc_Circle, 4); + ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawCircle, 4); this->unk_194 = 0; this->unk_198 = 0; this->unk_1C0 = 0x9C4; @@ -80,7 +80,7 @@ void func_809C1CAC(EnBird* this, s16 params) { void func_809C1D60(EnBird* this, GlobalContext* globalCtx) { f32 fVar2 = sinf(this->unk_1B4); - this->actor.shape.unk_08 = this->actor.shape.unk_08 + fVar2 * this->unk_1A0; + this->actor.shape.yOffset = this->actor.shape.yOffset + fVar2 * this->unk_1A0; Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); if (this->unk_19C != 0) { @@ -102,18 +102,18 @@ void func_809C1E00(EnBird* this, s16 params) { void func_809C1E40(EnBird* this, GlobalContext* globalCtx) { f32 fVar4 = sinf(this->unk_1B4); - this->actor.shape.unk_08 += fVar4 * this->unk_1A0; + this->actor.shape.yOffset += fVar4 * this->unk_1A0; Math_SmoothStepToF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f); - if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) || this->unk_198 < 4) { - Math_StepToAngleS(&this->actor.posRot.rot.y, - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos), this->unk_1C0); + if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) || this->unk_198 < 4) { + Math_StepToAngleS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos), + this->unk_1C0); } else { fVar4 = sinf(this->unk_1B4); - this->actor.posRot.rot.y += (s16)(fVar4 * this->unk_1A4); + this->actor.world.rot.y += (s16)(fVar4 * this->unk_1A4); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; SkelAnime_Update(&this->skelAnime); this->unk_198 -= 1; if (this->unk_198 < 0) { diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 4dcb2e36eb..0a3eee46ca 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -22,7 +22,7 @@ void EnBlkobj_DoNothing(EnBlkobj* this, GlobalContext* globalCtx); const ActorInit En_Blkobj_InitVars = { ACTOR_EN_BLKOBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BLKOBJ, sizeof(EnBlkobj), @@ -85,7 +85,7 @@ void EnBlkobj_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnBlkobj_Wait(EnBlkobj* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->dyna.actor.xzDistToLink < 120.0f) { + if (this->dyna.actor.xzDistToPlayer < 120.0f) { EnBlkobj_SetupAction(this, EnBlkobj_SpawnDarkLink); } player->stateFlags2 |= 0x04000000; @@ -93,8 +93,8 @@ void EnBlkobj_Wait(EnBlkobj* this, GlobalContext* globalCtx) { void EnBlkobj_SpawnDarkLink(EnBlkobj* this, GlobalContext* globalCtx) { if (!(this->dyna.actor.flags & 0x40)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_TORCH2, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.yawTowardsLink, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_TORCH2, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.yawTowardsPlayer, 0, 0); EnBlkobj_SetupAction(this, EnBlkobj_DarkLinkFight); } @@ -104,7 +104,7 @@ void EnBlkobj_DarkLinkFight(EnBlkobj* this, GlobalContext* globalCtx) { s32 alphaMod; if (this->timer == 0) { - if (Actor_Find(&globalCtx->actorCtx, ACTOR_EN_TORCH2, ACTORTYPE_BOSS) == NULL) { + if (Actor_Find(&globalCtx->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) { Flags_SetClear(globalCtx, this->dyna.actor.room); this->timer++; } diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 22fb09a256..84be5871fd 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -21,7 +21,7 @@ void EnBom_WaitForRelease(EnBom* this, GlobalContext* globalCtx); const ActorInit En_Bom_InitVars = { ACTOR_EN_BOM, - ACTORTYPE_EXPLOSIVES, + ACTORCAT_EXPLOSIVE, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBom), @@ -32,28 +32,56 @@ const ActorInit En_Bom_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x29, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x0003F828, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 6, 11, 14, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000008, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK0, 0x39, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 61536, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP), }; extern Gfx D_04007A50[]; // gold fuse cap @@ -67,17 +95,17 @@ void EnBom_Init(Actor* thisx, GlobalContext* globalCtx) { EnBom* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - ActorShape_Init(&thisx->shape, 700.0f, ActorShadow_DrawFunc_Circle, 16.0f); + ActorShape_Init(&thisx->shape, 700.0f, ActorShadow_DrawCircle, 16.0f); thisx->colChkInfo.mass = 200; - thisx->colChkInfo.unk_10 = 5; - thisx->colChkInfo.unk_12 = 0xA; + thisx->colChkInfo.cylRadius = 5; + thisx->colChkInfo.cylHeight = 10; this->timer = 70; this->flashSpeedScale = 7; Collider_InitCylinder(globalCtx, &this->bombCollider); Collider_InitJntSph(globalCtx, &this->explosionCollider); Collider_SetCylinder(globalCtx, &this->bombCollider, thisx, &sCylinderInit); Collider_SetJntSph(globalCtx, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]); - this->explosionColliderItems[0].body.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; + this->explosionColliderItems[0].info.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; thisx->shape.rot.z &= 0xFF; if (thisx->shape.rot.z & 0x80) { @@ -108,9 +136,8 @@ void EnBom_Move(EnBom* this, GlobalContext* globalCtx) { // rebound bomb off the wall it hits if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { - if (ABS((s16)(this->actor.wallPolyRot - this->actor.posRot.rot.y)) > 0x4000) { - this->actor.posRot.rot.y = - ((this->actor.wallPolyRot - this->actor.posRot.rot.y) + this->actor.wallPolyRot) - 0x8000; + if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) { + this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000; } Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_BOUND); Actor_MoveForward(&this->actor); @@ -145,12 +172,12 @@ void EnBom_WaitForRelease(EnBom* this, GlobalContext* globalCtx) { void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) { Player* player; - if (this->explosionCollider.list->dim.modelSphere.radius == 0) { + if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } - this->explosionCollider.list->dim.worldSphere.radius += this->actor.shape.rot.z + 8; + this->explosionCollider.elements[0].dim.worldSphere.radius += this->actor.shape.rot.z + 8; if (this->actor.params == BOMB_EXPLOSION) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base); @@ -215,20 +242,20 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); } - if ((thisx->xzDistToLink >= 20.0f) || (ABS(thisx->yDistToLink) >= 80.0f)) { + if ((thisx->xzDistToPlayer >= 20.0f) || (ABS(thisx->yDistToPlayer) >= 80.0f)) { this->bumpOn = true; } this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 15.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 15.0f, 0x1F); if (thisx->params == BOMB_BODY) { if (this->timer < 63) { dustAccel.y = 0.2f; // spawn spark effect on even frames - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 17.0f; if ((globalCtx->gameplayFrames % 2) == 0) { EffectSsGSpk_SpawnFuse(globalCtx, thisx, &effPos, &effVelocity, &effAccel); @@ -240,20 +267,20 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002829C(globalCtx, &effPos, &effVelocity, &dustAccel, &dustColor, &dustColor, 50, 5); } - if ((this->bombCollider.base.acFlags & 2) || - ((this->bombCollider.base.maskA & 2) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) && + (this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) { this->timer = 0; thisx->shape.rot.z = 0; } else { // if a lit stick touches the bomb, set timer to 100 // these bombs never have a timer over 70, so this isnt used - if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) { + if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->world.pos, 30.0f, 50.0f)) { this->timer = 100; } } dustAccel.y = 0.2f; - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; // double bomb flash speed and adjust red color at certain times during the countdown @@ -273,7 +300,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->timer == 0) { - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; if (Actor_HasParent(thisx, globalCtx)) { @@ -283,8 +310,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsBomb2_SpawnLayered(globalCtx, &effPos, &effVelocity, &bomb2Accel, 100, (thisx->shape.rot.z * 6) + 19); - effPos.y = thisx->groundY; - if (thisx->groundY > BGCHECK_Y_MIN) { + effPos.y = thisx->floorHeight; + if (thisx->floorHeight > BGCHECK_Y_MIN) { EffectSsBlast_SpawnWhiteShockwave(globalCtx, &effPos, &effVelocity, &effAccel); } @@ -300,10 +327,10 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(thisx, 20.0f); + Actor_SetFocus(thisx, 20.0f); if (thisx->params <= BOMB_BODY) { - Collider_CylinderUpdate(thisx, &this->bombCollider); + Collider_UpdateCylinder(thisx, &this->bombCollider); // if link is not holding the bomb anymore and bump conditions are met, subscribe to OC if (!Actor_HasParent(thisx, globalCtx) && this->bumpOn) { @@ -350,7 +377,7 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->flashIntensity, 0, 40, 255); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, (s16)this->flashIntensity, 0, 40, 255); gSPDisplayList(POLY_OPA_DISP++, D_04007860); - func_800628A4(0, &this->explosionCollider); + Collider_UpdateSpheres(0, &this->explosionCollider); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bom.c", 951); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index 6660253089..7de3e925c3 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -12,7 +12,7 @@ typedef struct EnBom { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder bombCollider; /* 0x0198 */ ColliderJntSph explosionCollider; - /* 0x01B8 */ ColliderJntSphItem explosionColliderItems[1]; + /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1]; /* 0x01F8 */ s16 timer; /* 0x01FA */ s16 flashSpeedScale; /* 0x01FC */ f32 flashIntensity; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 6d4bfb7b61..b998343c06 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -42,7 +42,7 @@ extern AnimationHeader D_060072AC; const ActorInit En_Bom_Bowl_Man_InitVars = { ACTOR_EN_BOM_BOWL_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_BG, sizeof(EnBomBowlMan), @@ -61,15 +61,15 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; GlobalContext* globalCtx2 = globalCtx; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_06006EB0, &D_06000710, this->jointTable, this->morphTable, 11); // ☆ Man, my shoulders hurt~ ☆ osSyncPrintf(VT_FGCOL(GREEN) "☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n" VT_RST); // ☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d osSyncPrintf(VT_FGCOL(GREEN) "☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n" VT_RST, globalCtx2->bombchuBowlingStatus); - this->posCopy = this->actor.posRot.pos; - this->actor.shape.unk_08 = -60.0f; + this->posCopy = this->actor.world.pos; + this->actor.shape.yOffset = -60.0f; Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { @@ -83,7 +83,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) { } this->prizeSelect = (s16)Rand_ZeroFloat(4.99f); - this->actor.unk_1F = 1; + this->actor.targetMode = 1; this->actionFunc = EnBomBowMan_SetupWaitAsleep; } @@ -106,9 +106,9 @@ void EnBomBowMan_WaitAsleep(EnBomBowlMan* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = EnBomBowMan_TalkAsleep; } else { - yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); - if (!(this->actor.xzDistToLink > 120.0f) && (yawDiff < 0x4300)) { + if (!(this->actor.xzDistToPlayer > 120.0f) && (yawDiff < 0x4300)) { func_8002F2CC(&this->actor, globalCtx, 120.0f); } } @@ -238,7 +238,7 @@ void EnBomBowMan_RunGame(EnBomBowlMan* this, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 中央HIT!!!! ☆☆☆☆☆ \n" VT_RST); } if ((globalCtx->bombchuBowlingStatus == -1) && - (globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].length == 0) && (this->bowlPit->status == 0) && + (globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length == 0) && (this->bowlPit->status == 0) && (this->wallStatus[0] != 1) && (this->wallStatus[1] != 1)) { this->gameResult = 2; // Lost // Bombchu lost @@ -269,8 +269,8 @@ void EnBomBowMan_RunGame(EnBomBowlMan* this, GlobalContext* globalCtx) { this->actionFunc = func_809C41FC; } } else { - yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); - if (!(this->actor.xzDistToLink > 120.0f) && (yawDiff < 0x4300)) { + yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); + if (!(this->actor.xzDistToPlayer > 120.0f) && (yawDiff < 0x4300)) { func_8002F2CC(&this->actor, globalCtx, 120.0f); } } @@ -454,8 +454,8 @@ void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx) { EnBomBowlMan* this = THIS; this->timer++; - this->actor.posRot2.pos.y = 60.0f; - Actor_SetHeight(&this->actor, 60.0f); + this->actor.focus.pos.y = 60.0f; + Actor_SetFocus(&this->actor, 60.0f); switch (this->eyeMode) { case CHU_GIRL_EYES_ASLEEP: @@ -483,7 +483,7 @@ void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx) { } } - func_80038290(globalCtx, &this->actor, &this->unk_218, &this->unk_224, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_218, &this->unk_224, this->actor.focus.pos); break; } diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 3a764a4dba..9ea4a5b993 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -24,7 +24,7 @@ static s32 sGetItemIds[] = { GI_BOMB_BAG_30, GI_HEART_PIECE, GI_BOMBCHUS_10, GI_ const ActorInit En_Bom_Bowl_Pit_InitVars = { ACTOR_EN_BOM_BOWL_PIT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBomBowlPit), @@ -55,7 +55,7 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { Vec3f chuPosDiff; if (globalCtx->cameraPtrs[0]->setting == 0x15) { - chu = (EnBomChu*)globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + chu = (EnBomChu*)globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (chu != NULL) { if ((&chu->actor == &this->actor) || (chu->actor.id != ACTOR_EN_BOM_CHU)) { @@ -63,9 +63,9 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { continue; } - chuPosDiff.x = chu->actor.posRot.pos.x - this->actor.posRot.pos.x; - chuPosDiff.y = chu->actor.posRot.pos.y - this->actor.posRot.pos.y; - chuPosDiff.z = chu->actor.posRot.pos.z - this->actor.posRot.pos.z; + chuPosDiff.x = chu->actor.world.pos.x - this->actor.world.pos.x; + chuPosDiff.y = chu->actor.world.pos.y - this->actor.world.pos.y; + chuPosDiff.z = chu->actor.world.pos.z - this->actor.world.pos.z; if (((fabsf(chuPosDiff.x) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.y) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.z) < 40.0f) || (BREG(2)))) { @@ -147,8 +147,8 @@ void EnBomBowlPit_CameraDollyIn(EnBomBowlPit* this, GlobalContext* globalCtx) { void EnBomBowlPit_SpawnPrize(EnBomBowlPit* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->exItem = (EnExItem*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_EX_ITEM, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z - 70.0f, 0, 0, 0, this->prizeIndex); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z - 70.0f, 0, 0, 0, this->prizeIndex); if (this->exItem != NULL) { this->actionFunc = EnBomBowlPit_SetupGivePrize; } diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 6880033acd..621ac46118 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_04007E10; /* const ActorInit En_Bom_Chu_InitVars = { ACTOR_EN_BOM_CHU, - ACTORTYPE_EXPLOSIVES, + ACTORCAT_EXPLOSIVE, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBomChu), @@ -23,6 +23,33 @@ const ActorInit En_Bom_Chu_InitVars = { (ActorFunc)EnBomChu_Update, (ActorFunc)EnBomChu_Draw, }; + +static ColliderJntSphElementInit D_809C6D30[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 12 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809C6D54 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_1 | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 1, + D_809C6D30, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Init.s") diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 97786c504f..1724346480 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -24,7 +24,7 @@ void EnBombf_SetupGrowBomb(EnBombf* this, s16 params); const ActorInit En_Bombf_InitVars = { ACTOR_EN_BOMBF, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOMBF, sizeof(EnBombf), @@ -35,22 +35,50 @@ const ActorInit En_Bombf_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x29, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x0003F828, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 9, 18, 10, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000008, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x39, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; extern Gfx D_06000340[]; @@ -77,27 +105,27 @@ void EnBombf_Init(Actor* thisx, GlobalContext* globalCtx) { shapeUnk10 = 1000.0f; } - ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawFunc_Circle, 12.0f); - thisx->posRot2.pos = thisx->posRot.pos; + ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawCircle, 12.0f); + thisx->focus.pos = thisx->world.pos; - if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORTYPE_BG, 10000.0f) != NULL) { + if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORCAT_BG, 10000.0f) != NULL) { thisx->flags |= 0x20; } - thisx->colChkInfo.unk_10 = 10.0f; - thisx->colChkInfo.unk_12 = 10; - thisx->unk_1F = 0; + thisx->colChkInfo.cylRadius = 10.0f; + thisx->colChkInfo.cylHeight = 10; + thisx->targetMode = 0; if (thisx->params == BOMBFLOWER_BODY) { this->timer = 140; this->flashSpeedScale = 15; thisx->gravity = -1.5f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_EXPLOSIVES); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_EXPLOSIVE); thisx->colChkInfo.mass = 200; thisx->flags &= ~1; EnBombf_SetupAction(this, EnBombf_Move); } else { - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->bumpOn = true; this->flowerBombScale = 1.0f; EnBombf_SetupGrowBomb(this, thisx->params); @@ -127,11 +155,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { if (this->flowerBombScale >= 1.0f) { if (Actor_HasParent(&this->actor, globalCtx)) { - bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + bombFlower = (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { - func_8002F5C4(&this->actor, bombFlower, globalCtx); + func_8002F5C4(&this->actor, &bombFlower->actor, globalCtx); this->timer = 180; this->flowerBombScale = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_PL_PULL_UP_ROCK); @@ -143,13 +170,13 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { this->actor.parent = NULL; player->stateFlags1 &= ~0x800; } - } else if (this->bombCollider.base.acFlags & 2) { - this->bombCollider.base.acFlags &= ~2; + } else if (this->bombCollider.base.acFlags & AC_HIT) { + this->bombCollider.base.acFlags &= ~AC_HIT; - if (this->bombCollider.base.ac->type != ACTORTYPE_BOSS) { + if (this->bombCollider.base.ac->category != ACTORCAT_BOSS) { bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { bombFlower->unk_200 = 1; bombFlower->timer = 0; @@ -159,10 +186,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { } } } else { - if (Player_IsBurningStickInRange(globalCtx, &this->actor.posRot.pos, 30.0f, 50.0f)) { + if (Player_IsBurningStickInRange(globalCtx, &this->actor.world.pos, 30.0f, 50.0f)) { bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { bombFlower->timer = 100; this->timer = 180; @@ -178,7 +205,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->interactRangeActor = NULL; this->actor.parent = NULL; player->stateFlags1 &= ~0x800; - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; } } } @@ -196,7 +223,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->interactRangeActor = NULL; this->actor.parent = NULL; player->stateFlags1 &= ~0x800; - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; } } } @@ -239,13 +266,14 @@ void EnBombf_WaitForRelease(EnBombf* this, GlobalContext* globalCtx) { void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) { Player* player; - if (this->explosionCollider.list->dim.modelSphere.radius == 0) { + if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } - this->explosionCollider.list->dim.modelSphere.radius += 8; - this->explosionCollider.list->dim.worldSphere.radius = this->explosionCollider.list->dim.modelSphere.radius; + this->explosionCollider.elements[0].dim.modelSphere.radius += 8; + this->explosionCollider.elements[0].dim.worldSphere.radius = + this->explosionCollider.elements[0].dim.modelSphere.radius; if (this->actor.params == BOMBFLOWER_EXPLOSION) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base); @@ -304,7 +332,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((!this->bumpOn) && (!Actor_HasParent(thisx, globalCtx)) && - ((thisx->xzDistToLink >= 20.0f) || (ABS(thisx->yDistToLink) >= 80.0f))) { + ((thisx->xzDistToPlayer >= 20.0f) || (ABS(thisx->yDistToPlayer) >= 80.0f))) { this->bumpOn = true; } @@ -316,7 +344,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->gravity != 0.0f) { DREG(6) = 1; - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; } @@ -329,33 +357,33 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { // rebound bomb off the wall it hits if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & 8)) { - if (ABS((s16)(thisx->wallPolyRot - thisx->posRot.rot.y)) > 0x4000) { + if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) { if (1) {} - thisx->posRot.rot.y = ((thisx->wallPolyRot - thisx->posRot.rot.y) + thisx->wallPolyRot) - 0x8000; + thisx->world.rot.y = ((thisx->wallYaw - thisx->world.rot.y) + thisx->wallYaw) - 0x8000; } Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_BOUND); Actor_MoveForward(thisx); DREG(6) = 1; - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; thisx->speedXZ *= 0.7f; thisx->bgCheckFlags &= ~8; } - if ((this->bombCollider.base.acFlags & 2) || - ((this->bombCollider.base.maskA & 2) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) && + (this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) { this->unk_200 = 1; this->timer = 0; } else { // if a lit stick touches the bomb, set timer to 100 - if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) { + if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->world.pos, 30.0f, 50.0f)) { this->timer = 100; } } if (this->unk_200 != 0) { dustAccel.y = 0.2f; - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 25.0f; if (this->timer < 127) { // spawn spark effect on even frames @@ -384,7 +412,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->timer == 0) { - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; @@ -394,8 +422,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsBomb2_SpawnLayered(globalCtx, &effPos, &effVelocity, &bomb2Accel, 100, 19); - effPos.y = thisx->groundY; - if (thisx->groundY > BGCHECK_Y_MIN) { + effPos.y = thisx->floorHeight; + if (thisx->floorHeight > BGCHECK_Y_MIN) { EffectSsBlast_SpawnWhiteShockwave(globalCtx, &effPos, &effVelocity, &effAccel); } @@ -411,12 +439,12 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 10.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 10.0f; if (thisx->params <= BOMBFLOWER_BODY) { - Collider_CylinderUpdate(thisx, &this->bombCollider); + Collider_UpdateCylinder(thisx, &this->bombCollider); if ((this->flowerBombScale >= 1.0f) && (this->bumpOn)) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bombCollider.base); @@ -482,7 +510,7 @@ void EnBombf_Draw(Actor* thisx, GlobalContext* globalCtx) { SEGMENTED_TO_VIRTUAL(EnBombf_NewMtxDList(globalCtx->state.gfxCtx, globalCtx))); gSPDisplayList(POLY_OPA_DISP++, D_06000408); } else { - func_800628A4(0, &this->explosionCollider); + Collider_UpdateSpheres(0, &this->explosionCollider); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bombf.c", 1063); diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 8ef4078829..0ca2841b37 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -12,7 +12,7 @@ typedef struct EnBombf { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder bombCollider; /* 0x0198 */ ColliderJntSph explosionCollider; - /* 0x01B8 */ ColliderJntSphItem explosionColliderItems[1]; + /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1]; /* 0x01F8 */ s16 timer; /* 0x01FC */ EnBombfActionFunc actionFunc; /* 0x0200 */ s32 unk_200; diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 04d8d1a561..5a28ab7e6d 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -19,7 +19,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx); const ActorInit En_Boom_InitVars = { ACTOR_EN_BOOM, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBoom), @@ -30,13 +30,27 @@ const ActorInit En_Boom_InitVars = { }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, - { 0 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000010, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE), + ICHAIN_S8(targetMode, 5, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), }; @@ -114,13 +128,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // If the boomerang is moving toward a targeted actor, handle setting the proper x and y angle to fly toward it. if (target != NULL) { - yawTarget = func_8002DAC0(&this->actor, &target->posRot2.pos); - yawDiff = this->actor.posRot.rot.y - yawTarget; + yawTarget = Actor_WorldYawTowardPoint(&this->actor, &target->focus.pos); + yawDiff = this->actor.world.rot.y - yawTarget; - pitchTarget = func_8002DB28(&this->actor, &target->posRot2.pos); - pitchDiff = this->actor.posRot.rot.x - pitchTarget; + pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &target->focus.pos); + pitchDiff = this->actor.world.rot.x - pitchTarget; - distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &target->posRot2.pos)) * 0.005f; + distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &target->focus.pos)) * 0.005f; if (distXYZScale < 0.12f) { distXYZScale = 0.12f; } @@ -131,8 +145,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // the moveTo pointer is nulled and it flies off in a seemingly random direction. this->moveTo = NULL; } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); - Math_ScaledStepToS(&this->actor.posRot.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); + Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); + Math_ScaledStepToS(&this->actor.world.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); } } @@ -142,8 +156,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { func_8002F974(this, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG); // If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up - collided = this->collider.base.atFlags & 0x2; - collided = !!collided; + collided = this->collider.base.atFlags & AT_HIT; + collided = !!(collided); if (collided) { if (((this->collider.base.at->id == ACTOR_EN_ITEM00) || (this->collider.base.at->id == ACTOR_EN_SI))) { this->grabbed = this->collider.base.at; @@ -156,14 +170,14 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly. // Otherwise handle grabbing and colliding. if (DECR(this->returnTimer) == 0) { - distFromLink = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot2.pos); + distFromLink = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos); this->moveTo = player; // If the boomerang is less than 40 units away from Link, he can catch it. if (distFromLink < 40.0f) { target = this->grabbed; if (target != NULL) { - Math_Vec3f_Copy(&target->posRot.pos, &player->actor.posRot.pos); + Math_Vec3f_Copy(&target->world.pos, &player->actor.world.pos); // If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link. // Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it. @@ -179,13 +193,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else { - collided = this->collider.base.atFlags & 0x2; - collided = !!collided; + collided = (this->collider.base.atFlags & AT_HIT); + collided = (!!(collided)); if (collided) { // Copy the position from the prevous frame to the boomerang to start the bounce back. - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); } else { - collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.pos4, &this->actor.posRot.pos, + collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos, &hitPoint, &this->actor.wallPoly, 1, 1, 1, 1, &hitDynaID); if (collided) { @@ -198,7 +212,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { hitActor->id == ACTOR_BG_BDAN_OBJECTS && hitActor->params == 0)) { collided = false; } else { - func_80062D60(globalCtx, &hitPoint); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &hitPoint); } } } @@ -206,8 +220,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // If the boomerang needs to bounce back, set x and y angle accordingly. // Set timer to 0 and set return actor to player so it goes back to Link. if (collided) { - this->actor.posRot.rot.x = -this->actor.posRot.rot.x; - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.x = -this->actor.world.rot.x; + this->actor.world.rot.y += 0x8000; this->moveTo = player; this->returnTimer = 0; } @@ -220,7 +234,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { if (target->update == NULL) { this->grabbed = NULL; } else { - Math_Vec3f_Copy(&target->posRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&target->world.pos, &this->actor.world.pos); } } } @@ -231,7 +245,7 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x20000000)) { this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); this->activeTimer = this->activeTimer + 1; } } @@ -245,9 +259,9 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_boom.c", 567); - Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateZ(0.7669904f, MTXMODE_APPLY); - Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY); + Matrix_RotateX(this->actor.world.rot.x * 0.0000958738f, MTXMODE_APPLY); Matrix_MultVec3f(&sMultVec1, &vec1); Matrix_MultVec3f(&sMultVec2, &vec2); diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index d7c73d8183..8fea984f16 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -62,7 +62,7 @@ extern CollisionHeader D_06005FC8; const ActorInit En_Box_InitVars = { ACTOR_EN_BOX, - ACTORTYPE_CHEST, + ACTORCAT_CHEST, FLAGS, OBJECT_BOX, sizeof(EnBox), @@ -75,7 +75,7 @@ const ActorInit En_Box_InitVars = { static AnimationHeader* D_809CA800[4] = { &D_0600024C, &D_06000128, &D_0600043C, &D_0600043C }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_STOP), + ICHAIN_U8(targetMode, 0, ICHAIN_STOP), }; static s32 sUnused; @@ -90,11 +90,11 @@ void EnBox_ClipToGround(EnBox* this, GlobalContext* globalCtx) { s32* bgId; Vec3f pos; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 1.0f; newY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->dyna.actor, &pos); if (newY != BGCHECK_Y_MIN) { - this->dyna.actor.posRot.pos.y = newY; + this->dyna.actor.world.pos.y = newY; } } @@ -122,7 +122,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; - this->switchFlag = this->dyna.actor.posRot.rot.z; + this->switchFlag = this->dyna.actor.world.rot.z; this->dyna.actor.minVelocityY = -50.0f; if (globalCtx2) {} // helps the compiler store globalCtx2 into s1 @@ -149,7 +149,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { EnBox_SetupAction(this, EnBox_AppearOnRoomClear); func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) { @@ -157,14 +157,14 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.flags |= 0x2000000; func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx2, this->switchFlag)) { EnBox_SetupAction(this, EnBox_AppearOnSwitchFlag); func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else { @@ -176,8 +176,8 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND; } - this->dyna.actor.posRot.rot.y += 0x8000; - this->dyna.actor.initPosRot.rot.z = this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = 0; + this->dyna.actor.world.rot.y += 0x8000; + this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; SkelAnime_Init(globalCtx2, &this->skelanime, &D_060047D8, anim, this->jointTable, this->morphTable, 5); Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f); @@ -188,11 +188,11 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { case ENBOX_TYPE_ROOM_CLEAR_SMALL: case ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL: Actor_SetScale(&this->dyna.actor, 0.005f); - Actor_SetHeight(&this->dyna.actor, 20.0f); + Actor_SetFocus(&this->dyna.actor, 20.0f); break; default: Actor_SetScale(&this->dyna.actor, 0.01f); - Actor_SetHeight(&this->dyna.actor, 40.0f); + Actor_SetFocus(&this->dyna.actor, 40.0f); } } @@ -206,7 +206,7 @@ void EnBox_RandomDustKinematic(EnBox* this, Vec3f* pos, Vec3f* velocity, Vec3f* f32 randomRadius = Rand_ZeroOne() * 25.0f; s16 randomAngle = Rand_ZeroOne() * 0x10000; - *pos = this->dyna.actor.posRot.pos; + *pos = this->dyna.actor.world.pos; pos->x += Math_SinS(randomAngle) * randomRadius; pos->z += Math_CosS(randomAngle) * randomRadius; @@ -256,7 +256,7 @@ void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) { } if (this->dyna.actor.velocity.y < 5.5f) { this->dyna.actor.shape.rot.z = 0; - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; EnBox_SetupAction(this, EnBox_WaitOpen); func_800803F0(globalCtx, this->unk_1AC); } @@ -264,7 +264,7 @@ void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) { &D_801333E8); EnBox_SpawnDust(this, globalCtx); } - yDiff = this->dyna.actor.posRot.pos.y - this->dyna.actor.groundY; + yDiff = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight; if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) { this->dyna.actor.shape.rot.z = yDiff * 50.0f; } else { @@ -299,7 +299,7 @@ void func_809C9700(EnBox* this, GlobalContext* globalCtx) { func_8002F5F0(&this->dyna.actor, globalCtx); } - if (Math3D_Vec3fDistSq(&this->dyna.actor.posRot.pos, &player->actor.posRot.pos) > 22500.0f) { + if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &player->actor.world.pos) > 22500.0f) { this->unk_1FB = ENBOX_STATE_0; } else { if (this->unk_1FB == ENBOX_STATE_0) { @@ -353,7 +353,7 @@ void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx) { Flags_SetClear(globalCtx, this->dyna.actor.room); EnBox_SetupAction(this, EnBox_AppearInit); func_80080480(globalCtx, &this->dyna.actor); - if (func_80080728(globalCtx, this->dyna.actor.type)) { + if (func_80080728(globalCtx, this->dyna.actor.category)) { this->unk_1A8 = 0; } else { this->unk_1A8 = -30; @@ -365,11 +365,11 @@ void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx) { * The chest is ready to appear, possibly waiting for camera/cutscene-related stuff to happen */ void EnBox_AppearInit(EnBox* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->dyna.actor.type || this->unk_1A8 != 0) { + if (func_8005B198() == this->dyna.actor.category || this->unk_1A8 != 0) { EnBox_SetupAction(this, EnBox_AppearAnimation); this->unk_1A8 = 0; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.y, this->dyna.actor.initPosRot.pos.z, 0, 0, 0, 0x0011); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, 0, 0, 0x0011); Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -382,11 +382,11 @@ void EnBox_AppearAnimation(EnBox* this, GlobalContext* globalCtx) { this->unk_1A8++; } else if (this->unk_1A8 < 40) { this->unk_1A8++; - this->dyna.actor.posRot.pos.y += 1.25f; + this->dyna.actor.world.pos.y += 1.25f; } else if (this->unk_1A8 < 60) { this->alpha += 12; this->unk_1A8++; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { EnBox_SetupAction(this, EnBox_WaitOpen); } @@ -420,8 +420,8 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { break; default: Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_DEMO_TRE_LGT, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y, - this->dyna.actor.posRot.pos.z, this->dyna.actor.shape.rot.x, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, + this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 0xFFFF); func_800F5C64(0x92B); } @@ -430,7 +430,7 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { Flags_SetTreasure(globalCtx, this->dyna.actor.params & 0x1F); } else { player = PLAYER; - func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && func_8002DFC8(&this->dyna.actor, 0x3000, globalCtx)) { func_8002F554(&this->dyna.actor, globalCtx, 0 - (this->dyna.actor.params >> 5 & 0x7F)); @@ -497,22 +497,22 @@ void EnBox_SpawnIceSmoke(EnBox* this, GlobalContext* globalCtx) { func_8002F974(&this->dyna.actor, NA_SE_EN_MIMICK_BREATH - SFX_FLAG); if (Rand_ZeroOne() < 0.3f) { f0 = 2.0f * Rand_ZeroOne() - 1.0f; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; if (this->type == ENBOX_TYPE_SMALL || this->type == ENBOX_TYPE_6 || this->type == ENBOX_TYPE_ROOM_CLEAR_SMALL || this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL) { - pos.x += f0 * 10.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x4000); - pos.z += f0 * 10.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x4000); + pos.x += f0 * 10.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x4000); + pos.z += f0 * 10.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x4000); f0 = 2.0f * Rand_ZeroOne() - 1.0f; - vel.x = f0 * 0.8f * Math_SinS(this->dyna.actor.posRot.rot.y); + vel.x = f0 * 0.8f * Math_SinS(this->dyna.actor.world.rot.y); vel.y = 1.8f; - vel.z = f0 * 0.8f * Math_CosS(this->dyna.actor.posRot.rot.y); + vel.z = f0 * 0.8f * Math_CosS(this->dyna.actor.world.rot.y); } else { - pos.x += f0 * 20.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x4000); - pos.z += f0 * 20.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x4000); + pos.x += f0 * 20.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x4000); + pos.z += f0 * 20.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x4000); f0 = 2.0f * Rand_ZeroOne() - 1.0f; - vel.x = f0 * 1.6f * Math_SinS(this->dyna.actor.posRot.rot.y); + vel.x = f0 * 1.6f * Math_SinS(this->dyna.actor.world.rot.y); vel.y = 1.8f; - vel.z = f0 * 1.6f * Math_CosS(this->dyna.actor.posRot.rot.y); + vel.z = f0 * 1.6f * Math_CosS(this->dyna.actor.world.rot.y); } EffectSsIceSmoke_Spawn(globalCtx, &pos, &vel, &accel, 150); } @@ -530,7 +530,7 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(this->movementFlags & ENBOX_MOVE_IMMOBILE)) { Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1C); } switch (this->type) { @@ -538,10 +538,10 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) { case ENBOX_TYPE_6: case ENBOX_TYPE_ROOM_CLEAR_SMALL: case ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL: - Actor_SetHeight(&this->dyna.actor, 20.0f); + Actor_SetFocus(&this->dyna.actor, 20.0f); break; default: - Actor_SetHeight(&this->dyna.actor, 40.0f); + Actor_SetFocus(&this->dyna.actor, 40.0f); } if ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C && this->actionFunc == EnBox_Open && diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index c3ca256a7b..7797c32216 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06001A70; /* const ActorInit En_Brob_InitVars = { ACTOR_EN_BROB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BROB, sizeof(EnBrob), @@ -34,6 +34,26 @@ const ActorInit En_Brob_InitVars = { (ActorFunc)EnBrob_Update, (ActorFunc)EnBrob_Draw, }; + +static ColliderCylinderInit D_809CBA80 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 8000, 11000, -5000, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s") diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 81ca623c93..72e2eaefa2 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -17,7 +17,7 @@ extern Gfx D_06001000[]; const ActorInit En_Bubble_InitVars = { ACTOR_EN_BUBBLE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BUBBLE, sizeof(EnBubble), @@ -27,25 +27,46 @@ const ActorInit En_Bubble_InitVars = { (ActorFunc)EnBubble_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x04 }, { 0xFFCFD753, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0x0000, 0x0000, 0x0000 }, 16 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x04 }, + { 0xFFCFD753, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 16 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00002824, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, - { 0x00, { { 0x0000, 0x0000, 0x0000 }, 16 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00002824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 16 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 2, - sJntSphItemsInit, + sJntSphElementsInit, }; static CollisionCheckInfoInit2 sColChkInfoInit2 = { - 0x01, 0x0002, 0x0019, 0x0019, 0xFF, + 1, 2, 25, 25, MASS_IMMOVABLE, }; static Vec3f sEffectAccel = { 0.0f, -0.5f, 0.0f }; @@ -62,7 +83,7 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) { this->actor.flags |= 1; Actor_SetScale(&this->actor, 1.0f); - this->actor.shape.unk_08 = 16.0f; + this->actor.shape.yOffset = 16.0f; this->graphicRotSpeed = 16.0f; this->graphicEccentricity = 0.08f; this->expansionWidth = dim; @@ -79,12 +100,12 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) { } u32 func_809CBCBC(EnBubble* this) { - ColliderBody* body = &this->colliderSphere.list->body; + ColliderInfo* info = &this->colliderSphere.elements[0].info; - body->toucher.flags = 0x8; - body->toucher.effect = 0; - body->toucher.damage = 4; - body->toucherFlags = 1; + info->toucher.dmgFlags = 0x8; + info->toucher.effect = 0; + info->toucher.damage = 4; + info->toucherFlags = TOUCH_ON; this->actor.velocity.y = 0.0f; return 6; } @@ -96,10 +117,10 @@ u32 func_809CBCEC(EnBubble* this) { } void EnBubble_DamagePlayer(EnBubble* this, GlobalContext* globalCtx) { - s32 damage = -this->colliderSphere.list->body.toucher.damage; + s32 damage = -this->colliderSphere.elements[0].info.toucher.damage; globalCtx->damagePlayer(globalCtx, damage); - func_8002F7A0(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F7A0(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); } s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { @@ -113,14 +134,14 @@ s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->expansionHeight, 4.0f, 0.1f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicRotSpeed, 54.0f, 0.1f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicEccentricity, 0.2f, 0.1f, 1000.0f, 0.0f); - this->actor.shape.unk_08 = ((this->expansionHeight + 1.0f) * 16.0f); + this->actor.shape.yOffset = ((this->expansionHeight + 1.0f) * 16.0f); if (DECR(this->explosionCountdown) != 0) { return -1; } - effectPos.x = this->actor.posRot.pos.x; - effectPos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08; - effectPos.z = this->actor.posRot.pos.z; + effectPos.x = this->actor.world.pos.x; + effectPos.y = this->actor.world.pos.y + this->actor.shape.yOffset; + effectPos.z = this->actor.world.pos.z; for (i = 0; i < 20; i++) { effectVel.x = (Rand_ZeroOne() - 0.5f) * 7.0f; effectVel.y = Rand_ZeroOne() * 7.0f; @@ -128,7 +149,7 @@ s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { EffectSsDtBubble_SpawnCustomColor(globalCtx, &effectPos, &effectVel, &effectAccel, &sEffectPrimColor, &sEffectEnvColor, Rand_S16Offset(100, 50), 0x19, 0); } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0x50); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0x50); this->actor.flags &= ~0x1; return Rand_S16Offset(90, 60); } @@ -191,7 +212,7 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { s32 bgId; u8 bounceCount; - if (this->colliderSphere.list[1].body.bumperFlags & 0x2) { + if (this->colliderSphere.elements[1].info.bumperFlags & BUMP_HIT) { bumpActor = this->colliderSphere.base.ac; this->normalizedBumpVelocity = bumpActor->velocity; EnBubble_Vec3fNormalize(&this->normalizedBumpVelocity); @@ -208,9 +229,9 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { sp54.z = this->velocityFromBounce.z + this->velocityFromBump.z; EnBubble_Vec3fNormalize(&sp54); - sp78.x = this->actor.posRot.pos.x; - sp78.y = this->actor.posRot.pos.y + this->actor.shape.unk_08; - sp78.z = this->actor.posRot.pos.z; + sp78.x = this->actor.world.pos.x; + sp78.y = this->actor.world.pos.y + this->actor.shape.yOffset; + sp78.z = this->actor.world.pos.z; sp6C = sp78; sp6C.x += (sp54.x * 24.0f); @@ -265,11 +286,11 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { } u32 func_809CC648(EnBubble* this) { - if (((this->colliderSphere.base.acFlags & 0x2) != 0) == false) { + if (((this->colliderSphere.base.acFlags & AC_HIT) != 0) == false) { return false; } - this->colliderSphere.base.acFlags &= ~0x2; - if (this->colliderSphere.list[1].body.bumperFlags & 0x2) { + this->colliderSphere.base.acFlags &= ~AC_HIT; + if (this->colliderSphere.elements[1].info.bumperFlags & BUMP_HIT) { this->unk_1F0.x = this->colliderSphere.base.ac->velocity.x / 10.0f; this->unk_1F0.y = this->colliderSphere.base.ac->velocity.y / 10.0f; this->unk_1F0.z = this->colliderSphere.base.ac->velocity.z / 10.0f; @@ -285,8 +306,8 @@ u32 EnBubble_DetectPop(EnBubble* this, GlobalContext* globalCtx) { if (DECR(this->unk_208) != 0 || this->actionFunc == EnBubble_Pop) { return false; } - if (this->colliderSphere.base.maskB & 0x1) { - this->colliderSphere.base.maskB &= ~0x1; + if (this->colliderSphere.base.ocFlags2 & OC2_HIT_PLAYER) { + this->colliderSphere.base.ocFlags2 &= ~OC2_HIT_PLAYER; EnBubble_DamagePlayer(this, globalCtx); this->unk_208 = 8; return true; @@ -295,11 +316,11 @@ u32 EnBubble_DetectPop(EnBubble* this, GlobalContext* globalCtx) { } void func_809CC774(EnBubble* this) { - ColliderJntSphItemDim* dim; + ColliderJntSphElementDim* dim; Vec3f src; Vec3f dest; - dim = &this->colliderSphere.list[0].dim; + dim = &this->colliderSphere.elements[0].dim; src.x = dim->modelSphere.center.x; src.y = dim->modelSphere.center.y; src.z = dim->modelSphere.center.z; @@ -309,17 +330,17 @@ void func_809CC774(EnBubble* this) { dim->worldSphere.center.y = dest.y; dim->worldSphere.center.z = dest.z; dim->worldSphere.radius = dim->modelSphere.radius * (1.0f + this->expansionWidth); - this->colliderSphere.list[1].dim = *dim; + this->colliderSphere.elements[1].dim = *dim; } void EnBubble_Init(Actor* thisx, GlobalContext* globalCtx) { EnBubble* this = THIS; u32 pad; - ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawFunc_Circle, 0.2f); + ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawCircle, 0.2f); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, this->colliderSphereItems); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2); this->actor.naviEnemyId = 0x16; this->bounceDirection.x = Rand_ZeroOne(); this->bounceDirection.y = Rand_ZeroOne(); @@ -344,7 +365,7 @@ void EnBubble_Wait(EnBubble* this, GlobalContext* globalCtx) { this->actionFunc = EnBubble_Pop; } else { EnBubble_Fly(this, globalCtx); - this->actor.shape.unk_08 = ((this->expansionHeight + 1.0f) * 16.0f); + this->actor.shape.yOffset = ((this->expansionHeight + 1.0f) * 16.0f); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); } @@ -352,7 +373,7 @@ void EnBubble_Wait(EnBubble* this, GlobalContext* globalCtx) { void EnBubble_Pop(EnBubble* this, GlobalContext* globalCtx) { if (EnBubble_Explosion(this, globalCtx) >= 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 60, NA_SE_EN_AWA_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); Actor_Kill(&this->actor); } } @@ -363,7 +384,7 @@ void EnBubble_Disappear(EnBubble* this, GlobalContext* globalCtx) { temp_v0 = func_809CBFD4(this); if (temp_v0 >= 0) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->explosionCountdown = temp_v0; this->actionFunc = EnBubble_Regrow; } @@ -371,7 +392,7 @@ void EnBubble_Disappear(EnBubble* this, GlobalContext* globalCtx) { // unused void EnBubble_Regrow(EnBubble* this, GlobalContext* globalCtx) { - if (func_809CC020(this) != 0) { + if (func_809CC020(this)) { this->actionFunc = EnBubble_Wait; } CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); @@ -382,9 +403,9 @@ void EnBubble_Update(Actor* thisx, GlobalContext* globalCtx) { EnBubble* this = THIS; func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 16.0f, 16.0f, 0.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 16.0f, 16.0f, 0.0f, 7); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->actor.shape.unk_08); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset); } void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -412,7 +433,7 @@ void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bubble.c", 1226); if (this->actionFunc != EnBubble_Disappear) { - this->actor.shape.unk_10 = (f32)((this->expansionWidth + 1.0f) * 0.2f); + this->actor.shape.shadowScale = (f32)((this->expansionWidth + 1.0f) * 0.2f); func_809CC774(this); } } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index 2d8c684a57..83b1b81de5 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -12,7 +12,7 @@ typedef struct EnBubble { /* 0x0000 */ Actor actor; /* 0x014C */ EnBubbleActionFunc actionFunc; /* 0x0150 */ ColliderJntSph colliderSphere; - /* 0x0170 */ ColliderJntSphItem colliderSphereItems[2]; + /* 0x0170 */ ColliderJntSphElement colliderSphereItems[2]; /* 0x01F0 */ Vec3f unk_1F0; // set but never used /* 0x01FC */ Vec3f unk_1FC; // randomly generated, set but never used /* 0x0208 */ s16 unk_208; // set to 8 when about to pop diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index b260180e2d..cd24764a7c 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -26,19 +26,31 @@ void EnButte_TransformIntoFairy(EnButte* this, GlobalContext* globalCtx); void EnButte_SetupWaitToDie(EnButte* this); void EnButte_WaitToDie(EnButte* this, GlobalContext* globalCtx); -static ColliderJntSphItemInit sColliderItemInit[] = { - { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x000, 0x00 }, 0x00, 0x00, 0x01 }, - { 0, { { 0, 0, 0 }, 5 }, 100 } } -}; +static ColliderJntSphElementInit sJntSphElementsInit[] = { { { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x000, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 5 }, 100 } } }; static ColliderJntSphInit sColliderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sColliderItemInit, + sJntSphElementsInit, }; const ActorInit En_Butte_InitVars = { ACTOR_EN_BUTTE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(EnButte), @@ -116,8 +128,8 @@ void EnButte_DrawTransformationEffect(EnButte* this, GlobalContext* globalCtx) { Matrix_RotateX(camDir.x * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_RotateZ(camDir.z * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_MultVec3f(&D_809CE3C4, &sp5C); - func_800D1694(this->actor.posRot2.pos.x + sp5C.x, this->actor.posRot2.pos.y + sp5C.y, - this->actor.posRot2.pos.z + sp5C.z, &camDir); + func_800D1694(this->actor.focus.pos.x + sp5C.x, this->actor.focus.pos.y + sp5C.y, this->actor.focus.pos.z + sp5C.z, + &camDir); Matrix_Scale(sTransformationEffectScale, sTransformationEffectScale, sTransformationEffectScale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_choo.c", 317), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -174,22 +186,22 @@ void func_809CD56C(EnButte* this) { static f32 D_809CE3E0[] = { 50.0f, 80.0f, 100.0f }; static f32 D_809CE3EC[] = { 30.0f, 40.0f, 50.0f }; - this->actor.shape.unk_08 += Math_SinS(this->unk_25C) * D_809CE3E0[this->flightParamsIdx] + - Math_SinS(this->unk_25E) * D_809CE3EC[this->flightParamsIdx]; - this->actor.shape.unk_08 = CLAMP(this->actor.shape.unk_08, -2000.0f, 2000.0f); + this->actor.shape.yOffset += Math_SinS(this->unk_25C) * D_809CE3E0[this->flightParamsIdx] + + Math_SinS(this->unk_25E) * D_809CE3EC[this->flightParamsIdx]; + this->actor.shape.yOffset = CLAMP(this->actor.shape.yOffset, -2000.0f, 2000.0f); } void func_809CD634(EnButte* this) { static f32 D_809CE3F8[] = { 15.0f, 20.0f, 25.0f }; static f32 D_809CE404[] = { 7.5f, 10.0f, 12.5f }; - this->actor.shape.unk_08 += Math_SinS(this->unk_25C) * D_809CE3F8[this->flightParamsIdx] + - Math_SinS(this->unk_25E) * D_809CE404[this->flightParamsIdx]; - this->actor.shape.unk_08 = CLAMP(this->actor.shape.unk_08, -500.0f, 500.0f); + this->actor.shape.yOffset += Math_SinS(this->unk_25C) * D_809CE3F8[this->flightParamsIdx] + + Math_SinS(this->unk_25E) * D_809CE404[this->flightParamsIdx]; + this->actor.shape.yOffset = CLAMP(this->actor.shape.yOffset, -500.0f, 500.0f); } void EnButte_Turn(EnButte* this) { - s16 target = this->actor.posRot.rot.y + 0x8000; + s16 target = this->actor.world.rot.y + 0x8000; s16 diff = target - this->actor.shape.rot.y; Math_ScaledStepToS(&this->actor.shape.rot.y, target, ABS(diff) >> 3); @@ -211,8 +223,8 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { f32 animSpeed; s16 rotStep; - distSqFromHome = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z); + distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z); func_809CD56C(this); Math_SmoothStepToF(&this->actor.speedXZ, flightParams->speedXZTarget, flightParams->speedXZScale, flightParams->speedXZStep, 0.0f); @@ -226,25 +238,25 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { } minAnimSpeed = 0.0f; - this->posYTarget = this->actor.initPosRot.pos.y; + this->posYTarget = this->actor.home.pos.y; if ((this->flightParamsIdx != 0) && ((distSqFromHome > maxDistSqFromHome) || (this->timer < 4))) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, flightParams->rotYStep) == 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, flightParams->rotYStep) == 0) { minAnimSpeed = 0.5f; } } else if ((this->unk_257 == 0) && (this->actor.child != NULL) && (this->actor.child != &this->actor)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.child->posRot.pos); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, rotStep) == 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.3f; } } else if (this->unk_257 == 1) { - yaw = this->actor.yawTowardsLink + 0x8000 + (s16)((Rand_ZeroOne() - 0.5f) * 0x6000); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, rotStep) == 0) { + yaw = this->actor.yawTowardsPlayer + 0x8000 + (s16)((Rand_ZeroOne() - 0.5f) * 0x6000); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.4f; } } else { - this->actor.posRot.rot.y += (s16)(sinf(this->unk_25C) * 100.0f); + this->actor.world.rot.y += (s16)(sinf(this->unk_25C) * 100.0f); } EnButte_Turn(this); @@ -259,12 +271,12 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { } if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == 6) && (this->swordDownTimer <= 0) && - ((Math3D_Dist2DSq(player->actor.posRot.pos.x, player->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z) < SQ(120.0f)) || - (this->actor.xzDistToLink < 60.0f))) { + ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z) < SQ(120.0f)) || + (this->actor.xzDistToPlayer < 60.0f))) { EnButte_SetupFollowLink(this); this->unk_257 = 2; - } else if (this->actor.xzDistToLink < 120.0) { + } else if (this->actor.xzDistToPlayer < 120.0) { this->unk_257 = 1; } else { this->unk_257 = 0; @@ -297,17 +309,17 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) { swordTip.y = player->swordInfo[0].tip.y; swordTip.z = player->swordInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000) != 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) { if (globalCtx->gameplayFrames % 2) { - this->actor.posRot.rot.y += (s16)(sinf(this->unk_25C) * 60.0f); + this->actor.world.rot.y += (s16)(sinf(this->unk_25C) * 60.0f); } } else { minAnimSpeed = 0.3f; } } - this->posYTarget = MAX(player->actor.posRot.pos.y + 30.0f, player->swordInfo[0].tip.y); + this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->swordInfo[0].tip.y); EnButte_Turn(this); @@ -321,14 +333,14 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) { D_809CE410 = -D_809CE410; } - distSqFromHome = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z); + distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z); if (!((player->heldItemActionParam == 6) && (fabsf(player->actor.speedXZ) < 1.8f) && (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) { EnButte_SetupFlyAround(this); } else if (distSqFromHome > SQ(240.0f)) { distSqFromSword = Math3D_Dist2DSq(player->swordInfo[0].tip.x, player->swordInfo[0].tip.z, - this->actor.posRot.pos.x, this->actor.posRot.pos.z); + this->actor.world.pos.x, this->actor.world.pos.z); if (distSqFromSword < SQ(60.0f)) { EnButte_SetupTransformIntoFairy(this); } @@ -348,10 +360,10 @@ void EnButte_TransformIntoFairy(EnButte* this, GlobalContext* globalCtx) { EnButte_UpdateTransformationEffect(); if (this->timer == 5) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); } else if (this->timer == 4) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot2.pos.x, this->actor.posRot2.pos.y, - this->actor.posRot2.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_HEAL_TIMED); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.focus.pos.x, this->actor.focus.pos.y, + this->actor.focus.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_HEAL_TIMED); this->drawSkelAnime = false; } else if (this->timer <= 0) { EnButte_SetupWaitToDie(this); @@ -399,11 +411,11 @@ void EnButte_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.update != NULL) { Actor_MoveForward(&this->actor); - Math_StepToF(&this->actor.posRot.pos.y, this->posYTarget, 0.6f); - if (this->actor.xyzDistToLinkSq < 5000.0f) { + Math_StepToF(&this->actor.world.pos.y, this->posYTarget, 0.6f); + if (this->actor.xyzDistToPlayerSq < 5000.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, this->actor.shape.unk_08 * this->actor.scale.y); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset * this->actor.scale.y); } } @@ -413,7 +425,7 @@ void EnButte_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->drawSkelAnime) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if (((this->actor.params & 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h index c4bc6e7384..b36ff083db 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -11,7 +11,7 @@ typedef void (*EnButteActionFunc)(struct EnButte*, GlobalContext*); typedef struct EnButte { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph collider; - /* 0x016C */ ColliderJntSphItem colliderItems[1]; + /* 0x016C */ ColliderJntSphElement colliderItems[1]; /* 0x01AC */ SkelAnime skelAnime; /* 0x01F0 */ Vec3s jointTable[8]; /* 0x0220 */ Vec3s morphTable[8]; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 49c319a4b8..9fa372255f 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -41,7 +41,7 @@ extern AnimationHeader D_06002250; const ActorInit En_Bw_InitVars = { ACTOR_EN_BW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BW, sizeof(EnBw), @@ -52,20 +52,78 @@ const ActorInit En_Bw_InitVars = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 30, 65, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK0, 0x00, 0x09, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 35, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x10, 0x00, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x10, 0x00, 0xF2, 0xF4, 0xF2, 0xE4, 0xF2, 0xF2, 0xF2, - 0xF2, 0x60, 0xE3, 0x60, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0xE), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 sSlugGroup = 0; @@ -81,11 +139,11 @@ void EnBw_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.naviEnemyId = 0x23; this->actor.gravity = -2.0f; SkelAnime_Init(globalCtx, &this->skelAnime, &D_060020F0, &D_06000228, this->jointTable, this->morphTable, 12); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; - this->actor.colChkInfo.mass = 0xFE; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.colChkInfo.mass = MASS_HEAVY; + this->actor.focus.pos = this->actor.world.pos; func_809CE9A8(this); this->color1.a = this->color1.r = 255; this->color1.g = this->color1.b = 0; @@ -95,7 +153,7 @@ void EnBw_Init(Actor* thisx, GlobalContext* globalCtx) { //! this->collider2 should have Init called on it, but it doesn't matter since the heap is zeroed before use. Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_SetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); - this->unk_236 = this->actor.posRot.rot.y; + this->unk_236 = this->actor.world.rot.y; this->actor.params = sSlugGroup; sSlugGroup = (sSlugGroup + 1) & 3; } @@ -115,7 +173,7 @@ void func_809CE884(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.y = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; this->actor.scale.z = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; if (this->unk_222 == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_809CE9A8(this); } } @@ -169,14 +227,14 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->color1.g = sp60; } if ((((globalCtx->gameplayFrames % 4) == this->actor.params) && (this->actor.speedXZ != 0.0f) && - (sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.posRot.pos, &this->unk_264, &sp68, &sp74, 1, 0, - 0, 1))) || + (sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.world.pos, &this->unk_264, &sp68, &sp74, 1, 0, 0, + 1))) || (this->unk_222 == 0)) { if (sp74 != NULL) { sp74 = SEGMENTED_TO_VIRTUAL(sp74); sp62 = Math_FAtan2F(sp74->normal.x, sp74->normal.z) * ((f32)0x8000 / M_PI); } else { - sp62 = this->actor.posRot.rot.y + 0x8000; + sp62 = this->actor.world.rot.y + 0x8000; } if ((this->unk_236 != sp62) || (sp64 == 0)) { if (BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->unk_270, &this->unk_288, &sp68, &sp74, 1, 0, 0, 1)) { @@ -196,7 +254,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->unk_238 = -0x4000; } } else { - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0.0f) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0.0f) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -226,9 +284,9 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f; } } else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { - if (this->unk_236 != this->actor.wallPolyRot) { + if (this->unk_236 != this->actor.wallYaw) { sp64 = 1; - this->unk_236 = this->actor.wallPolyRot; + this->unk_236 = this->actor.wallYaw; if (this->unk_221 == 3) { if (globalCtx->gameplayFrames & 0x20) { this->unk_238 = 0x4000; @@ -238,7 +296,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->actor.bgCheckFlags &= ~8; this->unk_222 = (Rand_ZeroOne() * 20.0f) + 160.0f; } else { - if ((s16)(this->actor.yawTowardsLink - this->unk_236) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->unk_236) >= 0) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -248,13 +306,13 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { } } } else if (this->unk_221 == 0) { - sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.posRot.pos, &player->actor.posRot.pos, &sp68, + sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.world.pos, &player->actor.world.pos, &sp68, &sp74, 1, 0, 0, 1); if (sp64 != 0) { sp74 = SEGMENTED_TO_VIRTUAL(sp74); sp60 = Math_FAtan2F(sp74->normal.x, sp74->normal.z) * ((f32)0x8000 / M_PI); if (this->unk_236 != sp60) { - if ((s16)(this->actor.yawTowardsLink - sp60) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - sp60) >= 0) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -278,29 +336,29 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { switch (this->unk_221) { case 3: Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); - if ((this->unk_224 == 0) && (this->actor.xzDistToLink < 200.0f) && (ABS(this->actor.yDistToLink) < 50.0f) && - func_8002E084(&this->actor, 0x1C70)) { + if ((this->unk_224 == 0) && (this->actor.xzDistToPlayer < 200.0f) && + (ABS(this->actor.yDistToPlayer) < 50.0f) && func_8002E084(&this->actor, 0x1C70)) { func_809CF72C(this); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } break; case 0: Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); if (sp64 == 0) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, this->actor.speedXZ * 1000.0f, 0); - if ((this->actor.xzDistToLink < 90.0f) && (this->actor.yDistToLink < 50.0f) && + if ((this->actor.xzDistToPlayer < 90.0f) && (this->actor.yDistToPlayer < 50.0f) && func_8002E084(&this->actor, 0x1554) && - func_800339B8(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsLink)) { + func_800339B8(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsPlayer)) { func_809CF8F0(this); } } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } - if ((this->unk_224 == 0) || (ABS(this->actor.yDistToLink) > 60.0f) || (player2->stateFlags1 & 0x6000)) { + if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) || (player2->stateFlags1 & 0x6000)) { this->unk_221 = 3; this->unk_224 = 150; this->unk_250 = 0.0f; @@ -311,10 +369,10 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { if (func_8002E084(&this->actor, 0x1C70)) { this->unk_238 = -this->unk_238; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x8000, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x8000, 1, this->actor.speedXZ * 1000.0f, 0); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } if (this->unk_224 <= 200) { @@ -331,7 +389,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { } break; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_809CF72C(EnBw* this) { @@ -369,7 +427,7 @@ void func_809CF7AC(EnBw* this, GlobalContext* globalCtx) { void func_809CF8F0(EnBw* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002250, -1.0f); this->actor.speedXZ = 7.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_220 = 4; this->unk_222 = 1000; this->actor.velocity.y = 11.0f; @@ -387,22 +445,22 @@ void func_809CF984(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.x = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; this->actor.scale.y = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0245f; this->actor.scale.z = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; - if (this->collider1.base.atFlags & 2) { - this->collider1.base.atFlags &= ~2; + if (this->collider1.base.atFlags & AT_HIT) { + this->collider1.base.atFlags &= ~AT_HIT; this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; - if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & 4)) { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } } SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 3) { - floorPolyType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + floorPolyType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorPolyType == 2) || (floorPolyType == 3) || (floorPolyType == 9)) { Actor_Kill(&this->actor); return; } - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); this->unk_222 = 3000; this->actor.flags &= ~0x01000000; this->actor.speedXZ = 0.0f; @@ -436,7 +494,7 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) { this->unk_258 += this->unk_25C; Math_SmoothStepToF(&this->unk_260, 0.075f, 1.0f, 0.005f, 0.0f); if (this->actor.bgCheckFlags & 2) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } if (this->unk_224 != 0) { @@ -463,8 +521,8 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) { } else { this->color1.b += 40; } - if (this->actor.shape.unk_08 < 1000.0f) { - this->actor.shape.unk_08 += 200.0f; + if (this->actor.shape.yOffset < 1000.0f) { + this->actor.shape.yOffset += 200.0f; } } } @@ -486,7 +544,7 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 3) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); this->unk_222 = 0xBB8; this->unk_250 = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); @@ -507,8 +565,8 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) { } else { this->color1.b -= 40; } - if (this->actor.shape.unk_08 > 0.0f) { - this->actor.shape.unk_08 -= 200.0f; + if (this->actor.shape.yOffset > 0.0f) { + this->actor.shape.yOffset -= 200.0f; } } @@ -527,7 +585,7 @@ void func_809D014C(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.y -= 0.0002f; this->actor.scale.z += 0.0002f; } - this->actor.shape.unk_14 = this->color1.a -= 6; + this->actor.shape.shadowAlpha = this->color1.a -= 6; this->unk_222--; if (this->unk_222 <= 0) { Actor_Kill(&this->actor); @@ -542,7 +600,7 @@ void func_809D01CC(EnBw* this) { if (this->damageEffect == 0xE) { this->iceTimer = 0x50; } - this->unk_222 = (this->actor.dmgEffectParams & 0x4000) ? 25 : 80; + this->unk_222 = (this->actor.colorFilterParams & 0x4000) ? 25 : 80; EnBw_SetupAction(this, func_809D0268); } @@ -559,7 +617,7 @@ void func_809D0268(EnBw* this, GlobalContext* globalCtx) { if (this->color1.b > 230) { this->color1.b = 230; } - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { if ((globalCtx->gameplayFrames % 0x80) == 0) { this->unk_25C = 0.5f + Rand_ZeroOne() * 0.25f; } @@ -583,13 +641,13 @@ void func_809D03CC(EnBw* this) { if (this->damageEffect == 0xE) { this->iceTimer = 32; } - this->unk_23C = this->actor.dmgEffectTimer; + this->unk_23C = this->actor.colorFilterTimer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); EnBw_SetupAction(this, func_809D0424); } void func_809D0424(EnBw* this, GlobalContext* globalCtx) { - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->unk_23C = 0; if (this->actor.colChkInfo.health != 0) { if ((this->unk_220 != 5) && (this->unk_220 != 6)) { @@ -609,11 +667,11 @@ void func_809D0424(EnBw* this, GlobalContext* globalCtx) { if (func_800355E4(globalCtx, &this->collider2.base)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); func_809D00F4(this); } } @@ -623,16 +681,16 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & 1)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); func_809D00F4(this); } else { - if (this->collider2.base.acFlags & 2) { - this->collider2.base.acFlags &= ~2; + if (this->collider2.base.acFlags & AC_HIT) { + this->collider2.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect == 0) || (this->unk_220 == 6)) { return; } this->damageEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->collider2.body, 0); + func_80035650(&this->actor, &this->collider2.info, 0); if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) { if (this->unk_23C == 0) { Actor_ApplyDamage(&this->actor); @@ -651,11 +709,11 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { if (func_800355E4(globalCtx, &this->collider2.base)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); func_809D00F4(this); } } else if ((this->unk_220 != 1) && (this->unk_220 != 6)) { @@ -667,7 +725,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { this->unk_248 = 0.0f; } } - if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xzDistToLink <= 400.0f) && + if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) && (this->actor.bgCheckFlags & 1)) { if (this->unk_220 == 5) { this->unk_23C = 0; @@ -704,10 +762,10 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { velocity.z = Rand_CenteredFloat(this->unk_248 * 24.0f); accel.x = velocity.x * -0.075f; accel.z = velocity.z * -0.075f; - func_8002836C(globalCtx, &thisx->posRot.pos, &velocity, &accel, &sp50, &sp4C, 0x3C, 0, 0x14); + func_8002836C(globalCtx, &thisx->world.pos, &velocity, &accel, &sp50, &sp4C, 0x3C, 0, 0x14); } if (this->unk_248 <= 0.4f) { - this->collider1.body.toucher.effect = 0; + this->collider1.info.toucher.effect = 0; if (((globalCtx->gameplayFrames & 1) == 0) && (this->unk_220 < 5) && (this->unk_23C == 0)) { accel.y = -0.1f; velocity.x = Rand_CenteredFloat(4.0f); @@ -723,31 +781,31 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { sp44.a = 0; } - func_8002836C(globalCtx, &thisx->posRot.pos, &velocity, &accel, &sp48, &sp44, 0xB4, 0x28, + func_8002836C(globalCtx, &thisx->world.pos, &velocity, &accel, &sp48, &sp44, 0xB4, 0x28, 20.0f - (this->unk_248 * 40.0f)); } } else { - this->collider1.body.toucher.effect = 1; + this->collider1.info.toucher.effect = 1; } - this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->posRot.rot.y); + this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->world.rot.y); if ((this->unk_220 == 4) || (this->unk_220 == 6) || (this->unk_220 == 5) || (this->unk_220 == 1) || (this->unk_234 != 0)) { Actor_MoveForward(thisx); } - func_8002E4B4(globalCtx, thisx, 20.0f, 30.0f, 21.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 30.0f, 21.0f, 0x1F); } - Collider_CylinderUpdate(thisx, &this->collider2); + Collider_UpdateCylinder(thisx, &this->collider2); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); - if ((this->unk_220 != 0) && ((thisx->dmgEffectTimer == 0) || !(thisx->dmgEffectParams & 0x4000))) { + if ((this->unk_220 != 0) && ((thisx->colorFilterTimer == 0) || !(thisx->colorFilterParams & 0x4000))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } if ((this->unk_221 != 1) && (this->unk_220 < 5) && (this->unk_248 > 0.4f)) { - Collider_CylinderUpdate(thisx, &this->collider1); + Collider_UpdateCylinder(thisx, &this->collider1); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 5.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 5.0f; } s32 EnBw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, @@ -818,8 +876,8 @@ void EnBw_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_MultVec3f(&spAC, &this->unk_27C); } - Matrix_Translate(thisx->posRot.pos.x, thisx->posRot.pos.y + ((thisx->scale.y - 0.013f) * 1000.0f), - thisx->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + ((thisx->scale.y - 0.013f) * 1000.0f), thisx->world.pos.z, + MTXMODE_NEW); func_80093D84(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); @@ -834,14 +892,14 @@ void EnBw_Draw(Actor* thisx, GlobalContext* globalCtx2) { gSPDisplayList(POLY_XLU_DISP++, D_0404D4E0); if (this->iceTimer != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->iceTimer--; if ((this->iceTimer & 3) == 0) { iceIndex = this->iceTimer >> 2; - icePos.x = sIceOffsets[iceIndex].x + thisx->posRot.pos.x; - icePos.y = sIceOffsets[iceIndex].y + thisx->posRot.pos.y; - icePos.z = sIceOffsets[iceIndex].z + thisx->posRot.pos.z; + icePos.x = sIceOffsets[iceIndex].x + thisx->world.pos.x; + icePos.y = sIceOffsets[iceIndex].y + thisx->world.pos.y; + icePos.z = sIceOffsets[iceIndex].z + thisx->world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f); } } diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 1159607696..34195dc182 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -19,7 +19,7 @@ extern Gfx D_060022F0[]; const ActorInit En_Bx_InitVars = { ACTOR_EN_BX, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BXA, sizeof(EnBx), @@ -30,14 +30,42 @@ const ActorInit En_Bx_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x01, { 0xFFCFFFFF, 0x03, 0x04 }, { 0xFFCFFFFF, 0x01, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 60, 100, 100, { 0, 0, 0 } }, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x03, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -46,7 +74,7 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) { Vec3f sp48 = { 0.015f, 0.015f, 0.015f }; Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5300, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; s32 i; s32 pad; @@ -55,22 +83,22 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = thisx->scale.z = 0.01f; thisx->scale.y = 0.03f; - thisx->posRot.pos.y = thisx->posRot.pos.y - 100.0f; + thisx->world.pos.y = thisx->world.pos.y - 100.0f; for (i = 0; i < 4; i++) { this->unk_184[i] = sp48; if (i == 0) { this->unk_1B4[i].x = thisx->shape.rot.x - 0x4000; } - this->unk_154[i] = thisx->posRot.pos; - this->unk_154[i].y = thisx->posRot.pos.y + ((i + 1) * 140.0f); + this->unk_154[i] = thisx->world.pos; + this->unk_154[i].y = thisx->world.pos.y + ((i + 1) * 140.0f); } - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 48.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 48.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Collider_InitQuad(globalCtx, &this->colliderQuad); Collider_SetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit); - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) { @@ -98,7 +126,8 @@ void func_809D1D0C(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_809D254C, &sp38); Matrix_MultVec3f(&sp5C, &this->colliderQuad.dim.quad[1]); Matrix_MultVec3f(&sp50, &this->colliderQuad.dim.quad[0]); - func_80062734(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0], &this->colliderQuad.dim.quad[1]); + Collider_SetQuadVertices(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0], + &this->colliderQuad.dim.quad[1]); } void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -108,14 +137,14 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { s16 tmp32; s32 tmp33; - if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) || - (this->colliderQuad.base.atFlags & 2)) { - if ((thisx->xzDistToLink <= 70.0f) || (&player->actor == this->collider.base.at) || + if ((thisx->xzDistToPlayer <= 70.0f) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->colliderQuad.base.atFlags & AT_HIT)) { + if ((thisx->xzDistToPlayer <= 70.0f) || (&player->actor == this->collider.base.at) || (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; - tmp32 = thisx->posRot.rot.y; + tmp32 = thisx->world.rot.y; if (!(thisx->params & 0x80)) { - tmp32 = thisx->yawTowardsLink; + tmp32 = thisx->yawTowardsPlayer; } if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) && (&player->actor != this->colliderQuad.base.at) && (player->invincibilityTimer <= 0)) { @@ -130,9 +159,9 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { player->invincibilityTimer = tmp33; } - this->collider.base.atFlags &= ~2; - this->collider.base.acFlags &= ~2; - this->colliderQuad.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; + this->collider.base.acFlags &= ~AC_HIT; + this->colliderQuad.base.atFlags &= ~AT_HIT; this->colliderQuad.base.at = NULL; this->collider.base.ac = NULL; this->collider.base.at = NULL; @@ -150,17 +179,17 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { yaw = (s32)Rand_CenteredFloat(12288.0f); yaw = (yaw + (i * 0x4000)) + 0x2000; - pos.x = Rand_CenteredFloat(5.0f) + thisx->posRot.pos.x; - pos.y = Rand_CenteredFloat(30.0f) + thisx->posRot.pos.y + 170.0f; - pos.z = Rand_CenteredFloat(5.0f) + thisx->posRot.pos.z; + pos.x = Rand_CenteredFloat(5.0f) + thisx->world.pos.x; + pos.y = Rand_CenteredFloat(30.0f) + thisx->world.pos.y + 170.0f; + pos.z = Rand_CenteredFloat(5.0f) + thisx->world.pos.z; EffectSsLightning_Spawn(globalCtx, &pos, &primColor, &envColor, 230, yaw, 6, 0); } } Audio_PlayActorSound2(thisx, NA_SE_EN_BIRI_SPARK - SFX_FLAG); } - thisx->posRot2.pos = thisx->posRot.pos; - Collider_CylinderUpdate(thisx, &this->collider); + thisx->focus.pos = thisx->world.pos; + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (thisx->params & 0x80) { diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index 50ee77b353..a9c19dfe9b 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -28,7 +28,7 @@ void EnChanger_SetHeartPieceFlag(EnChanger* this, GlobalContext* globalCtx); const ActorInit En_Changer_InitVars = { ACTOR_EN_CHANGER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnChanger), @@ -239,9 +239,9 @@ void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx) { switch (temp_s0_2) { case CHEST_LEFT: - xPos = right->dyna.actor.posRot.pos.x; - yPos = right->dyna.actor.posRot.pos.y; - zPos = right->dyna.actor.posRot.pos.z; + xPos = right->dyna.actor.world.pos.x; + yPos = right->dyna.actor.world.pos.y; + zPos = right->dyna.actor.world.pos.z; if (this->rightChestGetItemId == GI_DOOR_KEY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); @@ -255,9 +255,9 @@ void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx) { } break; case CHEST_RIGHT: - xPos = left->dyna.actor.posRot.pos.x; - yPos = left->dyna.actor.posRot.pos.y; - zPos = left->dyna.actor.posRot.pos.z; + xPos = left->dyna.actor.world.pos.x; + yPos = left->dyna.actor.world.pos.y; + zPos = left->dyna.actor.world.pos.z; if (this->leftChestGetItemId == GI_DOOR_KEY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); @@ -295,8 +295,8 @@ void EnChanger_Update(Actor* thisx, GlobalContext* globalCtx) { } if (BREG(0)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 33ef760987..abb22e80bc 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -12,7 +12,7 @@ void EnClearTag_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Clear_Tag_InitVars = { ACTOR_EN_CLEAR_TAG, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnClearTag), @@ -21,6 +21,46 @@ const ActorInit En_Clear_Tag_InitVars = { (ActorFunc)EnClearTag_Update, (ActorFunc)EnClearTag_Draw, }; + +static ColliderCylinderInit D_809D5C6C = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_809D5C40 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/func_809D35B0.s") diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index f4a191350d..3b86d59a9e 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -28,7 +28,7 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx); const ActorInit En_Cow_InitVars = { ACTOR_EN_COW, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_COW, sizeof(EnCow), @@ -39,8 +39,22 @@ const ActorInit En_Cow_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -71,17 +85,17 @@ void func_809DEE9C(EnCow* this) { vec.x = 0.0f; vec.z = 30.0f; func_809DEE00(&vec, this->actor.shape.rot.y); - this->colliders[0].dim.pos.x = this->actor.posRot.pos.x + vec.x; - this->colliders[0].dim.pos.y = this->actor.posRot.pos.y; - this->colliders[0].dim.pos.z = this->actor.posRot.pos.z + vec.z; + this->colliders[0].dim.pos.x = this->actor.world.pos.x + vec.x; + this->colliders[0].dim.pos.y = this->actor.world.pos.y; + this->colliders[0].dim.pos.z = this->actor.world.pos.z + vec.z; vec.x = 0.0f; vec.y = 0.0f; vec.z = -20.0f; func_809DEE00(&vec, this->actor.shape.rot.y); - this->colliders[1].dim.pos.x = this->actor.posRot.pos.x + vec.x; - this->colliders[1].dim.pos.y = this->actor.posRot.pos.y; - this->colliders[1].dim.pos.z = this->actor.posRot.pos.z + vec.z; + this->colliders[1].dim.pos.x = this->actor.world.pos.x + vec.x; + this->colliders[1].dim.pos.y = this->actor.world.pos.y; + this->colliders[1].dim.pos.z = this->actor.world.pos.z + vec.z; } void func_809DEF94(EnCow* this) { @@ -90,16 +104,16 @@ void func_809DEF94(EnCow* this) { VEC_SET(vec, 0.0f, 57.0f, -36.0f); func_809DEE00(&vec, this->actor.shape.rot.y); - this->actor.posRot.pos.x += vec.x; - this->actor.posRot.pos.y += vec.y; - this->actor.posRot.pos.z += vec.z; + this->actor.world.pos.x += vec.x; + this->actor.world.pos.y += vec.y; + this->actor.world.pos.z += vec.z; } void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { EnCow* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 72.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 72.0f); switch (this->actor.params) { case 0: SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, 6); @@ -120,11 +134,11 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { return; } } - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 1); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 1); this->unk_278 = Rand_ZeroFloat(1000.0f) + 40.0f; this->unk_27A = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; DREG(53) = 0; break; case 1: @@ -138,7 +152,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_278 = ((u32)(Rand_ZeroFloat(1000.0f)) & 0xFFFF) + 40.0f; break; } - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->unk_276 = 0; } @@ -161,7 +175,7 @@ void func_809DF494(EnCow* this, GlobalContext* globalCtx) { Animation_GetLastFrame(&D_060001CC), ANIMMODE_ONCE, 1.0f); } - if ((this->actor.xzDistToLink < 150.0f) && (!(this->unk_276 & 2))) { + if ((this->actor.xzDistToPlayer < 150.0f) && (!(this->unk_276 & 2))) { this->unk_276 |= 2; if (this->skelAnime.animation == &D_060001CC) { this->unk_278 = 0; @@ -250,8 +264,8 @@ void func_809DF96C(EnCow* this, GlobalContext* globalCtx) { this->unk_276 &= ~0x4; DREG(53) = 0; } else { - if ((this->actor.xzDistToLink < 150.0f) && - (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x61A8)) { + if ((this->actor.xzDistToPlayer < 150.0f) && + (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x61A8)) { DREG(53) = 0; this->actionFunc = func_809DF8FC; this->actor.flags |= 0x10000; @@ -277,8 +291,8 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx) { Animation_GetLastFrame(&D_06004348), ANIMMODE_ONCE, 1.0f); } - if ((this->actor.xzDistToLink < 150.0f) && - (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) { + if ((this->actor.xzDistToPlayer < 150.0f) && + (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) { this->unk_276 |= 2; if (this->skelAnime.animation == &D_06004348) { this->unk_278 = 0; @@ -297,7 +311,7 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx) {} // necessary to match CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->skelAnime.animation == &D_060001CC) { Audio_PlayActorSound2(thisx, NA_SE_EV_COW_CRY); @@ -309,10 +323,10 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->actionFunc(this, globalCtx); - if ((thisx->xzDistToLink < 150.0f) && - (ABS(Math_Vec3f_Yaw(&thisx->posRot.pos, &player->actor.posRot.pos)) < 0xC000)) { - targetX = Math_Vec3f_Pitch(&thisx->posRot2.pos, &player->actor.posRot2.pos); - targetY = Math_Vec3f_Yaw(&thisx->posRot2.pos, &player->actor.posRot2.pos) - thisx->shape.rot.y; + if ((thisx->xzDistToPlayer < 150.0f) && + (ABS(Math_Vec3f_Yaw(&thisx->world.pos, &player->actor.world.pos)) < 0xC000)) { + targetX = Math_Vec3f_Pitch(&thisx->focus.pos, &player->actor.focus.pos); + targetY = Math_Vec3f_Yaw(&thisx->focus.pos, &player->actor.focus.pos) - thisx->shape.rot.y; if (targetX > 0x1000) { targetX = 0x1000; @@ -367,7 +381,7 @@ void EnCow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnCow* this = THIS; if (limbIndex == 2) { - Matrix_MultVec3f(&D_809E010C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_809E010C, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index d6cb3bb9ca..edfc5a8ee0 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -24,7 +24,7 @@ static Vec3f sZeroVecAccel = { 0.0f, 0.0f, 0.0f }; const ActorInit En_Crow_InitVars = { ACTOR_EN_CROW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_CROW, sizeof(EnCrow), @@ -34,22 +34,68 @@ const ActorInit En_Crow_InitVars = { (ActorFunc)EnCrow_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit = { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, - { 1, { { 0, 0, 0 }, 20 }, 100 }, +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 1, 0x000F, 0x001E, 30 }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 30, 30 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x24, 0x32, 0x02, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static u32 sDeathCount = 0; @@ -57,11 +103,11 @@ static u32 sDeathCount = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 3000, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 88, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 65336, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_STOP), + ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), }; -static Vec3f sHeadVec[] = { 2500.0f, 0.0f, 0.0f }; +static Vec3f sHeadVec = { 2500.0f, 0.0f, 0.0f }; void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx) { EnCrow* this = THIS; @@ -69,10 +115,10 @@ void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060010C0, &D_060000F0, this->jointTable, this->morphTable, 9); Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItems); - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius; - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawFunc_Circle, 20.0f); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f); sDeathCount = 0; EnCrow_SetupWait(this); } @@ -85,7 +131,7 @@ void EnCrow_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnCrow_SetupWait(EnCrow* this) { this->timer = 100; - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; this->actionFunc = EnCrow_Wait; this->skelAnime.playSpeed = 1.0f; } @@ -102,22 +148,22 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { f32 scale; Vec3f iceParticlePos; - this->actor.speedXZ *= Math_CosS(this->actor.posRot.rot.x); + this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &D_060000F0, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); scale = this->actor.scale.x * 100.0f; - this->actor.posRot.pos.y += 20.0f * scale; + this->actor.world.pos.y += 20.0f * scale; this->actor.bgCheckFlags &= ~1; - this->actor.shape.unk_08 = 0.0f; - this->actor.unk_4C = 0.0f; + this->actor.shape.yOffset = 0.0f; + this->actor.targetArrowOffset = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_DEAD); if (this->actor.colChkInfo.damageEffect == 3) { func_8003426C(&this->actor, 0, 255, 0, 40); for (i = 0; i < 8; i++) { - iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.x; - iceParticlePos.y = ((i & 2 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.y; - iceParticlePos.z = ((i & 4 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.z; + iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.x; + iceParticlePos.y = ((i & 2 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.y; + iceParticlePos.z = ((i & 4 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceParticlePos, 150, 150, 150, 250, 235, 245, 255, ((Rand_ZeroOne() * 0.15f) + 0.85f) * scale); } @@ -125,7 +171,7 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 255, 0, 40); for (i = 0; i < 4; i++) { - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot, 50.0f * scale, 0, 0, i); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 50.0f * scale, 0, 0, i); } } else { func_8003426C(&this->actor, 0x4000, 255, 0, 40); @@ -135,14 +181,14 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= 0x10; this->actionFunc = func_809E0E2C; } void EnCrow_SetupDie(EnCrow* this) { - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actionFunc = EnCrow_Die; } @@ -150,7 +196,7 @@ void func_809E06E8(EnCrow* this) { this->timer = 100; this->actor.speedXZ = 3.5f; this->aimRotX = -0x1000; - this->aimRotY = this->actor.yawTowardsLink + 0x8000; + this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; this->skelAnime.playSpeed = 2.0f; func_8003426C(&this->actor, 0, 255, 0, 5); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -161,19 +207,20 @@ void func_809E0770(EnCrow* this) { if (sDeathCount == 10) { this->actor.params = 1; sDeathCount = 0; - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius * 0.03f * 100.0f; + this->collider.elements[0].dim.worldSphere.radius = + sJntSphInit.elements[0].dim.modelSphere.radius * 0.03f * 100.0f; } else { this->actor.params = 0; - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; } Animation_PlayLoop(&this->skelAnime, &D_060000F0); - Math_Vec3f_Copy(&this->actor.posRot, &this->actor.initPosRot); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->timer = 300; - this->actor.shape.unk_08 = 2000; - this->actor.unk_4C = 2000.0f; + this->actor.shape.yOffset = 2000; + this->actor.targetArrowOffset = 2000.0f; this->actor.draw = NULL; this->actionFunc = func_809E10A8; } @@ -188,14 +235,14 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; if (this->actor.bgCheckFlags & 8) { - this->aimRotY = this->actor.wallPolyRot; - } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot) > 300.0f) { - this->aimRotY = func_8002DAC0(&this->actor, &this->actor.initPosRot); + this->aimRotY = this->actor.wallYaw; + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + this->aimRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } - if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->aimRotY, 5, 0x300, 0x10) == 0) && (skelanimeUpdated) && + if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->aimRotY, 5, 0x300, 0x10) == 0) && skelanimeUpdated && (Rand_ZeroOne() < 0.1f)) { - var = func_8002DAC0(&this->actor, &this->actor.initPosRot) - this->actor.shape.rot.y; + var = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y; if (var > 0) { this->aimRotY += 0x1000 + (0x1000 * Rand_ZeroOne()); } else { @@ -206,15 +253,15 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { if (this->actor.yDistToWater > -40.0f) { this->aimRotX = -0x1000; - } else if (this->actor.posRot.pos.y < (this->actor.initPosRot.pos.y - 50.0f)) { + } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f)) { this->aimRotX = -0x800 - (Rand_ZeroOne() * 0x800); - } else if (this->actor.posRot.pos.y > (this->actor.initPosRot.pos.y + 50.0f)) { + } else if (this->actor.world.pos.y > (this->actor.home.pos.y + 50.0f)) { this->aimRotX = 0x800 + (Rand_ZeroOne() * 0x800); } if ((Math_SmoothStepToS(&this->actor.shape.rot.x, this->aimRotX, 10, 0x100, 8) == 0) && (skelanimeUpdated) && (Rand_ZeroOne() < 0.1f)) { - if (this->actor.initPosRot.pos.y < this->actor.posRot.pos.y) { + if (this->actor.home.pos.y < this->actor.world.pos.y) { this->aimRotX -= (0x400 * Rand_ZeroOne()) + 0x400; } else { this->aimRotX += (0x400 * Rand_ZeroOne()) + 0x400; @@ -229,7 +276,7 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if ((this->timer == 0) && (this->actor.xzDistToLink < 300.0f) && !(player->stateFlags1 & 0x00800000) && + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x00800000) && (this->actor.yDistToWater < -40.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { func_809E0384(this); } @@ -249,10 +296,10 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { yaw = func_8002E084(&this->actor, 0x2800); if (yaw != 0) { - pos.x = player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y + 20.0f; - pos.z = player->actor.posRot.pos.z; - target = func_8002DB28(&this->actor, &pos); + pos.x = player->actor.world.pos.x; + pos.y = player->actor.world.pos.y + 20.0f; + pos.z = player->actor.world.pos.z; + target = Actor_WorldPitchTowardPoint(&this->actor, &pos); if (target > 0x3000) { target = 0x3000; } @@ -261,14 +308,15 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.x, -0x1000, 2, 0x100); } - if ((yaw != 0) || (this->actor.xzDistToLink > 80.0f)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 4, 0xC00); + if ((yaw != 0) || (this->actor.xzDistToPlayer > 80.0f)) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); } - if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || (this->collider.base.atFlags & 2) || - (this->actor.bgCheckFlags & 9) || (player->stateFlags1 & 0x00800000) || (this->actor.yDistToWater > -40.0f)) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || + (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9) || + (player->stateFlags1 & 0x00800000) || (this->actor.yDistToWater > -40.0f)) { + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_ATTACK); } @@ -278,15 +326,15 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { void func_809E0E2C(EnCrow* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; if (!(this->actor.flags & 0x8000)) { - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); this->actor.shape.rot.z += 0x1780; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.groundY == BGCHECK_Y_MIN)) { - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot, &sZeroVecAccel, &sZeroVecAccel, + if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world, &sZeroVecAccel, &sZeroVecAccel, this->actor.scale.x * 10000.0f, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1); EnCrow_SetupDie(this); } @@ -302,12 +350,12 @@ void EnCrow_Die(EnCrow* this, GlobalContext* globalCtx) { step = 0.002f; } - if (Math_StepToF(&this->actor.scale, 0.0f, step)) { + if (Math_StepToF(&this->actor.scale.x, 0.0f, step)) { if (this->actor.params == 0) { sDeathCount++; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot, 0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot, ITEM00_RUPEE_RED); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_RUPEE_RED); } func_809E0770(this); } @@ -319,9 +367,9 @@ void func_809E1004(EnCrow* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 8) { - this->aimRotY = this->actor.wallPolyRot; + this->aimRotY = this->actor.wallYaw; } else { - this->aimRotY = this->actor.yawTowardsLink + 0x8000; + this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; } Math_ApproachS(&this->actor.shape.rot.y, this->aimRotY, 3, 0xC00); @@ -350,7 +398,7 @@ void func_809E10A8(EnCrow* this, GlobalContext* globalCtx) { } else { target = 0.01f; } - if (Math_StepToF(&this->actor.scale, target, target * 0.1f)) { + if (Math_StepToF(&this->actor.scale.x, target, target * 0.1f)) { this->actor.flags |= 1; this->actor.flags &= ~0x10; this->actor.colChkInfo.health = 1; @@ -361,9 +409,9 @@ void func_809E10A8(EnCrow* this, GlobalContext* globalCtx) { } void func_809E1174(EnCrow* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.list[0].body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.elements[0].info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect == 1) { func_809E06E8(this); @@ -386,8 +434,8 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { func_809E1174(this, globalCtx); this->actionFunc(this, globalCtx); scale = this->actor.scale.x * 100.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->actor.posRot.rot.x = -this->actor.shape.rot.x; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.x = -this->actor.shape.rot.x; if (this->actionFunc != func_809E10A8) { if (this->actor.colChkInfo.health != 0) { @@ -397,28 +445,28 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { height = 0.0f; Actor_MoveForward(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale, 7); } else { height = 0.0f; } - this->collider.list[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + height; - this->collider.list[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + height; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; if (this->actionFunc == func_809E0C8C) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - if (this->collider.base.acFlags & 1) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + if (this->collider.base.acFlags & AC_ON) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != func_809E10A8) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, height); + Actor_SetFocus(&this->actor, height); if (this->actor.colChkInfo.health != 0 && Animation_OnFrame(&this->skelAnime, 3.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_FLUTTER); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 75709dd846..741eee3663 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -19,7 +19,7 @@ typedef struct EnCrow { /* 0x01CA */ Vec3s jointTable[9]; /* 0x0200 */ Vec3s morphTable[9]; /* 0x0238 */ ColliderJntSph collider; - /* 0x0258 */ ColliderJntSphItem colliderItems[1]; + /* 0x0258 */ ColliderJntSphElement colliderItems[1]; } EnCrow; // size = 0x0298 extern const ActorInit En_Crow_InitVars; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 3496455bcf..e735c71b3b 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_0602AF70; /* const ActorInit En_Cs_InitVars = { ACTOR_EN_CS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_CS, sizeof(EnCs), @@ -24,6 +24,26 @@ const ActorInit En_Cs_InitVars = { (ActorFunc)EnCs_Update, (ActorFunc)EnCs_Draw, }; + +static ColliderCylinderInit D_809E28C0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E18B0.s") diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index bdf11791b2..1acb68dd08 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -61,7 +61,7 @@ extern FlexSkeletonHeader D_06007958; const ActorInit En_Daiku_InitVars = { ACTOR_EN_DAIKU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DAIKU, sizeof(EnDaiku), @@ -72,14 +72,61 @@ const ActorInit En_Daiku_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 66, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { 0 }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static EnDaikuAnimation sAnimations[] = { { 0x06001AB0, 1.0f, 0, 0 }, { 0x06007DE0, 1.0f, 0, 0 }, { 0x0600885C, 1.0f, 0, 0 }, @@ -133,7 +180,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { this->startFightSwitchFlag = this->actor.shape.rot.z & 0x3F; this->actor.shape.rot.z = 0; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007958, NULL, this->jointTable, this->morphTable, 17); if (!noKill) { @@ -143,18 +190,18 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); Animation_Change(&this->skelAnime, sAnimations[0].anim, 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[0].anim), sAnimations[0].mode, sAnimations[0].transitionRate); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->currentAnimIndex = -1; this->runSpeed = 5.0f; - this->initRot = this->actor.posRot.rot; - this->initPos = this->actor.posRot.pos; + this->initRot = this->actor.world.rot; + this->initPos = this->actor.world.pos; if (globalCtx->sceneNum == SCENE_GERUDOWAY) { EnDaiku_Change(this, ENDAIKU_ANIM_STAND, &this->currentAnimIndex); @@ -336,7 +383,7 @@ void EnDaiku_Jailed(EnDaiku* this, GlobalContext* globalCtx) { } SkelAnime_Update(&this->skelAnime); - gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORTYPE_ENEMY); + gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORCAT_ENEMY); if (gerudo == NULL) { this->stateFlags |= ENDAIKU_STATEFLAG_GERUDODEFEATED; this->stateFlags &= ~ENDAIKU_STATEFLAG_GERUDOFIGHTING; @@ -386,8 +433,8 @@ void EnDaiku_InitEscape(EnDaiku* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; this->rotYtowardsPath = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); dxz = sqrtf(SQ(dx) + SQ(dz)); if (dxz > 10.0f) { @@ -425,19 +472,19 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) { eyePosDeltaLocal.x = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.x; eyePosDeltaLocal.y = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.y; eyePosDeltaLocal.z = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.z; - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 0x8000), MTXMODE_NEW); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 0x8000), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); - this->subCamEyeInit.x = this->subCamEye.x = this->actor.posRot.pos.x + eyePosDeltaWorld.x; - this->subCamEyeInit.y = this->subCamEye.y = this->actor.posRot.pos.y + eyePosDeltaWorld.y; + this->subCamEyeInit.x = this->subCamEye.x = this->actor.world.pos.x + eyePosDeltaWorld.x; + this->subCamEyeInit.y = this->subCamEye.y = this->actor.world.pos.y + eyePosDeltaWorld.y; if (1) {} - this->subCamEyeInit.z = this->subCamEye.z = this->actor.posRot.pos.z + eyePosDeltaWorld.z; + this->subCamEyeInit.z = this->subCamEye.z = this->actor.world.pos.z + eyePosDeltaWorld.z; if (1) {} - this->subCamAtTarget.x = this->subCamAt.x = this->actor.posRot.pos.x; - this->subCamAtTarget.y = this->subCamAt.y = this->actor.posRot.pos.y + 60.0f; + this->subCamAtTarget.x = this->subCamAt.x = this->actor.world.pos.x; + this->subCamAtTarget.y = this->subCamAt.y = this->actor.world.pos.y + 60.0f; if (1) {} - this->subCamAtTarget.z = this->subCamAt.z = this->actor.posRot.pos.z; + this->subCamAtTarget.z = this->subCamAt.z = this->actor.world.pos.z; this->subCamId = Gameplay_CreateSubCamera(globalCtx); Gameplay_ChangeCameraStatus(globalCtx, 0, 1); @@ -451,9 +498,9 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) { void EnDaiku_UpdateSubCamera(EnDaiku* this, GlobalContext* globalCtx) { s32 pad; - this->subCamAtTarget.x = this->actor.posRot.pos.x; - this->subCamAtTarget.y = this->actor.posRot.pos.y + 60.0f; - this->subCamAtTarget.z = this->actor.posRot.pos.z; + this->subCamAtTarget.x = this->actor.world.pos.x; + this->subCamAtTarget.y = this->actor.world.pos.y + 60.0f; + this->subCamAtTarget.z = this->actor.world.pos.z; Math_SmoothStepToF(&this->subCamAt.x, this->subCamAtTarget.x, 1.0f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->subCamAt.y, this->subCamAtTarget.y, 1.0f, 1000.0f, 0.0f); @@ -501,8 +548,8 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; ry = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); dxz = sqrtf(SQ(dx) + SQ(dz)); if (dxz <= 20.88f) { @@ -517,10 +564,10 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) { } Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; Math_SmoothStepToF(&this->actor.speedXZ, this->runSpeed, 0.6f, dxz, 0.0f); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->subCamActive) { EnDaiku_UpdateSubCamera(this, globalCtx); @@ -544,15 +591,15 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); this->actionFunc(this, globalCtx); if (this->stateFlags & ENDAIKU_STATEFLAG_1) { - this->unk_244.unk_18.x = player->actor.posRot2.pos.x; - this->unk_244.unk_18.y = player->actor.posRot2.pos.y; - this->unk_244.unk_18.z = player->actor.posRot2.pos.z; + this->unk_244.unk_18.x = player->actor.focus.pos.x; + this->unk_244.unk_18.y = player->actor.focus.pos.y; + this->unk_244.unk_18.z = player->actor.focus.pos.z; if (this->stateFlags & ENDAIKU_STATEFLAG_2) { func_80034A14(&this->actor, &this->unk_244, 0, 4); @@ -610,7 +657,7 @@ void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limb, Gfx** dList, Vec3s OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_daiku.c", 1323); if (limb == 15) { // head - Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.posRot2.pos); + Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); gSPDisplayList(POLY_OPA_DISP++, hairDLists[this->actor.params & 3]); } diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index f327132059..7bec3178a7 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_06007958; /* const ActorInit En_Daiku_Kakariko_InitVars = { ACTOR_EN_DAIKU_KAKARIKO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DAIKU, sizeof(EnDaikuKakariko), @@ -23,6 +23,26 @@ const ActorInit En_Daiku_Kakariko_InitVars = { (ActorFunc)EnDaikuKakariko_Update, (ActorFunc)EnDaikuKakariko_Draw, }; + +static ColliderCylinderInit D_809E54B0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 66, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4320.s") diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 2eb93eec02..a251fddf06 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06003070; /* const ActorInit En_Dekubaba_InitVars = { ACTOR_EN_DEKUBABA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUBABA, sizeof(EnDekubaba), @@ -29,6 +29,99 @@ const ActorInit En_Dekubaba_InitVars = { (ActorFunc)EnDekubaba_Update, (ActorFunc)EnDekubaba_Draw, }; + +static ColliderJntSphElementInit D_809E8ECC[7] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 100, 1000 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 51, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 52, { { 0, 0, 500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 53, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 54, { { 0, 0, 500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 55, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 56, { { 0, 0, 500 }, 8 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809E8FC8 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 7, + D_809E8ECC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s") diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 9f2deb29b2..dd575c1640 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -31,7 +31,7 @@ extern UNK_TYPE D_06003650; /* const ActorInit En_Dekunuts_InitVars = { ACTOR_EN_DEKUNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUNUTS, sizeof(EnDekunuts), @@ -40,6 +40,26 @@ const ActorInit En_Dekunuts_InitVars = { (ActorFunc)EnDekunuts_Update, (ActorFunc)EnDekunuts_Draw, }; + +static ColliderCylinderInit D_809EAB50 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 32, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s") diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 393c2d4dba..daa4bba25a 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -45,7 +45,7 @@ extern Gfx D_06007FC0[]; const ActorInit En_Dh_InitVars = { ACTOR_EN_DH, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DH, sizeof(EnDh), @@ -56,32 +56,90 @@ const ActorInit En_Dh_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x0D, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 35, 70, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x09 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON | OCELEM_UNK3, + }, { 1, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x09, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static DamageTable D_809EC620 = { { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, -} }; +static DamageTable D_809EC620 = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(4, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 47, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -96,9 +154,9 @@ void EnDh_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &D_809EC620; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007E88, &D_06005880, this->jointTable, this->limbRotTable, 16); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 64.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 64.0f); this->actor.params = ENDH_WAIT_UNDERGROUND; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = (gSaveContext.linkAge == 0) ? 14 : 20; this->alpha = this->unk_258 = 255; this->actor.flags &= ~1; @@ -127,7 +185,7 @@ void EnDh_SpawnDebris(GlobalContext* globalCtx, EnDh* this, Vec3f* spawnPos, f32 f32 scaleMod; spreadAngle = (Rand_ZeroOne() - 0.5f) * 6.28f; - pos.y = this->actor.groundY; + pos.y = this->actor.floorHeight; pos.x = (Math_SinF(spreadAngle) * spread) + spawnPos->x; pos.z = (Math_CosF(spreadAngle) * spread) + spawnPos->z; accel.x = (Rand_ZeroOne() - 0.5f) * accelXZ; @@ -140,11 +198,11 @@ void EnDh_SpawnDebris(GlobalContext* globalCtx, EnDh* this, Vec3f* spawnPos, f32 void EnDh_SetupWait(EnDh* this) { Animation_PlayLoop(&this->skelAnime, &D_06003A8C); this->curAction = DH_WAIT; - this->actor.posRot.pos.x = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.z; - this->actor.shape.unk_08 = -15000.0f; + this->actor.world.pos.x = Rand_CenteredFloat(600.0f) + this->actor.home.pos.x; + this->actor.world.pos.z = Rand_CenteredFloat(600.0f) + this->actor.home.pos.z; + this->actor.shape.yOffset = -15000.0f; this->dirtWaveSpread = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.flags |= 0x80; this->dirtWavePhase = this->actionState = this->actor.params = ENDH_WAIT_UNDERGROUND; EnDh_SetupAction(this, EnDh_Wait); @@ -161,7 +219,7 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) { switch (this->actionState) { case 0: this->actor.flags |= 1; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.flags &= ~0x80; this->actionState++; this->drawDirtWave++; @@ -171,19 +229,19 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 5.0f, 0.0f); this->dirtWaveHeight = Math_SinS(this->dirtWavePhase) * 55.0f; this->dirtWaveAlpha = (s16)(Math_SinS(this->dirtWavePhase) * 255.0f); - EnDh_SpawnDebris(globalCtx, this, &this->actor.posRot.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); - if (this->actor.shape.unk_08 == 0.0f) { + EnDh_SpawnDebris(globalCtx, this, &this->actor.world.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); + if (this->actor.shape.yOffset == 0.0f) { this->drawDirtWave = false; this->actionState++; } else if (this->dirtWavePhase > 0x12C0) { - this->actor.shape.unk_08 += 500.0f; + this->actor.shape.yOffset += 500.0f; } break; case 2: EnDh_SetupWalk(this); break; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); SkelAnime_Update(&this->skelAnime); if (this->actor.params != ENDH_START_ATTACK_BOMB) { func_8008EEAC(globalCtx, &this->actor); @@ -201,8 +259,8 @@ void EnDh_SetupWalk(EnDh* this) { } void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (((s32)this->skelAnime.curFrame % 8) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_WALK); @@ -210,7 +268,7 @@ void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) { if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_LAUGH); } - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { this->actor.speedXZ = 0.0f; if (func_8002E084(&this->actor, 60 * 0x10000 / 360)) { EnDh_SetupAttack(this); @@ -234,9 +292,9 @@ void EnDh_Retreat(EnDh* this, GlobalContext* globalCtx) { this->retreat = false; EnDh_SetupBurrow(this); } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, (s16)(this->actor.yawTowardsLink + 0x8000), 1, 0xBB8, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, (s16)(this->actor.yawTowardsPlayer + 0x8000), 1, 0xBB8, 0); } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); } @@ -253,11 +311,11 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->actionState++; - } else if ((this->actor.xzDistToLink > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) { + } else if ((this->actor.xzDistToPlayer > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) { Animation_Change(&this->skelAnime, &D_06004658, -1.0f, this->skelAnime.curFrame, 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState = 4; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; } switch (this->actionState) { case 1: @@ -265,26 +323,28 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { this->actionState++; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_BITE); case 0: - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); break; case 2: if (this->skelAnime.curFrame >= 4.0f) { - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0x11; - this->collider2.list[0].body.toucher.flags = 0xFFCFFFFF; - this->collider2.list->body.toucher.damage = 8; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->collider2.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider2.elements[0].info.toucher.damage = 8; } - if (this->collider2.base.atFlags & 4) { - this->collider2.base.atFlags &= ~6; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + if (this->collider2.base.atFlags & AT_BOUNCED) { + this->collider2.base.atFlags &= ~(AT_HIT | AT_BOUNCED); + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; this->actionState++; - } else if (this->collider2.base.atFlags & 2) { - this->collider2.base.atFlags &= ~2; + } else if (this->collider2.base.atFlags & AT_HIT) { + this->collider2.base.atFlags &= ~AT_HIT; func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.shape.rot.y, 8.0f); } break; case 3: - if ((this->actor.xzDistToLink <= 100.0f) && (func_8002E084(&this->actor, 60 * 0x10000 / 360) != 0)) { + if ((this->actor.xzDistToPlayer <= 100.0f) && (func_8002E084(&this->actor, 60 * 0x10000 / 360) != 0)) { Animation_Change(&this->skelAnime, &D_06004658, 1.0f, 20.0f, Animation_GetLastFrame(&D_06004658), ANIMMODE_ONCE, -6.0f); this->actionState = 0; @@ -292,8 +352,9 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06004658, -1.0f, Animation_GetLastFrame(&D_06004658), 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState++; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; } break; case 5: @@ -302,14 +363,14 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { case 4: break; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } void EnDh_SetupBurrow(EnDh* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002148, -6.0f); this->curAction = DH_BURROW; this->dirtWaveSpread = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->dirtWavePhase = 0; this->actionState = 0; this->actor.flags &= ~1; @@ -322,15 +383,16 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) { case 0: this->actionState++; this->drawDirtWave++; - this->collider1.base.atFlags = this->collider1.body.toucherFlags = 0x11; - this->collider1.body.toucher.flags = 0xFFCFFFFF; - this->collider1.body.toucher.damage = 4; + this->collider1.base.atFlags = this->collider1.info.toucherFlags = + AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->collider1.info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider1.info.toucher.damage = 4; case 1: this->dirtWavePhase += 0x47E; Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 8.0f, 0.0f); this->dirtWaveHeight = Math_SinS(this->dirtWavePhase) * 55.0f; this->dirtWaveAlpha = (s16)(Math_SinS(this->dirtWavePhase) * 255.0f); - EnDh_SpawnDebris(globalCtx, this, &this->actor.posRot.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); + EnDh_SpawnDebris(globalCtx, this, &this->actor.world.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); this->collider1.dim.radius = this->dirtWaveSpread * 0.6f; if (SkelAnime_Update(&this->skelAnime)) { this->actionState++; @@ -339,8 +401,8 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) { case 2: this->drawDirtWave = false; this->collider1.dim.radius = 35; - this->collider1.base.atFlags = this->collider1.body.toucherFlags = 0; - this->collider1.body.toucher.flags = this->collider1.body.toucher.damage = 0; + this->collider1.base.atFlags = this->collider1.info.toucherFlags = AT_NONE; // Also TOUCH_NONE + this->collider1.info.toucher.dmgFlags = this->collider1.info.toucher.damage = 0; EnDh_SetupWait(this); break; } @@ -360,12 +422,12 @@ void EnDh_Damage(EnDh* this, GlobalContext* globalCtx) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.15f; } - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->retreat) { EnDh_SetupRetreat(this, globalCtx); - } else if ((this->actor.xzDistToLink <= 105.0f) && func_8002E084(&this->actor, 60 * 0x10000 / 360)) { + } else if ((this->actor.xzDistToPlayer <= 105.0f) && func_8002E084(&this->actor, 60 * 0x10000 / 360)) { f32 frames = Animation_GetLastFrame(&D_06004658); EnDh_SetupAttack(this); @@ -398,7 +460,7 @@ void EnDh_Death(EnDh* this, GlobalContext* globalCtx) { if (this->timer < 150) { if (this->alpha != 0) { this->actor.scale.y -= 0.000075f; - this->actor.shape.unk_14 = this->alpha -= 5; + this->actor.shape.shadowAlpha = this->alpha -= 5; } else { Actor_Kill(&this->actor); return; @@ -410,7 +472,7 @@ void EnDh_Death(EnDh* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); } if ((s32)this->skelAnime.curFrame == 61) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); } } } @@ -420,11 +482,11 @@ void EnDh_CollisionCheck(EnDh* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 lastHealth; - if ((this->collider2.base.acFlags & 2) && !this->retreat) { - this->collider2.base.acFlags &= ~2; + if ((this->collider2.base.acFlags & AC_HIT) && !this->retreat) { + this->collider2.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect != 0) && (this->actor.colChkInfo.damageEffect != 6)) { - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; if (player->unk_844 != 0) { this->unk_258 = player->unk_845; } @@ -432,7 +494,7 @@ void EnDh_CollisionCheck(EnDh* this, GlobalContext* globalCtx) { lastHealth = this->actor.colChkInfo.health; if (Actor_ApplyDamage(&this->actor) == 0) { EnDh_SetupDeath(this); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); } else { if (((lastHealth >= 15) && (this->actor.colChkInfo.health < 15)) || ((lastHealth >= 9) && (this->actor.colChkInfo.health < 9)) || @@ -455,16 +517,16 @@ void EnDh_Update(Actor* thisx, GlobalContext* globalCtx) { EnDh_CollisionCheck(this, globalCtx); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 45.0f, 45.0f, 0x1D); - this->actor.posRot2.pos = this->headPos; - Collider_CylinderUpdate(&this->actor, &this->collider1); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 45.0f, 45.0f, 0x1D); + this->actor.focus.pos = this->headPos; + Collider_UpdateCylinder(&this->actor, &this->collider1); if (this->actor.colChkInfo.health > 0) { if (this->curAction == DH_WAIT) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } else { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } - if (((this->curAction != DH_DAMAGE) && (this->actor.shape.unk_08 == 0.0f)) || + if (((this->curAction != DH_DAMAGE) && (this->actor.shape.yOffset == 0.0f)) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_258))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); @@ -485,7 +547,7 @@ void EnDh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Matrix_MultVec3f(&headOffset, &this->headPos); Matrix_Push(); Matrix_Translate(headOffset.x, headOffset.y, headOffset.z, MTXMODE_APPLY); - func_800628A4(1, &this->collider2); + Collider_UpdateSpheres(1, &this->collider2); Matrix_Pull(); } } @@ -518,7 +580,7 @@ void EnDh_Draw(Actor* thisx, GlobalContext* globalCtx) { 0x20, 0x40)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->dirtWaveAlpha); - Matrix_Translate(0.0f, -this->actor.shape.unk_08, 0.0f, MTXMODE_APPLY); + Matrix_Translate(0.0f, -this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); Matrix_Scale(this->dirtWaveSpread * 0.01f, this->dirtWaveHeight * 0.01f, this->dirtWaveSpread * 0.01f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_dh.c", 1160), diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h index 587de29040..85bda207d8 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -25,7 +25,7 @@ typedef struct EnDh { /* 0x025E */ s16 dirtWavePhase; /* 0x0260 */ ColliderCylinder collider1; /* 0x02AC */ ColliderJntSph collider2; - /* 0x02CC */ ColliderJntSphItem elements[1]; + /* 0x02CC */ ColliderJntSphElement elements[1]; /* 0x030C */ Vec3f headPos; /* 0x0318 */ f32 dirtWaveSpread; /* 0x031C */ f32 dirtWaveHeight; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 19688ec4e7..b5d204bcff 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -26,7 +26,7 @@ void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx); const ActorInit En_Dha_InitVars = { ACTOR_EN_DHA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DH, sizeof(EnDha), @@ -36,43 +36,115 @@ const ActorInit En_Dha_InitVars = { (ActorFunc)EnDha_Draw, }; -static DamageTable sDamageTable = { { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(4, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 0, 0 }, 12 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 2, { { 3200, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 3, { { 1200, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 4, { { 2700, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 5, { { 1200, 0, 0 }, 10 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 5, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x2E, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), }; @@ -89,10 +161,10 @@ void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &sDamageTable; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06000BD8, &D_060015B0, this->jointTable, this->morphTable, 4); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 50.0f; - this->actor.colChkInfo.mass = 0xFE; + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFeet, 90.0f); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 50.0f; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 8; this->unk_1CE = -0x4000; Collider_InitJntSph(globalCtx, &this->collider); @@ -113,8 +185,8 @@ void func_809EC9C8(EnDha* this) { this->unk_1C0 = 0; this->unk_1C8 = ((Rand_ZeroOne() * 10.0f) + 5.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->actor.initPosRot.rot.z = 1; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.home.rot.z = 1; EnDha_SetupAction(this, func_809ECA50); } @@ -125,7 +197,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; s32 pad2; - Vec3f playerPos = player->actor.posRot.pos; + Vec3f playerPos = player->actor.world.pos; Vec3s test; s16 result; s32 resultAbs; @@ -137,7 +209,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { } else { playerPos.y += 56.0f; } - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { this->unk_1D6.x = this->unk_1D0.z = this->unk_1D0.y = 0; if (Math_Vec3f_DistXYZ(&playerPos, &this->unk_1DC) <= 12.0f) { if (this->unk_1CC == 0) { @@ -170,12 +242,12 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { player->actor.parent = NULL; player->unk_850 = 200; } - if (this->actor.initPosRot.rot.z != 0) { + if (this->actor.home.rot.z != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_HAND_AT); - this->actor.initPosRot.rot.z = 0; + this->actor.home.rot.z = 0; } } - this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &playerPos); + this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &playerPos); Math_SmoothStepToF(&this->unk_1DC.x, playerPos.x, 1.0f, 16.0f, 0.0f); Math_SmoothStepToF(&this->unk_1DC.y, playerPos.y, 1.0f, 16.0f, 0.0f); Math_SmoothStepToF(&this->unk_1DC.z, playerPos.z, 1.0f, 16.0f, 0.0f); @@ -183,12 +255,12 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { Matrix_Translate(this->unk_1DC.x, this->unk_1DC.y, this->unk_1DC.z, MTXMODE_NEW); Matrix_RotateRPY(test.x, test.y, 0, MTXMODE_APPLY); Matrix_MultVec3f(&D_809ED758, &this->unk_1F4); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); - func_80035844(&this->actor.posRot.pos, &this->unk_1F4, &test, 0); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + func_80035844(&this->actor.world.pos, &this->unk_1F4, &test, 0); Matrix_RotateRPY(test.x, test.y, 0, MTXMODE_APPLY); Matrix_MultVec3f(&D_809ED74C, &this->unk_1F4); - this->unk_1CE = Math_Vec3f_Pitch(&this->actor.posRot.pos, &this->unk_1F4); - result = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_1F4) - this->actor.shape.rot.y; + this->unk_1CE = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_1F4); + result = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_1F4) - this->actor.shape.rot.y; resultAbs = ABS(result); if (resultAbs >= 0x4000) { this->unk_1CE = -0x8000 - this->unk_1CE; @@ -204,7 +276,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { player->actor.parent = NULL; player->unk_850 = 200; } - this->actor.initPosRot.rot.z = 1; + this->actor.home.rot.z = 1; Math_SmoothStepToS(&this->unk_1D0.x, 0, 1, 0x3E8, 0); Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x3E8, 0); SkelAnime_Update(&this->skelAnime); @@ -263,11 +335,11 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { result = Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x7D0, 0); SkelAnime_Update(&this->skelAnime); if (result == 0) { - vector = this->actor.posRot.pos; + vector = this->actor.world.pos; if (this->unk_1C8 != 0) { - if (-12000.0f < this->actor.shape.unk_08) { - this->actor.shape.unk_08 -= 1000.0f; + if (-12000.0f < this->actor.shape.yOffset) { + this->actor.shape.yOffset -= 1000.0f; func_80033480(globalCtx, &vector, 7.0f, 1, 0x5A, 0x14, 1); } else { this->unk_1C8--; @@ -277,9 +349,9 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { } } } else { - this->actor.shape.unk_08 += 500.0f; + this->actor.shape.yOffset += 500.0f; func_80033480(globalCtx, &vector, 7.0f, 1, 0x5A, 0x14, 1); - if (this->actor.shape.unk_08 == 0.0f) { + if (this->actor.shape.yOffset == 0.0f) { func_809EC9C8(this); } } @@ -287,8 +359,8 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { } void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx) { - if (!((this->unk_1C0 >= 8) || !(this->collider.base.acFlags & 2))) { - this->collider.base.acFlags &= ~2; + if (!((this->unk_1C0 >= 8) || !(this->collider.base.acFlags & AC_HIT))) { + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect == 0 || this->actor.colChkInfo.damageEffect == 6) { return; } else { @@ -296,7 +368,7 @@ void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx) { if (Actor_ApplyDamage(&this->actor) == 0) { EnDha_SetupDeath(this); this->actor.colChkInfo.health = 8; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_DAMAGE); this->unk_1C0 = 9; @@ -314,7 +386,7 @@ void EnDha_Update(Actor* thisx, GlobalContext* globalCtx) { EnDha* this = THIS; if (this->actor.parent == NULL) { - this->actor.parent = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORTYPE_ENEMY, 10000.0f); + this->actor.parent = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORCAT_ENEMY, 10000.0f); } EnDha_UpdateHealth(this, globalCtx); this->actionFunc(this, globalCtx); @@ -346,18 +418,18 @@ void EnDha_OverridePostDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList switch (limbIndex) { case 1: - func_800628A4(2, &this->collider); - func_800628A4(3, &this->collider); + Collider_UpdateSpheres(2, &this->collider); + Collider_UpdateSpheres(3, &this->collider); break; case 2: - func_800628A4(4, &this->collider); - func_800628A4(5, &this->collider); + Collider_UpdateSpheres(4, &this->collider); + Collider_UpdateSpheres(5, &this->collider); Matrix_MultVec3f(&D_809ED770, &this->unk_1F4); break; case 3: - func_800628A4(1, &this->collider); + Collider_UpdateSpheres(1, &this->collider); Matrix_MultVec3f(&D_809ED764, &this->unk_1DC); Matrix_MultVec3f(&D_809ED770, &this->unk_1E8); break; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/src/overlays/actors/ovl_En_Dha/z_en_dha.h index 3b14252b9d..6a6b8311e6 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -25,7 +25,7 @@ typedef struct EnDha { /* 0x01E8 */ Vec3f unk_1E8; /* 0x01F4 */ Vec3f unk_1F4; /* 0x0200 */ ColliderJntSph collider; - /* 0x0220 */ ColliderJntSphItem colliderItem[5]; + /* 0x0220 */ ColliderJntSphElement colliderItem[5]; } EnDha; // size = 0x0360 extern const ActorInit En_Dha_InitVars; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index a9b8c0f395..15cbd35437 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_0600BFA8; /* const ActorInit En_Diving_Game_InitVars = { ACTOR_EN_DIVING_GAME, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZO, sizeof(EnDivingGame), @@ -25,6 +25,26 @@ const ActorInit En_Diving_Game_InitVars = { (ActorFunc)EnDivingGame_Update, (ActorFunc)EnDivingGame_Draw, }; + +static ColliderCylinderInit D_809EF0B4 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 10, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s") diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 8f1ff9d7e1..ddf73c8053 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -46,7 +46,7 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx); const ActorInit En_Dns_InitVars = { ACTOR_EN_DNS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SHOPNUTS, sizeof(EnDns), @@ -56,9 +56,22 @@ const ActorInit En_Dns_InitVars = { (ActorFunc)EnDns_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 18, 32, 0, { 0, 0, 0 } }, }; @@ -104,8 +117,8 @@ DnsItemEntry* D_809F0500[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 78, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; typedef struct { @@ -143,11 +156,11 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_060009A0, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 35.0f); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 35.0f); this->actor.textId = D_809F040C[this->actor.params]; Actor_SetScale(&this->actor, 0.01f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->maintainCollider = 1; this->standOnGround = 1; this->dropCollectible = 0; @@ -311,17 +324,17 @@ void EnDns_SetupWait(EnDns* this, GlobalContext* globalCtx) { } void EnDns_Wait(EnDns* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2000, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = EnDns_Talk; } else { - if ((this->collider.base.maskA & 2) || (this->actor.unk_10C != 0)) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; } - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { func_8002F2F4(&this->actor, globalCtx); } } @@ -431,7 +444,7 @@ void EnDns_SetupBurrow(EnDns* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = EnDns_Burrow; this->standOnGround = 0; - this->yInitPos = this->actor.posRot.pos.y; + this->yInitPos = this->actor.world.pos.y; } } @@ -440,20 +453,20 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx) { Vec3f initPos; s32 i; - depth = this->yInitPos - this->actor.posRot.pos.y; + depth = this->yInitPos - this->actor.world.pos.y; if ((this->dustTimer & 3) == 0) { - initPos.x = this->actor.posRot.pos.x; + initPos.x = this->actor.world.pos.x; initPos.y = this->yInitPos; - initPos.z = this->actor.posRot.pos.z; + initPos.z = this->actor.world.pos.z; func_80028990(globalCtx, 20.0f, &initPos); } this->actor.shape.rot.y += 0x2000; // Drops only if you bought its item if (depth > 400.0f) { if (this->dropCollectible) { - initPos.x = this->actor.posRot.pos.x; + initPos.x = this->actor.world.pos.x; initPos.y = this->yInitPos; - initPos.z = this->actor.posRot.pos.z; + initPos.z = this->actor.world.pos.z; for (i = 0; i < 3; i++) { Item_DropCollectible(globalCtx, &initPos, ITEM00_HEART); } @@ -468,16 +481,16 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) { this->dustTimer++; this->actor.textId = D_809F040C[this->actor.params]; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); Actor_SetScale(&this->actor, 0.01f); SkelAnime_Update(&this->skelAnime); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); if (this->standOnGround) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4); } if (this->maintainCollider) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 74af8d25ea..f6f79d7e59 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -11,7 +11,7 @@ void EnDntDemo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dnt_Demo_InitVars = { ACTOR_EN_DNT_DEMO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDntDemo), diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index cd9622c448..c4a9ac3f97 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_060037C0; /* const ActorInit En_Dnt_Jiji_InitVars = { ACTOR_EN_DNT_JIJI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DNS, sizeof(EnDntJiji), @@ -31,6 +31,26 @@ const ActorInit En_Dnt_Jiji_InitVars = { (ActorFunc)EnDntJiji_Update, (ActorFunc)EnDntJiji_Draw, }; + +static ColliderCylinderInit D_809F2FA0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 30, 80, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s") diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 79b31a6b2d..90a0b4cc5f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -26,7 +26,7 @@ extern UNK_TYPE D_06003128; /* const ActorInit En_Dnt_Nomal_InitVars = { ACTOR_EN_DNT_NOMAL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDntNomal), @@ -35,6 +35,46 @@ const ActorInit En_Dnt_Nomal_InitVars = { (ActorFunc)EnDntNomal_Update, NULL, }; + +static ColliderQuadInit D_809F5DFC = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderCylinderInit D_809F5DD0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 16, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Init.s") diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index a9c17f8eba..bee4ffe008 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060020E0; /* const ActorInit En_Dodojr_InitVars = { ACTOR_EN_DODOJR, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DODOJR, sizeof(EnDodojr), @@ -28,6 +28,26 @@ const ActorInit En_Dodojr_InitVars = { (ActorFunc)EnDodojr_Update, (ActorFunc)EnDodojr_Draw, }; + +static ColliderCylinderInit D_809F7EB0 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFC5FFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 18, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s") diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 09d569c5c7..0b2eb27d2f 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -49,7 +49,7 @@ extern AnimationHeader D_06001A44; const ActorInit En_Dodongo_InitVars = { ACTOR_EN_DODONGO, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DODONGO, sizeof(EnDodongo), @@ -59,69 +59,190 @@ const ActorInit En_Dodongo_InitVars = { (ActorFunc)EnDodongo_Draw, }; -static ColliderJntSphItemInit sBodyElementsInit[6] = { +static ColliderJntSphElementInit sBodyElementsInit[6] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 15, { { 0, 0, 0 }, 17 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 14, { { 0, 0, 0 }, 15 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 21, { { 0, 0, 0 }, 20 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 28, { { 0, 0, 0 }, 20 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0D800691, 0x00, 0x00 }, 0x00, 0x01, 0x09 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0D800691, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON | OCELEM_UNK3, + }, { 6, { { 0, 0, 0 }, 35 }, 100 }, }, }; static ColliderJntSphInit sBodyJntSphInit = { - { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 6, sBodyElementsInit, }; -static ColliderTrisItemInit sHardElementsInit[3] = { +static ColliderTrisElementInit sHardElementsInit[3] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xF24BF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xF24BF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCBF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCBF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sHardTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 3, sHardElementsInit, }; static ColliderQuadInit sAttackQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x20000000, 0x01, 0x10 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF4, 0x02, 0x02, 0x02, - 0x02, 0x60, 0xF3, 0x60, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0xF), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; void EnDodongo_SetupAction(EnDodongo* this, EnDodongoActionFunc actionFunc) { @@ -191,24 +312,24 @@ void EnDodongo_SpawnBombSmoke(EnDodongo* this, GlobalContext* globalCtx) { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 13, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2800, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2800, ICHAIN_STOP), }; void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { EnDodongo* this = THIS; EffectBlureInit1 blureInit; - this->actor.unk_1F = 3; + this->actor.targetMode = 3; Actor_ProcessInitChain(&this->actor, sInitChain); this->bombSmokePrimColor.r = this->bombSmokePrimColor.g = this->bombSmokeEnvColor.r = 255; this->bombSmokePrimColor.a = this->bombSmokeEnvColor.a = 200; this->bombSmokeEnvColor.g = 10; this->bodyScale.x = this->bodyScale.y = this->bodyScale.z = 1.0f; - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 48.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 48.0f); Actor_SetScale(&this->actor, 0.01875f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31); this->actor.colChkInfo.health = 4; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.damageTable = &sDamageTable; Collider_InitQuad(globalCtx, &this->colliderAT); Collider_InitTris(globalCtx, &this->colliderHard); @@ -229,7 +350,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { blureInit.calcMode = 2; Effect_Add(globalCtx, &this->blureIdx, EFFECT_BLURE1, 0, 0, &blureInit); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); EnDodongo_SetupIdle(this); } @@ -323,10 +444,10 @@ void EnDodongo_BreatheFire(EnDodongo* this, GlobalContext* globalCtx) { if ((29.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 43.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG); fireFrame = this->skelAnime.curFrame - 29.0f; - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += 35.0f; - EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 30.0f, &pos); - EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 2.5f, &accel); + EnDodongo_ShiftVecRadial(this->actor.world.rot.y, 30.0f, &pos); + EnDodongo_ShiftVecRadial(this->actor.world.rot.y, 2.5f, &accel); EffectSsDFire_SpawnFixedScale(globalCtx, &pos, &velocity, &accel, 255 - (fireFrame * 10), fireFrame + 3); } else if ((2.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 20.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_BREATH - SFX_FLAG); @@ -347,10 +468,10 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) { s32 pad; if (this->actor.child != NULL) { - this->actor.child->posRot.pos = this->mouthPos; + this->actor.child->world.pos = this->mouthPos; ((EnBom*)this->actor.child)->timer++; } else if (this->actor.parent != NULL) { - this->actor.parent->posRot.pos = this->mouthPos; + this->actor.parent->world.pos = this->mouthPos; ((EnBombf*)this->actor.parent)->timer++; //! @bug The devs forgot an explosive could also be a bombchu, which leads to a serious bug. ->timer (0x1F8) is //! outside the bounds of the bombchu actor, and the memory it writes to happens to be one of the pointers in @@ -403,8 +524,8 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) { func_8002829C(globalCtx, &pos, &smokeVel, &smokeAccel, &white, &white, 50, 5); } } - this->bodyScale.y = this->bodyScale.z = (Math_SinS(this->actor.dmgEffectTimer * 0x1000) * 0.5f) + 1.0f; - this->bodyScale.x = Math_SinS(this->actor.dmgEffectTimer * 0x1000) + 1.0f; + this->bodyScale.y = this->bodyScale.z = (Math_SinS(this->actor.colorFilterTimer * 0x1000) * 0.5f) + 1.0f; + this->bodyScale.x = Math_SinS(this->actor.colorFilterTimer * 0x1000) + 1.0f; SkelAnime_Update(&this->skelAnime); if (this->timer == 0) { @@ -416,7 +537,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { s32 pad; f32 playbackSpeed; Player* player = PLAYER; - s16 yawDiff = (s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y); + s16 yawDiff = (s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y); yawDiff = ABS(yawDiff); @@ -449,19 +570,18 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { } } - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 400.0f) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x1F4, 0); + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 400.0f) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x1F4, 0); this->actor.flags |= 1; - if ((this->actor.xzDistToLink < 100.0f) && (yawDiff < 0x1388) && (this->actor.yDistToLink < 60.0f)) { + if ((this->actor.xzDistToPlayer < 100.0f) && (yawDiff < 0x1388) && (this->actor.yDistToPlayer < 60.0f)) { EnDodongo_SetupBreatheFire(this); } } else { this->actor.flags &= ~1; - if ((Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 150.0f) || - (this->retreatTimer != 0)) { - s16 yawToHome = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + if ((Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 150.0f) || (this->retreatTimer != 0)) { + s16 yawToHome = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yawToHome, 1, 0x1F4, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, yawToHome, 1, 0x1F4, 0); } if (this->retreatTimer != 0) { this->retreatTimer--; @@ -477,7 +597,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnDodongo_SetupSweepTail(EnDodongo* this) { @@ -490,25 +610,25 @@ void EnDodongo_SetupSweepTail(EnDodongo* this) { } void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { - s16 yawDiff1 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (SkelAnime_Update(&this->skelAnime)) { if ((this->timer != 0) || (ABS(yawDiff1) < 0x4000)) { - this->sphElements[2].body.toucherFlags = 0; - this->sphElements[1].body.toucherFlags = 0; - this->colliderBody.base.atFlags = 0; - this->sphElements[2].body.toucher.flags = 0; - this->sphElements[1].body.toucher.flags = 0; - this->sphElements[2].body.toucher.damage = 0; - this->sphElements[1].body.toucher.damage = 0; + this->sphElements[2].info.toucherFlags = TOUCH_NONE; + this->sphElements[1].info.toucherFlags = TOUCH_NONE; + this->colliderBody.base.atFlags = AT_NONE; + this->sphElements[2].info.toucher.dmgFlags = 0; + this->sphElements[1].info.toucher.dmgFlags = 0; + this->sphElements[2].info.toucher.damage = 0; + this->sphElements[1].info.toucher.damage = 0; EnDodongo_SetupBreatheFire(this); this->timer = Rand_S16Offset(5, 10); } else { - s16 yawDiff2 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff2 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; AnimationHeader* animation; this->tailSwipeSpeed = (0xFFFF - ABS(yawDiff2)) / 0xF; - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) { this->tailSwipeSpeed = -this->tailSwipeSpeed; animation = &D_060042C4; } else { @@ -517,16 +637,16 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL); Animation_PlayOnceSetSpeed(&this->skelAnime, animation, 2.0f); this->timer = 18; - this->colliderBody.base.atFlags = this->sphElements[1].body.toucherFlags = - this->sphElements[2].body.toucherFlags = 0x11; - this->sphElements[1].body.toucher.flags = this->sphElements[2].body.toucher.flags = 0xFFCFFFFF; - this->sphElements[1].body.toucher.damage = this->sphElements[2].body.toucher.damage = 8; + this->colliderBody.base.atFlags = this->sphElements[1].info.toucherFlags = + this->sphElements[2].info.toucherFlags = AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->sphElements[1].info.toucher.dmgFlags = this->sphElements[2].info.toucher.dmgFlags = 0xFFCFFFFF; + this->sphElements[1].info.toucher.damage = this->sphElements[2].info.toucher.damage = 8; } } else if (this->timer > 1) { Vec3f tailPos; this->timer--; - this->actor.shape.rot.y = this->actor.posRot.rot.y += this->tailSwipeSpeed; + this->actor.shape.rot.y = this->actor.world.rot.y += this->tailSwipeSpeed; tailPos.x = this->sphElements[1].dim.worldSphere.center.x; tailPos.y = this->sphElements[1].dim.worldSphere.center.y; tailPos.z = this->sphElements[1].dim.worldSphere.center.z; @@ -536,7 +656,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { tailPos.z = this->sphElements[2].dim.worldSphere.center.z; func_80033260(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0); - if (this->colliderBody.base.atFlags & 2) { + if (this->colliderBody.base.atFlags & AT_HIT) { Player* player = PLAYER; if (this->colliderBody.base.at == &player->actor) { @@ -564,13 +684,13 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { if (this->actor.params == EN_DODONGO_SMOKE_DEATH) { EnDodongo_SpawnBombSmoke(this, globalCtx); } - } else if (this->actor.dmgEffectTimer == 0) { + } else if (this->actor.colorFilterTimer == 0) { func_8003426C(&this->actor, 0x4000, 0x78, 0, 4); } if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->timer == 0) { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 6, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 6, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; this->timer = 8; @@ -582,7 +702,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; if (this->timer == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x40); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x40); Actor_Kill(&this->actor); } } @@ -590,7 +710,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.colChkInfo.health == 0) { EnDodongo_SetupDeath(this, globalCtx); } else { @@ -600,11 +720,11 @@ void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx) { } void EnDodongo_CollisionCheck(EnDodongo* this, GlobalContext* globalCtx) { - if (this->colliderHard.base.acFlags & 0x80) { - this->colliderHard.base.acFlags &= ~0x80; - this->colliderBody.base.acFlags &= ~2; - } else if ((this->colliderBody.base.acFlags & 2) && (this->actionState > DODONGO_DEATH)) { - this->colliderBody.base.acFlags &= ~2; + if (this->colliderHard.base.acFlags & AC_BOUNCED) { + this->colliderHard.base.acFlags &= ~AC_BOUNCED; + this->colliderBody.base.acFlags &= ~AC_HIT; + } else if ((this->colliderBody.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) { + this->colliderBody.base.acFlags &= ~AC_HIT; func_8003573C(&this->actor, &this->colliderBody, 0); if (this->actor.colChkInfo.damageEffect != 0xE) { this->damageEffect = this->actor.colChkInfo.damageEffect; @@ -647,8 +767,8 @@ void EnDodongo_UpdateQuad(EnDodongo* this, GlobalContext* globalCtx) { Matrix_MultVec3f(&sp7C, &this->colliderAT.dim.quad[d]); Matrix_MultVec3f(&sp70, &this->colliderAT.dim.quad[c]); - func_80062734(&this->colliderAT, &this->colliderAT.dim.quad[a], &this->colliderAT.dim.quad[b], - &this->colliderAT.dim.quad[c], &this->colliderAT.dim.quad[d]); + Collider_SetQuadVertices(&this->colliderAT, &this->colliderAT.dim.quad[a], &this->colliderAT.dim.quad[b], + &this->colliderAT.dim.quad[c], &this->colliderAT.dim.quad[d]); } void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -659,7 +779,7 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect != 0xE) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); if (this->actor.bgCheckFlags & 2) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); } @@ -679,9 +799,9 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderAT.base); } } - this->actor.posRot2.pos.x = this->actor.posRot.pos.x + Math_SinS(this->actor.shape.rot.y) * -30.0f; - this->actor.posRot2.pos.y = this->actor.posRot.pos.y + 20.0f; - this->actor.posRot2.pos.z = this->actor.posRot.pos.z + Math_CosS(this->actor.shape.rot.y) * -30.0f; + this->actor.focus.pos.x = this->actor.world.pos.x + Math_SinS(this->actor.shape.rot.y) * -30.0f; + this->actor.focus.pos.y = this->actor.world.pos.y + 20.0f; + this->actor.focus.pos.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y) * -30.0f; } s32 EnDodongo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, @@ -727,7 +847,7 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList Vec3f mouthOffset = { 1800.0f, 1200.0f, 0.0f }; Vec3f headOffset = { 1500.0f, 300.0f, 0.0f }; - func_800628A4(limbIndex, &this->colliderBody); + Collider_UpdateSpheres(limbIndex, &this->colliderBody); switch (limbIndex) { case 2: @@ -742,9 +862,9 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList Matrix_MultVec3f(&hardTris1VtxOffset[i], &hardTris1Vtx[i]); Matrix_MultVec3f(&hardTris2VtxOffset[i], &hardTris2Vtx[i]); } - func_800627A0(&this->colliderHard, 0, &hardTris0Vtx[0], &hardTris0Vtx[1], &hardTris0Vtx[2]); - func_800627A0(&this->colliderHard, 1, &hardTris1Vtx[0], &hardTris1Vtx[1], &hardTris1Vtx[2]); - func_800627A0(&this->colliderHard, 2, &hardTris2Vtx[0], &hardTris2Vtx[1], &hardTris2Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 0, &hardTris0Vtx[0], &hardTris0Vtx[1], &hardTris0Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 1, &hardTris1Vtx[0], &hardTris1Vtx[1], &hardTris1Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 2, &hardTris2Vtx[0], &hardTris2Vtx[1], &hardTris2Vtx[2]); Matrix_MultVec3f(&mouthOffset, &this->mouthPos); Matrix_MultVec3f(&headOffset, &this->headPos); break; @@ -812,7 +932,7 @@ void EnDodongo_Draw(Actor* thisx, GlobalContext* globalCtx2) { EnDodongo_PostLimbDraw, this); if (this->iceTimer != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; if (1) {} this->iceTimer--; if ((this->iceTimer % 4) == 0) { @@ -829,7 +949,7 @@ void EnDodongo_ShiftVecRadial(s16 yaw, f32 radius, Vec3f* vec) { } s32 EnDodongo_AteBomb(EnDodongo* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dx; f32 dy; f32 dz; @@ -839,9 +959,9 @@ s32 EnDodongo_AteBomb(EnDodongo* this, GlobalContext* globalCtx) { actor = actor->next; continue; } - dx = actor->posRot.pos.x - this->mouthPos.x; - dy = actor->posRot.pos.y - this->mouthPos.y; - dz = actor->posRot.pos.z - this->mouthPos.z; + dx = actor->world.pos.x - this->mouthPos.x; + dy = actor->world.pos.y - this->mouthPos.y; + dz = actor->world.pos.z - this->mouthPos.z; if ((fabsf(dx) < 20.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 20.0f)) { if (actor->id == ACTOR_EN_BOM) { this->actor.child = actor; diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index b7ea2e6a3c..d882e06e96 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -34,9 +34,9 @@ typedef struct EnDodongo { /* 0x03D0 */ s32 blureIdx; /* 0x03D4 */ ColliderQuad colliderAT; /* 0x0454 */ ColliderTris colliderHard; - /* 0x0474 */ ColliderTrisItem trisElements[3]; + /* 0x0474 */ ColliderTrisElement trisElements[3]; /* 0x0588 */ ColliderJntSph colliderBody; - /* 0x05A8 */ ColliderJntSphItem sphElements[6]; + /* 0x05A8 */ ColliderJntSphElement sphElements[6]; } EnDodongo; // size = 0x0728 typedef enum { diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 4736341b18..7d4e47ce01 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -24,7 +24,7 @@ void EnDog_Wait(EnDog* this, GlobalContext* globalCtx); const ActorInit En_Dog_InitVars = { ACTOR_EN_DOG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DOG, sizeof(EnDog), @@ -35,18 +35,26 @@ const ActorInit En_Dog_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 16, 20, 0, { 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, // health - 0x0000, // unk_10 - 0x0000, // unk_12 - 0x0000, // unk_14 - 0x32, // mass -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, 50 }; static struct_80034EC0_Entry sAnimations[] = { { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, @@ -157,8 +165,8 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) { } s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return 2; } @@ -166,8 +174,8 @@ s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) { return 0; } - if (this->collider.base.maskB & 1) { - this->collider.base.maskB &= ~1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; if (gSaveContext.dogParams != 0) { return 0; } @@ -211,7 +219,7 @@ s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) { f32 waypointDistSq; waypointDistSq = Path_OrientAndGetDistSq(&this->actor, this->path, this->waypoint, &targetYaw); - Math_SmoothStepToS(&this->actor.posRot.rot.y, targetYaw, 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, targetYaw, 10, 1000, 1); if ((waypointDistSq > 0.0f) && (waypointDistSq < 1000.0f)) { return EnDog_UpdateWaypoint(this, globalCtx); @@ -225,7 +233,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { s16 followingDog; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007290, NULL, this->jointTable, this->morphTable, 13); func_80034EC0(&this->skelAnime, sAnimations, 0); @@ -241,7 +249,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; @@ -300,7 +308,7 @@ void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) { } Math_SmoothStepToF(&this->actor.speedXZ, speed, 0.4f, 1.0f, 0.0f); EnDog_Orient(this, globalCtx); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; // Used to change between two text boxes for Richard's owner in the Market Day scene // depending on where he is on his path. En_Hy checks these event flags. @@ -351,16 +359,16 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink > 400.0f) { + if (this->actor.xzDistToPlayer > 400.0f) { if (this->nextBehavior != DOG_SIT && this->nextBehavior != DOG_SIT_2) { this->nextBehavior = DOG_BOW; } gSaveContext.dogParams = 0; speed = 0.0f; - } else if (this->actor.xzDistToLink > 100.0f) { + } else if (this->actor.xzDistToPlayer > 100.0f) { this->nextBehavior = DOG_RUN; speed = 4.0f; - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) { this->nextBehavior = DOG_BOW; } @@ -372,20 +380,20 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, speed, 0.6f, 1.0f); - if (!(this->actor.xzDistToLink > 400.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 10, 1000, 1); - this->actor.shape.rot = this->actor.posRot.rot; + if (!(this->actor.xzDistToPlayer > 400.0f)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 1000, 1); + this->actor.shape.rot = this->actor.world.rot; } } void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.6f, 1.0f); - Math_SmoothStepToS(&this->actor.posRot.rot.y, (this->actor.yawTowardsLink ^ 0x8000), 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, (this->actor.yawTowardsPlayer ^ 0x8000), 10, 1000, 1); } else { this->actionFunc = EnDog_FaceLink; } - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; } void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { @@ -394,16 +402,16 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { f32 absAngleDiff; // if the dog is more than 200 units away from Link, turn to face him then wait - if (200.0f <= this->actor.xzDistToLink) { + if (200.0f <= this->actor.xzDistToPlayer) { this->nextBehavior = DOG_WALK; Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f); - rotTowardLink = this->actor.yawTowardsLink; - prevRotY = this->actor.posRot.rot.y; - Math_SmoothStepToS(&this->actor.posRot.rot.y, rotTowardLink, 10, 1000, 1); + rotTowardLink = this->actor.yawTowardsPlayer; + prevRotY = this->actor.world.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, rotTowardLink, 10, 1000, 1); - absAngleDiff = this->actor.posRot.rot.y; + absAngleDiff = this->actor.world.rot.y; absAngleDiff -= prevRotY; absAngleDiff = fabsf(absAngleDiff); if (absAngleDiff < 200.0f) { @@ -415,14 +423,14 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; } void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) { - this->unusedAngle = (this->actor.yawTowardsLink - this->actor.shape.rot.y); + this->unusedAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y); // If another dog is following Link and he gets within 200 units of waiting dog, run away - if ((gSaveContext.dogParams != 0) && (this->actor.xzDistToLink < 200.0f)) { + if ((gSaveContext.dogParams != 0) && (this->actor.xzDistToPlayer < 200.0f)) { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } @@ -434,11 +442,12 @@ void EnDog_Update(Actor* thisx, GlobalContext* globalCtx) { EnDog_PlayAnimAndSFX(this); SkelAnime_Update(&this->skelAnime); - func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, + 5); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnDog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index bc6ede9afa..64b78e8669 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -31,7 +31,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx); const ActorInit En_Door_InitVars = { ACTOR_EN_DOOR, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDoor), @@ -55,7 +55,7 @@ static EnDoorInfo sDoorInfo[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP), }; @@ -119,16 +119,16 @@ void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx2) { xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; zOffset = Math_SinS(this->actor.shape.rot.y) * 30.0f; other = (EnDoor*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_DOOR, - this->actor.posRot.pos.x + xOffset, this->actor.posRot.pos.y, - this->actor.posRot.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, + this->actor.world.pos.x + xOffset, this->actor.world.pos.y, + this->actor.world.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, this->actor.params & ~0x40); if (other != NULL) { other->unk_192 = 1; } - this->actor.posRot.pos.x -= xOffset; - this->actor.posRot.pos.z += zOffset; + this->actor.world.pos.x -= xOffset; + this->actor.world.pos.z += zOffset; } - Actor_SetHeight(&this->actor, 70.0f); + Actor_SetFocus(&this->actor, 70.0f); } void EnDoor_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -153,15 +153,15 @@ void EnDoor_SetupType(EnDoor* this, GlobalContext* globalCtx) { doorType = (gSaveContext.dayTime > 0xC000 && gSaveContext.dayTime < 0xE000) ? DOOR_SCENEEXIT : DOOR_CHECKABLE; } - this->actor.posRot.rot.y = 0x0000; + this->actor.world.rot.y = 0x0000; if (doorType == DOOR_LOCKED) { if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { this->lockTimer = 10; } } else if (doorType == DOOR_AJAR) { - if (func_8002DB8C(&this->actor, &PLAYER->actor) > DOOR_AJAR_SLAM_RANGE) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) > DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarWait; - this->actor.posRot.rot.y = -0x1800; + this->actor.world.rot.y = -0x1800; } } else if (doorType == DOOR_CHECKABLE) { this->actor.textId = (this->actor.params & 0x3F) + 0x0200; @@ -188,7 +188,7 @@ void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx) { s16 phi_v0; doorType = this->actor.params >> 7 & 7; - func_8002DBD0(&this->actor, &sp2C, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &sp2C, &player->actor.world.pos); if (this->unk_191 != 0) { this->actionFunc = EnDoor_Open; Animation_PlayOnceSetSpeed(&this->skelAnime, D_809FCECC[this->unk_190], @@ -219,7 +219,7 @@ void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx) { player->doorDirection = (sp2C.z >= 0.0f) ? 1.0f : -1.0f; player->doorActor = &this->actor; } - } else if (doorType == DOOR_AJAR && this->actor.xzDistToLink > DOOR_AJAR_OPEN_RANGE) { + } else if (doorType == DOOR_AJAR && this->actor.xzDistToPlayer > DOOR_AJAR_OPEN_RANGE) { this->actionFunc = EnDoor_AjarOpen; } } @@ -240,21 +240,21 @@ void EnDoor_Check(EnDoor* this, GlobalContext* globalCtx) { } void EnDoor_AjarWait(EnDoor* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < DOOR_AJAR_SLAM_RANGE) { + if (this->actor.xzDistToPlayer < DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarClose; } } void EnDoor_AjarOpen(EnDoor* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < DOOR_AJAR_SLAM_RANGE) { + if (this->actor.xzDistToPlayer < DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarClose; - } else if (Math_ScaledStepToS(&this->actor.posRot.rot.y, -0x1800, 0x100)) { + } else if (Math_ScaledStepToS(&this->actor.world.rot.y, -0x1800, 0x100)) { this->actionFunc = EnDoor_AjarWait; } } void EnDoor_AjarClose(EnDoor* this, GlobalContext* globalCtx) { - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, 0, 0x700)) { + if (Math_ScaledStepToS(&this->actor.world.rot.y, 0, 0x700)) { this->actionFunc = EnDoor_Idle; } } @@ -276,7 +276,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx) { if (this->skelAnime.playSpeed < 1.5f) { numEffects = (s32)(Rand_ZeroOne() * 30.0f) + 50; for (i = 0; i < numEffects; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 60.0f, 100.0f, 50.0f, 0.15f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 60.0f, 100.0f, 50.0f, 0.15f); } } } else if (Animation_OnFrame(&this->skelAnime, sDoorAnimCloseFrames[this->unk_190])) { @@ -306,11 +306,11 @@ s32 EnDoor_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList if (limbIndex == 4) { temp_a2 = D_809FCEE4[this->dListIndex]; transitionEntry = &globalCtx->transitionActorList[(u16)this->actor.params >> 0xA]; - rot->z += this->actor.posRot.rot.y; + rot->z += this->actor.world.rot.y; if ((globalCtx->roomCtx.prevRoom.num >= 0) || (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) { phi_v0_2 = ((this->actor.shape.rot.y + this->skelAnime.jointTable[3].z) + rot->z) - - Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.posRot.pos); + Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.world.pos); *dList = (ABS(phi_v0_2) < 0x4000) ? temp_a2[0] : temp_a2[1]; } else { phi_v0 = this->unk_192; @@ -332,9 +332,9 @@ void EnDoor_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDoor_OverrideLimbDraw, NULL, &this->actor); - if (this->actor.posRot.rot.y != 0) { + if (this->actor.world.rot.y != 0) { if (1) {} - if (this->actor.posRot.rot.y > 0) { + if (this->actor.world.rot.y > 0) { gSPDisplayList(POLY_OPA_DISP++, D_0400EE00); } else { gSPDisplayList(POLY_OPA_DISP++, D_0400ECB8); diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 0f3603195c..5b9bc7280a 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -19,7 +19,7 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx); const ActorInit En_Ds_InitVars = { ACTOR_EN_DS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DS, sizeof(EnDs), @@ -35,16 +35,16 @@ extern AnimationHeader D_0600039C; void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { EnDs* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004768, &D_0600039C, this->jointTable, this->morphTable, 6); Animation_PlayOnce(&this->skelAnime, &D_0600039C); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.013f); this->actionFunc = EnDs_Wait; - this->actor.unk_1F = 1; + this->actor.targetMode = 1; this->unk_1E8 = 0; this->actor.flags &= ~0x1; this->unk_1E4 = 0.0f; @@ -225,10 +225,10 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { this->actionFunc = EnDs_Talk; } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; this->actor.textId = 0x5048; - if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistToLink < 200.0f)) { + if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistToPlayer < 200.0f)) { func_8002F298(this, globalCtx, 100.0f, EXCH_ITEM_ODD_MUSHROOM); this->unk_1E8 |= 1; } @@ -245,7 +245,7 @@ void EnDs_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->unk_1E8 & 1) { - func_80038290(globalCtx, this, &this->unk_1D8, &this->unk_1DE, this->actor.posRot2.pos); + func_80038290(globalCtx, this, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_1D8.x, 0, 6, 0x1838, 100); Math_SmoothStepToS(&this->unk_1D8.y, 0, 6, 0x1838, 100); @@ -269,7 +269,7 @@ void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnDs* this = THIS; if (limbIndex == 5) { - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index f852d5b39b..eb2aba76c7 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06011CA8; /* const ActorInit En_Du_InitVars = { ACTOR_EN_DU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DU, sizeof(EnDu), @@ -27,6 +27,26 @@ const ActorInit En_Du_InitVars = { (ActorFunc)EnDu_Update, (ActorFunc)EnDu_Draw, }; + +static ColliderCylinderInit D_809FF230 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Du/func_809FDC30.s") diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index df5ddb68a6..fd5f3b2c29 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -21,7 +21,7 @@ void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx); const ActorInit En_Dy_Extra_InitVars = { ACTOR_EN_DY_EXTRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DY_OBJ, sizeof(EnDyExtra), @@ -47,7 +47,7 @@ void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C.x = 0.025f; this->unk_15C.y = 0.039f; this->unk_15C.z = 0.025f; - this->unk_168 = this->actor.posRot.pos; + this->unk_168 = this->actor.world.pos; this->actor.gravity = -0.2f; this->unk_158 = 1.0f; this->unk_154 = 0x3C; @@ -56,7 +56,7 @@ void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx) { void func_809FF7AC(EnDyExtra* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f); - if (this->actor.posRot.pos.y < -55.0f) { + if (this->actor.world.pos.y < -55.0f) { this->actor.velocity.y = 0.0f; } if (this->unk_154 == 0 && this->unk_152 != 0) { @@ -72,7 +72,7 @@ void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx) { return; } Math_ApproachZeroF(&this->unk_158, 0.03f, 0.05f); - if (this->actor.posRot.pos.y < -55.0f) { + if (this->actor.world.pos.y < -55.0f) { this->actor.velocity.y = 0.0f; } } diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 1824e54abb..6e8a3df7eb 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -26,7 +26,7 @@ static EnEgActionFunc sActionFuncs[] = { const ActorInit En_Eg_InitVars = { ACTOR_EN_EG, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_ZL2, sizeof(EnEg), diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 0ae3508130..8d2aea34e6 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06003410; /* const ActorInit En_Eiyer_InitVars = { ACTOR_EN_EIYER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EI, sizeof(EnEiyer), @@ -28,6 +28,26 @@ const ActorInit En_Eiyer_InitVars = { (ActorFunc)EnEiyer_Update, (ActorFunc)EnEiyer_Draw, }; + +static ColliderCylinderInit D_80A01970 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x08 }, + { 0x00000019, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 27, 17, -10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s") diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index c58229f3fc..1e1fd74138 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -57,7 +57,7 @@ void EnElf_GetCutsceneNextPos(Vec3f* vec, GlobalContext* globalCtx, s32 action); const ActorInit En_Elf_InitVars = { ACTOR_EN_ELF, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnElf), @@ -215,7 +215,7 @@ s32 func_80A01F90(Vec3f* this, Vec3f* arg1, f32 arg2) { void func_80A01FE0(EnElf* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (!func_80A01F90(&this->actor.posRot.pos, &player->actor.posRot.pos, 30.0f)) { + if (!func_80A01F90(&this->actor.world.pos, &player->actor.world.pos, 30.0f)) { this->unk_2B8 = 0.5f; } else { this->unk_2B8 = 2.0f; @@ -235,7 +235,7 @@ void func_80A01FE0(EnElf* this, GlobalContext* globalCtx) { void func_80A020A4(EnElf* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_80A01F90(&this->actor.posRot.pos, &player->actor.posRot.pos, 50.0f)) { + if (func_80A01F90(&this->actor.world.pos, &player->actor.world.pos, 50.0f)) { if (this->unk_2C0 > 0) { this->unk_2C0--; } else { @@ -249,13 +249,13 @@ void func_80A020A4(EnElf* this, GlobalContext* globalCtx) { } void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { - f32 xzDistToLink; + f32 xzDistToPlayer; if (this->unk_2C0 > 0) { this->unk_2C0--; } else { - xzDistToLink = this->actor.xzDistToLink; - if (xzDistToLink < 50.0f) { + xzDistToPlayer = this->actor.xzDistToPlayer; + if (xzDistToPlayer < 50.0f) { if (Rand_ZeroOne() < 0.2f) { this->unk_2A8 = 2; this->unk_2AC = 0x400; @@ -267,16 +267,16 @@ void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { this->unk_2C0 = 10; } } else { - if (xzDistToLink > 150.0f) { - xzDistToLink = 150.0f; + if (xzDistToPlayer > 150.0f) { + xzDistToPlayer = 150.0f; } - xzDistToLink = ((xzDistToLink - 50.0f) * 0.95f) + 0.05f; + xzDistToPlayer = ((xzDistToPlayer - 50.0f) * 0.95f) + 0.05f; - if (Rand_ZeroOne() < xzDistToLink) { + if (Rand_ZeroOne() < xzDistToPlayer) { this->unk_2A8 = 3; this->unk_2AC = 0x200; - this->unk_2B8 = (xzDistToLink * 2.0f) + 1.0f; + this->unk_2B8 = (xzDistToPlayer * 2.0f) + 1.0f; this->func_2C8 = func_80A01FE0; this->unk_2C0 = (s16)Rand_ZeroFloat(16.0f) + 0x10; } else { @@ -294,7 +294,7 @@ void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { } void func_80A0232C(EnElf* this, GlobalContext* globalCtx) { - if (func_80A01F90(&this->unk_28C, &this->actor.posRot.pos, 100.0f)) { + if (func_80A01F90(&this->unk_28C, &this->actor.world.pos, 100.0f)) { this->unk_2A8 = 0; this->unk_2AC = 0x200; this->func_2C8 = func_80A0214C; @@ -325,14 +325,14 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); SkelAnime_Init(globalCtx, &this->skelAnime, &D_04016A48, &D_04014BA4, this->jointTable, this->morphTable, 15); ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f); - thisx->shape.unk_14 = 0xFF; + thisx->shape.shadowAlpha = 0xFF; - Lights_PointGlowSetInfo(&this->lightInfoGlow, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, 255, - 255, 255, 0); + Lights_PointGlowSetInfo(&this->lightInfoGlow, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, 255, + 255, 0); this->lightNodeGlow = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfoGlow); - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, - 255, 255, 255, 0); + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, + 255, 255, 0); this->lightNodeNoGlow = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfoNoGlow); this->fairyFlags = 0; @@ -357,10 +357,10 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { case FAIRY_REVIVE_BOTTLE: colorConfig = -1; EnElf_SetupAction(this, func_80A03610); - this->unk_2B8 = Math_Vec3f_DistXZ(&thisx->posRot.pos, &player->actor.posRot.pos); + this->unk_2B8 = Math_Vec3f_DistXZ(&thisx->world.pos, &player->actor.world.pos); this->unk_2AC = player->actor.shape.rot.y; this->unk_2B0 = -0x1000; - this->unk_28C.y = thisx->posRot.pos.y - player->actor.posRot.pos.y; + this->unk_28C.y = thisx->world.pos.y - player->actor.world.pos.y; this->unk_2AA = 0; this->unk_2B4 = 0.0f; break; @@ -370,13 +370,13 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B8 = 0.0f; this->unk_2AC = player->actor.shape.rot.y; this->unk_2B0 = 0; - this->unk_28C.y = thisx->posRot.pos.y - player->actor.posRot.pos.y; + this->unk_28C.y = thisx->world.pos.y - player->actor.world.pos.y; this->unk_2AA = 0; this->unk_2B4 = 7.0f; break; case FAIRY_HEAL_BIG: this->fairyFlags |= FAIRY_FLAG_BIG; - thisx->shape.shadowDrawFunc = ActorShadow_DrawFunc_WhiteCircle; + thisx->shape.shadowDraw = ActorShadow_DrawWhiteCircle; case FAIRY_HEAL_TIMED: this->fairyFlags |= FAIRY_FLAG_TIMED; case FAIRY_HEAL: @@ -385,7 +385,7 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = Rand_ZeroFloat(10.0f) + 10.0f; this->unk_2AA = 0; this->unk_2AE = (s16)(Rand_ZeroFloat(1048.0f)) + 0x200; - this->unk_28C = thisx->posRot.pos; + this->unk_28C = thisx->world.pos; this->unk_2BC = Rand_CenteredFloat(32767.0f); this->func_2C8 = func_80A0214C; func_80A0232C(this, globalCtx); @@ -402,8 +402,8 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { func_80A01C38(this, 8); for (i = 0; i < 8; i++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, thisx->posRot.pos.x, - thisx->posRot.pos.y - 30.0f, thisx->posRot.pos.z, 0, 0, 0, FAIRY_HEAL); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, thisx->world.pos.x, + thisx->world.pos.y - 30.0f, thisx->world.pos.z, 0, 0, 0, FAIRY_HEAL); } break; default: @@ -478,7 +478,7 @@ void func_80A02BD8(EnElf* this, Vec3f* targetPos, f32 arg2) { f32 yVelTarget; f32 yVelDirection; - yVelTarget = ((targetPos->y + this->unk_28C.y) - this->actor.posRot.pos.y) * arg2; + yVelTarget = ((targetPos->y + this->unk_28C.y) - this->actor.world.pos.y) * arg2; yVelDirection = (yVelTarget >= 0.0f) ? 1.0f : -1.0f; yVelTarget = fabsf(yVelTarget); yVelTarget = CLAMP(yVelTarget, 0.0f, 20.0f) * yVelDirection; @@ -491,8 +491,8 @@ void func_80A02C98(EnElf* this, Vec3f* targetPos, f32 arg2) { f32 xVelDirection; f32 zVelDirection; - xVelTarget = ((targetPos->x + this->unk_28C.x) - this->actor.posRot.pos.x) * arg2; - zVelTarget = ((targetPos->z + this->unk_28C.z) - this->actor.posRot.pos.z) * arg2; + xVelTarget = ((targetPos->x + this->unk_28C.x) - this->actor.world.pos.x) * arg2; + zVelTarget = ((targetPos->z + this->unk_28C.z) - this->actor.world.pos.z) * arg2; xVelDirection = (xVelTarget >= 0.0f) ? 1.0f : -1.0f; zVelDirection = (zVelTarget >= 0.0f) ? 1.0f : -1.0f; @@ -511,26 +511,26 @@ void func_80A02C98(EnElf* this, Vec3f* targetPos, f32 arg2) { void func_80A02E30(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); - this->actor.velocity.x = (targetPos->x + this->unk_28C.x) - this->actor.posRot.pos.x; - this->actor.velocity.z = (targetPos->z + this->unk_28C.z) - this->actor.posRot.pos.z; + this->actor.velocity.x = (targetPos->x + this->unk_28C.x) - this->actor.world.pos.x; + this->actor.velocity.z = (targetPos->z + this->unk_28C.z) - this->actor.world.pos.z; func_8002D7EC(&this->actor); - this->actor.posRot.pos.x = targetPos->x + this->unk_28C.x; - this->actor.posRot.pos.z = targetPos->z + this->unk_28C.z; + this->actor.world.pos.x = targetPos->x + this->unk_28C.x; + this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } void func_80A02EC0(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); this->actor.velocity.x = this->actor.velocity.z = 0.0f; func_8002D7EC(&this->actor); - this->actor.posRot.pos.x = targetPos->x + this->unk_28C.x; - this->actor.posRot.pos.z = targetPos->z + this->unk_28C.z; + this->actor.world.pos.x = targetPos->x + this->unk_28C.x; + this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } void func_80A02F2C(EnElf* this, Vec3f* targetPos) { f32 yVelTarget; f32 yVelDirection; - yVelTarget = (((Math_SinS(this->unk_2AA) * this->unk_2B4) + targetPos->y) - this->actor.posRot.pos.y) * 0.2f; + yVelTarget = (((Math_SinS(this->unk_2AA) * this->unk_2B4) + targetPos->y) - this->actor.world.pos.y) * 0.2f; yVelDirection = (yVelTarget >= 0.0f) ? 1.0f : -1.0f; this->unk_2AA += this->unk_2AE; yVelTarget = fabsf(yVelTarget); @@ -548,17 +548,17 @@ void func_80A03018(EnElf* this, GlobalContext* globalCtx) { switch (this->unk_2A8) { case 0: - targetYaw = Math_Atan2S(-(this->actor.posRot.pos.z - unk_28C->z), -(this->actor.posRot.pos.x - unk_28C->x)); + targetYaw = Math_Atan2S(-(this->actor.world.pos.z - unk_28C->z), -(this->actor.world.pos.x - unk_28C->x)); break; case 3: - targetYaw = Math_Atan2S(-(this->actor.posRot.pos.z - player->actor.posRot.pos.z), - -(this->actor.posRot.pos.x - player->actor.posRot.pos.x)); + targetYaw = Math_Atan2S(-(this->actor.world.pos.z - player->actor.world.pos.z), + -(this->actor.world.pos.x - player->actor.world.pos.x)); break; case 2: - targetYaw = Math_Atan2S(this->actor.posRot.pos.z - player->actor.posRot.pos.z, - this->actor.posRot.pos.x - player->actor.posRot.pos.x); + targetYaw = Math_Atan2S(this->actor.world.pos.z - player->actor.world.pos.z, + this->actor.world.pos.x - player->actor.world.pos.x); break; default: @@ -567,7 +567,7 @@ void func_80A03018(EnElf* this, GlobalContext* globalCtx) { } Math_SmoothStepToS(&this->unk_2BC, targetYaw, 10, this->unk_2AC, 0x20); - this->actor.posRot.rot.y = this->unk_2BC; + this->actor.world.rot.y = this->unk_2BC; Actor_MoveForward(&this->actor); } @@ -577,8 +577,8 @@ void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { f32 xzVelocity; f32 clampedXZ; - xVelTarget = ((arg1->x + this->unk_28C.x) - this->actor.posRot.pos.x) * arg4; - zVelTarget = ((arg1->z + this->unk_28C.z) - this->actor.posRot.pos.z) * arg4; + xVelTarget = ((arg1->x + this->unk_28C.x) - this->actor.world.pos.x) * arg4; + zVelTarget = ((arg1->z + this->unk_28C.z) - this->actor.world.pos.z) * arg4; arg4 += 0.3f; arg3 += 30.0f; @@ -627,10 +627,10 @@ void func_80A0329C(EnElf* this, GlobalContext* globalCtx) { } if (!Player_InCsMode(globalCtx)) { - heightDiff = this->actor.posRot.pos.y - refActor->actor.posRot.pos.y; + heightDiff = this->actor.world.pos.y - refActor->actor.world.pos.y; if ((heightDiff > 0.0f) && (heightDiff < 60.0f)) { - if (!func_80A01F90(&this->actor.posRot.pos, &refActor->actor.posRot.pos, 10.0f)) { + if (!func_80A01F90(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) { Health_ChangeBy(globalCtx, 128); if (this->fairyFlags & FAIRY_FLAG_BIG) { Magic_Fill(globalCtx); @@ -676,7 +676,7 @@ void func_80A0353C(EnElf* this, GlobalContext* globalCtx) { parent = this->actor.parent; if ((parent != NULL) && (parent->update != NULL)) { - parentPos = this->actor.parent->posRot.pos; + parentPos = this->actor.parent->world.pos; parentPos.y += ((1500.0f * this->actor.scale.y) + 40.0f); func_80A02C98(this, &parentPos, 0.2f); } else { @@ -714,7 +714,7 @@ void func_80A03610(EnElf* this, GlobalContext* globalCtx) { this->unk_28C.z = Math_SinS(this->unk_2AC) * -this->unk_2B8; this->unk_2AC += this->unk_2B0; - func_80A02C98(this, &player->actor.posRot.pos, 0.2f); + func_80A02C98(this, &player->actor.world.pos, 0.2f); if (this->unk_2B4 < 0.0f) { if ((this->unk_28C.y < 20.0f) && (this->unk_28C.y > 0.0f)) { @@ -818,16 +818,16 @@ void EnElf_UpdateLights(EnElf* this, GlobalContext* globalCtx) { if (this->fairyFlags & 0x20) { player = PLAYER; - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.posRot.pos.x, - (s16)(player->actor.posRot.pos.y) + 60.0f, player->actor.posRot.pos.z, 255, 255, 255, + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.world.pos.x, + (s16)(player->actor.world.pos.y) + 60.0f, player->actor.world.pos.z, 255, 255, 255, 200); } else { - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 255, -1); + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 255, -1); } - Lights_PointGlowSetInfo(&this->lightInfoGlow, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 255, glowLightRadius); + Lights_PointGlowSetInfo(&this->lightInfoGlow, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 255, glowLightRadius); this->unk_2BC = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); @@ -855,7 +855,7 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { EnElf_SpawnSparkles(this, globalCtx, 16); } - prevPos = this->actor.posRot.pos; + prevPos = this->actor.world.pos; if (this->unk_2A8 == 0xA) { func_80A02EC0(this, &nextPos); @@ -873,11 +873,11 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { // play dash sound in intervals as Navi is waking up Link in the intro if (this->unk_2A8 == 6) { if (this->fairyFlags & 0x40) { - if (prevPos.y < this->actor.posRot.pos.y) { + if (prevPos.y < this->actor.world.pos.y) { this->fairyFlags &= ~0x40; } } else { - if (this->actor.posRot.pos.y < prevPos.y) { + if (this->actor.world.pos.y < prevPos.y) { this->fairyFlags |= 0x40; Audio_PlayActorSound2(&this->actor, NA_SE_EV_FAIRY_DASH); } @@ -885,12 +885,12 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { } } } else { - distFromLinksHead = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); + distFromLinksHead = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos); switch (this->unk_2A8) { case 7: func_80A02C98(this, &player->bodyPartsPos[8], 1.0f - this->unk_2AE * 0.033333335f); - xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); + xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos); if (distFromLinksHead < 7.0f) { this->unk_2C0 = 0; @@ -906,7 +906,7 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { break; case 8: func_80A02C98(this, &player->bodyPartsPos[8], 0.2f); - this->actor.posRot.pos = player->bodyPartsPos[8]; + this->actor.world.pos = player->bodyPartsPos[8]; func_80A029A8(this, 1); break; case 11: @@ -1016,7 +1016,7 @@ void func_80A04414(EnElf* this, GlobalContext* globalCtx) { } else { if (this->unk_2C6 == 0) { if ((arrowPointedActor == NULL) || - (Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &globalCtx->actorCtx.targetCtx.naviRefPos) < 50.0f)) { + (Math_Vec3f_DistXYZ(&this->actor.world.pos, &globalCtx->actorCtx.targetCtx.naviRefPos) < 50.0f)) { this->unk_2C6 = 1; } } else if (this->unk_29C != 0.0f) { @@ -1039,10 +1039,11 @@ void func_80A04414(EnElf* this, GlobalContext* globalCtx) { } } else { if ((arrowPointedActor != NULL) && (player->unk_664 != NULL)) { - if (arrowPointedActor->type == ACTORTYPE_NPC) { + if (arrowPointedActor->category == ACTORCAT_NPC) { targetSound = NA_SE_VO_NAVY_HELLO; } else { - targetSound = (arrowPointedActor->type == ACTORTYPE_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; + targetSound = + (arrowPointedActor->category == ACTORCAT_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; } if (this->unk_2C7 == 0) { @@ -1088,7 +1089,7 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { if ((player->stateFlags1 & 0x400) || ((YREG(15) & 0x10) && func_800BC56C(globalCtx, 2))) { temp = 12; this->unk_2C0 = 100; - } else if ((arrowPointedActor == NULL) || (temp = 1, (arrowPointedActor->type == ACTORTYPE_NPC))) { + } else if ((arrowPointedActor == NULL) || (temp = 1, (arrowPointedActor->category == ACTORCAT_NPC))) { if (arrowPointedActor != NULL) { this->unk_2C0 = 100; player->stateFlags2 |= 0x100000; @@ -1170,8 +1171,8 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { func_80A01C38(this, temp); if (temp == 11) { - this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); - this->unk_2AC = Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->bodyPartsPos[8]); + this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[8], &this->actor.world.pos); + this->unk_2AC = Math_Vec3f_Yaw(&this->actor.world.pos, &player->bodyPartsPos[8]); } } } @@ -1187,9 +1188,9 @@ void EnElf_SpawnSparkles(EnElf* this, GlobalContext* globalCtx, s32 sparkleLife) Color_RGBA8 primColor; Color_RGBA8 envColor; - sparklePos.x = Rand_CenteredFloat(6.0f) + this->actor.posRot.pos.x; - sparklePos.y = (Rand_ZeroOne() * 6.0f) + this->actor.posRot.pos.y; - sparklePos.z = Rand_CenteredFloat(6.0f) + this->actor.posRot.pos.z; + sparklePos.x = Rand_CenteredFloat(6.0f) + this->actor.world.pos.x; + sparklePos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y; + sparklePos.z = Rand_CenteredFloat(6.0f) + this->actor.world.pos.z; primColor.r = this->innerColor.r; primColor.g = this->innerColor.g; @@ -1207,14 +1208,14 @@ void func_80A04D90(EnElf* this, GlobalContext* globalCtx) { s32 pad; s32 bgId; - this->actor.groundY = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &this->actor.floorPoly, &bgId, - &this->actor, &this->actor.posRot.pos); - this->actor.shape.unk_14 = 0x32; + this->actor.floorHeight = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &this->actor.floorPoly, &bgId, + &this->actor, &this->actor.world.pos); + this->actor.shape.shadowAlpha = 0x32; } // move to talk to player void func_80A04DE4(EnElf* this, GlobalContext* globalCtx) { - Vec3f posRot2Copy; + Vec3f headCopy; Player* player = PLAYER; Vec3f naviRefPos; @@ -1227,14 +1228,14 @@ void func_80A04DE4(EnElf* this, GlobalContext* globalCtx) { naviRefPos.z = player->bodyPartsPos[7].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f); } - this->actor.posRot2.pos = naviRefPos; + this->actor.focus.pos = naviRefPos; this->fairyFlags &= ~0x10; } func_80A03AB0(this, globalCtx); - posRot2Copy = this->actor.posRot2.pos; + headCopy = this->actor.focus.pos; - func_80A03148(this, &posRot2Copy, 0, 20.0f, 0.2f); + func_80A03148(this, &headCopy, 0, 20.0f, 0.2f); if (this->actor.speedXZ >= 5.0f) { EnElf_SpawnSparkles(this, globalCtx, 16); @@ -1389,7 +1390,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (func_8002F194(thisx, globalCtx)) { func_800F4524(&D_801333D4, NA_SE_VO_SK_LAUGH, 0x20); - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; if (thisx->textId == ElfMessage_GetCUpText(globalCtx)) { this->fairyFlags |= 0x80; diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index eb6c977b17..fea14a75bc 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -18,7 +18,7 @@ static f32 sLeeverDists[] = { 200.0f, 170.0f, 120.0f, 120.0f, 170.0f }; const ActorInit En_Encount1_InitVars = { ACTOR_EN_ENCOUNT1, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnEncount1), @@ -50,7 +50,7 @@ void EnEncount1_Init(Actor* thisx, GlobalContext* globalCtx) { this->maxCurSpawns = (this->actor.params >> 6) & 0x1F; this->maxTotalSpawns = this->actor.params & 0x3F; this->curNumSpawn = this->totalNumSpawn = 0; - spawnRange = 120.0f + (40.0f * this->actor.posRot.rot.z); + spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; osSyncPrintf("\n\n"); @@ -105,14 +105,14 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, GlobalContext* globalCtx) { EnReeba* leever; this->outOfRangeTimer = 0; - spawnPos = this->actor.posRot.pos; + spawnPos = this->actor.world.pos; if ((this->timer == 0) && (globalCtx->csCtx.state == 0) && (this->curNumSpawn <= this->maxCurSpawns) && (this->curNumSpawn < 5)) { - floorType = func_80041D4C(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorPolySource); + floorType = func_80041D4C(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId); if ((floorType != 4) && (floorType != 7) && (floorType != 12)) { this->numLeeverSpawns = 0; - } else if (!(this->reduceLeevers && (this->actor.xzDistToLink > 1300.0f))) { + } else if (!(this->reduceLeevers && (this->actor.xzDistToPlayer > 1300.0f))) { spawnLimit = 5; if (this->reduceLeevers) { spawnLimit = 3; @@ -129,9 +129,9 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, GlobalContext* globalCtx) { spawnParams = LEEVER_BIG; } - spawnPos.x = player->actor.posRot.pos.x + Math_SinS(spawnAngle) * spawnDist; - spawnPos.y = player->actor.groundY + 120.0f; - spawnPos.z = player->actor.posRot.pos.z + Math_CosS(spawnAngle) * spawnDist; + spawnPos.x = player->actor.world.pos.x + Math_SinS(spawnAngle) * spawnDist; + spawnPos.y = player->actor.floorHeight + 120.0f; + spawnPos.z = player->actor.world.pos.z + Math_CosS(spawnAngle) * spawnDist; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { @@ -185,15 +185,15 @@ void EnEncount1_SpawnTektites(EnEncount1* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 10; - if ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || - (this->actor.xzDistToLink > this->spawnRange)) { + if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || + (this->actor.xzDistToPlayer > this->spawnRange)) { this->outOfRangeTimer++; } else { this->outOfRangeTimer = 0; if ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { - spawnPos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(50.0f); - spawnPos.y = this->actor.posRot.pos.y + 120.0f; - spawnPos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(50.0f); + spawnPos.x = this->actor.world.pos.x + Rand_CenteredFloat(50.0f); + spawnPos.y = this->actor.world.pos.y + 120.0f; + spawnPos.z = this->actor.world.pos.z + Rand_CenteredFloat(50.0f); floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { return; @@ -228,8 +228,8 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt f32 floorY; if (globalCtx->sceneNum != SCENE_SPOT00) { - if ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || - (this->actor.xzDistToLink > this->spawnRange)) { + if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || + (this->actor.xzDistToPlayer > this->spawnRange)) { this->outOfRangeTimer++; return; } @@ -239,11 +239,11 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt } this->outOfRangeTimer = 0; - spawnPos = this->actor.posRot.pos; + spawnPos = this->actor.world.pos; if ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { while ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { if (globalCtx->sceneNum == SCENE_SPOT00) { - if ((player->unk_89E == 0) || (player->actor.floorPolySource != 0x32) || + if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) || !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) { this->fieldSpawnTimer = 60; @@ -264,16 +264,16 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt spawnDist = Rand_CenteredFloat(40.0f) + 100.0f; } spawnPos.x = - player->actor.posRot.pos.x + (Math_SinS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); - spawnPos.y = player->actor.groundY + 120.0f; + player->actor.world.pos.x + (Math_SinS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); + spawnPos.y = player->actor.floorHeight + 120.0f; spawnPos.z = - player->actor.posRot.pos.z + (Math_CosS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); + player->actor.world.pos.z + (Math_CosS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { break; } if ((player->actor.yDistToWater != BGCHECK_Y_MIN) && - (floorY < (player->actor.posRot.pos.y - player->actor.yDistToWater))) { + (floorY < (player->actor.world.pos.y - player->actor.yDistToWater))) { break; } spawnPos.y = floorY; @@ -327,13 +327,13 @@ void EnEncount1_Update(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0) != 0) { if (this->outOfRangeTimer != 0) { if ((this->outOfRangeTimer & 1) == 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); } } else { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index d1801e33d5..c2417432b6 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -13,7 +13,7 @@ extern UNK_TYPE D_06000DE0; /* const ActorInit En_Encount2_InitVars = { ACTOR_EN_ENCOUNT2, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EFC_STAR_FIELD, sizeof(EnEncount2), diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 1503588971..5ecb507643 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -35,7 +35,7 @@ void EnExItem_TargetPrizeFinish(EnExItem* this, GlobalContext* globalCtx); const ActorInit En_Ex_Item_InitVars = { ACTOR_EN_EX_ITEM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnExItem), @@ -60,7 +60,7 @@ void EnExItem_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); // What will come out? osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->unusedParam); - this->initPos = this->actor.posRot.pos; + this->initPos = this->actor.world.pos; this->getItemObjId = -1; switch (this->type) { case EXITEM_BOMB_BAG_BOWLING: @@ -145,7 +145,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = -18.0f; + this->actor.shape.yOffset = -18.0f; } break; case EXITEM_HEART_PIECE_COUNTER: @@ -160,7 +160,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = -10.0f; + this->actor.shape.yOffset = -10.0f; } break; case EXITEM_BOMBCHUS_COUNTER: @@ -189,7 +189,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = 10.0f; + this->actor.shape.yOffset = 10.0f; } break; case EXITEM_PURPLE_RUPEE_BOWLING: @@ -205,7 +205,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = 40.0f; + this->actor.shape.yOffset = 40.0f; } break; case EXITEM_GREEN_RUPEE_CHEST: @@ -289,13 +289,13 @@ void EnExItem_BowlPrize(EnExItem* this, GlobalContext* globalCtx) { tmpf6 = (tmpf2 / tmpf4) * 5.0f; tmpf7 = (tmpf3 / tmpf4) * 5.0f; - tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.posRot.pos.x; - tmpf2 = globalCtx->view.eye.y + tmpf6 - this->actor.posRot.pos.y; - tmpf3 = globalCtx->view.eye.z + tmpf7 - this->actor.posRot.pos.z; + tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.world.pos.x; + tmpf2 = globalCtx->view.eye.y + tmpf6 - this->actor.world.pos.y; + tmpf3 = globalCtx->view.eye.z + tmpf7 - this->actor.world.pos.z; - this->actor.posRot.pos.x += (tmpf1 / tmpf4) * 5.0f; - this->actor.posRot.pos.y += (tmpf2 / tmpf4) * 5.0f; - this->actor.posRot.pos.z += (tmpf3 / tmpf4) * 5.0f; + this->actor.world.pos.x += (tmpf1 / tmpf4) * 5.0f; + this->actor.world.pos.y += (tmpf2 / tmpf4) * 5.0f; + this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f; } } else { // parent @@ -312,7 +312,7 @@ void EnExItem_BowlPrize(EnExItem* this, GlobalContext* globalCtx) { } void EnExItem_SetupBowlCounter(EnExItem* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = 0x4268; + this->actor.world.rot.y = this->actor.shape.rot.y = 0x4268; this->actionFunc = EnExItem_BowlCounter; } @@ -372,13 +372,13 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) { tmpf6 = (tmpf2 / tmpf4) * 5.0f; tmpf7 = (tmpf3 / tmpf4) * 5.0f; - tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.posRot.pos.x; - tmpf2 = globalCtx->view.eye.y - 10.0f + tmpf6 - this->actor.posRot.pos.y; - tmpf3 = globalCtx->view.eye.z + 10.0f + tmpf7 - this->actor.posRot.pos.z; + tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.world.pos.x; + tmpf2 = globalCtx->view.eye.y - 10.0f + tmpf6 - this->actor.world.pos.y; + tmpf3 = globalCtx->view.eye.z + 10.0f + tmpf7 - this->actor.world.pos.z; - this->actor.posRot.pos.x += (tmpf1 / tmpf4) * 5.0f; - this->actor.posRot.pos.y += (tmpf2 / tmpf4) * 5.0f; - this->actor.posRot.pos.z += (tmpf3 / tmpf4) * 5.0f; + this->actor.world.pos.x += (tmpf1 / tmpf4) * 5.0f; + this->actor.world.pos.y += (tmpf2 / tmpf4) * 5.0f; + this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f; } } else { s32 itemId; diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 6a20193229..e875052898 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -31,7 +31,7 @@ static s16 sRupeeValues[] = { const ActorInit En_Ex_Ruppy_InitVars = { ACTOR_EN_EX_RUPPY, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnExRuppy), @@ -51,7 +51,7 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->type = this->actor.params; // "Index" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); switch (this->type) { case 0: @@ -101,10 +101,10 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { } } - this->actor.shape.unk_10 = 7.0f; - this->actor.shape.unk_08 = 700.0f; - this->unk_15A = this->actor.posRot.rot.z; - this->actor.posRot.rot.z = 0; + this->actor.shape.shadowScale = 7.0f; + this->actor.shape.yOffset = 700.0f; + this->unk_15A = this->actor.world.rot.z; + this->actor.world.rot.z = 0; this->timer = 30; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_DropIntoWater; @@ -122,8 +122,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; // "Wow Coin" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_WaitToBlowUp; break; @@ -144,8 +144,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; // "Normal rupee" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_WaitAsCollectible; break; @@ -154,8 +154,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; this->actor.flags &= ~1; Actor_SetScale(&this->actor, 0.01f); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = -700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = -700.0f; this->actionFunc = EnExRuppy_GalleryTarget; break; } @@ -198,9 +198,9 @@ void EnExRuppy_SpawnSparkles(EnExRuppy* this, GlobalContext* globalCtx, s16 numS scale = 5000; life = 20; } - pos.x = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() - 0.5f) * 10.0f + (this->actor.posRot.pos.y + this->unk_160 * 600.0f); - pos.z = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.posRot.pos.z; + pos.x = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() - 0.5f) * 10.0f + (this->actor.world.pos.y + this->unk_160 * 600.0f); + pos.z = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, scale, life); } } @@ -230,15 +230,15 @@ void EnExRuppy_EnterWater(EnExRuppy* this, GlobalContext* globalCtx) { if ((divingGame != NULL) && (divingGame->actor.update != NULL) && (divingGame->unk_2A2 == 2)) { this->invisible = false; - this->actor.posRot.pos.x = ((Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f; - this->actor.posRot.pos.y = ((Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f; + this->actor.world.pos.x = ((Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f; + this->actor.world.pos.y = ((Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f; temp_f2 = this->unk_15A * -50.0f; if (!(gSaveContext.eventChkInf[3] & 0x100)) { temp_f2 += -500.0f; - this->actor.posRot.pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + temp_f2; + this->actor.world.pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + temp_f2; } else { temp_f2 += -300.0f; - this->actor.posRot.pos.z = ((Rand_ZeroOne() - 0.5f) * 60.0f) + temp_f2; + this->actor.world.pos.z = ((Rand_ZeroOne() - 0.5f) * 60.0f) + temp_f2; } this->actionFunc = EnExRuppy_Sink; this->actor.gravity = -1.0f; @@ -251,7 +251,7 @@ void EnExRuppy_Sink(EnExRuppy* this, GlobalContext* globalCtx) { s32 pad; if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += this->actor.yDistToWater; this->actor.velocity.y = -1.0f; this->actor.gravity = -0.2f; @@ -274,7 +274,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 10; - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); } if (this->actor.parent != NULL) { divingGame = (EnDivingGame*)this->actor.parent; @@ -283,7 +283,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, GlobalContext* globalCtx) { this->timer = 20; this->actionFunc = EnExRuppy_Kill; if (1) {} - } else if (this->actor.xyzDistToLinkSq < SQ(localConst)) { + } else if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { Rupees_ChangeBy(this->rupeeValue); func_80078884(NA_SE_SY_GET_RUPY); divingGame->unk_2A4++; @@ -320,7 +320,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { if (this->type == 2) { distToBlowUp = 30.0f; } - if (this->actor.xyzDistToLinkSq < SQ(distToBlowUp)) { + if (this->actor.xyzDistToPlayerSq < SQ(distToBlowUp)) { parent = (EnExRuppyParentActor*)this->actor.parent; if (parent != NULL) { if (parent->actor.update != NULL) { @@ -338,9 +338,9 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { explosionScale = 20; explosionScaleStep = 6; } - EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.posRot.pos, &velocity, &accel, explosionScale, + EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.world.pos, &velocity, &accel, explosionScale, explosionScaleStep); - func_8002F71C(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f); + func_8002F71C(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f); Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_Kill(&this->actor); } @@ -349,18 +349,18 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { void EnExRuppy_WaitAsCollectible(EnExRuppy* this, GlobalContext* globalCtx) { f32 localConst = 30.0f; - if (this->actor.xyzDistToLinkSq < SQ(localConst)) { + if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { func_80078884(NA_SE_SY_GET_RUPY); - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, (sEnExRuppyCollectibleTypes[this->colorIdx] | 0x8000)); + Item_DropCollectible(globalCtx, &this->actor.world.pos, (sEnExRuppyCollectibleTypes[this->colorIdx] | 0x8000)); Actor_Kill(&this->actor); } } void EnExRuppy_GalleryTarget(EnExRuppy* this, GlobalContext* globalCtx) { if (this->galleryFlag) { - Math_ApproachF(&this->actor.shape.unk_08, 700.0f, 0.5f, 200.0f); + Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 0.5f, 200.0f); } else { - Math_ApproachF(&this->actor.shape.unk_08, -700.0f, 0.5f, 200.0f); + Math_ApproachF(&this->actor.shape.yOffset, -700.0f, 0.5f, 200.0f); } } @@ -373,7 +373,7 @@ void EnExRuppy_Update(Actor* thisx, GlobalContext* globalCtx) { this->timer--; } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); } UNK_PTR D_80A0B3B8[] = { 0x04042140, 0x04042160, 0x04042180, 0x040421C0, 0x040421A0 }; diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 76f6cc0e05..3ef5f0529a 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -32,7 +32,7 @@ extern FlexSkeletonHeader D_06005810; const ActorInit En_Fd_InitVars = { ACTOR_EN_FD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FW, sizeof(EnFd), @@ -42,64 +42,155 @@ const ActorInit En_Fd_InitVars = { (ActorFunc)EnFd_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[12] = { +static ColliderJntSphElementInit sJntSphElementsInit[12] = { { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040088, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040088, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 21, { { 1600, 0, 0 }, 5 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, { { 1600, 0, 0 }, 5 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 14, { { 800, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 15, { { 1600, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 16, { { 2000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 17, { { 800, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 18, { { 1600, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 19, { { 2000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 4, { { 2200, 0, 0 }, 4 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 4, { { 5000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 8, { { 2200, 0, 0 }, 4 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 8, { { 5000, 0, 0 }, 4 }, 300 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 12, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit2 sColChkInit = { 24, 2, 25, 25, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 24, 2, 25, 25, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x060010B4, 1.0f, 0.0f, -1.0f, 0x03, 0.0f }, { 0x06005C64, 1.0f, 0.0f, -1.0f, 0x03, -10.0f }, @@ -136,9 +227,9 @@ void EnFd_SpawnChildFire(EnFd* this, GlobalContext* globalCtx, s16 fireCnt, s16 s32 i; for (i = 0; i < fireCnt; i++) { - s16 angle = (s16)((((i * 360.0f) / fireCnt) * (0x10000 / 360.0f))) + this->actor.yawTowardsLink; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FD_FIRE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, angle, 0, (color << 0xF) | i); + s16 angle = (s16)((((i * 360.0f) / fireCnt) * (0x10000 / 360.0f))) + this->actor.yawTowardsPlayer; + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FD_FIRE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, angle, 0, (color << 0xF) | i); } } @@ -148,9 +239,9 @@ void EnFd_SpawnDot(EnFd* this, GlobalContext* globalCtx) { Vec3f accel = { 0.0f, 0.0f, 0.0f }; if (this->actionFunc == EnFd_Run || this->actionFunc == EnFd_SpinAndSpawnFire) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.groundY + 4.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.floorHeight + 4.0f; + pos.z = this->actor.world.pos.z; accel.x = (Rand_ZeroOne() - 0.5f) * 2.0f; accel.y = ((Rand_ZeroOne() - 0.5f) * 0.2f) + 0.3f; accel.z = (Rand_ZeroOne() - 0.5f) * 2.0f; @@ -165,8 +256,8 @@ s32 EnFd_CheckHammer(EnFd* this, GlobalContext* globalCtx) { if (this->actionFunc == EnFd_Reappear || this->actionFunc == EnFd_SpinAndGrow || this->actionFunc == EnFd_JumpToGround || this->actionFunc == EnFd_WaitForCore) { return false; - } else if (globalCtx->actorCtx.unk_02 != 0 && this->actor.xzDistToLink < 300.0f && - this->actor.yDistToLink < 60.0f) { + } else if (globalCtx->actorCtx.unk_02 != 0 && this->actor.xzDistToPlayer < 300.0f && + this->actor.yDistToPlayer < 60.0f) { return true; } else { return false; @@ -175,15 +266,15 @@ s32 EnFd_CheckHammer(EnFd* this, GlobalContext* globalCtx) { s32 EnFd_ColliderCheck(EnFd* this, GlobalContext* globalCtx) { Player* player = PLAYER; - ColliderBody* body; + ColliderInfo* info; - if (this->collider.base.acFlags & 2 || EnFd_CheckHammer(this, globalCtx)) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT || EnFd_CheckHammer(this, globalCtx)) { + this->collider.base.acFlags &= ~AC_HIT; if (this->invincibilityTimer != 0) { return false; } - body = &this->collider.list[0].body; - if (body->acHitItem != NULL && (body->acHitItem->toucher.flags & 0x80)) { + info = &this->collider.elements[0].info; + if (info->acHitInfo != NULL && (info->acHitInfo->toucher.dmgFlags & 0x80)) { return false; } @@ -195,18 +286,18 @@ s32 EnFd_ColliderCheck(EnFd* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_DAMAGE); func_80032C7C(globalCtx, &this->actor); return true; - } else if (DECR(this->attackTimer) == 0 && this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + } else if (DECR(this->attackTimer) == 0 && this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if (this->invincibilityTimer != 0) { return false; } - if (this->collider.base.atFlags & 4) { + if (this->collider.base.atFlags & AT_BOUNCED) { return false; } this->attackTimer = 30; Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(globalCtx, &this->actor, this->actor.speedXZ + 2.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, this->actor.speedXZ + 2.0f, this->actor.yawTowardsPlayer, 6.0f); } return false; } @@ -224,18 +315,18 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, GlobalContext* globalCtx) { s32 pad; // Check to see if `actor` is within 400 units of `this` - if (Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &actor->posRot.pos) > 400.0f) { + if (Math_Vec3f_DistXYZ(&this->actor.world.pos, &actor->world.pos) > 400.0f) { return false; } // Check to see if the angle between this facing angle and `actor` is withing ~40 degrees - angle = (f32)Math_Vec3f_Yaw(&this->actor.posRot.pos, &actor->posRot.pos) - this->actor.shape.rot.y; - if (ABS(angle) >= 0x1C71) { + angle = (f32)Math_Vec3f_Yaw(&this->actor.world.pos, &actor->world.pos) - this->actor.shape.rot.y; + if (ABS(angle) > 0x1C70) { return false; } // check to see if the line between `this` and `actor` does not intersect a collision poly - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &actor->posRot.pos, &colPoint, &colPoly, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &actor->world.pos, &colPoint, &colPoly, 1, 0, 0, 1, &bgId)) { return false; } @@ -244,7 +335,7 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, GlobalContext* globalCtx) { } Actor* EnFd_FindBomb(EnFd* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (actor != NULL) { if (actor->params != 0 || actor->parent != NULL) { @@ -295,11 +386,11 @@ Vec3f* EnFd_GetPosAdjAroundCircle(Vec3f* dst, EnFd* this, f32 radius, s16 dir) { s16 angle; Vec3f newPos; - angle = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos) + (dir * 0x1554); // ~30 degrees - newPos.x = (Math_SinS(angle) * radius) + this->actor.initPosRot.pos.x; - newPos.z = (Math_CosS(angle) * radius) + this->actor.initPosRot.pos.z; - newPos.x -= this->actor.posRot.pos.x; - newPos.z -= this->actor.posRot.pos.z; + angle = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos) + (dir * 0x1554); // ~30 degrees + newPos.x = (Math_SinS(angle) * radius) + this->actor.home.pos.x; + newPos.z = (Math_CosS(angle) * radius) + this->actor.home.pos.z; + newPos.x -= this->actor.world.pos.x; + newPos.z -= this->actor.world.pos.z; *dst = newPos; return dst; } @@ -314,11 +405,11 @@ s32 EnFd_ShouldStopRunning(EnFd* this, GlobalContext* globalCtx, f32 radius, s16 // will result in a background collision EnFd_GetPosAdjAroundCircle(&pos, this, radius, *runDir); - pos.x += this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y; - pos.z += this->actor.posRot.pos.z; + pos.x += this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z += this->actor.world.pos.z; - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &pos, &colPoint, &poly, 1, 0, 0, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &pos, &colPoint, &poly, 1, 0, 0, 1, &bgId)) { *runDir = -*runDir; return true; @@ -337,7 +428,7 @@ s32 EnFd_ShouldStopRunning(EnFd* this, GlobalContext* globalCtx, f32 radius, s16 void EnFd_Fade(EnFd* this, GlobalContext* globalCtx) { if (this->invincibilityTimer != 0) { Math_SmoothStepToF(&this->fadeAlpha, 0.0f, 0.3f, 10.0f, 0.0f); - this->actor.shape.unk_14 = this->fadeAlpha; + this->actor.shape.shadowAlpha = this->fadeAlpha; if (!(this->fadeAlpha >= 0.9f)) { this->invincibilityTimer = 0; this->spinTimer = 0; @@ -351,10 +442,10 @@ void EnFd_Init(Actor* thisx, GlobalContext* globalCtx) { EnFd* this = THIS; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06005810, NULL, this->jointTable, this->morphTable, 27); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 32.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 32.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colSphs); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); this->actor.flags &= ~1; this->actor.flags |= 0x1000000; Actor_SetScale(&this->actor, 0.01f); @@ -372,9 +463,9 @@ void EnFd_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnFd_Reappear(EnFd* this, GlobalContext* globalCtx) { - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; this->actor.params = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->coreActive = false; this->actor.scale.y = 0.0f; this->fadeAlpha = 255.0f; @@ -387,7 +478,7 @@ void EnFd_SpinAndGrow(EnFd* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->actor.velocity.y = 6.0f; this->actor.scale.y = 0.01f; - this->actor.posRot.rot.y ^= 0x8000; + this->actor.world.rot.y ^= 0x8000; this->actor.flags |= 1; this->actor.speedXZ = 8.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); @@ -395,7 +486,7 @@ void EnFd_SpinAndGrow(EnFd* this, GlobalContext* globalCtx) { } else { this->actor.scale.y = this->skelAnime.curFrame * (0.01f / this->skelAnime.animLength); this->actor.shape.rot.y += 0x2000; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } } @@ -403,7 +494,7 @@ void EnFd_JumpToGround(EnFd* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 1) && !(this->actor.velocity.y > 0.0f)) { this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_80034EC0(&this->skelAnime, sAnimations, 2); this->actionFunc = EnFd_Land; } @@ -415,9 +506,9 @@ void EnFd_Land(EnFd* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->skelAnime.playSpeed, 1.0f, 0.1f, 1.0f, 0.0f); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->spinTimer = Rand_S16Offset(60, 90); - this->runRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->runRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); EnFd_GetPosAdjAroundCircle(&adjPos, this, this->runRadius, this->runDir); - this->actor.posRot.rot.y = Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI); + this->actor.world.rot.y = Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI); func_80034EC0(&this->skelAnime, sAnimations, 4); this->actionFunc = EnFd_SpinAndSpawnFire; } @@ -437,7 +528,7 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { if (DECR(this->spinTimer) != 0) { this->actor.shape.rot.y += (this->runDir * 0x2000); if (this->spinTimer == 30 && this->invincibilityTimer == 0) { - if (this->actor.xzDistToLink > 160.0f) { + if (this->actor.xzDistToPlayer > 160.0f) { // orange flames EnFd_SpawnChildFire(this, globalCtx, 8, 0); } else { @@ -447,7 +538,7 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { } } else { // slow shape rotation down to meet `this` rotation within ~1.66 degrees - deceleration = this->actor.posRot.rot.y; + deceleration = this->actor.world.rot.y; deceleration -= this->actor.shape.rot.y; rotSpeed = 0.0f; tgtSpeed = fabsf(deceleration); @@ -458,11 +549,11 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { rotSpeed = fabsf(rotSpeed); if ((s32)rotSpeed <= 300) { // ~1.6 degrees - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } - if (this->actor.shape.rot.y == this->actor.posRot.rot.y) { - this->initYawToInitPos = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + if (this->actor.shape.rot.y == this->actor.world.rot.y) { + this->initYawToInitPos = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos); this->curYawToInitPos = this->runDir < 0 ? 0xFFFF : 0; this->circlesToComplete = (globalCtx->state.frames & 7) + 2; this->spinTimer = Rand_S16Offset(30, 120); @@ -485,7 +576,7 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { if (EnFd_ShouldStopRunning(this, globalCtx, this->runRadius, &this->runDir)) { if (this->invincibilityTimer == 0) { - this->actor.posRot.rot.y ^= 0x8000; + this->actor.world.rot.y ^= 0x8000; this->actor.velocity.y = 6.0f; this->actor.speedXZ = 0.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); @@ -494,7 +585,7 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { } } - yawToYawTarget = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos) - this->initYawToInitPos; + yawToYawTarget = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos) - this->initYawToInitPos; if (this->runDir > 0) { if ((u16)this->curYawToInitPos > (u16)(yawToYawTarget)) { this->circlesToComplete--; @@ -512,14 +603,14 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { // the distance to that threat, otherwise default to 200. potentialThreat = EnFd_FindPotentialTheat(this, globalCtx); if ((potentialThreat != NULL) && (this->invincibilityTimer == 0)) { - runRadiusTarget = Math_Vec3f_DistXYZ(&this->actor.initPosRot.pos, &potentialThreat->posRot.pos); + runRadiusTarget = Math_Vec3f_DistXYZ(&this->actor.home.pos, &potentialThreat->world.pos); } else { runRadiusTarget = 200.0f; } Math_SmoothStepToF(&this->runRadius, runRadiusTarget, 0.3f, 100.0f, 0.0f); EnFd_GetPosAdjAroundCircle(&adjPos, this, this->runRadius, this->runDir); Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI), 4, 0xFA0, 1); - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; func_8002F974(&this->actor, NA_SE_EN_FLAME_RUN - SFX_FLAG); if (this->skelAnime.curFrame == 6.0f || this->skelAnime.curFrame == 13.0f || this->skelAnime.curFrame == 28.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_KICK); @@ -574,7 +665,7 @@ void EnFd_Update(Actor* thisx, GlobalContext* globalCtx) { EnFd_ColliderCheck(this, globalCtx); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); EnFd_Fade(this, globalCtx); this->actionFunc(this, globalCtx); EnFd_UpdateDots(this); @@ -623,7 +714,7 @@ void EnFd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } if (limbIndex == 13) { - Matrix_MultVec3f(&initialPos, &this->actor.posRot2.pos); + Matrix_MultVec3f(&initialPos, &this->actor.focus.pos); } if (limbIndex == 3 || limbIndex == 6 || limbIndex == 7 || limbIndex == 10 || limbIndex == 14 || limbIndex == 15 || @@ -643,7 +734,7 @@ void EnFd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } } - func_800628A4(limbIndex, &this->collider); + Collider_UpdateSpheres(limbIndex, &this->collider); } void EnFd_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h index 05203b5dcb..0095bbc6cb 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -32,7 +32,7 @@ typedef struct EnFd { /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ EnFdActionFunc actionFunc; /* 0x0194 */ ColliderJntSph collider; - /* 0x01B4 */ ColliderJntSphItem colSphs[12]; + /* 0x01B4 */ ColliderJntSphElement colSphs[12]; /* 0x04B4 */ u8 coreActive; /* 0x04B6 */ s16 initYawToInitPos; /* 0x04B8 */ s16 curYawToInitPos; diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 8561ae6823..402342c886 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -17,7 +17,7 @@ extern Gfx D_0404D4E0[]; const ActorInit En_Fd_Fire_InitVars = { ACTOR_EN_FD_FIRE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnFdFire), @@ -28,23 +28,67 @@ const ActorInit En_Fd_Fire_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x0D840008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0x0D840008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 1, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { { - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; void EnFdFire_UpdatePos(EnFdFire* this, Vec3f* targetPos) { f32 dist; - f32 xDiff = targetPos->x - this->actor.posRot.pos.x; - f32 yDiff = targetPos->y - this->actor.posRot.pos.y; - f32 zDiff = targetPos->z - this->actor.posRot.pos.z; + f32 xDiff = targetPos->x - this->actor.world.pos.x; + f32 yDiff = targetPos->y - this->actor.world.pos.y; + f32 zDiff = targetPos->z - this->actor.world.pos.z; dist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)); if (fabsf(dist) > fabsf(this->actor.speedXZ)) { @@ -66,13 +110,13 @@ s32 EnFdFire_CheckCollider(EnFdFire* this, GlobalContext* globalCtx) { return false; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return true; } - if (this->collider.base.maskB & 1) { - this->collider.base.maskB &= ~1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; return true; } return false; @@ -83,15 +127,15 @@ void EnFdFire_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); this->actor.flags &= ~1; this->actor.gravity = -0.6f; this->actor.speedXZ = 5.0f; this->actor.velocity.y = 12.0f; - this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot.pos); + this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.world.pos); this->scale = 3.0f; this->tile2Y = (s16)Rand_ZeroFloat(5.0f) - 25; this->actionFunc = func_80A0E70C; @@ -105,10 +149,10 @@ void EnFdFire_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80A0E70C(EnFdFire* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; - Vec3f targetPos = this->actor.parent->posRot.pos; + Vec3f targetPos = this->actor.parent->world.pos; - targetPos.x += this->spawnRadius * Math_SinS(this->actor.posRot.rot.y); - targetPos.z += this->spawnRadius * Math_CosS(this->actor.posRot.rot.y); + targetPos.x += this->spawnRadius * Math_SinS(this->actor.world.rot.y); + targetPos.z += this->spawnRadius * Math_CosS(this->actor.world.rot.y); EnFdFire_UpdatePos(this, &targetPos); if (this->actor.bgCheckFlags & 1 && (!(this->actor.velocity.y > 0.0f))) { this->actor.velocity = velocity; @@ -139,14 +183,14 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, GlobalContext* globalCtx) { s16 idx; idx = ((globalCtx->state.frames / 10) + (this->actor.params & 0x7FFF)) % ARRAY_COUNT(angles); - pos = player->actor.posRot.pos; + pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); if (DECR(this->deathTimer) == 0) { this->actionFunc = EnFdFire_Disappear; } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_Vec3f_Yaw(&this->actor.posRot.pos, &pos), 8, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &pos), 8, 0xFA0, 1); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.0f, 0.0f); if (this->actor.speedXZ < 0.1f) { this->actor.speedXZ = 5.0f; @@ -159,8 +203,8 @@ void EnFdFire_Disappear(EnFdFire* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.6f, 9.0f, 0.0f); func_8002D868(&this->actor); Math_SmoothStepToF(&this->scale, 0.0f, 0.3f, 0.1f, 0.0f); - this->actor.shape.unk_10 = 20.0f; - this->actor.shape.unk_10 *= (this->scale / 3.0f); + this->actor.shape.shadowScale = 20.0f; + this->actor.shape.shadowScale *= (this->scale / 3.0f); if (!(this->scale > 0.01f)) { Actor_Kill(&this->actor); } @@ -178,10 +222,10 @@ void EnFdFire_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002D7EC(&this->actor); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 12.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f, 10.0f, 0.0f, 5); if (this->actionFunc != EnFdFire_Disappear) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -207,7 +251,7 @@ void EnFdFire_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_fd_fire.c", 572); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); sp8E = Math_Vec3f_Yaw(&scale, &this->actor.velocity) - Camera_GetCamDirYaw(ACTIVE_CAM); sp84 = fabsf(Math_CosS(sp8E)); sp88 = Math_SinS(sp8E); diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index e809813ab1..0eb4519f73 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -37,7 +37,7 @@ extern Gfx D_06012160[]; const ActorInit En_Fhg_Fire_InitVars = { 0, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FHG, sizeof(EnFhgFire), @@ -72,7 +72,7 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(thisx, NA_SE_EN_FANTOM_THUNDER); } else if (thisx->params >= 0x64) { EnFhgFire_SetupAction(this, func_80A0FA90); - thisx->shape.rot = thisx->posRot.rot; + thisx->shape.rot = thisx->world.rot; } if (thisx->params == 0x23) { @@ -90,7 +90,7 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_150.y = 0x32; this->unk_1FE = 0x0A; - tempf2 = thisx->posRot.rot.x; + tempf2 = thisx->world.rot.x; this->unk_18C = tempf2 / 100.0f; tempf1 = tempf2 * 0.13f; @@ -105,8 +105,8 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("yari hikari ct 1\n"); EnFhgFire_SetupAction(this, func_80A10008); osSyncPrintf("yari hikari ct 2\n"); - this->unk_150.x = thisx->posRot.rot.x; - this->fireMode = thisx->posRot.rot.y; + this->unk_150.x = thisx->world.rot.x; + this->fireMode = thisx->world.rot.y; return; } @@ -128,23 +128,23 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params == 0x32) { - thisx->speedXZ = (thisx->posRot.rot.x == 0) ? 8.0f : 3.0f; + thisx->speedXZ = (thisx->world.rot.x == 0) ? 8.0f : 3.0f; EnFhgFire_SetupAction(this, func_80A10220); this->unk_150.x = 0x46; this->unk_150.y = 0x02; - tempf1 = player->actor.posRot.pos.x - thisx->posRot.pos.x; - tempf2 = player->actor.posRot.pos.y + 30.0f - thisx->posRot.pos.y; - tempf3 = player->actor.posRot.pos.z - thisx->posRot.pos.z; - thisx->posRot.rot.y = Math_FAtan2F(tempf1, tempf3) * 10430.378f; // 65536/(2*M_PI) + tempf1 = player->actor.world.pos.x - thisx->world.pos.x; + tempf2 = player->actor.world.pos.y + 30.0f - thisx->world.pos.y; + tempf3 = player->actor.world.pos.z - thisx->world.pos.z; + thisx->world.rot.y = Math_FAtan2F(tempf1, tempf3) * 10430.378f; // 65536/(2*M_PI) tempf0 = sqrtf(SQ(tempf1) + SQ(tempf3)); - thisx->posRot.rot.x = Math_FAtan2F(tempf2, tempf0) * 10430.378f; // 65536/(2*M_PI) + thisx->world.rot.x = Math_FAtan2F(tempf2, tempf0) * 10430.378f; // 65536/(2*M_PI) this->collider.dim.radius = 40; this->collider.dim.height = 50; this->collider.dim.yShift = -25; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, 255, + Lights_PointNoGlowSetInfo(&this->lightInfo, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, 255, 255, 0xFF); } } @@ -187,11 +187,11 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { this->fireMode = 0x0B; this->actor.shape.rot.z += 0x8000; this->unk_150.x = 0x25; - this->actor.posRot.pos.y -= 200.0f; + this->actor.world.pos.y -= 200.0f; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 500, 0, - 0, 0x24); + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 500, 0, 0, + 0x24); ballAccel = D_80A117BC; @@ -200,7 +200,7 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { ballVelocity.y = Rand_ZeroFloat(5.0f) + 3.0f; ballVelocity.z = Rand_CenteredFloat(30.f); ballAccel.y = -0.2f; - EffectSsFhgFlash_SpawnLightBall(globalCtx, &this->actor.posRot.pos, &ballVelocity, &ballAccel, + EffectSsFhgFlash_SpawnLightBall(globalCtx, &this->actor.world.pos, &ballVelocity, &ballAccel, (s16)(Rand_ZeroOne() * 100.0f) + 240, FHGFLASH_LIGHTBALL_GREEN); } @@ -218,13 +218,13 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { for (i = 0; i < 8; i++) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, (i * 8192) + randY, 0x4000, i + 0x64); } for (i = 0; i < 8; i++) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, (i * 8192) + randY, 0, 0x23); } } @@ -251,8 +251,8 @@ void func_80A0FA90(EnFhgFire* this, GlobalContext* globalCtx) { if (this->unk_150.x == 0) { this->fireMode = 0x02; this->unk_150.x = 0x0A; - this->actor.posRot.pos.z += Math_SinS(this->actor.shape.rot.y) * -200.0f * this->scale; - this->actor.posRot.pos.x += Math_CosS(this->actor.shape.rot.y) * 200.0f * this->scale; + this->actor.world.pos.z += Math_SinS(this->actor.shape.rot.y) * -200.0f * this->scale; + this->actor.world.pos.x += Math_CosS(this->actor.shape.rot.y) * 200.0f * this->scale; this->actor.shape.rot.y += 0x8000; } break; @@ -276,24 +276,24 @@ void func_80A0FC48(EnFhgFire* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f pos; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags = this->collider.base.atFlags & ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER); } if (Rand_ZeroOne() < 0.5f) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y -= 20.0f; EffectSsFhgFlash_SpawnShock(globalCtx, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR); } Actor_MoveForward(&this->actor); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (player->invincibilityTimer == 0) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 1); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 1); if (this->actor.bgCheckFlags & 8) { Actor_Kill(&this->actor); } @@ -337,9 +337,9 @@ void func_80A0FD8C(EnFhgFire* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, this->scale); if (3.0f < this->unk_18C) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (player->invincibilityTimer == 0) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, (Collider*)&this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -361,7 +361,7 @@ void func_80A0FD8C(EnFhgFire* this, GlobalContext* globalCtx) { // Related to scene draw config 30, only used in BossGanon_Update and // loaded in z_kankyo D_8015FCF0 = this->unk_1FC; - D_8015FCF8 = this->actor.posRot.pos; + D_8015FCF8 = this->actor.world.pos; D_8015FD06 = this->unk_200; D_8015FD08 = 10.0f; D_8015FD0C = 0; @@ -379,7 +379,7 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 5.25f); } - this->actor.posRot.pos = horse->unk_200; + this->actor.world.pos = horse->unk_200; this->actor.shape.rot.z += (s16)(Rand_ZeroOne() * 20000.0f) + 0x4000; osSyncPrintf("yari hikari 2\n"); @@ -391,9 +391,9 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) { osSyncPrintf("FLASH !!\n"); for (i = 0; i < 2; i++) { - ballPos.x = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.x; - ballPos.y = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.y; - ballPos.z = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.z; + ballPos.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x; + ballPos.y = Rand_CenteredFloat(20.0f) + this->actor.world.pos.y; + ballPos.z = Rand_CenteredFloat(20.0f) + this->actor.world.pos.z; ballAccel.y = -0.08f; EffectSsFhgFlash_SpawnLightBall(globalCtx, &ballPos, &ballVelocity, &ballAccel, diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index d206566342..687e43f049 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_06000DE0; /* const ActorInit En_Fire_Rock_InitVars = { ACTOR_EN_FIRE_ROCK, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EFC_STAR_FIELD, sizeof(EnFireRock), @@ -23,6 +23,46 @@ const ActorInit En_Fire_Rock_InitVars = { (ActorFunc)EnFireRock_Update, (ActorFunc)EnFireRock_Draw, }; + +static ColliderCylinderInit D_80A12CCC = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 30, -10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A12CA0 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x09, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 30, -10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s") diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 00e535c605..c88c732c7c 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -31,7 +31,7 @@ typedef enum { const ActorInit En_Firefly_InitVars = { ACTOR_EN_FIREFLY, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FIREFLY, sizeof(EnFirefly), @@ -41,28 +41,74 @@ const ActorInit En_Firefly_InitVars = { (ActorFunc)EnFirefly_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { { - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, - { 1, { { 0, 1000, 0 }, 15 }, 100 }, -} }; +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 1000, 0 }, 15 }, 100 }, + }, +}; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit[0], + sJntSphElementsInit, }; static CollisionCheckInfoInit sColChkInfoInit = { 1, 10, 10, 30 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0xF2, 0x34, 0x02, 0x02, 0x02, - 0x02, 0x20, 0x34, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x2), + /* Ice magic */ DMG_ENTRY(4, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 4000, ICHAIN_STOP), + ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), + ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 4000, ICHAIN_STOP), }; extern SkeletonHeader D_060018B8; @@ -71,7 +117,7 @@ extern Gfx D_06001678[]; void EnFirefly_Extinguish(EnFirefly* this) { this->actor.params += 2; - this->collider.list->body.toucher.effect = 0; // None + this->collider.elements[0].info.toucher.effect = 0; // None this->auraType = KEESE_AURA_NONE; this->onFire = false; this->actor.naviEnemyId = 0x12; // Keese @@ -83,7 +129,7 @@ void EnFirefly_Ignite(EnFirefly* this) { } else { this->actor.params -= 2; } - this->collider.list->body.toucher.effect = 1; // Fire + this->collider.elements[0].info.toucher.effect = 1; // Fire this->auraType = KEESE_AURA_FIRE; this->onFire = true; this->actor.naviEnemyId = 0x11; // Fire Keese @@ -93,11 +139,11 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { EnFirefly* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if ((this->actor.params & 0x8000) != 0) { this->actor.flags |= 0x80; @@ -118,7 +164,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.rot.x = 0x1554; this->auraType = KEESE_AURA_FIRE; this->actor.naviEnemyId = 0x11; // Fire Keese - this->maxAltitude = this->actor.initPosRot.pos.y; + this->maxAltitude = this->actor.home.pos.y; } else { if (this->actor.params == KEESE_NORMAL_PERCH) { this->actionFunc = EnFirefly_Perch; @@ -127,14 +173,14 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { } if (this->actor.params == KEESE_ICE_FLY) { - this->collider.list->body.toucher.effect = 2; // Ice - this->actor.naviEnemyId = 0x56; // Ice Keese + this->collider.elements[0].info.toucher.effect = 2; // Ice + this->actor.naviEnemyId = 0x56; // Ice Keese } else { - this->collider.list->body.toucher.effect = 0; // Nothing - this->actor.naviEnemyId = 0x12; // Keese + this->collider.elements[0].info.toucher.effect = 0; // Nothing + this->actor.naviEnemyId = 0x12; // Keese } - this->maxAltitude = this->actor.initPosRot.pos.y + 100.0f; + this->maxAltitude = this->actor.home.pos.y + 100.0f; if (this->actor.params == KEESE_ICE_FLY) { this->auraType = KEESE_AURA_ICE; @@ -143,7 +189,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { } } - this->collider.list->dim.worldSphere.radius = sJntSphInit.list[0].dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; } void EnFirefly_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -155,8 +201,8 @@ void EnFirefly_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnFirefly_SetupWait(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); - this->targetPitch = ((this->maxAltitude < this->actor.posRot.pos.y) ? 0xC00 : -0xC00) + 0x1554; + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); + this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->skelAnime.playSpeed = 1.0f; this->actionFunc = EnFirefly_FlyIdle; } @@ -178,7 +224,7 @@ void EnFirefly_SetupDie(EnFirefly* this) { } void EnFirefly_SetupRebound(EnFirefly* this) { - this->actor.posRot.rot.x = 0x7000; + this->actor.world.rot.x = 0x7000; this->timer = 18; this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 2.5f; @@ -188,7 +234,7 @@ void EnFirefly_SetupRebound(EnFirefly* this) { void EnFirefly_SetupDiveAttack(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->skelAnime.playSpeed = 1.0f; - this->targetPitch = ((this->actor.yDistToLink > 0.0f) ? -0xC00 : 0xC00) + 0x1554; + this->targetPitch = ((this->actor.yDistToPlayer > 0.0f) ? -0xC00 : 0xC00) + 0x1554; this->actionFunc = EnFirefly_DiveAttack; } @@ -220,9 +266,9 @@ void EnFirefly_SetupFrozenFall(EnFirefly* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_DEAD); for (i = 0; i <= 7; i++) { - iceParticlePos.x = (i & 1 ? 7.0f : -7.0f) + this->actor.posRot.pos.x; - iceParticlePos.y = (i & 2 ? 7.0f : -7.0f) + this->actor.posRot.pos.y; - iceParticlePos.z = (i & 4 ? 7.0f : -7.0f) + this->actor.posRot.pos.z; + iceParticlePos.x = (i & 1 ? 7.0f : -7.0f) + this->actor.world.pos.x; + iceParticlePos.y = (i & 2 ? 7.0f : -7.0f) + this->actor.world.pos.y; + iceParticlePos.z = (i & 4 ? 7.0f : -7.0f) + this->actor.world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceParticlePos, 150, 150, 150, 250, 235, 245, 255, (Rand_ZeroOne() * 0.15f) + 0.85f); } @@ -239,7 +285,7 @@ void EnFirefly_SetupPerch(EnFirefly* this) { void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) { this->skelAnime.playSpeed = 3.0f; this->actor.shape.rot.x = 0x1554; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 3.0f; this->timer = 50; this->actionFunc = EnFirefly_DisturbDiveAttack; @@ -253,8 +299,8 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, GlobalContext* globalCtx) { return 0; } - if (func_8002DBB0(&player->actor, &this->actor.initPosRot.pos) > 300.0f) { - distFromHome = func_8002DB6C(&this->actor, &this->actor.initPosRot.pos); + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 300.0f) { + distFromHome = Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos); if (distFromHome < 5.0f) { EnFirefly_SetupPerch(this); @@ -267,9 +313,10 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, GlobalContext* globalCtx) { this->actor.speedXZ *= distFromHome; } - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &this->actor.initPosRot.pos) + 0x1554, - 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.x, + Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100); return 1; } @@ -283,13 +330,13 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, GlobalContext* globalCtx) { f32 currentMinDist; Vec3f flamePos; - findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; closestTorch = NULL; currentMinDist = 35000.0f; while (findTorch != NULL) { if ((findTorch->actor.id == ACTOR_OBJ_SYOKUDAI) && (findTorch->litTimer != 0)) { - torchDist = func_8002DB48(&this->actor, &findTorch->actor); + torchDist = Actor_WorldDistXYZToActor(&this->actor, &findTorch->actor); if (torchDist < currentMinDist) { currentMinDist = torchDist; closestTorch = findTorch; @@ -299,15 +346,17 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, GlobalContext* globalCtx) { } if (closestTorch != NULL) { - flamePos.x = closestTorch->actor.posRot.pos.x; - flamePos.y = closestTorch->actor.posRot.pos.y + 52.0f + 15.0f; - flamePos.z = closestTorch->actor.posRot.pos.z; - if (func_8002DB6C(&this->actor, &flamePos) < 15.0f) { + flamePos.x = closestTorch->actor.world.pos.x; + flamePos.y = closestTorch->actor.world.pos.y + 52.0f + 15.0f; + flamePos.z = closestTorch->actor.world.pos.z; + if (Actor_WorldDistXYZToPoint(&this->actor, &flamePos) < 15.0f) { EnFirefly_Ignite(this); return 1; } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, &closestTorch->actor), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &flamePos) + 0x1554, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor), + 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554, + 0x100); return 1; } } @@ -329,16 +378,16 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) { if (skelanimeUpdated) { rand = Rand_ZeroOne(); if (rand < 0.5f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), - 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, + Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); } else if (rand < 0.8f) { this->actor.shape.rot.y += Rand_CenteredFloat(1536.0f); } // Climb if too close to ground - if (this->actor.posRot.pos.y < (this->actor.groundY + 20.0f)) { + if (this->actor.world.pos.y < (this->actor.floorHeight + 20.0f)) { this->targetPitch = 0x954; // Descend if above maxAltitude - } else if (this->maxAltitude < this->actor.posRot.pos.y) { + } else if (this->maxAltitude < this->actor.world.pos.y) { this->targetPitch = 0x2154; // Otherwise ascend or descend at random, biased towards ascending } else if (0.35f < Rand_ZeroOne()) { @@ -349,16 +398,17 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) { } else { if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } } Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } - if ((this->timer == 0) && (this->actor.xzDistToLink < 200.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 200.0f) && + (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { EnFirefly_SetupDiveAttack(this); } } @@ -368,11 +418,11 @@ void EnFirefly_Fall(EnFirefly* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 6.0f)) { this->skelAnime.playSpeed = 0.0f; } - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); if (this->actor.flags & 0x8000) { - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; } else { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200); this->actor.shape.rot.y = this->actor.shape.rot.y - 0x300; @@ -393,7 +443,7 @@ void EnFirefly_Die(EnFirefly* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.scale.x, 0.0f, 0.00034f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->timer == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -409,27 +459,28 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) { } Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f); if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } else if (func_8002E084(&this->actor, 0x2800)) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = 4.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300); - preyPos.x = player->actor.posRot.pos.x; - preyPos.y = player->actor.posRot.pos.y + 20.0f; - preyPos.z = player->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &preyPos) + 0x1554, 2, 0x400, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); + preyPos.x = player->actor.world.pos.x; + preyPos.y = player->actor.world.pos.y + 20.0f; + preyPos.z = player->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, 2, + 0x400, 0x100); } else { this->skelAnime.playSpeed = 1.5f; - if (this->actor.xzDistToLink > 80.0f) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300); + if (this->actor.xzDistToPlayer > 80.0f) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); } if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; } - if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } else { this->targetPitch = 0x954; @@ -461,8 +512,8 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if (((fabsf(this->actor.posRot.pos.y - this->maxAltitude) < 10.0f) && - (Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) < 20.0f)) || + if (((fabsf(this->actor.world.pos.y - this->maxAltitude) < 10.0f) && + (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) < 20.0f)) || (this->timer == 0)) { EnFirefly_SetupWait(this); return; @@ -470,15 +521,16 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } else { this->targetPitch = 0x954; } if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); } Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } @@ -501,11 +553,11 @@ void EnFirefly_Stunned(EnFirefly* this, GlobalContext* globalCtx) { } void EnFirefly_FrozenFall(EnFirefly* this, GlobalContext* globalCtx) { - if ((this->actor.bgCheckFlags & 1) || (this->actor.groundY == BGCHECK_Y_MIN)) { - this->actor.dmgEffectTimer = 0; + if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + this->actor.colorFilterTimer = 0; EnFirefly_SetupDie(this); } else { - this->actor.dmgEffectTimer = 255; + this->actor.colorFilterTimer = 255; } } @@ -522,7 +574,7 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) { this->timer = 1; } - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnFirefly_SetupDisturbDiveAttack(this); } } @@ -539,11 +591,12 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) { if (this->timer < 40) { Math_ScaledStepToS(&this->actor.shape.rot.x, -0xAAC, 0x100); } else { - preyPos.x = player->actor.posRot.pos.x; - preyPos.y = player->actor.posRot.pos.y + 20.0f; - preyPos.z = player->actor.posRot.pos.z; - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &preyPos) + 0x1554, 0x100); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x300); + preyPos.x = player->actor.world.pos.x; + preyPos.y = player->actor.world.pos.y + 20.0f; + preyPos.z = player->actor.world.pos.z; + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, + 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300); } if (this->timer == 0) { @@ -555,7 +608,7 @@ void EnFirefly_Combust(EnFirefly* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i <= 2; i++) { - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0, 0, i); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0, 0, i); } this->auraType = KEESE_AURA_NONE; @@ -564,9 +617,9 @@ void EnFirefly_Combust(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) { u8 damageEffect; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.list->body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.elements[0].info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { @@ -612,8 +665,8 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { EnFirefly* this = THIS; GlobalContext* globalCtx = globalCtx2; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_ATTACK); if (this->onFire) { EnFirefly_Extinguish(this); @@ -632,16 +685,16 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_MoveForward(&this->actor); } else { if (this->actionFunc != EnFirefly_Rebound) { - this->actor.posRot.rot.x = 0x1554 - this->actor.shape.rot.x; + this->actor.world.rot.x = 0x1554 - this->actor.shape.rot.x; } func_8002D97C(&this->actor); } } - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 15.0f, 7); - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = this->actor.posRot.pos.y + 10.0f; - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 15.0f, 7); + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + 10.0f; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; if ((this->actionFunc == EnFirefly_DiveAttack) || (this->actionFunc == EnFirefly_DisturbDiveAttack)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -649,18 +702,18 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->actor.colChkInfo.health != 0) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_FLY); } } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - this->actor.posRot2.pos.x = - (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y)) + this->actor.posRot.pos.x; - this->actor.posRot2.pos.y = (10.0f * Math_CosS(this->actor.shape.rot.x)) + this->actor.posRot.pos.y; - this->actor.posRot2.pos.z = - (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y)) + this->actor.posRot.pos.z; + this->actor.focus.pos.x = + (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y)) + this->actor.world.pos.x; + this->actor.focus.pos.y = (10.0f * Math_CosS(this->actor.shape.rot.x)) + this->actor.world.pos.y; + this->actor.focus.pos.z = + (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y)) + this->actor.world.pos.z; } s32 EnFirefly_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, @@ -706,14 +759,14 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList effLife = 3; } else { if (limbIndex == 15) { - effPos.x = (Math_SinS(9100 * this->timer) * this->timer) + this->actor.posRot.pos.x; - effPos.z = (Math_CosS(9100 * this->timer) * this->timer) + this->actor.posRot.pos.z; + effPos.x = (Math_SinS(9100 * this->timer) * this->timer) + this->actor.world.pos.x; + effPos.z = (Math_CosS(9100 * this->timer) * this->timer) + this->actor.world.pos.z; } else { - effPos.x = this->actor.posRot.pos.x - (Math_SinS(9100 * this->timer) * this->timer); - effPos.z = this->actor.posRot.pos.z - (Math_CosS(9100 * this->timer) * this->timer); + effPos.x = this->actor.world.pos.x - (Math_SinS(9100 * this->timer) * this->timer); + effPos.z = this->actor.world.pos.z - (Math_CosS(9100 * this->timer) * this->timer); } - effPos.y = this->actor.posRot.pos.y + ((15 - this->timer) * 1.5f); + effPos.y = this->actor.world.pos.y + ((15 - this->timer) * 1.5f); effScaleStep = -5; effLife = 10; } diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index 0c48ba0990..7f90581c03 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -21,7 +21,7 @@ typedef struct EnFirefly { /* 0x0266 */ Vec3s morphTable[28]; /* 0x0310 */ f32 maxAltitude; /* 0x0314 */ ColliderJntSph collider; - /* 0x0344 */ ColliderJntSphItem colliderItems[1]; + /* 0x0344 */ ColliderJntSphElement colliderItems[1]; } EnFirefly; // size = 0x0374 typedef enum { diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 84c0395fb6..8cfe3990c7 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_0401909C; /* const ActorInit En_Fish_InitVars = { ACTOR_EN_FISH, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnFish), @@ -25,6 +25,33 @@ const ActorInit En_Fish_InitVars = { (ActorFunc)EnFish_Update, (ActorFunc)EnFish_Draw, }; + +static ColliderJntSphElementInit D_80A1701C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 5 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80A17040 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80A1701C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A15280.s") diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index a9b6eabad9..f4f5c72958 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -47,7 +47,7 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx); const ActorInit En_Floormas_InitVars = { ACTOR_EN_FLOORMAS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WALLMASTER, sizeof(EnFloormas), @@ -58,22 +58,66 @@ const ActorInit En_Floormas_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x05, 0x01 }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 25, 40, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x001E, 0x0028, 0x96 }; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 30, 40, 150 }; -static DamageTable sDamageTable = { { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x4), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(4, 0x4), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 0xFC18, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0x157C, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; extern Gfx D_06008688[]; @@ -98,11 +142,11 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; invisble = this->actor.params & SPAWN_INVISIBLE; @@ -120,16 +164,16 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { } else { // spawn first small floormaster this->actor.parent = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); + Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.parent == NULL) { Actor_Kill(&this->actor); return; } // spawn 2nd small floormaster this->actor.child = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); + Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.child == NULL) { Actor_Kill(this->actor.parent); Actor_Kill(&this->actor); @@ -152,15 +196,15 @@ void EnFloormas_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnFloormas_MakeInvulnerable(EnFloormas* this) { - this->collider.base.type = COLTYPE_UNK12; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_HARD; + this->collider.base.acFlags |= AC_HARD; this->actionTarget = 0x28; } void EnFloormas_MakeVulnerable(EnFloormas* this) { - this->collider.base.type = COLTYPE_UNK0; + this->collider.base.colType = COLTYPE_HIT0; this->actionTarget = 0; - this->collider.base.acFlags &= ~4; + this->collider.base.acFlags &= ~AC_HARD; } void EnFloormas_SetupBigDecideAction(EnFloormas* this) { @@ -223,7 +267,7 @@ void EnFloormas_SetupHover(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; EnFloormas_MakeInvulnerable(this); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); this->actionFunc = EnFloormas_Hover; } @@ -256,13 +300,13 @@ void EnFloormas_SetupSplit(EnFloormas* this) { this->actor.draw = EnFloormas_Draw; } this->actor.shape.rot.y = this->actor.parent->shape.rot.y + 0x5555; - this->actor.posRot.pos = this->actor.parent->posRot.pos; + this->actor.world.pos = this->actor.parent->world.pos; this->actor.params = 0x10; Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, Animation_GetLastFrame(&D_060019CC), ANIMMODE_ONCE, 0.0f); this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f; this->collider.dim.height = sCylinderInit.dim.height * 0.6f; - this->collider.body.bumperFlags &= ~4; + this->collider.info.bumperFlags &= ~BUMP_HOOKABLE; this->actor.speedXZ = 4.0f; this->actor.velocity.y = 7.0f; // using div creates a signed check. @@ -291,9 +335,9 @@ void EnFloormas_SetupSmShrink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 15.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 15.0f; + pos.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &pos, &velocity, &accel, 150, -10, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); this->actionFunc = EnFloormas_SmShrink; } @@ -320,15 +364,15 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { this->actor.velocity.y = 0.0f; EnFloormas_MakeInvulnerable(this); if (LINK_IS_CHILD) { - yDelta = CLAMP(-this->actor.yDistToLink, 20.0f, 30.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { - yDelta = CLAMP(-this->actor.yDistToLink, 25.0f, 45.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 25.0f, 45.0f); xzDelta = -70.0f; } - this->actor.posRot.pos.y = player->actor.posRot.pos.y + yDelta; - this->actor.posRot.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + yDelta; + this->actor.world.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.z; this->actor.shape.rot.x = -0x4CE0; this->actionFunc = EnFloormas_GrabLink; } @@ -359,10 +403,10 @@ void EnFloormas_SetupSmWait(EnFloormas* this) { void EnFloormas_SetupTakeDamage(EnFloormas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); - if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x14); this->actionFunc = EnFloormas_TakeDamage; @@ -373,7 +417,7 @@ void EnFloormas_SetupTakeDamage(EnFloormas* this) { void EnFloormas_SetupRecover(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &D_06000EA4); this->actor.velocity.y = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnFloormas_Recover; } @@ -397,14 +441,14 @@ void EnFloormas_SetupFreeze(EnFloormas* this) { void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) { if (this->actor.scale.x > 0.004f) { // split - this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer + 0x8000; EnFloormas_SetupSplit((EnFloormas*)this->actor.child); EnFloormas_SetupSplit((EnFloormas*)this->actor.parent); EnFloormas_SetupSplit(this); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT); } else { // Die - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); EnFloormas_SetupSmShrink(this, globalCtx); } } @@ -412,11 +456,11 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { // within 400 units of link and within 90 degrees rotation of him - if (this->actor.xzDistToLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) { - this->actionTarget = this->actor.yawTowardsLink; + if (this->actor.xzDistToPlayer < 400.0f && !func_8002E084(&this->actor, 0x4000)) { + this->actionTarget = this->actor.yawTowardsPlayer; EnFloormas_SetupTurn(this); // within 280 units of link and within 45 degrees rotation of him - } else if (this->actor.xzDistToLink < 280.0f && func_8002E084(&this->actor, 0x2000)) { + } else if (this->actor.xzDistToPlayer < 280.0f && func_8002E084(&this->actor, 0x2000)) { EnFloormas_SetupHover(this, globalCtx); } else { EnFloormas_SetupStand(this); @@ -451,15 +495,15 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } - if ((this->actor.xzDistToLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { + if ((this->actor.xzDistToPlayer < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { EnFloormas_SetupRun(this); } else if (this->actor.bgCheckFlags & 8) { // set target rotation to the colliding wall's rotation - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); - } else if ((this->actor.xzDistToLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { // set target rotation to link. - this->actionTarget = this->actor.yawTowardsLink; + this->actionTarget = this->actor.yawTowardsPlayer; EnFloormas_SetupTurn(this); } else if (this->actionTimer == 0) { EnFloormas_SetupBigStopWalk(this); @@ -480,11 +524,12 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); - if ((this->actor.xzDistToLink < 280.0f) && func_8002E084(&this->actor, 0x2000) && !(this->actor.bgCheckFlags & 8)) { + if ((this->actor.xzDistToPlayer < 280.0f) && func_8002E084(&this->actor, 0x2000) && + !(this->actor.bgCheckFlags & 8)) { EnFloormas_SetupHover(this, globalCtx); - } else if (this->actor.xzDistToLink > 400.0f) { + } else if (this->actor.xzDistToPlayer > 400.0f) { EnFloormas_SetupBigWalk(this); } } @@ -512,9 +557,9 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) { sp30 = Math_SinS(this->actor.shape.rot.y + 0x4268); sp2C = Math_CosS(this->actor.shape.rot.y + 0x4268); this->actor.shape.rot.y += this->actionTarget; - this->actor.posRot.pos.x -= + this->actor.world.pos.x -= (this->actor.scale.x * 2700.0f) * (Math_SinS(this->actor.shape.rot.y + 0x4268) - sp30); - this->actor.posRot.pos.z -= + this->actor.world.pos.z -= (this->actor.scale.x * 2700.0f) * (Math_CosS(this->actor.shape.rot.y + 0x4268) - sp2C); } } @@ -524,8 +569,8 @@ void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) { EnFloormas_SetupCharge(this); } this->actor.shape.rot.x += 0x140; - this->actor.posRot.pos.y += 10.0f; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2730); + this->actor.world.pos.y += 10.0f; + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2730); Math_StepToS(&this->zOffset, 1200, 100); } @@ -534,9 +579,9 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) { Vec3f pos; Vec3f velocity; - pos.x = this->actor.posRot.pos.x; - pos.z = this->actor.posRot.pos.z; - pos.y = this->actor.groundY; + pos.x = this->actor.world.pos.x; + pos.z = this->actor.world.pos.z; + pos.y = this->actor.floorHeight; velocity.y = 2.0f; velocity.x = Math_SinS(this->actor.shape.rot.y + 0x6000) * 7.0f; @@ -549,7 +594,7 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) { func_800286CC(globalCtx, &pos, &velocity, &accel, 450, 100); - func_8002F974(this, NA_SE_EN_FLOORMASTER_SLIDING); + func_8002F974(&this->actor, NA_SE_EN_FLOORMASTER_SLIDING); } void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) { @@ -562,9 +607,9 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 15.0f, SQ(this->actor.speedXZ) * (1.0f / 3.0f)); Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); - distFromGround = this->actor.posRot.pos.y - this->actor.groundY; + distFromGround = this->actor.world.pos.y - this->actor.floorHeight; if (distFromGround < 10.0f) { - this->actor.posRot.pos.y = this->actor.groundY + 10.0f; + this->actor.world.pos.y = this->actor.floorHeight + 10.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; } @@ -603,7 +648,7 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); } - if ((this->actor.speedXZ > 0.0f) && ((this->actor.posRot.pos.y - this->actor.groundY) < 12.0f)) { + if ((this->actor.speedXZ > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) { EnFloormas_Slide(this, globalCtx); } @@ -654,10 +699,10 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) { if (this->smActionTimer == 0) { EnFloormas_SetupSmDecideAction(this); } else if (this->actor.bgCheckFlags & 8) { - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); - } else if (this->actor.xzDistToLink < 120.0f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink + 0x8000, 0x38E); + } else if (this->actor.xzDistToPlayer < 120.0f) { + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x38E); } } @@ -671,7 +716,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { } isAgainstWall = this->actor.bgCheckFlags & 8; if (isAgainstWall) { - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); return; } @@ -686,13 +731,13 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { return; } - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primaryFloormas), 0x38E); - if (func_8002DB8C(&this->actor, primaryFloormas) < 80.0f) { + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primaryFloormas), 0x38E); + if (Actor_WorldDistXZToActor(&this->actor, primaryFloormas) < 80.0f) { EnFloormas_SetupSlaveJumpAtMaster(this); } } else { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); - if (this->actor.xzDistToLink < 80.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); + if (this->actor.xzDistToPlayer < 80.0f) { EnFloormas_SetupJumpAtLink(this); } } @@ -711,7 +756,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame < 20.0f) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; @@ -720,7 +765,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); EnFloormas_SetupLand(this); - } else if ((this->actor.yDistToLink < -10.0f) && (this->collider.base.maskA & 2) && + } else if ((this->actor.yDistToPlayer < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && (&player->actor == this->collider.base.oc)) { globalCtx->grabPlayer(globalCtx, player); EnFloormas_SetupGrabLink(this, player); @@ -747,21 +792,21 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { } if (LINK_IS_CHILD) { - yDelta = CLAMP(-this->actor.yDistToLink, 20.0f, 30.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { - yDelta = CLAMP(-this->actor.yDistToLink, 25.0f, 45.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 25.0f, 45.0f); xzDelta = -30.0f; } - this->actor.posRot.pos.y = player->actor.posRot.pos.y + yDelta; - this->actor.posRot.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + yDelta; + this->actor.world.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.z; // let go if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { - parent = this->actor.parent; - child = this->actor.child; + parent = (EnFloormas*)this->actor.parent; + child = (EnFloormas*)this->actor.child; if (((parent->actionFunc == EnFloormas_GrabLink) || parent->actionFunc == EnFloormas_SmWait) && (child->actionFunc == EnFloormas_GrabLink || child->actionFunc == EnFloormas_SmWait)) { @@ -810,20 +855,20 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; } else if (this->skelAnime.curFrame < 20.0f) { - Math_ApproachS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primFloormas), 2, 0xE38); - } else if ((((primFloormas->posRot.pos.y - this->actor.posRot.pos.y) < -10.0f) && - (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) && - (fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) { + Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primFloormas), 2, 0xE38); + } else if ((((primFloormas->world.pos.y - this->actor.world.pos.y) < -10.0f) && + (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 10.0f)) && + (fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 10.0f)) { EnFloormas_SetupSmWait(this); - this->collider.base.maskA |= 1; + this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); EnFloormas_SetupLand(this); } - if (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 5.0f && - fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 5.0f) { + if (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 5.0f && + fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 5.0f) { Math_StepToF(&this->actor.speedXZ, 0, 2.0f); } } @@ -839,8 +884,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { DECR(this->smActionTimer); - parent = this->actor.parent; - child = this->actor.child; + parent = (EnFloormas*)this->actor.parent; + child = (EnFloormas*)this->actor.child; if (this->smActionTimer == 0) { if (parent->actionFunc != EnFloormas_SmWait) { @@ -883,7 +928,7 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10; EnFloormas_MakeVulnerable(this); this->actor.params = 0; - this->collider.body.bumperFlags |= 4; + this->collider.info.bumperFlags |= BUMP_HOOKABLE; this->actor.colChkInfo.health = sColChkInfoInit.health; EnFloormas_SetupStand(this); } else { @@ -945,16 +990,16 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { s32 pad; s32 isSmall; - if ((this->collider.base.acFlags & 2) != 0) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->collider.base.type != COLTYPE_UNK12) { + if (this->collider.base.colType != COLTYPE_HARD) { isSmall = 0; if (this->actor.scale.x < 0.01f) { isSmall = 1; } - if (isSmall && this->collider.body.acHitItem->toucher.flags & 0x80) { + if (isSmall && this->collider.info.acHitInfo->toucher.dmgFlags & 0x80) { this->actor.colChkInfo.damage = 2; this->actor.colChkInfo.damageEffect = 0; } @@ -976,7 +1021,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { } } else { if (this->actor.colChkInfo.damageEffect == 2) { - EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.posRot.pos, + EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.world.pos, this->actor.scale.x * 4000.0f, this->actor.scale.x * 4000.0f); } EnFloormas_SetupTakeDamage(this); @@ -991,8 +1036,8 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (this->actionFunc != EnFloormas_SmWait) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; this->actor.speedXZ *= -0.5f; if (-5.0f < this->actor.speedXZ) { @@ -1009,33 +1054,33 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnFloormas_TakeDamage) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } if (this->actionFunc != EnFloormas_GrabLink) { Actor_MoveForward(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); + Collider_UpdateCylinder(&this->actor, &this->collider); if (this->actionFunc == EnFloormas_Charge) { this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != EnFloormas_GrabLink) { if (this->actionFunc != EnFloormas_Split && this->actionFunc != EnFloormas_TakeDamage && this->actor.freezeTimer == 0) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if ((this->actionFunc != EnFloormas_SmSlaveJumpAtMaster) || (this->skelAnime.curFrame < 20.0f)) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } - Actor_SetHeight(&this->actor, this->actor.scale.x * 2500.0f); + Actor_SetFocus(&this->actor, this->actor.scale.x * 2500.0f); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { if (this->actionTarget != 0) { this->actionTarget--; } @@ -1077,14 +1122,14 @@ void EnFloormas_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_floormas.c", 2318); func_80093D18(globalCtx->state.gfxCtx); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026230(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_OPA_DISP); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026608(globalCtx); } @@ -1097,13 +1142,13 @@ void EnFloormas_DrawHighlighted(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_floormas.c", 2352); func_80093D84(globalCtx->state.gfxCtx); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026690(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_XLU_DISP); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026A6C(globalCtx); } diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index be3c209001..4253a7a947 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600B498; /* const ActorInit En_Fr_InitVars = { ACTOR_EN_FR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FR, sizeof(EnFr), diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 5f549ec529..0636ef44e8 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -30,7 +30,7 @@ void func_80A1DB60(EnFu* this, GlobalContext* globalCtx); const ActorInit En_Fu_InitVars = { ACTOR_EN_FU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FU, sizeof(EnFu), @@ -41,8 +41,22 @@ const ActorInit En_Fu_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -76,12 +90,12 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { EnFu* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelanime, &D_06000B04); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); if (LINK_IS_CHILD) { this->actionFunc = EnFu_WaitChild; @@ -92,7 +106,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { this->skelanime.playSpeed = 2.0f; } this->behaviorFlags = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -109,9 +123,9 @@ s32 func_80A1D94C(EnFu* this, GlobalContext* globalCtx, u16 textID, EnFuActionFu return true; } this->actor.textId = textID; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistToLink < 100.0f)) { + if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistToPlayer < 100.0f)) { func_8002F2CC(&this->actor, globalCtx, 100.0f); } else { this->behaviorFlags |= FU_RESET_LOOK_ANGLE; @@ -216,7 +230,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { static s16 yawDiff; Player* player = PLAYER; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((gSaveContext.eventChkInf[5] & 0x800)) { func_80A1D94C(this, globalCtx, 0x508E, func_80A1DBA0); } else if (player->stateFlags2 & 0x1000000) { @@ -227,7 +241,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { } else if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80A1DBA0; } else if (ABS(yawDiff) < 0x2301) { - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { this->actor.textId = 0x5034; func_8002F2CC(&this->actor, globalCtx, 100.0f); player->stateFlags2 |= 0x800000; @@ -239,10 +253,10 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { EnFu* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((!(this->behaviorFlags & FU_WAIT)) && (SkelAnime_Update(&this->skelanime) != 0)) { Animation_Change(&this->skelanime, this->skelanime.animation, 1.0f, 0.0f, Animation_GetLastFrame(this->skelanime.animation), ANIMMODE_ONCE, 0.0f); @@ -255,7 +269,7 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_2A2.y, 0, 6, 6200, 100); this->behaviorFlags &= ~FU_RESET_LOOK_ANGLE; } else { - func_80038290(globalCtx, &this->actor, &this->lookAngleOffset, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->lookAngleOffset, &this->unk_2A2, this->actor.focus.pos); } } @@ -290,7 +304,7 @@ void EnFu_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnFu* this = THIS; if (limbIndex == 14) { - Matrix_MultVec3f(&sMtxSrc, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMtxSrc, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 8fff3863a0..af8b421362 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -20,7 +20,7 @@ void EnFw_TurnToParentInitPos(EnFw* this, GlobalContext* globalCtx); const ActorInit En_Fw_InitVars = { ACTOR_EN_FW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FW, sizeof(EnFw), @@ -30,20 +30,34 @@ const ActorInit En_Fw_InitVars = { (ActorFunc)EnFw_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x04 }, { 0xFFCFFFFE, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x04 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 2, { { 1200, 0, 0 }, 16 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, 0xFF }; +static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, MASS_IMMOVABLE }; static struct_80034EC0_Entry D_80A1FBA0[] = { { 0x06006CF8, 0.0f, 0.0f, -1.0f, 0x03, 0.0f }, @@ -85,15 +99,15 @@ s32 EnFw_PlayerInRange(EnFw* this, GlobalContext* globalCtx) { u32 bgId; Vec3f collisionPos; - if (this->actor.xzDistToLink > 300.0f) { + if (this->actor.xzDistToPlayer > 300.0f) { return false; } - if (ABS((s16)((f32)this->actor.yawTowardsLink - (f32)this->actor.shape.rot.y)) > 0x1C70) { + if (ABS((s16)((f32)this->actor.yawTowardsPlayer - (f32)this->actor.shape.rot.y)) > 0x1C70) { return false; } - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &player->actor.posRot.pos, &collisionPos, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &player->actor.world.pos, &collisionPos, &poly, 1, 0, 0, 1, &bgId)) { return false; } @@ -106,27 +120,27 @@ Vec3f* EnFw_GetPosAdjAroundCircle(Vec3f* dst, EnFw* this, f32 radius, s16 dir) { Vec3f posAdj; // increase rotation around circle ~30 degrees. - angle = Math_Vec3f_Yaw(&this->actor.parent->initPosRot.pos, &this->actor.posRot.pos) + (dir * 0x1554); - posAdj.x = (Math_SinS(angle) * radius) + this->actor.parent->initPosRot.pos.x; - posAdj.z = (Math_CosS(angle) * radius) + this->actor.parent->initPosRot.pos.z; - posAdj.x -= this->actor.posRot.pos.x; - posAdj.z -= this->actor.posRot.pos.z; + angle = Math_Vec3f_Yaw(&this->actor.parent->home.pos, &this->actor.world.pos) + (dir * 0x1554); + posAdj.x = (Math_SinS(angle) * radius) + this->actor.parent->home.pos.x; + posAdj.z = (Math_CosS(angle) * radius) + this->actor.parent->home.pos.z; + posAdj.x -= this->actor.world.pos.x; + posAdj.z -= this->actor.world.pos.z; *dst = posAdj; return dst; } s32 EnFw_CheckCollider(EnFw* this, GlobalContext* globalCtx) { - ColliderBody* body; + ColliderInfo* info; s32 phi_return; - if (this->collider.base.acFlags & 2) { - body = &this->collider.list[0].body; - if (body->acHitItem->toucher.flags & 0x80) { + if (this->collider.base.acFlags & AC_HIT) { + info = &this->collider.elements[0].info; + if (info->acHitInfo->toucher.dmgFlags & 0x80) { this->lastDmgHook = true; } else { this->lastDmgHook = false; } - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; if (Actor_ApplyDamage(&this->actor) <= 0) { if (this->actor.parent->colChkInfo.health <= 8) { func_80032C7C(globalCtx, &this->actor); @@ -149,16 +163,16 @@ s32 EnFw_SpawnDust(EnFw* this, u8 timer, f32 scale, f32 scaleStep, s32 dustCnt, s16 angle; s32 i; - pos = this->actor.posRot.pos; - pos.y = this->actor.groundY + 2.0f; + pos = this->actor.world.pos; + pos.y = this->actor.floorHeight + 2.0f; angle = ((Rand_ZeroOne() - 0.5f) * 0x10000); i = dustCnt; while (i >= 0) { accel.x = (Rand_ZeroOne() - 0.5f) * xzAccel; accel.y = yAccel; accel.z = (Rand_ZeroOne() - 0.5f) * xzAccel; - pos.x = (Math_SinS(angle) * radius) + this->actor.posRot.pos.x; - pos.z = (Math_CosS(angle) * radius) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(angle) * radius) + this->actor.world.pos.x; + pos.z = (Math_CosS(angle) * radius) + this->actor.world.pos.z; EnFw_AddDust(this, &pos, &velocity, &accel, timer, scale, scaleStep); angle += (s16)(0x10000 / dustCnt); i--; @@ -171,10 +185,10 @@ void EnFw_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007C30, NULL, this->jointTable, this->morphTable, 11); func_80034EC0(&this->skelAnime, D_80A1FBA0, 0); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->sphs); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94); Actor_SetScale(&this->actor, 0.01f); this->runDirection = -this->actor.params; this->actionFunc = EnFw_Bounce; @@ -203,7 +217,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->skelAnime.playSpeed, 1.0f, 0.1f, 1.0f, 0.0f); if (this->skelAnime.animation == &D_06006CF8) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) == 0) { - this->runRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.parent->posRot.pos); + this->runRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.parent->world.pos); func_80034EC0(&this->skelAnime, D_80A1FBA0, 2); } return; @@ -227,7 +241,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 0.0f; Math_SmoothStepToF(&this->actor.scale.x, 0.024999999f, 0.08f, 0.6f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { func_8003426C(&this->actor, 0x4000, 0xC8, 0, this->explosionTimer); this->explosionTimer--; } @@ -240,7 +254,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { } flareDancer = this->actor.parent; flareDancer->params |= 0x4000; - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0xA0); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0xA0); Actor_Kill(&this->actor); return; } @@ -263,7 +277,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { if (this->turnAround) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); - tmpAngle = (s16)(this->actor.posRot.rot.y ^ 0x8000); + tmpAngle = (s16)(this->actor.world.rot.y ^ 0x8000); facingDir = this->actor.shape.rot.y; tmpAngle = Math_SmoothStepToF(&facingDir, tmpAngle, 0.1f, 10000.0f, 0.0f); this->actor.shape.rot.y = facingDir; @@ -277,7 +291,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, (Math_FAtan2F(sp48.x, sp48.z) * (0x8000 / M_PI)), 4, 0xFA0, 1); } - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; if (this->slideTimer == 0 && EnFw_PlayerInRange(this, globalCtx)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_MAN_SURP); @@ -312,13 +326,13 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { void EnFw_TurnToParentInitPos(EnFw* this, GlobalContext* globalCtx) { s16 angleToParentInit; - angleToParentInit = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.parent->initPosRot.pos); + angleToParentInit = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.parent->home.pos); Math_SmoothStepToS(&this->actor.shape.rot.y, angleToParentInit, 4, 0xFA0, 1); if (ABS(angleToParentInit - this->actor.shape.rot.y) < 0x65) { // angle to parent init pos is ~0.5 degrees - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; this->actor.velocity.y = 14.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); func_80034EC0(&this->skelAnime, D_80A1FBA0, 1); this->actionFunc = EnFw_JumpToParentInitPos; @@ -330,8 +344,8 @@ void EnFw_JumpToParentInitPos(EnFw* this, GlobalContext* globalCtx) { this->actor.parent->params |= 0x8000; Actor_Kill(&this->actor); } else { - Math_SmoothStepToF(&this->actor.posRot.pos.x, this->actor.parent->initPosRot.pos.x, 0.6f, 8.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, this->actor.parent->initPosRot.pos.z, 0.6f, 8.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.parent->home.pos.x, 0.6f, 8.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.parent->home.pos.z, 0.6f, 8.0f, 0.0f); } } @@ -341,7 +355,7 @@ void EnFw_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.flags & 0x2000) != 0x2000) { // not attached to hookshot. Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 20.0f, 0.0f, 5); this->actionFunc(this, globalCtx); if (this->damageTimer == 0 && this->explosionTimer == 0 && this->actionFunc == EnFw_Run) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -366,10 +380,10 @@ void EnFw_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec if (limbIndex == 3) { // head - Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos); } - func_800628A4(limbIndex, &this->collider); + Collider_UpdateSpheres(limbIndex, &this->collider); } void EnFw_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h index 5e0627b27d..46319dc186 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -26,7 +26,7 @@ typedef struct EnFw { /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ EnFwActionFunc actionFunc; /* 0x0194 */ ColliderJntSph collider; - /* 0x01B4 */ ColliderJntSphItem sphs[1]; + /* 0x01B4 */ ColliderJntSphElement sphs[1]; /* 0x01F4 */ Vec3f bompPos; /* 0x0200 */ u8 lastDmgHook; /* 0x0202 */ s16 runDirection; diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index c6b887da9d..1b32cb1ec8 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_06003160; /* const ActorInit En_Fz_InitVars = { ACTOR_EN_FZ, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FZ, sizeof(EnFz), @@ -26,6 +26,63 @@ const ActorInit En_Fz_InitVars = { (ActorFunc)EnFz_Update, (ActorFunc)EnFz_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCE0FDB, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 30, 80, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x0001F024, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 35, 80, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x02, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 20, 30, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s") diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 9edd8b2a3b..35e5a4d002 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -1,7 +1,14 @@ +/* + * File: z_en_g_switch.c + * Overlay: ovl_En_G_Switch + * Description: Silver rupees, shooting gallery targets, and horseback archery pots + */ + #include "z_en_g_switch.h" #include "vt.h" #include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" +#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" #define FLAGS 0x00000030 @@ -36,8 +43,22 @@ extern Gfx D_06001960[]; static s16 sCollectedCount = 0; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 13, 40, 0, { 0, 0, 0 } }, }; @@ -48,7 +69,7 @@ static s16 sRupeeTypes[] = { const ActorInit En_G_Switch_InitVars = { ACTOR_EN_G_SWITCH, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGSwitch), @@ -97,7 +118,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.draw = EnGSwitch_DrawRupee; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.yOffset = 700.0f; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); @@ -117,7 +138,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = 0.25f; this->actor.scale.y = 0.45f; this->actor.scale.z = 0.25f; - this->collider.body.bumper.flags = 0x1F820; + this->collider.info.bumper.dmgFlags = 0x1F820; this->objId = OBJECT_TSUBO; this->objIndex = Object_GetIndex(&globalCtx->objectCtx, this->objId); if (this->objIndex < 0) { @@ -133,7 +154,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = EnGSwitch_WaitForObject; break; case ENGSWITCH_TARGET_RUPEE: - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.yOffset = 700.0f; Actor_SetScale(&this->actor, 0.05f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -160,13 +181,13 @@ void EnGSwitch_Break(EnGSwitch* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; s32 i; - randPos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(40.0f); - randPos.y = this->actor.posRot.pos.y + 30.0f + Rand_CenteredFloat(35.0f); - randPos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(40.0f); - hitPos.x = this->collider.body.bumper.unk_06.x; - hitPos.y = this->collider.body.bumper.unk_06.y; - hitPos.z = this->collider.body.bumper.unk_06.z; - EffectSsHitMark_SpawnCustomScale(globalCtx, 0, 700, &hitPos); + randPos.x = this->actor.world.pos.x + Rand_CenteredFloat(40.0f); + randPos.y = this->actor.world.pos.y + 30.0f + Rand_CenteredFloat(35.0f); + randPos.z = this->actor.world.pos.z + Rand_CenteredFloat(40.0f); + hitPos.x = this->collider.info.bumper.hitPos.x; + hitPos.y = this->collider.info.bumper.hitPos.y; + hitPos.z = this->collider.info.bumper.hitPos.z; + EffectSsHitMark_SpawnCustomScale(globalCtx, EFFECT_HITMARK_WHITE, 700, &hitPos); if (this->type == ENGSWITCH_ARCHERY_POT) { velocity.y = 15.0f; EffectSsExtra_Spawn(globalCtx, &hitPos, &velocity, &accel, 5, 2); @@ -219,14 +240,14 @@ void EnGSwitch_SilverRupeeIdle(EnGSwitch* this, GlobalContext* globalCtx) { Player* player = PLAYER; this->actor.shape.rot.y += 0x800; - if (this->actor.xyzDistToLinkSq < 900.0f) { + if (this->actor.xyzDistToPlayerSq < 900.0f) { Rupees_ChangeBy(5); sCollectedCount++; func_80078884(NA_SE_SY_GET_RUPY); - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y += 40.0f; + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y += 40.0f; if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } this->actor.gravity = 0.0f; this->killTimer = 15; @@ -242,11 +263,11 @@ void EnGSwitch_SilverRupeeCollected(EnGSwitch* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y = - player->actor.posRot.pos.y + 40.0f + (this->killTimer * 0.3f) * Math_SinS(this->killTimer * 0x3A98); + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y = + player->actor.world.pos.y + 40.0f + (this->killTimer * 0.3f) * Math_SinS(this->killTimer * 0x3A98); if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } } @@ -258,8 +279,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { switch (this->moveMode) { case GSWITCH_THROW: Actor_MoveForward(&this->actor); - if ((this->actor.velocity.y < 0.0f) && - (this->actor.posRot.pos.y < (this->actor.initPosRot.pos.y - 50.0f))) { + if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f))) { gallery = ((EnSyatekiItm*)this->actor.parent); this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -271,7 +291,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case GSWITCH_LEFT: func_8002D7EC(&this->actor); - if ((this->actor.velocity.x < 0.0f) && (this->actor.posRot.pos.x < this->targetPos.x)) { + if ((this->actor.velocity.x < 0.0f) && (this->actor.world.pos.x < this->targetPos.x)) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { gallery->targetState[this->index] = ENSYATEKIHIT_MISS; @@ -281,7 +301,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case GSWITCH_RIGHT: func_8002D7EC(&this->actor); - if (this->actor.posRot.pos.x > this->targetPos.x) { + if (this->actor.world.pos.x > this->targetPos.x) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { gallery->targetState[this->index] = ENSYATEKIHIT_MISS; @@ -292,10 +312,10 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { default: switch (this->moveState) { case MOVE_TARGET: - if ((fabsf(this->actor.posRot.pos.x - this->targetPos.x) > 5.0f) || - (fabsf(this->actor.posRot.pos.y - this->targetPos.y) > 5.0f)) { - Math_ApproachF(&this->actor.posRot.pos.x, this->targetPos.x, 0.3f, 30.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->targetPos.y, 0.3f, 30.0f); + if ((fabsf(this->actor.world.pos.x - this->targetPos.x) > 5.0f) || + (fabsf(this->actor.world.pos.y - this->targetPos.y) > 5.0f)) { + Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.3f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.3f, 30.0f); } else { this->moveState = MOVE_HOME; this->waitTimer = 60; @@ -303,10 +323,10 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case MOVE_HOME: if (this->waitTimer == 0) { - if ((fabsf(this->actor.posRot.pos.x - this->actor.initPosRot.pos.x) > 5.0f) || - (fabsf(this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) > 5.0f)) { - Math_ApproachF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 0.3f, 30.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.3f, 30.0f); + if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 5.0f) || + (fabsf(this->actor.world.pos.y - this->actor.home.pos.y) > 5.0f)) { + Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 30.0f); } else { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { @@ -319,9 +339,9 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { } break; } - if ((this->collider.base.acFlags & 2) || BREG(8)) { + if ((this->collider.base.acFlags & AC_HIT) || BREG(8)) { gallery = ((EnSyatekiItm*)this->actor.parent); - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; if (gallery->actor.update != NULL) { gallery->hitCount++; gallery->targetState[this->index] = ENSYATEKIHIT_HIT; @@ -341,11 +361,11 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { void EnGSwitch_ArcheryPot(EnGSwitch* this, GlobalContext* globalCtx) { s32 i; s16 angle; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; this->actor.shape.rot.y += 0x3C0; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; for (i = 0, angle = 0; i < 30; i++, angle += 0x4E20) { Vec3f pos; Vec3f vel; @@ -414,20 +434,20 @@ void EnGSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->type != ENGSWITCH_SILVER_TRACKER) && (this->type != ENGSWITCH_SILVER_RUPEE) && (this->type != ENGSWITCH_TARGET_RUPEE)) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 0x1C); } if (this->actor.draw != NULL) { if (this->type == ENGSWITCH_TARGET_RUPEE) { EnGSwitch_UpdateEffects(this, globalCtx); } if ((this->actionFunc != EnGSwitch_Kill) && (this->actionFunc != EnGSwitch_SilverRupeeIdle)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } if (BREG(0) && (this->type == ENGSWITCH_SILVER_TRACKER)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 5089d9f668..50ee39c8c9 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -12,7 +12,7 @@ void EnGanonMant_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ganon_Mant_InitVars = { ACTOR_EN_GANON_MANT, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGanonMant), diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index 48295a5a2e..6344554733 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -18,7 +18,7 @@ void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Ganon_Organ_InitVars = { ACTOR_EN_GANON_ORGAN, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON, sizeof(EnGanonOrgan), diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 17667811ea..e303b7f594 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600C8EC; /* const ActorInit En_Gb_InitVars = { ACTOR_EN_GB, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_PS, sizeof(EnGb), @@ -27,6 +27,44 @@ const ActorInit En_Gb_InitVars = { (ActorFunc)EnGb_Update, (ActorFunc)EnGb_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 40, 75, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 4, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Gb/func_80A2F180.s") diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 608b5bfa45..6ca95beb24 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_0600A498; /* const ActorInit En_Ge1_InitVars = { ACTOR_EN_GE1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GE1, sizeof(EnGe1), @@ -26,6 +26,26 @@ const ActorInit En_Ge1_InitVars = { (ActorFunc)EnGe1_Update, (ActorFunc)EnGe1_Draw, }; + +static ColliderCylinderInit D_80A32770 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000702, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s") diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 678e3e3819..6ef9dcdac5 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_06009ED4; /* const ActorInit En_Ge2_InitVars = { ACTOR_EN_GE2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GLA, sizeof(EnGe2), @@ -24,6 +24,26 @@ const ActorInit En_Ge2_InitVars = { (ActorFunc)EnGe2_Update, (ActorFunc)EnGe2_Draw, }; + +static ColliderCylinderInit D_80A34310 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x000007A2, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 60, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A32BD0.s") diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index fea4223242..b321627579 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600B07C; /* const ActorInit En_Ge3_InitVars = { ACTOR_EN_GE3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GELDB, sizeof(EnGe3), @@ -30,6 +30,26 @@ const ActorInit En_Ge3_InitVars = { (ActorFunc)EnGe3_Update, (ActorFunc)EnGe3_Draw, }; + +static ColliderCylinderInit D_80A35190 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000722, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 50, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34620.s") diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index dbe064d370..7b3969ccac 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -24,15 +24,6 @@ typedef enum { /* 16 */ GELDB_SPIN_DODGE } EnGeldBActionState; -typedef enum { - /* 0x0 */ GELDB_DAMAGE_NORMAL, - /* 0x1 */ GELDB_DAMAGE_STUN, - /* 0x6 */ GELDB_DAMAGE_UNK6 = 0x6, - /* 0xD */ GELDB_DAMAGE_UNKD = 0xD, - /* 0xE */ GELDB_DAMAGE_UNKE, - /* 0xF */ GELDB_DAMAGE_FREEZE -} EnGeldBDamageEffects; - void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx); void EnGeldB_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx); @@ -88,7 +79,7 @@ extern AnimationHeader D_06001578; const ActorInit En_GeldB_InitVars = { ACTOR_EN_GELDB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GELDB, sizeof(EnGeldB), @@ -99,41 +90,129 @@ const ActorInit En_GeldB_InitVars = { }; static ColliderCylinderInit sBodyCylInit = { - { COLTYPE_UNK5, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 50, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sBlockTrisElementsInit[] = { +static ColliderTrisElementInit sBlockTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sBlockTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sBlockTrisElementsInit, }; -static ColliderQuadInit sSwordQuadinit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, +static ColliderQuadInit sSwordQuadInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; +typedef enum { + /* 0x0 */ GELDB_DMG_NORMAL, + /* 0x1 */ GELDB_DMG_STUN, + /* 0x6 */ GELDB_DMG_UNK_6 = 0x6, + /* 0xD */ GELDB_DMG_UNK_D = 0xD, + /* 0xE */ GELDB_DMG_UNK_E, + /* 0xF */ GELDB_DMG_FREEZE +} EnGeldBDamageEffects; + static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF2, 0x02, 0x02, 0x02, - 0x02, 0xE4, 0x60, 0xD3, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x04, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Deku stick */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Slingshot */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Explosive */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Boomerang */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Normal arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Hookshot */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Kokiri sword */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Master sword */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Fire arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Ice arrow */ DMG_ENTRY(2, GELDB_DMG_FREEZE), + /* Light arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 1 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 2 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 3 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Fire magic */ DMG_ENTRY(4, GELDB_DMG_UNK_E), + /* Ice magic */ DMG_ENTRY(0, GELDB_DMG_UNK_6), + /* Light magic */ DMG_ENTRY(3, GELDB_DMG_UNK_D), + /* Shield */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Mirror Ray */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Kokiri spin */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Giant spin */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Master spin */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Giant jump */ DMG_ENTRY(8, GELDB_DMG_NORMAL), + /* Master jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unknown 1 */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unblockable */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Hammer jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unknown 2 */ DMG_ENTRY(0, GELDB_DMG_NORMAL), }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP), }; @@ -151,11 +230,11 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); thisx->colChkInfo.damageTable = &sDamageTable; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 0.0f); - this->actor.colChkInfo.mass = 0xFE; + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFeet, 0.0f); + this->actor.colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 20; - thisx->colChkInfo.unk_10 = 50; - thisx->colChkInfo.unk_12 = 100; + thisx->colChkInfo.cylRadius = 50; + thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = 0x54; this->keyFlag = thisx->params & 0xFF00; thisx->params &= 0xFF; @@ -167,7 +246,7 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitTris(globalCtx, &this->blockCollider); Collider_SetTris(globalCtx, &this->blockCollider, thisx, &sBlockTrisInit, this->blockElements); Collider_InitQuad(globalCtx, &this->swordCollider); - Collider_SetQuad(globalCtx, &this->swordCollider, thisx, &sSwordQuadinit); + Collider_SetQuad(globalCtx, &this->swordCollider, thisx, &sSwordQuadInit); blureInit.p1StartColor[0] = blureInit.p1StartColor[1] = blureInit.p1StartColor[2] = blureInit.p1StartColor[3] = blureInit.p2StartColor[0] = blureInit.p2StartColor[1] = blureInit.p2StartColor[2] = blureInit.p1EndColor[0] = blureInit.p1EndColor[1] = blureInit.p1EndColor[2] = blureInit.p2EndColor[0] = blureInit.p2EndColor[1] = @@ -204,9 +283,9 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { s16 angleToLink; Actor* bomb; - angleToWall = thisx->wallPolyRot - thisx->shape.rot.y; + angleToWall = thisx->wallYaw - thisx->shape.rot.y; angleToWall = ABS(angleToWall); - angleToLink = thisx->yawTowardsLink - thisx->shape.rot.y; + angleToLink = thisx->yawTowardsPlayer - thisx->shape.rot.y; angleToLink = ABS(angleToLink); if (func_800354B4(globalCtx, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) { @@ -219,25 +298,25 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { } } if (func_800354B4(globalCtx, thisx, 100.0f, 0x5DC0, 0x2AA8, thisx->shape.rot.y)) { - thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink; - if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToLink < 90.0f)) { + thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; + if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); return true; } else if (player->swordAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, globalCtx); return true; - } else if ((thisx->xzDistToLink < 90.0f) && (globalCtx->gameplayFrames & 1)) { + } else if ((thisx->xzDistToPlayer < 90.0f) && (globalCtx->gameplayFrames & 1)) { EnGeldB_SetupBlock(this); return true; } else { EnGeldB_SetupRollBack(this); return true; } - } else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORTYPE_EXPLOSIVES, 80.0f)) != NULL) { - thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink; + } else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) { + thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; if (((thisx->bgCheckFlags & 8) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) { - if ((bomb->id == ACTOR_EN_BOM_CHU) && (func_8002DB48(thisx, bomb) < 80.0f) && - ((s16)(thisx->shape.rot.y - (bomb->posRot.rot.y - 0x8000)) < 0x3E80)) { + if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) && + ((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) { EnGeldB_SetupJump(this); return true; } else { @@ -255,7 +334,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { } else { s16 angleToFacingLink = player->actor.shape.rot.y - thisx->shape.rot.y; - if ((thisx->xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, thisx) && + if ((thisx->xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, thisx) && ((globalCtx->gameplayFrames & 7) || (ABS(angleToFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); return true; @@ -270,7 +349,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { void EnGeldB_SetupWait(EnGeldB* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600ADF8, 0.0f); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 120.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 120.0f; this->timer = 10; this->invisible = true; this->actionState = GELDB_WAIT; @@ -281,21 +360,21 @@ void EnGeldB_SetupWait(EnGeldB* this) { } void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) { - if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.initPosRot.rot.z)) || - this->actor.xzDistToLink > 300.0f) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.posRot.pos.y = this->actor.groundY + 120.0f; + if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.home.rot.z)) || + this->actor.xzDistToPlayer > 300.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.world.pos.y = this->actor.floorHeight + 120.0f; } else { this->invisible = false; - this->actor.shape.unk_10 = 90.0f; + this->actor.shape.shadowScale = 90.0f; func_800F5ACC(0x38); } if (this->actor.bgCheckFlags & 2) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); this->skelAnime.playSpeed = 1.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; this->actor.flags |= 1; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->actor.bgCheckFlags &= ~2; this->actor.velocity.y = 0.0f; func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); @@ -312,7 +391,7 @@ void EnGeldB_SetupFlee(EnGeldB* this) { this->timer = 20; this->invisible = false; this->actionState = GELDB_WAIT; - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupAction(this, EnGeldB_Flee); } @@ -326,7 +405,7 @@ void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) { func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); } if (SkelAnime_Update(&this->skelAnime)) { - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 300.0f, 1.0f, 20.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 300.0f, 1.0f, 20.5f, 0.0f); this->timer--; if (this->timer == 0) { Actor_Kill(&this->actor); @@ -339,7 +418,7 @@ void EnGeldB_SetupReady(EnGeldB* this) { this->actionState = GELDB_READY; this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnGeldB_SetupAction(this, EnGeldB_Ready); } @@ -350,14 +429,14 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->lookTimer != 0) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->headRot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headRot.y; if (ABS(angleToLink) > 0x2000) { this->lookTimer--; return; } this->lookTimer = 0; } - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (!EnGeldB_DodgeRanged(globalCtx, this)) { if (this->unkTimer != 0) { this->unkTimer--; @@ -370,12 +449,12 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) { return; } angleToLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if ((this->actor.xzDistToLink < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else if (--this->timer == 0) { if (func_8002E084(&this->actor, 30 * 0x10000 / 360)) { - if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && (Rand_ZeroOne() < 0.3f)) { if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleToLink) < 0x38E0)) { @@ -416,11 +495,11 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { f32 playSpeed; if (!EnGeldB_DodgeRanged(globalCtx, this)) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x2EE, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if (this->actor.xzDistToLink <= 40.0f) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer <= 40.0f) { Math_SmoothStepToF(&this->actor.speedXZ, -8.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 55.0f) { + } else if (this->actor.xzDistToPlayer > 55.0f) { Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 6.65f, 0.0f); @@ -428,8 +507,8 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = this->actor.speedXZ * 0.125f; facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y; facingAngletoLink = ABS(facingAngletoLink); - if ((this->actor.xzDistToLink < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + if ((this->actor.xzDistToPlayer < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupCircle(this); return; @@ -446,9 +525,9 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { } else { EnGeldB_SetupReady(this); } - } else if (this->actor.xzDistToLink < 90.0f) { + } else if (this->actor.xzDistToPlayer < 90.0f) { if (!func_80033AB8(globalCtx, &this->actor) && - (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToLink <= 45.0f && facingAngletoLink < 0x38E0))) { + (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToPlayer <= 45.0f && facingAngletoLink < 0x38E0))) { EnGeldB_SetupSlash(this); } else if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); @@ -457,7 +536,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { } } if (!EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && func_8002E084(&this->actor, 0x71C)) { if (func_80033A84(globalCtx, &this->actor)) { if (Rand_ZeroOne() > 0.5f) { @@ -488,7 +567,7 @@ void EnGeldB_SetupRollForward(EnGeldB* this) { this->timer = 0; this->invisible = true; this->actionState = GELDB_ROLL_FORWARD; - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 10.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); EnGeldB_SetupAction(this, EnGeldB_RollForward); @@ -531,9 +610,9 @@ void EnGeldB_Pivot(EnGeldB* this, GlobalContext* globalCtx) { f32 playSpeed; if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; turnRate = (angleToLink > 0) ? ((angleToLink * 0.25f) + 2000.0f) : ((angleToLink * 0.25f) - 2000.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y += turnRate; + this->actor.world.rot.y = this->actor.shape.rot.y += turnRate; if (angleToLink > 0) { playSpeed = turnRate * 0.5f; playSpeed = CLAMP_MAX(playSpeed, 1.0f); @@ -560,7 +639,7 @@ void EnGeldB_SetupCircle(EnGeldB* this) { Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), ANIMMODE_LOOP_INTERP, 0.0f); this->actor.speedXZ = Rand_CenteredFloat(12.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->timer = Rand_ZeroOne() * 30.0f + 30.0f; this->actionState = GELDB_CIRCLE; @@ -577,9 +656,9 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { s32 prevKeyFrame; Player* player = PLAYER; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3A98; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3A98; angleBehindLink = player->actor.shape.rot.y + 0x8000; if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) >= 0.0f) { this->actor.speedXZ -= 0.25f; @@ -600,7 +679,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -614,16 +693,16 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { } } } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -645,7 +724,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_BREATH); } if ((Math_CosS(angleBehindLink - this->actor.shape.rot.y) < -0.85f) && - !func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 45.0f)) { + !func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { EnGeldB_SetupSlash(this); } else if (--this->timer == 0) { if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { @@ -674,7 +753,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, GlobalContext* globalCtx) { this->actor.speedXZ = -10.0f; } this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->timer = 6; this->approachRate = 0.0f; this->unkFloat = 0.0f; @@ -690,7 +769,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { s32 lastKeyFrame; s32 nextKeyFrame; - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x3A98; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98; if ((this->actor.bgCheckFlags & 8) || !func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { if (this->actor.bgCheckFlags & 8) { @@ -699,7 +778,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -709,16 +788,16 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { return; } } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.yawTowardsLink) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.yawTowardsLink) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.yawTowardsPlayer) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.yawTowardsPlayer) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -739,9 +818,9 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { } this->timer--; if (this->timer == 0) { - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (!EnGeldB_DodgeRanged(globalCtx, this)) { - if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 70.0f)) { + if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupRollBack(this); @@ -758,7 +837,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupSlash(EnGeldB* this) { Animation_PlayOnce(&this->skelAnime, &D_060003CC); - this->swordCollider.base.atFlags &= ~4; + this->swordCollider.base.atFlags &= ~AT_BOUNCED; this->actionState = GELDB_SLASH; this->spinAttackState = 0; this->actor.speedXZ = 0.0f; @@ -769,7 +848,7 @@ void EnGeldB_SetupSlash(EnGeldB* this) { void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - s16 angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; angleFacingLink = ABS(angleFacingLink); angleToLink = ABS(angleToLink); @@ -781,9 +860,9 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { } else if ((s32)this->skelAnime.curFrame == 6) { this->swordState = -1; } - if (this->swordCollider.base.atFlags & 4) { + if (this->swordCollider.base.atFlags & AT_BOUNCED) { this->swordState = -1; - this->swordCollider.base.atFlags &= ~6; + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); EnGeldB_SetupRollBack(this); } else if (SkelAnime_Update(&this->skelAnime)) { if (!func_8002E084(&this->actor, 0x1554)) { @@ -792,16 +871,16 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { if (angleToLink > 0x4000) { this->lookTimer = 20; } - } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) { + } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) { EnGeldB_SetupReady(this); this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; } else { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupSidestep(this, globalCtx); } else if (angleFacingLink <= 0x2710) { if (angleToLink > 0x3E80) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else { EnGeldB_ReactToPlayer(globalCtx, this, 1); @@ -816,7 +895,7 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupSpinAttack(EnGeldB* this) { Animation_Change(&this->skelAnime, &D_06000F5C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000F5C), ANIMMODE_ONCE_INTERP, 0.0f); - this->swordCollider.base.atFlags &= ~6; + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); this->actionState = GELDB_SPIN_ATTACK; this->spinAttackState = 0; this->actor.speedXZ = 0.0f; @@ -829,14 +908,14 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { s16 angleToLink; if (this->spinAttackState < 2) { - if (this->swordCollider.base.atFlags & 4) { - this->swordCollider.base.atFlags &= ~6; + if (this->swordCollider.base.atFlags & AT_BOUNCED) { + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); this->spinAttackState = 1; this->skelAnime.playSpeed = 1.5f; - } else if (this->swordCollider.base.atFlags & 2) { - this->swordCollider.base.atFlags &= ~2; + } else if (this->swordCollider.base.atFlags & AT_HIT) { + this->swordCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->swordCollider.base.at) { - func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); this->spinAttackState = 2; func_8002DF54(globalCtx, &this->actor, 0x18); func_8010B680(globalCtx, 0x6003, &this->actor); @@ -848,7 +927,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { } } if ((s32)this->skelAnime.curFrame < 9) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; } else if ((s32)this->skelAnime.curFrame == 13) { func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); @@ -867,21 +946,21 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { this->lookTimer = 46; } else if (this->spinAttackState != 0) { EnGeldB_SetupRollBack(this); - } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) { + } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) { EnGeldB_SetupReady(this); this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; } else { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupSidestep(this, globalCtx); } else { angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; angleFacingLink = ABS(angleFacingLink); if (angleFacingLink <= 0x2710) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; angleToLink = ABS(angleToLink); if (angleToLink > 0x3E80) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else { EnGeldB_ReactToPlayer(globalCtx, this, 1); @@ -901,14 +980,14 @@ void EnGeldB_SetupRollBack(EnGeldB* this) { this->actionState = GELDB_ROLL_BACK; this->actor.speedXZ = -8.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupAction(this, EnGeldB_RollBack); } void EnGeldB_RollBack(EnGeldB* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink < 170.0f) && - (this->actor.xzDistToLink > 140.0f) && (Rand_ZeroOne() < 0.2f)) { + if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnGeldB_SetupSpinAttack(this); } else if (globalCtx->gameplayFrames & 1) { EnGeldB_SetupSidestep(this, globalCtx); @@ -925,10 +1004,10 @@ void EnGeldB_SetupStunned(EnGeldB* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - if ((this->damageEffect != GELDB_DAMAGE_FREEZE) || (this->actionState == GELDB_SPIN_ATTACK)) { + if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->actionState == GELDB_SPIN_ATTACK)) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06002280, 0.0f); } - if (this->damageEffect == GELDB_DAMAGE_FREEZE) { + if (this->damageEffect == GELDB_DMG_FREEZE) { this->iceTimer = 36; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -946,7 +1025,7 @@ void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) { } this->invisible = false; } - if ((this->actor.dmgEffectTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { if (this->actor.colChkInfo.health == 0) { EnGeldB_SetupDefeated(this); } else { @@ -964,7 +1043,7 @@ void EnGeldB_SetupDamaged(EnGeldB* this) { this->invisible = true; } this->lookTimer = 0; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DAMAGE); this->actionState = GELDB_DAMAGED; EnGeldB_SetupAction(this, EnGeldB_Damaged); @@ -982,14 +1061,14 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) { } this->invisible = false; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x1194, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0); if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0) && SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { - angleToWall = this->actor.wallPolyRot - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToLink < 90.0f)) { + angleToWall = this->actor.wallYaw - this->actor.shape.rot.y; + if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); } else if (!EnGeldB_DodgeRanged(globalCtx, this)) { - if ((this->actor.xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) && (globalCtx->gameplayFrames & 7)) { EnGeldB_SetupSlash(this); } else { @@ -1008,22 +1087,22 @@ void EnGeldB_SetupJump(EnGeldB* this) { this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnGeldB_SetupAction(this, EnGeldB_Jump); } void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); if (this->actor.velocity.y >= 5.0f) { func_800355B8(globalCtx, &this->rightFootPos); func_800355B8(globalCtx, &this->leftFootPos); } if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.x = 0; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; if (!func_80033AB8(globalCtx, &this->actor)) { EnGeldB_SetupSlash(this); } else { @@ -1058,9 +1137,9 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 1.0f; } if (SkelAnime_Update(&this->skelAnime)) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToLink < 40.0f) && - (ABS(this->actor.yDistToLink) < 50.0f)) { + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) && + (ABS(this->actor.yDistToPlayer) < 50.0f)) { if (func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) { if (player->swordAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, globalCtx); @@ -1087,7 +1166,7 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) { EnGeldB_SetupSpinDodge(this, globalCtx); } else if (!EnGeldB_DodgeRanged(globalCtx, this)) { if ((globalCtx->gameplayFrames & 1)) { - if ((this->actor.xzDistToLink < 100.0f) && (Rand_ZeroOne() > 0.7f)) { + if ((this->actor.xzDistToPlayer < 100.0f) && (Rand_ZeroOne() > 0.7f)) { EnGeldB_SetupJump(this); } else { EnGeldB_SetupRollBack(this); @@ -1106,7 +1185,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), ANIMMODE_LOOP_INTERP, 0.0f); player = PLAYER; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); linkAngle = player->actor.shape.rot.y; if (Math_SinS(linkAngle - this->actor.shape.rot.y) > 0.0f) { this->actor.speedXZ = -6.0f; @@ -1117,7 +1196,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) { } this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->approachRate = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->actionState = GELDB_SIDESTEP; EnGeldB_SetupAction(this, EnGeldB_Sidestep); @@ -1131,7 +1210,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { s32 prevKeyFrame; f32 playSpeed; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xBB8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 1); behindLinkAngle = player->actor.shape.rot.y + 0x8000; if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) > 0.0f) { this->actor.speedXZ += 0.125f; @@ -1147,7 +1226,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -1162,20 +1241,20 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { } } if (this->actor.speedXZ >= 0.0f) { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3E80; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3E80; } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y - 0x3E80; + this->actor.world.rot.y = this->actor.shape.rot.y - 0x3E80; } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -1201,11 +1280,11 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { Player* player2 = PLAYER; s16 angleFacingPlayer2 = player2->actor.shape.rot.y - this->actor.shape.rot.y; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToLink <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) && + this->actor.world.rot.y = this->actor.shape.rot.y; + if ((this->actor.xzDistToPlayer <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) && (!(globalCtx->gameplayFrames & 3) || (ABS(angleFacingPlayer2) < 0x38E0))) { EnGeldB_SetupSlash(this); - } else if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + } else if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && !(globalCtx->gameplayFrames & 1)) { if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleFacingPlayer2) < 0x38E0)) { @@ -1231,7 +1310,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupDefeated(EnGeldB* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06001E10, -4.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.bgCheckFlags & 1) { this->invisible = false; this->actor.speedXZ = -6.0f; @@ -1265,7 +1344,7 @@ void func_80A391D8(EnGeldB* this, GlobalContext* globalCtx) { this->headRot.y = Math_SinS(this->lookTimer * 0x1068) * 8920.0f; } else if (this->actionState != GELDB_STUNNED) { if ((this->actionState != GELDB_SLASH) && (this->actionState != GELDB_SPIN_ATTACK)) { - Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F4, 0); + Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F4, 0); this->headRot.y = CLAMP(this->headRot.y, -0x256F, 0x256F); } else { this->headRot.y = 0; @@ -1277,18 +1356,18 @@ void func_80A392D8(EnGeldB* this, GlobalContext* globalCtx) { s32 pad; EnItem00* key; - if (this->blockCollider.base.acFlags & 0x80) { - this->blockCollider.base.acFlags &= ~0x80; - this->bodyCollider.base.acFlags &= ~2; - } else if ((this->bodyCollider.base.acFlags & 2) && (this->actionState >= GELDB_READY) && + if (this->blockCollider.base.acFlags & AC_BOUNCED) { + this->blockCollider.base.acFlags &= ~AC_BOUNCED; + this->bodyCollider.base.acFlags &= ~AC_HIT; + } else if ((this->bodyCollider.base.acFlags & AC_HIT) && (this->actionState >= GELDB_READY) && (this->spinAttackState < 2)) { - this->bodyCollider.base.acFlags &= ~2; - if (this->actor.colChkInfo.damageEffect != GELDB_DAMAGE_UNK6) { + this->bodyCollider.base.acFlags &= ~AC_HIT; + if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { this->damageEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->bodyCollider.body, 1); + func_80035650(&this->actor, &this->bodyCollider.info, 1); func_800F8A44(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH); - if ((this->actor.colChkInfo.damageEffect == GELDB_DAMAGE_STUN) || - (this->actor.colChkInfo.damageEffect == GELDB_DAMAGE_FREEZE)) { + if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) || + (this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) { if (this->actionState != GELDB_STUNNED) { func_8003426C(&this->actor, 0, 0x78, 0, 0x50); Actor_ApplyDamage(&this->actor); @@ -1298,11 +1377,9 @@ void func_80A392D8(EnGeldB* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); if (Actor_ApplyDamage(&this->actor) == 0) { if (this->keyFlag != 0) { - key = - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, this->keyFlag | ITEM00_SMALL_KEY); + key = Item_DropCollectible(globalCtx, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY); if (key != NULL) { - key->actor.posRot.rot.y = - Math_Vec3f_Yaw(&key->actor.posRot.pos, &this->actor.initPosRot.pos); + key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos); key->actor.speedXZ = 6.0f; Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -1323,18 +1400,18 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) { EnGeldB* this = THIS; func_80A392D8(this, globalCtx); - if (this->actor.colChkInfo.damageEffect != GELDB_DAMAGE_UNK6) { + if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); this->actionFunc(this, globalCtx); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 40.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 40.0f; func_80A391D8(this, globalCtx); } - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if ((this->actionState >= GELDB_READY) && (this->spinAttackState < 2) && - ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) { + ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } if ((this->actionState == GELDB_BLOCK) && (this->skelAnime.curFrame == 0.0f)) { @@ -1395,8 +1472,9 @@ void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Matrix_MultVec3f(&swordQuadOffset0, &this->swordCollider.dim.quad[0]); Matrix_MultVec3f(&swordQuadOffset3, &this->swordCollider.dim.quad[3]); Matrix_MultVec3f(&swordQuadOffset2, &this->swordCollider.dim.quad[2]); - func_80062734(&this->swordCollider, &this->swordCollider.dim.quad[0], &this->swordCollider.dim.quad[1], - &this->swordCollider.dim.quad[2], &this->swordCollider.dim.quad[3]); + Collider_SetQuadVertices(&this->swordCollider, &this->swordCollider.dim.quad[0], + &this->swordCollider.dim.quad[1], &this->swordCollider.dim.quad[2], + &this->swordCollider.dim.quad[3]); Matrix_MultVec3f(&swordTipOffset, &swordTip); Matrix_MultVec3f(&swordHiltOffset, &swordHilt); @@ -1408,7 +1486,7 @@ void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, EffectBlure_AddVertex(Effect_GetByIndex(this->blureIdx), &swordTip, &swordHilt); } } else { - func_8002BDB0(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset); + Actor_SetFeetPos(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset); } if (limbIndex == 19) { Matrix_MultVec3f(&footOffset, &this->rightFootPos); @@ -1480,7 +1558,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->spinAttackState == 2) { Animation_Change(&this->skelAnime, &D_06000F5C, 0.5f, 0.0f, 12.0f, ANIMMODE_ONCE_INTERP, 4.0f); this->spinAttackState++; - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink; + thisx->world.rot.y = thisx->shape.rot.y = thisx->yawTowardsPlayer; } else { this->timer--; if (this->timer == 0) { @@ -1511,12 +1589,12 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&blockTrisOffsets0[i], &blockTrisVtx0[i]); Matrix_MultVec3f(&blockTrisOffsets1[i], &blockTrisVtx1[i]); } - func_800627A0(&this->blockCollider, 0, &blockTrisVtx0[0], &blockTrisVtx0[1], &blockTrisVtx0[2]); - func_800627A0(&this->blockCollider, 1, &blockTrisVtx1[0], &blockTrisVtx1[1], &blockTrisVtx1[2]); + Collider_SetTrisVertices(&this->blockCollider, 0, &blockTrisVtx0[0], &blockTrisVtx0[1], &blockTrisVtx0[2]); + Collider_SetTrisVertices(&this->blockCollider, 1, &blockTrisVtx1[0], &blockTrisVtx1[1], &blockTrisVtx1[2]); } if (this->iceTimer != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->iceTimer--; if ((this->iceTimer % 4) == 0) { s32 iceIndex = this->iceTimer >> 2; @@ -1537,11 +1615,11 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) { s16 pad18; f32 dist; - angleToFacing = func_8002DA78(&this->actor, actor) - this->actor.shape.rot.y; - this->actor.posRot.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF; - dist = func_8002DB6C(&this->actor, &actor->posRot.pos); + angleToFacing = Actor_WorldYawTowardActor(&this->actor, actor) - this->actor.shape.rot.y; + this->actor.world.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF; + dist = Actor_WorldDistXYZToPoint(&this->actor, &actor->world.pos); //! @bug - // func_8002DB6C already sqrtfs the distance, so this actually checks for a + // Actor_WorldDistXYZToPoint already sqrtfs the distance, so this actually checks for a // distance of 360000. Also it's a double calculation because no f on sqrt. if ((ABS(angleToFacing) < 0x2EE0) && (sqrt(dist) < 600.0)) { if (actor->id == ACTOR_ARMS_HOOK) { @@ -1550,7 +1628,7 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) { EnGeldB_SetupBlock(this); } } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; if ((ABS(angleToFacing) < 0x2000) || (ABS(angleToFacing) > 0x5FFF)) { EnGeldB_SetupSidestep(this, globalCtx); this->actor.speedXZ *= 3.0f; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 9e4fca5866..6e196cf6f9 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -35,7 +35,7 @@ typedef struct EnGeldB { /* 0x0320 */ ColliderCylinder bodyCollider; /* 0x036C */ ColliderQuad swordCollider; /* 0x03EC */ ColliderTris blockCollider; - /* 0x040C */ ColliderTrisItem blockElements[2]; + /* 0x040C */ ColliderTrisElement blockElements[2]; /* 0x04C4 */ Vec3f leftFootPos; /* 0x04D0 */ Vec3f rightFootPos; /* 0x04DC */ Vec3s headRot; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index ff7a930002..0e406e3c50 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -71,7 +71,7 @@ void func_80A3BC6C(GlobalContext* globalCtx, EnGirlA* this); const ActorInit En_GirlA_InitVars = { ACTOR_EN_GIRLA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGirlA), @@ -963,9 +963,9 @@ void func_80A3BFE4(EnGirlA* this, GlobalContext* globalCtx) { osSyncPrintf("%s(%2d)\n", D_80A3C590[params], params); this->actor.flags &= ~1; Actor_SetScale(&this->actor, 0.25f); - this->actor.shape.unk_08 = 24.0f; - this->actor.shape.unk_10 = 4.0f; - this->actor.groundY = this->actor.initPosRot.pos.y; + this->actor.shape.yOffset = 24.0f; + this->actor.shape.shadowScale = 4.0f; + this->actor.floorHeight = this->actor.home.pos.y; this->actor.gravity = 0.0f; func_80A3A750(this, func_80A3BD80); this->unk_19C = 1; @@ -978,11 +978,11 @@ void func_80A3BFE4(EnGirlA* this, GlobalContext* globalCtx) { void func_80A3C3BC(EnGirlA* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.25f); - this->actor.shape.unk_08 = 24.0f; - this->actor.shape.unk_10 = 4.0f; + this->actor.shape.yOffset = 24.0f; + this->actor.shape.shadowScale = 4.0f; func_80A3BF54(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 5.0f); + Actor_SetFocus(&this->actor, 5.0f); this->actor.shape.rot.x = 0.0f; if (this->actor.params != 38) { if (this->unk_1B4 != 0) { diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 09f1e73611..202940f12f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -40,6 +40,6 @@ typedef struct EnGirlA { /* 0x01D0 */ EnGirlA3Func unk_1D0; } EnGirlA; // size = 0x01D4 -extern const ActorInit En_Girla_InitVars; +extern const ActorInit En_GirlA_InitVars; #endif diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index b3ea1e86b6..2376906cc1 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -32,7 +32,7 @@ extern AnimationHeader D_060002B8; const ActorInit En_Gm_InitVars = { ACTOR_EN_GM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGm), @@ -42,15 +42,28 @@ const ActorInit En_Gm_InitVars = { NULL, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 100, 120, 0, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 5, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -101,10 +114,10 @@ void func_80A3D838(EnGm* this, GlobalContext* globalCtx) { 0.0f); this->actor.draw = EnGm_Draw; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.05f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->eyeTexIndex = 0; this->blinkTimer = 20; this->actor.textId = 0x3049; @@ -159,16 +172,16 @@ void func_80A3DB04(EnGm* this, GlobalContext* globalCtx) { f32 dz; Player* player = PLAYER; - dx = this->talkPos.x - player->actor.posRot.pos.x; - dz = this->talkPos.z - player->actor.posRot.pos.z; + dx = this->talkPos.x - player->actor.world.pos.x; + dz = this->talkPos.z - player->actor.world.pos.z; if (Flags_GetSwitch(globalCtx, this->actor.params)) { EnGm_SetTextID(this); this->actionFunc = func_80A3DC44; } else if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = func_80A3DBF4; - } else if ((this->collider.base.maskA & 2) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { - this->collider.base.acFlags &= ~2; + } else if ((this->collider.base.ocFlags1 & OC1_HIT) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { + this->collider.base.acFlags &= ~AC_HIT; func_8002F2CC(&this->actor, globalCtx, 415.0f); } } @@ -187,8 +200,8 @@ void func_80A3DC44(EnGm* this, GlobalContext* globalCtx) { EnGm_SetTextID(this); - dx = this->talkPos.x - player->actor.posRot.pos.x; - dz = this->talkPos.z - player->actor.posRot.pos.z; + dx = this->talkPos.x - player->actor.world.pos.x; + dz = this->talkPos.z - player->actor.world.pos.z; if (func_8002F194(&this->actor, globalCtx)) { switch (func_80A3D7C8()) { @@ -207,8 +220,8 @@ void func_80A3DC44(EnGm* this, GlobalContext* globalCtx) { this->actionFunc = EnGm_ProcessChoiceIndex; } - if ((this->collider.base.maskA & 2) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.ocFlags1 & OC1_HIT) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { + this->collider.base.acFlags &= ~AC_HIT; func_8002F2CC(&this->actor, globalCtx, 415.0f); } } @@ -265,9 +278,9 @@ void func_80A3DFBC(EnGm* this, GlobalContext* globalCtx) { gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->objGmBankIndex].segment); this->timer++; this->actionFunc(this, globalCtx); - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; EnGm_UpdateEye(this); SkelAnime_Update(&this->skelAnime); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -285,7 +298,7 @@ void func_80A3E090(EnGm* this) { Matrix_Push(); Matrix_Translate(0.0f, 0.0f, 2600.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; Matrix_MultVec3f(&vec1, &vec2); this->collider.dim.pos.x = vec2.x; @@ -294,15 +307,15 @@ void func_80A3E090(EnGm* this) { Matrix_Pull(); Matrix_Push(); Matrix_Translate(0.0f, 0.0f, 4300.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; Matrix_MultVec3f(&vec1, &this->talkPos); Matrix_Pull(); Matrix_Translate(0.0f, 0.0f, 3800.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; - Matrix_MultVec3f(&vec1, &this->actor.posRot2.pos); - this->actor.posRot2.pos.y += 100.0f; + Matrix_MultVec3f(&vec1, &this->actor.focus.pos); + this->actor.focus.pos.y += 100.0f; } void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index f73d6b1e84..5e36f29a97 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_06010590; /* const ActorInit En_Go_InitVars = { ACTOR_EN_GO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGo), @@ -31,6 +31,26 @@ const ActorInit En_Go_InitVars = { (ActorFunc)EnGo_Update, (ActorFunc)EnGo_Draw, }; + +static ColliderCylinderInit D_80A41B00 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Go/func_80A3E570.s") diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 0a1192842c..2e3abc7699 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600FEF0; /* const ActorInit En_Go2_InitVars = { ACTOR_EN_GO2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGo2), @@ -30,6 +30,26 @@ const ActorInit En_Go2_InitVars = { (ActorFunc)EnGo2_Update, (ActorFunc)EnGo2_Draw, }; + +static ColliderCylinderInit D_80A48114 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 40, 65, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A42D30.s") diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 2980e4e3e3..497ff22608 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06003D78; /* const ActorInit En_Goma_InitVars = { ACTOR_BOSS_GOMA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GOL, sizeof(EnGoma), @@ -33,6 +33,46 @@ const ActorInit En_Goma_InitVars = { (ActorFunc)EnGoma_Update, (ActorFunc)EnGoma_Draw, }; + +static ColliderCylinderInit D_80A4B7A0 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A4B7CC = { + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s") diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 62db3bc38a..f408b1cbb5 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -34,7 +34,7 @@ void func_80A4DC00(EnGoroiwa* this, GlobalContext* globalCtx); const ActorInit En_Goroiwa_InitVars = { ACTOR_EN_GOROIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GOROIWA, sizeof(EnGoroiwa), @@ -44,20 +44,34 @@ const ActorInit En_Goroiwa_InitVars = { (ActorFunc)EnGoroiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 58 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, 254 }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; // Unused static f32 D_80A4DEBC[] = { 10.0f, 9.2f }; @@ -67,11 +81,11 @@ extern Gfx D_060006B0[]; void func_80A4BCA0(EnGoroiwa* this) { static f32 colliderHeightOffset[] = { 0.0f, 59.5f }; - Sphere16* worldSphere = &this->collider.list[0].dim.worldSphere; + Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; - worldSphere->center.x = this->actor.posRot.pos.x; - worldSphere->center.y = this->actor.posRot.pos.y + colliderHeightOffset[(this->actor.params >> 10) & 1]; - worldSphere->center.z = this->actor.posRot.pos.z; + worldSphere->center.x = this->actor.world.pos.x; + worldSphere->center.y = this->actor.world.pos.y + colliderHeightOffset[(this->actor.params >> 10) & 1]; + worldSphere->center.z = this->actor.world.pos.z; } void func_80A4BD04(EnGoroiwa* this, GlobalContext* globalCtx) { @@ -80,7 +94,7 @@ void func_80A4BD04(EnGoroiwa* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); func_80A4BCA0(this); - this->collider.list[0].dim.worldSphere.radius = 58; + this->collider.elements[0].dim.worldSphere.radius = 58; } void func_80A4BD70(EnGoroiwa* this, u8 arg1) { @@ -124,7 +138,7 @@ void func_80A4BE54(EnGoroiwa* this, GlobalContext* globalCtx) { nextPosF.y = nextPos->y; nextPosF.z = nextPos->z; - this->actor.posRot.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &nextPosF); + this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &nextPosF); } void func_80A4BF28(EnGoroiwa* this, GlobalContext* globalCtx, Vec3f* arg2) { @@ -204,9 +218,9 @@ void func_80A4C1C4(EnGoroiwa* this, GlobalContext* globalCtx, s32 waypoint) { Path* path = &globalCtx->setupPathList[this->actor.params & 0xFF]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; - this->actor.posRot.pos.x = pointPos->x; - this->actor.posRot.pos.y = pointPos->y; - this->actor.posRot.pos.z = pointPos->z; + this->actor.world.pos.x = pointPos->x; + this->actor.world.pos.y = pointPos->y; + this->actor.world.pos.z = pointPos->z; } void func_80A4C264(EnGoroiwa* this) { @@ -282,9 +296,9 @@ s32 func_80A4C6C8(EnGoroiwa* this, GlobalContext* globalCtx) { func_8002D868(&this->actor); path = &globalCtx->setupPathList[this->actor.params & 0xFF]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; - result = Math_StepToF(&this->actor.posRot.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)) & 1; - result &= Math_StepToF(&this->actor.posRot.pos.z, nextPointPos->z, fabsf(this->actor.velocity.z)); - this->actor.posRot.pos.y += this->actor.velocity.y; + result = Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)) & 1; + result &= Math_StepToF(&this->actor.world.pos.z, nextPointPos->z, fabsf(this->actor.velocity.z)); + this->actor.world.pos.y += this->actor.velocity.y; return result; } @@ -301,8 +315,8 @@ s32 func_80A4C814(EnGoroiwa* this, GlobalContext* globalCtx) { nextPointPosF.y = nextPointPos->y; nextPointPosF.z = nextPointPos->z; Math_StepToF(&this->actor.speedXZ, mREG(12) * 0.01f, 0.3f); - if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.posRot.pos) < 25.0f) { - Math_Vec3f_Diff(&nextPointPosF, &this->actor.posRot.pos, &posDiff); + if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < 25.0f) { + Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff); } else { posDiff.x = nextPointPosF.x - currentPointPos->x; posDiff.y = nextPointPosF.y - currentPointPos->y; @@ -312,9 +326,9 @@ s32 func_80A4C814(EnGoroiwa* this, GlobalContext* globalCtx) { this->actor.velocity.x *= this->actor.speedXZ; this->actor.velocity.y *= this->actor.speedXZ; this->actor.velocity.z *= this->actor.speedXZ; - result = Math_StepToF(&this->actor.posRot.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x)) & 1; - result &= Math_StepToF(&this->actor.posRot.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y)); - result &= Math_StepToF(&this->actor.posRot.pos.z, nextPointPosF.z, fabsf(this->actor.velocity.z)); + result = Math_StepToF(&this->actor.world.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x)) & 1; + result &= Math_StepToF(&this->actor.world.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y)); + result &= Math_StepToF(&this->actor.world.pos.z, nextPointPosF.z, fabsf(this->actor.velocity.z)); return result; } @@ -324,9 +338,9 @@ s32 func_80A4CA50(EnGoroiwa* this, GlobalContext* globalCtx) { Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, (mREG(12) * 0.01f) * 0.5f, 0.18f); - this->actor.posRot.pos.x = nextPointPos->x; - this->actor.posRot.pos.z = nextPointPos->z; - return Math_StepToF(&this->actor.posRot.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); + this->actor.world.pos.x = nextPointPos->x; + this->actor.world.pos.z = nextPointPos->z; + return Math_StepToF(&this->actor.world.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); } s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { @@ -349,14 +363,14 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { nextPointY = nextPointPos->y; Math_StepToF(&this->actor.velocity.y, -14.0f, 1.0f); - this->actor.posRot.pos.x = nextPointPos->x; - this->actor.posRot.pos.z = nextPointPos->z; - thisY = this->actor.posRot.pos.y; + this->actor.world.pos.x = nextPointPos->x; + this->actor.world.pos.z = nextPointPos->z; + thisY = this->actor.world.pos.y; if (1) {} - this->actor.posRot.pos.y += this->actor.velocity.y; - if (this->actor.velocity.y < 0.0f && this->actor.posRot.pos.y <= nextPointY) { + this->actor.world.pos.y += this->actor.velocity.y; + if (this->actor.velocity.y < 0.0f && this->actor.world.pos.y <= nextPointY) { if (this->unk_1C6 == 0) { - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { quakeIdx = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); @@ -364,17 +378,17 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { } this->unk_1C0 = 0.0f; if (!(this->unk_1D3 & 0x10)) { - sp5C.x = this->actor.posRot.pos.x; - sp5C.y = this->actor.posRot.pos.y + 50.0f; - sp5C.z = this->actor.posRot.pos.z; + sp5C.x = this->actor.world.pos.x; + sp5C.y = this->actor.world.pos.y + 50.0f; + sp5C.z = this->actor.world.pos.z; temp_f0_2 = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &sp68, &sp50, &this->actor, &sp5C); // temp needed to match - temp = temp_f0_2 - (this->actor.posRot.pos.y - 59.5f); + temp = temp_f0_2 - (this->actor.world.pos.y - 59.5f); if (fabsf(temp) < 15.0f) { - sp44.x = this->actor.posRot.pos.x; + sp44.x = this->actor.world.pos.x; sp44.y = temp_f0_2 + 10.0f; - sp44.z = this->actor.posRot.pos.z; + sp44.z = this->actor.world.pos.z; EnGoroiwa_SpawnDust(globalCtx, &sp44); } } @@ -384,17 +398,17 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { } this->unk_1C6 += 1; this->actor.velocity.y *= -0.3f; - this->actor.posRot.pos.y = nextPointY - ((this->actor.posRot.pos.y - nextPointY) * 0.3f); + this->actor.world.pos.y = nextPointY - ((this->actor.world.pos.y - nextPointY) * 0.3f); } if (this->unk_1C6 == 0 && - WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, + WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &waterBox) && - this->actor.posRot.pos.y <= ySurface) { + this->actor.world.pos.y <= ySurface) { this->unk_1D3 |= 0x10; if (ySurface < thisY) { - sp30.x = this->actor.posRot.pos.x; + sp30.x = this->actor.world.pos.x; sp30.y = ySurface; - sp30.z = this->actor.posRot.pos.z; + sp30.z = this->actor.world.pos.z; EnGoroiwa_SpawnWaterEffects(globalCtx, &sp30); this->actor.velocity.y *= 0.2f; } @@ -418,7 +432,7 @@ void func_80A4CED8(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->unk_1D3 & 8) { sp8C = this->unk_1BC; } else { - this->unk_1BC = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.pos4) * 0.016806724f; + this->unk_1BC = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.prevPos) * 0.016806724f; sp8C = this->unk_1BC; } sp8C *= this->unk_1C0; @@ -464,7 +478,7 @@ void func_80A4D0FC(EnGoroiwa* this, GlobalContext* globalCtx) { s16 angle1; s16 angle2; s32 pad; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f effectPos; Vec3f fragmentVelocity; f32 temp_f24; @@ -524,9 +538,9 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, D_80A4DF10[(this->actor.params >> 10) & 1], ActorShadow_DrawFunc_Circle, 9.4f); - this->actor.shape.unk_14 = 200; + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + ActorShape_Init(&this->actor.shape, D_80A4DF10[(this->actor.params >> 10) & 1], ActorShadow_DrawCircle, 9.4f); + this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, globalCtx); func_80A4C188(this, globalCtx); func_80A4C1C4(this, globalCtx, 0); @@ -536,7 +550,7 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { // Translation: (Goroiwa) osSyncPrintf("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, this->actor.params & 0xFF, (this->actor.params >> 8) & 3, (this->actor.params >> 10) & 1, - this->actor.initPosRot.rot.z & 1); + this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) { @@ -560,25 +574,25 @@ void func_80A4D624(EnGoroiwa* this, GlobalContext* globalCtx) { s16 yawDiff; s16 temp_v1_2; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; this->unk_1D3 &= ~4; - yawDiff = this->actor.yawTowardsLink - this->actor.posRot.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { this->unk_1D3 |= 4; - if ((this->actor.params >> 10) & 1 || (this->actor.initPosRot.rot.z & 1) != 1) { + if ((this->actor.params >> 10) & 1 || (this->actor.home.rot.z & 1) != 1) { func_80A4C164(this); func_80A4BE54(this, globalCtx); } } - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 0); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); osSyncPrintf(VT_FGCOL(CYAN)); // Translation: Player knocked down osSyncPrintf("Player ぶっ飛ばし\n"); osSyncPrintf(VT_RST); D_80A4DF20[(this->actor.params >> 10) & 1](this); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (D_80A4DF18[(this->actor.params >> 10) & 1](this, globalCtx)) { @@ -621,7 +635,7 @@ void func_80A4D8CC(EnGoroiwa* this) { void func_80A4D944(EnGoroiwa* this, GlobalContext* globalCtx) { func_80A4C6C8(this, globalCtx); if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y < 0.0f) { - if (this->unk_1D3 & 4 && (this->actor.initPosRot.rot.z & 1) == 1) { + if (this->unk_1D3 & 4 && (this->actor.home.rot.z & 1) == 1) { func_80A4C164(this); func_80A4BE54(this, globalCtx); } @@ -635,7 +649,7 @@ void func_80A4D9DC(EnGoroiwa* this) { this->actionFunc = func_80A4DA3C; this->actor.speedXZ = 0.0f; func_80A4BD70(this, 2); - this->waitTimer = waitDurations[this->actor.initPosRot.rot.z & 1]; + this->waitTimer = waitDurations[this->actor.home.rot.z & 1]; this->unk_1C0 = 0.0f; } @@ -643,7 +657,7 @@ void func_80A4DA3C(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->waitTimer > 0) { this->waitTimer--; } else { - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; func_80A4D5E0(this); } } @@ -656,11 +670,11 @@ void func_80A4DA7C(EnGoroiwa* this) { } void func_80A4DAD0(EnGoroiwa* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (func_80A4CA50(this, globalCtx)) { @@ -681,11 +695,11 @@ void func_80A4DB90(EnGoroiwa* this) { } void func_80A4DC00(EnGoroiwa* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (func_80A4CB78(this, globalCtx)) { @@ -709,15 +723,15 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); switch ((this->actor.params >> 10) & 1) { case 1: - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); break; case 0: - this->actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp30, - &this->actor, &this->actor.posRot.pos); + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp30, + &this->actor, &this->actor.world.pos); break; } func_80A4CED8(this, globalCtx); - if (this->actor.xzDistToLink < 300.0f) { + if (this->actor.xzDistToPlayer < 300.0f) { func_80A4BCA0(this); if (this->unk_1D3 & 1 && this->collisionTimer <= 0) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index 03de3a9a11..1080f34cad 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -12,7 +12,7 @@ typedef struct EnGoroiwa { /* 0x0000 */ Actor actor; /* 0x014C */ EnGoroiwaActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ Vec3f unk_1B0; /* 0x01BC */ f32 unk_1BC; /* 0x01C0 */ f32 unk_1C0; diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index b016760776..06c1485c73 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -28,7 +28,7 @@ extern Gfx D_06000A60[]; const ActorInit En_Gs_InitVars = { ACTOR_EN_GS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GS, sizeof(EnGs), @@ -38,17 +38,62 @@ const ActorInit En_Gs_InitVars = { (ActorFunc)EnGs_Draw, }; -static ColliderCylinderInit D_80A4FDA0 = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 21, 48, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 D_80A4FDCC = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable D_80A4FDD8 = { 0x00, 0x00, 0xE0, 0xC0, 0xE0, 0xE0, 0xD0, 0xE0, 0xF0, 0xF0, 0xF0, - 0xB0, 0xB0, 0xB0, 0x00, 0x00, 0x00, 0xB0, 0xB0, 0xB0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0xE), + /* Explosive */ DMG_ENTRY(0, 0xC), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(0, 0xE), + /* Hammer swing */ DMG_ENTRY(0, 0xD), + /* Hookshot */ DMG_ENTRY(0, 0xE), + /* Kokiri sword */ DMG_ENTRY(0, 0xF), + /* Master sword */ DMG_ENTRY(0, 0xF), + /* Giant's Knife */ DMG_ENTRY(0, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0xB), + /* Ice arrow */ DMG_ENTRY(0, 0xB), + /* Light arrow */ DMG_ENTRY(0, 0xB), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0xB), + /* Ice magic */ DMG_ENTRY(0, 0xB), + /* Light magic */ DMG_ENTRY(0, 0xB), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), @@ -58,12 +103,12 @@ void EnGs_Init(Actor* thisx, GlobalContext* globalCtx) { EnGs* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - Collider_InitCylinder(globalCtx, &this->unk_14C); - Collider_SetCylinder(globalCtx, &this->unk_14C, thisx, &D_80A4FDA0); - func_80061EFC(&thisx->colChkInfo, &D_80A4FDD8, &D_80A4FDCC); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); + CollisionCheck_SetInfo2(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - thisx->unk_1F = 6; - this->unk_1D8 = thisx->posRot.pos; + thisx->targetMode = 6; + this->unk_1D8 = thisx->world.pos; this->actionFunc = func_80A4F734; this->unk_1B4[0].x = 1.0f; this->unk_1B4[0].y = 1.0f; @@ -100,7 +145,7 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { Player* player = PLAYER; bREG(15) = 0; - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { bREG(15) = 1; if (this->unk_19D == 0) { player->stateFlags2 |= 0x800000; @@ -114,12 +159,12 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { if ((globalCtx->msgCtx.unk_E3F2 == 6) || (globalCtx->msgCtx.unk_E3F2 == 7) || (globalCtx->msgCtx.unk_E3F2 == 8) || (globalCtx->msgCtx.unk_E3F2 == 9) || (globalCtx->msgCtx.unk_E3F2 == 10)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_HEAL_TIMED); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_HEAL_TIMED); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } else if (globalCtx->msgCtx.unk_E3F2 == 11) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_HEAL_BIG); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_HEAL_BIG); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; @@ -303,9 +348,9 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { dustVelocity.x = Rand_CenteredFloat(15.0f); dustVelocity.y = Rand_ZeroFloat(-1.0f); dustVelocity.z = Rand_CenteredFloat(15.0f); - dustPos.x = this->actor.posRot.pos.x + (dustVelocity.x + dustVelocity.x); - dustPos.y = this->actor.posRot.pos.y + 7.0f; - dustPos.z = this->actor.posRot.pos.z + (dustVelocity.z + dustVelocity.z); + dustPos.x = this->actor.world.pos.x + (dustVelocity.x + dustVelocity.x); + dustPos.y = this->actor.world.pos.y + 7.0f; + dustPos.z = this->actor.world.pos.z + (dustVelocity.z + dustVelocity.z); func_8002836C(globalCtx, &dustPos, &dustVelocity, &dustAccel, &dustPrim, &dustEnv, (s16)Rand_ZeroFloat(50.0f) + 200, 40, 15); } @@ -322,11 +367,11 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { } if (this->unk_19F == 4) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3); if (this->actor.bgCheckFlags & 0x18) { - bomb2Pos.x = this->actor.posRot.pos.x; - bomb2Pos.y = this->actor.posRot.pos.y; - bomb2Pos.z = this->actor.posRot.pos.z; + bomb2Pos.x = this->actor.world.pos.x; + bomb2Pos.y = this->actor.world.pos.y; + bomb2Pos.z = this->actor.world.pos.z; Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); EffectSsBomb2_SpawnLayered(globalCtx, &bomb2Pos, &bomb2Velocity, &bomb2Accel, 100, 20); this->unk_200 = 10; @@ -337,7 +382,7 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { } Actor_MoveForward(&this->actor); - if (this->actor.yDistToLink < -12000.0f) { + if (this->actor.yDistToPlayer < -12000.0f) { Actor_Kill(&this->actor); } } @@ -477,13 +522,13 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnGs* this = THIS; - Actor_SetHeight(&this->actor, 23.0f); + Actor_SetFocus(&this->actor, 23.0f); if (globalCtx) {}; if (!(this->unk_19E & 0x10)) { if (globalCtx) {}; - if (this->unk_14C.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { this->unk_19F = 0; - this->unk_14C.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; switch (this->actor.colChkInfo.damageEffect) { case 15: @@ -513,9 +558,9 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { break; } } - Collider_CylinderUpdate(&this->actor, &this->unk_14C); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->unk_14C.base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->unk_14C.base); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } this->actionFunc(this, globalCtx); func_80A4E648(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index 04c45e9fcd..b8eecc4e5a 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -10,7 +10,7 @@ typedef void (*EnGsActionFunc)(struct EnGs*, GlobalContext*); typedef struct EnGs { /* 0x0000 */ Actor actor; - /* 0x014C */ ColliderCylinder unk_14C; + /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ EnGsActionFunc actionFunc; /* 0x019C */ u8 unk_19C; /* 0x019D */ u8 unk_19D; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 83f4e14e9a..0441867574 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -22,7 +22,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Guest_InitVars = { ACTOR_EN_GUEST, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_BOJ, sizeof(EnGuest), @@ -32,15 +32,21 @@ const ActorInit En_Guest_InitVars = { NULL, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 10, 60, 0, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 6, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; static UNK_PTR D_80A50BA4[] = { @@ -93,9 +99,9 @@ void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.update = func_80A505CC; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->unk_30E = 0; this->unk_30D = 0; @@ -131,7 +137,7 @@ void func_80A5046C(EnGuest* this) { void func_80A50518(EnGuest* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80A5057C; - } else if (this->actor.xzDistToLink < 100.0f) { + } else if (this->actor.xzDistToPlayer < 100.0f) { func_8002F2CC(&this->actor, globalCtx, 100.0f); } } @@ -155,7 +161,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { func_80A5046C(this); this->actionFunc(this, globalCtx); - this->unk_2A0.unk_18 = player->actor.posRot.pos; + this->unk_2A0.unk_18 = player->actor.world.pos; if (LINK_IS_ADULT) { this->unk_2A0.unk_14 = 10.0f; } else { @@ -168,9 +174,9 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->osAnimeBankIndex].segment); SkelAnime_Update(&this->skelAnime); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index 69cc2436c6..44fa131e9c 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -17,7 +17,7 @@ void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Hata_InitVars = { ACTOR_EN_HATA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HATA, sizeof(EnHata), diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 009d7058ca..4bdff5068f 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -34,7 +34,7 @@ static s32 sPlayerIsCaught = false; const ActorInit En_Heishi1_InitVars = { 0, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi1), @@ -167,13 +167,13 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - Math_ApproachF(&this->actor.posRot.pos.x, pointPos->x, 1.0f, this->moveSpeed); - Math_ApproachF(&this->actor.posRot.pos.z, pointPos->z, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.x, pointPos->x, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.z, pointPos->z, 1.0f, this->moveSpeed); Math_ApproachF(&this->moveSpeed, this->moveSpeedTarget, 1.0f, this->moveSpeedMax); - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.shape.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.378f), 3, this->bodyTurnSpeed, 0); @@ -237,14 +237,14 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) { Player* player = PLAYER; SkelAnime_Update(&this->skelAnime); - Math_ApproachF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 1.0f, this->moveSpeed); - Math_ApproachF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 1.0f, this->moveSpeed); Math_ApproachF(&this->moveSpeed, 6.0f, 1.0f, 0.4f); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0); Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f); Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f); - if (this->actor.xzDistToLink < 70.0f) { + if (this->actor.xzDistToPlayer < 70.0f) { this->actionFunc = EnHeishi1_SetupTurnTowardLink; } } @@ -332,7 +332,7 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->type != 5) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0); Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f); Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f); } @@ -378,7 +378,7 @@ void EnHeishi1_SetupWaitNight(EnHeishi1* this, GlobalContext* globalCtx) { void EnHeishi1_WaitNight(EnHeishi1* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8010B680(globalCtx, 0x702D, &this->actor); func_80078884(NA_SE_SY_FOUND); // "Discovered!" @@ -429,9 +429,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { Vec3f searchBallMult = { 0.0f, 0.0f, 20.0f }; Vec3f searchBallPos; - searchBallPos.x = this->actor.posRot.pos.x; - searchBallPos.y = this->actor.posRot.pos.y + 60.0f; - searchBallPos.z = this->actor.posRot.pos.z; + searchBallPos.x = this->actor.world.pos.x; + searchBallPos.y = this->actor.world.pos.y + 60.0f; + searchBallPos.z = this->actor.world.pos.z; Matrix_Push(); Matrix_RotateY(((this->actor.shape.rot.y + this->headAngle) / 32768.0f) * M_PI, 0); @@ -442,9 +442,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsSolderSrchBall_Spawn(globalCtx, &searchBallPos, &searchBallVel, &searchBallAccel, 2, &this->linkDetected); - if (this->actor.xzDistToLink < 60.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { this->linkDetected = true; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { // this case probably exists to detect link making a jump sound // from slightly further away than the previous 60 unit check if (player->actor.velocity.y > -4.0f) { @@ -463,7 +463,7 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->actor.velocity.y > -3.9f)) { this->linkDetected = false; // this 60 unit height check is so the player doesnt get caught when on the upper path - if (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 60.0f) { + if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) { func_80078884(NA_SE_SY_FOUND); // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); @@ -500,11 +500,11 @@ void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi1_OverrideLimbDraw, NULL, this); - func_80033C30(&this->actor.posRot.pos, &matrixScale, 0xFF, globalCtx); + func_80033C30(&this->actor.world.pos, &matrixScale, 0xFF, globalCtx); if ((this->path == BREG(1)) && (BREG(0) != 0)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 100.0f, this->actor.posRot.pos.z, - 17000, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, + 17000, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 46ed39c49f..06d7388d7e 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -58,7 +58,7 @@ extern Gfx D_06002C10[]; // 2D Guard in Window const ActorInit En_Heishi2_InitVars = { ACTOR_EN_HEISHI2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi2), @@ -69,8 +69,22 @@ const ActorInit En_Heishi2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 33, 40, 0, { 0, 0, 0 } }, }; @@ -80,12 +94,12 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->initParams = this->actor.params & 0xFF; - this->actor.colChkInfo.mass = 255; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->initParams == 6) || (this->initParams == 9)) { this->actor.draw = func_80A54C6C; this->actor.flags &= -2; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 6); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 6); if (this->initParams == 6) { this->actionFunc = func_80A531CC; @@ -96,12 +110,12 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.02f); - this->unk_274 = this->actor.posRot.pos; - this->actor.posRot.rot.y = 0x7918; - this->actor.posRot.pos.x += 90.0f; - this->actor.posRot.pos.y -= 60.0f; - this->actor.posRot.pos.z += 90.0f; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->unk_274 = this->actor.world.pos; + this->actor.world.rot.y = 0x7918; + this->actor.world.pos.x += 90.0f; + this->actor.world.pos.y -= 60.0f; + this->actor.world.pos.z += 90.0f; + this->actor.shape.rot.y = this->actor.world.rot.y; Collider_DestroyCylinder(globalCtx, &this->collider); func_8002DF54(globalCtx, 0, 8); this->actor.flags |= 0x11; @@ -109,7 +123,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { } } else { this->unk_2E0 = 60.0f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); collider = &this->collider; Collider_InitCylinder(globalCtx, collider); @@ -117,7 +131,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.dim.yShift = 0; this->collider.dim.radius = 0xF; this->collider.dim.height = 0x46; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; switch (this->initParams) { @@ -277,7 +291,7 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) { frameCount = this->skelAnime.curFrame; thisx = &this->actor; - actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; SkelAnime_Update(&this->skelAnime); if ((frameCount >= 12.0f) && (!this->audioFlag)) { Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT); @@ -409,9 +423,9 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) { player->actor.textId = 0x200F; // "I don't want that!" } } else { - yawDiffTemp = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiff = ABS(yawDiffTemp); - if (!(120.0f < this->actor.xzDistToLink) && (yawDiff < 0x4300)) { + if (!(120.0f < this->actor.xzDistToPlayer) && (yawDiff < 0x4300)) { func_8002F298(&this->actor, globalCtx, 100.0f, EXCH_ITEM_LETTER_ZELDA); } } @@ -442,7 +456,7 @@ void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) { BgGateShutter* gate; frameCount = this->skelAnime.curFrame; - gate = (BgGateShutter*)globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + gate = (BgGateShutter*)globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; SkelAnime_Update(&this->skelAnime); if (12.0f <= frameCount) { if (this->audioFlag == 0) { @@ -607,7 +621,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) { frameCount = this->skelAnime.curFrame; thisx = &this->actor; - gate = (BgGateShutter*)(globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first); + gate = (BgGateShutter*)(globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head); SkelAnime_Update(&this->skelAnime); if ((frameCount >= 12.0f) && (!this->audioFlag)) { Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT); @@ -637,7 +651,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) { void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.z, -6100, 5, this->unk_2E4, 0); Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f); - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; if (this->actor.shape.rot.z < -6000) { func_8010B680(globalCtx, 0x708F, NULL); this->actor.flags |= 0x10000; @@ -659,7 +673,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) { pos.x = Rand_CenteredFloat(20.0f) + this->unk_274.x; pos.y = Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f); pos.z = Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f); - rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsLink; + rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsPlayer; bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0); if (bomb != NULL) { bomb->actor.speedXZ = Rand_CenteredFloat(5.0f) + 10.0f; @@ -675,7 +689,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) { void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.z, 200, 5, this->unk_2E4, 0); Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f); - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; if (this->actor.shape.rot.z > 0) { Actor_Kill(&this->actor); } @@ -736,8 +750,8 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) { } if (((this->initParams != 2) && (this->initParams != 5)) || - ((yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)), - !(this->actor.xzDistToLink > 120.0f)) && + ((yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)), + !(this->actor.xzDistToPlayer > 120.0f)) && (yawDiff < 0x4300))) { func_8002F2F4(&this->actor, globalCtx); } @@ -770,11 +784,11 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) { EnHeishi2* this = THIS; s32 i; - Actor_SetHeight(&this->actor, this->unk_2E0); + Actor_SetFocus(&this->actor, this->unk_2E0); if ((this->initParams == 2) || (this->initParams == 5)) { - this->actor.posRot2.pos.y = 70.0f; - Actor_SetHeight(&this->actor, 70.0f); - func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.posRot2.pos); + this->actor.focus.pos.y = 70.0f; + Actor_SetFocus(&this->actor, 70.0f); + func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.focus.pos); } this->unk_2FC++; @@ -792,9 +806,9 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) { case 9: break; default: - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); break; } } diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 20acf705e3..e73b40387e 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -32,7 +32,7 @@ static s16 sPlayerCaught = 0; const ActorInit En_Heishi3_InitVars = { ACTOR_EN_HEISHI3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi3), @@ -43,8 +43,22 @@ const ActorInit En_Heishi3_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 15, 70, 0, { 0, 0, 0 } }, }; @@ -56,22 +70,22 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_278 = 0; } else { this->unk_278 = 1; - if (this->actor.posRot.pos.x < -290.0f) { + if (this->actor.world.pos.x < -290.0f) { this->unk_278 = 2; } } Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); - this->actor.colChkInfo.mass = 0xFF; - this->actor.unk_1F = 6; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->actor.targetMode = 6; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); // "Castle Gate Soldier - Power Up" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST); this->actor.gravity = -3.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->actionFunc = EnHeishi3_SetupGuardType; } @@ -103,7 +117,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx) player = PLAYER; SkelAnime_Update(&this->skelAnime); - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffNew = ABS(yawDiff); if (yawDiffNew < 0x4300) { if (gSaveContext.nightFlag == 0) { @@ -118,8 +132,8 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx) sightRange = 100.0f; } } - if ((this->actor.xzDistToLink < sightRange) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && (sPlayerCaught == 0)) { + if ((this->actor.xzDistToPlayer < sightRange) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && (sPlayerCaught == 0)) { sPlayerCaught = 1; func_8010B680(globalCtx, 0x702D, &this->actor); // "Hey you! Stop! You, kid, over there!" func_80078884(NA_SE_SY_FOUND); @@ -136,15 +150,15 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx) Player* player = PLAYER; SkelAnime_Update(&this->skelAnime); - if ((player->actor.posRot.pos.x < -190.0f) && (player->actor.posRot.pos.x > -380.0f) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && - (player->actor.posRot.pos.z < 1020.0f) && (player->actor.posRot.pos.z > 700.0f) && (sPlayerCaught == 0)) { + if ((player->actor.world.pos.x < -190.0f) && (player->actor.world.pos.x > -380.0f) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && + (player->actor.world.pos.z < 1020.0f) && (player->actor.world.pos.z > 700.0f) && (sPlayerCaught == 0)) { if (this->unk_278 == 1) { - if ((player->actor.posRot.pos.x < -290.0f)) { + if ((player->actor.world.pos.x < -290.0f)) { return; } } else { - if (player->actor.posRot.pos.x > -290.0f) { + if (player->actor.world.pos.x > -290.0f) { return; } } @@ -176,7 +190,7 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) { this->actionFunc = EnHeishi3_ResetAnimationToIdle; this->actor.speedXZ = 0.0f; } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 5, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 3000, 0); } } @@ -204,17 +218,17 @@ void EnHeishi3_Update(Actor* thisx, GlobalContext* globalCtx) { EnHeishi3* this = THIS; s32 pad; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->unk_274 += 1; if (this->caughtTimer != 0) { this->caughtTimer -= 1; } this->actionFunc(this, globalCtx); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnHeishi3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index d045135dad..676155543e 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -24,7 +24,7 @@ void func_80A56ACC(EnHeishi4* this, GlobalContext* globalCtx); const ActorInit En_Heishi4_InitVars = { ACTOR_EN_HEISHI4, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi4), @@ -37,8 +37,22 @@ const ActorInit En_Heishi4_InitVars = { static u32 sFaceReactionSets[] = { 6, 7 }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 33, 40, 0, { 0, 0, 0 } }, }; @@ -53,16 +67,16 @@ void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); this->type = thisx->params & 0xFF; - thisx->colChkInfo.mass = 0xFF; - this->pos = thisx->posRot.pos; - thisx->unk_1F = 6; + thisx->colChkInfo.mass = MASS_IMMOVABLE; + this->pos = thisx->world.pos; + thisx->targetMode = 6; if (this->type == HEISHI4_AT_MARKET_DYING) { this->height = 30.0f; ActorShape_Init(&thisx->shape, 0.0f, NULL, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_0600C444, this->jointTable, this->morphTable, 17); } else { this->height = 60.0f; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); } Collider_InitCylinder(globalCtx, &this->collider); @@ -252,7 +266,7 @@ void func_80A56900(EnHeishi4* this, GlobalContext* globalCtx) { void func_80A56994(EnHeishi4* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - func_80038290(globalCtx, &this->actor, &this->unk_260.x, &this->unk_266.x, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_260.x, &this->unk_266.x, this->actor.focus.pos); if (this->unk_282 == func_8010BDBC(&globalCtx->msgCtx)) { if (func_80106BC8(globalCtx) != 0) { func_80106CCC(globalCtx); @@ -333,14 +347,14 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - thisx->posRot.pos.x = this->pos.x; - thisx->posRot.pos.y = this->pos.y; - thisx->posRot.pos.z = this->pos.z; - Actor_SetHeight(thisx, this->height); + thisx->world.pos.x = this->pos.x; + thisx->world.pos.y = this->pos.y; + thisx->world.pos.z = this->pos.z; + Actor_SetFocus(thisx, this->height); if (this->type != HEISHI4_AT_MARKET_DYING) { - this->unk_28C.unk_18 = player->actor.posRot.pos; + this->unk_28C.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_28C.unk_18.y = (player->actor.posRot.pos.y - 10.0f); + this->unk_28C.unk_18.y = (player->actor.world.pos.y - 10.0f); } func_80034A14(thisx, &this->unk_28C, 2, 4); this->unk_260 = this->unk_28C.unk_08; @@ -349,9 +363,9 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_27E += 1; this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 10.0f, 10.0f, 30.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 10.0f, 10.0f, 30.0f, 0x1D); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnHeishi_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index ca38e6b78a..0adb524d4d 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -42,7 +42,7 @@ extern AnimationHeader D_06003128; const ActorInit En_Hintnuts_InitVars = { ACTOR_EN_HINTNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_HINTNUTS, sizeof(EnHintnuts), @@ -53,24 +53,33 @@ const ActorInit En_Hintnuts_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 18, 32, 0, { 0, 0, 0 } } + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 32, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x01, - 0x0012, - 0x0020, - 0xFE, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 18, 32, MASS_HEAVY }; static s16 sPuzzleCounter = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 10, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), }; void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -81,11 +90,11 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.params == 0xA) { this->actor.flags &= ~5; } else { - ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060023B8, &D_06002F7C, this->jointTable, this->morphTable, 10); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetTextWithPrefix(globalCtx, &this->actor, (this->actor.params >> 8) & 0xFF); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; @@ -97,8 +106,8 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { } } EnHintnuts_SetupWait(this); - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.posRot.rot.y, 0, 0xA); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0xA); } } @@ -110,11 +119,11 @@ void EnHintnuts_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnHintnuts_HitByScrubProjectile1(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->actor.textId != 0 && this->actor.type == ACTORTYPE_ENEMY && + if (this->actor.textId != 0 && this->actor.category == ACTORCAT_ENEMY && ((this->actor.params == 0) || (sPuzzleCounter == 2))) { this->actor.flags &= ~0x5; this->actor.flags |= 0x9; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BG); } } @@ -122,8 +131,8 @@ void EnHintnuts_SetupWait(EnHintnuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06002B90, 0.0f); this->animFlagAndTimer = Rand_S16Offset(100, 50); this->collider.dim.height = 5; - this->actor.posRot.pos = this->actor.initPosRot.pos; - this->collider.base.acFlags &= ~1; + this->actor.world.pos = this->actor.home.pos; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnHintnuts_Wait; } @@ -158,9 +167,9 @@ void EnHintnuts_HitByScrubProjectile2(EnHintnuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060026C4, -3.0f); this->collider.dim.height = 0x25; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; - if (this->actor.params > 0 && this->actor.params < 4 && this->actor.type == ACTORTYPE_ENEMY) { + if (this->actor.params > 0 && this->actor.params < 4 && this->actor.category == ACTORCAT_ENEMY) { if (sPuzzleCounter == -4) { sPuzzleCounter = 0; } @@ -195,12 +204,12 @@ void EnHintnuts_SetupLeave(EnHintnuts* this, GlobalContext* globalCtx) { Animation_MorphToLoop(&this->skelAnime, &D_06003128, -5.0f); this->actor.speedXZ = 3.0f; this->animFlagAndTimer = 100; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->collider.base.maskA &= ~1; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->collider.base.ocFlags1 &= ~OC1_ON; this->actor.flags |= 0x10; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0x0, 0x0, 0x0, 0x3); // recovery heart + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0x0, 0x0, 0x0, 0x3); // recovery heart this->actionFunc = EnHintnuts_Leave; } @@ -208,7 +217,7 @@ void EnHintnuts_SetupFreeze(EnHintnuts* this) { Animation_PlayLoop(&this->skelAnime, &D_060029BC); this->actor.flags &= ~1; func_8003426C(&this->actor, 0, 0xFF, 0, 100); - this->actor.dmgEffectTimer = 1; + this->actor.colorFilterTimer = 1; this->animFlagAndTimer = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT); if (sPuzzleCounter == -3) { @@ -228,25 +237,25 @@ void EnHintnuts_Wait(EnHintnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); } this->collider.dim.height = 5.0f + ((CLAMP(this->skelAnime.curFrame, 9.0f, 12.0f) - 9.0f) * 9.0f); - if (!hasSlowPlaybackSpeed && (this->actor.xzDistToLink < 120.0f)) { + if (!hasSlowPlaybackSpeed && (this->actor.xzDistToPlayer < 120.0f)) { EnHintnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnHintnuts_SetupBurrow(this); - } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToLink > 320.0f)) { + } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToPlayer > 320.0f)) { EnHintnuts_SetupLookAround(this); } else { EnHintnuts_SetupStand(this); } } - if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistToLink && fabsf(this->actor.yDistToLink) < 120.0f && - ((this->animFlagAndTimer == 0) || (this->actor.xzDistToLink < 480.0f))) { + if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistToPlayer && fabsf(this->actor.yDistToPlayer) < 120.0f && + ((this->animFlagAndTimer == 0) || (this->actor.xzDistToPlayer < 480.0f))) { this->skelAnime.playSpeed = 1.0f; } } @@ -256,7 +265,7 @@ void EnHintnuts_LookAround(EnHintnuts* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->animFlagAndTimer != 0) { this->animFlagAndTimer--; } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0)) { EnHintnuts_SetupBurrow(this); } } @@ -267,9 +276,9 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (!(this->animFlagAndTimer & 0x1000)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } - if (this->actor.xzDistToLink < 120.0f || this->animFlagAndTimer == 0x1000) { + if (this->actor.xzDistToPlayer < 120.0f || this->animFlagAndTimer == 0x1000) { EnHintnuts_SetupBurrow(this); } else if (this->animFlagAndTimer == 0) { EnHintnuts_SetupThrowScrubProjectile(this); @@ -279,15 +288,15 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_ThrowNut(EnHintnuts* this, GlobalContext* globalCtx) { Vec3f nutPos; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); - if (this->actor.xzDistToLink < 120.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); + if (this->actor.xzDistToPlayer < 120.0f) { EnHintnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { EnHintnuts_SetupStand(this); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - nutPos.x = this->actor.posRot.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); - nutPos.y = this->actor.posRot.pos.y + 12.0f; - nutPos.z = this->actor.posRot.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); + nutPos.x = this->actor.world.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); + nutPos.y = this->actor.world.pos.y + 12.0f; + nutPos.z = this->actor.world.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_NUTSBALL, nutPos.x, nutPos.y, nutPos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 1) != NULL) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW); @@ -302,19 +311,19 @@ void EnHintnuts_Burrow(EnHintnuts* this, GlobalContext* globalCtx) { this->collider.dim.height = 5.0f + ((3.0f - CLAMP(this->skelAnime.curFrame, 1.0f, 3.0f)) * 12.0f); } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; } - Math_ApproachF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 0.5f, 3.0f); - Math_ApproachF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.5f, 3.0f); } void EnHintnuts_BeginRun(EnHintnuts* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - this->unk_196 = this->actor.yawTowardsLink + 0x8000; + this->unk_196 = this->actor.yawTowardsPlayer + 0x8000; EnHintnuts_SetupRun(this); } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) { @@ -324,13 +333,13 @@ void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) { } void EnHintnuts_CheckProximity(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->actor.type != ACTORTYPE_ENEMY) { - if ((this->collider.base.maskA & 2) || (this->actor.unk_10C != 0)) { + if (this->actor.category != ACTORCAT_ENEMY) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; } - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { this->actor.textId = this->textIdCopy; func_8002F2F4(&this->actor, globalCtx); } @@ -353,35 +362,35 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) { } Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); - if (Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { + if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { if (this->actor.bgCheckFlags & 0x20) { - this->unk_196 = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } else if (this->actor.bgCheckFlags & 8) { - this->unk_196 = this->actor.wallPolyRot; + this->unk_196 = this->actor.wallYaw; } else if (this->animFlagAndTimer == 0) { - diffRotInit = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); - diffRot = diffRotInit - this->actor.yawTowardsLink; + diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); + diffRot = diffRotInit - this->actor.yawTowardsPlayer; if (ABS(diffRot) >= 0x2001) { this->unk_196 = diffRotInit; } else { phi_f0 = (0.0f <= (f32)diffRot) ? 1.0f : -1.0f; - this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.yawTowardsLink); + this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.yawTowardsPlayer); } } else { - this->unk_196 = (s16)(this->actor.yawTowardsLink + 0x8000); + this->unk_196 = (s16)(this->actor.yawTowardsPlayer + 0x8000); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; if (func_8002F194(&this->actor, globalCtx) != 0) { EnHintnuts_SetupTalk(this); - } else if (this->animFlagAndTimer == 0 && func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) < 20.0f && - fabsf(this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) < 2.0f) { + } else if (this->animFlagAndTimer == 0 && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f && + fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) { this->actor.speedXZ = 0.0f; - if (this->actor.type == ACTORTYPE_BG) { + if (this->actor.category == ACTORCAT_BG) { this->actor.flags &= ~0x00010009; this->actor.flags |= 0x5; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } EnHintnuts_SetupBurrow(this); } else { @@ -391,7 +400,7 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_Talk(EnHintnuts* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x3, 0x400, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x3, 0x400, 0x100); if (func_8010BDBC(&globalCtx->msgCtx) == 5) { EnHintnuts_SetupLeave(this, globalCtx); } @@ -408,10 +417,10 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } if (this->actor.bgCheckFlags & 8) { - temp_a1 = this->actor.wallPolyRot; + temp_a1 = this->actor.wallYaw; } else { temp_a1 = - this->actor.yawTowardsLink - Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000; + this->actor.yawTowardsPlayer - Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000; if (ABS(temp_a1) >= 0x4001) { temp_a1 = Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000; } else { @@ -419,7 +428,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { } } Math_ScaledStepToS(&this->actor.shape.rot.y, temp_a1, 0x800); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->animFlagAndTimer == 0) || (this->actor.projectedPos.z < 0.0f)) { func_80106CCC(globalCtx); if (this->actor.params == 3) { @@ -427,14 +436,14 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { sPuzzleCounter = 3; } if (this->actor.child != NULL) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORCAT_PROP); } Actor_Kill(&this->actor); } } void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { - this->actor.dmgEffectTimer = 1; + this->actor.colorFilterTimer = 1; SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT); @@ -442,29 +451,29 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { if (this->animFlagAndTimer == 0) { if (sPuzzleCounter == 3) { if (this->actor.child != NULL) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORCAT_PROP); } this->animFlagAndTimer = 1; } else if (sPuzzleCounter == -4) { this->animFlagAndTimer = 2; } - } else if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - 35.0f, 7.0f) != 0) { + } else if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 35.0f, 7.0f) != 0) { if (this->animFlagAndTimer == 1) { Actor_Kill(&this->actor); } else { this->actor.flags |= 1; this->actor.flags &= ~0x10; this->actor.colChkInfo.health = sColChkInfoInit.health; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; EnHintnuts_SetupWait(this); } } } void EnHintnuts_ColliderCheck(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if (this->collider.base.ac->id != ACTOR_EN_NUTSBALL) { EnHintnuts_SetupBurrow(this); } else { @@ -486,20 +495,21 @@ void EnHintnuts_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnHintnuts_Freeze && this->actionFunc != EnHintnuts_BeginFreeze) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, + this->collider.dim.height, 0x1D); } - Collider_CylinderUpdate(&this->actor, &this->collider); - if (this->collider.base.acFlags & 1) { + Collider_UpdateCylinder(&this->actor, &this->collider); + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actionFunc == EnHintnuts_Wait) { - Actor_SetHeight(&this->actor, this->skelAnime.curFrame); + Actor_SetFocus(&this->actor, this->skelAnime.curFrame); } else if (this->actionFunc == EnHintnuts_Burrow) { - Actor_SetHeight(&this->actor, - 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_060024CC))); + Actor_SetFocus(&this->actor, + 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_060024CC))); } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); } } } diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index f34ed6e29c..f4889ff8fb 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -27,7 +27,7 @@ void func_80A59618(EnHoll* this, GlobalContext* globalCtx); const ActorInit En_Holl_InitVars = { ACTOR_EN_HOLL, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHoll), @@ -141,7 +141,7 @@ void func_80A58DD4(EnHoll* this, GlobalContext* globalCtx) { f32 absZ; s32 transitionActorIdx; - func_8002DBD0(&this->actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); this->side = (vec.z < 0.0f) ? 0 : 1; absZ = fabsf(vec.z); if (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH && @@ -185,7 +185,7 @@ void func_80A59014(EnHoll* this, GlobalContext* globalCtx) { f32 absZ; s32 side; - func_8002DBD0(&this->actor, &vec, (useViewEye) ? &globalCtx->view.eye : &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, (useViewEye) ? &globalCtx->view.eye : &player->actor.world.pos); planeHalfWidth = (((this->actor.params >> 6) & 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; if (EnHoll_IsKokiriSetup8() || (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < planeHalfWidth && fabsf(vec.z) < 100.0f && fabsf(vec.z) > 50.0f)) { @@ -206,10 +206,10 @@ void func_80A59014(EnHoll* this, GlobalContext* globalCtx) { // Vertical Planes void func_80A591C0(EnHoll* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 absY = fabsf(this->actor.yDistToLink); + f32 absY = fabsf(this->actor.yDistToPlayer); s32 transitionActorIdx; - if (this->actor.xzDistToLink < 500.0f && absY < 700.0f) { + if (this->actor.xzDistToPlayer < 500.0f && absY < 700.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; if (absY < 95.0f) { globalCtx->unk_11E18 = 0xFF; @@ -220,8 +220,8 @@ void func_80A591C0(EnHoll* this, GlobalContext* globalCtx) { } if (absY < 95.0f) { this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[1].room; - Math_SmoothStepToF(&player->actor.posRot.pos.x, this->actor.posRot.pos.x, 1.0f, 50.0f, 10.0f); - Math_SmoothStepToF(&player->actor.posRot.pos.z, this->actor.posRot.pos.z, 1.0f, 50.0f, 10.0f); + Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 1.0f, 50.0f, 10.0f); + Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 1.0f, 50.0f, 10.0f); if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { EnHoll_SetupAction(this, EnHoll_NextAction); @@ -241,7 +241,7 @@ void func_80A593A4(EnHoll* this, GlobalContext* globalCtx) { s32 side; s32 transitionActorIdx; - if ((this->actor.xzDistToLink < 120.0f) && (absY = fabsf(this->actor.yDistToLink), absY < 200.0f)) { + if ((this->actor.xzDistToPlayer < 120.0f) && (absY = fabsf(this->actor.yDistToPlayer), absY < 200.0f)) { if (absY < 50.0f) { globalCtx->unk_11E18 = 0xFF; } else { @@ -249,7 +249,7 @@ void func_80A593A4(EnHoll* this, GlobalContext* globalCtx) { } if (absY > 50.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; - side = (0.0f < this->actor.yDistToLink) ? 0 : 1; + side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[side].room; if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { @@ -269,11 +269,11 @@ void func_80A59520(EnHoll* this, GlobalContext* globalCtx) { s8 side; s32 transitionActorIdx; - if (this->actor.xzDistToLink < 120.0f) { - absY = fabsf(this->actor.yDistToLink); + if (this->actor.xzDistToPlayer < 120.0f) { + absY = fabsf(this->actor.yDistToPlayer); if (absY < 200.0f && absY > 50.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; - side = (0.0f < this->actor.yDistToLink) ? 0 : 1; + side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[side].room; if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { @@ -297,7 +297,7 @@ void func_80A59618(EnHoll* this, GlobalContext* globalCtx) { this->unk_14F = 0; } } else { - func_8002DBD0(&this->actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); absZ = fabsf(vec.z); if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { this->unk_14F = 1; diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index c68d6cdd66..6cb7c16d32 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -52,7 +52,7 @@ extern Gfx D_05006810[]; const ActorInit En_Honotrap_InitVars = { ACTOR_EN_HONOTRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnHonotrap), @@ -62,26 +62,61 @@ const ActorInit En_Honotrap_InitVars = { (ActorFunc)EnHonotrap_Draw, }; -static ColliderTrisItemInit sTrisElementsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { -23.0f, 0.0f, 8.5f }, { 0.0f, -23.0f, 8.5f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { 0.0f, -23.0f, 8.5f }, { 23.0f, 0.0f, 8.5f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00100000, 0x00, 0x00 }, 0x19, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00100000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 25, 0, { 0, 0, 0 } }, }; @@ -96,7 +131,7 @@ static InitChainEntry sInitChain[] = { void EnHonotrap_FlameCollisionCheck(EnHonotrap* this, GlobalContext* globalCtx) { s32 pad[3]; - Collider_CylinderUpdate(&this->actor, &this->collider.cyl); + Collider_UpdateCylinder(&this->actor, &this->collider.cyl); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); @@ -131,24 +166,24 @@ void EnHonotrap_InitEye(Actor* thisx, GlobalContext* globalCtx) { f32 sin; Actor_SetScale(thisx, 0.1f); - sin = Math_SinS(thisx->initPosRot.rot.y); - cos = Math_CosS(thisx->initPosRot.rot.y); + sin = Math_SinS(thisx->home.rot.y); + cos = Math_CosS(thisx->home.rot.y); Collider_InitTris(globalCtx, &this->collider.tris); Collider_SetTris(globalCtx, &this->collider.tris, thisx, &sTrisInit, this->collider.elements); for (i = 0; i < 2; i++) { for (j = 0, vtx = triangle; j < 3; j++, vtx++) { - Vec3f* baseVtx = &sTrisInit.list[i].dim.vtx[j]; + Vec3f* baseVtx = &sTrisInit.elements[i].dim.vtx[j]; vtx->x = baseVtx->z * sin + baseVtx->x * cos; vtx->y = baseVtx->y; vtx->z = baseVtx->z * cos - baseVtx->x * sin; - Math_Vec3f_Sum(vtx, &thisx->posRot.pos, vtx); + Math_Vec3f_Sum(vtx, &thisx->world.pos, vtx); } - func_800627A0(&this->collider.tris, i, &triangle[0], &triangle[1], &triangle[2]); + Collider_SetTrisVertices(&this->collider.tris, i, &triangle[0], &triangle[1], &triangle[2]); } EnHonotrap_SetupEyeIdle(this); - Actor_SetHeight(thisx, 0.0f); + Actor_SetFocus(thisx, 0.0f); } void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { @@ -158,12 +193,12 @@ void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.0001f); Collider_InitCylinder(globalCtx, &this->collider.cyl); Collider_SetCylinder(globalCtx, &this->collider.cyl, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider.cyl); + Collider_UpdateCylinder(&this->actor, &this->collider.cyl); this->actor.minVelocityY = -1.0f; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - this->actor.shape.unk_14 = 0x80; - this->targetPos = PLAYER->actor.posRot.pos; + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + this->actor.shape.shadowAlpha = 128; + this->targetPos = PLAYER->actor.world.pos; this->targetPos.y += 10.0f; this->flameScroll = Rand_ZeroOne() * 511.0f; EnHonotrap_SetupFlame(this); @@ -172,7 +207,7 @@ void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.room = -1; this->collider.cyl.dim.radius = 12; this->collider.cyl.dim.height = 30; - this->actor.shape.unk_08 = -1000.0f; + this->actor.shape.yOffset = -1000.0f; } } @@ -204,10 +239,10 @@ void EnHonotrap_SetupEyeIdle(EnHonotrap* this) { void EnHonotrap_EyeIdle(EnHonotrap* this, GlobalContext* globalCtx) { if (this->actor.child != NULL) { this->timer = 200; - } else if ((this->timer <= 0) && (this->actor.xzDistToLink < 750.0f) && (0.0f > this->actor.yDistToLink) && - (this->actor.yDistToLink > -700.0f) && - (-0x4000 < (this->actor.yawTowardsLink - this->actor.shape.rot.y)) && - ((this->actor.yawTowardsLink - this->actor.shape.rot.y) < 0x4000)) { + } else if ((this->timer <= 0) && (this->actor.xzDistToPlayer < 750.0f) && (0.0f > this->actor.yDistToPlayer) && + (this->actor.yDistToPlayer > -700.0f) && + (-0x4000 < (this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) && + ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) < 0x4000)) { EnHonotrap_SetupEyeOpen(this); } } @@ -229,9 +264,9 @@ void EnHonotrap_EyeOpen(EnHonotrap* this, GlobalContext* globalCtx) { sin = Math_SinS(this->actor.shape.rot.y); cos = Math_CosS(this->actor.shape.rot.y); Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HONOTRAP, - (sin * 12.0f) + this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y - 10.0f, - (cos * 12.0f) + this->actor.initPosRot.pos.z, this->actor.initPosRot.rot.x, - this->actor.initPosRot.rot.y, this->actor.initPosRot.rot.z, HONOTRAP_FLAME_MOVE); + (sin * 12.0f) + this->actor.home.pos.x, this->actor.home.pos.y - 10.0f, + (cos * 12.0f) + this->actor.home.pos.z, this->actor.home.rot.x, this->actor.home.rot.y, + this->actor.home.rot.z, HONOTRAP_FLAME_MOVE); } } @@ -280,25 +315,25 @@ void EnHonotrap_Flame(EnHonotrap* this, GlobalContext* globalCtx) { void EnHonotrap_SetupFlameDrop(EnHonotrap* this) { this->timer = 40; this->actor.velocity.y = 1.0f; - this->actor.velocity.x = 2.0f * Math_SinS(this->actor.posRot.rot.y); - this->actor.velocity.z = 2.0f * Math_CosS(this->actor.posRot.rot.y); + this->actor.velocity.x = 2.0f * Math_SinS(this->actor.world.rot.y); + this->actor.velocity.z = 2.0f * Math_CosS(this->actor.world.rot.y); this->actionFunc = EnHonotrap_FlameDrop; } void EnHonotrap_FlameDrop(EnHonotrap* this, GlobalContext* globalCtx) { - if ((this->collider.cyl.base.atFlags & 2) || (this->timer <= 0)) { - if ((this->collider.cyl.base.atFlags & 2) && !(this->collider.cyl.base.atFlags & 4)) { - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 0.0f); + if ((this->collider.cyl.base.atFlags & AT_HIT) || (this->timer <= 0)) { + if ((this->collider.cyl.base.atFlags & AT_HIT) && !(this->collider.cyl.base.atFlags & AT_BOUNCED)) { + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); } this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; EnHonotrap_SetupFlameVanish(this); } else { if (this->actor.velocity.y > 0.0f) { - this->actor.posRot.pos.x += this->actor.velocity.x; - this->actor.posRot.pos.z += this->actor.velocity.z; - func_8002E4B4(globalCtx, &this->actor, 7.0f, 12.0f, 0.0f, 5); + this->actor.world.pos.x += this->actor.velocity.x; + this->actor.world.pos.z += this->actor.velocity.z; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 12.0f, 0.0f, 5); } - if (!Math_StepToF(&this->actor.posRot.pos.y, this->actor.groundY + 1.0f, this->actor.velocity.y)) { + if (!Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 1.0f, this->actor.velocity.y)) { this->actor.velocity.y += 1.0f; } else { this->actor.velocity.y = 0.0f; @@ -312,10 +347,10 @@ void EnHonotrap_SetupFlameMove(EnHonotrap* this) { this->actionFunc = EnHonotrap_FlameMove; - distFrac = 1.0f / (func_8002DB6C(&this->actor, &this->targetPos) + 1.0f); - this->actor.velocity.x = (this->targetPos.x - this->actor.posRot.pos.x) * distFrac; - this->actor.velocity.y = (this->targetPos.y - this->actor.posRot.pos.y) * distFrac; - this->actor.velocity.z = (this->targetPos.z - this->actor.posRot.pos.z) * distFrac; + distFrac = 1.0f / (Actor_WorldDistXYZToPoint(&this->actor, &this->targetPos) + 1.0f); + this->actor.velocity.x = (this->targetPos.x - this->actor.world.pos.x) * distFrac; + this->actor.velocity.y = (this->targetPos.y - this->actor.world.pos.y) * distFrac; + this->actor.velocity.z = (this->targetPos.z - this->actor.world.pos.z) * distFrac; this->speedMod = 0.0f; this->timer = 160; @@ -330,12 +365,12 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { speed.x = fabsf(this->speedMod * this->actor.velocity.x); speed.y = fabsf(this->speedMod * this->actor.velocity.y); speed.z = fabsf(this->speedMod * this->actor.velocity.z); - ready = Math_StepToF(&this->actor.posRot.pos.x, this->targetPos.x, speed.x) & 1; - ready &= Math_StepToF(&this->actor.posRot.pos.y, this->targetPos.y, speed.y); - ready &= Math_StepToF(&this->actor.posRot.pos.z, this->targetPos.z, speed.z); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + ready = Math_StepToF(&this->actor.world.pos.x, this->targetPos.x, speed.x) & 1; + ready &= Math_StepToF(&this->actor.world.pos.y, this->targetPos.y, speed.y); + ready &= Math_StepToF(&this->actor.world.pos.z, this->targetPos.z, speed.z); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); - if (this->collider.tris.base.atFlags & 4) { + if (this->collider.tris.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; Vec3f shieldNorm; Vec3f tempVel; @@ -349,9 +384,9 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { tempVel = this->actor.velocity; Math3D_Vec3fReflect(&tempVel, &shieldNorm, &this->actor.velocity); this->actor.speedXZ = this->speedMod * 0.5f; - this->actor.posRot.rot.y = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); + this->actor.world.rot.y = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); EnHonotrap_SetupFlameVanish(this); - } else if (this->collider.tris.base.atFlags & 2) { + } else if (this->collider.tris.base.atFlags & AT_HIT) { this->actor.velocity.y = this->actor.speedXZ = 0.0f; EnHonotrap_SetupFlameVanish(this); } else if (this->timer <= 0) { @@ -368,7 +403,7 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { this->actionFunc = EnHonotrap_FlameChase; this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.x = this->actor.posRot.rot.y = this->actor.posRot.rot.z = 0; + this->actor.world.rot.x = this->actor.world.rot.y = this->actor.world.rot.z = 0; this->timer = 100; } @@ -376,24 +411,24 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { void EnHonotrap_FlameChase(EnHonotrap* this, GlobalContext* globalCtx) { s32 pad; - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x300); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); Math_StepToF(&this->actor.speedXZ, 3.0f, 0.1f); - this->actor.gravity = (-this->actor.yDistToLink < 10.0f) ? 0.08f : -0.08f; + this->actor.gravity = (-this->actor.yDistToPlayer < 10.0f) ? 0.08f : -0.08f; func_8002D868(&this->actor); if (this->actor.velocity.y > 1.0f) { this->actor.velocity.y = 1.0f; } this->actor.velocity.y *= 0.95f; func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); - if (this->collider.cyl.base.atFlags & 4) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + if (this->collider.cyl.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; Vec3s shieldRot; func_800D20CC(&player->shieldMf, &shieldRot, false); - this->actor.posRot.rot.y = ((shieldRot.y * 2) - this->actor.posRot.rot.y) + 0x8000; + this->actor.world.rot.y = ((shieldRot.y * 2) - this->actor.world.rot.y) + 0x8000; EnHonotrap_SetupFlameVanish(this); - } else if (this->collider.cyl.base.atFlags & 2) { + } else if (this->collider.cyl.base.atFlags & AT_HIT) { this->actor.speedXZ *= 0.1f; this->actor.velocity.y *= 0.1f; EnHonotrap_SetupFlameVanish(this); @@ -414,7 +449,7 @@ void EnHonotrap_FlameVanish(EnHonotrap* this, GlobalContext* globalCtx) { this->actor.scale.z = this->actor.scale.y = this->actor.scale.x; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); if (ready) { Actor_Kill(&this->actor); } @@ -436,17 +471,17 @@ void EnHonotrap_Update(Actor* thisx, GlobalContext* globalCtx) { } else { this->colChkFlags = 0; this->bobPhase += 0x640; - this->actor.shape.unk_08 = (Math_SinS(this->bobPhase) * 1000.0f) + 600.0f; - Actor_SetHeight(&this->actor, 5.0f); + this->actor.shape.yOffset = (Math_SinS(this->bobPhase) * 1000.0f) + 600.0f; + Actor_SetFocus(&this->actor, 5.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } this->actionFunc(this, globalCtx); if (this->actor.params == HONOTRAP_EYE) { - if (this->collider.tris.base.acFlags & 2) { - EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 15, 8); + if (this->collider.tris.base.acFlags & AC_HIT) { + EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.world.pos, &velocity, &accel, 15, 8); Actor_Kill(&this->actor); } else if (this->eyeState < HONOTRAP_EYE_SHUT) { - this->collider.tris.base.acFlags &= ~2; + this->collider.tris.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.tris.base); } } diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index b38efffbdf..a3f77c4029 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -11,7 +11,7 @@ typedef void (*EnHonotrapActionFunc)(struct EnHonotrap*, GlobalContext*); typedef union { struct { ColliderTris tris; - ColliderTrisItem elements[2]; + ColliderTrisElement elements[2]; }; ColliderCylinder cyl; } EnHonotrapCollider; // size = 0xD8 diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 96dfd62c74..e720bfffc3 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06006530; /* const ActorInit En_Horse_InitVars = { ACTOR_EN_HORSE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE, sizeof(EnHorse), @@ -25,6 +25,73 @@ const ActorInit En_Horse_InitVars = { (ActorFunc)EnHorse_Update, (ActorFunc)EnHorse_Draw, }; + +static ColliderCylinderInit D_80A65EAC = { + { + COLTYPE_NONE, + AT_TYPE_PLAYER, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000400, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A65ED8 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80A65F04[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80A65F28 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, + 1, + D_80A65F04, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B2F0.s") diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 2610ea55c4..37dbf6f940 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -18,7 +18,7 @@ void EnHorseGameCheck_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Game_Check_InitVars = { ACTOR_EN_HORSE_GAME_CHECK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHorseGameCheck), diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index 04ead5aaec..fffbeccbd9 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -26,7 +26,7 @@ void func_80A68DB0(EnHorseGanon* this, GlobalContext* globalCtx); const ActorInit En_Horse_Ganon_InitVars = { ACTOR_EN_HORSE_GANON, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_GANON, sizeof(EnHorseGanon), @@ -41,30 +41,53 @@ static AnimationHeader* D_80A691B0[] = { 0x06004AA4, 0x06005264, 0x06005B78, 0x0 static f32 splaySpeeds[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x0A, - 0x0023, - 0x0064, - 0xFE, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; static unk_D_80A69248 D_80A69248[] = { { 0x09B8, 0x0126, 0x0E2C, 0x07 }, { 0x0C11, 0x017A, 0x1269, 0x07 }, { 0x064E, 0xFEFB, 0x1DAC, 0x07 }, @@ -97,7 +120,7 @@ void func_80A686A8(EnHorseGanon* this, GlobalContext* globalCtx) { s16 y; func_80A68660(D_80A69248, this->unk_1EC, &vec); - if (Math3D_Vec3f_DistXYZ(&vec, &this->actor.posRot.pos) <= 400.0f) { + if (Math3D_Vec3f_DistXYZ(&vec, &this->actor.world.pos) <= 400.0f) { this->unk_1EC += 1; if (this->unk_1EC >= 14) { this->unk_1EC = 0; @@ -105,18 +128,18 @@ void func_80A686A8(EnHorseGanon* this, GlobalContext* globalCtx) { } } - tempPos = &this->actor.posRot.pos; - y = Math_Vec3f_Yaw(tempPos, &vec) - this->actor.posRot.rot.y; + tempPos = &this->actor.world.pos; + y = Math_Vec3f_Yaw(tempPos, &vec) - this->actor.world.rot.y; if (y >= 301) { - this->actor.posRot.rot.y += 300; + this->actor.world.rot.y += 300; } else if (y < -300) { - this->actor.posRot.rot.y -= 300; + this->actor.world.rot.y -= 300; } else { - this->actor.posRot.rot.y += y; + this->actor.world.rot.y += y; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; - if (func_8002DB8C(&this->actor, &PLAYER->actor) <= 300.0f) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) <= 300.0f) { if (this->actor.speedXZ < 12.0f) { this->actor.speedXZ += 1.0f; } else { @@ -150,21 +173,21 @@ void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->action = 0; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06008668, &D_06004AA4); this->currentAnimation = 0; Animation_PlayOnce(&this->skin.skelAnime, D_80A691B0[0]); - Collider_InitCylinder(globalCtx, &this->colliderCylinder); - Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); - Collider_InitJntSph(globalCtx, &this->colliderSphere); - Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem); + Collider_InitCylinder(globalCtx, &this->colliderBody); + Collider_SetCylinder(globalCtx, &this->colliderBody, &this->actor, &sCylinderInit); + Collider_InitJntSph(globalCtx, &this->colliderHead); + Collider_SetJntSph(globalCtx, &this->colliderHead, &this->actor, &sJntSphInit, this->headElements); - func_80061ED4(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, 0, &sColChkInfoInit); func_80A68AC4(this); } @@ -172,8 +195,8 @@ void EnHorseGanon_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnHorseGanon* this = THIS; func_800A6888(globalCtx, &this->skin); - Collider_DestroyCylinder(globalCtx, &this->colliderCylinder); - Collider_DestroyJntSph(globalCtx, &this->colliderSphere); + Collider_DestroyCylinder(globalCtx, &this->colliderBody); + Collider_DestroyJntSph(globalCtx, &this->colliderHead); } void func_80A68AC4(EnHorseGanon* this) { @@ -251,14 +274,14 @@ void func_80A68E14(EnHorseGanon* this, GlobalContext* globalCtx) { Vec3f v; s32 temp1; - v.x = Math_SinS(this->actor.shape.rot.y) * 30.0f + this->actor.posRot.pos.x; - v.y = this->actor.posRot.pos.y + 60.0f; - v.z = Math_CosS(this->actor.shape.rot.y) * 30.0f + this->actor.posRot.pos.z; + v.x = Math_SinS(this->actor.shape.rot.y) * 30.0f + this->actor.world.pos.x; + v.y = this->actor.world.pos.y + 60.0f; + v.z = Math_CosS(this->actor.shape.rot.y) * 30.0f + this->actor.world.pos.z; temp_ret = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &col, &temp1, &v); this->unk_1F4 = temp_ret; - this->actor.shape.rot.x = 10430.3779f * Math_FAtan2F(this->actor.posRot.pos.y - temp_ret, 30.0f); + this->actor.shape.rot.x = 10430.3779f * Math_FAtan2F(this->actor.world.pos.y - temp_ret, 30.0f); } void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -267,11 +290,11 @@ void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; + Collider_UpdateCylinder(&this->actor, &this->colliderBody); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderBody.base); } void func_80A68FA8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { @@ -280,21 +303,21 @@ void func_80A68FA8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { EnHorseGanon* this = THIS; s32 index; - for (index = 0; index < this->colliderSphere.count; index++) { - sp4C.x = this->colliderSphere.list[index].dim.modelSphere.center.x; - sp4C.y = this->colliderSphere.list[index].dim.modelSphere.center.y; - sp4C.z = this->colliderSphere.list[index].dim.modelSphere.center.z; + for (index = 0; index < this->colliderHead.count; index++) { + sp4C.x = this->colliderHead.elements[index].dim.modelSphere.center.x; + sp4C.y = this->colliderHead.elements[index].dim.modelSphere.center.y; + sp4C.z = this->colliderHead.elements[index].dim.modelSphere.center.z; - func_800A6408(skin, this->colliderSphere.list[index].dim.joint, &sp4C, &sp40); + func_800A6408(skin, this->colliderHead.elements[index].dim.limb, &sp4C, &sp40); - this->colliderSphere.list[index].dim.worldSphere.center.x = sp40.x; - this->colliderSphere.list[index].dim.worldSphere.center.y = sp40.y; - this->colliderSphere.list[index].dim.worldSphere.center.z = sp40.z; + this->colliderHead.elements[index].dim.worldSphere.center.x = sp40.x; + this->colliderHead.elements[index].dim.worldSphere.center.y = sp40.y; + this->colliderHead.elements[index].dim.worldSphere.center.z = sp40.z; - this->colliderSphere.list[index].dim.worldSphere.radius = - this->colliderSphere.list[index].dim.modelSphere.radius * this->colliderSphere.list[index].dim.scale; + this->colliderHead.elements[index].dim.worldSphere.radius = + this->colliderHead.elements[index].dim.modelSphere.radius * this->colliderHead.elements[index].dim.scale; } - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderHead.base); } void EnHorseGanon_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h index 6d6e7bdda7..5c8edce0e4 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h @@ -19,9 +19,9 @@ typedef struct EnHorseGanon { /* 0x01F0 */ u8 unk_1F0[0x04]; /* 0x01F4 */ f32 unk_1F4; /* 0x01F8 */ u8 unk_1F8[0x04]; - /* 0x01FC */ ColliderCylinder colliderCylinder; - /* 0x0248 */ ColliderJntSph colliderSphere; - /* 0x0268 */ ColliderJntSphItem colliderSphereItem; + /* 0x01FC */ ColliderCylinder colliderBody; + /* 0x0248 */ ColliderJntSph colliderHead; + /* 0x0268 */ ColliderJntSphElement headElements[1]; } EnHorseGanon; // size = 0x02A8 extern const ActorInit En_Horse_Ganon_InitVars; diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 357f006fec..728eea24b0 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -22,7 +22,7 @@ void func_80A6A724(EnHorseLinkChild* this); const ActorInit En_Horse_Link_Child_InitVars = { ACTOR_EN_HORSE_LINK_CHILD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_LINK_CHILD, sizeof(EnHorseLinkChild), @@ -33,19 +33,54 @@ const ActorInit En_Horse_Link_Child_InitVars = { }; static AnimationHeader* sAnimations[] = { 0x060043E4, 0x06004B08, 0x060053F0, 0x0600360C, 0x06002F98 }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 20, 100, 0, { 0, 0, 0 } } + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemInit[] = { - { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 0xD, { { 0, 0, 0 }, 10 }, 100 } } + +static ColliderJntSphElementInit sJntSphElementInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 10 }, 100 }, + }, }; -static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemInit), - sJntSphItemInit }; -static CollisionCheckInfoInit sColCheckInfoInit = { 10, 35, 100, 0xFE }; + +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementInit, +}; + +static CollisionCheckInfoInit sColCheckInfoInit = { 10, 35, 100, MASS_HEAVY }; extern AnimationHeader D_06002F98; extern SkeletonHeader D_06007B20; @@ -112,19 +147,19 @@ void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.005f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; this->action = 1; - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06007B20, &D_06002F98); this->animationIdx = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimations[0]); Collider_InitCylinder(globalCtx, &this->bodyCollider); - Collider_SetCylinder_Set3(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit); Collider_InitJntSph(globalCtx, &this->headCollider); - Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderItems); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColCheckInfoInit); + Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headElements); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColCheckInfoInit); this->unk_1F0 = 0; this->unk_1EC = 0; @@ -141,7 +176,7 @@ void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx) { func_80A69EC0(this); } - this->actor.initPosRot.rot.z = this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.home.rot.z = this->actor.world.rot.z = this->actor.shape.rot.z = 0; } void EnHorseLinkChild_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -189,7 +224,7 @@ void func_80A699FC(EnHorseLinkChild* this, GlobalContext* globalCtx) { f32 distFromLink; s32 newAnimationIdx; - distFromLink = func_8002DB8C(&this->actor, &PLAYER->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); if (SkelAnime_Update(&this->skin.skelAnime)) { if ((distFromLink < 1000.0f) && (distFromLink > 70.0f)) { @@ -222,21 +257,21 @@ void func_80A69C18(EnHorseLinkChild* this, GlobalContext* globalCtx) { s32 newAnimationIdx; if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { - yawDiff = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + yawDiff = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; if (yawDiff > 0x12C) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } if (SkelAnime_Update(&this->skin.skelAnime)) { - distFromLink = func_8002DB8C(&this->actor, &PLAYER->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); if (distFromLink > 1000.0f) { func_80A6993C(this, 0); @@ -284,24 +319,24 @@ void func_80A69F5C(EnHorseLinkChild* this, GlobalContext* globalCtx) { if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { player = PLAYER; - if (Math3D_Vec3f_DistXYZ(&player->actor.posRot.pos, &this->actor.initPosRot.pos) < 250.0f) { + if (Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos) < 250.0f) { yawDiff = player->actor.shape.rot.y; - yawSign = func_8002DA78(&this->actor, &player->actor) > 0 ? 1 : -1; + yawSign = Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0 ? 1 : -1; yawOffset = yawSign << 0xE; yawDiff += yawOffset; } else { - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos) - this->actor.posRot.rot.y; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) - this->actor.world.rot.y; } if (yawDiff > 0x12C) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } @@ -315,7 +350,7 @@ void func_80A6A068(EnHorseLinkChild* this, GlobalContext* globalCtx) { func_80A69F5C(this, globalCtx); player = PLAYER; - distFromLink = func_8002DB8C(&this->actor, &player->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &player->actor); if (gSaveContext.entranceIndex == 0x2AE) { Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, @@ -335,8 +370,8 @@ void func_80A6A068(EnHorseLinkChild* this, GlobalContext* globalCtx) { animationEnded = SkelAnime_Update(&this->skin.skelAnime); if (animationEnded || (this->animationIdx == 1) || (this->animationIdx == 0)) { if (gSaveContext.eventChkInf[1] & 0x20) { - distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.posRot.pos, &this->actor.initPosRot.pos); + distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); + distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos); if (distLinkFromHome > 250.0f) { if (distFromHome >= 300.0f) { newAnimationIdx = 4; @@ -415,10 +450,10 @@ void func_80A6A5A4(EnHorseLinkChild* this, GlobalContext* globalCtx) { func_80A6A724(this); } else { this->actor.speedXZ = 0.0f; - yawDiff = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + yawDiff = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; // 0.7071 = cos(pi/4) if ((Math_CosS(yawDiff) < 0.7071f) && (this->animationIdx == 2)) { - func_8006DD9C(&this->actor, &PLAYER->actor.posRot.pos, 300); + func_8006DD9C(&this->actor, &PLAYER->actor.world.pos, 300); } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -455,17 +490,17 @@ void func_80A6A7D0(EnHorseLinkChild* this, GlobalContext* globalCtx) { if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { if (!this->unk_1E8) { - func_8006DD9C(&this->actor, &player->actor.posRot.pos, 300); + func_8006DD9C(&this->actor, &player->actor.world.pos, 300); } else { - func_8006DD9C(&this->actor, &this->actor.initPosRot.pos, 300); + func_8006DD9C(&this->actor, &this->actor.home.pos, 300); } } if (SkelAnime_Update(&this->skin.skelAnime)) { if (!this->unk_1E8) { - dist = func_8002DB8C(&this->actor, &PLAYER->actor); + dist = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); } else { - dist = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + dist = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); } if (!this->unk_1E8) { @@ -520,14 +555,14 @@ void EnHorseLinkChild_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); - if ((globalCtx->sceneNum == SCENE_SPOT20) && (this->actor.posRot.pos.z < -2400.0f)) { - this->actor.posRot.pos.z = -2400.0f; + if ((globalCtx->sceneNum == SCENE_SPOT20) && (this->actor.world.pos.z < -2400.0f)) { + this->actor.world.pos.z = -2400.0f; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; if ((Rand_ZeroOne() < 0.025f) && (this->unk_1EC == 0)) { this->unk_1EC++; @@ -538,7 +573,7 @@ void EnHorseLinkChild_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); func_80A6948C(this); } @@ -550,15 +585,15 @@ void func_80A6ABF8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { s32 i; for (i = 0; i < this->headCollider.count; i++) { - center.x = this->headCollider.list[i].dim.modelSphere.center.x; - center.y = this->headCollider.list[i].dim.modelSphere.center.y; - center.z = this->headCollider.list[i].dim.modelSphere.center.z; - func_800A6408(skin, this->headCollider.list[i].dim.joint, ¢er, &newCenter); - this->headCollider.list[i].dim.worldSphere.center.x = newCenter.x; - this->headCollider.list[i].dim.worldSphere.center.y = newCenter.y; - this->headCollider.list[i].dim.worldSphere.center.z = newCenter.z; - this->headCollider.list[i].dim.worldSphere.radius = - this->headCollider.list[i].dim.modelSphere.radius * this->headCollider.list[i].dim.scale; + center.x = this->headCollider.elements[i].dim.modelSphere.center.x; + center.y = this->headCollider.elements[i].dim.modelSphere.center.y; + center.z = this->headCollider.elements[i].dim.modelSphere.center.z; + func_800A6408(skin, this->headCollider.elements[i].dim.limb, ¢er, &newCenter); + this->headCollider.elements[i].dim.worldSphere.center.x = newCenter.x; + this->headCollider.elements[i].dim.worldSphere.center.y = newCenter.y; + this->headCollider.elements[i].dim.worldSphere.center.z = newCenter.z; + this->headCollider.elements[i].dim.worldSphere.radius = + this->headCollider.elements[i].dim.modelSphere.radius * this->headCollider.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index 95fd9f75f2..6e64d1408c 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -19,7 +19,7 @@ typedef struct EnHorseLinkChild { /* 0x01F0 */ s32 unk_1F0; /* 0x01F4 */ ColliderCylinder bodyCollider; /* 0x0240 */ ColliderJntSph headCollider; - /* 0x0260 */ ColliderJntSphItem headColliderItems[1]; + /* 0x0260 */ ColliderJntSphElement headElements[1]; /* 0x02A0 */ s32 unk_2A0; } EnHorseLinkChild; // size = 0x02A4 diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 2adf7bd12c..25e6c502a1 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -41,7 +41,7 @@ void func_80A6C6B0(EnHorseNormal* this); const ActorInit En_Horse_Normal_InitVars = { ACTOR_EN_HORSE_NORMAL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_NORMAL, sizeof(EnHorseNormal), @@ -68,31 +68,73 @@ static AnimationHeader* sAnimations[] = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 60, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 11, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemsInit), - sJntSphItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphElementsInit), + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; // Unused static EnHorseNormalUnkStruct1 D_80A6D428[] = { @@ -156,50 +198,50 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; this->action = HORSE_CYCLE_ANIMATIONS; this->animationIdx = 0; Collider_InitCylinder(globalCtx, &this->bodyCollider); Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit1); Collider_InitJntSph(globalCtx, &this->headCollider); - Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderItems); + Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headElements); Collider_InitCylinder(globalCtx, &this->cloneCollider); Collider_SetCylinder(globalCtx, &this->cloneCollider, &this->actor, &sCylinderInit2); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (globalCtx->sceneNum == SCENE_SPOT20) { - if (this->actor.posRot.rot.z == 0 || gSaveContext.nightFlag) { + if (this->actor.world.rot.z == 0 || gSaveContext.nightFlag) { Actor_Kill(&this->actor); return; } if (LINK_IS_CHILD) { if (Flags_GetEventChkInf(0x14)) { - if (this->actor.posRot.rot.z != 3) { + if (this->actor.world.rot.z != 3) { Actor_Kill(&this->actor); return; } - } else if (this->actor.posRot.rot.z != 1) { + } else if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); return; } } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { - if (this->actor.posRot.rot.z != 7) { + if (this->actor.world.rot.z != 7) { Actor_Kill(&this->actor); return; } - } else if (this->actor.posRot.rot.z != 5) { + } else if (this->actor.world.rot.z != 5) { Actor_Kill(&this->actor); return; } - this->actor.initPosRot.rot.z = this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.home.rot.z = this->actor.world.rot.z = this->actor.shape.rot.z = 0; func_800A663C(globalCtx, &this->skin, &D_06009FAC, &D_06004580); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); - if ((this->actor.posRot.pos.x == -730.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1100.0f) || - (this->actor.posRot.pos.x == 880.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1170.0f)) { + if ((this->actor.world.pos.x == -730.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1100.0f) || + (this->actor.world.pos.x == 880.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1170.0f)) { func_80A6C6B0(this); return; } @@ -214,8 +256,8 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { return; } } else if (globalCtx->sceneNum == SCENE_SPOT12) { - if (this->actor.posRot.pos.x == 3707.0f && this->actor.posRot.pos.y == 1413.0f && - this->actor.posRot.pos.z == -665.0f) { + if (this->actor.world.pos.x == 3707.0f && this->actor.world.pos.y == 1413.0f && + this->actor.world.pos.z == -665.0f) { func_800A663C(globalCtx, &this->skin, &D_06009FAC, &D_06004580); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); func_80A6C4CC(this); @@ -261,10 +303,10 @@ void EnHorseNormal_FollowPath(EnHorseNormal* this, GlobalContext* globalCtx) { s32 pad; pointPos += this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 0xA, 0x7D0, 1); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 0xA, 0x7D0, 1); + this->actor.shape.rot.y = this->actor.world.rot.y; if (SQ(dx) + SQ(dz) < 600.0f) { this->waypoint++; if (this->waypoint >= path->count) { @@ -363,9 +405,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, GlobalContext* globalCtx) { this->actor.speedXZ = 8.0f; phi_t0 = 6; } - if (Rand_ZeroOne() < 0.1f || - (this->unk_21E == 0 && (this->actor.bgCheckFlags & 8 || this->bodyCollider.base.maskA & 2 || - this->headCollider.base.maskA & 2))) { + if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & 8) || + (this->bodyCollider.base.ocFlags1 & OC1_HIT) || + (this->headCollider.base.ocFlags1 & OC1_HIT)))) { this->unk_21E += (Rand_ZeroOne() * 30.0f) - 15.0f; if (this->unk_21E > 50) { this->unk_21E = 50; @@ -382,8 +424,8 @@ void EnHorseNormal_Wander(EnHorseNormal* this, GlobalContext* globalCtx) { this->unk_21C = 0; this->unk_21E = 0; } - this->actor.posRot.rot.y += this->unk_21C; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y += this->unk_21C; + this->actor.shape.rot.y = this->actor.world.rot.y; break; case 2: case 3: @@ -520,11 +562,11 @@ void func_80A6C8E0(EnHorseNormal* this, GlobalContext* globalCtx) { Vec3f sp28; s32 sp24; - sp28.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.x; - sp28.y = this->actor.posRot.pos.y + 60.0f; - sp28.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.z; + sp28.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x; + sp28.y = this->actor.world.pos.y + 60.0f; + sp28.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z; this->unk_220 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &sp38, &sp24, &sp28); - this->actor.shape.rot.x = Math_FAtan2F(this->actor.posRot.pos.y - this->unk_220, 30.0f) * (0x8000 / M_PI); + this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->unk_220, 30.0f) * (0x8000 / M_PI); } static EnHorseNormalActionFunc sActionFuncs[] = { @@ -538,20 +580,20 @@ void EnHorseNormal_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 35.0f, 100.0f, 0x1D); - if (globalCtx->sceneNum == SCENE_SPOT20 && this->actor.posRot.pos.z < -2400.0f) { - this->actor.posRot.pos.z = -2400.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 35.0f, 100.0f, 0x1D); + if (globalCtx->sceneNum == SCENE_SPOT20 && this->actor.world.pos.z < -2400.0f) { + this->actor.world.pos.z = -2400.0f; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; this->unk_204 = this->actor.projectedPos; this->unk_204.y += 120.0f; - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if (this->actor.speedXZ == 0.0f) { - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; } } @@ -562,15 +604,15 @@ void func_80A6CAFC(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { s32 i; for (i = 0; i < this->headCollider.count; i++) { - sp4C.x = this->headCollider.list[i].dim.modelSphere.center.x; - sp4C.y = this->headCollider.list[i].dim.modelSphere.center.y; - sp4C.z = this->headCollider.list[i].dim.modelSphere.center.z; - func_800A6408(skin, this->headCollider.list[i].dim.joint, &sp4C, &sp40); - this->headCollider.list[i].dim.worldSphere.center.x = sp40.x; - this->headCollider.list[i].dim.worldSphere.center.y = sp40.y; - this->headCollider.list[i].dim.worldSphere.center.z = sp40.z; - this->headCollider.list[i].dim.worldSphere.radius = - this->headCollider.list[i].dim.modelSphere.radius * this->headCollider.list[i].dim.scale; + sp4C.x = this->headCollider.elements[i].dim.modelSphere.center.x; + sp4C.y = this->headCollider.elements[i].dim.modelSphere.center.y; + sp4C.z = this->headCollider.elements[i].dim.modelSphere.center.z; + func_800A6408(skin, this->headCollider.elements[i].dim.limb, &sp4C, &sp40); + this->headCollider.elements[i].dim.worldSphere.center.x = sp40.x; + this->headCollider.elements[i].dim.worldSphere.center.y = sp40.y; + this->headCollider.elements[i].dim.worldSphere.center.z = sp40.z; + this->headCollider.elements[i].dim.worldSphere.radius = + this->headCollider.elements[i].dim.modelSphere.radius * this->headCollider.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); @@ -616,32 +658,32 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { Mtx* mtx1; Vec3f clonePos = { 0.0f, 0.0f, 0.0f }; s16 cloneRotY; - f32 distFromGround = this->actor.posRot.pos.y - this->actor.groundY; + f32 distFromGround = this->actor.world.pos.y - this->actor.floorHeight; f32 temp_f0_4; if (globalCtx->sceneNum == SCENE_MALON_STABLE) { - if (this->actor.posRot.pos.x == 355.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -245.0f) { + if (this->actor.world.pos.x == 355.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -245.0f) { clonePos.x = 235.0f; clonePos.y = 0.0f; clonePos.z = 100.0f; cloneRotY = 0x7FFF; - } else if (this->actor.posRot.pos.x == 238.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -245.0f) { + } else if (this->actor.world.pos.x == 238.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -245.0f) { clonePos.x = 478.0f; clonePos.y = 0.0f; clonePos.z = 100.0f; cloneRotY = 0x7FFF; } } else if (globalCtx->sceneNum == SCENE_SPOT20) { - if (this->actor.posRot.pos.x == -730.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1100.0f) { + if (this->actor.world.pos.x == -730.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1100.0f) { clonePos.x = 780.0f; clonePos.y = 0.0f; clonePos.z = -80.0f; cloneRotY = 0; - } else if (this->actor.posRot.pos.x == 880.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1170.0f) { + } else if (this->actor.world.pos.x == 880.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1170.0f) { clonePos.x = -1000.0f; clonePos.y = 0.0f; clonePos.z = -70.0f; @@ -651,7 +693,7 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80A6CC88(globalCtx, this, &clonePos); SkinMatrix_SetScaleRotateYRPTranslate(&skinMtx, this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, this->actor.shape.rot.x, cloneRotY, this->actor.shape.rot.z, clonePos.x, - (this->actor.shape.unk_08 * this->actor.scale.y) + clonePos.y, + (this->actor.shape.yOffset * this->actor.scale.y) + clonePos.y, clonePos.z); mtx1 = SkinMatrix_MtxFToNewMtx(globalCtx->state.gfxCtx, &skinMtx); if (mtx1 == NULL) { @@ -667,7 +709,7 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); Matrix_Translate(clonePos.x, clonePos.y, clonePos.z, MTXMODE_NEW); - temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.unk_10; + temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.shadowScale; Matrix_Scale(this->actor.scale.x * temp_f0_4, 1.0f, this->actor.scale.z * temp_f0_4, MTXMODE_APPLY); Matrix_RotateY(cloneRotY * (2.0f * M_PI / 0x10000), MTXMODE_APPLY); mtx2 = Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_horse_normal.c", 2329); diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h index e34efe07ec..b1f21d07ec 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h @@ -26,7 +26,7 @@ typedef struct EnHorseNormal { /* 0x0224 */ char unk_224[0x04]; /* 0x0228 */ ColliderCylinder bodyCollider; /* 0x0274 */ ColliderJntSph headCollider; - /* 0x0294 */ ColliderJntSphItem headColliderItems[1]; + /* 0x0294 */ ColliderJntSphElement headElements[1]; /* 0x02D4 */ ColliderCylinder cloneCollider; /* 0x0320 */ char unk_320[0x04]; /* 0x0324 */ s32 waypoint; diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 18f21b1c67..3c7e2ab6fa 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -21,7 +21,7 @@ void func_80A6DC7C(EnHorseZelda* this); const ActorInit En_Horse_Zelda_InitVars = { ACTOR_EN_HORSE_ZELDA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_ZELDA, sizeof(EnHorseZelda), @@ -35,26 +35,53 @@ static AnimationHeader* sAnimationHeaders[] = { 0x06007148 }; static f32 splaySpeeds[] = { 0.66666666f }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0xA, 0x23, 0x64, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; typedef struct { /* 0x0 */ Vec3s unk_0; @@ -93,24 +120,24 @@ void func_80A6D918(EnHorseZelda* this, GlobalContext* globalCtx) { s16 yawDiff; func_80A6D8D0(D_80A6E240, this->unk_1EC, &sp28); - if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.posRot.pos) <= 400.0f) { + if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.world.pos) <= 400.0f) { this->unk_1EC++; if (this->unk_1EC >= 14) { this->unk_1EC = 0; func_80A6D8D0(D_80A6E240, 0, &sp28); } } - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp28) - this->actor.posRot.rot.y; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &sp28) - this->actor.world.rot.y; if (yawDiff >= 0x12D) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; - if (func_8002DB8C(&this->actor, &PLAYER->actor) <= 300.0f) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) <= 300.0f) { if (this->actor.speedXZ < 12.0f) { this->actor.speedXZ += 1.0f; } else { @@ -129,19 +156,19 @@ void EnHorseZelda_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.0115f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->action = 0; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06006B2C, &D_06007148); this->animationIndex = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[0]); Collider_InitCylinder(globalCtx, &this->colliderCylinder); - Collider_SetCylinder_Set3(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->animationIndex = 0; func_80A6DC7C(this); } @@ -196,11 +223,11 @@ void func_80A6DE38(EnHorseZelda* this, GlobalContext* globalCtx) { Vec3f pos; s32 bgId; - pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 60.0f; - pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 60.0f; + pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z; this->unk_1F4 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &poly, &bgId, &pos); - this->actor.shape.rot.x = Math_FAtan2F(this->actor.posRot.pos.y - this->unk_1F4, 30.0f) * (0x8000 / M_PI); + this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->unk_1F4, 30.0f) * (0x8000 / M_PI); } void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -210,10 +237,10 @@ void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); this->actor.speedXZ = 0.0f; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); } @@ -224,18 +251,18 @@ void func_80A6DFD4(EnHorseZelda* this, GlobalContext* globalCtx, PSkinAwb* skin) s32 i; for (i = 0; i < this->colliderSphere.count; i++) { - sp4C.x = this->colliderSphere.list[i].dim.modelSphere.center.x; - sp4C.y = this->colliderSphere.list[i].dim.modelSphere.center.y; - sp4C.z = this->colliderSphere.list[i].dim.modelSphere.center.z; + sp4C.x = this->colliderSphere.elements[i].dim.modelSphere.center.x; + sp4C.y = this->colliderSphere.elements[i].dim.modelSphere.center.y; + sp4C.z = this->colliderSphere.elements[i].dim.modelSphere.center.z; - func_800A6408(skin, this->colliderSphere.list[i].dim.joint, &sp4C, &sp40); + func_800A6408(skin, this->colliderSphere.elements[i].dim.limb, &sp4C, &sp40); - this->colliderSphere.list[i].dim.worldSphere.center.x = sp40.x; - this->colliderSphere.list[i].dim.worldSphere.center.y = sp40.y; - this->colliderSphere.list[i].dim.worldSphere.center.z = sp40.z; + this->colliderSphere.elements[i].dim.worldSphere.center.x = sp40.x; + this->colliderSphere.elements[i].dim.worldSphere.center.y = sp40.y; + this->colliderSphere.elements[i].dim.worldSphere.center.z = sp40.z; - this->colliderSphere.list[i].dim.worldSphere.radius = - this->colliderSphere.list[i].dim.modelSphere.radius * this->colliderSphere.list[i].dim.scale; + this->colliderSphere.elements[i].dim.worldSphere.radius = + this->colliderSphere.elements[i].dim.modelSphere.radius * this->colliderSphere.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); } diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h index f0e18eae33..49e45b965b 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h @@ -20,7 +20,7 @@ typedef struct EnHorseZelda { /* 0x01F8 */ char unk_1F8[0x4]; /* 0x01FC */ ColliderCylinder colliderCylinder; /* 0x0248 */ ColliderJntSph colliderSphere; - /* 0x0268 */ ColliderJntSphItem colliderSphereItem; + /* 0x0268 */ ColliderJntSphElement colliderSphereItem; } EnHorseZelda; // size = 0x02A8 extern const ActorInit En_Horse_Zelda_InitVars; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 5b94c86cc5..d350c386ae 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -21,7 +21,7 @@ void func_80A6E6B0(EnHs* this, GlobalContext* globalCtx); const ActorInit En_Hs_InitVars = { ACTOR_EN_HS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_HS, sizeof(EnHs), @@ -32,8 +32,22 @@ const ActorInit En_Hs_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 40, 40, 0, { 0, 0, 0 } }, }; @@ -50,12 +64,12 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { EnHs* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006260, &D_060005C0, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); if (LINK_IS_CHILD) { @@ -80,7 +94,7 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { } this->unk_2A8 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnHs_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -98,8 +112,8 @@ s32 func_80A6E53C(EnHs* this, GlobalContext* globalCtx, u16 textId, EnHsActionFu } this->actor.textId = textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToLink < 100.0f)) { + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToPlayer < 100.0f)) { this->unk_2A8 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -209,9 +223,9 @@ void func_80A6E9AC(EnHs* this, GlobalContext* globalCtx) { func_80A6E3A0(this, func_80A6E6D8); } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; this->actor.textId = 0x10B1; - if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToLink < 100.0f)) { + if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToPlayer < 100.0f)) { func_8002F298(&this->actor, globalCtx, 100.0f, 7); } } @@ -221,10 +235,10 @@ void EnHs_Update(Actor* thisx, GlobalContext* globalCtx) { EnHs* this = THIS; s32 pad; - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; } @@ -232,7 +246,7 @@ void EnHs_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->unk_2A8 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A8 &= ~1; } else { Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100); @@ -277,7 +291,7 @@ void EnHs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnHs* this = THIS; if (limbIndex == 9) { - Matrix_MultVec3f(&D_80A6EDFC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A6EDFC, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 24c5b6882d..8686e55957 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -19,7 +19,7 @@ void func_80A6F1A4(EnHs2* this, GlobalContext* globalCtx); const ActorInit En_Hs2_InitVars = { ACTOR_EN_HS2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_HS, sizeof(EnHs2), @@ -30,8 +30,22 @@ const ActorInit En_Hs2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 40, 40, 0, { 0, 0, 0 } }, }; @@ -42,17 +56,17 @@ void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) { EnHs2* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006260, &D_060005C0, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); this->actionFunc = func_80A6F1A4; this->unk_2A8 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -68,8 +82,8 @@ s32 func_80A6F0B4(EnHs2* this, GlobalContext* globalCtx, u16 textId, EnHs2Action } this->actor.textId = textId; - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x2151 && - this->actor.xzDistToLink < 100.0f) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2151 && + this->actor.xzDistToPlayer < 100.0f) { this->unk_2A8 |= 0x1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -98,16 +112,16 @@ void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) { EnHs2* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime) != 0) { this->skelAnime.curFrame = 0.0f; } this->actionFunc(this, globalCtx); if (this->unk_2A8 & 0x1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A8 &= ~1; } else { Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100); @@ -144,7 +158,7 @@ void EnHs2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnHs2* this = THIS; if (limbIndex == 9) { - Matrix_MultVec3f(&D_80A6F4CC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A6F4CC, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index c0f64e11f2..29f40f2890 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -1,3 +1,9 @@ +/* + * File: z_en_hy.c + * Overlay: ovl_En_Hy + * Description: Hylian NPCs + */ + #include "z_en_hy.h" #define FLAGS 0x00000019 @@ -9,18 +15,27 @@ void EnHy_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnHy_Update(Actor* thisx, GlobalContext* globalCtx); void EnHy_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_06000BFC; -extern UNK_TYPE D_06000FE4; -extern UNK_TYPE D_060012E8; -extern UNK_TYPE D_06002160; -extern UNK_TYPE D_0600265C; -extern UNK_TYPE D_060033B4; -extern UNK_TYPE D_06005BC8; +void func_80A70E34(EnHy* this, GlobalContext* globalCtx); +void func_80A7134C(EnHy* this, GlobalContext* globalCtx); +void func_80A71530(EnHy* this, GlobalContext* globalCtx); +void func_80A711B4(EnHy* this, GlobalContext* globalCtx); +void func_80A712C0(EnHy* this, GlobalContext* globalCtx); +void func_80A710F8(EnHy* this, GlobalContext* globalCtx); +void func_80A7127C(EnHy* this, GlobalContext* globalCtx); +void func_80A712B4(EnHy* this, GlobalContext* globalCtx); +void func_80A714C4(EnHy* this, GlobalContext* globalCtx); + +extern AnimationHeader D_06000BFC; +extern AnimationHeader D_06000FE4; +extern AnimationHeader D_060012E8; +extern AnimationHeader D_06002160; +extern AnimationHeader D_0600265C; +extern AnimationHeader D_060033B4; +extern Gfx D_06005BC8[]; -/* const ActorInit En_Hy_InitVars = { ACTOR_EN_HY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHy), @@ -29,71 +44,1038 @@ const ActorInit En_Hy_InitVars = { (ActorFunc)EnHy_Update, (ActorFunc)EnHy_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F5B0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F6C0.s") +static ColliderCylinderInit D_80A71EC0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F744.s") +static CollisionCheckInfoInit2 D_80A71EEC = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F790.s") +static UNK_PTR D_80A71EF8[] = { 0x060005C8, 0x06000DC8, 0x060015C8, NULL }; +static UNK_PTR D_80A71F08[] = { 0x0600057C, 0x0600067C, 0x0600077C, NULL }; +static UNK_PTR D_80A71F18[] = { 0x060004C8, NULL }; +static UNK_PTR D_80A71F20[] = { 0x060005FC, 0x060009FC, 0x06000DFC, NULL }; +static UNK_PTR D_80A71F30[] = { 0x060005FC, 0x060006FC, 0x060007FC, NULL }; +static UNK_PTR D_80A71F40[] = { 0x060007C8, 0x06000FC8, 0x060017C8, NULL }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F7CC.s") +typedef struct { + /* 0x00 */ s16 objectId; + /* 0x04 */ Gfx* dList; + /* 0x08 */ UNK_PTR* unk_8; +} EnHyUnknownStruct1; // size = 0xC -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F810.s") +static EnHyUnknownStruct1 D_80A71F50[] = { + { OBJECT_AOB, 0x06003C88, D_80A71EF8 }, { OBJECT_BOB, 0x06003B78, D_80A71F40 }, + { OBJECT_BOJ, 0x060026F0, D_80A71F30 }, { OBJECT_BOJ, 0x060052E0, NULL }, + { OBJECT_BOJ, 0x06005528, NULL }, { OBJECT_BOJ, 0x06005738, NULL }, + { OBJECT_BOJ, 0x060059B0, NULL }, { OBJECT_AHG, 0x060030F0, D_80A71F08 }, + { OBJECT_AHG, 0x06005508, NULL }, { OBJECT_AHG, 0x06005728, NULL }, + { OBJECT_BBA, 0x06002948, D_80A71F18 }, { OBJECT_CNE, 0x06001300, NULL }, + { OBJECT_CNE, 0x06002860, NULL }, { OBJECT_BJI, 0x06002560, D_80A71F20 }, + { OBJECT_BJI, 0x06003F68, NULL }, { OBJECT_COB, 0x06001300, NULL }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70058.s") +typedef struct { + /* 0x00 */ s16 objectId; + /* 0x04 */ FlexSkeletonHeader* unk_4; +} EnHyUnknownStruct2; // size = 0x8 -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A705A4.s") +static EnHyUnknownStruct2 D_80A72010[] = { + { OBJECT_AOB, 0x060000F0 }, { OBJECT_BOB, 0x060000F0 }, { OBJECT_BOJ, 0x060000F0 }, { OBJECT_AHG, 0x060000F0 }, + { OBJECT_BBA, 0x060000F0 }, { OBJECT_CNE, 0x060000F0 }, { OBJECT_BJI, 0x060000F0 }, { OBJECT_COB, 0x060021F8 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70660.s") +static struct_80034EC0_Entry D_80A72050[] = { + { 0x0600092C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06000228, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x06004CF4, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060016EC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x0600265C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060042AC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x060028DC, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06002160, 1.0f, 0.0f, -1.0f, 0x00, -10.0f }, + { 0x0600265C, 1.0f, 0.0f, -1.0f, 0x00, -10.0f }, { 0x06004E90, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x06001E7C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06000170, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x060000B4, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06003D84, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x060041F8, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x0600300C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x060031B0, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060031B0, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, + { 0x06002D0C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06002DC0, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x06004408, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001F18, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { 0x06004F28, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060033B4, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, + { 0x060012E8, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { 0x06000FE4, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, + { 0x06000BFC, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70698.s") +typedef struct { + /* 0x00 */ u8 unk_0; + /* 0x01 */ u8 unk_1; + /* 0x02 */ Color_RGBA8 unk_2; + /* 0x06 */ u8 unk_6; + /* 0x07 */ Color_RGBA8 unk_7; + /* 0x0B */ u8 unk_B; +} EnHyUnknownStruct3; // size = 0xC -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s") +static EnHyUnknownStruct3 D_80A722D8[] = { + { 0, 0, { 255, 255, 255, 255 }, 0, { 255, 255, 255, 255 }, 0 }, + { 15, 7, { 255, 255, 255, 255 }, 7, { 255, 255, 255, 255 }, 22 }, + { 7, 3, { 255, 255, 255, 255 }, 3, { 255, 255, 255, 255 }, 1 }, + { 3, 2, { 255, 255, 255, 0 }, 2, { 55, 55, 255, 0 }, 15 }, + { 8, 3, { 0, 0, 0, 0 }, 3, { 255, 0, 0, 0 }, 11 }, + { 4, 2, { 50, 80, 0, 0 }, 2, { 50, 80, 0, 0 }, 16 }, + { 10, 4, { 255, 255, 255, 255 }, 4, { 255, 255, 255, 255 }, 10 }, + { 13, 6, { 0, 50, 160, 0 }, 6, { 255, 255, 255, 0 }, 4 }, + { 11, 5, { 160, 180, 255, 0 }, 5, { 160, 180, 255, 0 }, 9 }, + { 2, 2, { 220, 0, 80, 0 }, 2, { 255, 255, 255, 0 }, 13 }, + { 2, 2, { 0, 130, 220, 0 }, 2, { 255, 255, 255, 0 }, 14 }, + { 12, 5, { 70, 160, 230, 0 }, 5, { 255, 255, 100, 0 }, 20 }, + { 5, 2, { 150, 60, 90, 0 }, 2, { 255, 240, 150, 0 }, 18 }, + { 9, 3, { 200, 180, 255, 0 }, 3, { 200, 180, 255, 0 }, 12 }, + { 6, 2, { 140, 255, 110, 0 }, 2, { 255, 255, 255, 0 }, 19 }, + { 14, 6, { 130, 70, 20, 0 }, 6, { 130, 180, 255, 0 }, 21 }, + { 2, 2, { 255, 255, 255, 255 }, 2, { 255, 255, 255, 255 }, 5 }, + { 8, 3, { 90, 100, 20, 255 }, 3, { 100, 140, 50, 255 }, 11 }, + { 1, 1, { 255, 255, 255, 255 }, 1, { 255, 255, 255, 255 }, 6 }, + { 14, 6, { 160, 0, 100, 0 }, 6, { 70, 130, 210, 0 }, 21 }, + { 9, 3, { 160, 230, 0, 0 }, 3, { 0, 150, 110, 0 }, 12 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70834.s") +typedef struct { + /* 0x00 */ Vec3s offset; + /* 0x06 */ s16 radius; + /* 0x08 */ s16 height; +} EnHyUnknownStruct4; // size 0xA -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70978.s") +static EnHyUnknownStruct4 D_80A723D4[] = { + { { 0, 0, 4 }, 24, 70 }, { { 0, 0, 8 }, 28, 62 }, { { 0, 0, 4 }, 20, 60 }, { { 0, 0, 2 }, 20, 60 }, + { { 0, 0, 65534 }, 20, 60 }, { { 0, 0, 8 }, 24, 40 }, { { 0, 0, 10 }, 26, 40 }, { { 0, 0, 12 }, 26, 58 }, + { { 0, 0, 2 }, 18, 68 }, { { 0, 0, 4 }, 20, 60 }, { { 0, 0, 4 }, 20, 60 }, { { 0, 0, 6 }, 20, 64 }, + { { 0, 0, 0 }, 18, 60 }, { { 0, 0, 0 }, 16, 60 }, { { 0, 0, 0 }, 16, 64 }, { { 0, 0, 8 }, 20, 58 }, + { { 4, 0, 0 }, 18, 62 }, { { 4, 0, 0 }, 18, 62 }, { { 0, 0, 8 }, 28, 62 }, { { 0, 0, 0 }, 16, 60 }, + { { 0, 0, 8 }, 20, 58 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70AE4.s") +typedef struct { + /* 0x00 */ u8 unk_0; + /* 0x04 */ f32 unk_4; + /* 0x08 */ f32 unk_8; +} EnHyUnknownStruct5; // size = 0xC -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70BAC.s") +static EnHyUnknownStruct5 D_80A724A8[] = { + { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x07, 40.0f, 20.0f }, { 0x06, 20.0f, 10.0f }, + { 0x07, 40.0f, 20.0f }, { 0x08, 0.0f, -20.0f }, { 0x09, 20.0f, 0.0f }, { 0x09, 20.0f, 0.0f }, + { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, + { 0x00, 0.0f, 0.0f }, { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x0A, 20.0f, 0.0f }, + { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, { 0x06, 20.0f, 10.0f }, + { 0x0A, 20.0f, 0.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C08.s") +typedef struct { + /* 0x00 */ f32 unk_0; + /* 0x04 */ Vec3f unk_4; + /* 0x10 */ f32 unk_10; + /* 0x14 */ s8 unk_14; + /* 0x18 */ f32 unk_18; +} EnHyUnknownStruct6; // size = 0x1C -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70C44.s") +static EnHyUnknownStruct6 D_80A725A4[] = { + { 36.0f, { 0.0f, 0.0f, 600.0f }, 0.01f, 0x06, 30.0f }, { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 0x06, 30.0f }, + { 22.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, { 20.0f, { -100.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, + { 22.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, { 21.0f, { 0.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, + { 25.0f, { -100.0f, 0.0f, 600.0f }, 0.01f, 0x06, 30.0f }, { 28.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 0x06, 30.0f }, + { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, { 18.0f, { 0.0f, 0.0f, 100.0f }, 0.01f, 0x06, 30.0f }, + { 18.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, + { 21.0f, { 0.0f, 0.0f, -300.0f }, 0.01f, 0x06, 30.0f }, { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, + { 18.0f, { -200.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, { 27.0f, { -100.0f, 0.0f, 800.0f }, 0.01f, 0x06, 30.0f }, + { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 0x04, 30.0f }, { 19.0f, { 400.0f, 0.0f, 0.0f }, 0.01f, 0x06, 30.0f }, + { 40.0f, { -100.0f, 0.0f, 400.0f }, 0.01f, 0x06, 30.0f }, { 17.0f, { 0.0f, 0.0f, 700.0f }, 0.01f, 0x06, 30.0f }, + { 20.0f, { 0.0f, 0.0f, -200.0f }, 0.01f, 0x06, 30.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70CD8.s") +s32 func_80A6F5B0(EnHy* this, GlobalContext* globalCtx) { + u8 i2 = D_80A722D8[this->actor.params & 0x7F].unk_0; + u8 i1 = D_80A722D8[this->actor.params & 0x7F].unk_1; + u8 i0 = D_80A722D8[this->actor.params & 0x7F].unk_6; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Init.s") + this->unk_198 = Object_GetIndex(&globalCtx->objectCtx, D_80A72010[i0].objectId); + if (this->unk_198 < 0) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Destroy.s") + this->unk_197 = Object_GetIndex(&globalCtx->objectCtx, D_80A72010[i1].objectId); + if (this->unk_197 < 0) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s") + this->unk_196 = Object_GetIndex(&globalCtx->objectCtx, D_80A71F50[i2].objectId); + if (this->unk_196 < 0) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A710F8.s") + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A711B4.s") +s32 func_80A6F6C0(EnHy* this, GlobalContext* globalCtx) { + if (!Object_IsLoaded(&globalCtx->objectCtx, this->unk_198)) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7127C.s") + if (!Object_IsLoaded(&globalCtx->objectCtx, this->unk_197)) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712B4.s") + if (!Object_IsLoaded(&globalCtx->objectCtx, this->unk_196)) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A712C0.s") + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A7134C.s") +s32 func_80A6F744(EnHy* this, GlobalContext* globalCtx) { + this->unk_199 = Object_GetIndex(&globalCtx->objectCtx, OBJECT_OS_ANIME); + if (this->unk_199 < 0) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A714C4.s") + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71530.s") +s32 func_80A6F790(EnHy* this, GlobalContext* globalCtx) { + if (!Object_IsLoaded(&globalCtx->objectCtx, this->unk_199)) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s") + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A716B8.s") +void func_80A6F7CC(EnHy* this, GlobalContext* globalCtx, s32 getItemId) { + this->unk_260 = getItemId; + func_8002F434(&this->actor, globalCtx, getItemId, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71A64.s") +u16 func_80A6F810(GlobalContext* globalCtx, Actor* thisx) { + Player* player = PLAYER; + EnHy* this = THIS; + u16 textId = Text_GetFaceReaction(globalCtx, (this->actor.params & 0x7F) + 37); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A71BBC.s") + if (textId != 0) { + if ((this->actor.params & 0x7F) == 5) { + player->exchangeItemId = EXCH_ITEM_BLUE_FIRE; + } + return textId; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Draw.s") + switch (this->actor.params & 0x7F) { + case 0: + if (globalCtx->sceneNum == SCENE_KAKARIKO) { + return (this->unk_330 & 0x800) ? 0x508D : ((gSaveContext.infTable[12] & 0x800) ? 0x508C : 0x508B); + } else if (globalCtx->sceneNum == SCENE_MARKET_DAY) { + return (gSaveContext.eventInf[3] & 1) ? 0x709B : 0x709C; + } else if (gSaveContext.dogIsLost) { + s16 dogParam = (gSaveContext.dogParams & 0xF00) >> 8; + if (dogParam) { + this->unk_215 = false; + return (dogParam == 1) ? 0x709F : 0x709E; + } else { + return 0x709D; + } + } else { + return 0x70A0; + } + case 1: + if (gSaveContext.eventChkInf[8] & 1) { + return (gSaveContext.infTable[12] & 2) ? 0x7017 : 0x7045; + } else { + return (gSaveContext.infTable[12] & 1) ? 0x7017 : 0x7016; + } + case 2: + if (globalCtx->sceneNum == SCENE_KAKARIKO) { + return 0x5086; + } else if (globalCtx->sceneNum == SCENE_SPOT01) { + return 0x5085; + } else if (gSaveContext.eventChkInf[8] & 1) { + return (gSaveContext.infTable[12] & 8) ? 0x701A : 0x7047; + } else if (gSaveContext.eventChkInf[1] & 0x10) { + return 0x701A; + } else if (gSaveContext.eventChkInf[1] & 1) { + return 0x701B; + } else if (gSaveContext.infTable[12] & 4) { + return 0x701C; + } else { + return 0x701A; + } + case 3: + return (gSaveContext.eventChkInf[8] & 1) ? ((gSaveContext.infTable[12] & 0x10) ? 0x7001 : 0x70EB) : 0x7001; + case 4: + return (gSaveContext.eventChkInf[8] & 1) ? 0x704B : ((gSaveContext.infTable[12] & 0x20) ? 0x7024 : 0x7023); + case 5: + player->exchangeItemId = EXCH_ITEM_BLUE_FIRE; + return 0x700C; + case 6: + return (gSaveContext.eventChkInf[8] & 1) ? 0x704A : ((gSaveContext.infTable[12] & 0x40) ? 0x7022 : 0x7021); + case 7: + if (globalCtx->sceneNum == SCENE_KAKARIKO) { + return 0x5088; + } else if (globalCtx->sceneNum == SCENE_SPOT01) { + return 0x5087; + } else { + return (gSaveContext.eventChkInf[8] & 1) ? 0x704D + : ((gSaveContext.infTable[12] & 0x80) ? 0x7028 : 0x7027); + } + case 8: + if (gSaveContext.eventChkInf[8] & 1) { + return (gSaveContext.infTable[12] & 0x200) ? 0x701E : 0x7048; + } else { + return (gSaveContext.infTable[12] & 0x100) ? 0x701E : 0x701D; + } + case 9: + if (globalCtx->sceneNum == SCENE_KAKARIKO) { + return (gSaveContext.eventChkInf[10] & 0x400) ? 0x5082 : 0x5081; + } else if (globalCtx->sceneNum == SCENE_SPOT01) { + return CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) ? 0x5080 : 0x507F; + } else { + return (gSaveContext.eventChkInf[8] & 1) ? 0x7049 + : ((gSaveContext.infTable[12] & 0x400) ? 0x7020 : 0x701F); + } + case 10: + if (globalCtx->sceneNum == SCENE_LABO) { + return (gSaveContext.eventChkInf[10] & 0x400) ? 0x507E : 0x507D; + } else if (globalCtx->sceneNum == SCENE_SPOT01) { + return CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) ? 0x507C : 0x507B; + } else { + return (gSaveContext.eventChkInf[8] & 1) ? 0x7046 + : ((gSaveContext.infTable[12] & 0x2000) ? 0x7019 : 0x7018); + } + case 11: + return (gSaveContext.infTable[8] & 0x800) ? ((gSaveContext.infTable[12] & 0x1000) ? 0x7014 : 0x70A4) + : 0x7014; + case 12: + if (globalCtx->sceneNum == SCENE_SPOT01) { + return gSaveContext.nightFlag ? 0x5084 : 0x5083; + } else { + return (gSaveContext.eventChkInf[8] & 1) ? 0x7044 : 0x7015; + } + case 13: + return 0x7055; + case 14: + return 0x7089; + case 15: + return 0x708A; + case 16: + return 0x700E; + case 17: + if (LINK_IS_CHILD) { + if (!gSaveContext.nightFlag) { + return (gSaveContext.infTable[22] & 1) ? 0x5058 : 0x5057; + } else { + return (gSaveContext.infTable[22] & 2) ? 0x505A : 0x5059; + } + } else if (!gSaveContext.nightFlag) { + return (gSaveContext.infTable[22] & 4) ? 0x505C : 0x505B; + } else { + return 0x5058; + } + case 18: + if (LINK_IS_CHILD) { + return (gSaveContext.eventChkInf[8] & 1) ? 0x505F : ((gSaveContext.infTable[22] & 8) ? 0x505E : 0x505D); + } else { + return (this->unk_330 & 0x800) ? 0x5062 : ((gSaveContext.infTable[22] & 0x10) ? 0x5061 : 0x5060); + } + case 19: + return 0x7120; + case 20: + return 0x7121; + default: + return 0; + } +} + +s16 func_80A70058(GlobalContext* globalCtx, Actor* thisx) { + EnHy* this = THIS; + s16 beggarItems[] = { ITEM_BLUE_FIRE, ITEM_FISH, ITEM_BUG, ITEM_FAIRY }; + s16 beggarRewards[] = { 150, 100, 50, 25 }; + + switch (func_8010BDBC(&globalCtx->msgCtx)) { + case 0: + case 1: + case 4: + case 6: + case 7: + case 8: + case 9: + return 1; + case 3: + switch (this->actor.textId) { + case 0x709E: + case 0x709F: + if (!this->unk_215) { + Audio_PlaySoundGeneral(this->actor.textId == 0x709F ? NA_SE_SY_CORRECT_CHIME : NA_SE_SY_ERROR, + &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + this->unk_215 = true; + } + break; + case 0x70F0: + case 0x70F1: + case 0x70F2: + case 0x70F3: + if (this->skelAnime.animation != &D_060033B4) { + func_80034EC0(&this->skelAnime, D_80A72050, 23); + func_800F5C64(0x922); + } + break; + } + return 1; + case 2: + switch (this->actor.textId) { + case 0x70F0: + case 0x70F1: + case 0x70F2: + case 0x70F3: + Rupees_ChangeBy(beggarRewards[this->actor.textId - 0x70F0]); + func_80034EC0(&this->skelAnime, D_80A72050, 17); + Player_UpdateBottleHeld(globalCtx, PLAYER, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + break; + case 0x7016: + gSaveContext.infTable[12] |= 1; + break; + case 0x7045: + gSaveContext.infTable[12] |= 2; + break; + case 0x701B: + gSaveContext.infTable[12] |= 4; + break; + case 0x7047: + gSaveContext.infTable[12] |= 8; + break; + case 0x70EB: + gSaveContext.infTable[12] |= 0x10; + break; + case 0x7023: + gSaveContext.infTable[12] |= 0x20; + break; + case 0x7021: + gSaveContext.infTable[12] |= 0x40; + break; + case 0x7027: + gSaveContext.infTable[12] |= 0x80; + break; + case 0x701D: + gSaveContext.infTable[12] |= 0x100; + break; + case 0x7048: + gSaveContext.infTable[12] |= 0x200; + break; + case 0x701F: + gSaveContext.infTable[12] |= 0x400; + break; + case 0x7018: + gSaveContext.infTable[12] |= 0x2000; + break; + case 0x70A4: + gSaveContext.infTable[12] |= 0x1000; + break; + case 0x5057: + gSaveContext.infTable[22] |= 1; + break; + case 0x5059: + gSaveContext.infTable[22] |= 2; + break; + case 0x505B: + gSaveContext.infTable[22] |= 4; + break; + case 0x505D: + gSaveContext.infTable[22] |= 8; + break; + case 0x5060: + gSaveContext.infTable[22] |= 0x10; + break; + case 0x508B: + gSaveContext.infTable[12] |= 0x800; + break; + case 0x709E: + gSaveContext.dogParams = 0; + break; + case 0x709F: + func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : GI_HEART_PIECE); + this->actionFunc = func_80A714C4; + break; + } + return 0; + case 5: + if (!func_80106BC8(globalCtx)) { + return 1; + } else { + return 2; + } + } + + return 1; +} + +void func_80A705A4(EnHy* this) { + u8 i; + + if (DECR(this->unk_21A) == 0) { + i = D_80A722D8[this->actor.params & 0x7F].unk_0; + this->unk_218++; + if ((D_80A71F50[i].unk_8 != NULL) && (D_80A71F50[i].unk_8[this->unk_218] == NULL)) { + this->unk_21A = Rand_S16Offset(30, 30); + this->unk_218 = 0; + } + } +} + +void func_80A70660(EnHy* this) { + u8 i = this->actor.params & 0x7F; + + this->collider.dim.radius = D_80A723D4[i].radius; + this->collider.dim.height = D_80A723D4[i].height; +} + +void func_80A70698(EnHy* this) { + u8 i = this->actor.params & 0x7F; + + this->actor.shape.shadowScale = D_80A725A4[i].unk_0; + Actor_SetScale(&this->actor, D_80A725A4[i].unk_10); + this->actor.targetMode = D_80A725A4[i].unk_14; + this->unk_264 = D_80A725A4[i].unk_4; + this->unk_25C = D_80A725A4[i].unk_18; + this->unk_25C += this->collider.dim.radius; +} + +void func_80A70734(EnHy* this, GlobalContext* globalCtx) { + Vec3s pos; + + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z = this->actor.world.pos.z; + pos.x += D_80A723D4[this->actor.params & 0x7F].offset.x; + pos.y += D_80A723D4[this->actor.params & 0x7F].offset.y; + pos.z += D_80A723D4[this->actor.params & 0x7F].offset.z; + this->collider.dim.pos = pos; + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); +} + +void func_80A70834(EnHy* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + + if ((this->actor.params & 0x7F) == 5) { + if (!Inventory_HasSpecificBottle(ITEM_BLUE_FIRE) && !Inventory_HasSpecificBottle(ITEM_BUG) && + !Inventory_HasSpecificBottle(ITEM_FISH)) { + switch (func_8002F368(globalCtx)) { + case EXCH_ITEM_POE: + case EXCH_ITEM_BIG_POE: + case EXCH_ITEM_LETTER_RUTO: + this->actor.textId = 0x70EF; + break; + default: + if (Player_GetMask(globalCtx) == PLAYER_MASK_NONE) { + this->actor.textId = 0x70ED; + } + break; + } + } else { + switch (func_8002F368(globalCtx)) { + case EXCH_ITEM_BLUE_FIRE: + this->actor.textId = 0x70F0; + break; + case EXCH_ITEM_FISH: + this->actor.textId = 0x70F1; + break; + case EXCH_ITEM_BUG: + this->actor.textId = 0x70F2; + break; + default: + if (Player_GetMask(globalCtx) == PLAYER_MASK_NONE) { + this->actor.textId = 0x700C; + } + break; + } + } + + player->actor.textId = this->actor.textId; + } +} + +void func_80A70978(EnHy* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + s16 phi_a3; + + switch (this->actor.params & 0x7F) { + case 3: + case 7: + case 9: + case 10: + phi_a3 = (this->unk_1E8.unk_00 == 0) ? 1 : 2; + break; + case 12: + phi_a3 = 1; + break; + case 2: + case 17: + phi_a3 = 4; + break; + case 0: + case 18: + phi_a3 = (this->unk_1E8.unk_00 == 0) ? 2 : 4; + break; + default: + phi_a3 = 2; + break; + } + + this->unk_1E8.unk_18 = player->actor.world.pos; + + if (LINK_IS_ADULT) { + this->unk_1E8.unk_14 = D_80A724A8[this->actor.params & 0x7F].unk_8; + } else { + this->unk_1E8.unk_14 = D_80A724A8[this->actor.params & 0x7F].unk_4; + } + + func_80034A14(&this->actor, &this->unk_1E8, D_80A724A8[this->actor.params & 0x7F].unk_0, phi_a3); + + if (func_800343CC(globalCtx, &this->actor, &this->unk_1E8.unk_00, this->unk_25C, func_80A6F810, func_80A70058)) { + func_80A70834(this, globalCtx); + } +} + +s32 func_80A70AE4(EnHy* this, GlobalContext* globalCtx) { + switch (globalCtx->sceneNum) { + case SCENE_SPOT01: + if (((this->actor.params & 0x7F) != 9) && ((this->actor.params & 0x7F) != 10) && + ((this->actor.params & 0x7F) != 12) && ((this->actor.params & 0x7F) != 2) && + ((this->actor.params & 0x7F) != 7)) { + return true; + } else if (LINK_IS_CHILD) { + return true; + } else if (((this->actor.params & 0x7F) != 12) && (gSaveContext.nightFlag == 1)) { + return false; + } else { + return true; + } + case SCENE_LABO: + if ((this->actor.params & 0x7F) != 10) { + return true; + } else if (gSaveContext.linkAge == 1) { + return false; + } else if (((this->actor.params & 0x7F) == 10) && !gSaveContext.nightFlag) { + return false; + } else { + return true; + } + case SCENE_IMPA: + if ((this->actor.params & 0x7F) != 0) { + return true; + } else if (!gSaveContext.nightFlag) { + return false; + } else { + return true; + } + case SCENE_KAKARIKO: + if ((this->actor.params & 0x7F) == 0) { + return LINK_IS_CHILD ? false : true; + } else if (((this->actor.params & 0x7F) != 9) && ((this->actor.params & 0x7F) != 2) && + ((this->actor.params & 0x7F) != 7)) { + return true; + } else if (!gSaveContext.nightFlag) { + return false; + } else if (gSaveContext.linkAge == 1) { + return false; + } else { + return true; + } + case SCENE_MARKET_ALLEY: + case SCENE_MARKET_ALLEY_N: + if ((this->actor.params & 0x7F) != 14) { + return true; + } else if (gSaveContext.nightFlag == 1) { + return false; + } else if ((gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.eventChkInf[4] & 0x20)) { + return false; + } else { + return true; + } + default: + switch (this->actor.params & 0x7F) { + case 19: + case 20: + if (LINK_IS_ADULT) { + return false; + } + } + return true; + } +} + +void EnHy_Init(Actor* thisx, GlobalContext* globalCtx) { + EnHy* this = THIS; + + if (((this->actor.params & 0x7F) > 20) || !func_80A6F744(this, globalCtx) || !func_80A6F5B0(this, globalCtx)) { + Actor_Kill(&this->actor); + } + + if (!func_80A70AE4(this, globalCtx)) { + Actor_Kill(&this->actor); + } + + this->actionFunc = func_80A70E34; +} + +void EnHy_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnHy* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +void func_80A70E34(EnHy* this, GlobalContext* globalCtx) { + if (func_80A6F790(this, globalCtx) && func_80A6F6C0(this, globalCtx)) { + this->actor.objBankIndex = this->unk_198; + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->actor.objBankIndex].segment); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, D_80A72010[D_80A722D8[this->actor.params & 0x7F].unk_6].unk_4, + NULL, this->jointTable, this->morphTable, 16); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->unk_199].segment); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80A71EC0); + func_80A70660(this); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &D_80A71EEC); + func_80034EC0(&this->skelAnime, D_80A72050, D_80A722D8[this->actor.params & 0x7F].unk_B); + + if ((globalCtx->sceneNum == SCENE_MARKET_ALLEY) || (globalCtx->sceneNum == SCENE_MARKET_DAY)) { + this->actor.flags &= ~0x10; + this->actor.uncullZoneScale = 0.0f; + } + + if (globalCtx->sceneNum == SCENE_KAKARIKO) { + this->unk_330 = gSaveContext.eventChkInf[6]; + } + + func_80A70698(this); + this->path = Path_GetByIndex(globalCtx, (this->actor.params & 0x780) >> 7, 15); + + switch (this->actor.params & 0x7F) { + case 3: + if (this->path != NULL) { + this->actor.speedXZ = 3.0f; + } + this->actionFunc = func_80A711B4; + break; + case 7: + this->unk_195 = false; + this->actionFunc = func_80A712C0; + break; + case 0: + if (globalCtx->sceneNum == SCENE_MARKET_DAY) { + this->actionFunc = func_80A710F8; + break; + } + case 1: + case 2: + case 4: + case 6: + case 8: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + this->actionFunc = func_80A7127C; + break; + case 5: + case 9: + case 10: + case 11: + case 12: + this->actionFunc = func_80A712B4; + break; + default: + Actor_Kill(&this->actor); + break; + } + } +} + +void func_80A710F8(EnHy* this, GlobalContext* globalCtx) { + if (this->unk_1E8.unk_00 != 0) { + if (this->skelAnime.animation != &D_06000BFC) { + func_80034EC0(&this->skelAnime, D_80A72050, 26); + } + } else if (gSaveContext.eventInf[3] & 1) { + if (this->skelAnime.animation != &D_06000FE4) { + func_80034EC0(&this->skelAnime, D_80A72050, 25); + } + } else if (this->skelAnime.animation != &D_060012E8) { + func_80034EC0(&this->skelAnime, D_80A72050, 24); + } +} + +void func_80A711B4(EnHy* this, GlobalContext* globalCtx) { + s16 yaw; + f32 distSq; + + distSq = Path_OrientAndGetDistSq(&this->actor, this->path, this->unk_214, &yaw); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 10, 1000, 1); + this->actor.shape.rot = this->actor.world.rot; + + if ((distSq > 0.0f) && (distSq < 1000.0f)) { + this->unk_214++; + if (this->unk_214 > (this->path->count - 1)) { + this->unk_214 = 0; + } + } +} + +void func_80A7127C(EnHy* this, GlobalContext* globalCtx) { + func_80034F54(globalCtx, this->unk_21C, this->unk_23C, 16); +} + +void func_80A712B4(EnHy* this, GlobalContext* globalCtx) { +} + +void func_80A712C0(EnHy* this, GlobalContext* globalCtx) { + if ((this->actor.xzDistToPlayer <= 100.0f) && (this->path != NULL)) { + func_80034EC0(&this->skelAnime, D_80A72050, 7); + this->actor.speedXZ = 0.4f; + this->actionFunc = func_80A7134C; + } + + func_80034F54(globalCtx, this->unk_21C, this->unk_23C, 16); +} + +void func_80A7134C(EnHy* this, GlobalContext* globalCtx) { + s16 yaw; + f32 distSq; + + if ((this->skelAnime.animation == &D_06002160) && (this->unk_1E8.unk_00 != 0)) { + func_80034EC0(&this->skelAnime, D_80A72050, 8); + } + + if ((this->skelAnime.animation == &D_0600265C) && (this->unk_1E8.unk_00 == 0)) { + func_80034EC0(&this->skelAnime, D_80A72050, 7); + } + + this->actor.speedXZ = 0.4f; + distSq = Path_OrientAndGetDistSq(&this->actor, this->path, this->unk_214, &yaw); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 10, 1000, 1); + this->actor.shape.rot = this->actor.world.rot; + + if (!(distSq <= 0.0f) && !(distSq >= 1000.0f)) { + if (!this->unk_195) { + this->unk_214++; + if (this->unk_214 > (this->path->count - 1)) { + this->unk_195 = true; + this->unk_214 = this->path->count - 2; + } + } else { + this->unk_214--; + if (this->unk_214 < 0) { + this->unk_195 = false; + this->unk_214 = 1; + } + } + } +} + +void func_80A714C4(EnHy* this, GlobalContext* globalCtx) { + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actionFunc = func_80A71530; + } else { + func_8002F434(&this->actor, globalCtx, this->unk_260, this->actor.xzDistToPlayer + 1.0f, + fabsf(this->actor.yDistToPlayer) + 1.0f); + } +} + +void func_80A71530(EnHy* this, GlobalContext* globalCtx) { + if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && func_80106BC8(globalCtx)) { + switch (this->unk_260) { + case GI_HEART_PIECE: + gSaveContext.dogParams = 0; + gSaveContext.dogIsLost = false; + gSaveContext.infTable[25] |= 2; + break; + case GI_RUPEE_BLUE: + Rupees_ChangeBy(5); + gSaveContext.dogParams = 0; + gSaveContext.dogIsLost = false; + break; + } + + this->actionFunc = func_80A7127C; + } +} + +void EnHy_Update(Actor* thisx, GlobalContext* globalCtx) { + EnHy* this = THIS; + + if (this->actionFunc != func_80A70E34) { + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->unk_199].segment); + SkelAnime_Update(&this->skelAnime); + func_80A705A4(this); + + if (this->unk_1E8.unk_00 == 0) { + Actor_MoveForward(&this->actor); + } + + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + } + + this->actionFunc(this, globalCtx); + func_80A70978(this, globalCtx); + func_80A70734(this, globalCtx); +} + +s32 func_80A716B8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { + EnHy* this = THIS; + s32 pad; + Vec3s sp48; + u8 i; + UNK_PTR ptr; + + if (1) {} + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2170); + + if (limbIndex == 15) { + gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_196].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->unk_196].segment); + i = D_80A722D8[this->actor.params & 0x7F].unk_0; + *dList = D_80A71F50[i].dList; + + if (D_80A71F50[i].unk_8 != NULL) { + ptr = D_80A71F50[i].unk_8[this->unk_218]; + gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(ptr)); + } + + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->unk_198].segment); + } + + if (limbIndex == 15) { + Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); + sp48 = this->unk_1E8.unk_08; + Matrix_RotateX((sp48.y / (f32)0x8000) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((sp48.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); + Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); + } + + if (limbIndex == 8) { + sp48 = this->unk_1E8.unk_0E; + Matrix_RotateX((-sp48.y / (f32)0x8000) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((sp48.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); + } + + if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) { + rot->y += Math_SinS(this->unk_21C[limbIndex]) * 200.0f; + rot->z += Math_CosS(this->unk_23C[limbIndex]) * 200.0f; + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2228); + + return 0; +} + +void func_80A71A64(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { + EnHy* this = THIS; + s32 pad; + Vec3f sp3C = { 400.0f, 0.0f, 0.0f }; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2255); + + if (limbIndex == 7) { + gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_197].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->unk_197].segment); + } + + if (((this->actor.params & 0x7F) == 3) && (limbIndex == 8)) { + gSPDisplayList(POLY_OPA_DISP++, D_06005BC8); + } + + if (limbIndex == 15) { + Matrix_MultVec3f(&sp3C, &this->actor.focus.pos); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2281); +} + +Gfx* func_80A71BBC(GraphicsContext* globalCtx, u8 envR, u8 envG, u8 envB, u8 envA) { + Gfx* dList; + + dList = Graph_Alloc(globalCtx, 2 * sizeof(Gfx)); + gDPSetEnvColor(dList, envR, envG, envB, envA); + gSPEndDisplayList(dList + 1); + + return dList; +} + +void EnHy_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnHy* this = THIS; + Color_RGBA8 envColor1; + Color_RGBA8 envColor2; + Color_RGBA8 envColor3; + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2318); + + if (this->actionFunc != func_80A70E34) { + func_80093D18(globalCtx->state.gfxCtx); + Matrix_Translate(this->unk_264.x, this->unk_264.y, this->unk_264.z, MTXMODE_APPLY); + envColor1 = D_80A722D8[this->actor.params & 0x7F].unk_2; + envColor2 = D_80A722D8[this->actor.params & 0x7F].unk_7; + + switch (this->actor.params & 0x7F) { + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 19: + case 20: + gSPSegment(POLY_OPA_DISP++, 0x08, + func_80A71BBC(globalCtx->state.gfxCtx, envColor1.r, envColor1.g, envColor1.b, envColor1.a)); + gSPSegment(POLY_OPA_DISP++, 0x09, + func_80A71BBC(globalCtx->state.gfxCtx, envColor2.r, envColor2.g, envColor2.b, envColor2.a)); + + if (((this->actor.params & 0x7F) == 8) || ((this->actor.params & 0x7F) == 11)) { + if ((this->actor.params & 0x7F) == 8) { + envColor3 = envColor1; + } + if ((this->actor.params & 0x7F) == 11) { + envColor3.r = envColor3.g = envColor3.b = 255; + envColor3.a = 0; + } + gSPSegment( + POLY_OPA_DISP++, 0x0A, + func_80A71BBC(globalCtx->state.gfxCtx, envColor3.r, envColor3.g, envColor3.b, envColor3.a)); + } + break; + } + + SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, func_80A716B8, func_80A71A64, &this->actor); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_hy.c", 2388); +} diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h index c0908015a7..059d860ac1 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -6,9 +6,34 @@ struct EnHy; +typedef void (*EnHyActionFunc)(struct EnHy*, GlobalContext*); + typedef struct EnHy { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x1E8]; + /* 0x014C */ SkelAnime skelAnime; + /* 0x0190 */ EnHyActionFunc actionFunc; + /* 0x0194 */ char unk_194; + /* 0x0195 */ u8 unk_195; + /* 0x0196 */ s8 unk_196; + /* 0x0197 */ s8 unk_197; + /* 0x0198 */ s8 unk_198; + /* 0x0199 */ s8 unk_199; + /* 0x019C */ ColliderCylinder collider; + /* 0x01E8 */ struct_80034A14_arg1 unk_1E8; + /* 0x0210 */ Path* path; + /* 0x0214 */ s8 unk_214; + /* 0x0215 */ s8 unk_215; + /* 0x0216 */ char unk_216[2]; + /* 0x0218 */ s16 unk_218; + /* 0x021A */ s16 unk_21A; + /* 0x021C */ s16 unk_21C[16]; + /* 0x023C */ s16 unk_23C[16]; + /* 0x025C */ f32 unk_25C; + /* 0x0260 */ s32 unk_260; + /* 0x0264 */ Vec3f unk_264; + /* 0x0270 */ Vec3s jointTable[16]; + /* 0x02D0 */ Vec3s morphTable[16]; + /* 0x0330 */ u16 unk_330; } EnHy; // size = 0x0334 extern const ActorInit En_Hy_InitVars; diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 5596843d87..00aae40d96 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -23,7 +23,7 @@ extern Gfx D_0404D4E0[]; const ActorInit En_Ice_Hono_InitVars = { ACTOR_EN_ICE_HONO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnIceHono), @@ -34,20 +34,48 @@ const ActorInit En_Ice_Hono_InitVars = { }; static ColliderCylinderInit sCylinderInitCapturableFlame = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInitDroppedFlame = { - { COLTYPE_UNK10, 0x21, 0x00, 0x21, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_OTHER, + AC_NONE, + OC1_ON | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; static InitChainEntry sInitChainCapturableFlame[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 60, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 60, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), @@ -78,13 +106,13 @@ void EnIceHono_InitCapturableFlame(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChainCapturableFlame); Actor_SetScale(&this->actor, 0.0074f); this->actor.flags |= 1; - Actor_SetHeight(&this->actor, 10.0f); + Actor_SetFocus(&this->actor, 10.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitCapturableFlame); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; EnIceHono_SetupActionCapturableFlame(this); } @@ -95,13 +123,13 @@ void EnIceHono_InitDroppedFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = this->actor.scale.z = this->actor.scale.y = 0.00002f; this->actor.gravity = -0.3f; this->actor.minVelocityY = -4.0f; - this->actor.shape.unk_08 = 0.0f; - this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = this->actor.posRot.rot.x = - this->actor.posRot.rot.y = this->actor.posRot.rot.z = 0; + this->actor.shape.yOffset = 0.0f; + this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = this->actor.world.rot.x = + this->actor.world.rot.y = this->actor.world.rot.z = 0; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitDroppedFlame); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 4000.4f; this->collider.dim.height = this->actor.scale.y * 8000.2f; @@ -116,7 +144,7 @@ void EnIceHono_InitSmallFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = this->actor.scale.z = this->actor.scale.y = 0.0008f; this->actor.gravity = -0.3f; this->actor.minVelocityY = -4.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; EnIceHono_SetupActionSmallFlame(this); } @@ -139,8 +167,8 @@ void EnIceHono_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.params == -1) || (this->actor.params == 0)) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 10, - this->actor.posRot.pos.z, 155, 210, 255, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, (s16)this->actor.world.pos.y + 10, + this->actor.world.pos.z, 155, 210, 255, 0); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); this->unk_154 = Rand_ZeroOne() * (0x1FFFF / 2.0f); this->unk_156 = Rand_ZeroOne() * (0x1FFFF / 2.0f); @@ -161,12 +189,12 @@ void EnIceHono_Destroy(Actor* thisx, GlobalContext* globalCtx) { u32 EnIceHono_LinkCloseAndFacing(EnIceHono* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->actor.xzDistToLink < 60.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { Vec3f tempPos; - tempPos.x = Math_SinS(this->actor.yawTowardsLink + 0x8000) * 40.0f + player->actor.posRot.pos.x; - tempPos.y = player->actor.posRot.pos.y; - tempPos.z = Math_CosS(this->actor.yawTowardsLink + 0x8000) * 40.0f + player->actor.posRot.pos.z; - if (EnIceHono_SquareDist(&tempPos, &this->actor.posRot.pos) <= SQ(40.0f)) { + tempPos.x = Math_SinS(this->actor.yawTowardsPlayer + 0x8000) * 40.0f + player->actor.world.pos.x; + tempPos.y = player->actor.world.pos.y; + tempPos.z = Math_CosS(this->actor.yawTowardsPlayer + 0x8000) * 40.0f + player->actor.world.pos.z; + if (EnIceHono_SquareDist(&tempPos, &this->actor.world.pos) <= SQ(40.0f)) { return 1; } } @@ -176,7 +204,7 @@ u32 EnIceHono_LinkCloseAndFacing(EnIceHono* this, GlobalContext* globalCtx) { void EnIceHono_SetupActionCapturableFlame(EnIceHono* this) { this->actionFunc = EnIceHono_CapturableFlame; this->alpha = 255; - this->actor.shape.unk_08 = -1000.0f; + this->actor.shape.yOffset = -1000.0f; } void EnIceHono_CapturableFlame(EnIceHono* this, GlobalContext* globalCtx) { @@ -186,7 +214,7 @@ void EnIceHono_CapturableFlame(EnIceHono* this, GlobalContext* globalCtx) { func_8002F434(&this->actor, globalCtx, 0x7E, 60.0f, 100.0f); } - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } func_8002F8F0(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); @@ -208,16 +236,16 @@ void EnIceHono_DropFlame(EnIceHono* this, GlobalContext* globalCtx) { if (bgFlag != 0) { s32 i; for (i = 0; i < 8; i++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, ((s32)(Rand_ZeroOne() * 1000.0f) + i * 0x2000) - 0x1F4, 0, 1); } EnIceHono_SetupActionSpreadFlames(this); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 4000.0f; this->collider.dim.height = this->actor.scale.y * 8000.0f; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -243,14 +271,14 @@ void EnIceHono_SpreadFlames(EnIceHono* this, GlobalContext* globalCtx) { } this->actor.scale.z = this->actor.scale.x; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 4); if (this->timer < 25) { this->alpha -= 10; this->alpha = CLAMP(this->alpha, 0, 255); } if ((this->alpha > 100) && (this->timer < 40)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 6000.0f; this->collider.dim.height = this->actor.scale.y * 8000.0f; CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -259,8 +287,8 @@ void EnIceHono_SpreadFlames(EnIceHono* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 10; i++) { s32 rot = i * 0x1999; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, ((s32)(Rand_ZeroOne() * 1000.0f) + rot) - 0x1F4, 0, 2); } } @@ -294,7 +322,7 @@ void EnIceHono_SmallFlameMove(EnIceHono* this, GlobalContext* globalCtx) { this->actor.scale.z = this->actor.scale.x; Math_StepToF(&this->actor.speedXZ, 0, 0.06f); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); if (this->timer < 25) { this->alpha -= 10; @@ -329,8 +357,8 @@ void EnIceHono_Update(Actor* thisx, GlobalContext* globalCtx) { // Translates to: "impossible value(ratio = %f)" osSyncPrintf("ありえない値(ratio = %f)\n", intensity); } - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 10, - this->actor.posRot.pos.z, (s32)(155.0f * intensity), (s32)(210.0f * intensity), + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, (s16)this->actor.world.pos.y + 10, + this->actor.world.pos.z, (s32)(155.0f * intensity), (s32)(210.0f * intensity), (s32)(255.0f * intensity), 1400); } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 0921024ba5..bd87b79e6b 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -81,43 +81,122 @@ extern AnimationHeader D_060203D8; extern FlexSkeletonHeader D_060205C0; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, 0x00, 0x09, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC3FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, 0x00, 0x09, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC3FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, - ARRAY_COUNT(sTrisItemsInit), - sTrisItemsInit, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, + 2, + sTrisElementsInit, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x20000000, 0x00, 0x40 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x40 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -static DamageTable sDamageTable = { { - 0xD0, 0xF2, 0xE1, 0xF2, 0xD0, 0xE2, 0xF2, 0xD0, 0xF1, 0xF2, 0xF4, 0xE2, 0xE2, 0xE2, 0xE2, 0xE2, - 0xEF, 0x60, 0x60, 0x60, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0xFA, 0x00, 0xF4, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0xD), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0xD), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0xD), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(2, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(15, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(10, 0xF), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; void EnIk_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnIk* this = THIS; - if (Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_IK, ACTORTYPE_ENEMY, 8000.0f) == NULL) { + if (Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_IK, ACTORCAT_ENEMY, 8000.0f) == NULL) { func_800F5B58(); } @@ -147,7 +226,7 @@ void func_80A74398(Actor* thisx, GlobalContext* globalCtx) { Collider_SetQuad(globalCtx, &this->axeCollider, thisx, &sQuadInit); thisx->colChkInfo.damageTable = &sDamageTable; - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; this->unk_2FC = 0; thisx->colChkInfo.health = 30; thisx->gravity = -1.0f; @@ -160,7 +239,7 @@ void func_80A74398(Actor* thisx, GlobalContext* globalCtx) { } else { Actor_SetScale(thisx, 0.012f); thisx->naviEnemyId = 53; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_ENEMY); } blureInit.p1StartColor[0] = blureInit.p1StartColor[1] = blureInit.p2StartColor[0] = blureInit.p2StartColor[1] = @@ -200,7 +279,7 @@ s32 func_80A745E4(EnIk* this, GlobalContext* globalCtx) { } Actor* func_80A74674(GlobalContext* globalCtx, Actor* actor) { - Actor* prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + Actor* prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if ((prop == actor) || (prop->id != ACTOR_BG_JYA_IRONOBJ)) { @@ -235,8 +314,8 @@ void func_80A74714(EnIk* this) { void func_80A747C0(EnIk* this, GlobalContext* globalCtx) { Vec3f sp24; - if (this->bodyCollider.base.acFlags & 2) { - sp24 = this->actor.posRot.pos; + if (this->bodyCollider.base.acFlags & AC_HIT) { + sp24 = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); sp24.y += 30.0f; func_8003424C(globalCtx, &sp24); @@ -264,15 +343,16 @@ void func_80A7489C(EnIk* this) { void func_80A7492C(EnIk* this, GlobalContext* globalCtx) { s32 phi_a0 = (this->unk_2FB == 0) ? 0xAAA : 0x3FFC; - s16 yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToLink < 100.0f) && (ABS(this->actor.yDistToLink) < 150.0f)) { + if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToPlayer < 100.0f) && + (ABS(this->actor.yDistToPlayer) < 150.0f)) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { func_80A751C8(this); } - } else if ((ABS(yawDiff) <= 0x4000) && (ABS(this->actor.yDistToLink) < 150.0f)) { + } else if ((ABS(yawDiff) <= 0x4000) && (ABS(this->actor.yDistToPlayer) < 150.0f)) { func_80A74AAC(this); } else { func_80A74AAC(this); @@ -293,7 +373,7 @@ void func_80A74AAC(EnIk* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DASH); this->actor.speedXZ = 2.5f; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnIk_SetupAction(this, func_80A74BA4); } @@ -316,18 +396,17 @@ void func_80A74BA4(EnIk* this, GlobalContext* globalCtx) { sp30 = 2; sp2E = 9; } - temp_a1 = this->actor.wallPolyRot - this->actor.shape.rot.y; + temp_a1 = this->actor.wallYaw - this->actor.shape.rot.y; if ((this->actor.bgCheckFlags & 8) && (ABS(temp_a1) >= 0x4000)) { - temp_a1 = - (this->actor.yawTowardsLink > 0) ? this->actor.wallPolyRot - 0x4000 : this->actor.wallPolyRot + 0x4000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, temp_a1, 1, phi_a3, 0); + temp_a1 = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000; + Math_SmoothStepToS(&this->actor.world.rot.y, temp_a1, 1, phi_a3, 0); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, phi_a3, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, phi_a3, 0); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= temp_t0) && (this->actor.xzDistToLink < 100.0f)) { - if (ABS(this->actor.yDistToLink) < 150.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(yawDiff) <= temp_t0) && (this->actor.xzDistToPlayer < 100.0f)) { + if (ABS(this->actor.yDistToPlayer) < 150.0f) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { @@ -339,7 +418,7 @@ void func_80A74BA4(EnIk* this, GlobalContext* globalCtx) { func_80A751C8(this); this->unk_2FC = 1; } else { - temp_t0 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + temp_t0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(temp_t0) > 0x4000) { this->unk_300--; if (this->unk_300 == 0) { @@ -372,21 +451,21 @@ void func_80A74EBC(EnIk* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == 15.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } else if (this->skelAnime.curFrame == 21.0f) { - sp2C.x = this->actor.posRot.pos.x + Math_SinS(this->actor.shape.rot.y + 0x6A4) * 70.0f; - sp2C.z = this->actor.posRot.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f; - sp2C.y = this->actor.posRot.pos.y; + sp2C.x = this->actor.world.pos.x + Math_SinS(this->actor.shape.rot.y + 0x6A4) * 70.0f; + sp2C.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f; + sp2C.y = this->actor.world.pos.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); - func_80062CD4(globalCtx, &sp2C); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp2C); } if ((this->skelAnime.curFrame > 17.0f) && (this->skelAnime.curFrame < 23.0f)) { this->unk_2FE = 1; } else { if ((this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; } this->unk_2FE = 0; } @@ -447,8 +526,8 @@ void func_80A75260(EnIk* this, GlobalContext* globalCtx) { if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) || ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f))) { if ((this->unk_2FC == 0) && (this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->unk_2FE < 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); @@ -489,8 +568,8 @@ void func_80A754A0(EnIk* this) { } void func_80A75530(EnIk* this, GlobalContext* globalCtx) { - Math_StepUntilS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x7D0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_StepUntilS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x7D0); + this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f)) { if (this->unk_2FE < 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); @@ -518,8 +597,8 @@ void func_80A755F0(EnIk* this) { void func_80A7567C(EnIk* this, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->shieldCollider.base); if (SkelAnime_Update(&this->skelAnime)) { - if ((ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4000) && - (this->actor.xzDistToLink < 100.0f) && (ABS(this->actor.yDistToLink) < 150.0f)) { + if ((ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4000) && + (this->actor.xzDistToPlayer < 100.0f) && (ABS(this->actor.yDistToPlayer) < 150.0f)) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { @@ -535,7 +614,7 @@ void func_80A75790(EnIk* this) { s16 yaw; s16 yawDiff; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->bodyCollider.base.ac->posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyCollider.base.ac->world.pos); this->unk_2F8 = 0; yawDiff = yaw - this->actor.shape.rot.y; if (ABS(yawDiff) <= 0x4000) { @@ -557,7 +636,7 @@ void func_80A758B0(EnIk* this, GlobalContext* globalCtx) { this->unk_308.unk_10 = 0; } if (SkelAnime_Update(&this->skelAnime)) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4000) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4000) { func_80A7489C(this); func_80A745E4(this, globalCtx); } else { @@ -589,13 +668,13 @@ void func_80A75A38(EnIk* this, GlobalContext* globalCtx) { this->unk_2F9--; for (i = 0xC - (this->unk_2F9 >> 1); i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(120.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(120.0f); - pos.y = this->actor.posRot.pos.y + 20.0f + Rand_CenteredFloat(50.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(120.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(120.0f); + pos.y = this->actor.world.pos.y + 20.0f + Rand_CenteredFloat(50.0f); EffectSsDeadDb_Spawn(globalCtx, &pos, &sp7C, &sp7C, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); } if (this->unk_2F9 == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xB0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xB0); if (this->switchFlags != 0xFF) { Flags_SetSwitch(globalCtx, this->switchFlags); } @@ -618,30 +697,30 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { if ((this->unk_2F8 == 3) || (this->unk_2F8 == 2)) { return; } - if (this->shieldCollider.base.acFlags & 0x80) { + if (this->shieldCollider.base.acFlags & AC_BOUNCED) { temp_f0 = Animation_GetLastFrame(&D_0600485C) - 2.0f; if (this->skelAnime.curFrame < temp_f0) { this->skelAnime.curFrame = temp_f0; } - this->shieldCollider.base.acFlags &= ~0x80; - this->bodyCollider.base.acFlags &= ~0x2; + this->shieldCollider.base.acFlags &= ~AC_BOUNCED; + this->bodyCollider.base.acFlags &= ~AC_HIT; return; } - if (!(this->bodyCollider.base.acFlags & 2)) { + if (!(this->bodyCollider.base.acFlags & AC_HIT)) { return; } - sp38 = this->actor.posRot.pos; + sp38 = this->actor.world.pos; sp38.y += 50.0f; - func_80035650(&this->actor, &this->bodyCollider.body, 1); + func_80035650(&this->actor, &this->bodyCollider.info, 1); temp_v0_3 = this->actor.colChkInfo.damageEffect; this->unk_2FD = temp_v0_3 & 0xFF; - this->bodyCollider.base.acFlags &= ~0x2; + this->bodyCollider.base.acFlags &= ~AC_HIT; if (1) {} if ((this->unk_2FD == 0) || (this->unk_2FD == 0xD) || ((this->unk_2FB == 0) && (this->unk_2FD == 0xE))) { if (this->unk_2FD != 0) { - func_80062D60(globalCtx, &sp38); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &sp38); } return; } @@ -654,14 +733,14 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { func_80032E24(&this->unk_308, 3, globalCtx); } } else if (this->actor.colChkInfo.health <= 10) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_BOSS); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_LAST_DAMAGE); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BOSS); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_LAST_DAMAGE); if (this->switchFlags != 0xFF) { Flags_SetSwitch(globalCtx, this->switchFlags); } return; } else if (prevHealth == 50) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } if (this->actor.colChkInfo.health == 0) { @@ -669,9 +748,9 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { func_80032C7C(globalCtx, &this->actor); return; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); if ((this->actor.params == 0) && (Rand_ZeroOne() < 0.5f)) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) > 0x4000) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 0x4000) { func_80A754A0(this); } } @@ -687,7 +766,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { } Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); - func_80062CD4(globalCtx, &sp38); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp38); } void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { @@ -703,8 +782,8 @@ void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { return; } this->actionFunc(this, globalCtx); - if (this->axeCollider.base.atFlags & 2) { - this->axeCollider.base.atFlags &= ~0x2; + if (this->axeCollider.base.atFlags & AT_HIT) { + this->axeCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->axeCollider.base.at) { prevInvincibilityTimer = player->invincibilityTimer; if (player->invincibilityTimer <= 0) { @@ -716,17 +795,17 @@ void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { this->unk_2FE = 0; } } - func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.yawTowardsLink, 8.0f); + func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; } } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 0x1D); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 45.0f; - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 0x1D); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 45.0f; + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); - if ((this->actor.colChkInfo.health > 0) && (this->actor.dmgEffectTimer == 0) && (this->unk_2F8 >= 2)) { + if ((this->actor.colChkInfo.health > 0) && (this->actor.colorFilterTimer == 0) && (this->unk_2F8 >= 2)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } if (this->unk_2FE > 0) { @@ -824,8 +903,8 @@ void EnIk_PostLimbDraw3(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&D_80A7847C[1], &this->axeCollider.dim.quad[0]); Matrix_MultVec3f(&D_80A7847C[2], &this->axeCollider.dim.quad[3]); Matrix_MultVec3f(&D_80A7847C[3], &this->axeCollider.dim.quad[2]); - func_80062734(&this->axeCollider, &this->axeCollider.dim.quad[0], &this->axeCollider.dim.quad[1], - &this->axeCollider.dim.quad[2], &this->axeCollider.dim.quad[3]); + Collider_SetQuadVertices(&this->axeCollider, &this->axeCollider.dim.quad[0], &this->axeCollider.dim.quad[1], + &this->axeCollider.dim.quad[2], &this->axeCollider.dim.quad[3]); Matrix_MultVec3f(&D_80A7847C[0], &spF4); Matrix_MultVec3f(&D_80A7847C[1], &spE8); if (this->unk_2FE > 0) { @@ -840,8 +919,8 @@ void EnIk_PostLimbDraw3(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&D_80A784D0[i], &sp78[i]); } - func_800627A0(&this->shieldCollider, 0, &sp9C[0], &sp9C[1], &sp9C[2]); - func_800627A0(&this->shieldCollider, 1, &sp78[0], &sp78[1], &sp78[2]); + Collider_SetTrisVertices(&this->shieldCollider, 0, &sp9C[0], &sp9C[1], &sp9C[2]); + Collider_SetTrisVertices(&this->shieldCollider, 1, &sp78[0], &sp78[1], &sp78[2]); } } @@ -978,7 +1057,7 @@ void func_80A76E2C(EnIk* this, GlobalContext* globalCtx, Vec3f* pos) { } void func_80A77034(EnIk* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80A7707C(EnIk* this) { @@ -997,10 +1076,10 @@ void func_80A770C0(EnIk* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = EnIk_GetNpcAction(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -1013,7 +1092,7 @@ f32 EnIk_curFrame(Actor* thisx) { void func_80A77148(EnIk* this) { this->action = 0; this->drawMode = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80A77158(EnIk* this, GlobalContext* globalCtx) { @@ -1022,7 +1101,7 @@ void func_80A77158(EnIk* this, GlobalContext* globalCtx) { func_80A770C0(this, globalCtx, 4); this->action = 1; this->drawMode = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A771E4(EnIk* this) { @@ -1031,7 +1110,7 @@ void func_80A771E4(EnIk* this) { this->action = 2; this->drawMode = 1; this->unk_4D4 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77264(EnIk* this, GlobalContext* globalCtx, s32 arg2) { @@ -1050,7 +1129,7 @@ void func_80A772EC(EnIk* this, GlobalContext* globalCtx) { s32 pad[2]; f32 wDest; - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &this->actor.posRot.pos, &D_80A78FA0, &wDest); + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &this->actor.world.pos, &D_80A78FA0, &wDest); Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_DEAD, &D_80A78FA0, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -1064,20 +1143,20 @@ void func_80A7735C(EnIk* this, GlobalContext* globalCtx) { this->drawMode = 2; func_80A770C0(this, globalCtx, 4); func_80A772EC(this, globalCtx); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77434(EnIk* this, GlobalContext* globalCtx) { this->action = 4; this->drawMode = 2; func_80A772A4(this); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77474(EnIk* this, GlobalContext* globalCtx) { this->action = 5; this->drawMode = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80A7748C(EnIk* this, GlobalContext* globalCtx) { @@ -1388,7 +1467,7 @@ void EnIk_Init(Actor* thisx, GlobalContext* globalCtx) { (flag != 0 && Flags_GetSwitch(globalCtx, flag >> 8))) { Actor_Kill(&this->actor); } else { - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0601E178, &D_0600C114, this->jointTable, this->morphTable, 30); func_80A74398(&this->actor, globalCtx); @@ -1398,7 +1477,7 @@ void EnIk_Init(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Ik_InitVars = { ACTOR_EN_IK, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_IK, sizeof(EnIk), diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 082ec8d1bd..22a406ab23 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -28,7 +28,7 @@ typedef struct EnIk { /* 0x0320 */ ColliderCylinder bodyCollider; /* 0x036C */ ColliderQuad axeCollider; /* 0x03EC */ ColliderTris shieldCollider; - /* 0x040C */ ColliderTrisItem shieldColliderItems[2]; + /* 0x040C */ ColliderTrisElement shieldColliderItems[2]; /* 0x04C4 */ s32 blureIdx; /* 0x04C8 */ s32 action; /* 0x04CC */ s32 drawMode; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index afa769c019..1a42e0f51c 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -27,7 +27,7 @@ void func_80A7A4BC(EnIn* this, GlobalContext* globalCtx); const ActorInit En_In_InitVars = { ACTOR_EN_IN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IN, sizeof(EnIn), @@ -38,13 +38,27 @@ const ActorInit En_In_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, + 0, 0, 0, 0, MASS_IMMOVABLE, }; static struct_D_80AA1678 sAnimationInfo[] = { @@ -296,7 +310,7 @@ void func_80A795C8(EnIn* this, GlobalContext* globalCtx) { this->unk_308.unk_18 = globalCtx->view.eye; this->unk_308.unk_14 = 60.0f; } else { - this->unk_308.unk_18 = player->actor.posRot.pos; + this->unk_308.unk_18 = player->actor.world.pos; this->unk_308.unk_14 = 16.0f; } func_80034A14(&this->actor, &this->unk_308, 1, phi_a3); @@ -320,7 +334,7 @@ s32 func_80A7975C(EnIn* this, GlobalContext* globalCtx) { return 0; } this->unk_1E6 = 1; - this->collider.base.maskA &= ~1; + this->collider.base.ocFlags1 &= ~OC1_ON; Animation_Change(&this->skelAnime, D_80A7B918[this->unk_1E6], 1.0f, 0.0f, Animation_GetLastFrame(D_80A7B918[this->unk_1E6]), 2, 0.0f); this->actionFunc = func_80A7A304; @@ -421,23 +435,23 @@ void func_80A79C78(EnIn* this, GlobalContext* globalCtx) { this->camId = Gameplay_CreateSubCamera(globalCtx); Gameplay_ChangeCameraStatus(globalCtx, 0, 1); Gameplay_ChangeCameraStatus(globalCtx, this->camId, 7); - sp48.x = this->actor.posRot.pos.x; - sp48.y = this->actor.posRot.pos.y + 60.0f; - sp48.z = this->actor.posRot.pos.z; + sp48.x = this->actor.world.pos.x; + sp48.y = this->actor.world.pos.y + 60.0f; + sp48.z = this->actor.world.pos.z; sp3C.x = sp48.x; sp3C.y = sp48.y - 22.0f; sp3C.z = sp48.z + 40.0f; Gameplay_CameraSetAtEye(globalCtx, this->camId, &sp48, &sp3C); - this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp3C); + this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &sp3C); this->unk_308.unk_08 = zeroVec; this->unk_308.unk_0E = zeroVec; func_8010B680(globalCtx, 0x2025, NULL); this->unk_308.unk_00 = 1; - player->actor.posRot.pos = this->actor.posRot.pos; - player->actor.posRot.pos.x += 100.0f * Math_SinS(this->actor.shape.rot.y); - player->actor.posRot.pos.z += 100.0f * Math_CosS(this->actor.shape.rot.y); + player->actor.world.pos = this->actor.world.pos; + player->actor.world.pos.x += 100.0f * Math_SinS(this->actor.shape.rot.y); + player->actor.world.pos.z += 100.0f * Math_CosS(this->actor.shape.rot.y); if (player->rideActor != NULL) { - player->rideActor->posRot.pos = player->actor.posRot.pos; + player->rideActor->world.pos = player->actor.world.pos; player->rideActor->freezeTimer = 10; } player->actor.freezeTimer = 10; @@ -480,17 +494,17 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { s32 sp3C = 0; if (Object_IsLoaded(&globalCtx->objectCtx, this->ingoObjBankIndex) || this->actor.params <= 0) { - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013B88, NULL, this->jointTable, this->morphTable, 20); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (func_80A7975C(this, globalCtx)) { gSaveContext.eventInf[0] &= ~0x8000; return; } Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_308.unk_00 = 0; this->actionFunc = func_80A7A4BC; @@ -549,7 +563,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { gSaveContext.eventInf[0] = 0; break; case 1: - this->actor.unk_1F = 3; + this->actor.targetMode = 3; func_80A796EC(this, 2); this->actionFunc = func_80A7A568; func_80088B34(0x3C); @@ -565,7 +579,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { break; case 5: case 6: - this->actor.unk_1F = 3; + this->actor.targetMode = 3; func_80A796EC(this, 6); this->unk_1EC = 8; this->actionFunc = func_80A7AA40; @@ -741,8 +755,8 @@ void func_80A7AA40(EnIn* this, GlobalContext* globalCtx) { this->unk_300 = 50.0f; this->unk_304 = 50.0f; - sp30 = this->actor.posRot.pos; - sp24 = this->actor.posRot.pos; + sp30 = this->actor.world.pos; + sp24 = this->actor.world.pos; sp30.x += this->unk_2F0; sp30.y += this->unk_2F4; @@ -807,8 +821,8 @@ void func_80A7ABD4(EnIn* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->unk_300, 150.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_304, 300.0f, 0.06f, 10000.0f, 0.0f); - sp48 = this->actor.posRot.pos; - sp3C = this->actor.posRot.pos; + sp48 = this->actor.world.pos; + sp3C = this->actor.world.pos; sp48.x += this->unk_2F0; sp48.y += this->unk_2F4; @@ -831,11 +845,11 @@ void func_80A7AE84(EnIn* this, GlobalContext* globalCtx) { void func_80A7AEF0(EnIn* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 yaw; - Vec3f pos = this->actor.posRot.pos; + Vec3f pos = this->actor.world.pos; pos.x += 90.0f * Math_SinS(this->actor.shape.rot.y); pos.z += 90.0f * Math_CosS(this->actor.shape.rot.y); - yaw = Math_Vec3f_Yaw(&pos, &player->actor.posRot.pos); + yaw = Math_Vec3f_Yaw(&pos, &player->actor.world.pos); if (ABS(yaw) > 0x4000) { globalCtx->nextEntranceIndex = 0x0476; globalCtx->sceneLoadFlag = 0x14; @@ -882,14 +896,14 @@ void EnIn_Update(Actor* thisx, GlobalContext* globalCtx) { return; } collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); if (this->actionFunc != func_80A7A304) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.animation == &D_06001BE0 && ((gSaveContext.eventInf[0] & 0xF) != 6)) { func_80A79690(&this->skelAnime, this, globalCtx); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } func_80A79A2C(this); this->actionFunc(this, globalCtx); @@ -899,7 +913,7 @@ void EnIn_Update(Actor* thisx, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) {} } else { func_800343CC(globalCtx, &this->actor, &this->unk_308.unk_00, - ((this->actor.unk_1F == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, func_80A79168, + ((this->actor.targetMode == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, func_80A79168, func_80A79500); if (this->unk_308.unk_00 != 0) { this->unk_1FA = this->unk_1F8; @@ -944,8 +958,8 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_in.c", 2335); if (limbIndex == 16) { - Matrix_MultVec3f(&D_80A7B9A8, &this->actor.posRot2.pos); - this->actor.posRot2.rot = this->actor.posRot.rot; + Matrix_MultVec3f(&D_80A7B9A8, &this->actor.focus.pos); + this->actor.focus.rot = this->actor.world.rot; } if (limbIndex == 12 && this->skelAnime.animation == &D_06014CA8) { gSPDisplayList(POLY_OPA_DISP++, D_06007A20); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 7738180faf..0115319071 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -35,7 +35,7 @@ static s16 D_80A7DEB8 = 0; const ActorInit En_Insect_InitVars = { ACTOR_EN_INSECT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnInsect), @@ -45,15 +45,29 @@ const ActorInit En_Insect_InitVars = { (ActorFunc)EnInsect_Draw, }; -static ColliderJntSphItemInit sColliderItemInit[1] = { +static ColliderJntSphElementInit sColliderItemInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 5 }, 100 }, }, }; static ColliderJntSphInit sColliderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, sColliderItemInit, }; @@ -80,12 +94,12 @@ s32 func_80A7BE6C(EnInsect* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f pos; - if (this->actor.xzDistToLink < 32.0f) { - pos.x = Math_SinS(this->actor.yawTowardsLink + 0x8000) * 16.0f + player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y; - pos.z = Math_CosS(this->actor.yawTowardsLink + 0x8000) * 16.0f + player->actor.posRot.pos.z; + if (this->actor.xzDistToPlayer < 32.0f) { + pos.x = Math_SinS(this->actor.yawTowardsPlayer + 0x8000) * 16.0f + player->actor.world.pos.x; + pos.y = player->actor.world.pos.y; + pos.z = Math_CosS(this->actor.yawTowardsPlayer + 0x8000) * 16.0f + player->actor.world.pos.z; - if (EnInsect_XZDistanceSquared(&pos, &this->actor.posRot.pos) <= 400.0f) { + if (EnInsect_XZDistanceSquared(&pos, &this->actor.world.pos) <= 400.0f) { return 1; } } @@ -109,14 +123,14 @@ s32 EnInsect_FoundNearbySoil(EnInsect* this, GlobalContext* globalCtx) { s32 ret; ret = 0; - currentActor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + currentActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; bestDistance = 6400.0f; this->soilActor = NULL; while (currentActor != NULL) { if (currentActor->id == ACTOR_OBJ_MAKEKINSUTA) { - currentDistance = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, - currentActor->posRot.pos.x, currentActor->posRot.pos.z); + currentDistance = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, + currentActor->world.pos.x, currentActor->world.pos.z); if (currentDistance < bestDistance && currentActor->room == this->actor.room) { ret = 1; @@ -177,12 +191,12 @@ void EnInsect_Init(Actor* thisx, GlobalContext* globalCtx) { } if (temp_s2 == 2) { - this->actor.posRot.rot.z = 0; - this->actor.shape.rot.z = this->actor.posRot.rot.z; + this->actor.world.rot.z = 0; + this->actor.shape.rot.z = this->actor.world.rot.z; for (count = 0; count < 2; count++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 3); if (globalCtx) {} @@ -238,7 +252,7 @@ void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = CLAMP(playSpeed, 0.0f, 1.9f); SkelAnime_Update(&this->skelAnime); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->unk_31A <= 0) { func_80A7C598(this); } @@ -248,7 +262,7 @@ void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) { func_80A7CBC8(this); } else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { func_80A7CE60(this); - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { func_80A7C818(this); } } @@ -268,16 +282,15 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); - if (EnInsect_XZDistanceSquared(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 1600.0f || - (this->unk_31A < 4)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 1600.0f || (this->unk_31A < 4)) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (this->actor.child != NULL && &this->actor != this->actor.child) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.child->posRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.4f, 0.7f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -291,7 +304,7 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) { func_80A7CBC8(this); } else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { func_80A7CE60(this); - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { func_80A7C818(this); } } @@ -309,17 +322,16 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) { s16 pad3; s16 frames; s16 yaw; - s16 sp38 = this->actor.xzDistToLink < 40.0f; + s16 sp38 = this->actor.xzDistToPlayer < 40.0f; Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); - if (EnInsect_XZDistanceSquared(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 25600.0f || - this->unk_31A < 4) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 25600.0f || this->unk_31A < 4) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (sp38 != 0) { frames = globalCtx->state.frames; - yaw = this->actor.yawTowardsLink + 0x8000; + yaw = this->actor.yawTowardsPlayer + 0x8000; if (frames & 0x10) { if (frames & 0x20) { @@ -331,9 +343,9 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) { } } if (globalCtx) {} - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -380,7 +392,7 @@ void func_80A7CBC8(EnInsect* this) { func_80A7BF58(this); this->skelAnime.playSpeed = 1.9f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK); - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); this->actionFunc = func_80A7CC3C; this->unk_314 &= ~0x100; this->unk_314 |= 0x8; @@ -397,9 +409,9 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.0002f, 0.001f)); - this->actor.shape.unk_08 -= 0.8f; - this->actor.posRot.pos.x = Rand_ZeroOne() + this->actor.initPosRot.pos.x - 0.5f; - this->actor.posRot.pos.z = Rand_ZeroOne() + this->actor.initPosRot.pos.z - 0.5f; + this->actor.shape.yOffset -= 0.8f; + this->actor.world.pos.x = Rand_ZeroOne() + this->actor.home.pos.x - 0.5f; + this->actor.world.pos.z = Rand_ZeroOne() + this->actor.home.pos.z - 0.5f; SkelAnime_Update(&this->skelAnime); @@ -407,13 +419,13 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) { velocity.x = Math_SinS(this->actor.shape.rot.y) * -0.6f; velocity.y = Math_SinS(this->actor.shape.rot.x) * 0.6f; velocity.z = Math_CosS(this->actor.shape.rot.y) * -0.6f; - func_800286CC(globalCtx, &this->actor.posRot.pos, &velocity, &accel, Rand_ZeroOne() * 5.0f + 8.0f, + func_800286CC(globalCtx, &this->actor.world.pos, &velocity, &accel, Rand_ZeroOne() * 5.0f + 8.0f, Rand_ZeroOne() * 5.0f + 8.0f); } if (this->unk_31A <= 0) { if ((this->unk_314 & 0x10) && this->soilActor != NULL && - Math3D_Vec3fDistSq(&this->soilActor->actor.posRot.pos, &this->actor.posRot.pos) < 64.0f) { + Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < 64.0f) { this->soilActor->unk_152 = 1; } Actor_Kill(&this->actor); @@ -445,7 +457,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); } this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; this->skelAnime.playSpeed = CLAMP(this->unk_31A * 0.018f, 0.1f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -467,7 +479,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { } this->unk_316 = phi_v0; } - this->actor.posRot.rot.y += this->unk_316; + this->actor.world.rot.y += this->unk_316; temp_v1 = this->skelAnime.playSpeed * 1000.0f; if (this->unk_318 < -temp_v1) { @@ -482,13 +494,13 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += this->unk_318; - Math_ScaledStepToS(&this->actor.posRot.rot.x, 0, 3000); - this->actor.shape.rot.x = this->actor.posRot.rot.x; + Math_ScaledStepToS(&this->actor.world.rot.x, 0, 3000); + this->actor.shape.rot.x = this->actor.world.rot.x; if (Rand_ZeroOne() < 0.03f) { - sp40.x = this->actor.posRot.pos.x; - sp40.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - sp40.z = this->actor.posRot.pos.z; + sp40.x = this->actor.world.pos.x; + sp40.y = this->actor.world.pos.y + this->actor.yDistToWater; + sp40.z = this->actor.world.pos.z; EffectSsGRipple_Spawn(globalCtx, &sp40, 20, 100, 4); EffectSsGRipple_Spawn(globalCtx, &sp40, 40, 200, 8); } @@ -524,7 +536,7 @@ void func_80A7D26C(EnInsect* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.00005f, 0.001f)); if (this->actor.yDistToWater > 5.0f && this->actor.yDistToWater < 30.0f && Rand_ZeroOne() < 0.3f) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f); } if (this->unk_31A <= 0) { @@ -538,7 +550,7 @@ void func_80A7D39C(EnInsect* this) { this->unk_324 = 1.5f; this->unk_328 = Rand_ZeroOne() * 65535.5f; this->unk_316 = (Rand_ZeroOne() - 0.5f) * 1500.0f; - this->actor.posRot.rot.y = Rand_ZeroOne() * 65535.5f; + this->actor.world.rot.y = Rand_ZeroOne() * 65535.5f; Actor_SetScale(&this->actor, 0.003f); this->actionFunc = func_80A7D460; this->unk_314 |= 0x100; @@ -560,7 +572,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { sp3A = this->actor.params & 3; if (this->soilActor != NULL) { - sp40 = Math3D_Vec3fDistSq(&this->actor.posRot.pos, &this->soilActor->actor.posRot.pos); + sp40 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); } else { if (this->unk_314 & 0x10) { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -589,13 +601,13 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } if (this->soilActor != NULL && Rand_ZeroOne() < 0.07f) { - this->actor.initPosRot.pos.x = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.posRot.pos.x; - this->actor.initPosRot.pos.y = thisTemp->soilActor->actor.posRot.pos.y; - this->actor.initPosRot.pos.z = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.posRot.pos.z; + this->actor.home.pos.x = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.world.pos.x; + this->actor.home.pos.y = thisTemp->soilActor->actor.world.pos.y; + this->actor.home.pos.z = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.world.pos.z; } if (D_80A7DEB0 > 0.999f) { - this->unk_328 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->unk_328 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->unk_324 = Rand_ZeroOne() * 0.6f + 0.6f; } else if (Rand_ZeroOne() < 0.07f) { if (this->unk_324 > 1.0f) { @@ -617,23 +629,23 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } sp38 = (Rand_ZeroOne() - 0.5f) * 65535.0f * sp34; - this->unk_328 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos) + sp38; + this->unk_328 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) + sp38; } Actor_SetScale(&this->actor, CLAMP_MAX(thisTemp->actor.scale.x + 0.0008f, 0.01f)); if (this->actor.bgCheckFlags & 1) { Math_SmoothStepToF(&this->actor.speedXZ, this->unk_324, 0.1f, 0.5f, 0.0f); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_328, 2000); - sp50 = Math_ScaledStepToS(&this->actor.posRot.rot.x, 0, 2000); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - this->actor.shape.rot.x = this->actor.posRot.rot.x; + Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_328, 2000); + sp50 = Math_ScaledStepToS(&this->actor.world.rot.x, 0, 2000); + this->actor.shape.rot.y = this->actor.world.rot.y; + this->actor.shape.rot.x = this->actor.world.rot.x; } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); this->actor.speedXZ += (Rand_ZeroOne() - 0.5f) * 0.14f; this->actor.velocity.y += Rand_ZeroOne() * 0.12f; - this->actor.posRot.rot.y += this->unk_316; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y += this->unk_316; + this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.x -= 2000; } @@ -692,7 +704,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } else if (sp50 != 0) { func_80A7C3A0(this); } else if ((sp3A == 2 || sp3A == 3) && (this->unk_314 & 1) && this->unk_31C <= 0 && this->unk_31A <= 0 && - this->actor.groundY < -31990.0f) { + this->actor.floorHeight < -31990.0f) { osSyncPrintf(VT_COL(YELLOW, BLACK)); // BG missing? To do Actor_delete osSyncPrintf("BG 抜け? Actor_delete します(%s %d)\n", "../z_en_mushi.c", 1197); @@ -747,7 +759,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { if (phi_v0 != 0) { phi_v0 |= 0x40; - func_8002E4B4(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0); } if (Actor_HasParent(&this->actor, globalCtx)) { @@ -759,7 +771,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { } else { func_80A7CA64(this); } - } else if (this->actor.xzDistToLink < 50.0f && this->actionFunc != func_80A7CAD0) { + } else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != func_80A7CAD0) { if (!(this->unk_314 & 0x20) && this->unk_31C < 180) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -770,7 +782,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } } @@ -779,6 +791,6 @@ void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); D_80A7DEB4 = 0; } diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index 2d43a0e5d7..6f65cbb90a 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -12,7 +12,7 @@ typedef void (*EnInsectActionFunc)(struct EnInsect*, GlobalContext*); typedef struct EnInsect { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph collider; - /* 0x016C */ ColliderJntSphItem colliderItem; + /* 0x016C */ ColliderJntSphElement colliderItem; /* 0x01AC */ SkelAnime skelAnime; /* 0x01F0 */ Vec3s jointTable[24]; /* 0x0280 */ Vec3s morphTable[24]; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 6263ee1dde..ab23da9c30 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -41,7 +41,7 @@ static s16 sRotSpeedY = 0; const ActorInit En_Ishi_InitVars = { ACTOR_EN_ISHI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(EnIshi), @@ -68,25 +68,46 @@ static EnIshiEffectSpawnFunc sDustSpawnFuncs[] = { EnIshi_SpawnDustSmall, EnIshi static ColliderCylinderInit sCylinderInits[] = { { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 18, -2, { 0, 0, 0 } }, }, { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 55, 70, 0, { 0, 0, 0 } }, } }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; void EnIshi_InitCollider(Actor* thisx, GlobalContext* globalCtx) { EnIshi* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInits[this->actor.params & 1]); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } s32 EnIshi_SnapToFloor(EnIshi* this, GlobalContext* globalCtx, f32 arg2) { @@ -95,13 +116,13 @@ s32 EnIshi_SnapToFloor(EnIshi* this, GlobalContext* globalCtx, f32 arg2) { s32 bgId; f32 floorY; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 30.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 30.0f; + pos.z = this->actor.world.pos.z; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->actor, &pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY + arg2; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + this->actor.world.pos.y = floorY + arg2; + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return true; } else { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -121,9 +142,9 @@ void EnIshi_SpawnFragmentsSmall(EnIshi* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < ARRAY_COUNT(scales); i++) { - pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 8.0f; - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f; - pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f; + pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 8.0f; + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f; + pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f; Math_Vec3f_Copy(&velocity, &this->actor.velocity); if (this->actor.bgCheckFlags & 1) { velocity.x *= 0.8f; @@ -161,9 +182,9 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(scales); i++) { angle += 0x4E20; rand = Rand_ZeroOne() * 10.0f; - pos.x = this->actor.posRot.pos.x + (Math_SinS(angle) * rand); - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() * 40.0f) + 5.0f; - pos.z = this->actor.posRot.pos.z + (Math_CosS(angle) * rand); + pos.x = this->actor.world.pos.x + (Math_SinS(angle) * rand); + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 40.0f) + 5.0f; + pos.z = this->actor.world.pos.z + (Math_CosS(angle) * rand); Math_Vec3f_Copy(&velocity, &thisx->velocity); if (thisx->bgCheckFlags & 1) { velocity.x *= 0.9f; @@ -188,15 +209,15 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) { phi_v0 = 69; phi_v1 = -320; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, phi_v1, phi_v0, 30, 5, 0, scales[i], - 5, 2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, phi_v1, phi_v0, 30, 5, 0, scales[i], 5, + 2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); } } void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx) { Vec3f pos; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); if (this->actor.bgCheckFlags & 1) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; @@ -212,7 +233,7 @@ void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx) { void EnIshi_SpawnDustLarge(EnIshi* this, GlobalContext* globalCtx) { Vec3f pos; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); if (this->actor.bgCheckFlags & 1) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; @@ -235,7 +256,7 @@ void EnIshi_DropCollectible(EnIshi* this, GlobalContext* globalCtx) { dropParams = 0; } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, dropParams << 4); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, dropParams << 4); } } @@ -258,8 +279,8 @@ void EnIshi_SpawnBugs(EnIshi* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); + Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); if (bug == NULL) { break; @@ -293,7 +314,7 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneForward += 1000.0f; } if (this->actor.shape.rot.y == 0) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = Rand_ZeroFloat(0x10000); + this->actor.shape.rot.y = this->actor.world.rot.y = Rand_ZeroFloat(0x10000); } Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, globalCtx); @@ -302,8 +323,8 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - this->actor.shape.unk_08 = D_80A7FA20[type]; + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + this->actor.shape.yOffset = D_80A7FA20[type]; if (!((this->actor.params >> 5) & 1) && !EnIshi_SnapToFloor(this, globalCtx, 0.0f)) { Actor_Kill(&this->actor); return; @@ -329,24 +350,24 @@ void EnIshi_Wait(EnIshi* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnIshi_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, liftSounds[type]); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, liftSounds[type]); if ((this->actor.params >> 4) & 1) { EnIshi_SpawnBugs(this, globalCtx); } - } else if (this->collider.base.acFlags & 2 && (type == ROCK_SMALL) && - this->collider.body.acHitItem->toucher.flags & 0x40000048) { + } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && + this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000048) { EnIshi_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, sBreakSoundDurations[type], sBreakSounds[type]); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], sBreakSounds[type]); sFragmentSpawnFuncs[type](this, globalCtx); sDustSpawnFuncs[type](this, globalCtx); Actor_Kill(&this->actor); - } else if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); - this->collider.base.acFlags &= ~2; + } else if (this->actor.xzDistToPlayer < 600.0f) { + Collider_UpdateCylinder(&this->actor, &this->collider); + this->collider.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 400.0f) { + if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 90.0f) { + if (this->actor.xzDistToPlayer < 90.0f) { if (type == ROCK_LARGE) { func_8002F434(&this->actor, globalCtx, 0, 80.0f, 20.0f); } else { @@ -373,13 +394,13 @@ void EnIshi_LiftedUp(EnIshi* this, GlobalContext* globalCtx) { EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[this->actor.params & 1]); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); } } void EnIshi_SetupFly(EnIshi* this) { - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; if ((this->actor.params & 1) == ROCK_SMALL) { sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; @@ -402,7 +423,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { EnIshi_DropCollectible(this, globalCtx); sFragmentSpawnFuncs[type](this, globalCtx); if (!(this->actor.bgCheckFlags & 0x20)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, sBreakSoundDurations[type], + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], sBreakSounds[type]); sDustSpawnFuncs[type](this, globalCtx); } @@ -411,15 +432,15 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); Quake_SetCountdown(quakeIdx, 7); - func_800AA000(this->actor.xyzDistToLinkSq, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } Actor_Kill(&this->actor); return; } if (this->actor.bgCheckFlags & 0x40) { - contactPos.x = this->actor.posRot.pos.x; - contactPos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - contactPos.z = this->actor.posRot.pos.z; + contactPos.x = this->actor.world.pos.x; + contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater; + contactPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(globalCtx, &contactPos, 0, 0, 0, 350); if (type == ROCK_SMALL) { EffectSsGRipple_Spawn(globalCtx, &contactPos, 150, 650, 0); @@ -433,17 +454,17 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { this->actor.minVelocityY = -6.0f; sRotSpeedX >>= 2; sRotSpeedY >>= 2; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); this->actor.bgCheckFlags &= ~0x40; } - Math_StepToF(&this->actor.shape.unk_08, 0.0f, 2.0f); + Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[type]); func_8002D7EC(&this->actor); this->actor.shape.rot.x += sRotSpeedX; this->actor.shape.rot.y += sRotSpeedY; - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 0ecfb2d2b4..98c2e85007 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -15,18 +15,30 @@ void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnIt_Update(Actor* thisx, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_NO_PUSH, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 10, 0, { 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_It_InitVars = { ACTOR_EN_IT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnIt), @@ -42,7 +54,7 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.params = 0x0D05; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); } void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -55,6 +67,6 @@ void EnIt_Update(Actor* thisx, GlobalContext* globalCtx) { EnIt* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index b38293040e..b18ca9ee37 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_0600BA8C; /* const ActorInit En_Jj_InitVars = { ACTOR_EN_JJ, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_JJ, sizeof(EnJj), @@ -33,6 +33,26 @@ const ActorInit En_Jj_InitVars = { (ActorFunc)EnJj_Update, (ActorFunc)EnJj_Draw, }; + +static ColliderCylinderInit D_80A88CB4 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 170, 150, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87800.s") diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 8b4cdf4de0..3de29128b3 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -19,7 +19,7 @@ void func_80A89304(EnJs* this, GlobalContext* globalCtx); const ActorInit En_Js_InitVars = { ACTOR_EN_JS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_JS, sizeof(EnJs), @@ -30,8 +30,22 @@ const ActorInit En_Js_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -52,13 +66,13 @@ void EnJs_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayOnce(&this->skelAnime, &D_0600045C); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); En_Js_SetupAction(this, func_80A89304); this->unk_284 = 0; this->actor.gravity = -1.0f; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } void EnJs_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -74,9 +88,9 @@ u8 func_80A88F64(EnJs* this, GlobalContext* globalCtx, u16 textId) { return 1; } else { this->actor.textId = textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if (ABS(yawDiff) <= 0x1800 && this->actor.xzDistToLink < 100.0f) { + if (ABS(yawDiff) <= 0x1800 && this->actor.xzDistToPlayer < 100.0f) { this->unk_284 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -158,24 +172,24 @@ void EnJs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; s32 pad2; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->actor.bgCheckFlags & 1) { - if (SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) == 1) { - Math_ApproachF(&this->actor.shape.unk_08, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f); + if (SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1) { + Math_ApproachF(&this->actor.shape.yOffset, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f); } } else { - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, (sREG(81) / 10.0f) + 50.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, (sREG(81) / 10.0f) + 50.0f); } if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; } this->actionFunc(this, globalCtx); if (this->unk_284 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_278, &this->unk_27E, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_278, &this->unk_27E, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_278.x, 0, 6, 0x1838, 0x64); Math_SmoothStepToS(&this->unk_278.y, 0, 6, 0x1838, 0x64); @@ -209,7 +223,7 @@ void EnJs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnJs* this = THIS; if (limbIndex == 12) { - Matrix_MultVec3f(&D_80A896DC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A896DC, &this->actor.focus.pos); } } void EnJs_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index ab1bd8dffa..cfcbd1813c 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -12,7 +12,7 @@ void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Jsjutan_InitVars = { ACTOR_EN_JSJUTAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnJsjutan), diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 59e49753e5..fdd7e6eb57 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -24,8 +24,22 @@ void func_80A8FBB8(EnKakasi* this, GlobalContext* globalCtx); void func_80A8FAA4(EnKakasi* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x04, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -34,7 +48,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi_InitVars = { ACTOR_EN_KAKASI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KA, sizeof(EnKakasi), @@ -55,16 +69,16 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) { EnKakasi* this = THIS; osSyncPrintf("\n\n"); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ Let’s DANCE! ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ Let’s DANCE! ☆☆☆☆☆ %f\n" VT_RST, this->actor.world.pos.y); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_060065B0, &D_06000214, NULL, NULL, 0); - this->rot = this->actor.posRot.rot; + this->rot = this->actor.world.rot; this->actor.flags |= 0x400; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80A8F660; @@ -185,8 +199,8 @@ void func_80A8F660(EnKakasi* this, GlobalContext* globalCtx) { void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 yawTowardsLink; - s16 absyawTowardsLink; + s16 yawTowardsPlayer; + s16 absyawTowardsPlayer; func_80A8F28C(this); SkelAnime_Update(&this->skelanime); @@ -200,11 +214,11 @@ void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { return; } - yawTowardsLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (!(this->actor.xzDistToLink > 120.0f)) { - absyawTowardsLink = ABS(yawTowardsLink); + yawTowardsPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (!(this->actor.xzDistToPlayer > 120.0f)) { + absyawTowardsPlayer = ABS(yawTowardsPlayer); - if (absyawTowardsLink < 0x4300) { + if (absyawTowardsPlayer < 0x4300) { if (!this->unk_194) { if (player->stateFlags2 & 0x1000000) { this->camId = func_800800F8(globalCtx, 0x8D4, -0x63, &this->actor, 0); @@ -216,7 +230,7 @@ void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { this->actionFunc = func_80A8F8D0; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } @@ -313,7 +327,7 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { s32 i; this->unk_198++; - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; for (i = 0; i < ARRAY_COUNT(this->unk_19C); i++) { if (this->unk_19C[i] != 0) { this->unk_19C[i]--; @@ -321,11 +335,11 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { } this->height = 60.0f; - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 428c4980d4..cdf8c80b6f 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -12,8 +12,22 @@ #define THIS ((EnKakasi2*)thisx) static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -33,7 +47,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi2_InitVars = { ACTOR_EN_KAKASI2, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_KA, sizeof(EnKakasi2), @@ -55,11 +69,11 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->switchFlag = this->actor.params & 0x3F; spawnRangeY = (this->actor.params >> 6) & 0xFF; - spawnRangeXZ = this->actor.posRot.rot.z; + spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 4; + this->actor.targetMode = 4; this->maxSpawnDistance.x = (spawnRangeY * 40.0f) + 40.0f; this->maxSpawnDistance.y = (spawnRangeXZ * 40.0f) + 40.0f; @@ -76,7 +90,7 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ SAVE ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); osSyncPrintf("\n\n"); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->height = 60.0f; Actor_SetScale(&this->actor, 0.01f); this->actor.flags |= 0x400; @@ -90,7 +104,7 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_80A9062C; } else { this->actionFunc = func_80A90264; - this->actor.shape.unk_08 = -8000.0f; + this->actor.shape.yOffset = -8000.0f; } } @@ -106,8 +120,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { this->unk_194++; - if ((BREG(1) != 0) && (this->actor.xzDistToLink < this->maxSpawnDistance.x) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y)) { + if ((BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; Collider_InitCylinder(globalCtx, &this->collider); @@ -123,8 +137,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); this->actionFunc = func_80A904D8; - } else if ((this->actor.xzDistToLink < this->maxSpawnDistance.x) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y) && + } else if ((this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y) && (gSaveContext.eventChkInf[9] & 0x1000)) { this->unk_194 = 0; @@ -166,11 +180,11 @@ void func_80A90578(EnKakasi2* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x800; - Math_ApproachZeroF(&this->actor.shape.unk_08, 0.5f, 500.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 0.5f, 500.0f); - if (this->actor.shape.unk_08 > -100.0f) { + if (this->actor.shape.yOffset > -100.0f) { this->actionFunc = func_80A9062C; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -193,34 +207,34 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { EnKakasi2* this = THIS; GlobalContext* globalCtx2 = globalCtx; - this->actor.posRot.rot = this->actor.shape.rot; - Actor_SetHeight(&this->actor, this->height); + this->actor.world.rot = this->actor.shape.rot; + Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, globalCtx2); Actor_MoveForward(&this->actor); - if (this->actor.shape.unk_08 == 0.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + if (this->actor.shape.yOffset == 0.0f) { + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } if (BREG(0) != 0) { if (BREG(5) != 0) { osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->actor.player_distance ☆☆☆☆☆ %f\n" VT_RST, - this->actor.xzDistToLink); + this->actor.xzDistToPlayer); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->hosei.x ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x); osSyncPrintf("\n\n"); } if (this->actor.draw == NULL) { if (this->unk_194 != 0) { if ((this->unk_194 % 2) == 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx2->state.gfxCtx); } } else { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx); } } } diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 8ee621cdbd..407e1a8b0e 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -28,8 +28,22 @@ void func_80A918E4(EnKakasi3* this, GlobalContext* globalCtx); void func_80A91A90(EnKakasi3* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -38,7 +52,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi3_InitVars = { ACTOR_EN_KAKASI3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KA, sizeof(EnKakasi3), @@ -61,14 +75,14 @@ void EnKakasi3_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Translates to: Obonur -- Related to the name of the scarecrow (Bonooru) osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ おーボヌール ☆☆☆☆☆ \n" VT_RST); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060065B0, &D_06000214, NULL, NULL, 0); this->actor.flags |= 0x400; - this->rot = this->actor.posRot.rot; - this->actor.colChkInfo.mass = 0xFF; + this->rot = this->actor.world.rot; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80A911F0; } @@ -218,8 +232,8 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { return; } - angleTowardsLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (!(this->actor.xzDistToLink > 120.0f)) { + angleTowardsLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (!(this->actor.xzDistToPlayer > 120.0f)) { absAngleTowardsLink = ABS(angleTowardsLink); if (absAngleTowardsLink < 0x4300) { @@ -235,7 +249,7 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { this->actionFunc = func_80A915B8; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } else if (gSaveContext.scarecrowSpawnSongSet && !this->unk_195) { @@ -250,7 +264,7 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { this->actionFunc = func_80A9187C; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } @@ -409,18 +423,18 @@ void EnKakasi3_Update(Actor* thisx, GlobalContext* globalCtx) { } this->unk_198++; - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; for (i = 0; i < ARRAY_COUNT(this->unk_19C); i++) { if (this->unk_19C[i] != 0) { this->unk_19C[i]--; } } - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 60c87825b2..6b8a895cb2 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -81,7 +81,7 @@ extern Gfx D_06001630[]; const ActorInit En_Kanban_InitVars = { ACTOR_EN_KANBAN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_KANBAN, sizeof(EnKanban), @@ -92,8 +92,22 @@ const ActorInit En_Kanban_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 50, 5, { 0, 0, 0 } }, }; @@ -185,7 +199,7 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); if (this->actor.params != ENKANBAN_PIECE) { - this->actor.unk_1F = 0; + this->actor.targetMode = 0; this->actor.flags |= 1; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -201,10 +215,10 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { } this->bounceX = 1; this->partFlags = 0xFFFF; - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); EnKanban_SetFloorRot(this); if (gSaveContext.linkAge == 1) { - this->actor.posRot.pos.y -= 15.0f; + this->actor.world.pos.y -= 15.0f; } } } @@ -221,7 +235,7 @@ void EnKanban_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnKanban_Message(EnKanban* this, GlobalContext* globalCtx) { if (!this->msgFlag) { if (this->msgTimer == 0) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x2800) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2800) { if (func_8002F194(&this->actor, globalCtx)) { this->msgFlag = true; } else { @@ -263,19 +277,19 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->partFlags == 0xFFFF) { EnKanban_Message(this, globalCtx); } - if ((this->invincibilityTimer == 0) && (this->collider.base.acFlags & 2)) { - this->collider.base.acFlags &= ~2; + if ((this->invincibilityTimer == 0) && (this->collider.base.acFlags & AC_HIT)) { + this->collider.base.acFlags &= ~AC_HIT; this->invincibilityTimer = 6; piece = (EnKanban*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_KANBAN, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->actor.shape.rot.x, + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, ENKANBAN_PIECE); if (piece != NULL) { - ColliderBody* hitItem = this->collider.body.acHitItem; - s16 yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + ColliderInfo* hitItem = this->collider.info.acHitInfo; + s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; u8 i; - if (hitItem->toucher.flags & 0x700) { + if (hitItem->toucher.dmgFlags & 0x700) { this->cutType = sCutTypes[player->swordAnimation]; } else { this->cutType = CUT_POST; @@ -349,9 +363,9 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateY((this->actor.shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_NEW); Matrix_MultVec3f(&sPieceOffsets[piece->pieceType], &offset); - piece->actor.posRot.pos.x += offset.x; - piece->actor.posRot.pos.y += offset.y; - piece->actor.posRot.pos.z += offset.z; + piece->actor.world.pos.x += offset.x; + piece->actor.world.pos.y += offset.y; + piece->actor.world.pos.z += offset.z; piece->offset.x = -sPieceOffsets[piece->pieceType].x / this->actor.scale.x; piece->offset.y = -sPieceOffsets[piece->pieceType].y / this->actor.scale.x; piece->offset.z = -sPieceOffsets[piece->pieceType].z / this->actor.scale.x; @@ -359,7 +373,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { piece->pieceHeight = sPieceSizes[piece->pieceType].y; piece->actor.gravity = -1.0f; piece->actionState = ENKANBAN_AIR; - piece->actor.posRot.rot.y = (s16)Rand_CenteredFloat(0x3000) + this->actor.yawTowardsLink + 0x8000; + piece->actor.world.rot.y = (s16)Rand_CenteredFloat(0x3000) + this->actor.yawTowardsPlayer + 0x8000; piece->actor.velocity.y = Rand_ZeroFloat(2.0f) + 3.0f; piece->actor.speedXZ = Rand_ZeroFloat(2.0f) + 3.0f; if (piece->partCount >= 4) { @@ -382,12 +396,12 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_STRIKE); } } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 44.0f; - Collider_CylinderUpdate(&this->actor, &this->collider); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 44.0f; + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink > 500.0f) { + if (this->actor.xzDistToPlayer > 500.0f) { this->actor.flags |= 1; this->partFlags = 0xFFFF; } @@ -416,21 +430,21 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { u8 onGround; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 30.0f, 30.0f, 50.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 30.0f, 50.0f, 5); - tempX = this->actor.posRot.pos.x; - tempY = this->actor.posRot.pos.y; - tempZ = this->actor.posRot.pos.z; + tempX = this->actor.world.pos.x; + tempY = this->actor.world.pos.y; + tempZ = this->actor.world.pos.z; tempBgFlags = this->actor.bgCheckFlags; tempYDistToWater = this->actor.yDistToWater; - this->actor.posRot.pos.z += ((this->actor.posRot.pos.y - this->actor.groundY) * -50.0f) / 100.0f; - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); + this->actor.world.pos.z += ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); EnKanban_SetFloorRot(this); - this->actor.posRot.pos.x = tempX; - this->actor.posRot.pos.y = tempY; - this->actor.posRot.pos.z = tempZ; + this->actor.world.pos.x = tempX; + this->actor.world.pos.y = tempY; + this->actor.world.pos.z = tempZ; this->actor.bgCheckFlags = tempBgFlags; this->actor.yDistToWater = tempYDistToWater; @@ -480,15 +494,15 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionState = ENKANBAN_WATER; Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->bounceX = this->bounceZ = 0; - this->actor.posRot.pos.y += this->actor.yDistToWater; - EffectSsGSplash_Spawn(globalCtx, &this->actor.posRot.pos, NULL, NULL, 0, (this->partCount * 20) + 300); - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 150, 650, 0); - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 300, 800, 5); + this->actor.world.pos.y += this->actor.yDistToWater; + EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 150, 650, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 300, 800, 5); this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; osSyncPrintf(" WAT Y = %f\n", this->actor.yDistToWater); - osSyncPrintf(" POS Y = %f\n", this->actor.posRot.pos.y); - osSyncPrintf(" GROUND Y = %f\n", this->actor.groundY); + osSyncPrintf(" POS Y = %f\n", this->actor.world.pos.y); + osSyncPrintf(" GROUND Y = %f\n", this->actor.floorHeight); break; } @@ -496,7 +510,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->bounceCount <= 0) { this->bounceCount++; this->actor.velocity.y *= -0.3f; - this->actor.posRot.rot.y += (s16)Rand_CenteredFloat(16384.0f); + this->actor.world.rot.y += (s16)Rand_CenteredFloat(16384.0f); } else { this->actor.velocity.y = 0.0f; } @@ -547,11 +561,11 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { accel.x = 0.0f; accel.y = 0.1f; accel.z = 0.0f; - pos.y = this->actor.groundY + 3.0f; + pos.y = this->actor.floorHeight + 3.0f; dustCount = this->partCount * 0.5f; for (j = 0; j < dustCount + 3; j++) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); func_800286CC(globalCtx, &pos, &velocity, &accel, 100, 5); } } @@ -566,18 +580,18 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (signpost->partFlags == 0xFFFF) { Actor_Kill(&this->actor); } - Math_ApproachF(&this->actor.shape.unk_08, 100.0f, 1.0f, 5.0f); + Math_ApproachF(&this->actor.shape.yOffset, 100.0f, 1.0f, 5.0f); if (this->actionState == ENKANBAN_WATER) { s32 rippleDelay; s32 rippleScale; - if ((player->actor.speedXZ > 0.0f) && (player->actor.posRot.pos.y < this->actor.posRot.pos.y) && - (this->actor.xyzDistToLinkSq < 2500.0f)) { + if ((player->actor.speedXZ > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) && + (this->actor.xyzDistToPlayerSq < 2500.0f)) { Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 1.0f, 0.2f); if (this->actor.speedXZ > 1.0f) { this->actor.speedXZ = 1.0f; } - if (Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 1, 0x1000, + if (Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1, 0x1000, 0) > 0) { this->spinVel.y = this->actor.speedXZ * 1000.0f; } else { @@ -589,7 +603,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { } Actor_MoveForward(&this->actor); if (this->actor.speedXZ != 0.0f) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 5); if (this->actor.bgCheckFlags & 8) { this->actor.speedXZ *= -0.5f; if (this->spinVel.y > 0) { @@ -622,14 +636,14 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { rippleScale = 200; } - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, rippleScale, rippleScale + 500, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, rippleScale, rippleScale + 500, 0); } - } else if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xyzDistToLinkSq < SQ(100.0f))) { - f32 hammerStrength = (100.0f - sqrtf(this->actor.xyzDistToLinkSq)) * 0.05f; + } else if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xyzDistToPlayerSq < SQ(100.0f))) { + f32 hammerStrength = (100.0f - sqrtf(this->actor.xyzDistToPlayerSq)) * 0.05f; this->actionState = ENKANBAN_AIR; this->actor.gravity = -1.0f; - this->actor.posRot.rot.y = Rand_CenteredFloat(0x10000); + this->actor.world.rot.y = Rand_CenteredFloat(0x10000); if (this->partCount >= 4) { this->bounceX = (s16)Rand_ZeroFloat(10.0f) + 6; this->bounceZ = (s16)Rand_ZeroFloat(10.0f) + 6; @@ -650,7 +664,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { this->airTimer = 70; } if (this->bounceX == 0) { - Actor* bomb = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* bomb = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dx; f32 dy; f32 dz; @@ -660,15 +674,15 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { bomb = bomb->next; continue; } - dx = this->actor.posRot.pos.x - bomb->posRot.pos.x; - dy = this->actor.posRot.pos.y - bomb->posRot.pos.y; - dz = this->actor.posRot.pos.z - bomb->posRot.pos.z; + dx = this->actor.world.pos.x - bomb->world.pos.x; + dy = this->actor.world.pos.y - bomb->world.pos.y; + dz = this->actor.world.pos.z - bomb->world.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 100.0f) { f32 bombStrength = (100.0f - sqrtf(SQ(dx) + SQ(dy) + SQ(dz))) * 0.05f; this->actionState = ENKANBAN_AIR; this->actor.gravity = -1.0f; - this->actor.posRot.rot.y = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); + this->actor.world.rot.y = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); if (this->partCount >= 4) { this->bounceX = (s16)Rand_ZeroFloat(10.0f) + 6; this->bounceZ = (s16)Rand_ZeroFloat(10.0f) + 6; @@ -725,12 +739,12 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateY((signpost->actor.shape.rot.y / 32768.0f) * 3.1415927f, MTXMODE_NEW); Matrix_MultVec3f(&sPieceOffsets[this->pieceType], &offset); - distX = Math_SmoothStepToF(&this->actor.posRot.pos.x, signpost->actor.posRot.pos.x + offset.x, 1.0f, 3.0f, - 0.0f); - distY = Math_SmoothStepToF(&this->actor.posRot.pos.y, signpost->actor.posRot.pos.y + offset.y, 1.0f, 3.0f, - 0.0f); - distZ = Math_SmoothStepToF(&this->actor.posRot.pos.z, signpost->actor.posRot.pos.z + offset.z, 1.0f, 3.0f, - 0.0f); + distX = + Math_SmoothStepToF(&this->actor.world.pos.x, signpost->actor.world.pos.x + offset.x, 1.0f, 3.0f, 0.0f); + distY = + Math_SmoothStepToF(&this->actor.world.pos.y, signpost->actor.world.pos.y + offset.y, 1.0f, 3.0f, 0.0f); + distZ = + Math_SmoothStepToF(&this->actor.world.pos.z, signpost->actor.world.pos.z + offset.z, 1.0f, 3.0f, 0.0f); pDiff = Math_SmoothStepToS(&this->actor.shape.rot.x, signpost->actor.shape.rot.x, 1, 0x200, 0); yDiff = Math_SmoothStepToS(&this->actor.shape.rot.y, signpost->actor.shape.rot.y, 1, 0x200, 0); rDiff = Math_SmoothStepToS(&this->actor.shape.rot.z, signpost->actor.shape.rot.z, 1, 0x200, 0); @@ -738,7 +752,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachS(&this->spinRot.z, 0, 1, 0x200); Math_ApproachZeroF(&this->floorRot.x, 1.0f, 0.05f); Math_ApproachZeroF(&this->floorRot.z, 1.0f, 0.05f); - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, 2.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, 2.0f); if (((distX + distY + distZ) == 0.0f) && ((pDiff + yDiff + rDiff + this->spinRot.x + this->spinRot.z) == 0) && (this->floorRot.x == 0.0f) && (this->floorRot.z == 0.0f)) { @@ -801,11 +815,11 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, D_06000C30); if (this->actionState != ENKANBAN_SIGN) { - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateX(this->floorRot.x, MTXMODE_APPLY); Matrix_RotateZ(this->floorRot.z, MTXMODE_APPLY); - Matrix_Translate(0.0f, this->actor.shape.unk_08, 0.0f, MTXMODE_APPLY); + Matrix_Translate(0.0f, this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); Matrix_RotateY((this->actor.shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_APPLY); Matrix_RotateX((this->actor.shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); zShift = fabsf(Math_SinS(this->spinRot.x) * this->pieceHeight); @@ -851,7 +865,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { } } if ((this->actor.projectedPos.z <= 400.0f) && (this->actor.projectedPos.z > 0.0f) && - (this->actor.groundY > -3000.0f)) { + (this->actor.floorHeight > -3000.0f)) { if ((this->bounceX != 0) || (this->bounceZ != 0)) { u16 dayTime = gSaveContext.dayTime; f32 shadowAlpha; @@ -868,10 +882,10 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { if ((this->actionState == ENKANBAN_SIGN) && (gSaveContext.linkAge == 1)) { zShift = 0.0f; } else { - zShift = ((this->actor.posRot.pos.y - this->actor.groundY) * -50.0f) / 100.0f; + zShift = ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.groundY, this->actor.posRot.pos.z + zShift, + Matrix_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z + zShift, MTXMODE_NEW); Matrix_RotateX(this->floorRot.x, MTXMODE_APPLY); Matrix_RotateZ(this->floorRot.z, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 0ef89bf56a..7bc1f9e501 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -31,7 +31,7 @@ void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx); const ActorInit En_Karebaba_InitVars = { ACTOR_EN_KAREBABA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUBABA, sizeof(EnKarebaba), @@ -42,22 +42,50 @@ const ActorInit En_Karebaba_InitVars = { }; static ColliderCylinderInit sBodyColliderInit = { - { 0xC, 0, 9, 0, 0x10, COLSHAPE_CYLINDER }, - { 0, { 0x00000000, 0, 0 }, { ~0x00300000, 0, 0 }, 0, 1, 0 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 7, 25, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sHeadColliderInit = { - { 0x0C, 0x11, 0, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0, { ~0x00300000, 0, 8 }, { 0x00000000, 0, 0 }, 9, 0, 1 }, + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_NONE, + OCELEM_ON, + }, { 4, 25, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, 0xFE }; +static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, MASS_HEAVY }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2500, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 9, ICHAIN_STOP), }; @@ -73,15 +101,15 @@ void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) { EnKarebaba* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 22.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002A40, &D_060002B8, this->jointTable, this->morphTable, 8); Collider_InitCylinder(globalCtx, &this->bodyCollider); Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyColliderInit); - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); Collider_InitCylinder(globalCtx, &this->headCollider); Collider_SetCylinder(globalCtx, &this->headCollider, &this->actor, &sHeadColliderInit); - Collider_CylinderUpdate(&this->actor, &this->headCollider); - func_80061ED4(&this->actor.colChkInfo, DamageTable_Get(1), &sColCheckInfoInit); + Collider_UpdateCylinder(&this->actor, &this->headCollider); + CollisionCheck_SetInfo(&this->actor.colChkInfo, DamageTable_Get(1), &sColCheckInfoInit); this->boundFloor = NULL; @@ -102,9 +130,9 @@ void EnKarebaba_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnKarebaba_ResetCollider(EnKarebaba* this) { this->bodyCollider.dim.radius = 7; this->bodyCollider.dim.height = 25; - this->bodyCollider.base.type = COLTYPE_UNK12; - this->bodyCollider.base.acFlags |= 4; - this->bodyCollider.body.bumper.flags = ~0x00300000; + this->bodyCollider.base.colType = COLTYPE_HARD; + this->bodyCollider.base.acFlags |= AC_HARD; + this->bodyCollider.info.bumper.dmgFlags = ~0x00300000; this->headCollider.dim.height = 25; } @@ -112,14 +140,14 @@ void EnKarebaba_SetupGrow(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.0f); this->actor.shape.rot.x = -0x4000; this->actionFunc = EnKarebaba_Grow; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 14.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; } void EnKarebaba_SetupIdle(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.005f); this->actor.shape.rot.x = -0x4000; this->actionFunc = EnKarebaba_Idle; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 14.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; } void EnKarebaba_SetupAwaken(EnKarebaba* this) { @@ -132,9 +160,9 @@ void EnKarebaba_SetupAwaken(EnKarebaba* this) { void EnKarebaba_SetupUpright(EnKarebaba* this) { if (this->actionFunc != EnKarebaba_Spin) { Actor_SetScale(&this->actor, 0.01f); - this->bodyCollider.base.type = COLTYPE_UNK6; - this->bodyCollider.base.acFlags &= ~0x0004; - this->bodyCollider.body.bumper.flags = gSaveContext.linkAge != 0 ? 0x07C00710 : 0x0FC00710; + this->bodyCollider.base.colType = COLTYPE_HIT6; + this->bodyCollider.base.acFlags &= ~AC_HARD; + this->bodyCollider.info.bumper.dmgFlags = gSaveContext.linkAge != 0 ? 0x07C00710 : 0x0FC00710; this->bodyCollider.dim.radius = 15; this->bodyCollider.dim.height = 80; this->headCollider.dim.height = 80; @@ -153,7 +181,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { this->actor.params = 0; this->actor.gravity = -0.8f; this->actor.velocity.y = 4.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actor.speedXZ = 3.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= 0x30; @@ -163,11 +191,11 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.03f); this->actor.shape.rot.x -= 0x4000; - this->actor.shape.unk_08 = 1000.0f; + this->actor.shape.yOffset = 1000.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.shape.unk_10 = 3.0f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_MISC); + this->actor.shape.shadowScale = 3.0f; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_MISC); this->actor.params = 200; this->actor.flags &= ~0x20; this->actionFunc = EnKarebaba_DeadItemDrop; @@ -186,14 +214,14 @@ void EnKarebaba_SetupDead(EnKarebaba* this) { this->actor.shape.rot.x = -0x4000; this->actor.params = 200; this->actor.parent = NULL; - this->actor.shape.unk_10 = 0.0f; - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->actor.shape.shadowScale = 0.0f; + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); this->actionFunc = EnKarebaba_Dead; } void EnKarebaba_SetupRegrow(EnKarebaba* this) { - this->actor.shape.unk_08 = 0.0f; - this->actor.shape.unk_10 = 22.0f; + this->actor.shape.yOffset = 0.0f; + this->actor.shape.shadowScale = 22.0f; this->headCollider.dim.radius = sHeadColliderInit.dim.radius; Actor_SetScale(&this->actor, 0.0f); this->actionFunc = EnKarebaba_Regrow; @@ -205,14 +233,14 @@ void EnKarebaba_Grow(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params++; scale = this->actor.params * 0.05f; Actor_SetScale(&this->actor, 0.005f * scale); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (14.0f * scale); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale); if (this->actor.params == 20) { EnKarebaba_SetupIdle(this); } } void EnKarebaba_Idle(EnKarebaba* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < 200.0f && fabsf(this->actor.yDistToLink) < 30.0f) { + if (this->actor.xzDistToPlayer < 200.0f && fabsf(this->actor.yDistToPlayer) < 30.0f) { EnKarebaba_SetupAwaken(this); } } @@ -221,11 +249,11 @@ void EnKarebaba_Awaken(EnKarebaba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 60.0f, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 5.0f)) { EnKarebaba_SetupUpright(this); } this->actor.shape.rot.y += 0x1999; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.initPosRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx) { @@ -241,10 +269,10 @@ void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKU_JR_MOUTH); } - if (this->bodyCollider.base.acFlags & 2) { + if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); func_80032C7C(globalCtx, &this->actor); - } else if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) > 240.0f) { + } else if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 240.0f) { EnKarebaba_SetupRetract(this); } else if (this->actor.params == 0) { EnKarebaba_SetupSpin(this); @@ -277,14 +305,14 @@ void EnKarebaba_Spin(EnKarebaba* this, GlobalContext* globalCtx) { this->headCollider.dim.radius = sHeadColliderInit.dim.radius + (value * 2); this->actor.shape.rot.x = 0xC000 - (value * 0x100); this->actor.shape.rot.y += value * 0x2C0; - this->actor.posRot.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.home.pos.y; cos60 = Math_CosS(this->actor.shape.rot.x) * 60.0f; - this->actor.posRot.pos.x = (Math_SinS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.z; + this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * cos60) + this->actor.home.pos.x; + this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * cos60) + this->actor.home.pos.z; - if (this->bodyCollider.base.acFlags & 2) { + if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); func_80032C7C(globalCtx, &this->actor); } else if (this->actor.params == 0) { @@ -302,13 +330,13 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { if (this->actor.params == 0) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); if (this->actor.scale.x > 0.005f && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speedXZ = 0.0f; this->actor.flags &= ~5; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } @@ -317,7 +345,7 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params = 1; } } else if (this->actor.params == 1) { - Math_Vec3f_Copy(&position, &this->actor.posRot.pos); + Math_Vec3f_Copy(&position, &this->actor.world.pos); rotation.z = Math_SinS(this->actor.shape.rot.x) * 20.0f; rotation.x = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y); rotation.y = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y); @@ -329,7 +357,7 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { position.z += rotation.y; } - func_800286CC(globalCtx, &this->actor.initPosRot.pos, &zeroVec, &zeroVec, 500, 100); + func_800286CC(globalCtx, &this->actor.home.pos, &zeroVec, &zeroVec, 500, 100); EnKarebaba_SetupDeadItemDrop(this, globalCtx); } } @@ -351,12 +379,12 @@ void EnKarebaba_Retract(EnKarebaba* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 14.0f, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 14.0f, 5.0f)) { EnKarebaba_SetupIdle(this); } this->actor.shape.rot.y += 0x1999; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.initPosRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } void EnKarebaba_Dead(EnKarebaba* this, GlobalContext* globalCtx) { @@ -376,12 +404,12 @@ void EnKarebaba_Regrow(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params++; scaleFactor = this->actor.params * 0.05f; Actor_SetScale(&this->actor, 0.005f * scaleFactor); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (14.0f * scaleFactor); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scaleFactor); if (this->actor.params == 20) { this->actor.flags &= ~0x10; this->actor.flags |= 5; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); EnKarebaba_SetupIdle(this); } } @@ -396,9 +424,9 @@ void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != EnKarebaba_Dead) { if (this->actionFunc == EnKarebaba_Dying) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 10.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 10.0f, 5); } else { - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->boundFloor == NULL) { this->boundFloor = this->actor.floorPoly; } @@ -409,11 +437,11 @@ void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); - Actor_SetHeight(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f); - height = this->actor.initPosRot.pos.y + 40.0f; - this->actor.posRot2.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot2.pos.y = CLAMP_MAX(this->actor.posRot2.pos.y, height); - this->actor.posRot2.pos.z = this->actor.initPosRot.pos.z; + Actor_SetFocus(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f); + height = this->actor.home.pos.y + 40.0f; + this->actor.focus.pos.x = this->actor.home.pos.x; + this->actor.focus.pos.y = CLAMP_MAX(this->actor.focus.pos.y, height); + this->actor.focus.pos.z = this->actor.home.pos.z; } } } @@ -426,8 +454,7 @@ void EnKarebaba_DrawCenterShadow(EnKarebaba* this, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); - func_80038A28(this->boundFloor, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, &mf); + func_80038A28(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf); Matrix_Mult(&mf, MTXMODE_NEW); Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1029), @@ -460,7 +487,7 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { } else if (this->actionFunc != EnKarebaba_Dead) { func_80026230(globalCtx, &black, 1, 2); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); if ((this->actionFunc == EnKarebaba_Regrow) || (this->actionFunc == EnKarebaba_Grow)) { scale = this->actor.params * 0.0005f; @@ -484,7 +511,7 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_OPA_DISP++, dLists[i]); if (i == 0 && this->actionFunc == EnKarebaba_Dying) { - Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos); } } @@ -492,21 +519,20 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { } func_80026230(globalCtx, &black, 1, 2); - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); if (this->actionFunc != EnKarebaba_Grow) { scale = 0.01f; } Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - Matrix_RotateY(this->actor.initPosRot.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateY(this->actor.home.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1144), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_060010F0); if (this->actionFunc == EnKarebaba_Dying) { - Matrix_RotateRPY(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.initPosRot.rot.y), 0, MTXMODE_APPLY); + Matrix_RotateRPY(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.home.rot.y), 0, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1155), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_06001828); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 90656eda03..16844d4cdf 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06008F6C; /* const ActorInit En_Ko_InitVars = { ACTOR_EN_KO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnKo), @@ -27,6 +27,26 @@ const ActorInit En_Ko_InitVars = { (ActorFunc)EnKo_Update, (ActorFunc)EnKo_Draw, }; + +static ColliderCylinderInit D_80A9A100 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A96DB0.s") diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index f7914e56ee..74fb152098 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -41,7 +41,7 @@ s16 D_80A9C1DC = 0; const ActorInit En_Kusa_InitVars = { ACTOR_EN_KUSA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnKusa), @@ -54,12 +54,26 @@ const ActorInit En_Kusa_InitVars = { static s16 sObjectIds[] = { OBJECT_GAMEPLAY_FIELD_KEEP, OBJECT_KUSA, OBJECT_KUSA }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x29, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC00758, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC00758, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 44, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 30, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 30, MASS_IMMOVABLE }; static Vec3f D_80A9C23C[] = { { 0.0f, 0.7071f, 0.7071f }, @@ -92,15 +106,15 @@ s32 EnKusa_SnapToFloor(EnKusa* this, GlobalContext* globalCtx, f32 yOffset) { s32 bgId; f32 floorY; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 30.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 30.0f; + pos.z = this->actor.world.pos.z; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->actor, &pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY + yOffset; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + this->actor.world.pos.y = floorY + yOffset; + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return true; } else { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -122,13 +136,13 @@ void EnKusa_DropCollectible(EnKusa* this, GlobalContext* globalCtx) { if (dropParams >= 0xD) { dropParams = 0; } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, dropParams << 4); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, dropParams << 4); break; case 1: if (Rand_ZeroOne() < 0.5f) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_SEEDS); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_SEEDS); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_HEART); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_HEART); } break; } @@ -166,9 +180,9 @@ void EnKusa_SpawnFragments(EnKusa* this, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(D_80A9C23C); i++) { scale = &D_80A9C23C[i]; - pos.x = this->actor.posRot.pos.x + (scale->x * this->actor.scale.x * 20.0f); - pos.y = this->actor.posRot.pos.y + (scale->y * this->actor.scale.y * 20.0f) + 10.0f; - pos.z = this->actor.posRot.pos.z + (scale->z * this->actor.scale.z * 20.0f); + pos.x = this->actor.world.pos.x + (scale->x * this->actor.scale.x * 20.0f); + pos.y = this->actor.world.pos.y + (scale->y * this->actor.scale.y * 20.0f) + 10.0f; + pos.z = this->actor.world.pos.z + (scale->z * this->actor.scale.z * 20.0f); velocity.x = (Rand_ZeroOne() - 0.5f) * 8.0f; velocity.y = Rand_ZeroOne() * 10.0f; @@ -179,9 +193,9 @@ void EnKusa_SpawnFragments(EnKusa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -100, 64, 40, 3, 0, D_80A9C26C[index], 0, 0, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, D_040355E0); - pos.x = this->actor.posRot.pos.x + (scale->x * this->actor.scale.x * 40.0f); - pos.y = this->actor.posRot.pos.y + (scale->y * this->actor.scale.y * 40.0f) + 10.0f; - pos.z = this->actor.posRot.pos.z + (scale->z * this->actor.scale.z * 40.0f); + pos.x = this->actor.world.pos.x + (scale->x * this->actor.scale.x * 40.0f); + pos.y = this->actor.world.pos.y + (scale->y * this->actor.scale.y * 40.0f) + 10.0f; + pos.z = this->actor.world.pos.z + (scale->z * this->actor.scale.z * 40.0f); velocity.x = (Rand_ZeroOne() - 0.5f) * 6.0f; velocity.y = Rand_ZeroOne() * 10.0f; @@ -198,8 +212,8 @@ void EnKusa_SpawnBugs(EnKusa* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); + Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); if (bug == NULL) { break; @@ -212,7 +226,7 @@ void EnKusa_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -225,13 +239,13 @@ void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx) { } EnKusa_InitCollider(thisx, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (this->actor.shape.rot.y == 0) { s16 rand = Rand_ZeroFloat(0x10000); - this->actor.posRot.rot.y = rand; - this->actor.initPosRot.rot.y = rand; + this->actor.world.rot.y = rand; + this->actor.home.rot.y = rand; this->actor.shape.rot.y = rand; } @@ -287,12 +301,12 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnKusa_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_PL_PULL_UP_PLANT); - } else if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); + } else if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_PLANT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); if ((this->actor.params >> 4) & 1) { EnKusa_SpawnBugs(this, globalCtx); @@ -306,17 +320,17 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { func_80A9BEAC(this); this->actor.flags |= 0x800; } else { - if (!(this->collider.base.maskA & 8) && (this->actor.xzDistToLink > 12.0f)) { - this->collider.base.maskA |= 8; + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 12.0f)) { + this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } - if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + if (this->actor.xzDistToPlayer < 600.0f) { + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 400.0f) { + if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8002F580(&this->actor, globalCtx); } } @@ -334,14 +348,14 @@ void EnKusa_LiftedUp(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasNoParent(&this->actor, globalCtx)) { this->actor.room = globalCtx->roomCtx.curRoom.num; func_80A9BBB0(this); - this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.posRot.rot.y); - this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.posRot.rot.y); + this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); + this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); this->actor.colChkInfo.mass = 240; this->actor.gravity = -0.1f; EnKusa_Fall(this); func_80A9B174(&this->actor.velocity, 0.005f); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); this->actor.gravity = -3.2f; } } @@ -360,7 +374,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 11) { if (!(this->actor.bgCheckFlags & 32)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_PLANT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); @@ -376,9 +390,9 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { } } else { if (this->actor.bgCheckFlags & 0x40) { - contactPos.x = this->actor.posRot.pos.x; - contactPos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - contactPos.z = this->actor.posRot.pos.z; + contactPos.x = this->actor.world.pos.x; + contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater; + contactPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(globalCtx, &contactPos, NULL, NULL, 0, 400); EffectSsGRipple_Spawn(globalCtx, &contactPos, 150, 650, 0); EffectSsGRipple_Spawn(globalCtx, &contactPos, 400, 800, 4); @@ -389,7 +403,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { D_80A9C1DC >>= 1; D_80A9C1D8 >>= 1; this->actor.bgCheckFlags &= ~0x40; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); } EnKusa_Fall(this); Math_StepToS(&D_80A9C1D4, D_80A9C1D0, 0x1F4); @@ -398,8 +412,8 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += D_80A9C1DC; func_80A9B174(&this->actor.velocity, 0.05f); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -425,17 +439,17 @@ void func_80A9BF30(EnKusa* this, GlobalContext* globalCtx) { } void func_80A9BF3C(EnKusa* this) { - this->actor.posRot.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - 9.0f; - this->actor.posRot.pos.z = this->actor.initPosRot.pos.z; + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.y = this->actor.home.pos.y - 9.0f; + this->actor.world.pos.z = this->actor.home.pos.z; EnKusa_SetScale(this); - this->actor.shape.rot = this->actor.initPosRot.rot; + this->actor.shape.rot = this->actor.home.rot; EnKusa_SetupAction(this, func_80A9BFA8); } void func_80A9BFA8(EnKusa* this, GlobalContext* globalCtx) { if (this->timer > 120) { - if ((Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.6f)) && (this->timer >= 170)) { + if ((Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.6f)) && (this->timer >= 170)) { func_80A9C00C(this); } } @@ -444,7 +458,7 @@ void func_80A9BFA8(EnKusa* this, GlobalContext* globalCtx) { void func_80A9C00C(EnKusa* this) { EnKusa_SetupAction(this, func_80A9C068); EnKusa_SetScale(this); - this->actor.shape.rot = this->actor.initPosRot.rot; + this->actor.shape.rot = this->actor.home.rot; this->actor.flags &= ~0x800; } @@ -458,7 +472,7 @@ void func_80A9C068(EnKusa* this, GlobalContext* globalCtx) { if (sp24) { Actor_SetScale(&this->actor, 0.4f); func_80A9B89C(this); - this->collider.base.maskA &= ~8; + this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } } @@ -470,9 +484,9 @@ void EnKusa_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actor.flags & 0x800) { - this->actor.shape.unk_08 = -6.25f; + this->actor.shape.yOffset = -6.25f; } else { - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index a9adcc766e..0d0ffa29bd 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -25,7 +25,7 @@ void EnKz_StartTimer(EnKz* this, GlobalContext* globalCtx); const ActorInit En_Kz_InitVars = { ACTOR_EN_KZ, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KZ, sizeof(EnKz), @@ -36,14 +36,26 @@ const ActorInit En_Kz_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 80, 120, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x0600075C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, @@ -176,7 +188,7 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal Player* player = PLAYER; s16 sp32; s16 sp30; - f32 xzDistToLink; + f32 xzDistToPlayer; f32 yaw; if (func_8002F194(&this->actor, globalCtx) != 0) { @@ -189,9 +201,9 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal return 0; } - yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &player->actor.posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); yaw -= this->actor.shape.rot.y; - if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToLink < 265.0f)) { + if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToPlayer < 265.0f)) { this->actor.flags &= ~1; return 0; } @@ -203,13 +215,13 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal return 0; } - xzDistToLink = this->actor.xzDistToLink; - this->actor.xzDistToLink = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos); + xzDistToPlayer = this->actor.xzDistToPlayer; + this->actor.xzDistToPlayer = Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos); if (func_8002F2CC(&this->actor, globalCtx, unkf) == 0) { - this->actor.xzDistToLink = xzDistToLink; + this->actor.xzDistToPlayer = xzDistToPlayer; return 0; } - this->actor.xzDistToLink = xzDistToLink; + this->actor.xzDistToPlayer = xzDistToPlayer; this->actor.textId = callback1(globalCtx, this); return 0; @@ -266,9 +278,9 @@ s32 EnKz_FollowPath(EnKz* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.3779296875f), 0xA, 0x3E8, + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.3779296875f), 0xA, 0x3E8, 1); if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f) { @@ -293,9 +305,9 @@ s32 EnKz_SetMovedPos(EnKz* this, GlobalContext* globalCtx) { lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; - this->actor.posRot.pos.x = lastPointPos->x; - this->actor.posRot.pos.y = lastPointPos->y; - this->actor.posRot.pos.z = lastPointPos->z; + this->actor.world.pos.x = lastPointPos->x; + this->actor.world.pos.y = lastPointPos->y; + this->actor.world.pos.z = lastPointPos->z; return 1; } @@ -308,9 +320,9 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0, NULL, 0.0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01); - this->actor.unk_1F = 3; + this->actor.targetMode = 3; this->unk_1E0.unk_00 = 0; func_80034EC0(&this->skelanime, sAnimations, 0); @@ -321,7 +333,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { if (LINK_IS_ADULT) { if (!(gSaveContext.infTable[19] & 0x100)) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_ICE_SHELTER, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x04FF); } this->actionFunc = EnKz_Wait; @@ -355,8 +367,8 @@ void EnKz_SetupMweep(EnKz* this, GlobalContext* globalCtx) { this->gameplayCamera = globalCtx->activeCamera; Gameplay_ChangeCameraStatus(globalCtx, this->gameplayCamera, 1); Gameplay_ChangeCameraStatus(globalCtx, this->cutsceneCamera, 7); - pos = this->actor.posRot.pos; - initPos = this->actor.initPosRot.pos; + pos = this->actor.world.pos; + initPos = this->actor.home.pos; pos.y += 60.0f; initPos.y += -100.0f; initPos.z += 260.0f; @@ -371,8 +383,8 @@ void EnKz_Mweep(EnKz* this, GlobalContext* globalCtx) { Vec3f pos; Vec3f initPos; - pos = this->actor.posRot.pos; - initPos = this->actor.initPosRot.pos; + pos = this->actor.world.pos; + initPos = this->actor.home.pos; pos.y += 60.0f; initPos.y += -100.0f; initPos.z += 260.0f; @@ -417,8 +429,8 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) { this->actionFunc = EnKz_StartTimer; } else { getItemID = this->isTrading == true ? GI_FROG : GI_TUNIC_ZORA; - yRange = fabsf(this->actor.yDistToLink) + 1.0f; - xzRange = this->actor.xzDistToLink + 1.0f; + yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; + xzRange = this->actor.xzDistToPlayer + 1.0f; func_8002F434(&this->actor, globalCtx, getItemID, xzRange, yRange); } } @@ -441,8 +453,8 @@ void EnKz_Update(Actor* thisx, GlobalContext* globalCtx) { if (LINK_IS_ADULT && !(gSaveContext.infTable[19] & 0x100)) { gSaveContext.infTable[19] |= 0x100; } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelanime); EnKz_UpdateEyes(this); Actor_MoveForward(&this->actor); @@ -468,7 +480,7 @@ void EnKz_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f mult = { 2600.0f, 0.0f, 0.0f }; if (limbIndex == 11) { - Matrix_MultVec3f(&mult, &this->actor.posRot2.pos); + Matrix_MultVec3f(&mult, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 59f13d4404..8ff45bc796 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -18,7 +18,7 @@ void EnLight_UpdateSwitch(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Light_InitVars = { ACTOR_EN_LIGHT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnLight), @@ -55,12 +55,12 @@ void EnLight_Init(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.gameMode == 3) { // special case for the credits yOffset = (this->actor.params < 0) ? 1 : 40; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, yOffset + (s16)this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 180, -1); } else { yOffset = (this->actor.params < 0) ? 1 : 40; - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, yOffset + (s16)this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 180, -1); } this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); @@ -83,8 +83,8 @@ void EnLight_UpdatePosRot(EnLight* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = Camera_GetCamDirYaw(ACTIVE_CAM) + 0x8000; if (this->actor.parent != NULL) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &(this->actor.parent)->posRot.pos); - this->actor.posRot.pos.y += 17.0f; + Math_Vec3f_Copy(&this->actor.world.pos, &(this->actor.parent)->world.pos); + this->actor.world.pos.y += 17.0f; } this->timer++; diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index f37e61c661..a8d8c10d42 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -17,7 +17,7 @@ void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Lightbox_InitVars = { ACTOR_EN_LIGHTBOX, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_LIGHTBOX, sizeof(EnLightbox), @@ -51,13 +51,13 @@ void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) { break; } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->colChkInfo.unk_10 = 0x1E; - thisx->colChkInfo.unk_12 = 0x32; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + thisx->focus.pos = thisx->world.pos; + thisx->colChkInfo.cylRadius = 30; + thisx->colChkInfo.cylHeight = 50; + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.unk_160 = 0; this->dyna.unk_15C = 0; - thisx->unk_1F = 0; + thisx->targetMode = 0; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&D_06001F10, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); @@ -82,7 +82,7 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { } else { if (thisx->speedXZ) { if (thisx->bgCheckFlags & 8) { - thisx->posRot.rot.y = (thisx->posRot.rot.y + thisx->wallPolyRot) - thisx->posRot.rot.y; + thisx->world.rot.y = (thisx->world.rot.y + thisx->wallYaw) - thisx->world.rot.y; Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); thisx->speedXZ *= 0.7f; @@ -106,8 +106,9 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { } } Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D); - thisx->posRot2.pos = thisx->posRot.pos; + Actor_UpdateBgCheckInfo(globalCtx, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, + thisx->colChkInfo.cylRadius, 0x1D); + thisx->focus.pos = thisx->world.pos; } void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index f2b8de8b3a..5b419fddef 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -16,7 +16,7 @@ void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_M_Fire1_InitVars = { ACTOR_EN_M_FIRE1, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnMFire1), @@ -26,18 +26,30 @@ const ActorInit En_M_Fire1_InitVars = { NULL, }; -static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, - { 200, 200, 0, { 0 } } -}; +static ColliderCylinderInit sCylinderInit = { { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000001, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 200, 200, 0, { 0 } } }; void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) { EnMFire1* this = THIS; s32 pad; if (this->actor.params < 0) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ITEMACTION); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ITEMACTION); } Collider_InitCylinder(globalCtx, &this->collider); @@ -57,7 +69,7 @@ void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx) { if (Math_StepToF(&this->unk_198, 1.0f, 0.2f)) { Actor_Kill(&this->actor); } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 8937b08009..f1d446aca4 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -9,16 +9,13 @@ void EnMThunder_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnMThunder_Update(Actor* thisx, GlobalContext* globalCtx); void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_04012570; -extern UNK_TYPE D_04012690; -extern UNK_TYPE D_04012AF0; -extern UNK_TYPE D_04012C10; -extern UNK_TYPE D_04013610; +void func_80A9F314(GlobalContext* globalCtx, f32 arg1); +void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx); +void func_80A9F9B4(EnMThunder* this, GlobalContext* globalCtx); -/* const ActorInit En_M_Thunder_InitVars = { ACTOR_EN_M_THUNDER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnMThunder), @@ -27,23 +24,391 @@ const ActorInit En_M_Thunder_InitVars = { (ActorFunc)EnMThunder_Update, (ActorFunc)EnMThunder_Draw, }; -*/ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9EFE0.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Init.s") +static ColliderCylinderInit D_80AA0420 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000001, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 200, 200, 0, { 0, 0, 0 } }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Destroy.s") +static u32 D_80AA044C[] = { 0x01000000, 0x00400000, 0x00800000 }; +static u32 D_80AA0458[] = { 0x08000000, 0x02000000, 0x04000000 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F314.s") +static u16 sSfxIds[] = { NA_SE_IT_ROLLING_CUT_LV2, NA_SE_IT_ROLLING_CUT_LV1, NA_SE_IT_ROLLING_CUT_LV2, + NA_SE_IT_ROLLING_CUT_LV1 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F350.s") +extern Gfx D_04012570[]; +extern Gfx D_04012690[]; +extern Gfx D_04012AF0[]; +extern Gfx D_04012C10[]; +extern Gfx D_04013610[]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F408.s") +// Setup action +void func_80A9EFE0(EnMThunder* this, EnMThunderActionFunc actionFunc) { + this->actionFunc = actionFunc; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F938.s") +void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + EnMThunder* this = THIS; + Player* player = PLAYER; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s") + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80AA0420); + this->unk_1C7 = (this->actor.params & 0xFF) - 1; + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 255, 0); + this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); + this->collider.dim.radius = 0; + this->collider.dim.height = 40; + this->collider.dim.yShift = -20; + this->unk_1C4 = 8; + this->unk_1B4 = 0.0f; + this->actor.world.pos = player->bodyPartsPos[0]; + this->unk_1AC = 0.0f; + this->unk_1BC = 0.0f; + this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000; + this->actor.room = -1; + Actor_SetScale(&this->actor, 0.1f); + this->unk_1CA = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Update.s") + if (player->stateFlags2 & 0x20000) { + if (!gSaveContext.magicAcquired || gSaveContext.unk_13F0 || + (((this->actor.params & 0xFF00) >> 8) && + !(func_80087708(globalCtx, (this->actor.params & 0xFF00) >> 8, 0)))) { + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + Actor_Kill(&this->actor); + return; + } + player->stateFlags2 &= ~0x20000; + this->unk_1CA = 1; + this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; + this->unk_1C6 = 1; + this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); + func_80A9EFE0(this, func_80A9F9B4); + this->unk_1C4 = 8; + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT_LV1, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + this->unk_1AC = 1.0f; + } else { + func_80A9EFE0(this, func_80A9F408); + } + this->actor.child = NULL; +} + +void EnMThunder_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMThunder* this = THIS; + + if (this->unk_1CA != 0) { + func_800876C8(globalCtx); + } + + Collider_DestroyCylinder(globalCtx, &this->collider); + func_80A9F314(globalCtx, 0.0f); + LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode); +} + +void func_80A9F314(GlobalContext* globalCtx, f32 arg1) { + func_800773A8(globalCtx, arg1, 850.0f, 0.2f, 0.0f); +} + +void func_80A9F350(EnMThunder* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + + if (player->stateFlags2 & 0x20000) { + if (player->swordAnimation >= 0x18) { + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } + + Actor_Kill(&this->actor); + return; + } + + if (!(player->stateFlags1 & 0x1000)) { + Actor_Kill(&this->actor); + } +} + +void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + Actor* child = this->actor.child; + + this->unk_1B8 = player->unk_858; + this->actor.world.pos = player->bodyPartsPos[0]; + this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000; + + if (this->unk_1CA == 0) { + if (player->unk_858 >= 0.1f) { + if ((gSaveContext.unk_13F0) || (((this->actor.params & 0xFF00) >> 8) && + !(func_80087708(globalCtx, (this->actor.params & 0xFF00) >> 8, 4)))) { + func_80A9F350(this, globalCtx); + func_80A9EFE0(this, func_80A9F350); + this->unk_1C8 = 0; + this->unk_1BC = 0.0; + this->unk_1AC = 0.0f; + return; + } + + this->unk_1CA = 1; + } + } + + if (player->unk_858 >= 0.1f) { + func_800AA000(0.0f, (s32)(player->unk_858 * 150.0f) & 0xFF, 2, (s32)(player->unk_858 * 150.0f) & 0xFF); + } + + if (player->stateFlags2 & 0x20000) { + if ((child != NULL) && (child->update != NULL)) { + child->parent = NULL; + } + + if (player->unk_858 <= 0.15f) { + if ((player->unk_858 >= 0.1f) && (player->swordAnimation >= 0x18)) { + Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } + Actor_Kill(&this->actor); + return; + } else { + player->stateFlags2 &= ~0x20000; + if ((this->actor.params & 0xFF00) >> 8) { + gSaveContext.unk_13F0 = 1; + } + if (player->unk_858 < 0.85f) { + this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; + this->unk_1C6 = 1; + this->unk_1C9 = ((this->unk_1C7 == 1) ? 2 : 4); + } else { + this->collider.info.toucher.dmgFlags = D_80AA0458[this->unk_1C7]; + this->unk_1C6 = 0; + this->unk_1C9 = ((this->unk_1C7 == 1) ? 4 : 8); + } + + func_80A9EFE0(this, func_80A9F9B4); + this->unk_1C4 = 8; + Audio_PlaySoundGeneral(sSfxIds[this->unk_1C6], &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + this->unk_1AC = 1.0f; + return; + } + } + + if (!(player->stateFlags1 & 0x1000)) { + if (this->actor.child != NULL) { + this->actor.child->parent = NULL; + } + Actor_Kill(&this->actor); + return; + } + + if (player->unk_858 > 0.15f) { + this->unk_1C8 = 255; + if (this->actor.child == NULL) { + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EFF_DUST, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, + this->unk_1C7 + 2); + } + this->unk_1BC += ((((player->unk_858 - 0.15f) * 1.5f) - this->unk_1BC) * 0.5f); + + } else if (player->unk_858 > .1f) { + this->unk_1C8 = (s32)((player->unk_858 - .1f) * 255.0f * 20.0f); + this->unk_1AC = (player->unk_858 - .1f) * 10.0f; + } else { + this->unk_1C8 = 0; + } + + if (player->unk_858 > 0.85f) { + func_800F4254(&player->actor.projectedPos, 2); + } else if (player->unk_858 > 0.15f) { + func_800F4254(&player->actor.projectedPos, 1); + } else if (player->unk_858 > 0.1f) { + func_800F4254(&player->actor.projectedPos, 0); + } + + if (Gameplay_InCsMode(globalCtx)) { + Actor_Kill(&this->actor); + } +} + +void func_80A9F938(EnMThunder* this, GlobalContext* globalCtx) { + if (this->unk_1C4 < 2) { + if (this->unk_1C8 < 40) { + this->unk_1C8 = 0; + } else { + this->unk_1C8 -= 40; + } + } + + this->unk_1B4 += 2.0f * this->unk_1B0; + + if (this->unk_1BC < this->unk_1AC) { + this->unk_1BC += ((this->unk_1AC - this->unk_1BC) * 0.1f); + } else { + this->unk_1BC = this->unk_1AC; + } +} + +void func_80A9F9B4(EnMThunder* this, GlobalContext* globalCtx) { + Player* player = PLAYER; + + if (Math_StepToF(&this->unk_1AC, 0.0f, 0.0625f)) { + Actor_Kill(&this->actor); + } else { + Math_SmoothStepToF(&this->actor.scale.x, (s32)this->unk_1C9, 0.6f, 0.8f, 0.0f); + Actor_SetScale(&this->actor, this->actor.scale.x); + this->collider.dim.radius = (this->actor.scale.x * 25.0f); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + + if (this->unk_1C4 > 0) { + this->actor.world.pos.x = player->bodyPartsPos[0].x; + this->actor.world.pos.z = player->bodyPartsPos[0].z; + this->unk_1C4--; + } + + if (this->unk_1AC > 0.6f) { + this->unk_1B0 = 1.0f; + } else { + this->unk_1B0 = this->unk_1AC * 1.6666666f; + } + + func_80A9F938(this, globalCtx); + + if (Gameplay_InCsMode(globalCtx)) { + Actor_Kill(&this->actor); + } +} + +void EnMThunder_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMThunder* this = THIS; + f32 blueRadius; + s32 redGreen; + + this->actionFunc(this, globalCtx); + func_80A9F314(globalCtx, this->unk_1BC); + blueRadius = this->unk_1AC; + redGreen = (u32)(blueRadius * 255.0f) & 0xFF; + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, redGreen, redGreen, (u32)(blueRadius * 100.0f), + (s32)(blueRadius * 800.0f)); +} + +#ifdef NON_MATCHING +void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) { + static f32 D_80AA046C[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f }; + GlobalContext* globalCtx = globalCtx2; + EnMThunder* this = THIS; + Player* player = PLAYER; + f32 phi_f14; + s32 phi_t1; + // u8 frames; + + if (1) {} + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_m_thunder.c", 844); + func_80093D84(globalCtx->state.gfxCtx); + Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_m_thunder.c", 853), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + if (((this->unk_1C6 & 0xFF) == 0) || ((this->unk_1C6) == 1)) { + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0xFF - ((s8)(this->unk_1B4 * 30) & 0xFF), 0, 0x40, 0x20, + 1, 0xFF - ((s8)(this->unk_1B4 * 20) & 0xFF), 0, 8, 8)); + if (1) {} + } + + switch (this->unk_1C6) { + case 0: + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)((u32)(this->unk_1B0 * 255) & 0xFF)); + gSPDisplayList(POLY_XLU_DISP++, D_04012AF0); + gSPDisplayList(POLY_XLU_DISP++, D_04012C10); + break; + case 1: + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)((u32)(this->unk_1B0 * 255) & 0xFF)); + gSPDisplayList(POLY_XLU_DISP++, D_04012570); + gSPDisplayList(POLY_XLU_DISP++, D_04012690); + break; + } + + Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); + + switch (this->unk_1C7) { + case 1: + Matrix_Translate(0.0f, 220.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(-0.7f, -0.6f, -0.4f, MTXMODE_APPLY); + Matrix_RotateX(16384.0f, MTXMODE_APPLY); + break; + case 0: + Matrix_Translate(0.0f, 300.0f, -100.0f, MTXMODE_APPLY); + Matrix_Scale(-1.2f, -1.0f, -0.7f, MTXMODE_APPLY); + Matrix_RotateX(16384.0f, MTXMODE_APPLY); + break; + case 2: + Matrix_Translate(200.0f, 350.0f, 0.0f, MTXMODE_APPLY); + Matrix_Scale(-1.8f, -1.4f, -0.7f, MTXMODE_APPLY); + Matrix_RotateX(16384.0f, MTXMODE_APPLY); + break; + } + + if (this->unk_1B8 >= 0.85f) { + phi_f14 = (D_80AA046C[(globalCtx->gameplayFrames & 7)] * 6.0f) + 1.0f; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); + phi_t1 = 0x28; + } else { + phi_f14 = (D_80AA046C[globalCtx->gameplayFrames & 7] * 2.0f) + 1.0f; + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8); + gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); + phi_t1 = 0x14; + } + Matrix_Scale(1.0f, phi_f14, phi_f14, MTXMODE_APPLY); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_m_thunder.c", 960), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + // redGreen_14 = temp_s0->polyXlu.p; + // temp_s0->polyXlu.p = redGreen_14 + 8; + // redGreen_14->words.w0 = 0xDB060024; + // temp_v1_3 = temp_t2->unk1DE4; + // temp_v1_3 = globalCtx->gameplayFrames; + // sp50 = redGreen_14; + // sp50->words.w1 = Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (temp_v1_3 * 5) & 0xFF, 0U, 0x20, 0x20, 1, + // (temp_v1_3 * 0x14) & 0xFF, (temp_v1_3 * temp_t1) & 0xFF, 8, 8); + // frames = globalCtx->gameplayFrames; + gSPSegment(POLY_XLU_DISP++, 0x09, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (globalCtx->gameplayFrames * 5) & 0xFF, 0, 0x20, 0x20, 1, + (globalCtx->gameplayFrames * 0x14) & 0xFF, + (u8)(globalCtx->gameplayFrames * phi_t1) & 0xFF, 8, 8)); + + gSPDisplayList(POLY_XLU_DISP++, D_04013610); + + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_m_thunder.c", 1031); +} +#else +f32 D_80AA046C[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Draw.s") +#endif diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h index cb6db0d41f..d1408439c1 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h @@ -6,9 +6,25 @@ struct EnMThunder; +typedef void (*EnMThunderActionFunc)(struct EnMThunder*, GlobalContext*); + typedef struct EnMThunder { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x80]; + /* 0x014C */ ColliderCylinder collider; + /* 0x0198 */ LightNode* lightNode; + /* 0x019C */ LightInfo lightInfo; + /* 0x01AC */ f32 unk_1AC; + /* 0x01B0 */ f32 unk_1B0; + /* 0x01B0 */ f32 unk_1B4; + /* 0x01B0 */ f32 unk_1B8; + /* 0x01BC */ f32 unk_1BC; + /* 0x01C0 */ EnMThunderActionFunc actionFunc; + /* 0x01C4 */ u16 unk_1C4; + /* 0x01C6 */ u8 unk_1C6; + /* 0x01C7 */ u8 unk_1C7; + /* 0x01C8 */ u8 unk_1C8; + /* 0x01C9 */ u8 unk_1C9; + /* 0x01CA */ u8 unk_1CA; } EnMThunder; // size = 0x01CC extern const ActorInit En_M_Thunder_InitVars; diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 8519840de9..d3429e0567 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -29,7 +29,7 @@ void func_80AA11C8(EnMa1* this, GlobalContext* globalCtx); const ActorInit En_Ma1_InitVars = { ACTOR_EN_MA1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA1, sizeof(EnMa1), @@ -40,14 +40,26 @@ const ActorInit En_Ma1_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA1678[] = { { 0x06000820, 1.0f, 0x00, 0.0f }, @@ -222,7 +234,7 @@ void func_80AA0AF4(EnMa1* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E8.unk_18 = player->actor.posRot.pos; + this->unk_1E8.unk_18 = player->actor.world.pos; this->unk_1E8.unk_18.y -= -10.0f; func_80034A14(&this->actor, &this->unk_1E8, 0, phi_a3); @@ -248,20 +260,20 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa1* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); if (!func_80AA08C4(this, globalCtx)) { Actor_Kill(&this->actor); return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_1E8.unk_00 = 0; if ((!(gSaveContext.eventChkInf[1] & 0x10)) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) { @@ -342,7 +354,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) { this->unk_1E8.unk_00 = 1; this->actor.flags |= 0x10000; this->actionFunc = func_80AA106C; - } else if (this->actor.xzDistToLink < 30.0f + (f32)this->collider.dim.radius) { + } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { player->stateFlags2 |= 0x800000; } } @@ -384,7 +396,7 @@ void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa1* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA0A0C(this); @@ -424,7 +436,7 @@ void EnMa1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Vec3f vec = D_80AA16B8; if (limbIndex == 15) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } @@ -437,7 +449,7 @@ void EnMa1_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma1.c", 1226); camera = ACTIVE_CAM; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index cc73f4b212..ff55495958 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -23,7 +23,7 @@ void func_80AA21C8(EnMa2* this, GlobalContext* globalCtx); const ActorInit En_Ma2_InitVars = { ACTOR_EN_MA2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA2, sizeof(EnMa2), @@ -34,14 +34,26 @@ const ActorInit En_Ma2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA2858[] = { { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, @@ -129,7 +141,7 @@ void func_80AA1AE4(EnMa2* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = 0.0f; func_80034A14(&this->actor, &this->unk_1E0, 0, phi_a3); @@ -211,11 +223,11 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa2* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); switch (func_80AA1B58(this, globalCtx)) { case 1: @@ -239,9 +251,9 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_1E0.unk_00 = 0; } @@ -267,7 +279,7 @@ void func_80AA204C(EnMa2* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x2000000; func_8010BD58(globalCtx, 0x23); this->actionFunc = func_80AA20E4; - } else if (this->actor.xzDistToLink < 30.0f + (f32)this->collider.dim.radius) { + } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { player->stateFlags2 |= 0x800000; } } @@ -309,7 +321,7 @@ void EnMa2_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa2* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA1CC0(this); @@ -355,7 +367,7 @@ void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma2.c", 904); if (limbIndex == 18) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } if ((limbIndex == 14) && (this->skelAnime.animation == &D_060093BC)) { gSPDisplayList(POLY_OPA_DISP++, D_06005420); @@ -373,7 +385,7 @@ void EnMa2_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma2.c", 955); camera = ACTIVE_CAM; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 2145f0a6fb..e14d4c5b9e 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -27,7 +27,7 @@ void func_80AA3200(EnMa3* this, GlobalContext* globalCtx); const ActorInit En_Ma3_InitVars = { ACTOR_EN_MA3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA2, sizeof(EnMa3), @@ -38,12 +38,26 @@ const ActorInit En_Ma3_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA3848[] = { { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, @@ -186,7 +200,7 @@ void func_80AA2E54(EnMa3* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = 0.0f; func_80034A14(&this->actor, &this->unk_1E0, 0, phi_a3); } @@ -240,11 +254,11 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa3* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); switch (func_80AA2EC8(this, globalCtx)) { case 0: @@ -260,7 +274,7 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); this->unk_1E0.unk_00 = (u16)0; } @@ -283,7 +297,7 @@ void EnMa3_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa3* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA2F80(this); @@ -335,7 +349,7 @@ void EnMa3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma3.c", 927); if (limbIndex == 18) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } if ((limbIndex == 14) && (this->skelAnime.animation == &D_060093BC)) { gSPDisplayList(POLY_OPA_DISP++, &D_06005420); @@ -353,7 +367,7 @@ void EnMa3_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma3.c", 978); camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 2710a351cc..217ea77d60 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -24,7 +24,7 @@ extern u8 D_06024E40[]; // "Ocarina of Time" const ActorInit En_Mag_InitVars = { ACTOR_EN_MAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MAG, sizeof(EnMag), diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 20e8327b52..c8269bec3b 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -11,7 +11,7 @@ void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Mb_InitVars = { ACTOR_EN_MB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_MB, sizeof(EnMb), @@ -70,48 +70,157 @@ void EnMb_SetupAction(EnMb* this, EnMbActionFunc actionFunc) { } static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static DamageTable sDamageTable = { - 0x50, 0xF2, 0xF1, 0xF2, 0x10, 0xF2, 0xF2, 0xF2, 0xF1, 0xF2, 0xF4, 0xF2, 0x64, 0xF2, 0xF4, 0xF2, - 0xF2, 0x50, 0x63, 0x50, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x50, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x5), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(1, 0xF), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(2, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x6), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x5), + /* Ice magic */ DMG_ENTRY(3, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x5), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x5), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sBigMoblinDamageTable = { - 0x50, 0xF2, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0xF2, 0x64, 0xF2, 0xF4, 0xF2, - 0xF2, 0x50, 0x63, 0x50, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x50, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x5), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x6), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x5), + /* Ice magic */ DMG_ENTRY(3, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x5), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x5), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 74, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 5300, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -121,8 +230,8 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { s16 yawDiff; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 46.0f); - this->actor.colChkInfo.mass = 0xFF; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 46.0f); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.damageTable = &sDamageTable; Collider_InitCylinder(globalCtx, &this->collider1); Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit); @@ -136,7 +245,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable, this->morphTable, 28); this->actor.colChkInfo.health = 2; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->unk_360 = 1000.0f; this->unk_364 = 1750.0f; func_80AA6830(this); @@ -145,7 +254,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014190, &D_0600EBE4, this->jointTable, this->morphTable, 28); this->actor.colChkInfo.health = 6; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.damageTable = &sBigMoblinDamageTable; Actor_SetScale(&this->actor, 0.02f); this->collider1.dim.height = 170; @@ -154,15 +263,15 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneScale = 800.0f; this->actor.uncullZoneDownward = 1800.0f; this->unk_364 = 710.0f; - this->collider2.body.toucher.flags = 0x20000000; - yawDiff = (this->actor.posRot.rot.y - Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos)); + this->collider2.info.toucher.dmgFlags = 0x20000000; + yawDiff = (this->actor.world.rot.y - Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos)); if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = thisx->posRot.rot.y + 0x8000; - this->actor.shape.rot.y = thisx->posRot.rot.y; - this->actor.posRot.pos.z = thisx->posRot.pos.z + 600.0f; + this->actor.world.rot.y = thisx->world.rot.y + 0x8000; + this->actor.shape.rot.y = thisx->world.rot.y; + this->actor.world.pos.z = thisx->world.pos.z + 600.0f; } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 90.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); this->actor.flags &= ~1; this->actor.naviEnemyId++; func_80AA6898(this); @@ -175,7 +284,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.params = 1; this->waypoint = 0; this->actor.colChkInfo.health = 1; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->unk_360 = 350.0f; this->unk_364 = 1750.0f; this->actor.flags &= ~1; @@ -193,10 +302,10 @@ void EnMb_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AA6408(EnMb* this, GlobalContext* globalCtx) { - s16 yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + s16 yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); this->actor.shape.rot.y = yaw; - this->actor.posRot.rot.y = yaw; + this->actor.world.rot.y = yaw; } void func_80AA6444(EnMb* this, GlobalContext* globalCtx) { @@ -230,12 +339,12 @@ s32 func_80AA652C(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; phi_a2 = 0; - if ((this->actor.posRot.rot.y < -0x62A2) || (this->actor.posRot.rot.y >= 0x62A3)) { + if ((this->actor.world.rot.y < -0x62A2) || (this->actor.world.rot.y >= 0x62A3)) { phi_a2 = -0x8000; - } else if (this->actor.posRot.rot.y < -0x20E0) { + } else if (this->actor.world.rot.y < -0x20E0) { phi_a2 = -0x4000; } else { - if (this->actor.posRot.rot.y >= 0x20E1) { + if (this->actor.world.rot.y >= 0x20E1) { phi_a2 = 0x4000; } } @@ -243,8 +352,8 @@ s32 func_80AA652C(EnMb* this, GlobalContext* globalCtx) { sinAngle = Math_SinS(phi_a2); cosAngle = ABS(cosAngle); sinAngle = ABS(sinAngle); - xDist = this->actor.posRot.pos.x - player->actor.posRot.pos.x; - zDist = this->actor.posRot.pos.z - player->actor.posRot.pos.z; + xDist = this->actor.world.pos.x - player->actor.world.pos.x; + zDist = this->actor.world.pos.z - player->actor.world.pos.z; xDistABS = ABS(xDist); if (xDistABS < cosAngle * 37.0f + sinAngle * 400.0f) { if (0 <= zDist) { @@ -275,11 +384,11 @@ void func_80AA66A0(EnMb* this, GlobalContext* globalCtx) { points.x = pointPath->x; points.y = pointPath->y; points.z = pointPath->z; - yawToPoints = Math_Vec3f_Yaw(&this->actor.posRot.pos, &points); - yawDiff = yawToPoints - this->actor.yawTowardsLink; + yawToPoints = Math_Vec3f_Yaw(&this->actor.world.pos, &points); + yawDiff = yawToPoints - this->actor.yawTowardsPlayer; yawDiffABS = (yawDiff >= 0) ? yawDiff : -yawDiff; if (yawDiffABS <= 0x1770) { - this->actor.posRot.rot.y = yawToPoints; + this->actor.world.rot.y = yawToPoints; if (pathIndex == this->waypoint) { this->direction = -this->direction; } @@ -372,7 +481,7 @@ void func_80AA6BF0(EnMb* this) { this->unk_320 = 10; Animation_Change(&this->skelAnime, &D_0600B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f); this->unk_32E = 1; - yawDiff = (this->actor.posRot.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer); if (yawDiff >= 0) { yawDiffABS = yawDiff; @@ -475,10 +584,10 @@ void func_80AA702C(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attackParams = 0; } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.params == 0) { if (this->actor.colChkInfo.health == 0) { func_80AA6F04(this); @@ -520,21 +629,21 @@ void func_80AA71AC(EnMb* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->unk_32A == 0) { - this->unk_330 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + this->unk_330 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_330, 1, 0x3E8, 0) == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_80AA6A18(this); } } else { this->unk_32A--; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, 1, 0x3E8, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x3E8, 0); } - yDist = this->actor.yDistToLink; + yDist = this->actor.yDistToPlayer; yDistAbs = ABS(yDist); if ((yDistAbs <= 20.0f) && func_80AA652C(this, globalCtx)) { - yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsLink; + yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; yawDiffAbs = ABS(yawDiff); - if ((yawDiffAbs <= 0x4000) || (func_8002DDE4(globalCtx) != 0) && (this->actor.xzDistToLink < 160.0f)) { + if ((yawDiffAbs <= 0x4000) || (func_8002DDE4(globalCtx) != 0) && (this->actor.xzDistToPlayer < 160.0f)) { func_80AA66A0(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_VOICE); func_80AA6AC8(this); @@ -547,7 +656,7 @@ void func_80AA7310(EnMb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.5f, 1.0f, 0.0f); if (this->actor.speedXZ > 1.0f) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); } if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->unk_32A == 0) { @@ -586,20 +695,20 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } if (this->actor.bgCheckFlags & 1) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); if (1.0f < this->actor.speedXZ) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); } if (this->unk_32A != 0) { this->unk_32E--; if (this->unk_32E == 0) { - yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsLink; + yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; - if ((ABS(this->actor.yDistToLink) <= 20.0f) && (func_80AA652C(this, globalCtx) != 0) && - (ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToLink <= 200.0f)) { + if ((ABS(this->actor.yDistToPlayer) <= 20.0f) && (func_80AA652C(this, globalCtx) != 0) && + (ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer <= 200.0f)) { func_80AA6AC8(this); } else { endFrame = Animation_GetLastFrame(&D_06002C10); @@ -608,7 +717,7 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM); } - } else if (this->actor.xzDistToLink <= 160.0f) { + } else if (this->actor.xzDistToPlayer <= 160.0f) { this->actor.speedXZ = -5.0f; } else { this->actor.speedXZ = 0.0f; @@ -620,7 +729,7 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06002F10, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, 0.0f); this->unk_32A = 1; } else { - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos) - this->actor.yawTowardsLink; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos) - this->actor.yawTowardsPlayer; if (ABS(yawDiff) <= 0x4000) { func_80AA68FC(this, globalCtx); @@ -636,7 +745,7 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) { s32 currentFrame; s16 yawDiff; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (yawDiff < 0) { yawDiff = -yawDiff; @@ -651,11 +760,11 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) { if (this->unk_32E != 0) { this->unk_32E--; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); } else { this->actor.speedXZ = 10.0f; this->attackParams = 1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if ((currentFrame != (s32)this->skelAnime.curFrame) && (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 6))) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); @@ -677,10 +786,10 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { s16 sp54[] = { 20, 40, 0 }; s16 sp4C[] = { -2500, 0, 3500 }; - Math_SmoothStepToS(&this->actor.shape.rot.y, sp4C[this->attackParams - 1] + this->actor.posRot.rot.y, 1, 0x2EE, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, sp4C[this->attackParams - 1] + this->actor.world.rot.y, 1, 0x2EE, 0); - if (this->collider2.base.atFlags & 2) { - this->collider2.base.atFlags &= ~2; + if (this->collider2.base.atFlags & AT_HIT) { + this->collider2.base.atFlags &= ~AT_HIT; if (this->collider2.base.at == &player->actor) { u8 oldInvincibilityTimer = player->invincibilityTimer; @@ -693,8 +802,8 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { } } - func_8002F71C(globalCtx, &this->actor, ((650.0f - this->actor.xzDistToLink) * 0.04f) + 4.0f, - this->actor.posRot.rot.y, 8.0f); + func_8002F71C(globalCtx, &this->actor, ((650.0f - this->actor.xzDistToPlayer) * 0.04f) + 4.0f, + this->actor.world.rot.y, 8.0f); player->invincibilityTimer = oldInvincibilityTimer; } @@ -708,13 +817,13 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { } } else { sp74 = this->effSpawnPos; - sp74.y = this->actor.groundY; + sp74.y = this->actor.floorHeight; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_HAM_LAND); - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); EffectSsBlast_SpawnWhiteShockwave(globalCtx, &sp74, &sp68, &sp68); func_80033480(globalCtx, &sp74, 2.0f, 3, 0x12C, 0xB4, 1); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); - func_800358DC(&this->actor, &sp74, &this->actor.posRot.rot, &sp5C, 20, &sp54, globalCtx, -1, 0); + func_800358DC(&this->actor, &sp74, &this->actor.world.rot, &sp5C, 20, &sp54, globalCtx, -1, 0); func_80AA6DA4(this); } } else { @@ -735,7 +844,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; sp4C = 0; - sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.posRot.rot.y); + sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y); currentFrame = (s32)this->skelAnime.curFrame; if (SkelAnime_Update(&this->skelAnime) != 0) { Animation_PlayLoop(&this->skelAnime, &D_06002F10); @@ -743,19 +852,19 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } if (this->unk_32E != 0) { this->unk_32E--; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 1, 0x1F40, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x1F40, 0); sp48 = 0; } else { this->actor.speedXZ = 10.0f; this->attackParams = 1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if (currentFrame != (s32)this->skelAnime.curFrame) { if (((s32)this->skelAnime.curFrame == 2 || (s32)this->skelAnime.curFrame == 6)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); } } } - if (this->collider2.base.atFlags & 2) { + if (this->collider2.base.atFlags & AT_HIT) { if (this->collider2.base.at == &player->actor) { if ((sp48 == 0) && !(player->stateFlags2 & 0x80)) { if (player->invincibilityTimer < 0) { @@ -766,7 +875,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - if (!(this->collider2.base.atFlags & 4)) { + if (!(this->collider2.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } if (globalCtx->grabPlayer(globalCtx, player) != 0) { @@ -775,27 +884,27 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } sp4C = 1; } else { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + - (Math_SinS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.x = this->actor.world.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + + (Math_SinS(this->actor.shape.rot.y) * 89.0f); sp4C = 1; - player->actor.posRot.pos.z = this->actor.posRot.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + - (Math_CosS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.z = this->actor.world.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + + (Math_CosS(this->actor.shape.rot.y) * 89.0f); player->unk_850 = 0; player->actor.speedXZ = 0.0f; player->actor.velocity.y = 0.0f; } if (sp48 != 0) { if ((sp4C != 0) || (player->stateFlags2 & 0x80)) { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & 0x80) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } } this->attackParams = 0; @@ -812,16 +921,16 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; sp54 = 0; - sp50 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.posRot.rot.y); + sp50 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y); currentFrame = (s32)this->skelAnime.curFrame; SkelAnime_Update(&this->skelAnime); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if (currentFrame != (s32)this->skelAnime.curFrame) { if (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 6)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); } } - if (this->collider2.base.atFlags & 2) { + if (this->collider2.base.atFlags & AT_HIT) { if (this->collider2.base.at == &player->actor) { if ((sp50 == 0) && !(player->stateFlags2 & 0x80)) { if (player->invincibilityTimer < 0) { @@ -832,7 +941,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - if (!(this->collider2.base.atFlags & 4)) { + if (!(this->collider2.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } if (globalCtx->grabPlayer(globalCtx, player) != 0) { @@ -841,27 +950,27 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } sp54 = 1; } else { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + - (Math_SinS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.x = this->actor.world.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + + (Math_SinS(this->actor.shape.rot.y) * 89.0f); sp54 = 1; - player->actor.posRot.pos.z = this->actor.posRot.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + - (Math_CosS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.z = this->actor.world.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + + (Math_CosS(this->actor.shape.rot.y) * 89.0f); player->unk_850 = 0; player->actor.speedXZ = 0.0f; player->actor.velocity.y = 0.0f; } if (sp50 != 0) { if ((sp54 != 0) || (player->stateFlags2 & 0x80)) { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & 0x80) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } this->attackParams = 0; this->actor.speedXZ = -10.0f; @@ -873,8 +982,8 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } } func_80AA6408(this, globalCtx); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - if ((this->unk_32E == 0) && Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &this->actor.posRot.pos) < 80.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y; + if ((this->unk_32E == 0) && Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) < 80.0f) { this->attackParams = 0; func_80AA6CC0(this); } @@ -885,7 +994,7 @@ void func_80AA8378(EnMb* this, GlobalContext* globalCtx) { if (this->unk_32E != 0) { Animation_PlayOnce(&this->skelAnime, &D_0600E18C); this->unk_32E = 0; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); Camera_AddQuake(&globalCtx->mainCamera, 2, 25, 5); } else { func_80AA6898(this); @@ -923,7 +1032,7 @@ void func_80AA8514(EnMb* this, GlobalContext* globalCtx) { Vec3f effZeroVector; s32 effectsPerFrame; - effPosition = this->actor.posRot.pos; + effPosition = this->actor.world.pos; effPosition.x += Math_SinS(this->actor.shape.rot.y) * -70.0f; effPosition.z += Math_CosS(this->actor.shape.rot.y) * -70.0f; Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); @@ -944,7 +1053,7 @@ void func_80AA8514(EnMb* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else if (((s32)this->skelAnime.curFrame == 15) || ((s32)this->skelAnime.curFrame == 22)) { - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_80033260(globalCtx, &this->actor, &effPosition, 50.0f, 0xA, 3.0f, 0x190, 0x3C, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); @@ -961,7 +1070,7 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { s16 yaw; f32 playSpeedABS; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiff = ABS(yawDiff); Math_SmoothStepToF(&this->actor.speedXZ, 0.59999996f, 0.1f, 1.0f, 0.0f); this->skelAnime.playSpeed = this->actor.speedXZ; @@ -971,19 +1080,18 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { sp48 = this->skelAnime.curFrame - playSpeedABS; playSpeedABS = ABS(this->skelAnime.playSpeed); - if ((this->unk_32E == 0) && - (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < this->unk_364)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 750, 0); + if ((this->unk_32E == 0) && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->unk_364)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0); this->actor.flags |= 1; - if ((this->actor.xzDistToLink < 500.0f) && (yawDiff <= 0x1387)) { + if ((this->actor.xzDistToPlayer < 500.0f) && (yawDiff <= 0x1387)) { func_80AA6AC8(this); } } else { this->actor.flags &= ~1; - if ((this->unk_360 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos)) || + if ((this->unk_360 < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos)) || (this->soundTimer != 0)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 1, 750, 0); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 750, 0); } if (this->soundTimer != 0) { this->soundTimer--; @@ -1011,7 +1119,7 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { @@ -1022,20 +1130,20 @@ void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { s32 yawDiffAbs; f32 playSpeedABS; - if (Math_Vec3f_DistXZ(&this->waypointPos, &this->actor.posRot.pos) <= 8.0f || - Rand_ZeroOne() < 0.1f && Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &this->actor.posRot.pos) <= 4.0f) { + if (Math_Vec3f_DistXZ(&this->waypointPos, &this->actor.world.pos) <= 8.0f || + Rand_ZeroOne() < 0.1f && Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) <= 4.0f) { func_80AA68FC(this, globalCtx); } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.59999996f, 0.1f, 1.0f, 0.0f); this->skelAnime.playSpeed = (this->actor.speedXZ + this->actor.speedXZ); } - this->unk_330 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_330, 1, 0x5DC, 0); - yDistAbs = (this->actor.yDistToLink >= 0.0f) ? this->actor.yDistToLink : -this->actor.yDistToLink; + this->unk_330 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_330, 1, 0x5DC, 0); + yDistAbs = (this->actor.yDistToPlayer >= 0.0f) ? this->actor.yDistToPlayer : -this->actor.yDistToPlayer; if (yDistAbs <= 20.0f && func_80AA652C(this, globalCtx) != 0) { - yawDiff = (this->actor.shape.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.shape.rot.y - this->actor.yawTowardsPlayer); yawDiffAbs = ABS(yawDiff); - if (yawDiffAbs <= 0x4000 || func_8002DDE4(globalCtx) != 0 && this->actor.xzDistToLink < 160.0f) { + if (yawDiffAbs <= 0x4000 || func_8002DDE4(globalCtx) != 0 && this->actor.xzDistToPlayer < 160.0f) { func_80AA66A0(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_VOICE); func_80AA6AC8(this); @@ -1063,7 +1171,7 @@ void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80AA8DD8(EnMb* this, GlobalContext* globalCtx) { @@ -1072,9 +1180,9 @@ void func_80AA8DD8(EnMb* this, GlobalContext* globalCtx) { s16 yawDiff; s32 yawDiffAbs; - yawDiff = (this->actor.posRot.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer); SkelAnime_Update(&this->skelAnime); - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < this->unk_364) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->unk_364) { if (!(player->stateFlags1 & 0x4000000)) { yawDiffAbs = ABS(yawDiff); if (yawDiffAbs < 0x3E80) { @@ -1088,7 +1196,7 @@ void func_80AA8E88(EnMb* this) { s16 yawDiff; s32 yawDiffABS; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffABS = ABS(yawDiff); if (yawDiffABS <= 0x4000) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06001950, -4.0f); @@ -1099,7 +1207,7 @@ void func_80AA8E88(EnMb* this) { } this->unk_32A = 30; this->unk_320 = 0; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DEAD); EnMb_SetupAction(this, func_80AA8F50); } @@ -1119,7 +1227,7 @@ void func_80AA8FC8(EnMb* this) { s16 yawDiff; s32 yawDiffAbs; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffAbs = ABS(yawDiff); if (yawDiffAbs <= 0x4000) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f); @@ -1128,7 +1236,7 @@ void func_80AA8FC8(EnMb* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f); this->actor.speedXZ = 8.0f; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_32A = 30; this->unk_320 = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DEAD); @@ -1145,7 +1253,7 @@ void func_80AA90A0(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attackParams = 0; } } @@ -1155,18 +1263,18 @@ void func_80AA90A0(EnMb* this, GlobalContext* globalCtx) { s32 i; Vec3f effPos; - this->actor.shape.unk_10 = 0.0f; + this->actor.shape.shadowScale = 0.0f; this->unk_32A--; for (i = 4; i >= 0; i--) { - effPos.x = Rand_CenteredFloat(110.0f) + this->actor.posRot.pos.x; - effPos.y = Rand_CenteredFloat(15.0f) + (this->actor.posRot.pos.y + 20.0f); - effPos.z = Rand_CenteredFloat(110.0f) + this->actor.posRot.pos.z; + effPos.x = Rand_CenteredFloat(110.0f) + this->actor.world.pos.x; + effPos.y = Rand_CenteredFloat(15.0f) + (this->actor.world.pos.y + 20.0f); + effPos.z = Rand_CenteredFloat(110.0f) + this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &effPos, &zeroVec, &zeroVec, 0x64, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0xFF, 0, 1, 9, 1); } } else { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -1193,8 +1301,8 @@ void func_80AA92B8(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9D9C, &this->collider2.dim.quad[0]); Matrix_MultVec3f(&D_80AA9DA8, &this->collider2.dim.quad[3]); Matrix_MultVec3f(&D_80AA9DB4, &this->collider2.dim.quad[2]); - func_80062734(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], - &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); + Collider_SetQuadVertices(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], + &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); } void func_80AA9440(Actor* thisx, GlobalContext* globalCtx) { @@ -1208,30 +1316,30 @@ void func_80AA9440(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9DCC, &this->collider2.dim.quad[0]); Matrix_MultVec3f(&D_80AA9DD8, &this->collider2.dim.quad[3]); Matrix_MultVec3f(&D_80AA9DE4, &this->collider2.dim.quad[2]); - func_80062734(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], - &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); + Collider_SetQuadVertices(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], + &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); } void func_80AA94D8(EnMb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->collider3.base.acFlags & 2) { - this->collider3.base.acFlags &= ~0x82; - this->collider1.base.acFlags &= ~2; + if (this->collider3.base.acFlags & AC_HIT) { + this->collider3.base.acFlags &= ~(AC_HIT | AC_BOUNCED); + this->collider1.base.acFlags &= ~AC_HIT; return; } - if ((this->collider1.base.acFlags & 2) && (this->unk_320 >= 5)) { - this->collider1.base.acFlags &= ~2; + if ((this->collider1.base.acFlags & AC_HIT) && (this->unk_320 >= 5)) { + this->collider1.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect != 0) && (this->actor.colChkInfo.damageEffect != 5)) { if ((player->stateFlags2 & 0x80) && &this->actor == player->actor.parent) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.posRot.rot.y, 6.0f); + func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); } this->unk_188 = this->actor.colChkInfo.damageEffect; this->attackParams = 0; - func_80035650(&this->actor, &this->collider1.body, 0); + func_80035650(&this->actor, &this->collider1.info, 0); if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 6)) { if (this->unk_320 != 5) { Actor_ApplyDamage(&this->actor); @@ -1265,9 +1373,9 @@ void EnMb_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->colChkInfo.damageEffect != 5) { this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 40.0f, 40.0f, 70.0f, 0x1D); - Actor_SetHeight(thisx, thisx->scale.x * 4500.0f); - Collider_CylinderUpdate(thisx, &this->collider1); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 40.0f, 40.0f, 70.0f, 0x1D); + Actor_SetFocus(thisx, thisx->scale.x * 4500.0f); + Collider_UpdateCylinder(thisx, &this->collider1); if (thisx->colChkInfo.health <= 0) { this->collider1.dim.pos.x += (Math_SinS(thisx->shape.rot.y) * (-4400.0f * thisx->scale.y)); this->collider1.dim.pos.z += (Math_CosS(thisx->shape.rot.y) * (-4400.0f * thisx->scale.y)); @@ -1305,7 +1413,7 @@ void EnMb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec func_80AA9440(&this->actor, globalCtx); } } - func_8002BDB0(&this->actor, limbIndex, 0x16, &D_80AA9DFC, 0x1B, &D_80AA9DFC); + Actor_SetFeetPos(&this->actor, limbIndex, 22, &D_80AA9DFC, 27, &D_80AA9DFC); } if (this->unk_328 != 0) { switch (limbIndex) { @@ -1378,11 +1486,11 @@ void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9E20[i], &phi_s2[i]); Matrix_MultVec3f(&D_80AA9E44[i], &phi_s0[i]); } - func_800627A0(&this->collider3, 0, &phi_s2[0], &phi_s2[1], &phi_s2[2]); - func_800627A0(&this->collider3, 1, &phi_s0[0], &phi_s0[1], &phi_s0[2]); + Collider_SetTrisVertices(&this->collider3, 0, &phi_s2[0], &phi_s2[1], &phi_s2[2]); + Collider_SetTrisVertices(&this->collider3, 1, &phi_s0[0], &phi_s0[1], &phi_s0[2]); } if (this->unk_328 != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; if (this->unk_328 >= 0) { this->unk_328--; } diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h index 9f3e39416f..51b724edcb 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -36,7 +36,7 @@ typedef struct EnMb { /* 0x0368 */ ColliderCylinder collider1; /* 0x03B4 */ ColliderQuad collider2; /* 0x0434 */ ColliderTris collider3; - /* 0x0454 */ ColliderTrisItem collider3Items[2]; + /* 0x0454 */ ColliderTrisElement collider3Items[2]; } EnMb; // size = 0x050C extern const ActorInit En_Mb_InitVars; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5bce798043..2a8be4b847 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -24,7 +24,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx); const ActorInit En_Md_InitVars = { ACTOR_EN_MD, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MD, sizeof(EnMd), @@ -35,14 +35,26 @@ const ActorInit En_Md_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 36, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x060002C8, 0.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060002C8, 0.0f, 0.0f, -1.0f, 0x00, -10.0f }, @@ -482,8 +494,8 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) { s16 temp2; s16 yawDiff; - if (this->actor.xzDistToLink < 170.0f) { - yawDiff = (f32)this->actor.yawTowardsLink - this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer < 170.0f) { + yawDiff = (f32)this->actor.yawTowardsPlayer - this->actor.shape.rot.y; absYawDiff = ABS(yawDiff); temp = (absYawDiff <= func_800347E8(2)) ? 2 : 1; @@ -511,7 +523,7 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) { this->unk_1E0.unk_14 = 40.0f; temp = 2; } else { - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = (gSaveContext.linkAge > 0) ? 0.0f : -18.0f; } @@ -538,9 +550,9 @@ u8 EnMd_FollowPath(EnMd* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000, + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000, 1); if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 100.0f) { @@ -565,9 +577,9 @@ u8 EnMd_SetMovedPos(EnMd* this, GlobalContext* globalCtx) { lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; - this->actor.posRot.pos.x = lastPointPos->x; - this->actor.posRot.pos.y = lastPointPos->y; - this->actor.posRot.pos.z = lastPointPos->z; + this->actor.world.pos.x = lastPointPos->x; + this->actor.world.pos.y = lastPointPos->y; + this->actor.world.pos.z = lastPointPos->z; return 1; } @@ -581,10 +593,10 @@ void func_80AAB5A4(EnMd* this, GlobalContext* globalCtx) { ? 100.0f : 400.0f; this->alpha = func_80034DD4(this, globalCtx, this->alpha, temp); - this->actor.shape.unk_14 = this->alpha; + this->actor.shape.shadowAlpha = this->alpha; } else { this->alpha = 255; - this->actor.shape.unk_14 = this->alpha; + this->actor.shape.shadowAlpha = this->alpha; } } @@ -592,12 +604,12 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) { EnMd* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007FB8, NULL, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (!EnMd_ShouldSpawn(&this->actor, globalCtx)) { Actor_Kill(&this->actor); return; @@ -605,16 +617,16 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) { func_80034EC0(&this->skelAnime, sAnimations, 0); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->alpha = 255; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_KOKIRI); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, FAIRY_KOKIRI); if (((globalCtx->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) || ((globalCtx->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || ((globalCtx->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) { - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB948; return; } @@ -657,18 +669,18 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { func_80AAAA24(this); if (this->unk_1E0.unk_00 == 0) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &actorToBlock->posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &actorToBlock->world.pos); - this->actor.posRot.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot.pos.x += 60.0f * Math_SinS(yaw); + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.x += 60.0f * Math_SinS(yaw); - this->actor.posRot.pos.z = this->actor.initPosRot.pos.z; - this->actor.posRot.pos.z += 60.0f * Math_CosS(yaw); + this->actor.world.pos.z = this->actor.home.pos.z; + this->actor.world.pos.z += 60.0f * Math_CosS(yaw); - temp = fabsf((f32)this->actor.yawTowardsLink - yaw) * 0.001f * 3.0f; + temp = fabsf((f32)this->actor.yawTowardsPlayer - yaw) * 0.001f * 3.0f; this->skelAnime.playSpeed = CLAMP(temp, 1.0f, 3.0f); } @@ -707,7 +719,7 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink < (30.0f + this->collider.dim.radius)) { + if (this->actor.xzDistToPlayer < (30.0f + this->collider.dim.radius)) { player->stateFlags2 |= 0x800000; } } @@ -736,7 +748,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) { func_80AAA93C(this); if (!(EnMd_FollowPath(this, globalCtx)) || (this->waypoint != 0)) { - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; return; } @@ -752,7 +764,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB8F8; } @@ -760,14 +772,14 @@ void EnMd_Update(Actor* thisx, GlobalContext* globalCtx) { EnMd* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); EnMd_UpdateEyes(this); func_80AAB5A4(this, globalCtx); Actor_MoveForward(&this->actor); func_80AAB158(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); } @@ -802,7 +814,7 @@ void EnMd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec = { 400.0f, 0.0f, 0.0f }; if (limbIndex == 16) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index b74d487388..9d1dea7e86 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06005DF0; /* const ActorInit En_Mk_InitVars = { ACTOR_EN_MK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MK, sizeof(EnMk), @@ -33,6 +33,26 @@ const ActorInit En_Mk_InitVars = { (ActorFunc)EnMk_Update, (ActorFunc)EnMk_Draw, }; + +static ColliderCylinderInit D_80AAD620 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s") diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index ee9ab4c012..542f25e566 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_0602CA38; /* const ActorInit En_Mm_InitVars = { ACTOR_EN_MM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MM, sizeof(EnMm), @@ -24,6 +24,26 @@ const ActorInit En_Mm_InitVars = { (ActorFunc)EnMm_Update, (ActorFunc)EnMm_Draw, }; + +static ColliderCylinderInit D_80AAEAE0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AAD770.s") diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index bd5d7cc656..a4ff8e1e07 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_06005E18; /* const ActorInit En_Mm2_InitVars = { ACTOR_EN_MM2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MM, sizeof(EnMm2), @@ -23,6 +23,26 @@ const ActorInit En_Mm2_InitVars = { (ActorFunc)EnMm2_Update, (ActorFunc)EnMm2_Draw, }; + +static ColliderCylinderInit D_80AAFAC0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mm2/func_80AAEE50.s") diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 104221d3bc..8846c30bf8 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -23,7 +23,7 @@ void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx); const ActorInit En_Ms_InitVars = { ACTOR_EN_MS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MS, sizeof(EnMs), @@ -33,8 +33,14 @@ const ActorInit En_Ms_InitVars = { (ActorFunc)EnMs_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 22, 37, 0, { 0 } }, }; @@ -48,8 +54,8 @@ static u16 sOfferTextIDs[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; extern AnimationHeader D_060005EC; @@ -77,11 +83,11 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + Collider_SetCylinderType1(globalCtx, &this->collider, this, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.015f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; @@ -100,14 +106,14 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { s16 yawDiff; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; EnMs_SetOfferText(&this->actor, globalCtx); if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated this->actionFunc = EnMs_Talk; return; } - if ((this->actor.xzDistToLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range + if ((this->actor.xzDistToPlayer < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range func_8002F2CC(&this->actor, globalCtx, 90.0f); } } @@ -163,8 +169,8 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; this->activeTimer += 1; - Actor_SetHeight(&this->actor, 20.0f); - this->actor.unk_4C = 500.0f; + Actor_SetFocus(&this->actor, 20.0f); + this->actor.targetArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); SkelAnime_Update(&this->skelAnime); this->actionFunc(this, globalCtx); @@ -172,10 +178,10 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.entranceIndex == 0x157 && gSaveContext.sceneSetupIndex == 8) { // ride carpet if in credits Actor_MoveForward(&this->actor); osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void EnMs_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 18a9418e4b..fec3a81f3c 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_06004F70; /* const ActorInit En_Mu_InitVars = { ACTOR_EN_MU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MU, sizeof(EnMu), @@ -24,6 +24,26 @@ const ActorInit En_Mu_InitVars = { (ActorFunc)EnMu_Update, (ActorFunc)EnMu_Draw, }; + +static ColliderCylinderInit D_80AB0BD0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 100, 70, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mu/func_80AB0420.s") diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 4c467f67bb..d6ccc50ce4 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -78,9 +78,22 @@ extern AnimationHeader D_06005614; // crossed legs, looking behind to the right extern Gfx D_06013158[]; extern UNK_TYPE D_0600D8E8; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -138,14 +151,14 @@ void EnNb_SetupCollider(Actor* thisx, GlobalContext* globalCtx) { EnNb* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, thisx, &sCylinderInit); } void EnNb_UpdateCollider(EnNb* this, GlobalContext* globalCtx) { s32 pad[4]; ColliderCylinder* collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); } @@ -158,7 +171,7 @@ void EnNb_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80AB0FBC(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_300.unk_18 = player->actor.posRot.pos; + this->unk_300.unk_18 = player->actor.world.pos; this->unk_300.unk_14 = kREG(16) + 9.0f; func_80034A14(&this->actor, &this->unk_300, kREG(17) + 0xC, 2); } @@ -166,7 +179,7 @@ void func_80AB0FBC(EnNb* this, GlobalContext* globalCtx) { void func_80AB1040(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_300.unk_18 = player->actor.posRot.pos; + this->unk_300.unk_18 = player->actor.world.pos; this->unk_300.unk_14 = kREG(16) + 9.0f; func_80034A14(&this->actor, &this->unk_300, kREG(17) + 0xC, 4); } @@ -204,7 +217,7 @@ void func_80AB11EC(EnNb* this) { this->drawMode = NB_DRAW_NOTHING; this->alpha = 0; this->flag = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->alphaTimer = 0.0f; } @@ -228,7 +241,7 @@ void func_80AB1210(EnNb* this, GlobalContext* globalCtx) { } void func_80AB1284(EnNb* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); } s32 EnNb_FrameUpdateMatrix(EnNb* this) { @@ -248,10 +261,10 @@ void EnNb_SetupCsPosRot(EnNb* this, GlobalContext* globalCtx, s32 npcActionIdx) Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; - thisx->posRot.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; + thisx->world.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; } } @@ -282,10 +295,10 @@ void EnNb_SetInitialCsPosRot(EnNb* this, GlobalContext* globalCtx, s32 npcAction Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; - thisx->posRot.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; + thisx->world.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; } } @@ -310,22 +323,22 @@ void EnNb_SetCurrentAnim(EnNb* this, AnimationHeader* animation, u8 mode, f32 tr void EnNb_SetChamberAnim(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06009694, 0, 0, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void EnNb_SpawnBlueWarp(EnNb* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void EnNb_GiveMedallion(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 50.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 50.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xC); @@ -333,7 +346,7 @@ void EnNb_GiveMedallion(EnNb* this, GlobalContext* globalCtx) { } void EnNb_ComeUpImpl(EnNb* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 83.333336f; + this->actor.shape.yOffset += 83.333336f; } void EnNb_SetupChamberCsImpl(EnNb* this, GlobalContext* globalCtx) { @@ -346,7 +359,7 @@ void EnNb_SetupChamberCsImpl(EnNb* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = &D_80AB431C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -365,9 +378,9 @@ void EnNb_SetupChamberWarpImpl(EnNb* this, GlobalContext* globalCtx) { } void EnNb_SetupDefaultChamberIdle(EnNb* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = NB_CHAMBER_IDLE; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -455,7 +468,7 @@ void func_80AB19FC(EnNb* this, GlobalContext* globalCtx) { void EnNb_SetupLightArrowOrSealingCs(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06000410, 2, 0.0f, 0); this->action = NB_ACTION_7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_PlaySealingSound(void) { @@ -463,8 +476,8 @@ void EnNb_PlaySealingSound(void) { } void EnNb_InitializeDemo6K(EnNb* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(21) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 7); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(21) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 7); } void EnNb_SetupHide(EnNb* this, GlobalContext* globalCtx) { @@ -472,7 +485,7 @@ void EnNb_SetupHide(EnNb* this, GlobalContext* globalCtx) { this->action = NB_SEAL_HIDE; this->drawMode = NB_DRAW_HIDE; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->alphaTimer = 0.0f; EnNb_PlaySealingSound(); } @@ -489,7 +502,7 @@ void EnNb_CheckToFade(EnNb* this, GlobalContext* globalCtx) { this->drawMode = NB_DRAW_DEFAULT; *alphaTimer = kREG(5) + 10.0f; this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; return; } } else { @@ -499,14 +512,14 @@ void EnNb_CheckToFade(EnNb* this, GlobalContext* globalCtx) { this->drawMode = NB_DRAW_NOTHING; *alphaTimer = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*alphaTimer / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void EnNb_SetupLightOrb(EnNb* this, GlobalContext* globalCtx) { @@ -521,7 +534,7 @@ void EnNb_SetupLightOrb(EnNb* this, GlobalContext* globalCtx) { this->flag = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -568,7 +581,7 @@ void EnNb_DrawTransparency(EnNb* this, GlobalContext* globalCtx) { void EnNb_InitKidnap(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06001E7C, 0, 0.0f, 0); this->action = NB_KIDNAPPED; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; gSaveContext.eventChkInf[9] |= 0x20; } @@ -586,7 +599,7 @@ void EnNb_PlayAgonySFX(EnNb* this, GlobalContext* globalCtx) { void EnNb_SetPosInPortal(EnNb* this, GlobalContext* globalCtx) { CsCmdActorAction* csCmdNPCAction = EnNb_GetNpcCsAction(globalCtx, 1); - Vec3f* pos = &this->actor.posRot.pos; + Vec3f* pos = &this->actor.world.pos; f32 f0; s32 pad; Vec3f startPos; @@ -610,7 +623,7 @@ void EnNb_SetupCaptureCutsceneState(EnNb* this, GlobalContext* globalCtx) { EnNb_SetupCsPosRot(this, globalCtx, 1); this->action = NB_KIDNAPPED; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_SetRaisedArmCaptureAnim(EnNb* this, s32 animFinished) { @@ -698,7 +711,7 @@ void EnNb_SetupConfrontation(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, animation, 0, 0.0f, 0); this->action = NB_IN_CONFRONTATION; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_PlayKnuckleDefeatSFX(EnNb* this, GlobalContext* globalCtx) { @@ -736,8 +749,8 @@ void EnNb_PlayLookLeftSFX(EnNb* this) { } void EnNb_InitDemo6KInConfrontation(EnNb* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(21) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0xB); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(21) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0xB); } void func_80AB2688(EnNb* this, GlobalContext* globalCtx) { @@ -748,7 +761,7 @@ void func_80AB2688(EnNb* this, GlobalContext* globalCtx) { void func_80AB26C8(EnNb* this) { this->action = NB_IN_CONFRONTATION; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) { @@ -760,7 +773,7 @@ void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, 0.0f); this->action = NB_ACTION_14; this->drawMode = NB_DRAW_KNEEL; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_SetupKneel(EnNb* this) { @@ -770,7 +783,7 @@ void EnNb_SetupKneel(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, 0.0f); this->action = NB_KNEEL; this->drawMode = NB_DRAW_KNEEL; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfKneeling(EnNb* this, s32 animFinished) { @@ -790,7 +803,7 @@ void EnNb_SetupLookRight(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_LOOK_RIGHT; this->drawMode = NB_DRAW_DEFAULT; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfLookingRight(EnNb* this, s32 animFinished) { @@ -810,7 +823,7 @@ void EnNb_SetupLookLeft(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_LOOK_LEFT; this->drawMode = NB_DRAW_LOOK_DIRECTION; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfLookLeft(EnNb* this, s32 animFinished) { @@ -836,13 +849,13 @@ void EnNb_SetupRun(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_RUN; this->drawMode = NB_DRAW_LOOK_DIRECTION; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_SetupConfrontationDestroy(EnNb* this) { this->action = NB_CONFRONTATION_DESTROYED; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_CheckConfrontationCsMode(EnNb* this, GlobalContext* globalCtx) { @@ -1006,7 +1019,7 @@ void EnNb_SetupCreditsSpawn(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06000BC0, 0, 0.0f, 0); this->action = NB_CREDITS_INIT; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_SetAlphaInCredits(EnNb* this) { @@ -1017,11 +1030,11 @@ void EnNb_SetAlphaInCredits(EnNb* this) { if ((kREG(17) + 10.0f) <= this->alphaTimer) { this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } else { alpha = (*alphaTimer / (kREG(17) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } } @@ -1116,7 +1129,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06004BB4, 0, 0.0f, 0); this->headTurnFlag = 1; this->actor.flags |= 9; - this->actor.posRot.pos = this->finalPos; + this->actor.world.pos = this->finalPos; this->action = NB_IDLE_AFTER_TALK; this->drawMode = NB_DRAW_DEFAULT; } @@ -1126,7 +1139,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) { } void func_80AB359C(EnNb* this) { - PosRot* posRot = &this->actor.posRot; + PosRot* world = &this->actor.world; Vec3f* initialPos = &this->initialPos; Vec3f* finalPos = &this->finalPos; f32 f0; @@ -1140,9 +1153,9 @@ void func_80AB359C(EnNb* this) { if (temp_t1 >= this->movementTimer) { f0 = func_8006F9BC(temp_t1, 0, this->movementTimer, 3, 3); - posRot->pos.x = initialPos->x + (f0 * (finalPos->x - initialPos->x)); - posRot->pos.y = initialPos->y + (f0 * (finalPos->y - initialPos->y)); - posRot->pos.z = initialPos->z + (f0 * (finalPos->z - initialPos->z)); + world->pos.x = initialPos->x + (f0 * (finalPos->x - initialPos->x)); + world->pos.y = initialPos->y + (f0 * (finalPos->y - initialPos->y)); + world->pos.z = initialPos->z + (f0 * (finalPos->z - initialPos->z)); } } @@ -1152,10 +1165,10 @@ void EnNb_SetNoticeSFX(EnNb* this) { s32 EnNb_GetNoticedStatus(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerZ = player->actor.posRot.pos.z; - f32 thisX = this->actor.posRot.pos.x; - f32 thisZ = this->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerZ = player->actor.world.pos.z; + f32 thisX = this->actor.world.pos.x; + f32 thisZ = this->actor.world.pos.z; if (SQ(playerX - thisX) + SQ(playerZ - thisZ) < SQ(80.0f)) { return true; @@ -1175,7 +1188,7 @@ void func_80AB36DC(EnNb* this, GlobalContext* globalCtx) { } else { s16 invScale = (u16)(kREG(17) + 25) - moveTime; if (invScale > 0) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, invScale, 6200, 100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, invScale, 6200, 100); } } } @@ -1428,7 +1441,7 @@ void EnNb_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnNb* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); EnNb_SetupCollider(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060181C8, NULL, this->jointTable, this->morphTable, 19); @@ -1482,12 +1495,12 @@ void EnNb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec2; Matrix_MultVec3f(&vec1, &vec2); - this->actor.posRot2.pos.x = vec2.x; - this->actor.posRot2.pos.y = vec2.y; - this->actor.posRot2.pos.z = vec2.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = vec2.x; + this->actor.focus.pos.y = vec2.y; + this->actor.focus.pos.z = vec2.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } @@ -1532,7 +1545,7 @@ void EnNb_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Nb_InitVars = { ACTOR_EN_NB, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_NB, sizeof(EnNb), diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 447c0e42bf..b81089c25a 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -39,7 +39,7 @@ static s16 D_80AB85E0 = 0; const ActorInit En_Niw_InitVars = { ACTOR_EN_NIW, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NIW, sizeof(EnNiw), @@ -74,21 +74,49 @@ static u8 sLowerRiverSpawned = false; static u8 sUpperRiverSpawned = false; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK5, 0x00, 0x09, 0x01, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 15, 25, 4, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 15, 25, 4, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 6, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; extern FlexSkeletonHeader D_06002530; @@ -129,27 +157,27 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags |= 1; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); if (globalCtx->sceneNum == SCENE_SPOT01) { for (i = 0; i < ARRAY_COUNT(sKakarikoPosList); i++) { - if (fabsf(this->actor.posRot.pos.x - sKakarikoPosList[i].x) < 40.0f && - fabsf(this->actor.posRot.pos.z - sKakarikoPosList[i].z) < 40.0f) { + if (fabsf(this->actor.world.pos.x - sKakarikoPosList[i].x) < 40.0f && + fabsf(this->actor.world.pos.z - sKakarikoPosList[i].z) < 40.0f) { this->unk_2AA = i; osSyncPrintf(VT_FGCOL(YELLOW) " 通常鶏index %d\n" VT_RST, this->unk_2AA); if (gSaveContext.infTable[25] & sKakarikoFlagList[i]) { - this->actor.posRot.pos.x = 300.0f; - this->actor.posRot.pos.y = 100.0f; - this->actor.posRot.pos.z = 1530.0f; + this->actor.world.pos.x = 300.0f; + this->actor.world.pos.y = 100.0f; + this->actor.world.pos.z = 1530.0f; this->actor.params = 0; } } } } - Math_Vec3f_Copy(&this->unk_2AC, &this->actor.posRot.pos); - Math_Vec3f_Copy(&this->unk_2B8, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->unk_2AC, &this->actor.world.pos); + Math_Vec3f_Copy(&this->unk_2B8, &this->actor.world.pos); this->unk_304 = 10.0f; Actor_SetScale(&this->actor, 0.01f); this->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5; @@ -199,7 +227,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case 0xA: - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; case 0xD: case 0xE: Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit2); @@ -372,12 +400,12 @@ void func_80AB6100(EnNiw* this, GlobalContext* globalCtx, s32 arg2) { this->timer6 = 150; if (this->timer8 == 0) { this->timer8 = 70; - this->unk_2E4 = this->actor.yawTowardsLink; + this->unk_2E4 = this->actor.yawTowardsPlayer; } } } targetRotY = this->unk_2E4 + factor; - Math_SmoothStepToS(&this->actor.posRot.rot.y, targetRotY, 3, this->unk_2FC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, targetRotY, 3, this->unk_2FC, 0); Math_ApproachF(&this->unk_2FC, 3000.0f, 1.0f, 500.0f); func_80AB5BF8(this, globalCtx, 5); } @@ -410,9 +438,9 @@ void func_80AB6324(EnNiw* this, GlobalContext* globalCtx) { void func_80AB63A8(EnNiw* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y < 0.0f) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = @@ -427,7 +455,7 @@ void func_80AB63A8(EnNiw* this, GlobalContext* globalCtx) { void func_80AB6450(EnNiw* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->actor.xzDistToLink < 30.0f && fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 5.0f) { + if (this->actor.xzDistToPlayer < 30.0f && fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 5.0f) { this->timer6 = 100; this->actor.gravity = -2.0f; this->actionFunc = func_80AB7290; @@ -539,11 +567,11 @@ void func_80AB6570(EnNiw* this, GlobalContext* globalCtx) { if (this->timer4 != 0) { Math_ApproachZeroF(&this->unk_26C[9], 0.5f, 4000.0f); tmp = 1; - Math_ApproachF(&this->actor.posRot.pos.x, this->unk_2B8, 1.0f, this->unk_2FC); - Math_ApproachF(&this->actor.posRot.pos.z, this->unk_2C0, 1.0f, this->unk_2FC); + Math_ApproachF(&this->actor.world.pos.x, this->unk_2B8, 1.0f, this->unk_2FC); + Math_ApproachF(&this->actor.world.pos.z, this->unk_2C0, 1.0f, this->unk_2FC); Math_ApproachF(&this->unk_2FC, 3.0f, 1.0f, 0.3f); - posY = this->unk_2B8 - this->actor.posRot.pos.x; - posZ = this->unk_2C0 - this->actor.posRot.pos.z; + posY = this->unk_2B8 - this->actor.world.pos.x; + posZ = this->unk_2C0 - this->actor.world.pos.z; if (fabsf(posY) < 10.0f) { posY = 0.0; @@ -556,7 +584,7 @@ void func_80AB6570(EnNiw* this, GlobalContext* globalCtx) { this->unk_29E = 7; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(posY, posZ) * (0x8000 / M_PI), 3, this->unk_300, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(posY, posZ) * (0x8000 / M_PI), 3, this->unk_300, 0); Math_ApproachF(&this->unk_300, 10000.0f, 1.0f, 1000.0f); } @@ -571,9 +599,9 @@ void func_80AB6A38(EnNiw* this, GlobalContext* globalCtx) { s16 pathIndex = this->path - 1; if (this->path == 0) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = this->unk_2FC = this->unk_300 = 0.0f; @@ -582,8 +610,8 @@ void func_80AB6A38(EnNiw* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[pathIndex]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; this->unk_2E4 = Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI); func_80AB6100(this, globalCtx, 2); @@ -631,9 +659,9 @@ void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) { return; } if (this->actor.params == 0xE) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = @@ -679,7 +707,7 @@ void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) { } void func_80AB6EB4(EnNiw* this, GlobalContext* globalCtx) { - if (this->actor.posRot.pos.y > 400.0f) { + if (this->actor.world.pos.y > 400.0f) { Actor_Kill(&this->actor); } @@ -699,11 +727,11 @@ void func_80AB6F04(EnNiw* this, GlobalContext* globalCtx) { this->actor.gravity = 0.0f; if (this->actor.yDistToWater > 15.0f) { - this->actor.posRot.pos.y += 2.0f; + this->actor.world.pos.y += 2.0f; } if (this->timer4 == 0) { this->timer4 = 30; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); pos.y += this->actor.yDistToWater; EffectSsGRipple_Spawn(globalCtx, &pos, 100, 500, 30); } @@ -773,7 +801,7 @@ void func_80AB714C(EnNiw* this, GlobalContext* globalCtx) { } if (this->timer5 == 0) { this->timer7 = 10; - this->unk_2E4 = this->actor.yawTowardsLink; + this->unk_2E4 = this->actor.yawTowardsPlayer; this->actor.flags &= ~1; this->actionFunc = func_80AB7204; } @@ -807,9 +835,9 @@ void func_80AB7328(EnNiw* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->timer6 == 0) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = this->unk_2FC = this->unk_300 = 0.0f; @@ -818,8 +846,8 @@ void func_80AB7328(EnNiw* this, GlobalContext* globalCtx) { } this->actionFunc = EnNiw_ResetAction; } else { - this->unk_2E4 = Math_FAtan2F(this->actor.posRot.pos.x - player->actor.posRot.pos.x, - this->actor.posRot.pos.z - player->actor.posRot.pos.z) * + this->unk_2E4 = Math_FAtan2F(this->actor.world.pos.x - player->actor.world.pos.x, + this->actor.world.pos.z - player->actor.world.pos.z) * (0x8000 / M_PI); func_80AB6100(this, globalCtx, 0); func_80AB5BF8(this, globalCtx, 2); @@ -835,8 +863,8 @@ void func_80AB7420(EnNiw* this, GlobalContext* globalCtx) { void func_80AB747C(EnNiw* this, GlobalContext* globalCtx) { if (this->unk_2A8 == 0 && this->actor.params != 0xA && this->actionFunc != func_80AB6450 && - this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->sfxTimer1 = 30; if (this->unk_2A4 > 0 && D_80AB85E0 == 0) { this->unk_2A4--; @@ -884,9 +912,9 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } for (i = 0; i < featherCount; i++) { - pos.x = Rand_CenteredFloat(10.0f) + thisx->posRot.pos.x; - pos.y = Rand_CenteredFloat(10.0f) + (thisx->posRot.pos.y + this->unk_304); - pos.z = Rand_CenteredFloat(10.0f) + thisx->posRot.pos.z; + pos.x = Rand_CenteredFloat(10.0f) + thisx->world.pos.x; + pos.y = Rand_CenteredFloat(10.0f) + (thisx->world.pos.y + this->unk_304); + pos.z = Rand_CenteredFloat(10.0f) + thisx->world.pos.z; scale = Rand_ZeroFloat(6.0f) + 6.0f; if (this->unk_2A6 == 2 && this->unk_304 != 0) { @@ -945,46 +973,46 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->timer9 != 0) { this->timer9--; } - thisx->shape.rot = thisx->posRot.rot; - thisx->shape.unk_10 = 15.0f; + thisx->shape.rot = thisx->world.rot; + thisx->shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->unk_304); + Actor_SetFocus(&this->actor, this->unk_304); Actor_MoveForward(&this->actor); if (this->actionFunc != func_80AB6EB4 && this->actionFunc != func_80AB6450 && globalCtx->sceneNum != SCENE_SPOT03) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 31); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 31); } if (globalCtx->sceneNum == SCENE_SPOT03) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 29); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 29); } - if (thisx->groundY <= BGCHECK_Y_MIN || thisx->groundY >= 32000.0f) { - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n" VT_RST, thisx->groundY); + if (thisx->floorHeight <= BGCHECK_Y_MIN || thisx->floorHeight >= 32000.0f) { + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n" VT_RST, thisx->floorHeight); cam.x = globalCtx->view.lookAt.x - globalCtx->view.eye.x; cam.y = globalCtx->view.lookAt.y - globalCtx->view.eye.y; cam.z = globalCtx->view.lookAt.z - globalCtx->view.eye.z; camResult = cam.y / sqrtf(SQ(cam.x) + SQ(cam.y) + SQ(cam.z)); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.x); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.y); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.z); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.x); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.y); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.z); - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; - thisx->posRot.pos.y = ((thisx->initPosRot.pos.y + globalCtx->view.eye.y) + (camResult * 160.0f)); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.x); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.y); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.z); + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.z = thisx->home.pos.z; + thisx->world.pos.y = ((thisx->home.pos.y + globalCtx->view.eye.y) + (camResult * 160.0f)); - if (thisx->posRot.pos.y < thisx->initPosRot.pos.y) { - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 300.0f; + if (thisx->world.pos.y < thisx->home.pos.y) { + thisx->world.pos.y = thisx->home.pos.y + 300.0f; } - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.x); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.y); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.z); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); osSyncPrintf("\n\n"); thisx->speedXZ = 0.0f; thisx->gravity = -2.0f; - Math_Vec3f_Copy(&this->unk_2AC, &thisx->initPosRot); - Math_Vec3f_Copy(&this->unk_2B8, &thisx->initPosRot); + Math_Vec3f_Copy(&this->unk_2AC, &thisx->home); + Math_Vec3f_Copy(&this->unk_2B8, &thisx->home); this->unk_300 = 0.0f; this->unk_2FC = 0.0f; this->unk_2F0.z = 0.0f; @@ -1014,7 +1042,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) { thisx->velocity.y = 0.0f; thisx->gravity = 0.0f; - Math_Vec3f_Copy(&pos, &thisx->posRot); + Math_Vec3f_Copy(&pos, &thisx->world); pos.y += thisx->yDistToWater; this->timer4 = 30; EffectSsGSplash_Spawn(globalCtx, &pos, 0, 0, 0, 400); @@ -1029,7 +1057,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { if (D_80AB85E0 == 0 && this->unk_2A4 <= 0 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) { this->timer6 = 100; - if (thisx->xzDistToLink > 10.0f) { + if (thisx->xzDistToPlayer > 10.0f) { D_80AB85E0 = 1; this->timer5 = this->timer4 = this->unk_29E = 0; thisx->speedXZ = 0.0f; @@ -1041,9 +1069,9 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_26C[8] = 0.0f; this->sfxTimer1 = 10000; this->unk_2A8 = 1; - this->unk_2AC = this->unk_2B8 = thisx->posRot.pos.x; - this->unk_2B0 = this->unk_2BC = thisx->posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = thisx->posRot.pos.z; + this->unk_2AC = this->unk_2B8 = thisx->world.pos.x; + this->unk_2B0 = this->unk_2BC = thisx->world.pos.y; + this->unk_2B4 = this->unk_2C0 = thisx->world.pos.z; this->actionFunc = func_80AB70A0; return; } @@ -1051,8 +1079,8 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { dist = 20.0f; - if (this->unk_2A8 != 0 && thisx->xyzDistToLinkSq < SQ(dist) && player->invincibilityTimer == 0) { - func_8002F6D4(globalCtx, &this->actor, 2.0f, thisx->posRot.rot.y, 0.0f, 0x10); + if (this->unk_2A8 != 0 && thisx->xyzDistToPlayerSq < SQ(dist) && player->invincibilityTimer == 0) { + func_8002F6D4(globalCtx, &this->actor, 2.0f, thisx->world.rot.y, 0.0f, 0x10); } func_80AB747C(&this->actor, globalCtx); @@ -1071,15 +1099,15 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } } if (this->unk_2A8 == 0) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (thisx->params != 0xA && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 4) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != func_80AB6BF8 && this->actionFunc != func_80AB6D08 && this->actionFunc != func_80AB6324 && this->actionFunc != func_80AB63A8 && this->actionFunc != func_80AB6450) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } @@ -1118,7 +1146,7 @@ void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx) { EnNiw_OverrideLimbDraw, NULL, this); if (this->actionFunc == func_80AB6450) { - func_80033C30(&this->actor.posRot.pos, &scale, 255, globalCtx); + func_80033C30(&this->actor.world.pos, &scale, 255, globalCtx); } EnNiw_FeatherDraw(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 24c721a6b2..5a81402748 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -22,7 +22,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx); const ActorInit En_Niw_Girl_InitVars = { ACTOR_EN_NIW_GIRL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GR, sizeof(EnNiwGirl), @@ -33,8 +33,22 @@ const ActorInit En_Niw_Girl_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 10, 30, 0, { 0, 0, 0 } }, }; @@ -56,7 +70,7 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009948, &D_06000378, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; if (this->actor.params < 0) { this->actor.params = 0; } @@ -68,13 +82,13 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) { vec1.z = 50.0; Matrix_MultVec3f(&vec1, &vec2); this->chasedEnNiw = (EnNiw*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_NIW, this->actor.posRot.pos.x + vec2.x, - this->actor.posRot.pos.y + vec2.y, this->actor.posRot.pos.z + vec2.z, 0, this->actor.posRot.rot.y, 0, 0xA); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_NIW, this->actor.world.pos.x + vec2.x, + this->actor.world.pos.y + vec2.y, this->actor.world.pos.z + vec2.z, 0, this->actor.world.rot.y, 0, 0xA); if (this->chasedEnNiw != NULL) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ シツレイしちゃうわね!プンプン ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ きゃははははは、まてー ☆☆☆☆☆ %d\n" VT_RST, this->path); osSyncPrintf("\n\n"); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = EnNiwGirl_Talk; } else { osSyncPrintf("\n\n"); @@ -104,8 +118,8 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.2f, 0.4f); // Find the X and Z distance between the girl and the cuckoo she is chasing - xDistBetween = this->chasedEnNiw->actor.posRot.pos.x - this->actor.posRot.pos.x; - zDistBetween = this->chasedEnNiw->actor.posRot.pos.z - this->actor.posRot.pos.z; + xDistBetween = this->chasedEnNiw->actor.world.pos.x - this->actor.world.pos.x; + zDistBetween = this->chasedEnNiw->actor.world.pos.z - this->actor.world.pos.z; if (func_8010BDBC(&globalCtx->msgCtx) != 0) { this->chasedEnNiw->path = 0; } @@ -120,7 +134,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(xDistBetween, zDistBetween) * 10430.378f, 3, this->unk_27C, 0); Math_ApproachF(&this->unk_27C, 5000.0f, 30.0f, 150.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; // Only allow Link to talk to her when she is playing the jumping animation if ((this->jumpTimer == 0) || (Player_GetMask(globalCtx) != PLAYER_MASK_NONE)) { @@ -195,11 +209,11 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->unk_280 = 30.0f; - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); if (tempActionFunc == this->actionFunc) { - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_2D4.unk_18.y = player->actor.posRot.pos.y - 10.0f; + this->unk_2D4.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(&this->actor, &this->unk_2D4, 2, 4); this->unk_260 = this->unk_2D4.unk_08; @@ -217,9 +231,9 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 100.0f, 100.0f, 200.0f, 0x1C); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 100.0f, 100.0f, 200.0f, 0x1C); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnNiwGirlOverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, @@ -247,7 +261,7 @@ void EnNiwGirl_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80AB99D8[this->unk_272])); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnNiwGirlOverrideLimbDraw, 0, this); - func_80033C30(&this->actor.posRot.pos, &sp4C, 255, globalCtx); + func_80033C30(&this->actor.world.pos, &sp4C, 255, globalCtx); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_niw_girl.c", 592); } diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 4b5cc5aa59..9bff836bfc 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -27,7 +27,7 @@ void func_80ABAD7C(EnNiwLady* this, GlobalContext* globalCtx); const ActorInit En_Niw_Lady_InitVars = { ACTOR_EN_NIW_LADY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ANE, sizeof(EnNiwLady), @@ -46,8 +46,22 @@ static s16 D_80ABB3B4[] = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 10, 0, { 0, 0, 0 } }, }; @@ -151,11 +165,11 @@ void func_80AB9F24(EnNiwLady* this, GlobalContext* globalCtx) { this->unk_27E = 1; this->actor.gravity = -3.0f; Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 20.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_272 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.draw = EnNiwLady_Draw; switch (this->unk_278) { case 0: @@ -192,11 +206,11 @@ void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) { s32 phi_s1; this->cuccosInPen = 0; - currentCucco = (EnNiw*)globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + currentCucco = (EnNiw*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (currentCucco != NULL) { if (currentCucco->actor.id == ACTOR_EN_NIW) { - if ((fabsf(currentCucco->actor.posRot.pos.x - 330.0f) < 90.0f) && - (fabsf(currentCucco->actor.posRot.pos.z - 1610.0f) < 190.0f)) { + if ((fabsf(currentCucco->actor.world.pos.x - 330.0f) < 90.0f) && + (fabsf(currentCucco->actor.world.pos.z - 1610.0f) < 190.0f)) { if (this->unk_26C == 0) { gSaveContext.infTable[25] |= D_80ABB3B4[currentCucco->unk_2AA]; if (BREG(1) != 0) { @@ -480,10 +494,10 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { EnNiwLady* this = THIS; Player* player = PLAYER; - Actor_SetHeight(thisx, 60.0f); - this->unk_288.unk_18 = player->actor.posRot.pos; + Actor_SetFocus(thisx, 60.0f); + this->unk_288.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_288.unk_18.y = player->actor.posRot.pos.y - 10.0f; + this->unk_288.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(thisx, &this->unk_288, 2, 4); this->unk_254 = this->unk_288.unk_08; @@ -518,8 +532,8 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { this->unusedRandomTimer = ((s16)Rand_ZeroFloat(60.0f) + 0x14); } } - func_8002E4B4(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); - Collider_CylinderUpdate(thisx, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); + Collider_UpdateCylinder(thisx, &this->collider); if (1) {} CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 96687e3681..3632ecc0fd 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -21,7 +21,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx); const ActorInit En_Nutsball_InitVars = { ACTOR_EN_NUTSBALL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnNutsball), @@ -32,8 +32,22 @@ const ActorInit En_Nutsball_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_ON, + }, { 13, 13, 0, { 0 } }, }; @@ -45,7 +59,7 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { EnNutsball* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); + ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[this->actor.params]); @@ -85,33 +99,33 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; } - this->actor.initPosRot.rot.z += 0x2AA8; + this->actor.home.rot.z += 0x2AA8; - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & 2) || - (this->collider.base.acFlags & 2) || (this->collider.base.maskA & 2)) { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { // Checking if the player is using a shield that reflects projectiles // And if so, reflects the projectile on impact if ((player->currentShield == PLAYER_SHIELD_DEKU) || ((player->currentShield == PLAYER_SHIELD_HYLIAN) && LINK_IS_ADULT)) { - if ((this->collider.base.atFlags & 2) && (this->collider.base.atFlags & 0x10) && - (this->collider.base.atFlags & 4)) { - this->collider.base.atFlags &= ~0x16; - this->collider.base.atFlags |= 0x08; + if ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.atFlags & AT_TYPE_ENEMY) && + (this->collider.base.atFlags & AT_BOUNCED)) { + this->collider.base.atFlags &= ~AT_TYPE_ENEMY & ~AT_BOUNCED & ~AT_HIT; + this->collider.base.atFlags |= AT_TYPE_PLAYER; - this->collider.body.toucher.flags = 2; + this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp4C, 0); - this->actor.posRot.rot.y = sp4C.y + 0x8000; + this->actor.world.rot.y = sp4C.y + 0x8000; this->timer = 30; return; } } - sp40.x = this->actor.posRot.pos.x; - sp40.y = this->actor.posRot.pos.y + 4; - sp40.z = this->actor.posRot.pos.z; + sp40.x = this->actor.world.pos.x; + sp40.y = this->actor.world.pos.y + 4; + sp40.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } else { if (this->timer == -300) { @@ -129,14 +143,14 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); + Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -147,7 +161,7 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); - Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); + Matrix_RotateZ(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params]); diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 8f0f1869a0..673b9b384d 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -39,7 +39,7 @@ extern Gfx D_06000D50[]; const ActorInit En_Nwc_InitVars = { ACTOR_EN_NWC, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NWC, sizeof(EnNwc), @@ -49,13 +49,26 @@ const ActorInit En_Nwc_InitVars = { (ActorFunc)EnNwc_Draw, }; -static ColliderJntSphItemInit sJntSphElementInit = { - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, +static ColliderJntSphElementInit sJntSphElementInit = { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 10 }, 100 }, }; -static ColliderJntSphInit_Set3 sJntSphInit = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, COLSHAPE_JNTSPH }, +static ColliderJntSphInitType1 sJntSphInit = { + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_JNTSPH, + }, 16, NULL, }; @@ -105,7 +118,7 @@ void EnNwc_ChickFall(EnNwcChick* chick, EnNwc* this, GlobalContext* globalCtx) { void EnNwc_UpdateChicks(EnNwc* this, GlobalContext* globalCtx) { static EnNwcChickFunc chickActionFuncs[] = { EnNwc_ChickNoop, EnNwc_ChickFall }; EnNwcChick* chick = this->chicks; - ColliderJntSphItem* element = this->collider.list; + ColliderJntSphElement* element = this->collider.elements; Vec3f prevChickPos; s32 i; f32 test; @@ -198,25 +211,25 @@ void EnNwc_DrawChicks(EnNwc* this, GlobalContext* globalCtx) { void EnNwc_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnNwc* this = THIS; - ColliderJntSphItemInit elementInits[16]; - ColliderJntSphItemInit* element; + ColliderJntSphElementInit elementInits[16]; + ColliderJntSphElementInit* element; EnNwcChick* chick; s32 i; - element = sJntSphInit.list = elementInits; + element = sJntSphInit.elements = elementInits; for (i = 0; i < 16; i++, element++) { *element = sJntSphElementInit; } Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph_Set3(globalCtx, &this->collider, &this->actor, &sJntSphInit); + Collider_SetJntSphAllocType1(globalCtx, &this->collider, &this->actor, &sJntSphInit); this->count = 16; chick = this->chicks; for (i = 0; i < this->count; i++, chick++) { chick->type = CHICK_NORMAL; - chick->pos.x = thisx->posRot.pos.x + ((Rand_ZeroOne() * 100.0f) - 50.0f); - chick->pos.y = thisx->posRot.pos.y + 20.0f; - chick->pos.z = thisx->posRot.pos.z + ((Rand_ZeroOne() * 100.0f) - 50.0f); + chick->pos.x = thisx->world.pos.x + ((Rand_ZeroOne() * 100.0f) - 50.0f); + chick->pos.y = thisx->world.pos.y + 20.0f; + chick->pos.z = thisx->world.pos.z + ((Rand_ZeroOne() * 100.0f) - 50.0f); chick->height = 5; } EnNwc_SetUpdate(this, EnNwc_Idle); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 473ec73a2b..05940a2205 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06001FC8; /* const ActorInit En_Ny_InitVars = { ACTOR_EN_NY, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_NY, sizeof(EnNy), @@ -25,6 +25,33 @@ const ActorInit En_Ny_InitVars = { (ActorFunc)EnNy_Update, (ActorFunc)EnNy_Draw, }; + +static ColliderJntSphElementInit D_80ABE330[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 15 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80ABE354 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80ABE330, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s") diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c index 0416dd7150..422a0a96bb 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -19,7 +19,7 @@ void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx); const ActorInit En_OE2_InitVars = { ACTOR_EN_OE2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OE2, sizeof(EnOE2), diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 7affec989f..7536232e0a 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -20,7 +20,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx const ActorInit En_Okarina_Effect_InitVars = { ACTOR_EN_OKARINA_EFFECT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOkarinaEffect), @@ -116,8 +116,8 @@ void EnOkarinaEffect_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (BREG(0) != 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 44068f0eff..1ed1e2f588 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -24,7 +24,7 @@ void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx); const ActorInit En_Okarina_Tag_InitVars = { ACTOR_EN_OKARINA_TAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOkarinaTag), @@ -60,9 +60,9 @@ void EnOkarinaTag_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_152 = 0; this->unk_158 = 1; } - this->actor.unk_1F = 1; - if (this->actor.posRot.rot.z > 0) { - this->unk_15C = this->actor.posRot.rot.z * 40.0f; + this->actor.targetMode = 1; + if (this->actor.world.rot.z > 0) { + this->unk_15C = this->actor.world.rot.z * 40.0f; } // "Save information" @@ -72,7 +72,7 @@ void EnOkarinaTag_Init(Actor* thisx, GlobalContext* globalCtx) { // "Correct answer information" osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 正解情報\t ☆☆☆☆☆ %d\n" VT_RST, this->unk_152); // "Range information" - osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); // "Processing range information" osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 処理範囲情報\t ☆☆☆☆☆ %f\n" VT_RST, this->unk_15C); // "Hit?" @@ -120,10 +120,10 @@ void func_80ABEF2C(EnOkarinaTag* this, GlobalContext* globalCtx) { if ((this->unk_152 != 6) || (gSaveContext.scarecrowSpawnSongSet)) { if (player->stateFlags2 & 0x1000000) { // "North! ! ! ! !" - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToLink); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); } - if ((this->actor.xzDistToLink < (90.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 80.0f)) { + if ((this->actor.xzDistToPlayer < (90.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if (player->stateFlags2 & 0x2000000) { unk_152 = this->unk_152; if (unk_152 == 6) { @@ -132,8 +132,8 @@ void func_80ABEF2C(EnOkarinaTag* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x800000; func_8010BD58(globalCtx, unk_152 + 0x22); this->actionFunc = func_80ABF0CC; - } else if ((this->actor.xzDistToLink < (50.0f + this->unk_15C) && - ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 40.0f)))) { + } else if ((this->actor.xzDistToPlayer < (50.0f + this->unk_15C) && + ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)))) { this->unk_15A = 0; player->unk_6A8 = &this->actor; } @@ -194,8 +194,8 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; } else if (((this->unk_150 != 4) || !(gSaveContext.eventChkInf[4] & 0x800)) && ((this->unk_150 != 6) || !(gSaveContext.eventChkInf[1] & 0x2000)) && - (this->actor.xzDistToLink < (90.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 80.0f)) { + (this->actor.xzDistToPlayer < (90.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if (player->stateFlags2 & 0x1000000) { switch (this->unk_150) { case 1: @@ -219,8 +219,8 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { } player->stateFlags2 |= 0x800000; this->actionFunc = func_80ABF4C8; - } else if ((this->actor.xzDistToLink < (50.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 40.0f)) { + } else if ((this->actor.xzDistToPlayer < (50.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)) { this->unk_15A = 0; player->stateFlags2 |= 0x800000; } @@ -285,9 +285,9 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80ABF7CC; } else { - yawDiff = this->actor.yawTowardsLink - this->actor.posRot.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; this->unk_15A++; - if (!(this->actor.xzDistToLink > 120.0f)) { + if (!(this->actor.xzDistToPlayer > 120.0f)) { if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { // "This poem is dedicated to the memory of the dearly departed members of the Royal Family." this->actor.textId = 0x5021; @@ -322,13 +322,13 @@ void EnOkarinaTag_Update(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0) != 0) { if (this->unk_15A != 0) { if (!(this->unk_15A & 1)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); } } else { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 3586a2e960..d30920238a 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -22,7 +22,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx); const ActorInit En_Okuta_InitVars = { ACTOR_EN_OKUTA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_OKUTA, sizeof(EnOkuta), @@ -42,27 +42,85 @@ extern AnimationHeader D_06003910; extern AnimationHeader D_06003C64; static ColliderCylinderInit sProjectileColliderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 13, 20, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sOctorockColliderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, -30, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 1, 0xF, 0x3C, 0x64 }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 60, 100 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x02, 0x34, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 66, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 6500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 6500, ICHAIN_STOP), }; void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -79,28 +137,28 @@ void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003660, &D_06003C64, this->jointTable, this->morphTable, 38); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sOctorockColliderInit); - func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); if ((this->numShots == 0xFF) || (this->numShots == 0)) { this->numShots = 1; } - thisx->groundY = - BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &thisx->floorPoly, &sp30, thisx, &thisx->posRot.pos); + thisx->floorHeight = + BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &thisx->floorPoly, &sp30, thisx, &thisx->world.pos); //! @bug calls WaterBox_GetSurfaceImpl directly - if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, thisx->posRot.pos.x, thisx->posRot.pos.z, &ySurface, + if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, thisx->world.pos.x, thisx->world.pos.z, &ySurface, &outWaterBox) || - (ySurface <= thisx->groundY)) { + (ySurface <= thisx->floorHeight)) { Actor_Kill(thisx); } else { - thisx->initPosRot.pos.y = ySurface; + thisx->home.pos.y = ySurface; } EnOkuta_SetupWaitToAppear(this); } else { - ActorShape_Init(&thisx->shape, 1100.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&thisx->shape, 1100.0f, ActorShadow_DrawCircle, 18.0f); thisx->flags &= ~1; thisx->flags |= 0x10; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sProjectileColliderInit); - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_PROP); this->timer = 30; thisx->shape.rot.y = 0; this->actionFunc = EnOkuta_ProjectileFly; @@ -118,7 +176,7 @@ void EnOkuta_SpawnBubbles(EnOkuta* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 10; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, -10.0f, 10.0f, 30.0f, 0.25f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -10.0f, 10.0f, 30.0f, 0.25f); } } @@ -131,17 +189,17 @@ void EnOkuta_SpawnDust(Vec3f* pos, Vec3f* velocity, s16 scaleStep, GlobalContext } void EnOkuta_SpawnSplash(EnOkuta* this, GlobalContext* globalCtx) { - EffectSsGSplash_Spawn(globalCtx, &this->actor.initPosRot.pos, NULL, NULL, 0, 1300); + EffectSsGSplash_Spawn(globalCtx, &this->actor.home.pos, NULL, NULL, 0, 1300); } void EnOkuta_SpawnRipple(EnOkuta* this, GlobalContext* globalCtx) { Vec3f pos; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.initPosRot.pos.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.home.pos.y; + pos.z = this->actor.world.pos.z; if ((globalCtx->gameplayFrames % 7) == 0 && - ((this->actionFunc != EnOkuta_Shoot) || ((this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) < 50.0f))) { + ((this->actionFunc != EnOkuta_Shoot) || ((this->actor.world.pos.y - this->actor.home.pos.y) < 50.0f))) { EffectSsGRipple_Spawn(globalCtx, &pos, 250, 650, 0); } } @@ -150,12 +208,12 @@ void EnOkuta_SetupWaitToAppear(EnOkuta* this) { this->actor.draw = NULL; this->actor.flags &= ~1; this->actionFunc = EnOkuta_WaitToAppear; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.world.pos.y = this->actor.home.pos.y; } void EnOkuta_SetupAppear(EnOkuta* this, GlobalContext* globalCtx) { this->actor.draw = EnOkuta_Draw; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.flags |= 1; Animation_PlayOnce(&this->skelAnime, &D_06003C64); EnOkuta_SpawnBubbles(this, globalCtx); @@ -178,7 +236,7 @@ void EnOkuta_SetupShoot(EnOkuta* this, GlobalContext* globalCtx) { if (this->actionFunc != EnOkuta_Shoot) { this->timer = this->numShots; } - this->jumpHeight = this->actor.yDistToLink + 20.0f; + this->jumpHeight = this->actor.yDistToPlayer + 20.0f; this->jumpHeight = CLAMP_MIN(this->jumpHeight, 10.0f); if (this->jumpHeight > 50.0f) { EnOkuta_SpawnSplash(this, globalCtx); @@ -192,7 +250,7 @@ void EnOkuta_SetupShoot(EnOkuta* this, GlobalContext* globalCtx) { void EnOkuta_SetupWaitToDie(EnOkuta* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06003910, -5.0f); func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0xB); - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; Actor_SetScale(&this->actor, 0.01f); Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); this->actionFunc = EnOkuta_WaitToDie; @@ -216,14 +274,14 @@ void EnOkuta_SpawnProjectile(EnOkuta* this, GlobalContext* globalCtx) { f32 sin = Math_SinS(this->actor.shape.rot.y); f32 cos = Math_CosS(this->actor.shape.rot.y); - pos.x = this->actor.posRot.pos.x + (25.0f * sin); - pos.y = this->actor.posRot.pos.y - 6.0f; - pos.z = this->actor.posRot.pos.z + (25.0f * cos); + pos.x = this->actor.world.pos.x + (25.0f * sin); + pos.y = this->actor.world.pos.y - 6.0f; + pos.z = this->actor.world.pos.z + (25.0f * cos); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKUTA, pos.x, pos.y, pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0x10) != NULL) { - pos.x = this->actor.posRot.pos.x + (40.0f * sin); - pos.z = this->actor.posRot.pos.z + (40.0f * cos); - pos.y = this->actor.posRot.pos.y; + pos.x = this->actor.world.pos.x + (40.0f * sin); + pos.z = this->actor.world.pos.z + (40.0f * cos); + pos.y = this->actor.world.pos.y; velocity.x = 1.5f * sin; velocity.y = 0.0f; velocity.z = 1.5f * cos; @@ -233,8 +291,8 @@ void EnOkuta_SpawnProjectile(EnOkuta* this, GlobalContext* globalCtx) { } void EnOkuta_WaitToAppear(EnOkuta* this, GlobalContext* globalCtx) { - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; - if ((this->actor.xzDistToLink < 480.0f) && (this->actor.xzDistToLink > 200.0f)) { + this->actor.world.pos.y = this->actor.home.pos.y; + if ((this->actor.xzDistToPlayer < 480.0f) && (this->actor.xzDistToPlayer > 200.0f)) { EnOkuta_SetupAppear(this, globalCtx); } } @@ -243,7 +301,7 @@ void EnOkuta_Appear(EnOkuta* this, GlobalContext* globalCtx) { s32 pad; if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 160.0f) { + if (this->actor.xzDistToPlayer < 160.0f) { EnOkuta_SetupHide(this); } else { EnOkuta_SetupWaitToShoot(this); @@ -267,7 +325,7 @@ void EnOkuta_Appear(EnOkuta* this, GlobalContext* globalCtx) { void EnOkuta_Hide(EnOkuta* this, GlobalContext* globalCtx) { s32 pad; - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 30.0f); if (SkelAnime_Update(&this->skelAnime)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_BUBLE); EnOkuta_SpawnBubbles(this, globalCtx); @@ -287,7 +345,7 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) { s16 temp_v0_2; s32 phi_v1; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.world.pos.y = this->actor.home.pos.y; SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { if (this->timer != 0) { @@ -297,19 +355,19 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.5f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_FLOAT); } - if (this->actor.xzDistToLink < 160.0f || this->actor.xzDistToLink > 560.0f) { + if (this->actor.xzDistToPlayer < 160.0f || this->actor.xzDistToPlayer > 560.0f) { EnOkuta_SetupHide(this); } else { - temp_v0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C, 0x38E); + temp_v0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C, 0x38E); phi_v1 = ABS(temp_v0_2); - if ((phi_v1 < 0x38E) && (this->timer == 0) && (this->actor.yDistToLink < 200.0f)) { + if ((phi_v1 < 0x38E) && (this->timer == 0) && (this->actor.yDistToPlayer < 200.0f)) { EnOkuta_SetupShoot(this, globalCtx); } } } void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); if (SkelAnime_Update(&this->skelAnime)) { if (this->timer != 0) { this->timer--; @@ -323,8 +381,7 @@ void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { f32 curFrame = this->skelAnime.curFrame; if (curFrame < 13.0f) { - this->actor.posRot.pos.y = - (sinf((0.08333f * M_PI) * curFrame) * this->jumpHeight) + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = (sinf((0.08333f * M_PI) * curFrame) * this->jumpHeight) + this->actor.home.pos.y; } if (Animation_OnFrame(&this->skelAnime, 6.0f)) { EnOkuta_SpawnProjectile(this, globalCtx); @@ -336,7 +393,7 @@ void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_LAND); } } - if (this->actor.xzDistToLink < 160.0f) { + if (this->actor.xzDistToPlayer < 160.0f) { EnOkuta_SetupHide(this); } } @@ -345,7 +402,7 @@ void EnOkuta_WaitToDie(EnOkuta* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { EnOkuta_SetupDie(this); } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); } void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { @@ -359,11 +416,11 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->timer++; } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); if (this->timer == 5) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 40.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 40.0f; + pos.z = this->actor.world.pos.z; velocity.x = 0.0f; velocity.y = -0.5f; velocity.z = 0.0f; @@ -382,13 +439,13 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, (((this->timer - 5) * 0.04f) + 0.8f) * 0.01f); } else { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x70); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x70); for (i = 0; i < 20; i++) { velocity.x = (Rand_ZeroOne() - 0.5f) * 7.0f; velocity.y = Rand_ZeroOne() * 7.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 7.0f; - EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->actor.posRot.pos, &velocity, &accel, &primColor, + EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->actor.world.pos, &velocity, &accel, &primColor, &envColor, Rand_S16Offset(100, 50), 25, 0); } Actor_Kill(&this->actor); @@ -409,13 +466,13 @@ void EnOkuta_Freeze(EnOkuta* this, GlobalContext* globalCtx) { } if ((this->timer >= 64) && (this->timer & 1)) { temp_v1 = (this->timer - 64) >> 1; - pos.y = (this->actor.posRot.pos.y - 32.0f) + (8.0f * (8 - temp_v1)); - pos.x = this->actor.posRot.pos.x + ((temp_v1 & 2) ? 10.0f : -10.0f); - pos.z = this->actor.posRot.pos.z + ((temp_v1 & 1) ? 10.0f : -10.0f); + pos.y = (this->actor.world.pos.y - 32.0f) + (8.0f * (8 - temp_v1)); + pos.x = this->actor.world.pos.x + ((temp_v1 & 2) ? 10.0f : -10.0f); + pos.z = this->actor.world.pos.z + ((temp_v1 & 1) ? 10.0f : -10.0f); EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &pos, 150, 150, 150, 250, 235, 245, 255, (Rand_ZeroOne() * 0.2f) + 1.9f); } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); } void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { @@ -427,29 +484,31 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->actor.gravity = -1.0f; } - this->actor.initPosRot.rot.z += 0x1554; + this->actor.home.rot.z += 0x1554; if (this->actor.bgCheckFlags & 0x20) { this->actor.gravity = -1.0f; this->actor.speedXZ -= 0.1f; this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 1.0f); } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & 2) || - this->collider.base.acFlags & 2 || this->collider.base.maskA & 2 || this->actor.groundY == BGCHECK_Y_MIN) { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || + this->collider.base.acFlags & AC_HIT || this->collider.base.ocFlags1 & OC1_HIT || + this->actor.floorHeight == BGCHECK_Y_MIN) { if ((player->currentShield == PLAYER_SHIELD_DEKU || (player->currentShield == PLAYER_SHIELD_HYLIAN && LINK_IS_ADULT)) && - this->collider.base.atFlags & 2 && this->collider.base.atFlags & 0x10 && this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~0x16; - this->collider.base.atFlags |= 8; - this->collider.body.toucher.flags = 2; + this->collider.base.atFlags & AT_HIT && this->collider.base.atFlags & AT_TYPE_ENEMY && + this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY); + this->collider.base.atFlags |= AT_TYPE_PLAYER; + this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp40, 0); - this->actor.posRot.rot.y = sp40.y + 0x8000; + this->actor.world.rot.y = sp40.y + 0x8000; this->timer = 30; } else { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 11.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 11.0f; + pos.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &pos, 6.0f, 0, 1, 2, 15, 7, 10, D_06003380); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } } else if (this->timer == -300) { @@ -503,9 +562,9 @@ void EnOkuta_UpdateHeadScale(EnOkuta* this) { } void EnOkuta_ColliderCheck(EnOkuta* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { func_80032C7C(globalCtx, &this->actor); this->actor.colChkInfo.health = 0; @@ -531,15 +590,15 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x300000C0)) { if (this->actor.params == 0) { EnOkuta_ColliderCheck(this, globalCtx2); - if (!WaterBox_GetSurfaceImpl(globalCtx2, &globalCtx2->colCtx, this->actor.posRot.pos.x, - this->actor.posRot.pos.z, &ySurface, &outWaterBox) || - (ySurface < this->actor.groundY)) { + if (!WaterBox_GetSurfaceImpl(globalCtx2, &globalCtx2->colCtx, this->actor.world.pos.x, + this->actor.world.pos.z, &ySurface, &outWaterBox) || + (ySurface < this->actor.floorHeight)) { if (this->actor.colChkInfo.health != 0) { Actor_Kill(&this->actor); return; } } else { - this->actor.initPosRot.pos.y = ySurface; + this->actor.home.pos.y = ySurface; } } this->actionFunc(this, globalCtx2); @@ -551,27 +610,25 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { } else { sp34 = false; Actor_MoveForward(&this->actor); - Math_Vec3f_Copy(&sp38, &this->actor.posRot.pos); - func_8002E4B4(globalCtx2, &this->actor, 10.0f, 15.0f, 30.0f, 5); + Math_Vec3f_Copy(&sp38, &this->actor.world.pos); + Actor_UpdateBgCheckInfo(globalCtx2, &this->actor, 10.0f, 15.0f, 30.0f, 5); if ((this->actor.bgCheckFlags & 8) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.wallPoly, - this->actor.wallPolySource)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~8; } if ((this->actor.bgCheckFlags & 1) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.floorPoly, - this->actor.floorPolySource)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~1; } if (sp34 && !(this->actor.bgCheckFlags & 9)) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &sp38); + Math_Vec3f_Copy(&this->actor.world.pos, &sp38); } } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if ((this->actionFunc == EnOkuta_Appear) || (this->actionFunc == EnOkuta_Hide)) { - this->collider.dim.pos.y = this->actor.posRot.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); + this->collider.dim.pos.y = this->actor.world.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); this->collider.dim.radius = sOctorockColliderInit.dim.radius * this->actor.scale.x * 100.0f; } if (this->actor.params == 0x10) { @@ -585,7 +642,7 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 15.0f); + Actor_SetFocus(&this->actor, 15.0f); if ((this->actor.params == 0) && (this->actor.draw != NULL)) { EnOkuta_SpawnRipple(this, globalCtx2); } @@ -665,7 +722,7 @@ void EnOkuta_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1653); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); - Matrix_RotateZ(this->actor.initPosRot.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateZ(this->actor.home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1657), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_06003380); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 7c023441c0..ebcf348718 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -30,7 +30,7 @@ extern UNK_TYPE D_0600FEF0; /* const ActorInit En_Ossan_InitVars = { ACTOR_EN_OSSAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOssan), diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index bfd901ae48..b841a94afc 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -76,7 +76,7 @@ typedef enum { const ActorInit En_Owl_InitVars = { ACTOR_EN_OWL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OWL, sizeof(EnOwl), @@ -86,9 +86,23 @@ const ActorInit En_Owl_InitVars = { (ActorFunc)EnOwl_Draw, }; -ColliderCylinderInit sOwlCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInit sOwlCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -106,15 +120,15 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { s32 switchFlag; Actor_ProcessInitChain(&this->actor, sOwlInitChain); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C0E8, &D_060015CC, this->jointTable, this->morphTable, 21); SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060100B0, &D_0600C8A0, this->jointTable2, this->morphTable2, 16); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sOwlCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.minVelocityY = -10.0f; - this->actor.unk_4C = 500.0f; + this->actor.targetArrowOffset = 500.0f; EnOwl_ChangeMode(this, EnOwl_WaitDefault, func_80ACC540, &this->skelAnime2, &D_0600C8A0, 0.0f); this->actionFlags = this->unk_406 = this->unk_409 = 0; this->unk_405 = 4; @@ -136,7 +150,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { } this->unk_3EE = 0; - this->unk_400 = this->actor.posRot.rot.y; + this->unk_400 = this->actor.world.rot.y; switch (owlType) { case OWL_DEFAULT: @@ -240,8 +254,8 @@ void EnOwl_LookAtLink(EnOwl* this, GlobalContext* globalCtx) { s16 yaw; Player* player = PLAYER; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos); - this->actor.posRot.rot.y = yaw; + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos); + this->actor.world.rot.y = yaw; this->actor.shape.rot.y = yaw; } @@ -272,7 +286,7 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 t } else { this->actor.textId = textId; distCheck = (flags & 2) ? 200.0f : 1000.0f; - if (this->actor.xzDistToLink < targetDist) { + if (this->actor.xzDistToPlayer < targetDist) { this->actor.flags |= 0x10000; func_8002F1C4(&this->actor, globalCtx, targetDist, distCheck, 0); } @@ -286,7 +300,7 @@ s32 func_80ACA558(EnOwl* this, GlobalContext* globalCtx, u16 textId) { return true; } else { this->actor.textId = textId; - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { func_8002F1C4(&this->actor, globalCtx, 350.0f, 1000.0f, 0); } @@ -810,7 +824,7 @@ void EnOwl_WaitDefault(EnOwl* this, GlobalContext* globalCtx) { func_80ACD130(this, globalCtx, 7); func_80ACBAB8(this, globalCtx); } else { - this->actor.posRot.rot.z = globalCtx->csCtx.npcActions[7]->urot.y; + this->actor.world.rot.z = globalCtx->csCtx.npcActions[7]->urot.y; } } @@ -847,18 +861,18 @@ void func_80ACBAB8(EnOwl* this, GlobalContext* globalCtx) { void func_80ACBC0C(EnOwl* this, GlobalContext* globalCtx) { this->actor.flags |= 0x20; - if (this->actor.xzDistToLink > 6000.0f && !(this->actionFlags & 0x80)) { + if (this->actor.xzDistToPlayer > 6000.0f && !(this->actionFlags & 0x80)) { Actor_Kill(&this->actor); } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x80, 0x40); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x80, 0x40); + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.speedXZ < 16.0f) { this->actor.speedXZ += 0.5f; } - if ((this->unk_3F8 + 1000.0f) < this->actor.posRot.pos.y) { + if ((this->unk_3F8 + 1000.0f) < this->actor.world.pos.y) { if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y -= 0.4f; } @@ -871,8 +885,8 @@ void func_80ACBC0C(EnOwl* this, GlobalContext* globalCtx) { void func_80ACBD4C(EnOwl* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame > 10.0f) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x400, 0x40); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x400, 0x40); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->skelAnime.curFrame > 45.0f) { @@ -902,12 +916,12 @@ void func_80ACBEA0(EnOwl* this, GlobalContext* GlobalContext) { if (this->actionFlags & 1) { this->unk_3FE = 3; EnOwl_ChangeMode(this, func_80ACBD4C, func_80ACC540, &this->skelAnime, &D_06001168, 0.0f); - this->unk_3F8 = this->actor.posRot.pos.y; + this->unk_3F8 = this->actor.world.pos.y; this->actor.velocity.y = 2.0f; if (this->actionFlags & 0x40) { - this->unk_400 = this->actor.posRot.rot.y + 0x4000; + this->unk_400 = this->actor.world.rot.y + 0x4000; } else { - this->unk_400 = this->actor.posRot.rot.y - 0x4000; + this->unk_400 = this->actor.world.rot.y - 0x4000; } } @@ -915,8 +929,8 @@ void func_80ACBEA0(EnOwl* this, GlobalContext* GlobalContext) { } void func_80ACBF50(EnOwl* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actionFlags & 1) { EnOwl_ChangeMode(this, func_80ACBC0C, func_80ACC460, &this->skelAnime, &D_060015CC, 0.0f); @@ -933,10 +947,10 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) { s32 temp_v0; s32 temp_v0_2; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; - if (this->actor.xzDistToLink < 50.0f) { + if (this->actor.xzDistToPlayer < 50.0f) { if (!Gameplay_InCsMode(globalCtx)) { owlType = (this->actor.params & 0xFC0) >> 6; osSyncPrintf(VT_FGCOL(CYAN)); @@ -987,8 +1001,8 @@ void func_80ACC23C(EnOwl* this, GlobalContext* globalCtx) { this->actor.speedXZ = 1.5f; } else { this->actor.speedXZ = 0.0f; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->skelAnime.curFrame >= 37.0f) { @@ -1007,7 +1021,7 @@ void func_80ACC30C(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { this->unk_3FE = 3; EnOwl_ChangeMode(this, func_80ACC23C, func_80ACC540, &this->skelAnime, &D_06001168, 0.0f); - this->unk_3F8 = this->actor.posRot.pos.y; + this->unk_3F8 = this->actor.world.pos.y; this->actor.velocity.y = 0.2f; } @@ -1086,16 +1100,14 @@ s32 func_80ACC624(EnOwl* this, GlobalContext* globalCtx) { } } -#ifdef NON_MATCHING -// Minor regalloc surrounding the unk_3EE at the end of the function. void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnOwl* this = THIS; s16 phi_a1; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); this->unk_410(this); this->actionFlags &= ~8; this->actionFunc(this, globalCtx); @@ -1265,7 +1277,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { } } if (phi_a1) {} - this->unk_3F0 = (s16)(this->unk_3EE * 1024) + phi_a1; + this->unk_3F0 = (u16)((this->unk_3EE << 2) << 8) + phi_a1; this->unk_3EC = ABS(this->unk_3F0) >> 3; } else { this->unk_3F2 = 0; @@ -1278,9 +1290,6 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_3EC = ABS(this->unk_3F0) >> 3; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s") -#endif s32 EnOwl_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** gfx, Vec3f* pos, Vec3s* rot, void* thisx) { EnOwl* this = THIS; @@ -1323,7 +1332,7 @@ void EnOwl_PostLimbUpdate(GlobalContext* globalCtx, s32 limbIndex, Gfx** gfx, Ve vec.x = 1400.0f; } if (limbIndex == 3) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } @@ -1356,8 +1365,8 @@ void func_80ACD130(EnOwl* this, GlobalContext* globalCtx, s32 idx) { startPos.x = globalCtx->csCtx.npcActions[idx]->startPos.x; startPos.y = globalCtx->csCtx.npcActions[idx]->startPos.y; startPos.z = globalCtx->csCtx.npcActions[idx]->startPos.z; - this->actor.posRot.pos = startPos; - this->actor.posRot.rot.y = this->actor.shape.rot.y = globalCtx->csCtx.npcActions[idx]->rot.y; + this->actor.world.pos = startPos; + this->actor.world.rot.y = this->actor.shape.rot.y = globalCtx->csCtx.npcActions[idx]->rot.y; this->actor.shape.rot.z = globalCtx->csCtx.npcActions[idx]->urot.z; } @@ -1375,14 +1384,14 @@ f32 func_80ACD1C4(GlobalContext* globalCtx, s32 idx) { void func_80ACD220(EnOwl* this, Vec3f* arg1, f32 arg2) { Vec3f rpy; - rpy.x = (arg1->x - this->actor.posRot.pos.x) * arg2; - rpy.y = (arg1->y - this->actor.posRot.pos.y) * arg2; - rpy.z = (arg1->z - this->actor.posRot.pos.z) * arg2; + rpy.x = (arg1->x - this->actor.world.pos.x) * arg2; + rpy.y = (arg1->y - this->actor.world.pos.y) * arg2; + rpy.z = (arg1->z - this->actor.world.pos.z) * arg2; Math_StepToF(&this->actor.velocity.y, rpy.y, 1.0f); this->actor.speedXZ = sqrtf(SQ(rpy.x) + SQ(rpy.z)); - this->actor.posRot.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, arg1); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, arg1); + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { @@ -1395,11 +1404,11 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { pos.x = globalCtx->csCtx.npcActions[7]->startPos.x; pos.y = globalCtx->csCtx.npcActions[7]->startPos.y; pos.z = globalCtx->csCtx.npcActions[7]->startPos.z; - angle = (s16)globalCtx->csCtx.npcActions[7]->rot.y - this->actor.posRot.rot.z; + angle = (s16)globalCtx->csCtx.npcActions[7]->rot.y - this->actor.world.rot.z; if (angle < 0) { angle += 0x10000; } - angle = (s16)((t * angle) + this->actor.posRot.rot.z); + angle = (s16)((t * angle) + this->actor.world.rot.z); angle = (u16)angle; if (this->actionFlags & 4) { phi_f2 = globalCtx->csCtx.npcActions[7]->urot.x; @@ -1410,7 +1419,7 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { pos.x -= Math_SinS(angle) * phi_f2; pos.z += Math_CosS(angle) * phi_f2; this->unk_3F8 = phi_f2; - this->actor.posRot.pos = pos; + this->actor.world.pos = pos; this->actor.draw = &EnOwl_Draw; this->actionFlags &= ~4; this->actor.speedXZ = 0.0f; diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index 90cdead6e6..3732ebd3c8 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -17,7 +17,7 @@ void EnPart_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Part_InitVars = { ACTOR_EN_PART, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnPart), @@ -46,7 +46,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { f32 sign = 1.0f; this->action = 1; - this->actor.posRot.rot.y = Rand_ZeroOne() * 20000.0f; + this->actor.world.rot.y = Rand_ZeroOne() * 20000.0f; switch (this->actor.params) { case 0: @@ -60,14 +60,14 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->timer = 400; case 12: this->actor.speedXZ = Rand_CenteredFloat(6.0f); - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->timer += 60; this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 4.0f; this->actor.gravity = -0.6f - Rand_ZeroOne() * 0.5f; this->rotZSpeed = 0.15f; break; case 14: - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); case 1: case 4: case 9: @@ -79,7 +79,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->rotZSpeed = 0.15f; break; case 11: - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); case 3: this->actor.speedXZ = (Rand_ZeroOne() - 0.5f) * 3.0f; this->timer = (s16)(Rand_ZeroOne() * 17.0f) + 10; @@ -91,7 +91,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { case 6: case 7: case 8: - this->actor.posRot.rot.y = this->actor.parent->shape.rot.y; + this->actor.world.rot.y = this->actor.parent->shape.rot.y; if (this->displayList == D_06015380) { sign = -1.0f; } @@ -99,7 +99,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->actor.speedXZ = 6.0f * sign; this->actor.gravity = -1.2f; this->rotZSpeed = 0.15f * sign; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->timer = 18; break; } @@ -113,9 +113,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; if ((this->actor.params == 12) || (this->actor.params == 13)) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D); - if ((this->actor.bgCheckFlags & 1) || (this->actor.posRot.pos.y <= this->actor.groundY)) { + if ((this->actor.bgCheckFlags & 1) || (this->actor.world.pos.y <= this->actor.floorHeight)) { this->action = 4; this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; @@ -131,22 +131,22 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { case 9: case 10: case 14: - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9, true); break; case 3: case 11: - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); break; case 4: for (i = 7; i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(60.0f); - pos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08 * this->actor.scale.y + + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(60.0f); + pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y + Rand_CenteredFloat(50.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(60.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(60.0f); velocity.y = Rand_ZeroOne() + 1.0f; EffectSsDtBubble_SpawnColorProfile(globalCtx, &pos, &velocity, &accel, Rand_S16Offset(80, 100), 25, 0, true); @@ -157,9 +157,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { case 7: case 8: for (i = 4; i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(25.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(40.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(25.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(25.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(40.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(25.0f); EffectSsDeadDb_Spawn(globalCtx, &pos, &zeroVec, &zeroVec, 40, 7, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); } @@ -188,7 +188,7 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 8.0f, 0.0f }; Vec3f accel = { 0.0f, -1.5f, 0.0f }; - if (sqrt(this->actor.xyzDistToLinkSq) <= 40.0f) { + if (sqrt(this->actor.xyzDistToPlayerSq) <= 40.0f) { u8 prevInvincibilityTimer = player->invincibilityTimer; if (player->invincibilityTimer <= 0) { if (player->invincibilityTimer <= -40) { @@ -198,15 +198,15 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToLink) * 0.04f + 4.0f, - this->actor.parent->posRot.rot.y, 8.0f); + func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToPlayer) * 0.04f + 4.0f, + this->actor.parent->world.rot.y, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; this->timer = 1; } - func_80033480(globalCtx, &this->actor.posRot.pos, 0.0f, 1, 300, 150, 1); + func_80033480(globalCtx, &this->actor.world.pos, 0.0f, 1, 300, 150, 1); velocity.x = Rand_CenteredFloat(16.0f); - EffectSsHahen_Spawn(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 20, + EffectSsHahen_Spawn(globalCtx, &this->actor.world.pos, &velocity, &accel, 20, (s32)((Rand_ZeroOne() * 5.0f + 12.0f) * 2), -1, 10, NULL); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_GNDWAVE - SFX_FLAG); } @@ -216,19 +216,19 @@ void func_80ACE7E8(EnPart* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; if ((this->actor.parent == NULL) || (this->actor.parent->update == NULL)) { - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9, true); Actor_Kill(&this->actor); return; } if (this->timer == 0) { - f32 diffsSum = Math_SmoothStepToF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 1.0f, 5.0f, 0.0f); - diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 1.0f, 5.0f, 0.0f); - diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 1.0f, 5.0f, 0.0f); + f32 diffsSum = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f, 5.0f, 0.0f); + diffsSum += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f, 5.0f, 0.0f); + diffsSum += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f, 5.0f, 0.0f); diffsSum += Math_SmoothStepToF(&this->rotZ, 0.0f, 1.0f, 0.25f, 0.0f); if (diffsSum == 0.0f) { - this->actor.parent->initPosRot.rot.x--; + this->actor.parent->home.rot.x--; this->timer--; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_DAMAGE); } @@ -251,7 +251,7 @@ void EnPart_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if ((this->actor.params > 4 && this->actor.params < 9) || this->actor.params < 0) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5); if (this->actor.params >= 0) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); if (thisx->bgCheckFlags & 1) { diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 66df031ab5..5385b049d0 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06001C80; /* const ActorInit En_Peehat_InitVars = { ACTOR_EN_PEEHAT, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PEEHAT, sizeof(EnPeehat), @@ -27,6 +27,73 @@ const ActorInit En_Peehat_InitVars = { (ActorFunc)EnPeehat_Update, (ActorFunc)EnPeehat_Draw, }; + +static ColliderCylinderInit D_80AD2740 = { + { + COLTYPE_WOOD, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 50, 160, -70, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_80AD27A0 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderJntSphElementInit D_80AD276C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80AD2790 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80AD276C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80ACF4A0.s") diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 7cb1f0db97..7603bf80d7 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -22,7 +22,7 @@ void EnPoDesert_Disappear(EnPoDesert* this, GlobalContext* globalCtx); const ActorInit En_Po_Desert_InitVars = { ACTOR_EN_PO_DESERT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PO_FIELD, sizeof(EnPoDesert), @@ -33,15 +33,29 @@ const ActorInit En_Po_Desert_InitVars = { }; static ColliderCylinderInit sColliderInit = { - { COLTYPE_UNK3, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 50, 20, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x5C, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; extern SkeletonHeader D_06006A30; @@ -64,12 +78,12 @@ void EnPoDesert_Init(Actor* thisx, GlobalContext* globalCtx) { this->lightColor.b = 210; this->lightColor.a = 255; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 200); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 37.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 200); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; this->actor.params = (this->actor.params >> 8) & 0xFF; - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, globalCtx); } @@ -86,13 +100,13 @@ void EnPoDesert_SetNextPathPoint(EnPoDesert* this, GlobalContext* globalCtx) { Animation_MorphToLoop(&this->skelAnime, &D_06001360, -6.0f); pathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->currentPathPoint]; - this->actor.initPosRot.pos.x = pathPoint->x; - this->actor.initPosRot.pos.y = pathPoint->y; - this->actor.initPosRot.pos.z = pathPoint->z; - this->initDistToNextPoint = func_8002DBB0(&this->actor, &this->actor.initPosRot.pos); + this->actor.home.pos.x = pathPoint->x; + this->actor.home.pos.y = pathPoint->y; + this->actor.home.pos.z = pathPoint->z; + this->initDistToNextPoint = Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos); this->initDistToNextPoint = CLAMP_MIN(this->initDistToNextPoint, 1.0f); this->currentPathPoint++; - this->yDiff = this->actor.initPosRot.pos.y - this->actor.posRot.pos.y; + this->yDiff = this->actor.home.pos.y - this->actor.world.pos.y; this->actor.speedXZ = 0.0f; if (path->count == this->currentPathPoint) { this->currentPathPoint = 0; @@ -120,12 +134,12 @@ void EnPoDesert_UpdateSpeedModifier(EnPoDesert* this) { if (this->speedModifier != 0) { this->speedModifier--; } - this->actor.posRot.pos.y = Math_SinS(this->speedModifier * 0x800) * 13.0f + this->targetY; + this->actor.world.pos.y = Math_SinS(this->speedModifier * 0x800) * 13.0f + this->targetY; } void EnPoDesert_WaitForPlayer(EnPoDesert* this, GlobalContext* globalCtx) { func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); - if (this->actor.xzDistToLink < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.unk_03)) { + if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.unk_03)) { if (this->currentPathPoint == 2) { if (Gameplay_InCsMode(globalCtx)) { this->actor.shape.rot.y += 0x800; @@ -146,17 +160,17 @@ void EnPoDesert_MoveToNextPoint(EnPoDesert* this, GlobalContext* globalCtx) { this->actionTimer--; } temp_f20 = sinf(this->actionTimer * (M_PI / 20.0f)) * 5.0f; - this->actor.posRot.pos.x += temp_f20 * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += temp_f20 * Math_SinS(this->actor.shape.rot.y); + this->actor.world.pos.x += temp_f20 * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += temp_f20 * Math_SinS(this->actor.shape.rot.y); if (this->actionTimer == 0) { this->actionTimer = 40; } - temp_f20 = func_8002DBB0(&this->actor, &this->actor.initPosRot.pos); - this->actor.posRot.rot.y = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); - Math_ApproachS(&this->actor.shape.rot.y, this->actor.posRot.rot.y + 0x8000, 5, 0x400); + temp_f20 = Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y + 0x8000, 5, 0x400); this->actor.speedXZ = sinf(this->speedModifier * (M_PI / 32.0f)) * 2.5f + 5.5f; func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); - this->targetY = this->actor.initPosRot.pos.y - ((temp_f20 * this->yDiff) / this->initDistToNextPoint); + this->targetY = this->actor.home.pos.y - ((temp_f20 * this->yDiff) / this->initDistToNextPoint); if (temp_f20 < 40.0f) { if (this->currentPathPoint != 0) { EnPoDesert_SetNextPathPoint(this, globalCtx); @@ -172,7 +186,7 @@ void EnPoDesert_Disappear(EnPoDesert* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x2000; this->lightColor.a = this->actionTimer * 15.9375f; - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; if (this->actionTimer == 0) { Actor_Kill(&this->actor); } @@ -186,15 +200,15 @@ void EnPoDesert_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); EnPoDesert_UpdateSpeedModifier(this); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); - Actor_SetHeight(&this->actor, 42.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Actor_SetFocus(&this->actor, 42.0f); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (globalCtx->actorCtx.unk_03) { this->actor.flags |= 0x81; - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else { - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; this->actor.flags &= ~0x81; } } diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index b7c4ce1deb..adc0fafc1f 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -35,7 +35,7 @@ void EnPoField_SpawnFlame(EnPoField* this); const ActorInit En_Po_Field_InitVars = { ACTOR_EN_PO_FIELD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PO_FIELD, sizeof(EnPoField), @@ -46,22 +46,80 @@ const ActorInit En_Po_Field_InitVars = { }; static ColliderCylinderInit D_80AD7080 = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 50, 20, { 0, 0, 0 } }, }; static ColliderCylinderInit D_80AD70AC = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 10, 30, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit D_80AD70D8 = { 0x04, 0x0019, 0x0032, 0x28 }; +static CollisionCheckInfoInit D_80AD70D8 = { 4, 25, 50, 40 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x11, 0x02, 0x02, 0x12, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 sNumSpawned = 0; @@ -69,7 +127,7 @@ static s32 sNumSpawned = 0; static Vec3f sFieldMiddle = { -1000.0f, 0.0f, 6500.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AD7114 = { 0.0f, 3.0f, 0.0f }; @@ -107,9 +165,9 @@ void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (sNumSpawned != 10) { - sSpawnPositions[sNumSpawned].x = this->actor.posRot.pos.x; - sSpawnPositions[sNumSpawned].y = this->actor.posRot.pos.y; - sSpawnPositions[sNumSpawned].z = this->actor.posRot.pos.z; + sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; + sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; + sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; sSpawnSwitchFlags[sNumSpawned] = this->actor.params & 0xFF; sNumSpawned++; } @@ -124,11 +182,11 @@ void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80AD7080); Collider_InitCylinder(globalCtx, &this->flameCollider); Collider_SetCylinder(globalCtx, &this->flameCollider, &this->actor, &D_80AD70AC); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &D_80AD70D8); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &D_80AD70D8); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 0); - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 0); + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; EnPoField_SetupWaitForSpawn(this, globalCtx); } @@ -144,14 +202,14 @@ void EnPoField_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnPoField_SetupWaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actor.update = EnPoField_Update; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->actor.shape.rot.x = 0; Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); this->actionTimer = 200; Actor_SetScale(&this->actor, 0.0f); this->actor.flags &= ~0x00010001; - this->collider.base.acFlags &= ~1; - this->collider.base.maskA = 0x39; + this->collider.base.acFlags &= ~AC_ON; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_ALL; this->actor.colChkInfo.health = D_80AD70D8.health; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; @@ -165,16 +223,16 @@ void EnPoField_SetupAppear(EnPoField* this) { this->lightColor.g = 255; this->lightColor.b = 210; this->lightColor.a = 0; - this->actor.shape.unk_14 = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.shadowAlpha = 0; + this->actor.shape.yOffset = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; if (this->actor.params == EN_PO_FIELD_BIG) { this->actor.speedXZ = 12.0f; this->collider.dim.radius = 35; this->collider.dim.height = 100; this->collider.dim.yShift = 10; - this->actor.shape.unk_10 = 45.0f; + this->actor.shape.shadowScale = 45.0f; this->scaleModifier = 0.014f; this->actor.naviEnemyId = 0x5A; } else { @@ -182,7 +240,7 @@ void EnPoField_SetupAppear(EnPoField* this) { this->collider.dim.radius = D_80AD7080.dim.radius; this->collider.dim.height = D_80AD7080.dim.height; this->collider.dim.yShift = D_80AD7080.dim.yShift; - this->actor.shape.unk_10 = 37.0f; + this->actor.shape.shadowScale = 37.0f; this->scaleModifier = 0.01f; this->actor.naviEnemyId = 0x5C; } @@ -193,10 +251,10 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, GlobalContext* globalCtx) { Player* player = PLAYER; Animation_PlayLoop(&this->skelAnime, &D_06000924); - this->collider.base.acFlags |= 1; - this->scaleModifier = this->actor.xzDistToLink; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &player->actor.posRot.pos); - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->collider.base.acFlags |= AC_ON; + this->scaleModifier = this->actor.xzDistToPlayer; + Math_Vec3f_Copy(&this->actor.home.pos, &player->actor.world.pos); + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actionFunc != EnPoField_Damage) { this->actor.flags |= 1; this->actionTimer = 600; @@ -207,12 +265,12 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, GlobalContext* globalCtx) { void EnPoField_SetupFlee(EnPoField* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000608, -5.0f); - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; this->actionFunc = EnPoField_Flee; this->actor.speedXZ = 12.0f; if (this->actionFunc != EnPoField_Damage) { this->actor.flags |= 1; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actionTimer = 2000; this->unk_194 = 32; } @@ -220,12 +278,12 @@ void EnPoField_SetupFlee(EnPoField* this) { void EnPoField_SetupDamage(EnPoField* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000454, -6.0f); - if (this->collider.body.acHitItem->toucher.flags & 0x1F824) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } - this->collider.base.acFlags &= ~3; + this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 5.0f; func_8003426C(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = EnPoField_Damage; @@ -235,7 +293,7 @@ void EnPoField_SetupDeath(EnPoField* this) { this->actionTimer = 0; this->actor.flags &= -2; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.naviEnemyId = 0xFF; if (this->flameTimer >= 20) { this->flameTimer = 19; @@ -246,7 +304,7 @@ void EnPoField_SetupDeath(EnPoField* this) { void EnPoField_SetupDisappear(EnPoField* this) { Animation_MorphToLoop(&this->skelAnime, &D_06001360, -6.0f); this->actionTimer = 16; - this->collider.base.acFlags &= ~3; + this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); @@ -256,27 +314,27 @@ void EnPoField_SetupDisappear(EnPoField* this) { void EnPoField_SetupSoulIdle(EnPoField* this, GlobalContext* globalCtx) { this->actor.update = EnPoField_UpdateDead; this->actor.draw = EnPoField_DrawSoul; - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; Actor_SetScale(&this->actor, 0.01f); this->actor.gravity = -1.0f; - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; this->actor.shape.rot.x = -0x8000; this->actionTimer = 60; - this->actor.posRot.pos.y -= 15.0f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_MISC); + this->actor.world.pos.y -= 15.0f; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_MISC); this->actionFunc = EnPoField_SoulIdle; } void func_80AD42B0(EnPoField* this) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->actor.shape.rot.y = 0; this->lightColor.a = 0; this->actor.shape.rot.x = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); @@ -287,15 +345,15 @@ void func_80AD42B0(EnPoField* this) { } void func_80AD4384(EnPoField* this) { - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + this->actor.home.pos.y = this->actor.world.pos.y; + Actor_SetFocus(&this->actor, -10.0f); this->collider.dim.radius = 13; this->collider.dim.height = 30; this->collider.dim.yShift = 0; - this->collider.dim.pos.x = this->actor.posRot.pos.x; - this->collider.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - this->collider.dim.pos.z = this->actor.posRot.pos.z; - this->collider.base.maskA = 9; + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y - 20.0f; + this->collider.dim.pos.z = this->actor.world.pos.z; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; this->actor.textId = 0x5005; this->actionTimer = 400; this->unk_194 = 32; @@ -309,7 +367,7 @@ void EnPoField_SetupSoulDisappear(EnPoField* this) { void EnPoField_SetupInteractWithSoul(EnPoField* this) { this->actionFunc = EnPoField_SoulInteract; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y - 15.0f; + this->actor.home.pos.y = this->actor.world.pos.y - 15.0f; } void EnPoField_CorrectYPos(EnPoField* this, GlobalContext* globalCtx) { @@ -321,26 +379,27 @@ void EnPoField_CorrectYPos(EnPoField* this, GlobalContext* globalCtx) { if (this->unk_194 != 0) { this->unk_194 -= 1; } - if (this->actor.groundY == BGCHECK_Y_MIN) { + if (this->actor.floorHeight == BGCHECK_Y_MIN) { EnPoField_SetupDisappear(this); return; } Math_ApproachF( - &this->actor.initPosRot.pos.y, - ((player->actor.posRot.pos.y > this->actor.groundY) ? player->actor.posRot.pos.y : this->actor.groundY) + 13.0f, + &this->actor.home.pos.y, + ((player->actor.world.pos.y > this->actor.floorHeight) ? player->actor.world.pos.y : this->actor.floorHeight) + + 13.0f, 0.2f, 5.0f); - this->actor.posRot.pos.y = Math_SinS(this->unk_194 * 0x800) * 13.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 13.0f + this->actor.home.pos.y; } f32 EnPoField_SetFleeSpeed(EnPoField* this, GlobalContext* globalCtx) { Player* player = PLAYER; f32 speed = ((player->stateFlags1 & 0x800000) && player->rideActor != NULL) ? player->rideActor->speedXZ : 12.0f; - if (this->actor.xzDistToLink < 300.0f) { + if (this->actor.xzDistToPlayer < 300.0f) { this->actor.speedXZ = speed * 1.5f + 2.0f; - } else if (this->actor.xzDistToLink < 400.0f) { + } else if (this->actor.xzDistToPlayer < 400.0f) { this->actor.speedXZ = speed * 1.25f + 2.0f; - } else if (this->actor.xzDistToLink < 500.0f) { + } else if (this->actor.xzDistToPlayer < 500.0f) { this->actor.speedXZ = speed + 2.0f; } else { this->actor.speedXZ = 12.0f; @@ -359,8 +418,8 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { } if (this->actionTimer == 0) { for (i = 0; i < sNumSpawned; i++) { - if (fabsf(sSpawnPositions[i].x - player->actor.posRot.pos.x) < 150.0f && - fabsf(sSpawnPositions[i].z - player->actor.posRot.pos.z) < 150.0f) { + if (fabsf(sSpawnPositions[i].x - player->actor.world.pos.x) < 150.0f && + fabsf(sSpawnPositions[i].z - player->actor.world.pos.z) < 150.0f) { if (Flags_GetSwitch(globalCtx, sSpawnSwitchFlags[i])) { if (player->stateFlags1 & 0x800000) { // Player riding Epona return; @@ -376,15 +435,13 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actor.params = EN_PO_FIELD_SMALL; spawnDist = 300.0f; } - this->actor.posRot.pos.x = - Math_SinS(player->actor.shape.rot.y) * spawnDist + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = - Math_CosS(player->actor.shape.rot.y) * spawnDist + player->actor.posRot.pos.z; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 1000.0f; - this->actor.posRot.pos.y = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, - &bgId, &this->actor, &this->actor.posRot.pos); - if (this->actor.posRot.pos.y != BGCHECK_Y_MIN) { - this->actor.shape.rot.y = func_8002DA78(&this->actor, &player->actor); + this->actor.world.pos.x = Math_SinS(player->actor.shape.rot.y) * spawnDist + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(player->actor.shape.rot.y) * spawnDist + player->actor.world.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + 1000.0f; + this->actor.world.pos.y = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &bgId, + &this->actor, &this->actor.world.pos); + if (this->actor.world.pos.y != BGCHECK_Y_MIN) { + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor); EnPoField_SetupAppear(this); } else { return; @@ -410,10 +467,10 @@ void EnPoField_Appear(EnPoField* this, GlobalContext* globalCtx) { this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; } - this->actor.shape.unk_14 = this->lightColor.a; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.shadowAlpha = this->lightColor.a; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.params == EN_PO_FIELD_BIG) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; EnPoField_SetFleeSpeed(this, globalCtx); } } @@ -427,26 +484,24 @@ void EnPoField_CirclePlayer(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer--; } if (ABS(temp_v1) < 16) { - this->actor.posRot.rot.y += 512.0f * fabsf(Math_SinS(this->unk_194 * 0x800)); + this->actor.world.rot.y += 512.0f * fabsf(Math_SinS(this->unk_194 * 0x800)); } Math_ApproachF(&this->scaleModifier, 180.0f, 0.5f, 10.0f); - Math_ApproachF(&this->actor.initPosRot.pos.x, player->actor.posRot.pos.x, 0.2f, 6.0f); - Math_ApproachF(&this->actor.initPosRot.pos.z, player->actor.posRot.pos.z, 0.2f, 6.0f); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 1, 0x800, 0x200); - if (this->actor.initPosRot.pos.x - player->actor.posRot.pos.x > 100.0f) { - this->actor.initPosRot.pos.x = player->actor.posRot.pos.x + 100.0f; - } else if (this->actor.initPosRot.pos.x - player->actor.posRot.pos.x < -100.0f) { - this->actor.initPosRot.pos.x = player->actor.posRot.pos.x + -100.0f; + Math_ApproachF(&this->actor.home.pos.x, player->actor.world.pos.x, 0.2f, 6.0f); + Math_ApproachF(&this->actor.home.pos.z, player->actor.world.pos.z, 0.2f, 6.0f); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x800, 0x200); + if (this->actor.home.pos.x - player->actor.world.pos.x > 100.0f) { + this->actor.home.pos.x = player->actor.world.pos.x + 100.0f; + } else if (this->actor.home.pos.x - player->actor.world.pos.x < -100.0f) { + this->actor.home.pos.x = player->actor.world.pos.x + -100.0f; } - if (this->actor.initPosRot.pos.z - player->actor.posRot.pos.z > 100.0f) { - this->actor.initPosRot.pos.z = player->actor.posRot.pos.z + 100.0f; - } else if (this->actor.initPosRot.pos.z - player->actor.posRot.pos.z < -100.0f) { - this->actor.initPosRot.pos.z = player->actor.posRot.pos.z + -100.0f; + if (this->actor.home.pos.z - player->actor.world.pos.z > 100.0f) { + this->actor.home.pos.z = player->actor.world.pos.z + 100.0f; + } else if (this->actor.home.pos.z - player->actor.world.pos.z < -100.0f) { + this->actor.home.pos.z = player->actor.world.pos.z + -100.0f; } - this->actor.posRot.pos.x = - this->actor.initPosRot.pos.x - (Math_SinS(this->actor.posRot.rot.y) * this->scaleModifier); - this->actor.posRot.pos.z = - this->actor.initPosRot.pos.z - (Math_CosS(this->actor.posRot.rot.y) * this->scaleModifier); + this->actor.world.pos.x = this->actor.home.pos.x - (Math_SinS(this->actor.world.rot.y) * this->scaleModifier); + this->actor.world.pos.z = this->actor.home.pos.z - (Math_CosS(this->actor.world.rot.y) * this->scaleModifier); if (this->actionTimer == 0) { EnPoField_SetupDisappear(this); } else { @@ -464,18 +519,19 @@ void EnPoField_Flee(EnPoField* this, GlobalContext* globalCtx) { if (this->actionTimer != 0) { this->actionTimer--; } - if (func_8002DBB0(&this->actor, &sFieldMiddle) > 3000.0f) { - phi_t0 = (s16)(this->actor.yawTowardsLink - func_8002DAC0(&this->actor, &sFieldMiddle) - 0x8000) * 0.2f; + if (Actor_WorldDistXZToPoint(&this->actor, &sFieldMiddle) > 3000.0f) { + phi_t0 = (s16)(this->actor.yawTowardsPlayer - Actor_WorldYawTowardPoint(&this->actor, &sFieldMiddle) - 0x8000) * + 0.2f; } else { phi_t0 = 0; } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink - phi_t0, 6, 0x400); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - phi_t0, 6, 0x400); EnPoField_SetFleeSpeed(this, globalCtx); - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; temp_f6 = Math_SinS(this->actionTimer * 0x800) * 3.0f; - this->actor.posRot.pos.x -= temp_f6 * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += temp_f6 * Math_SinS(this->actor.shape.rot.y); - if (this->actionTimer == 0 || this->actor.xzDistToLink > 1500.0f) { + this->actor.world.pos.x -= temp_f6 * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += temp_f6 * Math_SinS(this->actor.shape.rot.y); + if (this->actionTimer == 0 || this->actor.xzDistToPlayer > 1500.0f) { EnPoField_SetupDisappear(this); } else { EnPoField_CorrectYPos(this, globalCtx); @@ -506,23 +562,23 @@ void EnPoField_Death(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer++; if (this->actionTimer < 8) { if (this->actionTimer < 5) { - sp6C.y = Math_SinS(this->actionTimer * 0x1000 - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + sp6C.y = Math_SinS(this->actionTimer * 0x1000 - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); sp68 = Math_CosS(this->actionTimer * 0x1000 - 0x4000) * 23.0f; - sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.posRot.pos.x; - sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.posRot.pos.z; + sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.world.pos.x; + sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.world.pos.z; } else { - sp6C.y = this->actor.posRot.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); - sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.x; - sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.z; + sp6C.y = this->actor.world.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); + sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x; + sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - sp6C.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - sp6C.x; - sp6C.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - sp6C.z; + sp6C.x = (this->actor.world.pos.x + this->actor.world.pos.x) - sp6C.x; + sp6C.z = (this->actor.world.pos.z + this->actor.world.pos.z) - sp6C.z; EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - sp6C.x = this->actor.posRot.pos.x; - sp6C.z = this->actor.posRot.pos.z; + sp6C.x = this->actor.world.pos.x; + sp6C.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); if (this->actionTimer == 1) { @@ -532,7 +588,7 @@ void EnPoField_Death(EnPoField* this, GlobalContext* globalCtx) { EnPoField_SetupSoulIdle(this, globalCtx); } else if (this->actionTimer >= 19) { temp_f0 = (28 - this->actionTimer) * 0.001f; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos.y += 5.0f; this->actor.scale.z = temp_f0; this->actor.scale.y = temp_f0; this->actor.scale.x = temp_f0; @@ -549,7 +605,7 @@ void EnPoField_Disappear(EnPoField* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x1000; this->lightColor.a = this->actionTimer * 15.9375f; - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; if (this->actionTimer == 0) { EnPoField_SetupWaitForSpawn(this, globalCtx); } @@ -560,14 +616,13 @@ void EnPoField_SoulIdle(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer--; } if (this->actor.bgCheckFlags & 1) { - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10, - D_06004BA0); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10, D_06004BA0); func_80AD42B0(this); } else if (this->actionTimer == 0) { EnPoField_SetupWaitForSpawn(this, globalCtx); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); } void EnPoField_SoulUpdateProperties(EnPoField* this, s32 arg1) { @@ -585,18 +640,18 @@ void EnPoField_SoulUpdateProperties(EnPoField* this, s32 arg1) { this->actor.scale.z = this->lightColor.a * 2.7450982e-05f; this->actor.scale.y = this->lightColor.a * 2.7450982e-05f; this->actor.scale.x = this->lightColor.a * 2.7450982e-05f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (0.05882353f * this->lightColor.a); + this->actor.world.pos.y = this->actor.home.pos.y + (0.05882353f * this->lightColor.a); } this->lightColor.r = info->lightColor.r * multiplier; this->lightColor.g = info->lightColor.g * multiplier; this->lightColor.b = info->lightColor.b * multiplier; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, info->lightColor.r, info->lightColor.g, info->lightColor.b, + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, info->lightColor.r, info->lightColor.g, info->lightColor.b, this->lightColor.a * 0.78431373f); } void func_80AD587C(EnPoField* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y += 2.0f; + this->actor.home.pos.y += 2.0f; EnPoField_SoulUpdateProperties(this, 20); if (this->lightColor.a == 255) { func_80AD4384(this); @@ -617,24 +672,24 @@ void func_80AD58D4(EnPoField* this, GlobalContext* globalCtx) { EnPoField_SetupSoulDisappear(this); return; } - if (this->collider.base.maskA & 2) { + if (this->collider.base.ocFlags1 & OC1_HIT) { this->actor.flags |= 0x10000; func_8002F2F4(&this->actor, globalCtx); } else { this->actor.flags &= ~0x10000; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - this->actor.posRot.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.home.pos.y; if (this->unk_194 != 0) { this->unk_194 -= 1; } if (this->unk_194 == 0) { this->unk_194 = 32; } - this->collider.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - Actor_SetHeight(&this->actor, -10.0f); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->lightInfo.params.point.color[0], + this->collider.dim.pos.y = this->actor.world.pos.y - 20.0f; + Actor_SetFocus(&this->actor, -10.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->lightInfo.params.point.color[0], this->lightInfo.params.point.color[1], this->lightInfo.params.point.color[2], this->lightColor.a * 0.78431374f); } @@ -683,8 +738,8 @@ void EnPoField_SoulInteract(EnPoField* this, GlobalContext* globalCtx) { } void EnPoField_TestForDamage(EnPoField* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -712,8 +767,8 @@ void EnPoField_UpdateFlame(EnPoField* this, GlobalContext* globalCtx) { if (this->flameTimer != 0) { this->flameTimer--; } - if (this->flameCollider.base.atFlags & 2) { - this->flameCollider.base.atFlags &= ~2; + if (this->flameCollider.base.atFlags & AT_HIT) { + this->flameCollider.base.atFlags &= ~AT_HIT; this->flameTimer = 19; } if (this->flameTimer < 20) { @@ -769,7 +824,7 @@ void func_80AD619C(EnPoField* this) { temp_var = this->lightColor.b + 5; this->lightColor.b = CLAMP_MAX(temp_var, 225); } else if (this->actionFunc == EnPoField_Damage) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->lightColor.r = 0; this->lightColor.g = 0; this->lightColor.b = 0; @@ -818,13 +873,13 @@ void EnPoField_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); } if (this->actionFunc != EnPoField_WaitForSpawn) { - Actor_SetHeight(&this->actor, 42.0f); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Actor_SetFocus(&this->actor, 42.0f); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); func_80AD619C(this); func_80AD6330(this); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->collider.base.acFlags & 1) { + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -868,9 +923,9 @@ void EnPoField_PostLimDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList } Matrix_Get(&sLimb7Mtx); if (this->actionFunc == EnPoField_Death && this->actionTimer == 27) { - this->actor.posRot.pos.x = sLimb7Mtx.wx; - this->actor.posRot.pos.y = sLimb7Mtx.wy; - this->actor.posRot.pos.z = sLimb7Mtx.wz; + this->actor.world.pos.x = sLimb7Mtx.wx; + this->actor.world.pos.y = sLimb7Mtx.wy; + this->actor.world.pos.z = sLimb7Mtx.wz; } Lights_PointGlowSetInfo(&this->lightInfo, vec.x, vec.y, vec.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, this->soulColor.a * 0.7843137383460999f); @@ -936,8 +991,8 @@ void EnPoField_DrawSoul(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, info->envColor.r, info->envColor.g, info->envColor.b, 255)); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, 200); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, 200); gDPSetEnvColor(POLY_OPA_DISP++, this->soulColor.r, this->soulColor.g, this->soulColor.b, 255); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_po_field.c", 2104), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index b65c3667f5..9ca2820ecc 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -36,7 +36,7 @@ Vec3s D_80AD8C30[] = { const ActorInit En_Po_Relay_InitVars = { ACTOR_EN_PO_RELAY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TK, sizeof(EnPoRelay), @@ -47,8 +47,22 @@ const ActorInit En_Po_Relay_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 52, 0, { 0, 0, 0 } }, }; @@ -56,7 +70,7 @@ static s32 D_80AD8D24 = 0; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x4F, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 1500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_STOP), }; static Vec3f D_80AD8D30 = { 0.0f, 1.5f, 0.0f }; @@ -81,13 +95,13 @@ void EnPoRelay_Init(Actor* thisx, GlobalContext* globalCtx) { s32 temp; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 42.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BE40, &D_06003768, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 200); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 200); this->lightColor.a = 255; temp = 1; if (D_80AD8D24 != 0) { @@ -113,8 +127,8 @@ void EnPoRelay_SetupIdle(EnPoRelay* this) { this->pathIndex = 0; this->actor.room = -1; this->actor.shape.rot.y = 0; - this->actor.posRot.rot.y = -0x8000; - this->actor.colChkInfo.mass = 0xFE; + this->actor.world.rot.y = -0x8000; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actionFunc = EnPoRelay_Idle; } @@ -128,34 +142,33 @@ void EnPoRelay_SetupRace(EnPoRelay* this) { Vec3f vec; EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); - this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.posRot.rot.y - 0x8000) >> 0xB) % 32U; + this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U; func_80088B34(0); this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE; - this->unk_19A = func_8002DAC0(&this->actor, &vec); + this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); this->actor.flags |= 0x8000000; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = EnPoRelay_Race; } void EnPoRelay_SetupEndRace(EnPoRelay* this) { - this->actor.posRot.rot.y = this->actor.initPosRot.rot.y + 0xC000; + this->actor.world.rot.y = this->actor.home.rot.y + 0xC000; this->actor.flags &= ~0x08000000; this->actor.speedXZ = 0.0f; this->actionFunc = EnPoRelay_EndRace; } void EnPoRelay_CorrectY(EnPoRelay* this) { - Math_StepToF(&this->actor.initPosRot.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, - 2.0f); - this->actor.posRot.pos.y = Math_SinS(this->unk_195 * 0x800) * 8.0f + this->actor.initPosRot.pos.y; + Math_StepToF(&this->actor.home.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, 2.0f); + this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 8.0f + this->actor.home.pos.y; } void EnPoRelay_Idle(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8002F194(&this->actor, globalCtx) != 0) { this->actor.flags &= ~0x10000; this->actionFunc = EnPoRelay_Talk; - } else if (this->actor.xzDistToLink < 250.0f) { + } else if (this->actor.xzDistToPlayer < 250.0f) { this->actor.flags |= 0x10000; this->actor.textId = this->textId; func_8002F2CC(&this->actor, globalCtx, 250.0f); @@ -164,7 +177,7 @@ void EnPoRelay_Idle(EnPoRelay* this, GlobalContext* globalCtx) { } void EnPoRelay_Talk(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8002F334(&this->actor, globalCtx) != 0) { Actor_SetTextWithPrefix(globalCtx, &this->actor, 0x2F); this->textId = this->actor.textId; @@ -195,32 +208,32 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { } speed = 30.0f * multiplier; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HONOTRAP, - Math_CosS(this->unk_19A) * speed + this->actor.posRot.pos.x, this->actor.posRot.pos.y, - Math_SinS(this->unk_19A) * speed + this->actor.posRot.pos.z, 0, + Math_CosS(this->unk_19A) * speed + this->actor.world.pos.x, this->actor.world.pos.y, + Math_SinS(this->unk_19A) * speed + this->actor.world.pos.z, 0, (this->unk_19A + 0x8000) - (0x2000 * multiplier), 0, HONOTRAP_FLAME_DROP); } } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_19A, 2, 0x1000, 0x100); - this->actor.shape.rot.y = this->actor.posRot.rot.y + (this->actionTimer * 0x800) + 0x8000; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_19A, 2, 0x1000, 0x100); + this->actor.shape.rot.y = this->actor.world.rot.y + (this->actionTimer * 0x800) + 0x8000; if (this->pathIndex < 23) { // If the player travels along a different path to Dampé that converges later - if ((Math3D_PointInSquare2D(660.0f, 840.0f, -4480.0f, -3760.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0) || - (Math3D_PointInSquare2D(1560.0f, 1740.0f, -4030.0f, -3670.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0) || - (Math3D_PointInSquare2D(1580.0f, 2090.0f, -3030.0f, -2500.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0)) { + if ((Math3D_PointInSquare2D(660.0f, 840.0f, -4480.0f, -3760.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0) || + (Math3D_PointInSquare2D(1560.0f, 1740.0f, -4030.0f, -3670.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0) || + (Math3D_PointInSquare2D(1580.0f, 2090.0f, -3030.0f, -2500.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0)) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ * 1.4f : player->actor.speedXZ * 1.2f; - } else if (this->actor.xzDistToLink < 150.0f) { + } else if (this->actor.xzDistToPlayer < 150.0f) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ * 1.2f : player->actor.speedXZ; - } else if (this->actor.xzDistToLink < 300.0f) { + } else if (this->actor.xzDistToPlayer < 300.0f) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ : player->actor.speedXZ * 0.8f; } else if (this->hookshotSlotFull) { speed = 4.5f; } else { speed = 3.5f; } - multiplier = 250.0f - this->actor.xzDistToLink; + multiplier = 250.0f - this->actor.xzDistToPlayer; multiplier = CLAMP_MIN(multiplier, 0.0f); speed += multiplier * 0.02f + 1.0f; Math_ApproachF(&this->actor.speedXZ, speed, 0.5f, 1.5f); @@ -228,7 +241,7 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.5f, 1.5f); } EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); - if (func_8002DBB0(&this->actor, &vec) < 40.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &vec) < 40.0f) { this->pathIndex++; EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); if (this->pathIndex == 28) { @@ -241,7 +254,7 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, 0x37); } } - this->unk_19A = func_8002DAC0(&this->actor, &vec); + this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } @@ -260,7 +273,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, GlobalContext* globalCtx) { } void EnPoRelay_Talk2(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8010BDBC(&globalCtx->msgCtx) == 5) { if (func_80106BC8(globalCtx) != 0) { if (this->hookshotSlotFull != 0) { @@ -289,23 +302,23 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { this->actionTimer++; if (this->actionTimer < 8) { if (this->actionTimer < 5) { - vec.y = Math_SinS((this->actionTimer * 0x1000) - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + vec.y = Math_SinS((this->actionTimer * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); multiplier = Math_CosS((this->actionTimer * 0x1000) - 0x4000) * 23.0f; - vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.posRot.pos.x; - vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.posRot.pos.z; + vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.world.pos.x; + vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.world.pos.z; } else { - vec.y = this->actor.posRot.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); - vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.posRot.pos.x; - vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.posRot.pos.z; + vec.y = this->actor.world.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); + vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.world.pos.x; + vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - vec.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - vec.x; - vec.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - vec.z; + vec.x = (this->actor.world.pos.x + this->actor.world.pos.x) - vec.x; + vec.z = (this->actor.world.pos.z + this->actor.world.pos.z) - vec.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - vec.x = this->actor.posRot.pos.x; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); if (this->actionTimer == 1) { @@ -314,9 +327,9 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { } if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) { if (this->hookshotSlotFull != 0) { - sp60.x = this->actor.posRot.pos.x; - sp60.y = this->actor.groundY; - sp60.z = this->actor.posRot.pos.z; + sp60.x = this->actor.world.pos.x; + sp60.y = this->actor.floorHeight; + sp60.z = this->actor.world.pos.z; if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) { HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value; } @@ -333,7 +346,7 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { } this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; - this->actor.posRot.pos.y += 10.0f; + this->actor.world.pos.y += 10.0f; } void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -344,10 +357,10 @@ void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); EnPoRelay_CorrectY(this); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); if (this->unk_195 != 0) { this->unk_195 -= 1; } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 7d880a9ba9..d1089914ec 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -63,7 +63,7 @@ static Color_RGBA8 D_80ADD700[4] = { const ActorInit En_Po_Sisters_InitVars = { ACTOR_EN_PO_SISTERS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PO_SISTERS, sizeof(EnPoSisters), @@ -74,23 +74,67 @@ const ActorInit En_Po_Sisters_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x4FC7FFEA, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x4FC7FFEA, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 18, 60, 15, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x0A, 0x0019, 0x003C, 0x28 }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 25, 60, 40 }; static DamageTable sDamageTable = { - 0xF0, 0x02, 0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0xE1, 0xE2, 0xE4, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE1, 0xE4, 0xE2, 0xE2, 0xE8, 0xE4, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xE), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 D_80ADD784 = 0; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 7, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 6000, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 6000, ICHAIN_STOP), }; static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; @@ -138,18 +182,18 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060065C8, &D_060014CC, this->jointTable, this->morphTable, 12); this->unk_22E.r = 255; this->unk_22E.g = 255; this->unk_22E.b = 210; this->unk_22E.a = 255; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 0, 0, 0, 0); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, + 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->unk_194 = (thisx->params >> 8) & 3; this->actor.naviEnemyId = this->unk_194 + 0x50; if (1) {} @@ -164,13 +208,13 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { func_80ADA094(this, globalCtx); } else if (this->unk_194 == 0) { if (this->unk_195 == 0) { - this->collider.base.maskA = 9; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; func_80AD9AA8(this, globalCtx); } else { - this->actor.flags &= -0x4201; - this->collider.body.flags = 4; - this->collider.body.bumper.flags |= 1; - this->collider.base.maskA = 0; + this->actor.flags &= ~0x00004200; + this->collider.info.elemType = ELEMTYPE_UNK4; + this->collider.info.bumper.dmgFlags |= 1; + this->collider.base.ocFlags1 = OC1_NONE; func_80AD9C24(this, NULL); } } else { @@ -224,8 +268,8 @@ void func_80AD943C(EnPoSisters* this) { void func_80AD944C(EnPoSisters* this) { if (this->unk_22E.a != 0) { - this->collider.base.type = COLTYPE_METAL_SHIELD; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_METAL; + this->collider.base.acFlags |= AC_HARD; } Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); this->actor.speedXZ = 0.0f; @@ -237,22 +281,22 @@ void func_80AD944C(EnPoSisters* this) { void func_80AD94E0(EnPoSisters* this) { this->actor.speedXZ = 5.0f; if (this->unk_194 == 0) { - this->collider.base.type = COLTYPE_METAL_SHIELD; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_METAL; + this->collider.base.acFlags |= AC_HARD; Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); } this->unk_19A = 5; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->unk_199 |= 8; this->actionFunc = func_80ADA8C0; } void func_80AD9568(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; if (this->unk_194 != 0) { - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; } this->actionFunc = func_80ADA9E8; } @@ -260,9 +304,9 @@ void func_80AD9568(EnPoSisters* this) { void func_80AD95D8(EnPoSisters* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060008C0, -3.0f); if (this->collider.base.ac != NULL) { - this->actor.posRot.rot.y = (this->collider.body.acHitItem->toucher.flags & 0x1F824) - ? this->collider.base.ac->posRot.rot.y - : func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) + ? this->collider.base.ac->world.rot.y + : Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } if (this->unk_194 != 0) { this->actor.speedXZ = 10.0f; @@ -274,7 +318,7 @@ void func_80AD95D8(EnPoSisters* this) { void func_80AD96A4(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000A54, -3.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->unk_19A = 5; this->unk_199 |= 0xB; this->actor.speedXZ = 5.0f; @@ -286,7 +330,7 @@ void func_80AD9718(EnPoSisters* this) { -3.0f); this->actor.speedXZ = 0.0f; this->unk_19C = 100; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 &= ~5; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -299,17 +343,17 @@ void func_80AD97C8(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_195 == 0 || this->actionFunc != func_80ADAAA4) { if ((player->swordState == 0 || player->swordAnimation >= 24) && - player->actor.posRot.pos.y - player->actor.groundY < 1.0f) { + player->actor.world.pos.y - player->actor.floorHeight < 1.0f) { Math_StepToF(&this->unk_294, 110.0f, 3.0f); } else { Math_StepToF(&this->unk_294, 170.0f, 10.0f); } sp20 = this->unk_294; } else if (this->unk_195 != 0) { - sp20 = this->actor.parent->xzDistToLink; + sp20 = this->actor.parent->xzDistToPlayer; } - this->actor.posRot.pos.x = (Math_SinS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.posRot.pos.z; + this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.world.pos.x; + this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.world.pos.z; } void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { @@ -321,7 +365,7 @@ void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 0; this->actor.draw = EnPoSisters_Draw; } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } this->unk_19A = 15; this->actor.speedXZ = 0.0f; @@ -333,8 +377,8 @@ void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80AD99D4(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A = 0; this->actor.speedXZ = 0.0f; - this->actor.posRot.pos.y += 42.0f; - this->actor.shape.unk_08 = -6000.0f; + this->actor.world.pos.y += 42.0f; + this->actor.shape.yOffset = -6000.0f; this->actor.flags &= -2; this->unk_199 = 0; this->actionFunc = func_80ADAFC0; @@ -343,19 +387,19 @@ void func_80AD99D4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80AD9A54(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A = 0; - this->actor.posRot.pos.y = this->unk_234[0].y; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x80); + this->actor.world.pos.y = this->unk_234[0].y; + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); this->actionFunc = func_80ADB17C; } // Meg spawning fakes void func_80AD9AA8(EnPoSisters* this, GlobalContext* globalCtx) { - Actor* actor1 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0x400); - Actor* actor2 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0x800); - Actor* actor3 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0xC00); + Actor* actor1 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x400); + Actor* actor2 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x800); + Actor* actor3 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0xC00); s32 pad; s32 pad1; @@ -388,12 +432,12 @@ void func_80AD9C24(EnPoSisters* this, GlobalContext* globalCtx) { this->actor.flags &= -2; this->unk_19C = 100; this->unk_199 = 32; - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; if (globalCtx != NULL) { - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 45.0f; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 45.0f; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &sZeroVector, &sZeroVector, 150, 0, 255, 255, 255, 155, 150, 150, 150, 1, 9, 0); } @@ -426,10 +470,10 @@ void func_80AD9E60(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); this->unk_19A = Animation_GetLastFrame(&D_06000D40) * 7 + 7; if (this->actor.parent != NULL) { - this->actor.posRot.pos = this->actor.parent->posRot.pos; + this->actor.world.pos = this->actor.parent->world.pos; this->actor.shape.rot.y = this->actor.parent->shape.rot.y; } else { - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_19A++; } if (this->unk_195 == 0) { @@ -450,11 +494,11 @@ void func_80AD9F1C(EnPoSisters* this) { void func_80AD9F90(EnPoSisters* this) { if (this->unk_194 == 1) { - this->actor.initPosRot.pos.x = -632.0f; - this->actor.initPosRot.pos.z = -3440.0f; + this->actor.home.pos.x = -632.0f; + this->actor.home.pos.z = -3440.0f; } else { - this->actor.initPosRot.pos.x = 752.0f; - this->actor.initPosRot.pos.z = -3440.0f; + this->actor.home.pos.x = 752.0f; + this->actor.home.pos.z = -3440.0f; } Animation_PlayLoop(&this->skelAnime, &D_06000D40); this->unk_199 |= 0xA; @@ -476,8 +520,8 @@ void func_80ADA094(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 0; this->unk_199 = 128; this->unk_19A = 50; - this->unk_234[0] = this->actor.initPosRot.pos; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + this->unk_234[0] = this->actor.home.pos; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); this->actionFunc = func_80ADBC88; } @@ -508,7 +552,7 @@ void func_80ADA25C(EnPoSisters* this) { Animation_PlayLoop(&this->skelAnime, &D_060014CC); this->unk_198 = 8; this->unk_19A = 32; - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); this->actionFunc = func_80ADBEE8; } @@ -518,8 +562,8 @@ void func_80ADA2BC(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_199 = 40; this->unk_19A = 90; this->unk_196 = 32; - this->actor.posRot.rot.y = D_80ADD79C[this->unk_194]; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.world.rot.y = D_80ADD79C[this->unk_194]; + this->actor.home.pos.y = this->actor.world.pos.y; if (this->unk_194 == 0) { Flags_SetSwitch(globalCtx, 0x1B); } @@ -532,20 +576,20 @@ void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->actionFunc == func_80ADBF58) { - targetY = this->actor.initPosRot.pos.y; + targetY = this->actor.home.pos.y; } else if (this->unk_194 == 0 || this->unk_194 == 3) { - targetY = player->actor.posRot.pos.y + 5.0f; + targetY = player->actor.world.pos.y + 5.0f; } else { targetY = 832.0f; } - Math_ApproachF(&this->actor.posRot.pos.y, targetY, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.y, targetY, 0.5f, 3.0f); if (!this->unk_196) { this->unk_196 = 32; } if (this->unk_196 != 0) { this->unk_196--; } - this->actor.posRot.pos.y += (2.0f + 0.5f * Rand_ZeroOne()) * Math_SinS(this->unk_196 * 0x800); + this->actor.world.pos.y += (2.0f + 0.5f * Rand_ZeroOne()) * Math_SinS(this->unk_196 * 0x800); if (this->unk_22E.a == 255 && this->actionFunc != func_80ADA8C0 && this->actionFunc != func_80ADA7F0) { if (this->actionFunc == func_80ADAC70) { func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); @@ -560,7 +604,7 @@ void func_80ADA4A8(EnPoSisters* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } - if (this->unk_19A == 0 || this->actor.xzDistToLink < 200.0f) { + if (this->unk_19A == 0 || this->actor.xzDistToPlayer < 200.0f) { func_80AD93C4(this); } } @@ -571,15 +615,17 @@ void func_80ADA530(EnPoSisters* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } - if (this->actor.xzDistToLink < 200.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + if (this->actor.xzDistToPlayer < 200.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD943C(this); } else if (this->unk_19A == 0 && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f) != 0) { func_80AD9368(this); } if (this->actor.bgCheckFlags & 8) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x71C); - } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 300.0f) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); } } @@ -588,18 +634,18 @@ void func_80ADA6A0(EnPoSisters* this, GlobalContext* globalCtx) { s16 temp_v0; SkelAnime_Update(&this->skelAnime); - temp_v0 = this->actor.yawTowardsLink - player->actor.shape.rot.y; + temp_v0 = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; Math_StepToF(&this->actor.speedXZ, 2.0f, 0.2f); if (temp_v0 > 0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (temp_v0 < -0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } - if (this->actor.xzDistToLink < 160.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + if (this->actor.xzDistToPlayer < 160.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD944C(this); - } else if (this->actor.xzDistToLink > 240.0f) { + } else if (this->actor.xzDistToPlayer > 240.0f) { func_80AD93C4(this); } } @@ -626,10 +672,10 @@ void func_80ADA8C0(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A--; } this->actor.shape.rot.y += (384.0f * this->skelAnime.endFrame) * 3.0f; - if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.posRot.rot.y)) < 0x1000) { + if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.world.rot.y)) < 0x1000) { if (this->unk_194 != 0) { - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; func_80AD93C4(this); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -645,7 +691,7 @@ void func_80ADA9E8(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.shape.rot.y -= (this->actor.speedXZ * 10.0f) * 128.0f; if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f) != 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->unk_194 != 0) { func_80AD93C4(this); } else { @@ -673,7 +719,7 @@ void func_80ADAAA4(EnPoSisters* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y, (this->unk_195 == 2) ? 0x800 : 0x400); this->unk_22E.a = ((this->skelAnime.endFrame - this->skelAnime.curFrame) * 255.0f) / this->skelAnime.endFrame; - this->actor.posRot.pos.y = this->actor.parent->posRot.pos.y; + this->actor.world.pos.y = this->actor.parent->world.pos.y; func_80AD97C8(this, globalCtx); } else if (this->unk_194 != 0) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); @@ -682,16 +728,16 @@ void func_80ADAAA4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADAC70(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 1820); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1820); if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } if (this->actor.bgCheckFlags & 8) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD9718(this); - } else if (this->unk_19A == 0 && 240.0f < this->actor.xzDistToLink) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + } else if (this->unk_19A == 0 && 240.0f < this->actor.xzDistToPlayer) { + this->actor.world.rot.y = this->actor.shape.rot.y; func_80AD93C4(this); } } @@ -701,7 +747,7 @@ void func_80ADAD54(EnPoSisters* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->unk_22E.a = 0; - this->collider.body.bumper.flags = 0x60001; + this->collider.info.bumper.dmgFlags = 0x00060001; func_80AD93C4(this); } else { endFrame = this->skelAnime.endFrame; @@ -714,7 +760,7 @@ void func_80ADAE6C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 255; if (this->unk_194 != 0) { this->unk_199 |= 1; - this->collider.body.bumper.flags = 0x4FC7FFEA; + this->collider.info.bumper.dmgFlags = 0x4FC7FFEA; if (this->unk_19A != 0) { this->unk_19A--; } @@ -743,10 +789,10 @@ void func_80ADAFC0(EnPoSisters* this, GlobalContext* globalCtx) { } this->unk_234[0].x = (Math_SinS((this->actor.shape.rot.y + this->unk_19A * 0x3000) - 0x4000) * (3000.0f * this->actor.scale.x)) + - this->actor.posRot.pos.x; + this->actor.world.pos.x; this->unk_234[0].z = (Math_CosS((this->actor.shape.rot.y + this->unk_19A * 0x3000) - 0x4000) * (3000.0f * this->actor.scale.x)) + - this->actor.posRot.pos.z; + this->actor.world.pos.z; if (this->unk_19A < 8) { this->unk_234[0].y = this->unk_234[1].y - 9.0f; } else { @@ -768,7 +814,7 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A++; if (this->unk_19A == 64) { Flags_SetSwitch(globalCtx, this->actor.params); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EV_FLAME_IGNITION); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_FLAME_IGNITION); if (this->unk_194 == 0) { Flags_UnsetSwitch(globalCtx, 0x1B); } @@ -776,26 +822,26 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) { func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); } else if (this->unk_19A < 32) { - func_80AD9240(this, this->unk_19A, &this->actor.posRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.world.pos); } else { - func_80AD9240(this, 64 - this->unk_19A, &this->actor.posRot.pos); + func_80AD9240(this, 64 - this->unk_19A, &this->actor.world.pos); } if (this->unk_19A == 32) { - this->actor.posRot.pos.x = D_80ADD7A4[this->unk_194].x; - this->actor.posRot.pos.y = D_80ADD7A4[this->unk_194].y; - this->actor.posRot.pos.z = D_80ADD7A4[this->unk_194].z; + this->actor.world.pos.x = D_80ADD7A4[this->unk_194].x; + this->actor.world.pos.y = D_80ADD7A4[this->unk_194].y; + this->actor.world.pos.z = D_80ADD7A4[this->unk_194].z; } } void func_80ADB2B8(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { func_80AD9DF0(this, globalCtx); } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_CRY); } - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; } void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { @@ -803,7 +849,7 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { EnPoSisters* realMeg = (EnPoSisters*)this->actor.parent; if (this->unk_195 == 0) { - if (func_8002DBB0(&player->actor, &this->actor.initPosRot.pos) < 600.0f) { + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 600.0f) { if (this->unk_19C != 0) { this->unk_19C--; } @@ -811,8 +857,8 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19C = 100; } if (this->unk_19C == 0) { - this->actor.shape.rot.y = (s32)(4.0f * Rand_ZeroOne()) * 0x4000 + this->actor.yawTowardsLink; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 5.0f; + this->actor.shape.rot.y = (s32)(4.0f * Rand_ZeroOne()) * 0x4000 + this->actor.yawTowardsPlayer; + this->actor.world.pos.y = player->actor.world.pos.y + 5.0f; func_80AD98F4(this, globalCtx); } } else { @@ -821,7 +867,7 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { func_80AD9E60(this); } else if (realMeg->actionFunc == func_80ADAE6C) { this->actor.shape.rot.y = this->actor.parent->shape.rot.y + this->unk_195 * 0x4000; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 5.0f; + this->actor.world.pos.y = player->actor.world.pos.y + 5.0f; func_80AD98F4(this, globalCtx); } else if (realMeg->actionFunc == func_80ADAFC0) { Actor_Kill(&this->actor); @@ -834,8 +880,8 @@ void func_80ADB4B0(EnPoSisters* this, GlobalContext* globalCtx) { func_80AD9E60(this); } func_80AD97C8(this, globalCtx); - this->actor.posRot.pos.y += 1.0f; - Actor_SetHeight(&this->actor, 40.0f); + this->actor.world.pos.y += 1.0f; + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { @@ -851,13 +897,13 @@ void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A -= 1; } if (this->unk_19A == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y += 0x4000 * (s32)(Rand_ZeroOne() * 4.0f); + this->actor.world.rot.y = this->actor.shape.rot.y += 0x4000 * (s32)(Rand_ZeroOne() * 4.0f); if (this->unk_195 == 0) { func_800F5ACC(0x38); } func_80AD9F1C(this); } else { - this->actor.posRot.pos.y += 0.1f; + this->actor.world.pos.y += 0.1f; temp = this->unk_195; if (temp != 0) { if (this->unk_19A > 90) { @@ -886,7 +932,7 @@ void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { } } func_80AD97C8(this, globalCtx); - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) { @@ -921,7 +967,7 @@ void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_199 &= ~0x40; } } - if (func_8002DBB0(&PLAYER->actor, &this->actor.initPosRot.pos) > 600.0f) { + if (Actor_WorldDistXZToPoint(&PLAYER->actor, &this->actor.home.pos) > 600.0f) { this->unk_199 &= ~0x40; func_80AD9C24(this, globalCtx); } else if (this->unk_19A == 0) { @@ -953,8 +999,8 @@ void func_80ADB9F0(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 255; if (this->unk_194 == 3) { this->actor.flags |= 1; - this->actor.initPosRot.pos.x = 1992.0f; - this->actor.initPosRot.pos.z = -1440.0f; + this->actor.home.pos.x = 1992.0f; + this->actor.home.pos.z = -1440.0f; this->unk_199 |= 0x18; func_80AD93C4(this); } else { @@ -967,22 +1013,23 @@ void func_80ADB9F0(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_194 != 3 && Animation_OnFrame(&this->skelAnime, 1.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); } - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADBB6C(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) < 10.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 10.0f) { func_80ADA028(this); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 1820); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 1820); } } void func_80ADBBF4(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1820); - if (this->actor.xzDistToLink < 240.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1820); + if (this->actor.xzDistToPlayer < 240.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD93C4(this); } } @@ -1007,7 +1054,7 @@ void func_80ADBC88(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADBD38(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A++; - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); if (this->unk_19A == 32) { func_80ADA1B8(this); } @@ -1037,7 +1084,7 @@ void func_80ADBEE8(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_19A != 0) { this->unk_19A--; } - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); if (this->unk_19A == 0) { func_80ADA2BC(this, globalCtx); } @@ -1046,7 +1093,7 @@ void func_80ADBEE8(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_19A--; - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 0x500); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x500); if (this->unk_19A == 0 && this->unk_194 == 0) { globalCtx->envCtx.unk_BF = 4; } @@ -1062,7 +1109,7 @@ void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80ADC034(EnPoSisters* this, GlobalContext* globalCtx) { - if (this->actor.unk_10C != 0 && this->unk_22E.a == 255) { + if (this->actor.isTargeted && this->unk_22E.a == 255) { if (this->unk_197 != 0) { this->unk_197--; } @@ -1086,26 +1133,26 @@ void func_80ADC034(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { Vec3f sp24; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if (this->unk_195 != 0) { ((EnPoSisters*)this->actor.parent)->unk_19C--; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); func_80AD9C24(this, globalCtx); if (Rand_ZeroOne() < 0.2f) { - sp24.x = this->actor.posRot.pos.x; - sp24.y = this->actor.posRot.pos.y; - sp24.z = this->actor.posRot.pos.z; + sp24.x = this->actor.world.pos.x; + sp24.y = this->actor.world.pos.y; + sp24.z = this->actor.world.pos.z; Item_DropCollectible(globalCtx, &sp24, ITEM00_ARROWS_SMALL); } - } else if (this->collider.base.type == 9 || + } else if (this->collider.base.colType == 9 || (this->actor.colChkInfo.damageEffect == 0 && this->actor.colChkInfo.damage == 0)) { if (this->unk_194 == 0) { this->actor.freezeTimer = 0; } } else if (this->actor.colChkInfo.damageEffect == 0xF) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD98F4(this, globalCtx); } else if (this->unk_194 == 0 && this->actor.colChkInfo.damageEffect == 0xE && @@ -1130,8 +1177,8 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { EnPoSisters* this = THIS; s16 temp; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_80AD9568(this); } func_80ADC10C(this, globalCtx); @@ -1146,19 +1193,19 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (this->unk_199 & 0x10) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5); } else { Vec3f vec; UNK_TYPE sp34; - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 10.0f; - vec.z = this->actor.posRot.pos.z; - this->actor.groundY = + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 10.0f; + vec.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp34, &this->actor, &vec); } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (this->actionFunc == func_80ADA8C0 || this->actionFunc == func_80ADA7F0) { this->unk_198++; this->unk_198 = CLAMP_MAX(this->unk_198, 8); @@ -1176,11 +1223,11 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != func_80ADB338) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); if (this->actionFunc == func_80ADAC70) { - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } else if (this->unk_199 & 2) { - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } } @@ -1199,7 +1246,7 @@ void func_80ADC55C(EnPoSisters* this) { temp_var = this->unk_22E.b + 5; this->unk_22E.b = CLAMP_MAX(temp_var, 225); } else if (this->skelAnime.animation == &D_060008C0) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->unk_22E.r = 0; this->unk_22E.g = 0; this->unk_22E.b = 0; @@ -1267,7 +1314,7 @@ void EnPoSisters_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi } Matrix_MultVec3f(&D_80ADD7F8, &this->unk_234[0]); } else if (this->actionFunc == func_80ADBD8C) { - Matrix_MultVec3f(&D_80ADD7F8, &this->actor.initPosRot.pos); + Matrix_MultVec3f(&D_80ADD7F8, &this->actor.home.pos); } if (this->unk_198 > 0) { Color_RGBA8* color = &D_80ADD6F0[this->unk_194]; diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 07b76abd96..44a620f1b6 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -44,7 +44,7 @@ static s16 D_80AE1A50 = 0; const ActorInit En_Poh_InitVars = { ACTOR_EN_POH, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnPoh), @@ -55,25 +55,87 @@ const ActorInit En_Poh_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, 20, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit D_80AE1AA0[] = { +static ColliderJntSphElementInit D_80AE1AA0[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 18, { { 0, 1400, 0 }, 10 }, 100 }, }, }; -static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, 1, D_80AE1AA0 }; +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80AE1AA0, +}; -static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x0019, 0x0032, 0x28 }; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 25, 50, 40 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x11, 0x02, 0x02, 0x12, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static EnPohInfo sPoeInfo[2] = { @@ -113,7 +175,7 @@ static Color_RGBA8 D_80AE1B54 = { 90, 85, 50, 255 }; static Color_RGBA8 D_80AE1B58 = { 100, 90, 100, 255 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AE1B60 = { 0.0f, 3.0f, 0.0f }; @@ -142,22 +204,22 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { EnPoh* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); Collider_InitJntSph(globalCtx, &this->colliderSph); Collider_SetJntSph(globalCtx, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); - this->colliderSph.list[0].dim.worldSphere.radius = 0; - this->colliderSph.list[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderSph.list[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->colliderSph.list[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->colliderSph.elements[0].dim.worldSphere.radius = 0; + this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; + this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; Collider_InitCylinder(globalCtx, &this->colliderCyl); Collider_SetCylinder(globalCtx, &this->colliderCyl, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->unk_194 = 0; this->unk_195 = 32; this->visibilityTimer = Rand_S16Offset(700, 300); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 0); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 0); if (this->actor.params >= 4) { this->actor.params = EN_POH_NORMAL; } @@ -166,7 +228,7 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { if (D_80AE1A50 >= 3) { Actor_Kill(&this->actor); } else { - collectible = Item_DropCollectible(globalCtx, &this->actor.posRot.pos, 0x4000 | ITEM00_RUPEE_BLUE); + collectible = Item_DropCollectible(globalCtx, &this->actor.world.pos, 0x4000 | ITEM00_RUPEE_BLUE); if (collectible != NULL) { collectible->actor.speedXZ = 0.0f; } @@ -248,12 +310,12 @@ void func_80ADE28C(EnPoh* this) { } else { Animation_PlayOnce(&this->skelAnime, &D_06000570); } - if (this->colliderCyl.body.acHitItem->toucher.flags & 0x0001F824) { - this->actor.posRot.rot.y = this->colliderCyl.base.ac->posRot.rot.y; + if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { + this->actor.world.rot.y = this->colliderCyl.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colliderCyl.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCyl.base.ac) + 0x8000; } - this->colliderCyl.base.acFlags &= ~1; + this->colliderCyl.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x10); this->actionFunc = func_80ADEECC; @@ -262,8 +324,8 @@ void func_80ADE28C(EnPoh* this) { void func_80ADE368(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, this->info->unk_18, -5.0f); this->actor.speedXZ = 5.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; - this->colliderCyl.base.acFlags |= 1; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; + this->colliderCyl.base.acFlags |= AC_ON; this->unk_198 = 200; this->actionFunc = func_80ADF894; } @@ -276,7 +338,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) { this->actionFunc = func_80ADEF38; } else { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06000FE4, 1.0f); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 20.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); this->actionFunc = EnPoh_ComposerAppear; @@ -285,7 +347,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) { void func_80ADE48C(EnPoh* this) { this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_198 = 0; this->actor.naviEnemyId = 0xFF; this->actor.flags &= ~1; @@ -300,7 +362,7 @@ void func_80ADE4C8(EnPoh* this) { void func_80ADE514(EnPoh* this) { Animation_PlayLoop(&this->skelAnime, this->info->unk_C); - this->unk_19C = this->actor.posRot.rot.y + 0x8000; + this->unk_19C = this->actor.world.rot.y + 0x8000; this->actionFunc = func_80ADF5E0; this->actor.speedXZ = 0.0f; } @@ -308,7 +370,7 @@ void func_80ADE514(EnPoh* this) { void EnPoh_SetupDisappear(EnPoh* this) { this->unk_194 = 32; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = EnPoh_Disappear; @@ -325,28 +387,28 @@ void EnPoh_SetupAppear(EnPoh* this) { void EnPoh_SetupDeath(EnPoh* this, GlobalContext* globalCtx) { this->actor.update = EnPoh_UpdateDead; this->actor.draw = EnPoh_DrawSoul; - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; Actor_SetScale(&this->actor, 0.01f); this->actor.flags |= 0x10; this->actor.gravity = -1.0f; - this->actor.shape.unk_08 = 1500.0f; - this->actor.posRot.pos.y -= 15.0f; + this->actor.shape.yOffset = 1500.0f; + this->actor.world.pos.y -= 15.0f; if (this->infoIdx != EN_POH_INFO_COMPOSER) { this->actor.shape.rot.x = -0x8000; } - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 8); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 8); this->unk_198 = 60; this->actionFunc = EnPoh_Death; } void func_80ADE6D4(EnPoh* this) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->visibilityTimer = 0; this->actor.shape.rot.y = 0; this->lightColor.r = 0; this->lightColor.a = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; if (this->actor.params >= EN_POH_SHARP) { @@ -359,21 +421,21 @@ void func_80ADE6D4(EnPoh* this) { this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; this->actor.shape.rot.x = 0; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); this->actionFunc = func_80ADFE28; } void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + this->actor.home.pos.y = this->actor.world.pos.y; + Actor_SetFocus(&this->actor, -10.0f); this->colliderCyl.dim.radius = 13; this->colliderCyl.dim.height = 30; this->colliderCyl.dim.yShift = 0; - this->colliderCyl.dim.pos.x = this->actor.posRot.pos.x; - this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - this->colliderCyl.dim.pos.z = this->actor.posRot.pos.z; - this->colliderCyl.base.maskA = 9; + this->colliderCyl.dim.pos.x = this->actor.world.pos.x; + this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f; + this->colliderCyl.dim.pos.z = this->actor.world.pos.z; + this->colliderCyl.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; if (this->actor.params == EN_POH_FLAT || this->actor.params == EN_POH_SHARP) { if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { this->actor.textId = 0x5000; @@ -404,7 +466,7 @@ void func_80ADE950(EnPoh* this, s32 arg1) { void func_80ADE998(EnPoh* this) { this->actionFunc = EnPoh_TalkRegular; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y - 15.0f; + this->actor.home.pos.y = this->actor.world.pos.y - 15.0f; } void func_80ADE9BC(EnPoh* this) { @@ -414,8 +476,8 @@ void func_80ADE9BC(EnPoh* this) { void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) { Player* player = PLAYER; - Math_StepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y, 1.0f); - this->actor.posRot.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800); + Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f); + this->actor.world.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800); if (this->unk_195 != 0) { this->unk_195 -= 1; } @@ -425,10 +487,10 @@ void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) { } void func_80ADEA5C(EnPoh* this) { - if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 400.0f) { - this->unk_19C = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) { + this->unk_19C = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 0x71C); } void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) { @@ -437,7 +499,7 @@ void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) { this->unk_198--; } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { func_80ADE1BC(this); } else if (this->unk_198 == 0) { EnPoh_SetupIdle(this); @@ -455,7 +517,7 @@ void EnPoh_Idle(EnPoh* this, GlobalContext* globalCtx) { } func_80ADEA5C(this); EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink < 200.0f && this->unk_198 < 19) { + if (this->actor.xzDistToPlayer < 200.0f && this->unk_198 < 19) { func_80ADE1BC(this); } else if (this->unk_198 == 0) { if (Rand_ZeroOne() < 0.1f) { @@ -478,18 +540,18 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) { if (this->unk_198 != 0) { this->unk_198--; } - facingDiff = this->actor.yawTowardsLink - player->actor.shape.rot.y; + facingDiff = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; if (facingDiff >= 0x3001) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (facingDiff < -0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink > 280.0f) { + if (this->actor.xzDistToPlayer > 280.0f) { EnPoh_SetupIdle(this); - } else if (this->unk_198 == 0 && this->actor.xzDistToLink < 140.0f && + } else if (this->unk_198 == 0 && this->actor.xzDistToPlayer < 140.0f && func_8002DFC8(&this->actor, 0x2AAA, globalCtx) == 0) { EnPoh_SetupAttack(this); } @@ -508,7 +570,7 @@ void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) { } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); if (this->unk_198 >= 10) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0xE38); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xE38); } else if (this->unk_198 == 9) { this->actor.speedXZ = 5.0f; this->skelAnime.playSpeed = 2.0f; @@ -538,7 +600,7 @@ void func_80ADEF38(EnPoh* this, GlobalContext* globalCtx) { } else if (this->skelAnime.curFrame > 10.0f) { this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f; } - if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToLink < 280.0f) { + if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToPlayer < 280.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); this->skelAnime.playSpeed = 1.0f; } @@ -565,23 +627,23 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { this->unk_198++; if (this->unk_198 < 8) { if (this->unk_198 < 5) { - vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); multiplier = Math_CosS((this->unk_198 * 0x1000) - 0x4000) * 23.0f; - vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.x; - vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.z; + vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.x; + vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.z; } else { - vec.y = (this->actor.posRot.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5)); - vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.x; - vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.z; + vec.y = (this->actor.world.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5)); + vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x; + vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - vec.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - vec.x; - vec.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - vec.z; + vec.x = (this->actor.world.pos.x + this->actor.world.pos.x) - vec.x; + vec.z = (this->actor.world.pos.z + this->actor.world.pos.z) - vec.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - vec.x = this->actor.posRot.pos.x; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); if (this->unk_198 == 1) { @@ -591,7 +653,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { EnPoh_SetupDeath(this, globalCtx); } else if (this->unk_198 >= 19) { newScale = (28 - this->unk_198) * 0.001f; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos.y += 5.0f; this->actor.scale.z = newScale; this->actor.scale.y = newScale; this->actor.scale.x = newScale; @@ -603,7 +665,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnPoh_SetupIdle(this); this->unk_198 = 23; } else { @@ -614,10 +676,10 @@ void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) { void func_80ADF5E0(EnPoh* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 1820) != 0) { + if (Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 1820) != 0) { EnPoh_SetupIdle(this); } - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { func_80ADE1BC(this); } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); @@ -627,7 +689,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) { if (this->unk_194 != 0) { this->unk_194--; } - this->actor.posRot.rot.y += 0x1000; + this->actor.world.rot.y += 0x1000; EnPoh_MoveTowardsPlayerHeight(this, globalCtx); this->lightColor.a = this->unk_194 * 7.96875f; if (this->unk_194 == 0) { @@ -638,7 +700,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) { void EnPoh_Appear(EnPoh* this, GlobalContext* globalCtx) { this->unk_194++; - this->actor.posRot.rot.y -= 0x1000; + this->actor.world.rot.y -= 0x1000; EnPoh_MoveTowardsPlayerHeight(this, globalCtx); this->lightColor.a = this->unk_194 * 7.96875f; if (this->unk_194 == 32) { @@ -653,12 +715,12 @@ void func_80ADF894(EnPoh* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); multiplier = Math_SinS(this->unk_195 * 0x800) * 3.0f; - this->actor.posRot.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0x71C); + this->actor.world.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x71C); EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->unk_198 == 0 || this->actor.xzDistToLink > 250.0f) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + if (this->unk_198 == 0 || this->actor.xzDistToPlayer > 250.0f) { + this->actor.world.rot.y = this->actor.shape.rot.y; EnPoh_SetupIdle(this); } func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); @@ -672,14 +734,14 @@ void EnPoh_Death(EnPoh* this, GlobalContext* globalCtx) { } if (this->actor.bgCheckFlags & 1) { objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C); func_80ADE6D4(this); } else if (this->unk_198 == 0) { Actor_Kill(&this->actor); return; } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); } void func_80ADFA90(EnPoh* this, s32 arg1) { @@ -696,18 +758,18 @@ void func_80ADFA90(EnPoh* this, s32 arg1) { this->actor.scale.z = this->lightColor.a * 2.7450982e-05f; this->actor.scale.y = this->lightColor.a * 2.7450982e-05f; this->actor.scale.x = this->lightColor.a * 2.7450982e-05f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 0.05882353f * this->lightColor.a; + this->actor.world.pos.y = this->actor.home.pos.y + 0.05882353f * this->lightColor.a; } this->lightColor.r = this->info->lightColor.r * multiplier; this->lightColor.g = this->info->lightColor.g * multiplier; this->lightColor.b = this->info->lightColor.b * multiplier; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g, + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g, this->info->lightColor.b, this->lightColor.a * 0.78431373f); } void func_80ADFE28(EnPoh* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y += 2.0f; + this->actor.home.pos.y += 2.0f; func_80ADFA90(this, 20); if (this->lightColor.a == 255) { EnPoh_Talk(this, globalCtx); @@ -731,24 +793,24 @@ void func_80ADFE80(EnPoh* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; return; } - if (this->colliderCyl.base.maskA & 2) { + if (this->colliderCyl.base.ocFlags1 & OC1_HIT) { this->actor.flags |= 0x10000; func_8002F2F4(&this->actor, globalCtx); } else { this->actor.flags &= ~0x10000; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); } - this->actor.posRot.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y; if (this->unk_195 != 0) { this->unk_195 -= 1; } if (this->unk_195 == 0) { this->unk_195 = 32; } - this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - Actor_SetHeight(&this->actor, -10.0f); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g, + this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f; + Actor_SetFocus(&this->actor, -10.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g, this->info->lightColor.b, this->lightColor.a * 0.78431373f); } @@ -817,8 +879,8 @@ void EnPoh_TalkComposer(EnPoh* this, GlobalContext* globalCtx) { } void func_80AE032C(EnPoh* this, GlobalContext* globalCtx) { - if (this->colliderCyl.base.acFlags & 2) { - this->colliderCyl.base.acFlags &= ~2; + if (this->colliderCyl.base.acFlags & AC_HIT) { + this->colliderCyl.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -838,7 +900,7 @@ void EnPoh_UpdateVisibility(EnPoh* this) { this->visibilityTimer--; } if (this->lightColor.a == 255) { - if (this->actor.unk_10C != 0) { + if (this->actor.isTargeted) { this->unk_194++; this->unk_194 = CLAMP_MAX(this->unk_194, 20); } else { @@ -873,9 +935,9 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006F90, &D_060009DC, this->jointTable, this->morphTable, 12); this->actor.draw = EnPoh_DrawComposer; - this->colliderSph.list[0].dim.joint = 9; - this->colliderSph.list->dim.modelSphere.center.y *= -1; - this->actor.shape.rot.y = this->actor.posRot.rot.y = -0x4000; + this->colliderSph.elements[0].dim.limb = 9; + this->colliderSph.elements[0].dim.modelSphere.center.y *= -1; + this->actor.shape.rot.y = this->actor.world.rot.y = -0x4000; this->colliderCyl.dim.radius = 20; this->colliderCyl.dim.height = 55; this->colliderCyl.dim.yShift = 15; @@ -899,7 +961,7 @@ void func_80AE067C(EnPoh* this) { temp_var = this->lightColor.b + 5; this->lightColor.b = CLAMP_MAX(temp_var, 225); } else if (this->actionFunc == func_80ADEECC) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->lightColor.r = 0; this->lightColor.g = 0; this->lightColor.b = 0; @@ -943,8 +1005,8 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) { Vec3f vec; UNK_TYPE sp38; - if (this->colliderSph.base.atFlags & 2) { - this->colliderSph.base.atFlags &= ~2; + if (this->colliderSph.base.atFlags & AT_HIT) { + this->colliderSph.base.atFlags &= ~AT_HIT; func_80ADE4C8(this); } func_80AE032C(this, globalCtx); @@ -955,27 +1017,27 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x1000000; CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); } - Collider_CylinderUpdate(&this->actor, &this->colliderCyl); - if ((this->colliderCyl.base.acFlags & 1) && this->lightColor.a == 255) { + Collider_UpdateCylinder(&this->actor, &this->colliderCyl); + if ((this->colliderCyl.base.acFlags & AC_ON) && this->lightColor.a == 255) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); - Actor_SetHeight(&this->actor, 42.0f); + Actor_SetFocus(&this->actor, 42.0f); if (this->actionFunc != func_80ADEECC && this->actionFunc != func_80ADF574) { if (this->actionFunc == func_80ADF894) { - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } else { - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 20.0f; - vec.z = this->actor.posRot.pos.z; - this->actor.groundY = + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 20.0f; + vec.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &vec); func_80AE089C(this); - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; } s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, @@ -998,7 +1060,7 @@ s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) { EnPoh* this = THIS; - func_800628A4(limbIndex, &this->colliderSph); + Collider_UpdateSpheres(limbIndex, &this->colliderSph); if (this->actionFunc == func_80ADF15C && this->unk_198 >= 2 && limbIndex == this->info->unk_7) { gSPMatrix((*gfxP)++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2460), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1011,14 +1073,14 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } Matrix_Get(&this->unk_368); if (this->actionFunc == func_80ADF15C && this->unk_198 == 27) { - this->actor.posRot.pos.x = this->unk_368.wx; - this->actor.posRot.pos.y = this->unk_368.wy; - this->actor.posRot.pos.z = this->unk_368.wz; + this->actor.world.pos.x = this->unk_368.wx; + this->actor.world.pos.y = this->unk_368.wy; + this->actor.world.pos.z = this->unk_368.wz; } - Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.list[0].dim.worldSphere.center.x, - this->colliderSph.list[0].dim.worldSphere.center.y, - this->colliderSph.list[0].dim.worldSphere.center.z, this->envColor.r, this->envColor.g, - this->envColor.b, this->envColor.a * 0.78431374f); + Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.elements[0].dim.worldSphere.center.x, + this->colliderSph.elements[0].dim.worldSphere.center.y, + this->colliderSph.elements[0].dim.worldSphere.center.z, this->envColor.r, + this->envColor.g, this->envColor.b, this->envColor.a * 0.78431374f); } } @@ -1122,8 +1184,8 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc == EnPoh_Death) { func_80093D18(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2854), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, this->info->unk_1C); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index ec824eb575..cad0c23cf8 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -55,7 +55,7 @@ typedef struct EnPoh { /* 0x02AC */ LightInfo lightInfo; /* 0x02BC */ ColliderCylinder colliderCyl; /* 0x0308 */ ColliderJntSph colliderSph; - /* 0x0328 */ ColliderJntSphItem colliderSphItem; + /* 0x0328 */ ColliderJntSphElement colliderSphItem; /* 0x0368 */ MtxF unk_368; } EnPoh; // size = 0x03A8 diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index 0441709c66..a21b419978 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -18,7 +18,7 @@ void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Pu_box_InitVars = { ACTOR_EN_PU_BOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PU_BOX, sizeof(EnPubox), @@ -48,14 +48,14 @@ void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) { break; } this->unk_164 = 1; - thisx->colChkInfo.unk_10 = 0x14; - thisx->colChkInfo.unk_12 = 0x32; + thisx->colChkInfo.cylRadius = 20; + thisx->colChkInfo.cylHeight = 50; thisx->uncullZoneDownward = 1200.0f; thisx->uncullZoneScale = 720.0f; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.unk_160 = 0; this->dyna.unk_15C = DPM_UNK; - thisx->unk_1F = 1; + thisx->targetMode = 1; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&gPuBoxCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); @@ -71,7 +71,7 @@ void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx) { EnPubox* this = THIS; thisx->speedXZ += this->dyna.unk_150; - thisx->posRot.rot.y = this->dyna.unk_158; + thisx->world.rot.y = this->dyna.unk_158; thisx->speedXZ = (thisx->speedXZ < -2.5f) ? -2.5f : ((thisx->speedXZ > 2.5f) ? 2.5f : thisx->speedXZ); Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); if (thisx->speedXZ != 0.0f) { @@ -81,8 +81,9 @@ void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx) { this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = 0.0f; Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D); - thisx->posRot2.pos = thisx->posRot.pos; + Actor_UpdateBgCheckInfo(globalCtx, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, + thisx->colChkInfo.cylRadius, 0x1D); + thisx->focus.pos = thisx->world.pos; } void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 85b5735d97..9a4862f1af 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -32,7 +32,7 @@ void func_80AE3ECC(EnRd* this, GlobalContext* globalCtx); const ActorInit En_Rd_InitVars = { ACTOR_EN_RD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_RD, sizeof(EnRd), @@ -43,18 +43,62 @@ const ActorInit En_Rd_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xE4, 0x60, 0xD3, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0xE), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(3, 0xD), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -95,13 +139,13 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) { EnRd* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - thisx->unk_1F = 0; + thisx->targetMode = 0; thisx->colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); this->unk_310 = this->unk_30E = 0; - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 50.0f; - thisx->colChkInfo.mass = 0xFE; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 50.0f; + thisx->colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 8; this->unk_314 = this->unk_31D = 0xFF; this->unk_312 = (thisx->params & 0xFF00) >> 8; @@ -148,7 +192,7 @@ void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AE2630(GlobalContext* globalCtx, Actor* thisx, s32 arg2) { - Actor* enemyIt = globalCtx->actorCtx.actorList[ACTORTYPE_ENEMY].first; + Actor* enemyIt = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].head; while (enemyIt != NULL) { if ((enemyIt->id != ACTOR_EN_RD) || (enemyIt == thisx) || (enemyIt->params < 0)) { @@ -175,7 +219,7 @@ void func_80AE269C(EnRd* this) { this->unk_31B = 0; this->unk_30C = (Rand_ZeroOne() * 10.0f) + 5.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnRd_SetupAction(this, func_80AE2744); } @@ -216,7 +260,7 @@ void func_80AE2744(EnRd* this, GlobalContext* globalCtx) { } this->unk_305 = 0; - if ((this->actor.xzDistToLink <= 150.0f) && func_8002DDE4(globalCtx)) { + if ((this->actor.xzDistToPlayer <= 150.0f) && func_8002DDE4(globalCtx)) { if ((this->actor.params != 2) && (this->unk_305 == 0)) { func_80AE37BC(this); } else { @@ -225,18 +269,18 @@ void func_80AE2744(EnRd* this, GlobalContext* globalCtx) { } } - if ((globalCtx->gameplayFrames & 95) == 0) { + if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } } void func_80AE2970(EnRd* this) { Animation_Change(&this->skelAnime, &D_060087D0, 0, 0, Animation_GetLastFrame(&D_060087D0), ANIMMODE_LOOP, -6.0f); - this->unk_31B = 0xB; + this->unk_31B = 11; this->unk_30C = 6; this->actor.shape.rot.x = -0x4000; this->actor.gravity = 0.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.speedXZ = 0.0f; EnRd_SetupAction(this, func_80AE2A10); } @@ -245,16 +289,15 @@ void func_80AE2970(EnRd* this) { void func_80AE2A10(EnRd* this, GlobalContext* globalCtx) { if (this->actor.shape.rot.x != -0x4000) { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0); - if (Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) { + if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) { this->actor.gravity = -3.5f; func_80AE269C(this); } } else { - if (this->actor.posRot.pos.y == this->actor.initPosRot.pos.y) { + if (this->actor.world.pos.y == this->actor.home.pos.y) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } - if (Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == - 0.0f) { + if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { if (this->unk_30C != 0) { this->unk_30C--; Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f); @@ -279,27 +322,27 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { Color_RGBA8 sp3C = D_80AE4928; Player* player = PLAYER; s32 pad; - s16 sp32 = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->unk_30E - this->unk_310; + s16 sp32 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; this->skelAnime.playSpeed = this->actor.speedXZ; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); - if (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) >= 150.0f) { + if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { func_80AE2F50(this, globalCtx); } - if ((ABS(sp32) < 0x1554) && (func_8002DB48(&this->actor, &player->actor) <= 150.0f)) { + if ((ABS(sp32) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) { if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80)) { if (this->unk_306 == 0) { if (!(this->unk_312 & 0x80)) { player->actor.freezeTimer = 40; func_8008EEAC(globalCtx, &this->actor); PLAYER->unk_684 = &this->actor; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } this->unk_306 = 0x3C; Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); @@ -309,10 +352,12 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { } } - DECR(this->unk_307); + if (this->unk_307 != 0) { + this->unk_307--; + } - if ((this->unk_307 == 0) && (func_8002DB48(&this->actor, &player->actor) <= 45.0f) && - (func_8002E084(&this->actor, 0x38E3))) { + if (!this->unk_307 && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) && + func_8002E084(&this->actor, 0x38E3)) { player->actor.freezeTimer = 0; if (globalCtx->grabPlayer(globalCtx, player)) { this->actor.flags &= ~1; @@ -328,7 +373,7 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { if ((this->skelAnime.curFrame == 10.0f) || (this->skelAnime.curFrame == 22.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); - } else if ((globalCtx->gameplayFrames & 95) == 0) { + } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -343,13 +388,13 @@ void func_80AE2F50(EnRd* this, GlobalContext* globalCtx) { void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; - s16 targetY = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + s16 targetY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - if (func_8002DB6C(&this->actor, &this->actor.initPosRot.pos) >= 5.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, targetY, 1, 0x1C2, 0); } else { this->actor.speedXZ = 0.0f; - if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, 1, 0x1C2, 0) == 0) { + if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x1C2, 0) == 0) { if (this->actor.params != 2) { func_80AE269C(this); } else { @@ -360,12 +405,12 @@ void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80) && - (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) < 150.0f)) { - this->actor.unk_1F = 0; + (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { + this->actor.targetMode = 0; func_80AE2B90(this, globalCtx); } else if (this->actor.params > 0) { if (this->actor.parent != NULL) { @@ -377,7 +422,7 @@ void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == 10.0f || this->skelAnime.curFrame == 22.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); - } else if ((globalCtx->gameplayFrames & 95) == 0) { + } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -394,13 +439,13 @@ void func_80AE3260(EnRd* this, GlobalContext* globalCtx) { if (this->actor.parent != NULL) { s32 pad; s16 targetY; - Vec3f thisPos = this->actor.parent->posRot.pos; + Vec3f thisPos = this->actor.parent->world.pos; - targetY = func_8002DAC0(&this->actor, &thisPos); + targetY = Actor_WorldYawTowardPoint(&this->actor, &thisPos); Math_SmoothStepToS(&this->actor.shape.rot.y, targetY, 1, 0xFA, 0); - if (func_8002DB6C(&this->actor, &thisPos) >= 45.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &thisPos) >= 45.0f) { this->actor.speedXZ = 0.4f; } else { this->actor.speedXZ = 0.0f; @@ -418,12 +463,12 @@ void func_80AE3260(EnRd* this, GlobalContext* globalCtx) { func_80AE2B90(this, globalCtx); } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame == 10.0f || this->skelAnime.curFrame == 22.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); - } else if ((globalCtx->gameplayFrames & 95) == 0) { + } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -431,7 +476,7 @@ void func_80AE3260(EnRd* this, GlobalContext* globalCtx) { void func_80AE33F0(EnRd* this) { Animation_PlayOnce(&this->skelAnime, &D_06004ADC); this->unk_30C = this->unk_304 = 0; - this->unk_319 = 0xC8; + this->unk_319 = 200; this->unk_31B = 8; this->actor.speedXZ = 0.0f; EnRd_SetupAction(this, func_80AE3454); @@ -450,8 +495,8 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime, &D_06004268); this->unk_304++; globalCtx->damagePlayer(globalCtx, -8); - func_800AA000(this->actor.xzDistToLink, 0xFF, 1, 0xC); - this->unk_319 = 0x14; + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC); + this->unk_319 = 20; case 0: Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x5DC, 0); @@ -465,16 +510,16 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { } if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, -1500.0f, 1.0f, 150.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f); } - Math_SmoothStepToF(&this->actor.posRot.pos.x, - (Math_SinS(player->actor.shape.rot.y) * -25.0f) + player->actor.posRot.pos.x, 1.0f, - 10.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, - (Math_CosS(player->actor.shape.rot.y) * -25.0f) + player->actor.posRot.pos.z, 1.0f, - 10.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, + (Math_SinS(player->actor.shape.rot.y) * -25.0f) + player->actor.world.pos.x, 1.0f, 10.0f, + 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, + (Math_CosS(player->actor.shape.rot.y) * -25.0f) + player->actor.world.pos.z, 1.0f, 10.0f, + 0.0f); Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 0x1770, 0); if (this->skelAnime.curFrame == 0.0f) { @@ -484,21 +529,21 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { if (this->unk_319 == 0) { globalCtx->damagePlayer(globalCtx, -8); - func_800AA000(this->actor.xzDistToLink, 0xF0, 1, 0xC); - this->unk_319 = 0x14; + func_800AA000(this->actor.xzDistToPlayer, 0xF0, 1, 0xC); + this->unk_319 = 20; func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92); } break; case 3: if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, 0, 1.0f, 400.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } break; case 4: if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, 0, 1.0f, 400.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } - this->actor.unk_1F = 0; + this->actor.targetMode = 0; this->actor.flags |= 1; this->unk_306 = 0xA; this->unk_307 = 0xF; @@ -519,12 +564,12 @@ void func_80AE3834(EnRd* this, GlobalContext* globalCtx) { Color_RGBA8 sp30 = D_80AE4938; Color_RGBA8 sp2C = D_80AE493C; Player* player = PLAYER; - s16 temp_v0 = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->unk_30E - this->unk_310; + s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; if (ABS(temp_v0) < 0x2008) { if (!(this->unk_312 & 0x80)) { player->actor.freezeTimer = 60; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_8008EEAC(globalCtx, &this->actor); } Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); @@ -581,15 +626,15 @@ void func_80AE3B18(EnRd* this, GlobalContext* globalCtx) { this->actor.speedXZ += 0.15f; } - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x12C, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x12C, 0); if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.parent != NULL) { func_80AE31DC(this); - } else if (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) >= 150.0f) { + } else if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { func_80AE2F50(this, globalCtx); } else { func_80AE2B90(this, globalCtx); @@ -601,8 +646,8 @@ void func_80AE3B18(EnRd* this, GlobalContext* globalCtx) { void func_80AE3C20(EnRd* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06006E88, -1.0f); - this->unk_31B = 0xA; - this->unk_30C = 0x12C; + this->unk_31B = 10; + this->unk_30C = 300; this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); @@ -610,8 +655,8 @@ void func_80AE3C20(EnRd* this) { } void func_80AE3C98(EnRd* this, GlobalContext* globalCtx) { - if (this->actor.type != ACTORTYPE_PROP) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + if (this->actor.category != ACTORCAT_PROP) { + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); } Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x7D0, 0); @@ -642,7 +687,7 @@ void func_80AE3C98(EnRd* this, GlobalContext* globalCtx) { void func_80AE3DE4(EnRd* this) { this->unk_31B = 1; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (gSaveContext.unk_1422 != 0) { this->unk_318 = 1; this->unk_316 = 0x258; @@ -669,11 +714,11 @@ void func_80AE3ECC(EnRd* this, GlobalContext* globalCtx) { } } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.colChkInfo.health == 0) { func_80AE2630(globalCtx, &this->actor, 1); func_80AE3C20(this); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); } else { func_80AE3A8C(this); } @@ -685,13 +730,13 @@ void func_80AE3F9C(EnRd* this, GlobalContext* globalCtx) { s16 temp2; s16 temp3; - temp1 = this->actor.yawTowardsLink - (s16)(this->actor.shape.rot.y + this->unk_310); + temp1 = this->actor.yawTowardsPlayer - (s16)(this->actor.shape.rot.y + this->unk_310); temp2 = CLAMP(temp1, -500, 500); temp1 -= this->unk_30E; temp3 = CLAMP(temp1, -500, 500); - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) { this->unk_310 += ABS(temp2); this->unk_30E += ABS(temp3); } else { @@ -708,17 +753,17 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { Player* player = PLAYER; if ((gSaveContext.unk_1422 != 0) && (this->actor.shape.rot.x == 0) && (this->unk_318 == 0) && - (this->unk_31B != 9) && (this->unk_31B != 0xA) && (this->unk_31B != 1)) { + (this->unk_31B != 9) && (this->unk_31B != 10) && (this->unk_31B != 1)) { func_80AE3DE4(this); return; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->unk_31C = this->actor.colChkInfo.damageEffect; if (this->unk_31B != 11) { - func_80035650(&this->actor, &this->collider.body, 1); + func_80035650(&this->actor, &this->collider.info, 1); if (player->unk_844 != 0) { this->unk_31D = player->unk_845; } @@ -744,7 +789,7 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.health == 0) { func_80AE2630(globalCtx, &this->actor, 1); func_80AE3C20(this); - Item_DropCollectibleRandom(globalCtx, 0, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, 0, &this->actor.world.pos, 0x90); } else { func_80AE3A8C(this); } @@ -754,10 +799,10 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { } void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; EnRd* this = THIS; - CollisionCheckContext* colChkCtx = &globalCtx->colChkCtx; Player* player = PLAYER; - ColliderCylinder* collider = &this->collider; + s32 pad2; func_80AE4114(this, globalCtx); @@ -776,7 +821,7 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.shape.rot.x == 0) && (this->unk_31B != 8) && (this->actor.speedXZ != 0.0f)) { - func_8002E4B4(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); } if (this->unk_31B == 7) { @@ -784,14 +829,14 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { } } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 50.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 50.0f; if ((this->actor.colChkInfo.health > 0) && (this->unk_31B != 8)) { - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, colChkCtx, &collider->base); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->unk_31B != 9) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &collider->base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } @@ -814,7 +859,7 @@ void EnRd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec s32 idx = -1; Vec3f destPos; - if ((this->unk_31A != 0) || ((this->actor.dmgEffectTimer != 0) && (this->actor.dmgEffectParams & 0x4000))) { + if ((this->unk_31A != 0) || ((this->actor.colorFilterTimer != 0) && (this->actor.colorFilterParams & 0x4000))) { switch (limbIndex - 1) { case 23: idx = 0; @@ -860,7 +905,7 @@ void EnRd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnRd* this = THIS; - Vec3f thisPos = thisx->posRot.pos; + Vec3f thisPos = thisx->world.pos; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_rd.c", 1679); @@ -873,7 +918,7 @@ void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) { POLY_OPA_DISP); func_80033C30(&thisPos, &D_80AE4958, 255, globalCtx); if (this->unk_31A != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->unk_31A--; if (this->unk_31A % 4 == 0) { EffectSsEnFire_SpawnVec3s(globalCtx, thisx, &this->firePos[this->unk_31A >> 2], 0x4B, 0, 0, diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 4702090c16..9f89635400 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -32,13 +32,43 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx); void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx); static DamageTable sDamageTable = { - 0x00, 0xE2, 0xE1, 0xE2, 0xC1, 0xE2, 0xE2, 0xD2, 0xE1, 0xE4, 0xE6, 0xE2, 0x34, 0xE2, 0xE2, 0xE2, - 0xE2, 0x00, 0x34, 0x00, 0x00, 0x00, 0xE2, 0xE8, 0xE4, 0xE2, 0xE8, 0xE4, 0x10, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xE), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xE), + /* Boomerang */ DMG_ENTRY(1, 0xC), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xE), + /* Hookshot */ DMG_ENTRY(2, 0xD), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(4, 0xE), + /* Giant's Knife */ DMG_ENTRY(6, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xE), + /* Giant spin */ DMG_ENTRY(8, 0xE), + /* Master spin */ DMG_ENTRY(4, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x1), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; const ActorInit En_Reeba_InitVars = { ACTOR_EN_REEBA, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_REEBA, sizeof(EnReeba), @@ -49,8 +79,22 @@ const ActorInit En_Reeba_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK5, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x08, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + COLTYPE_HIT5, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x08, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 40, 0, { 0, 0, 0 } }, }; @@ -63,11 +107,11 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { s32 surfaceType; this->actor.naviEnemyId = 0x47; - this->actor.unk_1F = 3; + this->actor.targetMode = 3; this->actor.gravity = -3.5f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; SkelAnime_Init(globalCtx, &this->skelanime, &D_06001EE8, &D_060001E4, this->jointTable, this->morphTable, 18); - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 4; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -80,17 +124,17 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale *= 1.5f; osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n" VT_RST, this->scale); this->actor.colChkInfo.health = 20; - this->collider.body.toucher.effect = 4; - this->collider.body.toucher.damage = 16; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + this->collider.info.toucher.effect = 4; + this->collider.info.toucher.damage = 16; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } - this->actor.shape.unk_08 = this->unk_284 = this->scale * -27500.0f; - ActorShape_Init(&this->actor.shape, this->actor.shape.unk_08, ActorShadow_DrawFunc_Circle, 0.0f); + this->actor.shape.yOffset = this->unk_284 = this->scale * -27500.0f; + ActorShape_Init(&this->actor.shape, this->actor.shape.yOffset, ActorShadow_DrawCircle, 0.0f); this->actor.colChkInfo.damageTable = &sDamageTable; - func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surfaceType != 4) && (surfaceType != 7)) { Actor_Kill(&this->actor); @@ -138,7 +182,7 @@ void func_80AE4F40(EnReeba* this, GlobalContext* globalCtx) { } this->actor.flags &= ~0x08000000; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; if (this->isBig) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_BIG_APPEAR); @@ -156,34 +200,35 @@ void func_80AE5054(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); if ((globalCtx->gameplayFrames % 4) == 0) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, 10, + 1); } if (this->unk_278 == 0) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 1.0f, 1.0f); - if (this->actor.shape.unk_08 < 0.0f) { - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, this->unk_288); + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 1.0f, 1.0f); + if (this->actor.shape.yOffset < 0.0f) { + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, this->unk_288); Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); } else { this->unk_288 = 0.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; playerLinearVel = player->linearVelocity; switch (this->unk_280) { case 0: - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; break; case 1: - this->actor.posRot.rot.y = this->actor.yawTowardsLink + (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer + (800.0f * playerLinearVel); break; case 2: case 3: - this->actor.posRot.rot.y = - this->actor.yawTowardsLink + - (player->actor.shape.rot.y - this->actor.yawTowardsLink) * (playerLinearVel * 0.15f); + this->actor.world.rot.y = + this->actor.yawTowardsPlayer + + (player->actor.shape.rot.y - this->actor.yawTowardsPlayer) * (playerLinearVel * 0.15f); break; case 4: - this->actor.posRot.rot.y = this->actor.yawTowardsLink - (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer - (800.0f * playerLinearVel); break; } @@ -203,16 +248,16 @@ void func_80AE5270(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); - if (this->actor.shape.unk_10 < 12.0f) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f); + if (this->actor.shape.shadowScale < 12.0f) { + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f); } - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surfaceType != 4) && (surfaceType != 7)) { this->actor.speedXZ = 0.0f; this->actionfunc = func_80AE5688; - } else if ((this->unk_272 == 0) || (this->actor.xzDistToLink < 30.0f) || (this->actor.xzDistToLink > 400.0f) || + } else if ((this->unk_272 == 0) || (this->actor.xzDistToPlayer < 30.0f) || (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) { this->actionfunc = func_80AE5688; } else if (this->unk_274 == 0) { @@ -234,21 +279,21 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); - if (this->actor.shape.unk_10 < 12.0f) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f); + if (this->actor.shape.shadowScale < 12.0f) { + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f); } - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); - if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToLink > 400.0f) || + if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) { this->actionfunc = func_80AE5688; } else { - if ((this->actor.xzDistToLink < 70.0f) && (this->unk_270 == 0)) { + if ((this->actor.xzDistToPlayer < 70.0f) && (this->unk_270 == 0)) { this->unk_270 = 30; } - speed = (this->actor.xzDistToLink - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f); + speed = (this->actor.xzDistToPlayer - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f); this->actor.speedXZ += speed * 1.8f; if (this->actor.speedXZ >= 3.0f) { this->actor.speedXZ = 3.0f; @@ -257,10 +302,10 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) { this->actor.speedXZ = -3.0f; } - yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsLink : -this->actor.yawTowardsLink; - yawDiff -= this->actor.posRot.rot.y; + yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsPlayer : -this->actor.yawTowardsPlayer; + yawDiff -= this->actor.world.rot.y; yaw = (yawDiff > 0) ? ((yawDiff / 31.0f) + 10.0f) : ((yawDiff / 31.0f) - 10.0f); - this->actor.posRot.rot.y += yaw * 2.0f; + this->actor.world.rot.y += yaw * 2.0f; if (this->unk_274 == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE); @@ -290,17 +335,17 @@ void func_80AE5688(EnReeba* this, GlobalContext* globalCtx) { } void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) { - Math_ApproachZeroF(&this->actor.shape.unk_10, 1.0f, 0.3f); + Math_ApproachZeroF(&this->actor.shape.shadowScale, 1.0f, 0.3f); Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f); SkelAnime_Update(&this->skelanime); - if ((this->unk_284 + 10.0f) <= this->actor.shape.unk_08) { + if ((this->unk_284 + 10.0f) <= this->actor.shape.yOffset) { if ((globalCtx->gameplayFrames % 4) == 0) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10, - 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, + 10, 1); } - Math_ApproachF(&this->actor.shape.unk_08, this->unk_284, 1.0f, this->unk_288); + Math_ApproachF(&this->actor.shape.yOffset, this->unk_284, 1.0f, this->unk_288); Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); } else { Actor_Kill(&this->actor); @@ -310,7 +355,7 @@ void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) { void func_80AE57F0(EnReeba* this, GlobalContext* globalCtx) { this->unk_276 = 14; this->actor.speedXZ = -8.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); this->actionfunc = func_80AE5854; } @@ -334,7 +379,7 @@ void func_80AE5854(EnReeba* this, GlobalContext* globalCtx) { void func_80AE58EC(EnReeba* this, GlobalContext* globalCtx) { this->unk_278 = 14; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = -8.0f; this->actor.flags |= 0x8000000; this->actor.flags &= ~5; @@ -354,9 +399,9 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx) { if ((this->unk_27E == 4) || (this->actor.colChkInfo.health != 0)) { if (this->unk_27E == 2) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); scale = 3.0f; if (this->isBig) { @@ -381,9 +426,9 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) { if (this->unk_278 != 0) { if ((this->unk_27E == 2) && ((this->unk_278 & 0xF) == 0)) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); scale = 3.0f; if (this->isBig) { @@ -401,7 +446,7 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) { void func_80AE5BC4(EnReeba* this, GlobalContext* globalCtx) { this->actor.speedXZ = -8.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); this->unk_278 = 14; this->actor.flags &= ~1; @@ -422,9 +467,9 @@ void func_80AE5C38(EnReeba* this, GlobalContext* globalCtx) { Math_ApproachZeroF(&this->scale, 0.1f, 0.01f); if (this->scale < 0.01f) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z = this->actor.world.pos.z; velocity.y = 4.0f; @@ -471,8 +516,8 @@ void func_80AE5E48(EnReeba* this, GlobalContext* globalCtx) { } void func_80AE5EDC(EnReeba* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) { this->actor.shape.rot.x = this->actor.shape.rot.z = 0; @@ -560,42 +605,42 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { this->actor.speedXZ = 8.0f; - this->actor.posRot.rot.y *= -1.0f; + this->actor.world.rot.y *= -1.0f; this->unk_272 = 14; this->actionfunc = func_80AE561C; return; } } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if ((this->collider.base.at == &player->actor) && !this->isBig && (this->actionfunc != func_80AE56E0)) { this->actionfunc = func_80AE5688; } } - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; if (!this->isBig) { - this->actor.posRot2.pos.y += 15.0f; + this->actor.focus.pos.y += 15.0f; } else { - this->actor.posRot2.pos.y += 30.0f; + this->actor.focus.pos.y += 30.0f; } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); - if ((this->actor.shape.unk_08 >= -700.0f) && (this->actor.colChkInfo.health > 0) && + if ((this->actor.shape.yOffset >= -700.0f) && (this->actor.colChkInfo.health > 0) && (this->actionfunc != func_80AE56E0)) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (!(this->actor.shape.unk_08 < 0.0f)) { + if (!(this->actor.shape.yOffset < 0.0f)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { @@ -626,10 +671,10 @@ void EnReeba_Draw(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0)) { Vec3f debugPos; - debugPos.x = (Math_SinS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.x; - debugPos.y = this->actor.posRot.pos.y + 20.0f; - debugPos.z = (Math_CosS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.z; - DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.posRot.rot.x, this->actor.posRot.rot.y, - this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); + debugPos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x; + debugPos.y = this->actor.world.pos.y + 20.0f; + debugPos.z = (Math_CosS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.z; + DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.world.rot.x, this->actor.world.rot.y, + this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index cbc960cf29..63018b1ec0 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -18,7 +18,7 @@ void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_River_Sound_InitVars = { ACTOR_EN_RIVER_SOUND, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnRiverSound), diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 6c0af74f18..4fb1c4b997 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -63,7 +63,7 @@ void func_80AE7358(EnRl* this) { this->drawConfig = 0; this->alpha = 0; this->lightBallSpawned = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_19C = 0.0f; } @@ -83,7 +83,7 @@ void func_80AE73D8(EnRl* this, GlobalContext* globalCtx) { } void func_80AE744C(EnRl* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80AE7494(EnRl* this) { @@ -128,9 +128,9 @@ void func_80AE7590(EnRl* this, GlobalContext* globalCtx) { globalCtx->csCtx.npcActions[6] != NULL && globalCtx->csCtx.npcActions[6]->action == 2 && !this->lightMedallionGiven) { player = PLAYER; - pos.x = player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y + 80.0f; - pos.z = player->actor.posRot.pos.z; + pos.x = player->actor.world.pos.x; + pos.y = player->actor.world.pos.y + 80.0f; + pos.z = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, pos.x, pos.y, pos.z, 0, 0, 0, 0xE); Item_Give(globalCtx, ITEM_MEDALLION_LIGHT); this->lightMedallionGiven = 1; @@ -142,7 +142,7 @@ void func_80AE7668(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 1; this->action = 1; - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } void func_80AE7698(EnRl* this, GlobalContext* globalCtx) { @@ -196,12 +196,12 @@ void func_80AE7838(EnRl* this, GlobalContext* globalCtx) { void func_80AE7878(EnRl* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007B38, &D_06000A3C, NULL, NULL, 0); this->action = 4; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AE78D4(EnRl* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(18) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 5); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(18) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 5); } void func_80AE7954(EnRl* this, GlobalContext* globalCtx) { @@ -209,7 +209,7 @@ void func_80AE7954(EnRl* this, GlobalContext* globalCtx) { this->action = 5; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_19C = 0.0f; } } @@ -225,7 +225,7 @@ void func_80AE79A4(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_19C = kREG(5) + 10.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -235,13 +235,13 @@ void func_80AE79A4(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_19C = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*unk_19C / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void func_80AE7AF8(EnRl* this, GlobalContext* globalCtx) { @@ -258,7 +258,7 @@ void func_80AE7AF8(EnRl* this, GlobalContext* globalCtx) { func_80AE78D4(this, globalCtx); this->lightBallSpawned = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -340,7 +340,7 @@ void EnRl_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRl_Init(Actor* thisx, GlobalContext* globalCtx) { EnRl* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); if (this->actor.params == 2) { func_80AE7878(this, globalCtx); } else { @@ -388,7 +388,7 @@ void EnRl_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Rl_InitVars = { ACTOR_EN_RL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RL, sizeof(EnRl), diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index facb1b29e8..1b7dbe97cd 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -26,15 +26,16 @@ typedef enum { } EnRrReachState; typedef enum { - /* 0x1 */ RR_DAMAGE_STUN = 1, - /* 0x2 */ RR_DAMAGE_FIRE, - /* 0x3 */ RR_DAMAGE_ICE, - /* 0x4 */ RR_DAMAGE_LIGHT_MAGIC, - /* 0xB */ RR_DAMAGE_LIGHT_ARROW = 11, - /* 0xC */ RR_DAMAGE_UNK_ARROW_1, - /* 0xD */ RR_DAMAGE_UNK_ARROW_2, - /* 0xE */ RR_DAMAGE_UNK_ARROW_3, - /* 0xF */ RR_DAMAGE_NORMAL + /* 0x0 */ RR_DMG_NONE, + /* 0x1 */ RR_DMG_STUN, + /* 0x2 */ RR_DMG_FIRE, + /* 0x3 */ RR_DMG_ICE, + /* 0x4 */ RR_DMG_LIGHT_MAGIC, + /* 0xB */ RR_DMG_LIGHT_ARROW = 11, + /* 0xC */ RR_DMG_SHDW_ARROW, + /* 0xD */ RR_DMG_WIND_ARROW, + /* 0xE */ RR_DMG_SPRT_ARROW, + /* 0xF */ RR_DMG_NORMAL } EnRrDamageEffect; typedef enum { @@ -68,7 +69,7 @@ extern Gfx D_06000470[]; const ActorInit En_Rr_InitVars = { ACTOR_EN_RR, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_RR, sizeof(EnRr), @@ -83,27 +84,83 @@ static char* sDropNames[] = { "タイプ7 ", "魔法の壷小", "矢 ", "妖精 ", "20ルピー ", "50ルピー ", }; -static ColliderCylinderInit_Set3 sCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit1 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 30, 55, 0, { 0, 0, 0 } }, }; -static ColliderCylinderInit_Set3 sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x0D, 0x0D, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit2 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 20, -10, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x00, 0xF2, 0xF1, 0xF2, 0x10, 0xF2, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0x24, 0x34, 0xBF, 0xD4, 0xCF, - 0xEF, 0x24, 0x33, 0x4A, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0xEA, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, RR_DMG_NONE), + /* Deku stick */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Slingshot */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Explosive */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Boomerang */ DMG_ENTRY(0, RR_DMG_STUN), + /* Normal arrow */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Hookshot */ DMG_ENTRY(0, RR_DMG_STUN), + /* Kokiri sword */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Master sword */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Fire arrow */ DMG_ENTRY(4, RR_DMG_FIRE), + /* Ice arrow */ DMG_ENTRY(4, RR_DMG_ICE), + /* Light arrow */ DMG_ENTRY(15, RR_DMG_LIGHT_ARROW), + /* Unk arrow 1 */ DMG_ENTRY(4, RR_DMG_WIND_ARROW), + /* Unk arrow 2 */ DMG_ENTRY(15, RR_DMG_SHDW_ARROW), + /* Unk arrow 3 */ DMG_ENTRY(15, RR_DMG_SPRT_ARROW), + /* Fire magic */ DMG_ENTRY(4, RR_DMG_FIRE), + /* Ice magic */ DMG_ENTRY(3, RR_DMG_ICE), + /* Light magic */ DMG_ENTRY(10, RR_DMG_LIGHT_MAGIC), + /* Shield */ DMG_ENTRY(0, RR_DMG_NONE), + /* Mirror Ray */ DMG_ENTRY(0, RR_DMG_NONE), + /* Kokiri spin */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Giant spin */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Master spin */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Giant jump */ DMG_ENTRY(8, RR_DMG_NORMAL), + /* Master jump */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Unknown 1 */ DMG_ENTRY(10, RR_DMG_SPRT_ARROW), + /* Unblockable */ DMG_ENTRY(0, RR_DMG_NONE), + /* Hammer jump */ DMG_ENTRY(0, RR_DMG_NONE), + /* Unknown 2 */ DMG_ENTRY(0, RR_DMG_NONE), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 55, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnRr_Init(Actor* thisx, GlobalContext* globalCtx2) { @@ -115,13 +172,13 @@ void EnRr_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 4; Collider_InitCylinder(globalCtx, &this->collider1); - Collider_SetCylinder_Set3(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); + Collider_SetCylinderType1(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); - Collider_SetCylinder_Set3(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); - Actor_SetHeight(&this->actor, 30.0f); + Collider_SetCylinderType1(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); + Actor_SetFocus(&this->actor, 30.0f); this->actor.scale.y = 0.013f; this->actor.scale.x = this->actor.scale.z = 0.014f; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.velocity.y = this->actor.speedXZ = 0.0f; this->actor.gravity = -0.4f; this->actionTimer = 0; @@ -269,7 +326,7 @@ void EnRr_SetupReleasePlayer(EnRr* this, GlobalContext* globalCtx) { } osSyncPrintf(VT_FGCOL(YELLOW) "%s[%d] : Rr_Catch_Cancel" VT_RST "\n", "../z_en_rr.c", 650); func_8002F6D4(globalCtx, &this->actor, 4.0f, this->actor.shape.rot.y, 12.0f, 8); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->actionFunc = EnRr_Approach; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_THROW); } else if (this->actor.colChkInfo.health != 0) { @@ -359,35 +416,35 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { Vec3f hitPos; Player* player = PLAYER; - if (this->collider2.base.acFlags & 2) { - this->collider2.base.acFlags &= ~2; + if (this->collider2.base.acFlags & AC_HIT) { + this->collider2.base.acFlags &= ~AC_HIT; // Kakin (not sure what this means) osSyncPrintf(VT_FGCOL(GREEN) "カキン(%d)!!" VT_RST "\n", this->frameCount); - hitPos.x = this->collider2.body.bumper.unk_06.x; - hitPos.y = this->collider2.body.bumper.unk_06.y; - hitPos.z = this->collider2.body.bumper.unk_06.z; - func_80062DF4(globalCtx, &hitPos); + hitPos.x = this->collider2.info.bumper.hitPos.x; + hitPos.y = this->collider2.info.bumper.hitPos.y; + hitPos.z = this->collider2.info.bumper.hitPos.z; + CollisionCheck_SpawnShieldParticlesMetal2(globalCtx, &hitPos); } else { - if (this->collider1.base.acFlags & 2) { + if (this->collider1.base.acFlags & AC_HIT) { u8 dropType = RR_DROP_RANDOM_RUPEE; - this->collider1.base.acFlags &= ~2; + this->collider1.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0) { - hitPos.x = this->collider1.body.bumper.unk_06.x; - hitPos.y = this->collider1.body.bumper.unk_06.y; - hitPos.z = this->collider1.body.bumper.unk_06.z; - func_8005DFAC(globalCtx, NULL, &hitPos); + hitPos.x = this->collider1.info.bumper.hitPos.x; + hitPos.y = this->collider1.info.bumper.hitPos.y; + hitPos.z = this->collider1.info.bumper.hitPos.z; + CollisionCheck_BlueBlood(globalCtx, NULL, &hitPos); } switch (this->actor.colChkInfo.damageEffect) { - case RR_DAMAGE_LIGHT_ARROW: + case RR_DMG_LIGHT_ARROW: dropType++; // purple rupee - case RR_DAMAGE_UNK_ARROW_1: + case RR_DMG_SHDW_ARROW: dropType++; // flexible - case RR_DAMAGE_UNK_ARROW_2: + case RR_DMG_WIND_ARROW: dropType++; // arrow - case RR_DAMAGE_UNK_ARROW_3: + case RR_DMG_SPRT_ARROW: dropType++; // magic jar - case RR_DAMAGE_NORMAL: + case RR_DMG_NORMAL: // ouch osSyncPrintf(VT_FGCOL(RED) "いてっ( %d : LIFE %d : DAMAGE %d : %x )!!" VT_RST "\n", this->frameCount, this->actor.colChkInfo.health, this->actor.colChkInfo.damage, @@ -405,7 +462,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { EnRr_SetupDeath(this); } return; - case RR_DAMAGE_FIRE: // Fire Arrow and Din's Fire + case RR_DMG_FIRE: // Fire Arrow and Din's Fire Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; @@ -414,18 +471,18 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { this->effectTimer = 20; EnRr_SetupStunned(this); return; - case RR_DAMAGE_ICE: // Ice Arrow and unused ice magic + case RR_DMG_ICE: // Ice Arrow and unused ice magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->effectTimer = 20; func_8003426C(&this->actor, 0, 0xFF, 0x2000, 0x50); } EnRr_SetupStunned(this); return; - case RR_DAMAGE_LIGHT_MAGIC: // Unused light magic + case RR_DMG_LIGHT_MAGIC: // Unused light magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RUPEE_RED; @@ -433,17 +490,18 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, -0x8000, 0xFF, 0x2000, 0x50); EnRr_SetupStunned(this); return; - case RR_DAMAGE_STUN: // Boomerang and Hookshot + case RR_DMG_STUN: // Boomerang and Hookshot Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); func_8003426C(&this->actor, 0, 0xFF, 0x2000, 0x50); EnRr_SetupStunned(this); return; } } - if ((this->ocTimer == 0) && (this->actor.dmgEffectTimer == 0) && (player->invincibilityTimer == 0) && - !(player->stateFlags2 & 0x80) && ((this->collider1.base.maskA & 2) || (this->collider2.base.maskA & 2))) { - this->collider1.base.maskA &= ~2; - this->collider2.base.maskA &= ~2; + if ((this->ocTimer == 0) && (this->actor.colorFilterTimer == 0) && (player->invincibilityTimer == 0) && + !(player->stateFlags2 & 0x80) && + ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT))) { + this->collider1.base.ocFlags1 &= ~OC1_HIT; + this->collider2.base.ocFlags1 &= ~OC1_HIT; // catch osSyncPrintf(VT_FGCOL(GREEN) "キャッチ(%d)!!" VT_RST "\n", this->frameCount); if (globalCtx->grabPlayer(globalCtx, player)) { @@ -513,18 +571,18 @@ void EnRr_UpdateBodySegments(EnRr* this, GlobalContext* globalCtx) { } void EnRr_Approach(EnRr* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x1F4, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if ((this->actionTimer == 0) && (this->actor.xzDistToLink < 160.0f)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1F4, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if ((this->actionTimer == 0) && (this->actor.xzDistToPlayer < 160.0f)) { EnRr_SetupReach(this); - } else if ((this->actor.xzDistToLink < 400.0f) && (this->actor.speedXZ == 0.0f)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speedXZ == 0.0f)) { EnRr_SetSpeed(this, 2.0f); } } void EnRr_Reach(EnRr* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x1F4, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1F4, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; switch (this->reachState) { case REACH_EXTEND: if (this->actionTimer == 0) { @@ -563,7 +621,7 @@ void EnRr_Reach(EnRr* this, GlobalContext* globalCtx) { void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { Player* player = PLAYER; - func_800AA000(this->actor.xyzDistToLinkSq, 120, 2, 120); + func_800AA000(this->actor.xyzDistToPlayerSq, 120, 2, 120); if ((this->frameCount % 8) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_EAT); } @@ -571,9 +629,9 @@ void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { if ((this->grabTimer == 0) || !(player->stateFlags2 & 0x80)) { EnRr_SetupReleasePlayer(this, globalCtx); } else { - Math_ApproachF(&player->actor.posRot.pos.x, this->mouthPos.x, 1.0f, 30.0f); - Math_ApproachF(&player->actor.posRot.pos.y, this->mouthPos.y + this->swallowOffset, 1.0f, 30.0f); - Math_ApproachF(&player->actor.posRot.pos.z, this->mouthPos.z, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.x, this->mouthPos.x, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.y, this->mouthPos.y + this->swallowOffset, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.z, this->mouthPos.z, 1.0f, 30.0f); Math_ApproachF(&this->swallowOffset, -55.0f, 1.0f, 5.0f); } } @@ -581,9 +639,9 @@ void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { void EnRr_Damage(EnRr* this, GlobalContext* globalCtx) { s32 i; - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { EnRr_SetupApproach(this); - } else if ((this->actor.dmgEffectTimer & 8) != 0) { + } else if ((this->actor.colorFilterTimer & 8) != 0) { for (i = 1; i < 5; i++) { this->bodySegs[i].rotTarget.z = 5000.0f; } @@ -607,9 +665,9 @@ void EnRr_Death(EnRr* this, GlobalContext* globalCtx) { } else if (this->frameCount >= 95) { Vec3f dropPos; - dropPos.x = this->actor.posRot.pos.x; - dropPos.y = this->actor.posRot.pos.y; - dropPos.z = this->actor.posRot.pos.z; + dropPos.x = this->actor.world.pos.x; + dropPos.y = this->actor.world.pos.y; + dropPos.z = this->actor.world.pos.z; switch (this->eatenShield) { case PLAYER_SHIELD_DEKU: Item_DropCollectible(globalCtx, &dropPos, ITEM00_SHIELD_DEKU); @@ -655,9 +713,9 @@ void EnRr_Death(EnRr* this, GlobalContext* globalCtx) { Vec3f vel; Vec3f accel; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 20.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 20.0f; + pos.z = this->actor.world.pos.z; vel.x = 0.0f; vel.y = 0.0f; vel.z = 0.0f; @@ -678,8 +736,8 @@ void EnRr_Retreat(EnRr* this, GlobalContext* globalCtx) { this->retreat = false; this->actionFunc = EnRr_Approach; } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink + 0x8000, 0xA, 0x3E8, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xA, 0x3E8, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.speedXZ == 0.0f) { EnRr_SetSpeed(this, 2.0f); } @@ -687,7 +745,7 @@ void EnRr_Retreat(EnRr* this, GlobalContext* globalCtx) { } void EnRr_Stunned(EnRr* this, GlobalContext* globalCtx) { - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->stopScroll = false; if (this->hasPlayer) { EnRr_SetupReleasePlayer(this, globalCtx); @@ -724,9 +782,9 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { this->effectTimer--; } - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); EnRr_UpdateBodySegments(this, globalCtx); - if (!this->isDead && ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) { + if (!this->isDead && ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) { EnRr_CollisionCheck(this, globalCtx); } @@ -737,7 +795,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); Actor_MoveForward(&this->actor); - Collider_CylinderUpdate(&this->actor, &this->collider1); + Collider_UpdateCylinder(&this->actor, &this->collider1); this->collider2.dim.pos.x = this->mouthPos.x; this->collider2.dim.pos.y = this->mouthPos.y; this->collider2.dim.pos.z = this->mouthPos.z; @@ -749,12 +807,12 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } else { - this->collider2.base.maskA &= ~2; - this->collider2.base.acFlags &= ~2; - this->collider1.base.maskA &= ~2; - this->collider1.base.acFlags &= ~2; + this->collider2.base.ocFlags1 &= ~OC1_HIT; + this->collider2.base.acFlags &= ~AC_HIT; + this->collider1.base.ocFlags1 &= ~OC1_HIT; + this->collider1.base.acFlags &= ~AC_HIT; } - func_8002E4B4(globalCtx, &this->actor, 20.0f, 30.0f, 20.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 30.0f, 20.0f, 7); if (!this->stopScroll) { Math_ApproachF(&this->segPhaseVel, this->segPhaseVelTarget, 1.0f, 50.0f); Math_ApproachF(&this->segPulsePhaseDiff, 4.0f, 1.0f, 5.0f); @@ -821,7 +879,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { segMtx++; Matrix_MultVec3f(&zeroVec, &this->effectPos[i]); } - this->effectPos[0] = this->actor.posRot.pos; + this->effectPos[0] = this->actor.world.pos; Matrix_MultVec3f(&zeroVec, &this->mouthPos); gSPDisplayList(POLY_XLU_DISP++, D_06000470); @@ -830,7 +888,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { Vec3f effectPos; s16 effectTimer = this->effectTimer - 1; - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; if ((effectTimer & 1) == 0) { s32 segIndex = 4 - (effectTimer >> 2); s32 offIndex = (effectTimer >> 1) & 3; @@ -838,7 +896,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { effectPos.x = this->effectPos[segIndex].x + sEffectOffsets[offIndex].x + Rand_CenteredFloat(10.0f); effectPos.y = this->effectPos[segIndex].y + sEffectOffsets[offIndex].y + Rand_CenteredFloat(10.0f); effectPos.z = this->effectPos[segIndex].z + sEffectOffsets[offIndex].z + Rand_CenteredFloat(10.0f); - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &effectPos, 100, 0, 0, -1); } else { EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &effectPos, 150, 150, 150, 250, 235, 245, 255, diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 95c216ae9b..ada7fb287b 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -69,14 +69,26 @@ void func_80AF03F4(EnRu1* this, GlobalContext* globalCtx); void func_80AF0400(EnRu1* this, GlobalContext* globalCtx); void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit1 = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit1 = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 25, 80, 0, { 0 } }, }; -static ColliderCylinderInit_Set3 sCylinderInit2 = { - { COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit2 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, { 20, 30, 0, { 0 } }, }; @@ -121,7 +133,7 @@ static EnRu1DrawFunc sDrawFuncs[] = { const ActorInit En_Ru1_InitVars = { ACTOR_EN_RU1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RU1, sizeof(EnRu1), @@ -156,43 +168,38 @@ extern AnimationHeader D_06012E94; extern AnimationHeader D_06013A64; void func_80AEAC10(EnRu1* this, GlobalContext* globalCtx) { - s32 pad[4]; - ColliderCylinder* collider = &this->collider; + s32 pad[5]; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; - ColliderCylinder* collider2 = &this->collider2; - s32 pad[3]; + s32 pad[5]; - Collider_CylinderUpdate(thisx, collider2); + Collider_UpdateCylinder(&this->actor, &this->collider2); if (this->unk_34C != 0) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider2); - } else if (thisx->xzDistToLink > 32.0f) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); + } else if (this->actor.xzDistToPlayer > 32.0f) { this->unk_34C = 1; } } void func_80AEACDC(EnRu1* this, GlobalContext* globalCtx) { - s32 pad[4]; - ColliderCylinder* collider2 = &this->collider2; + s32 pad[5]; - Collider_CylinderUpdate(&this->actor, collider2); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, collider2); + Collider_UpdateCylinder(&this->actor, &this->collider2); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } -void func_80AEAD20(EnRu1* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; +void func_80AEAD20(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - if (!thisx) {} // necessary to match - Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit1); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); - Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &sCylinderInit2); + Collider_SetCylinderType1(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); } void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) { @@ -250,7 +257,7 @@ void func_80AEAECC(EnRu1* this, GlobalContext* globalCtx) { f32 velocityYHeld = *velocityY; *velocityY = -4.0f; - func_8002E4B4(globalCtx, &this->actor, 19.0f, 25.0f, 30.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 25.0f, 30.0f, 7); *velocityY = velocityYHeld; } @@ -290,7 +297,7 @@ s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { } s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; EnRu1* someEnRu1; while (actorIt != NULL) { @@ -307,12 +314,12 @@ s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { return 0; } -DynaPolyActor* func_80AEB088(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BG].first; +BgBdanObjects* func_80AEB088(GlobalContext* globalCtx) { + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BG].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_BG_BDAN_OBJECTS && actorIt->params == 0) { - return actorIt; + return (BgBdanObjects*)actorIt; } actorIt = actorIt->next; } @@ -335,7 +342,7 @@ s32 func_80AEB104(EnRu1* this) { } Actor* func_80AEB124(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { if ((actorIt->id == ACTOR_DEMO_EFFECT) && ((actorIt->params & 0xFF) == 0x15)) { @@ -442,9 +449,9 @@ void EnRu1_SpawnRipple(EnRu1* this, GlobalContext* globalCtx, s16 radiusMax, s16 Vec3f pos; Actor* thisx = &this->actor; - pos.x = thisx->posRot.pos.x; - pos.y = thisx->posRot.pos.y + thisx->yDistToWater; - pos.z = thisx->posRot.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->yDistToWater; + pos.z = thisx->world.pos.z; EffectSsGRipple_Spawn(globalCtx, &pos, 100, radiusMax, life); } @@ -466,9 +473,9 @@ void func_80AEB680(EnRu1* this, GlobalContext* globalCtx) { Vec3f pos; Actor* thisx = &this->actor; - pos.x = thisx->posRot.pos.x; - pos.y = thisx->posRot.pos.y + thisx->yDistToWater; - pos.z = thisx->posRot.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->yDistToWater; + pos.z = thisx->world.pos.z; EffectSsGSplash_Spawn(globalCtx, &pos, 0, 0, 1, 0); } @@ -521,10 +528,10 @@ void func_80AEB89C(EnRu1* this, GlobalContext* globalCtx) { if (npcAction != NULL) { npcActionRotY = npcAction->rot.y; thisx->shape.rot.y = npcActionRotY; - thisx->posRot.rot.y = npcActionRotY; - thisx->posRot.pos.x = npcAction->startPos.x; - thisx->posRot.pos.y = npcAction->startPos.y; - thisx->posRot.pos.z = npcAction->startPos.z; + thisx->world.rot.y = npcActionRotY; + thisx->world.pos.x = npcAction->startPos.x; + thisx->world.pos.y = npcAction->startPos.y; + thisx->world.pos.z = npcAction->startPos.z; } } @@ -548,7 +555,7 @@ void func_80AEB974(EnRu1* this, GlobalContext* globalCtx) { if (csCmdNPCAction != NULL) { sp30 = func_80AEB7E0(csCmdNPCAction, globalCtx); - thisPos = &thisx->posRot.pos; + thisPos = &thisx->world.pos; thisPos->x = func_80AEB87C(sp30, csCmdNPCAction->startPos.x, csCmdNPCAction->endPos.x); thisPos->y = func_80AEB87C(sp30, csCmdNPCAction->startPos.y, csCmdNPCAction->endPos.y); thisPos->z = func_80AEB87C(sp30, csCmdNPCAction->startPos.z, csCmdNPCAction->endPos.z); @@ -569,7 +576,7 @@ void func_80AEBA2C(EnRu1* this, GlobalContext* globalCtx) { if (csCmdNPCAction != NULL) { temp_ret_2 = func_80AEB7E0(csCmdNPCAction, globalCtx); - thisPos = &thisx->posRot.pos; + thisPos = &thisx->world.pos; thisPos->x = func_80AEB87C(temp_ret_2, unk_364->x, csCmdNPCAction->endPos.x); thisPos->y = func_80AEB87C(temp_ret_2, unk_364->y, csCmdNPCAction->endPos.y); thisPos->z = func_80AEB87C(temp_ret_2, unk_364->z, csCmdNPCAction->endPos.z); @@ -683,7 +690,7 @@ void func_80AEBF60(EnRu1* this, GlobalContext* globalCtx) { if (func_80AEB480(globalCtx, 6)) { func_80AEB7D0(this); this->action = 5; - this->unk_364 = this->actor.posRot.pos; + this->unk_364 = this->actor.world.pos; return; } else { func_80AEBA0C(this, globalCtx); @@ -844,10 +851,10 @@ void func_80AEC4F4(EnRu1* this) { s32 func_80AEC5FC(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; Actor* thisx = &this->actor; - f32 thisPosZ = thisx->posRot.pos.z; - f32 playerPosZ = player->actor.posRot.pos.z; + f32 thisPosZ = thisx->world.pos.z; + f32 playerPosZ = player->actor.world.pos.z; - if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.posRot.pos.y >= thisx->posRot.pos.y)) { + if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.world.pos.y >= thisx->world.pos.y)) { return 1; } return 0; @@ -897,12 +904,12 @@ void func_80AEC81C(EnRu1* this, GlobalContext* globalCtx) { if (func_80AEAFE0(globalCtx, 1, 3)) { csCmdNPCAction = globalCtx->csCtx.npcActions[3]; - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotY = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; this->action = 9; this->drawConfig = 1; } @@ -920,7 +927,7 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) { if (arg1 != 0) { Animation_Change(&this->skelAnime, &D_060078E4, 1.0f, 0, Animation_GetLastFrame(&D_060078E4), ANIMMODE_LOOP, -8.0f); - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.y += 0x8000; this->action = 0xB; this->unk_26C = 0.0f; } @@ -1013,41 +1020,41 @@ void func_80AECC84(EnRu1* this, GlobalContext* globalCtx) { void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Vec3f* pos; - s16 yawTowardsLink; + s16 yawTowardsPlayer; f32 spawnX; f32 spawnY; f32 spawnZ; s32 pad[2]; - yawTowardsLink = thisx->yawTowardsLink; - pos = &thisx->posRot.pos; - spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsLink)) + pos->x; + yawTowardsPlayer = thisx->yawTowardsPlayer; + pos = &thisx->world.pos; + spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsPlayer)) + pos->x; spawnY = pos->y; - spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsLink)) + pos->z; - this->unk_278 = Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, spawnY, spawnZ, - 0, yawTowardsLink, 0, 5); + spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsPlayer)) + pos->z; + this->unk_278 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, + spawnY, spawnZ, 0, yawTowardsPlayer, 0, 5); } void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) { func_80AEB264(this, &D_06000E54, 0, 0, 0); this->action = 15; - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; func_80AEAEA4(this, 5); func_80AEAEB8(this, 2); } void func_80AECE04(EnRu1* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += (250.0f / 3.0f); + this->actor.shape.yOffset += (250.0f / 3.0f); } void func_80AECE20(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; s16 shapeRotY = player->actor.shape.rot.y; s32 pad; f32 unk_27C = this->unk_27C; - Vec3f* pos = &thisx->posRot.pos; + Vec3f* pos = &thisx->world.pos; pos->x = (Math_SinS(shapeRotY) * unk_27C) + playerPos->x; pos->y = playerPos->y; @@ -1058,7 +1065,7 @@ void func_80AECEB4(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Player* player = PLAYER; Vec3f* player_unk_450 = &player->unk_450; - Vec3f* pos = &thisx->posRot.pos; + Vec3f* pos = &thisx->world.pos; s16 shapeRotY = thisx->shape.rot.y; player_unk_450->x = ((kREG(2) + 30.0f) * Math_SinS(shapeRotY)) + pos->x; @@ -1077,16 +1084,16 @@ s32 func_80AECF6C(EnRu1* this, GlobalContext* globalCtx) { this->unk_26C += 1.0f; if ((player->actor.speedXZ == 0.0f) && (this->unk_26C >= 3.0f)) { otherPlayer = PLAYER; - player->actor.posRot.pos.x = otherPlayer->unk_450.x; - player->actor.posRot.pos.y = otherPlayer->unk_450.y; - player->actor.posRot.pos.z = otherPlayer->unk_450.z; + player->actor.world.pos.x = otherPlayer->unk_450.x; + player->actor.world.pos.y = otherPlayer->unk_450.y; + player->actor.world.pos.z = otherPlayer->unk_450.z; shapeRotY = &player->actor.shape.rot.y; - temp1 = this->actor.posRot.pos.x - player->actor.posRot.pos.x; - temp2 = this->actor.posRot.pos.z - player->actor.posRot.pos.z; + temp1 = this->actor.world.pos.x - player->actor.world.pos.x; + temp2 = this->actor.world.pos.z - player->actor.world.pos.z; temp_f16 = Math_FAtan2F(temp1, temp2) * 10430.3779296875f; if (*shapeRotY != temp_f16) { Math_SmoothStepToS(shapeRotY, temp_f16, 0x14, 0x1838, 0x64); - player->actor.posRot.rot.y = *shapeRotY; + player->actor.world.rot.y = *shapeRotY; } else { return 1; } @@ -1114,16 +1121,16 @@ void func_80AED0C8(EnRu1* this, GlobalContext* globalCtx) { void func_80AED0D8(EnRu1* this, GlobalContext* globalCtx) { this->action = 17; this->drawConfig = 1; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; func_80AECCB0(this, globalCtx); } void func_80AED110(EnRu1* this) { Actor* thisx = &this->actor; - if (thisx->shape.unk_08 >= 0.0f) { + if (thisx->shape.yOffset >= 0.0f) { this->action = 18; - thisx->shape.unk_08 = 0.0f; + thisx->shape.yOffset = 0.0f; func_80AED0B0(this, 1); } } @@ -1155,7 +1162,7 @@ void func_80AED218(EnRu1* this, UNK_TYPE arg1) { Animation_Change(&this->skelAnime, &D_06002990, 1.0f, 0, Animation_GetLastFrame(&D_06002990), ANIMMODE_ONCE, -8.0f); this->action = 21; - this->unk_27C = this->actor.xzDistToLink; + this->unk_27C = this->actor.xzDistToPlayer; } } @@ -1289,7 +1296,7 @@ void func_80AED738(EnRu1* this, GlobalContext* globalCtx) { if (this->unk_2A4 < 20.0f) { temp_v0 = ((20.0f - this->unk_2A4) * 255.0f) / 20.0f; this->unk_2A8 = temp_v0; - this->actor.shape.unk_14 = temp_v0; + this->actor.shape.shadowAlpha = temp_v0; } else { Actor_Kill(&this->actor); } @@ -1343,7 +1350,7 @@ void func_80AED8DC(EnRu1* this) { void func_80AEDAE0(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, thisx->floorPolySource); + Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, thisx->floorBgId); if (dyna == NULL || dyna->id == ACTOR_EN_BOX) { thisx->bgCheckFlags &= ~0x19; @@ -1355,7 +1362,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { f32* velocityY; f32* speedXZ; f32* gravity; - s16 wallPolyRot; + s16 wallYaw; s16 rotY; s32 temp_a1_2; s32 temp_a0; @@ -1363,7 +1370,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { velocityY = &this->actor.velocity.y; - temp_dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource); + temp_dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId); if (*velocityY <= 0.0f) { speedXZ = &this->actor.speedXZ; if (temp_dyna != NULL) { @@ -1413,14 +1420,14 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 8) { speedXZ = &this->actor.speedXZ; if (*speedXZ != 0.0f) { - rotY = this->actor.posRot.rot.y; - wallPolyRot = this->actor.wallPolyRot; - temp_a0 = (wallPolyRot * 2) - rotY; + rotY = this->actor.world.rot.y; + wallYaw = this->actor.wallYaw; + temp_a0 = (wallYaw * 2) - rotY; temp_a1_2 = temp_a0 + 0x8000; - if ((s16)((temp_a0 - wallPolyRot) + 0x8000) >= 0) { - phi_v1 = (s16)(temp_a1_2 - wallPolyRot); + if ((s16)((temp_a0 - wallYaw) + 0x8000) >= 0) { + phi_v1 = (s16)(temp_a1_2 - wallYaw); } else { - phi_v1 = -(s16)(temp_a1_2 - wallPolyRot); + phi_v1 = -(s16)(temp_a1_2 - wallYaw); } if (phi_v1 < 0x4001) { if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) { @@ -1428,7 +1435,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { } else { *speedXZ = 0.0f; } - this->actor.posRot.rot.y = temp_a1_2; + this->actor.world.rot.y = temp_a1_2; func_80AED4FC(this); func_80AED5B8(this); } @@ -1438,7 +1445,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { void func_80AEDEF4(EnRu1* this, GlobalContext* globalCtx) { f32* speedXZ = &this->actor.speedXZ; - Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource); + Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId); if (dyna != NULL && dyna->id == ACTOR_EN_BOX) { if (*speedXZ != 0.0f) { @@ -1484,7 +1491,7 @@ void func_80AEE050(EnRu1* this) { func_80AEE02C(this); this->unk_35C = 0; this->unk_358 = (this->actor.yDistToWater - 10.0f) * 0.5f; - this->unk_354 = this->actor.posRot.pos.y + thisx->unk_358; // thisx only used here + this->unk_354 = this->actor.world.pos.y + thisx->unk_358; // thisx only used here } else { this->actor.gravity = 0.0f; this->actor.minVelocityY *= 0.2f; @@ -1497,8 +1504,8 @@ void func_80AEE050(EnRu1* this) { if (this->actor.speedXZ <= 0.1f) { this->actor.speedXZ = 0.0f; } - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; func_8002D7EC(this); } } else { @@ -1511,7 +1518,7 @@ void func_80AEE050(EnRu1* this) { sp28 = this->unk_358; sp24 = this->unk_354; temp_f10 = Math_CosS(this->unk_35C) * -sp28; - this->actor.posRot.pos.y = temp_f10 + sp24; + this->actor.world.pos.y = temp_f10 + sp24; this->unk_35C += 0x3E8; this->unk_358 *= 0.95f; } @@ -1546,10 +1553,10 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) { void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) { Actor* dyna; - s32 floorPolySource; - if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != BGCHECK_SCENE)) { - floorPolySource = this->actor.floorPolySource; - dyna = DynaPoly_GetActor(&globalCtx->colCtx, floorPolySource); + s32 floorBgId; + if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) { + floorBgId = this->actor.floorBgId; + dyna = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId); if ((dyna != NULL) && (dyna->id == ACTOR_BG_BDAN_SWITCH)) { if (((dyna->params >> 8) & 0x3F) == 0x38) { gSaveContext.infTable[20] |= 1; @@ -1564,13 +1571,12 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { s32 pad[2]; CollisionContext* colCtx; DynaPolyActor* dynaActor; - s32 floorPolySource; + s32 floorBgId; - if ((this->actor.bgCheckFlags & 1) && this->actor.floorPolySource != BGCHECK_SCENE) { + if ((this->actor.bgCheckFlags & 1) && this->actor.floorBgId != BGCHECK_SCENE) { colCtx = &globalCtx->colCtx; - floorPolySource = - this->actor.floorPolySource; // necessary match, can't move this out of this block unfortunately - dynaActor = DynaPoly_GetActor(colCtx, floorPolySource); + floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately + dynaActor = DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL && dynaActor->actor.id == ACTOR_BG_BDAN_OBJECTS && dynaActor->actor.params == 0 && !Player_InCsMode(globalCtx) && globalCtx->msgCtx.unk_E300 == 0) { func_80AEE02C(this); @@ -1578,8 +1584,8 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { gSaveContext.cutsceneTrigger = 1; this->action = 36; this->drawConfig = 0; - this->unk_28C = dynaActor; - this->actor.shape.unk_14 = 0; + this->unk_28C = (BgBdanObjects*)dynaActor; + this->actor.shape.shadowAlpha = 0; return 1; } } @@ -1822,7 +1828,7 @@ void func_80AEEF68(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 something; - this->unk_374.unk_18 = player->actor.posRot.pos; + this->unk_374.unk_18 = player->actor.world.pos; this->unk_374.unk_14 = kREG(16) - 3.0f; something = kREG(17) + 0xC; func_80034A14(&this->actor, &this->unk_374, something, 2); @@ -1832,11 +1838,11 @@ void func_80AEEFEC(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 something; - this->unk_374.unk_18 = player->actor.posRot.pos; + this->unk_374.unk_18 = player->actor.world.pos; this->unk_374.unk_14 = kREG(16) - 3.0f; something = kREG(17) + 0xC; func_80034A14(&this->actor, &this->unk_374, something, 4); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } void func_80AEF080(EnRu1* this) { @@ -1989,23 +1995,23 @@ void func_80AEF624(EnRu1* this, GlobalContext* globalCtx) { // this weird part with the redundant variable is necessary to match for some reason csCmdNPCAction2 = globalCtx->csCtx.npcActions[3]; csCmdNPCAction = csCmdNPCAction2; - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotTmp = csCmdNPCAction->rot.x; thisx->shape.rot.x = newRotTmp; - thisx->posRot.rot.x = newRotTmp; + thisx->world.rot.x = newRotTmp; newRotTmp = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotTmp; - thisx->posRot.rot.y = newRotTmp; + thisx->world.rot.y = newRotTmp; newRotTmp = csCmdNPCAction->rot.z; thisx->shape.rot.z = newRotTmp; - thisx->posRot.rot.z = newRotTmp; + thisx->world.rot.z = newRotTmp; Animation_Change(&this->skelAnime, &D_060063F4, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); func_80AEB3A4(this, globalCtx); this->action = 37; this->drawConfig = 1; - thisx->shape.unk_14 = 0xFF; + thisx->shape.shadowAlpha = 0xFF; } } @@ -2263,7 +2269,7 @@ void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) { EnRu1* this = THIS; s32 pad; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06012700, NULL, this->jointTable, this->morphTable, 17); func_80AEAD20(this, globalCtx); switch (func_80AEADF0(this)) { @@ -2334,12 +2340,12 @@ void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve if (limbIndex == 15) { vec1 = sMultVec; Matrix_MultVec3f(&vec1, &vec2); - this->actor.posRot2.pos.x = vec2.x; - this->actor.posRot2.pos.y = vec2.y; - this->actor.posRot2.pos.z = vec2.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = vec2.x; + this->actor.focus.pos.y = vec2.y; + this->actor.focus.pos.z = vec2.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index cb60ae2eba..bfcdacb227 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -19,7 +19,7 @@ typedef struct EnRu1 { /* 0x0190 */ Vec3s jointTable[17]; /* 0x01F6 */ Vec3s morphTable[17]; /* 0x025C */ s16 unk_25C; - /* 0x025E */ char unk_25E[0x2]; + /* 0x025E */ s16 unk_25E; /* 0x0260 */ s16 unk_260; /* 0x0262 */ char unk_262[0x2]; /* 0x0264 */ s32 action; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 04f4d14be2..21491829e7 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -43,8 +43,14 @@ void func_80AF321C(EnRu2* this, GlobalContext* globalCtx); void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 30, 100, 0, { 0 } }, }; @@ -73,7 +79,7 @@ static EnRu2DrawFunc sDrawFuncs[] = { const ActorInit En_Ru2_InitVars = { ACTOR_EN_RU2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RU2, sizeof(EnRu2), @@ -96,17 +102,14 @@ void func_80AF2550(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { - s32 pad; - ColliderCylinder* collider = &this->collider; - Actor* thisx = &this->actor; - s32 pad2[2]; + s32 pad[5]; - Collider_CylinderUpdate(thisx, collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void EnRu2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -147,7 +150,7 @@ void func_80AF26AC(EnRu2* this) { this->drawConfig = 0; this->alpha = 0; this->unk_2B8 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_2B0 = 0.0f; } @@ -171,7 +174,7 @@ void func_80AF26D0(EnRu2* this, GlobalContext* globalCtx) { } void func_80AF2744(EnRu2* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); } s32 EnRu2_FrameUpdateMatrix(EnRu2* this) { @@ -209,12 +212,12 @@ void func_80AF2868(EnRu2* this, GlobalContext* globalCtx, u32 npcActionIdx) { Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotY = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; } } @@ -238,28 +241,28 @@ void func_80AF28E8(EnRu2* this, AnimationHeader* animation, u8 arg2, f32 transit } void func_80AF2978(EnRu2* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 83.333336f; + this->actor.shape.yOffset += 83.333336f; } void func_80AF2994(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_06000DE8, 0, 0.0f, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - f32 posX = thisx->posRot.pos.x; - f32 posY = thisx->posRot.pos.y; - f32 posZ = thisx->posRot.pos.z; + f32 posX = thisx->world.pos.x; + f32 posY = thisx->world.pos.y; + f32 posZ = thisx->world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_80AF2A38(EnRu2* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 50.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 50.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 10); Item_Give(globalCtx, ITEM_MEDALLION_WATER); @@ -276,9 +279,9 @@ void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = &D_80AF411C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_WATER); - temp = this->actor.posRot.rot.y + 0x8000; + temp = this->actor.world.rot.y + 0x8000; player->actor.shape.rot.y = temp; - player->actor.posRot.rot.y = temp; + player->actor.world.rot.y = temp; } } @@ -297,9 +300,9 @@ void func_80AF2B44(EnRu2* this, GlobalContext* globalCtx) { } void func_80AF2B94(EnRu2* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -382,7 +385,7 @@ void func_80AF2DEC(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2E1C(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_060004CC, 2, 0.0f, 0); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AF2E64() { @@ -390,8 +393,8 @@ void func_80AF2E64() { } void func_80AF2E84(EnRu2* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(19) + 24.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 8); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(19) + 24.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 8); } void func_80AF2F04(EnRu2* this, GlobalContext* globalCtx) { @@ -399,7 +402,7 @@ void func_80AF2F04(EnRu2* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_2B0 = 0.0f; func_80AF2E64(); } @@ -416,7 +419,7 @@ void func_80AF2F58(EnRu2* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_2B0 = kREG(5) + 10.0f; this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; return; } } else { @@ -426,13 +429,13 @@ void func_80AF2F58(EnRu2* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_2B0 = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*unk_2B0 / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void func_80AF30AC(EnRu2* this, GlobalContext* globalCtx) { @@ -445,7 +448,7 @@ void func_80AF30AC(EnRu2* this, GlobalContext* globalCtx) { func_80AF2E84(this, globalCtx); this->unk_2B8 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -495,7 +498,7 @@ void func_80AF3394(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_0600E630, 0, 0.0f, 0); this->action = 10; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AF33E0(EnRu2* this) { @@ -508,11 +511,11 @@ void func_80AF33E0(EnRu2* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_2B0) { this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } else { temp_f18 = (*unk_2B0 / temp_f0) * 255.0f; this->alpha = temp_f18; - this->actor.shape.unk_14 = temp_f18; + this->actor.shape.shadowAlpha = temp_f18; } } @@ -620,13 +623,13 @@ void func_80AF37CC(EnRu2* this) { this->unk_2C0 += 1; funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (300.0f * funcFloat); + this->actor.world.pos.y = this->actor.home.pos.y + (300.0f * funcFloat); } s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 thisPosX = this->actor.posRot.pos.x; - f32 playerPosX = player->actor.posRot.pos.x; + f32 thisPosX = this->actor.world.pos.x; + f32 playerPosX = player->actor.world.pos.x; if (playerPosX - thisPosX >= -202.0f) { return 1; @@ -678,9 +681,9 @@ void func_80AF39DC(EnRu2* this, GlobalContext* globalCtx) { player = PLAYER; osSyncPrintf("うおりゃー! \n"); func_8005B1A4(ACTIVE_CAM); - player->actor.posRot.pos.x = 820.0f; - player->actor.posRot.pos.y = 0.0f; - player->actor.posRot.pos.z = 180.0f; + player->actor.world.pos.x = 820.0f; + player->actor.world.pos.y = 0.0f; + player->actor.world.pos.z = 180.0f; } } } @@ -709,7 +712,7 @@ void func_80AF3B74(EnRu2* this, GlobalContext* globalCtx) { void func_80AF3BC8(EnRu2* this, GlobalContext* globalCtx) { func_80AF3878(this, globalCtx); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF259C(this, globalCtx); } @@ -718,7 +721,7 @@ void func_80AF3C04(EnRu2* this, GlobalContext* globalCtx) { func_80AF259C(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF38D0(this, globalCtx); } @@ -726,7 +729,7 @@ void func_80AF3C64(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF390C(this, globalCtx); } @@ -734,7 +737,7 @@ void func_80AF3CB8(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF39DC(this, globalCtx); } @@ -742,7 +745,7 @@ void func_80AF3D0C(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF3ADC(this, globalCtx); } @@ -751,7 +754,7 @@ void func_80AF3D60(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF3B74(this, globalCtx); } @@ -768,7 +771,7 @@ void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); func_80AF2550(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C700, NULL, this->jointTable, this->morphTable, 23); diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 8e9e8934c5..3f6958bbc4 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06012100; /* const ActorInit En_Sa_InitVars = { ACTOR_EN_SA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SA, sizeof(EnSa), @@ -30,6 +30,26 @@ const ActorInit En_Sa_InitVars = { (ActorFunc)EnSa_Update, (ActorFunc)EnSa_Draw, }; + +static ColliderCylinderInit D_80AF7260 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sa/func_80AF5560.s") diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 4fc23e8698..36300e5fb9 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -28,7 +28,7 @@ void EnSb_Cooldown(EnSb* this, GlobalContext* globalCtx); const ActorInit En_Sb_InitVars = { ACTOR_EN_SB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SB, sizeof(EnSb), @@ -38,21 +38,57 @@ const ActorInit En_Sb_InitVars = { (ActorFunc)EnSb_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0xFFCFFFFF, 0x04, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, { 30, 40, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable[] = { - 0x00, 0x00, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x12, 0xD1, 0xD2, 0xD4, 0x24, 0xF2, 0xF2, 0xE4, 0xF2, - 0xF2, 0x24, 0x00, 0x00, 0x00, 0x00, 0xD1, 0xD4, 0xD2, 0xD2, 0xD8, 0xD4, 0x00, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xD), + /* Master sword */ DMG_ENTRY(2, 0xD), + /* Giant's Knife */ DMG_ENTRY(4, 0xD), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xD), + /* Giant spin */ DMG_ENTRY(4, 0xD), + /* Master spin */ DMG_ENTRY(2, 0xD), + /* Kokiri jump */ DMG_ENTRY(2, 0xD), + /* Giant jump */ DMG_ENTRY(8, 0xD), + /* Master jump */ DMG_ENTRY(4, 0xD), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 39, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; static Vec3f sFlamePosOffsets[] = { @@ -85,7 +121,7 @@ void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.health = 2; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->isDead = false; this->actor.colChkInfo.mass = 0; Actor_SetScale(&this->actor, 0.006f); @@ -109,7 +145,7 @@ void EnSb_SpawnBubbles(GlobalContext* globalCtx, EnSb* this) { if (this->actor.yDistToWater > 0) { for (i = 0; i < 10; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 10.0f, 10.0f, 30.0f, 0.25f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 10.0f, 10.0f, 30.0f, 0.25f); } } } @@ -175,9 +211,9 @@ void EnSb_SetupCooldown(EnSb* this, s32 changeSpeed) { void EnSb_WaitClosed(EnSb* this, GlobalContext* globalCtx) { // always face toward link - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink <= 160.0f) && (this->actor.xzDistToLink > 40.0f)) { + if ((this->actor.xzDistToPlayer <= 160.0f) && (this->actor.xzDistToPlayer > 40.0f)) { EnSb_SetupOpen(this); } } @@ -189,8 +225,8 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) { this->timer = 15; EnSb_SetupWaitOpen(this); } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink > 160.0f) || (this->actor.xzDistToLink <= 40.0f)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); + if ((this->actor.xzDistToPlayer > 160.0f) || (this->actor.xzDistToPlayer <= 40.0f)) { EnSb_SetupWaitClosed(this); } } @@ -199,9 +235,9 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) { void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) { s16 timer = this->timer; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink > 160.0f) || (this->actor.xzDistToLink <= 40.0f)) { + if ((this->actor.xzDistToPlayer > 160.0f) || (this->actor.xzDistToPlayer <= 40.0f)) { EnSb_SetupWaitClosed(this); } @@ -209,7 +245,7 @@ void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) { this->timer = timer - 1; } else { this->timer = 0; - this->attackYaw = this->actor.yawTowardsLink; + this->attackYaw = this->actor.yawTowardsPlayer; this->actionFunc = EnSb_TurnAround; } } @@ -221,7 +257,7 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, invertedYaw, 0x1, 0x1F40, 0xA); if (this->actor.shape.rot.y == invertedYaw) { - this->actor.posRot.rot.y = this->attackYaw; + this->actor.world.rot.y = this->attackYaw; if (this->actor.yDistToWater > 0.0f) { this->actor.velocity.y = 3.0f; this->actor.speedXZ = 5.0f; @@ -340,24 +376,24 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { u8 hitByWindArrow; // hit box collided, switch to cool down - if ((this->collider.base.atFlags & 2)) { + if ((this->collider.base.atFlags & AT_HIT)) { EnSb_SetupCooldown(this, 1); return 1; } // hurt box collided, take damage if appropriate - if ((this->collider.base.acFlags & 2)) { + if ((this->collider.base.acFlags & AC_HIT)) { hitByWindArrow = false; tookDamage = false; - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; switch (this->actor.colChkInfo.damageEffect) { case 14: // wind arrow hitByWindArrow = true; case 15: // explosions, arrow, hammer, ice arrow, light arrow, spirit arrow, shadow arrow if (EnSb_IsVulnerable(this)) { - hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.world.pos.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); @@ -374,8 +410,8 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { case 1: // hookshot/longshot case 13: // all sword damage if (EnSb_IsVulnerable(this)) { - hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.world.pos.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); @@ -392,16 +428,16 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { func_80032E24(&this->unk_1E0, 8, globalCtx); this->isDead = true; func_80032C7C(globalCtx, &this->actor); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EN_SHELL_DEAD); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_SHELL_DEAD); return 1; } // if player attack didn't do damage, play recoil sound and spawn sparks if (!tookDamage) { - hitPoint.x = this->collider.body.bumper.unk_06.x; - hitPoint.y = this->collider.body.bumper.unk_06.y; - hitPoint.z = this->collider.body.bumper.unk_06.z; - func_80062DF4(globalCtx, &hitPoint); + hitPoint.x = this->collider.info.bumper.hitPos.x; + hitPoint.y = this->collider.info.bumper.hitPos.y; + hitPoint.z = this->collider.info.bumper.hitPos.z; + CollisionCheck_SpawnShieldParticlesMetal2(globalCtx, &hitPoint); } } @@ -420,20 +456,20 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) { } if (func_8003305C(this, &this->unk_1E0, globalCtx, this->actor.params) != 0) { if (!this->hitByWindArrow) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x80); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, 8); + Item_DropCollectible(globalCtx, &this->actor.world.pos, 8); } Actor_Kill(&this->actor); } } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); Actor_SetScale(&this->actor, 0.006f); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); EnSb_UpdateDamage(this, globalCtx); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -457,15 +493,15 @@ void EnSb_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, EnSb_PostLimbDraw, this); if (this->fire != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; fireDecr = this->fire - 1; // this is intended to draw flames after being burned, but the condition is never met to run this code // fire gets set to 4 when burned, decrements to 3 and fails the "& 1" check and never stores the decrement if ((fireDecr & 1) == 0) { offset = &sFlamePosOffsets[(fireDecr & 3)]; - flamePos.x = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.x + offset->x); - flamePos.y = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.y + offset->y); - flamePos.z = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.z + offset->z); + flamePos.x = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.x + offset->x); + flamePos.y = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.y + offset->y); + flamePos.z = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.z + offset->z); EffectSsEnFire_SpawnVec3f(globalCtx, this, &flamePos, 100, 0, 0, -1); } } diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index f0b6da1a4f..de41f50e8b 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -19,7 +19,7 @@ void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx); const ActorInit En_Scene_Change_InitVars = { ACTOR_EN_SCENE_CHANGE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JJ, sizeof(EnSceneChange), diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index 7227ebf590..5c093b277c 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -21,7 +21,7 @@ void func_80AF8F60(Player* player, u8* shadowTexture, f32 arg2); const ActorInit En_Sda_InitVars = { ACTOR_EN_SDA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSda), @@ -133,7 +133,7 @@ void EnSda_Update(Actor* thisx, GlobalContext* globalCtx) { player = PLAYER; } - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; osSyncPrintf("SDA MOVE END\n"); } @@ -151,7 +151,7 @@ void EnSda_Draw(Actor* thisx, GlobalContext* globalCtx) { player = PLAYER; } - player->actor.shape.unk_14 = 0; + player->actor.shape.shadowAlpha = 0; func_80AF95C4(this, shadowTexture, player, globalCtx); if (KREG(0) < 5) { @@ -182,13 +182,13 @@ void func_80AF8F60(Player* player, u8* shadowTexture, f32 arg2) { lerp.y = D_80AFA660[i].y + (D_80AFA660[j].y - D_80AFA660[i].y) * arg2; lerp.z = D_80AFA660[i].z + (D_80AFA660[j].z - D_80AFA660[i].z) * arg2; - sp88.x = lerp.x - player->actor.posRot.pos.x; - sp88.y = lerp.y - player->actor.posRot.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; - sp88.z = lerp.z - player->actor.posRot.pos.z; + sp88.x = lerp.x - player->actor.world.pos.x; + sp88.y = lerp.y - player->actor.world.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; + sp88.z = lerp.z - player->actor.world.pos.z; } else { - sp88.x = D_80AFA660[i].x - player->actor.posRot.pos.x; - sp88.y = D_80AFA660[i].y - player->actor.posRot.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; - sp88.z = D_80AFA660[i].z - player->actor.posRot.pos.z; + sp88.x = D_80AFA660[i].x - player->actor.world.pos.x; + sp88.y = D_80AFA660[i].y - player->actor.world.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; + sp88.z = D_80AFA660[i].z - player->actor.world.pos.z; } Matrix_MultVec3f(&sp88, &sp7C); sp7C.x *= (1.0f + (BREG(49) / 100.0f)); @@ -324,9 +324,9 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, GlobalContext } Matrix_RotateX((BREG(50) + 70) / 100.0f, 0); for (i = 0; i < 22; i++) { - sp194.x = sp64[i].x - player->actor.posRot.pos.x; - sp194.y = sp64[i].y - player->actor.posRot.pos.y + KREG(80) + 16.0f; - sp194.z = sp64[i].z - player->actor.posRot.pos.z; + sp194.x = sp64[i].x - player->actor.world.pos.x; + sp194.y = sp64[i].y - player->actor.world.pos.y + KREG(80) + 16.0f; + sp194.z = sp64[i].z - player->actor.world.pos.z; Matrix_MultVec3f(&sp194, &sp188); sp188.x *= (1.0f + (KREG(90) / 100.0f)); sp188.y *= (1.0f + (KREG(90) / 100.0f)); @@ -374,12 +374,12 @@ void func_80AF9C70(u8* shadowTexture, Player* player, GlobalContext* globalCtx) func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x00, 0, 0, 0, (BREG(52) + 50)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0); - Matrix_Translate(player->actor.posRot.pos.x, player->actor.groundY, player->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(player->actor.world.pos.x, player->actor.floorHeight, player->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateY(BREG(51) / 100.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, (BREG(63) / 10.0f) + 1.0f, MTXMODE_APPLY); tempx = (BREG(62) / 10.0f) + 2.0f; - tempz = - ((player->actor.posRot.pos.y - player->actor.groundY + BREG(54)) * (BREG(55) - 5) / 10.0f) + BREG(58) - 20.0f; + tempz = ((player->actor.world.pos.y - player->actor.floorHeight + BREG(54)) * (BREG(55) - 5) / 10.0f) + BREG(58) - + 20.0f; Matrix_Translate(tempx, 0.0f, tempz, MTXMODE_APPLY); Matrix_Scale(((BREG(56) - 250) / 1000.0f) + 0.6f, 1.0f, ((BREG(59) - 250) / 1000.0f) + 0.6f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_sda.c", 860), diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index fa032a7c64..126d083a77 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -28,7 +28,7 @@ extern AnimationHeader D_06004574; const ActorInit En_Shopnuts_InitVars = { ACTOR_EN_SHOPNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SHOPNUTS, sizeof(EnShopnuts), @@ -39,9 +39,23 @@ const ActorInit En_Shopnuts_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x0014, 0x0028, 0x0000, { 0x0000, 0x0000, 0x0000 } } + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 40, 0, { 0, 0, 0 } }, }; static CollisionCheckInfoInit sColChkInfoInit = { 1, 20, 40, 0xFE }; @@ -49,19 +63,19 @@ static CollisionCheckInfoInit sColChkInfoInit = { 1, 20, 40, 0xFE }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x4E, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), }; void EnShopnuts_Init(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_06004574, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + Collider_UpdateCylinder(&this->actor, &this->collider); if (((this->actor.params == 0x0002) && (gSaveContext.itemGetInf[0] & 0x800)) || ((this->actor.params == 0x0009) && (gSaveContext.infTable[25] & 4)) || @@ -82,7 +96,7 @@ void EnShopnuts_SetupWait(EnShopnuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600139C, 0.0f); this->animFlagAndTimer = Rand_S16Offset(100, 50); this->collider.dim.height = 5; - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnShopnuts_Wait; } @@ -116,7 +130,7 @@ void EnShopnuts_SetupBurrow(EnShopnuts* this) { void EnShopnuts_SetupSpawnSalesman(EnShopnuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000764, -3.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnShopnuts_SpawnSalesman; } @@ -130,26 +144,26 @@ void EnShopnuts_Wait(EnShopnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); } this->collider.dim.height = ((CLAMP(this->skelAnime.curFrame, 9.0f, 13.0f) - 9.0f) * 9.0f) + 5.0f; - if (!hasSlowPlaybackSpeed && (this->actor.xzDistToLink < 120.0f)) { + if (!hasSlowPlaybackSpeed && (this->actor.xzDistToPlayer < 120.0f)) { EnShopnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnShopnuts_SetupBurrow(this); - } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToLink > 320.0f)) { + } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToPlayer > 320.0f)) { EnShopnuts_SetupLookAround(this); } else { EnShopnuts_SetupStand(this); } } if (hasSlowPlaybackSpeed && - ((this->actor.xzDistToLink > 160.0f) && (fabsf(this->actor.yDistToLink) < 120.0f)) && - ((this->animFlagAndTimer == 0) || (this->actor.xzDistToLink < 480.0f))) { + ((this->actor.xzDistToPlayer > 160.0f) && (fabsf(this->actor.yDistToPlayer) < 120.0f)) && + ((this->animFlagAndTimer == 0) || (this->actor.xzDistToPlayer < 480.0f))) { this->skelAnime.playSpeed = 1.0f; } } @@ -159,7 +173,7 @@ void EnShopnuts_LookAround(EnShopnuts* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && (this->animFlagAndTimer != 0)) { this->animFlagAndTimer--; } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0)) { EnShopnuts_SetupBurrow(this); } } @@ -170,9 +184,9 @@ void EnShopnuts_Stand(EnShopnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (!(this->animFlagAndTimer & 0x1000)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0x1000)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0x1000)) { EnShopnuts_SetupBurrow(this); } else if (this->animFlagAndTimer == 0) { EnShopnuts_SetupThrowNut(this); @@ -182,15 +196,15 @@ void EnShopnuts_Stand(EnShopnuts* this, GlobalContext* globalCtx) { void EnShopnuts_ThrowNut(EnShopnuts* this, GlobalContext* globalCtx) { Vec3f spawnPos; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); - if (this->actor.xzDistToLink < 120.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); + if (this->actor.xzDistToPlayer < 120.0f) { EnShopnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { EnShopnuts_SetupStand(this); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - spawnPos.x = this->actor.posRot.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); - spawnPos.y = this->actor.posRot.pos.y + 12.0f; - spawnPos.z = this->actor.posRot.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); + spawnPos.x = this->actor.world.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); + spawnPos.y = this->actor.world.pos.y + 12.0f; + spawnPos.z = this->actor.world.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_NUTSBALL, spawnPos.x, spawnPos.y, spawnPos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 2) != NULL) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW); @@ -205,25 +219,25 @@ void EnShopnuts_Burrow(EnShopnuts* this, GlobalContext* globalCtx) { this->collider.dim.height = ((4.0f - CLAMP_MAX(this->skelAnime.curFrame, 4.0f)) * 10.0f) + 5.0f; } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; } } void EnShopnuts_SpawnSalesman(EnShopnuts* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DNS, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DNS, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, this->actor.params); Actor_Kill(&this->actor); } else { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } } void EnShopnuts_ColliderCheck(EnShopnuts* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); EnShopnuts_SetupSpawnSalesman(this); } else if (globalCtx->actorCtx.unk_02 != 0) { EnShopnuts_SetupSpawnSalesman(this); @@ -235,18 +249,18 @@ void EnShopnuts_Update(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts_ColliderCheck(this, globalCtx); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 4); - if (this->collider.base.acFlags & 1) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 4); + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actionFunc == EnShopnuts_Wait) { - Actor_SetHeight(&this->actor, this->skelAnime.curFrame); + Actor_SetFocus(&this->actor, this->skelAnime.curFrame); } else if (this->actionFunc == EnShopnuts_Burrow) { - Actor_SetHeight(&this->actor, - 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_0600039C))); + Actor_SetFocus(&this->actor, + 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_0600039C))); } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); } } diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 32a3147c49..60b91ce022 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -1,7 +1,7 @@ /* * File: z_en_si.c * Overlay: En_Si - * Description: + * Description: Gold Skulltula token */ #include "z_en_si.h" @@ -21,18 +21,30 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx); void func_80AFB950(EnSi* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000090, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000090, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 18, 2, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 D_80AFBADC = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 D_80AFBADC = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Si_InitVars = { ACTOR_EN_SI, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_ST, sizeof(EnSi), @@ -47,11 +59,11 @@ void EnSi_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &D_80AFBADC); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &D_80AFBADC); Actor_SetScale(&this->actor, 0.025f); this->unk_19C = 0; this->actionFunc = func_80AFB768; - this->actor.shape.unk_08 = 42.0f; + this->actor.shape.yOffset = 42.0f; } void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -61,8 +73,8 @@ void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 0x2) { - this->collider.base.acFlags &= ~0x2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; } return 0; } @@ -80,17 +92,17 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (!Player_InCsMode(globalCtx)) { func_80AFB748(this, globalCtx); - if (this->collider.base.maskB & 0x1) { - this->collider.base.maskB &= ~0x1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; Item_Give(globalCtx, ITEM_SKULL_TOKEN); player->actor.freezeTimer = 10; func_8010B680(globalCtx, 0xB4, 0); func_800F5C64(0x39); this->actionFunc = func_80AFB950; } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } @@ -132,9 +144,9 @@ void EnSi_Update(Actor* thisx, GlobalContext* globalCtx) { EnSi* this = THIS; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 16.0f); + Actor_SetFocus(&this->actor, 16.0f); } void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 91511ff069..98581cb9e3 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -21,7 +21,7 @@ void func_80AFC478(EnSiofuki* this, GlobalContext* globalCtx); const ActorInit En_Siofuki_InitVars = { ACTOR_EN_SIOFUKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SIOFUKI, sizeof(EnSiofuki), @@ -61,7 +61,7 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - this->initPosY = thisx->posRot.pos.y; + this->initPosY = thisx->world.pos.y; this->unk_174 = 35.0f; this->unk_170 = -6058.0f + this->unk_174; @@ -78,9 +78,9 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.z = thisx->shape.rot.z * 0.5f * 0.1f; } - thisx->posRot.rot.x = 0; - thisx->posRot.rot.y = 0; - thisx->posRot.rot.z = 0; + thisx->world.rot.x = 0; + thisx->world.rot.y = 0; + thisx->world.rot.z = 0; thisx->shape.rot.x = 0; thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; @@ -112,7 +112,7 @@ void func_80AFBDC8(EnSiofuki* this, GlobalContext* globalCtx) { this->oscillation = sinf((globalCtx->gameplayFrames & 0x1F) / 32.0f * M_PI * 2.0f) * 4.0f; this->unk_170 = this->unk_174 * 10.0f + -6058.0f - this->oscillation * 10.0f; this->unk_174 = 35.0f; - this->dyna.actor.posRot.pos.y = this->initPosY + this->currentHeight + this->oscillation; + this->dyna.actor.world.pos.y = this->initPosY + this->currentHeight + this->oscillation; } void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { @@ -125,15 +125,15 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { f32 dist2d; f32 speedScale; - dX = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x; - dY = player->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y; - dZ = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z; + dX = player->actor.world.pos.x - this->dyna.actor.world.pos.x; + dY = player->actor.world.pos.y - this->dyna.actor.world.pos.y; + dZ = player->actor.world.pos.z - this->dyna.actor.world.pos.z; if ((dX > (this->dyna.actor.scale.x * -346.0f)) && (dX < (this->dyna.actor.scale.x * 346.0f)) && (dZ > (this->dyna.actor.scale.z * -400.0f)) && (dZ < (this->dyna.actor.scale.z * 400.0f)) && (dY < 0.0f)) { if (func_8004356C(&this->dyna)) { if (this->splashTimer <= 0) { - EffectSsGSplash_Spawn(globalCtx, &player->actor.posRot.pos, NULL, NULL, 1, 1); + EffectSsGSplash_Spawn(globalCtx, &player->actor.world.pos, NULL, NULL, 1, 1); this->splashTimer = 10; } else { this->splashTimer--; @@ -147,13 +147,13 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { this->applySpeed = true; this->splashTimer = 0; angle = Math_FAtan2F(dX, dZ) * (0x8000 / M_PI); - dAngle = (player->actor.posRot.rot.y ^ 0x8000) - angle; + dAngle = (player->actor.world.rot.y ^ 0x8000) - angle; player->actor.gravity = 0.0f; player->actor.velocity.y = 0.0f; - Math_SmoothStepToF(&player->actor.posRot.pos.y, this->dyna.actor.posRot.pos.y, 0.5f, 4.0f, 1.0f); + Math_SmoothStepToF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.5f, 4.0f, 1.0f); if ((dAngle < 0x4000) && (dAngle > -0x4000)) { - this->appliedYaw = player->actor.posRot.rot.y ^ 0x8000; + this->appliedYaw = player->actor.world.rot.y ^ 0x8000; speedScale = dist2d / (this->dyna.actor.scale.x * 40.0f * 10.0f); speedScale = CLAMP_MIN(speedScale, 0.0f); speedScale = CLAMP_MAX(speedScale, 1.0f); @@ -161,7 +161,7 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.3f * speedScale); } else { - this->appliedYaw = player->actor.posRot.rot.y; + this->appliedYaw = player->actor.world.rot.y; player->linearVelocity /= 2.0f; Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.1f); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index de77df6688..309d4f140c 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060047E0; /* const ActorInit En_Skb_InitVars = { ACTOR_EN_SKB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKB, sizeof(EnSkb), @@ -28,6 +28,44 @@ const ActorInit En_Skb_InitVars = { (ActorFunc)EnSkb_Update, (ActorFunc)EnSkb_Draw, }; + +static ColliderJntSphElementInit D_80AFE020[2] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 15, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80AFE068 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + D_80AFE020, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFC9A0.s") diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index f7d16990eb..6601dbbb93 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06007128; /* const ActorInit En_Skj_InitVars = { ACTOR_EN_SKJ, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKJ, sizeof(EnSkj), @@ -28,6 +28,25 @@ const ActorInit En_Skj_InitVars = { (ActorFunc)EnSkj_Update, (ActorFunc)EnSkj_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, 48, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skj/func_80AFE2B0.s") diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 90e8fb8b2b..d056cd9421 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -21,7 +21,7 @@ extern Gfx D_06000EB0[]; const ActorInit En_Skjneedle_InitVars = { ACTOR_EN_SKJNEEDLE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKJ, sizeof(EnSkjneedle), @@ -31,15 +31,21 @@ const ActorInit En_Skjneedle_InitVars = { (ActorFunc)EnSkjneedle_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK1, 0x11, 0x09, 0x00, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT1, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, { 10, 4, -2, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -47,8 +53,8 @@ void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 20.0f); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 20.0f); thisx->flags &= ~0x1; Actor_SetScale(&this->actor, 0.01f); } @@ -60,8 +66,8 @@ void EnSkjneedle_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 func_80B01F6C(EnSkjneedle* this) { - if (this->collider.base.atFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return 1; } return 0; @@ -80,11 +86,11 @@ void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx) { } else { globalCtx = preserve; // workaround Actor_SetScale(&this->actor, 0.01f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 7); } } diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 7725ce30f2..b8d19014f0 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -57,7 +57,7 @@ static Gfx D_80B04400[] = { const ActorInit En_Ssh_InitVars = { ACTOR_EN_SSH, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SSH, sizeof(EnSsh), @@ -68,30 +68,72 @@ const ActorInit En_Ssh_InitVars = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK6, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 32, 50, -24, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK6, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 60, -30, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphElementInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 1, { { 0, -240, 0 }, 28 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphElementInit, + sJntSphElementsInit, }; void EnSsh_SetupAction(EnSsh* this, EnSshActionFunc actionFunc) { @@ -102,9 +144,9 @@ void EnSsh_SpawnShockwave(EnSsh* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f pos; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.groundY; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.floorHeight; + pos.z = this->actor.world.pos.z; EffectSsBlast_SpawnWhiteCustomScale(globalCtx, &pos, &zeroVec, &zeroVec, 100, 220, 8); } @@ -137,10 +179,10 @@ s32 EnSsh_CheckCeilingPos(EnSsh* this, GlobalContext* globalCtx) { s32 bgId; Vec3f posB; - posB.x = this->actor.posRot.pos.x; - posB.y = this->actor.posRot.pos.y + 1000.0f; - posB.z = this->actor.posRot.pos.z; - if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &posB, &this->ceilingPos, &poly, false, + posB.x = this->actor.world.pos.x; + posB.y = this->actor.world.pos.y + 1000.0f; + posB.z = this->actor.world.pos.z; + if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &posB, &this->ceilingPos, &poly, false, false, true, true, &bgId)) { return false; } else { @@ -183,14 +225,14 @@ void EnSsh_InitColliders(EnSsh* this, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colCylinder[i], &this->actor, cylinders[i]); } - this->colCylinder[0].body.bumper.flags = 0x0003F8E9; - this->colCylinder[1].body.bumper.flags = 0xFFC00716; - this->colCylinder[2].base.type = 9; - this->colCylinder[2].body.bumperFlags = 0xD; - this->colCylinder[2].body.flags = 2; - this->colCylinder[2].body.bumper.flags = 0xFFCC0716; + this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8E9; + this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00716; + this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO; + this->colCylinder[2].info.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0716; - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit); Collider_InitJntSph(globalCtx, &this->colSph); Collider_SetJntSph(globalCtx, &this->colSph, &this->actor, &sJntSphInit, this->colSphElements); @@ -221,7 +263,7 @@ void EnSsh_SetReturnAnimation(EnSsh* this) { } void EnSsh_SetLandAnimation(EnSsh* this) { - this->actor.posRot.pos.y = this->groundYoffset + this->actor.groundY; + this->actor.world.pos.y = this->floorHeightOffset + this->actor.floorHeight; this->animTimer = EnSsh_SetAnimation(this, SSH_ANIM_LAND); } @@ -236,7 +278,7 @@ void EnSsh_SetStunned(EnSsh* this) { if (this->stunTimer == 0) { this->stateFlags |= SSH_STATE_ATTACKED; this->stunTimer = 120; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; } } @@ -246,9 +288,9 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) { f32 yShift; s32 i; - radius = this->colSph.list[0].dim.modelSphere.radius; + radius = this->colSph.elements[0].dim.modelSphere.radius; radius *= scale; - this->colSph.list[0].dim.modelSphere.radius = radius; + this->colSph.elements[0].dim.modelSphere.radius = radius; for (i = 0; i < 6; i++) { yShift = this->colCylinder[i].dim.yShift; @@ -263,7 +305,7 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) { this->colCylinder[i].dim.height = height; } Actor_SetScale(&this->actor, 0.04f * scale); - this->groundYoffset = 40.0f * scale; + this->floorHeightOffset = 40.0f * scale; this->colliderScale = scale * 1.5f; } @@ -292,18 +334,18 @@ void EnSsh_Turn(EnSsh* this, GlobalContext* globalCtx) { this->hitTimer--; } if (DECR(this->spinTimer) != 0) { - this->actor.posRot.rot.y += 10000.0f * (this->spinTimer / 30.0f); + this->actor.world.rot.y += 10000.0f * (this->spinTimer / 30.0f); } else if ((this->swayTimer == 0) && (this->stunTimer == 0)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x2710, 1); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnSsh_Stunned(EnSsh* this, GlobalContext* globalCtx) { if ((this->swayTimer == 0) && (this->stunTimer == 0)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink ^ 0x8000, 4, this->maxTurnRate, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer ^ 0x8000, 4, this->maxTurnRate, 1); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->stunTimer < 30) { if (this->stunTimer & 1) { this->actor.shape.rot.y += 0x7D0; @@ -347,16 +389,16 @@ s32 EnSsh_IsCloseToLink(EnSsh* this, GlobalContext* globalCtx) { return true; } - if (this->actor.xzDistToLink > 160.0f) { + if (this->actor.xzDistToPlayer > 160.0f) { return false; } - yDist = this->actor.posRot.pos.y - player->actor.posRot.pos.y; + yDist = this->actor.world.pos.y - player->actor.world.pos.y; if (yDist < 0.0f || yDist > 400.0f) { return false; } - if (player->actor.posRot.pos.y < this->actor.groundY) { + if (player->actor.world.pos.y < this->actor.floorHeight) { return false; } return true; @@ -364,9 +406,9 @@ s32 EnSsh_IsCloseToLink(EnSsh* this, GlobalContext* globalCtx) { s32 EnSsh_IsCloseToHome(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.posRot.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; - if (nextY >= this->actor.initPosRot.pos.y) { + if (nextY >= this->actor.home.pos.y) { return 1; } return 0; @@ -374,9 +416,9 @@ s32 EnSsh_IsCloseToHome(EnSsh* this) { s32 EnSsh_IsCloseToGround(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.posRot.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; - if ((nextY - this->actor.groundY) <= this->groundYoffset) { + if ((nextY - this->actor.floorHeight) <= this->floorHeightOffset) { return 1; } return 0; @@ -396,33 +438,33 @@ void EnSsh_Sway(EnSsh* this) { } temp = this->swayTimer * (1.0f / 6); swayAngle = temp * (0x10000 / 360.0f) * Math_SinS(this->swayAngle); - temp = this->actor.posRot.pos.y - this->ceilingPos.y; + temp = this->actor.world.pos.y - this->ceilingPos.y; swayVecBase.x = Math_SinS(swayAngle) * temp; swayVecBase.y = Math_CosS(swayAngle) * temp; swayVecBase.z = 0.0f; Matrix_Push(); Matrix_Translate(this->ceilingPos.x, this->ceilingPos.y, this->ceilingPos.z, MTXMODE_NEW); - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_MultVec3f(&swayVecBase, &swayVec); Matrix_Pull(); this->actor.shape.rot.z = -(swayAngle * 2); - this->actor.posRot.pos.x = swayVec.x; - this->actor.posRot.pos.z = swayVec.z; + this->actor.world.pos.x = swayVec.x; + this->actor.world.pos.z = swayVec.z; } } void EnSsh_CheckBodyStickHit(EnSsh* this, GlobalContext* globalCtx) { - ColliderBody* body = &this->colCylinder[0].body; + ColliderInfo* info0 = &this->colCylinder[0].info; Player* player = PLAYER; if (player->unk_860 != 0) { - body->bumper.flags |= 2; - this->colCylinder[1].body.bumper.flags &= ~2; - this->colCylinder[2].body.bumper.flags &= ~2; + info0->bumper.dmgFlags |= 2; + this->colCylinder[1].info.bumper.dmgFlags &= ~2; + this->colCylinder[2].info.bumper.dmgFlags &= ~2; } else { - body->bumper.flags &= ~2; - this->colCylinder[1].body.bumper.flags |= 2; - this->colCylinder[2].body.bumper.flags |= 2; + info0->bumper.dmgFlags &= ~2; + this->colCylinder[1].info.bumper.dmgFlags |= 2; + this->colCylinder[2].info.bumper.dmgFlags |= 2; } } @@ -434,8 +476,8 @@ s32 EnSsh_CheckHitLink(EnSsh* this, GlobalContext* globalCtx) { return false; } for (i = 0; i < 3; i++) { - if (this->colCylinder[i + 3].base.maskB & 1) { - this->colCylinder[i + 3].base.maskB &= ~1; + if (this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) { + this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER; hit = true; } } @@ -449,7 +491,7 @@ s32 EnSsh_CheckHitLink(EnSsh* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_ROLL); Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_ATTACK); globalCtx->damagePlayer(globalCtx, -8); - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->hitCount--; return true; } @@ -460,10 +502,10 @@ s32 EnSsh_CheckHitFront(EnSsh* this) { if (this->colCylinder[2].base.acFlags) {} // Needed for matching acFlags = this->colCylinder[2].base.acFlags; - if (!!(acFlags & 2) == 0) { + if (!!(acFlags & AC_HIT) == 0) { return 0; } else { - this->colCylinder[2].base.acFlags &= ~2; + this->colCylinder[2].base.acFlags &= ~AC_HIT; this->invincibilityTimer = 8; if ((this->swayTimer == 0) && (this->hitTimer == 0) && (this->stunTimer == 0)) { this->swayTimer = 60; @@ -476,13 +518,13 @@ s32 EnSsh_CheckHitBack(EnSsh* this, GlobalContext* globalCtx) { ColliderCylinder* cyl = &this->colCylinder[0]; s32 hit = false; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; } cyl = &this->colCylinder[1]; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; } if (!hit) { @@ -523,18 +565,18 @@ s32 EnSsh_CollisionCheck(EnSsh* this, GlobalContext* globalCtx) { } void EnSsh_SetBodyCylinderAC(EnSsh* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[0]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[0].base); } void EnSsh_SetLegsCylinderAC(EnSsh* this, GlobalContext* globalCtx) { - s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); if (angleTowardsLink < 90 * (0x10000 / 360)) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[2]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[2].base); } else { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[1]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[1].base); } } @@ -549,7 +591,7 @@ s32 EnSsh_SetCylinderOC(EnSsh* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - cylPos = this->actor.posRot.pos; + cylPos = this->actor.world.pos; cyloffsets[i].x *= this->colliderScale; cyloffsets[i].y *= this->colliderScale; cyloffsets[i].z *= this->colliderScale; @@ -596,7 +638,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060052E0, NULL, this->jointTable, this->morphTable, 30); Animation_Change(&this->skelAnime, &D_06000304, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, 0.0f); this->blureIdx = EnSsh_CreateBlureEffect(globalCtx); @@ -610,7 +652,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) { EnSsh_SetColliderScale(this, 0.75f, 1.0f); } this->actor.gravity = 0.0f; - this->initialYaw = this->actor.posRot.rot.y; + this->initialYaw = this->actor.world.rot.y; EnSsh_SetupAction(this, EnSsh_Start); } @@ -707,7 +749,7 @@ void EnSsh_Land(EnSsh* this, GlobalContext* globalCtx) { if ((this->animTimer != 0) && (DECR(this->animTimer) == 0)) { EnSsh_SetAnimation(this, SSH_ANIM_WAIT); } - if ((this->actor.groundY + this->groundYoffset) <= this->actor.posRot.pos.y) { + if ((this->actor.floorHeight + this->floorHeightOffset) <= this->actor.world.pos.y) { EnSsh_SetupAction(this, EnSsh_Idle); } else { Math_SmoothStepToF(&this->actor.velocity.y, 2.0f, 0.6f, 1000.0f, 0.0f); @@ -795,7 +837,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { } else { SkelAnime_Update(&this->skelAnime); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); } EnSsh_UpdateYaw(this, globalCtx); @@ -807,7 +849,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { this->blinkState = 0; } EnSsh_SetColliders(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } s32 EnSsh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { @@ -845,7 +887,7 @@ s32 EnSsh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnSsh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnSsh* this = THIS; - func_800628A4(limbIndex, &this->colSph); + Collider_UpdateSpheres(limbIndex, &this->colSph); } void EnSsh_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index af1f411fe1..df81956296 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -16,7 +16,7 @@ typedef struct EnSsh { /* 0x02F8 */ EnSshActionFunc actionFunc; /* 0x02FC */ ColliderCylinder colCylinder[6]; /* 0x04C4 */ ColliderJntSph colSph; - /* 0x04E4 */ ColliderJntSphItem colSphElements[1]; + /* 0x04E4 */ ColliderJntSphElement colSphElements[1]; /* 0x0524 */ s16 initialYaw; /* 0x0526 */ s16 maxTurnRate; /* 0x0528 */ s16 unkTimer; @@ -29,7 +29,7 @@ typedef struct EnSsh { /* 0x0536 */ s16 swayTimer; /* 0x0538 */ s32 blureIdx; /* 0x053C */ f32 colliderScale; - /* 0x0540 */ f32 groundYoffset; + /* 0x0540 */ f32 floorHeightOffset; /* 0x0544 */ Vec3f ceilingPos; /* 0x0558 */ char unk_558[0x78]; /* 0x05C8 */ s16 swayAngle; diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 84a190fac8..d864bb2092 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -38,7 +38,7 @@ static Gfx sUnusedDList[] = { const ActorInit En_St_InitVars = { ACTOR_EN_ST, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ST, sizeof(EnSt), @@ -49,30 +49,72 @@ const ActorInit En_St_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 32, 50, -24, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 2, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 2, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK6, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 60, -30, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 1, { { 0, -240, 0 }, 28 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; extern SkeletonHeader D_06005298; @@ -105,12 +147,12 @@ void EnSt_SpawnDust(EnSt* this, GlobalContext* globalCtx, s32 dustCnt) { s32 i; yAngle = (Rand_ZeroOne() - 0.5f) * 65536.0f; - dustPos.y = this->actor.groundY; + dustPos.y = this->actor.floorHeight; for (i = dustCnt; i >= 0; i--, yAngle += (s16)(0x10000 / dustCnt)) { dustAccel.x = (Rand_ZeroOne() - 0.5f) * 4.0f; dustAccel.z = (Rand_ZeroOne() - 0.5f) * 4.0f; - dustPos.x = this->actor.posRot.pos.x + (Math_SinS(yAngle) * 22.0f); - dustPos.z = this->actor.posRot.pos.z + (Math_CosS(yAngle) * 22.0f); + dustPos.x = this->actor.world.pos.x + (Math_SinS(yAngle) * 22.0f); + dustPos.z = this->actor.world.pos.z + (Math_CosS(yAngle) * 22.0f); func_8002836C(globalCtx, &dustPos, &dustVel, &dustAccel, &primColor, &envColor, 120, 40, 10); } } @@ -119,9 +161,9 @@ void EnSt_SpawnBlastEffect(EnSt* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f blastPos; - blastPos.x = this->actor.posRot.pos.x; - blastPos.y = this->actor.groundY; - blastPos.z = this->actor.posRot.pos.z; + blastPos.x = this->actor.world.pos.x; + blastPos.y = this->actor.floorHeight; + blastPos.z = this->actor.world.pos.z; EffectSsBlast_SpawnWhiteCustomScale(globalCtx, &blastPos, &zeroVec, &zeroVec, 100, 220, 8); } @@ -130,9 +172,9 @@ void EnSt_SpawnDeadEffect(EnSt* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f firePos; - firePos.x = this->actor.posRot.pos.x + ((Rand_ZeroOne() - 0.5f) * 60.0f); - firePos.y = (this->actor.posRot.pos.y + 10.0f) + ((Rand_ZeroOne() - 0.5f) * 45.0f); - firePos.z = this->actor.posRot.pos.z + ((Rand_ZeroOne() - 0.5f) * 60.0f); + firePos.x = this->actor.world.pos.x + ((Rand_ZeroOne() - 0.5f) * 60.0f); + firePos.y = (this->actor.world.pos.y + 10.0f) + ((Rand_ZeroOne() - 0.5f) * 45.0f); + firePos.z = this->actor.world.pos.z + ((Rand_ZeroOne() - 0.5f) * 60.0f); EffectSsDeadDb_Spawn(globalCtx, &firePos, &zeroVec, &zeroVec, 100, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, true); } @@ -169,14 +211,14 @@ s32 EnSt_CheckCeilingPos(EnSt* this, GlobalContext* globalCtx) { s32 bgId; Vec3f checkPos; - checkPos.x = this->actor.posRot.pos.x; - checkPos.y = this->actor.posRot.pos.y + 1000.0f; - checkPos.z = this->actor.posRot.pos.z; - if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &checkPos, &this->ceilingPos, &poly, 0, 0, + checkPos.x = this->actor.world.pos.x; + checkPos.y = this->actor.world.pos.y + 1000.0f; + checkPos.z = this->actor.world.pos.z; + if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &checkPos, &this->ceilingPos, &poly, 0, 0, 1, 1, &bgId)) { return false; } - this->unusedPos = this->actor.posRot.pos; + this->unusedPos = this->actor.world.pos; this->unusedPos.y -= 100.0f; return true; } @@ -216,7 +258,7 @@ void EnSt_SetReturnToCeilingAnimation(EnSt* this) { } void EnSt_SetLandAnimation(EnSt* this) { - this->actor.posRot.pos.y = this->actor.groundY + this->groundYOffset; + this->actor.world.pos.y = this->actor.floorHeight + this->floorHeightOffset; func_80034EC0(&this->skelAnime, sAnimations, 4); this->sfxTimer = 0; this->animFrames = this->skelAnime.animLength; @@ -247,47 +289,47 @@ void EnSt_InitColliders(EnSt* this, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colCylinder[i], &this->actor, cylinders[i]); } - this->colCylinder[0].body.bumper.flags = 0x0003F8F9; - this->colCylinder[1].body.bumper.flags = 0xFFC00706; - this->colCylinder[2].base.type = 9; - this->colCylinder[2].body.bumperFlags = 0xD; - this->colCylinder[2].body.flags = 2; - this->colCylinder[2].body.bumper.flags = 0xFFCC0706; + this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8F9; + this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00706; + this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO; + this->colCylinder[2].info.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0706; - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit); Collider_InitJntSph(globalCtx, &this->colSph); Collider_SetJntSph(globalCtx, &this->colSph, &this->actor, &sJntSphInit, this->colSphItems); } void EnSt_CheckBodyStickHit(EnSt* this, GlobalContext* globalCtx) { - ColliderBody* body = &this->colCylinder[0].body; + ColliderInfo* body = &this->colCylinder[0].info; Player* player = PLAYER; if (player->unk_860 != 0) { - body->bumper.flags |= 2; - this->colCylinder[1].body.bumper.flags &= ~2; - this->colCylinder[2].body.bumper.flags &= ~2; + body->bumper.dmgFlags |= 2; + this->colCylinder[1].info.bumper.dmgFlags &= ~2; + this->colCylinder[2].info.bumper.dmgFlags &= ~2; } else { - body->bumper.flags &= ~2; - this->colCylinder[1].body.bumper.flags |= 2; - this->colCylinder[2].body.bumper.flags |= 2; + body->bumper.dmgFlags &= ~2; + this->colCylinder[1].info.bumper.dmgFlags |= 2; + this->colCylinder[2].info.bumper.dmgFlags |= 2; } } void EnSt_SetBodyCylinderAC(EnSt* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[0]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[0].base); } void EnSt_SetLegsCylinderAC(EnSt* this, GlobalContext* globalCtx) { - s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); if (angleTowardsLink < 0x3FFC) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[2]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[2].base); } else { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[1]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[1].base); } } @@ -302,7 +344,7 @@ s32 EnSt_SetCylinderOC(EnSt* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - cylPos = this->actor.posRot.pos; + cylPos = this->actor.world.pos; cyloffsets[i].x *= this->colliderScale; cyloffsets[i].y *= this->colliderScale; cyloffsets[i].z *= this->colliderScale; @@ -342,10 +384,10 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) { s32 i; for (i = 0, hit = 0; i < 3; i++) { - if (((this->colCylinder[i + 3].base.maskB & 1) != 0) == 0) { + if (((this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) != 0) == 0) { continue; } - this->colCylinder[i + 3].base.maskB &= ~0x1; + this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER; hit = true; } @@ -360,18 +402,18 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) { this->gaveDamageSpinTimer = 30; globalCtx->damagePlayer(globalCtx, -8); Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); return true; } s32 EnSt_CheckHitFrontside(EnSt* this) { u8 acFlags = this->colCylinder[2].base.acFlags; - if (!!(acFlags & 2) == 0) { + if (!!(acFlags & AC_HIT) == 0) { // not hit return false; } else { - this->colCylinder[2].base.acFlags &= ~0x2; + this->colCylinder[2].base.acFlags &= ~AC_HIT; this->invulnerableTimer = 8; this->playSwayFlag = 0; this->swayTimer = 60; @@ -384,17 +426,17 @@ s32 EnSt_CheckHitBackside(EnSt* this, GlobalContext* globalCtx) { s32 flags = 0; // ac hit flags from colliders 0 and 1 s32 hit = false; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->body.acHitItem->toucher.flags; + flags |= cyl->info.acHitInfo->toucher.dmgFlags; } cyl = &this->colCylinder[1]; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->body.acHitItem->toucher.flags; + flags |= cyl->info.acHitInfo->toucher.dmgFlags; } if (!hit) { @@ -475,9 +517,9 @@ void EnSt_SetColliderScale(EnSt* this) { scaleAmount = 1.4f; } - radius = this->colSph.list[0].dim.modelSphere.radius; + radius = this->colSph.elements[0].dim.modelSphere.radius; radius *= scaleAmount; - this->colSph.list[0].dim.modelSphere.radius = radius; + this->colSph.elements[0].dim.modelSphere.radius = radius; for (i = 0; i < 6; i++) { yShift = this->colCylinder[i].dim.yShift; @@ -493,7 +535,7 @@ void EnSt_SetColliderScale(EnSt* this) { } Actor_SetScale(&this->actor, 0.04f * scaleAmount); this->colliderScale = scaleAmount; - this->groundYOffset = 32.0f * scaleAmount; + this->floorHeightOffset = 32.0f * scaleAmount; } s32 EnSt_SetTeethColor(EnSt* this, s16 redTarget, s16 greenTarget, s16 blueTarget, s16 minMaxStep) { @@ -579,7 +621,7 @@ void EnSt_UpdateYaw(EnSt* this, GlobalContext* globalCtx) { // calculate the new yaw to or away from the player. rot = this->actor.shape.rot; - yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsLink : this->initalYaw); + yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsPlayer : this->initalYaw); yawDiff = rot.y - (yawTarget ^ yawDir); if (ABS(yawDiff) <= 0x4000) { Math_SmoothStepToS(&rot.y, yawTarget ^ yawDir, 4, 0x2000, 1); @@ -587,7 +629,7 @@ void EnSt_UpdateYaw(EnSt* this, GlobalContext* globalCtx) { rot.y += 0x2000; } - this->actor.shape.rot = this->actor.posRot.rot = rot; + this->actor.shape.rot = this->actor.world.rot = rot; // Do the shaking animation. if (yawDir == 0 && this->rotAwayTimer < 0xA) { @@ -651,19 +693,19 @@ s32 EnSt_IsCloseToPlayer(EnSt* this, GlobalContext* globalCtx) { if (this->takeDamageSpinTimer != 0) { // skull is spinning from damage. return false; - } else if (this->actor.xzDistToLink > 160.0f) { + } else if (this->actor.xzDistToPlayer > 160.0f) { // player is more than 160 xz units from the skulltulla return false; } - yDist = this->actor.posRot.pos.y - player->actor.posRot.pos.y; + yDist = this->actor.world.pos.y - player->actor.world.pos.y; if (yDist < 0.0f || yDist > 400.0f) { // player is above the skulltulla or more than 400 units below // the skulltulla return false; } - if (player->actor.posRot.pos.y < this->actor.groundY) { + if (player->actor.world.pos.y < this->actor.floorHeight) { // player is below the Skulltulla's ground position return false; } @@ -672,9 +714,9 @@ s32 EnSt_IsCloseToPlayer(EnSt* this, GlobalContext* globalCtx) { s32 EnSt_IsCloseToInitalPos(EnSt* this) { f32 velY = this->actor.velocity.y; - f32 checkY = this->actor.posRot.pos.y + (velY * 2.0f); + f32 checkY = this->actor.world.pos.y + (velY * 2.0f); - if (checkY >= this->actor.initPosRot.pos.y) { + if (checkY >= this->actor.home.pos.y) { return true; } return false; @@ -682,9 +724,9 @@ s32 EnSt_IsCloseToInitalPos(EnSt* this) { s32 EnSt_IsCloseToGround(EnSt* this) { f32 velY = this->actor.velocity.y; - f32 checkY = this->actor.posRot.pos.y + (velY * 2.0f); + f32 checkY = this->actor.world.pos.y + (velY * 2.0f); - if (checkY - this->actor.groundY <= this->groundYOffset) { + if (checkY - this->actor.floorHeight <= this->floorHeightOffset) { return true; } return false; @@ -727,12 +769,12 @@ void EnSt_Sway(EnSt* this) { amtToTranslate.z = 0.0f; Matrix_Push(); Matrix_Translate(this->ceilingPos.x, this->ceilingPos.y, this->ceilingPos.z, MTXMODE_NEW); - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 32768.0f), MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 32768.0f), MTXMODE_APPLY); Matrix_MultVec3f(&amtToTranslate, &translatedPos); Matrix_Pull(); this->actor.shape.rot.z = -(rotAngle * 2); - this->actor.posRot.pos.x = translatedPos.x; - this->actor.posRot.pos.z = translatedPos.z; + this->actor.world.pos.x = translatedPos.x; + this->actor.world.pos.z = translatedPos.z; } } @@ -740,7 +782,7 @@ void EnSt_Init(Actor* thisx, GlobalContext* globalCtx) { EnSt* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 14.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005298, NULL, this->jointTable, this->morphTable, 30); func_80034EC0(&this->skelAnime, sAnimations, 0); this->blureIdx = EnSt_CreateBlureEffect(globalCtx); @@ -758,7 +800,7 @@ void EnSt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x1000000; EnSt_SetColliderScale(this); this->actor.gravity = 0.0f; - this->initalYaw = this->actor.posRot.rot.y; + this->initalYaw = this->actor.world.rot.y; EnSt_SetupAction(this, EnSt_StartOnCeilingOrGround); } @@ -839,7 +881,7 @@ void EnSt_LandOnGround(EnSt* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_DOWN_SET); } - if ((this->actor.groundY + this->groundYOffset) < this->actor.posRot.pos.y) { + if ((this->actor.floorHeight + this->floorHeightOffset) < this->actor.world.pos.y) { // the skulltulla has hit the ground. this->sfxTimer = 0; EnSt_SetupAction(this, EnSt_WaitOnGround); @@ -896,18 +938,18 @@ void EnSt_ReturnToCeiling(EnSt* this, GlobalContext* globalCtx) { * The skulltulla has been killed, bounce around */ void EnSt_BounceAround(EnSt* this, GlobalContext* globalCtx) { - this->actor.dmgEffectTimer = this->deathTimer; + this->actor.colorFilterTimer = this->deathTimer; func_8002D868(&this->actor); - this->actor.posRot.rot.x += 0x800; - this->actor.posRot.rot.z -= 0x800; - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.world.rot.x += 0x800; + this->actor.world.rot.z -= 0x800; + this->actor.shape.rot = this->actor.world.rot; if (EnSt_IsDoneBouncing(this, globalCtx)) { - this->actor.shape.unk_08 = 400.0f; + this->actor.shape.yOffset = 400.0f; this->actor.speedXZ = 1.0f; this->actor.gravity = -2.0f; EnSt_SetupAction(this, EnSt_FinishBouncing); } else { - Math_SmoothStepToF(&this->actor.shape.unk_08, 400.0f, 0.4f, 10000.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 400.0f, 0.4f, 10000.0f, 0.0f); } } @@ -925,15 +967,15 @@ void EnSt_FinishBouncing(EnSt* this, GlobalContext* globalCtx) { } if (DECR(this->setTargetYawTimer) == 0) { - this->deathYawTarget = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->deathYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->setTargetYawTimer = 8; } - Math_SmoothStepToS(&this->actor.posRot.rot.x, 0x3FFC, 4, 0x2710, 1); - Math_SmoothStepToS(&this->actor.posRot.rot.z, 0, 4, 0x2710, 1); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->deathYawTarget, 0xA, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.x, 0x3FFC, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.z, 0, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->deathYawTarget, 0xA, 0x2710, 1); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; func_8002D868(&this->actor); this->groundBounces = 2; @@ -947,7 +989,7 @@ void EnSt_Die(EnSt* this, GlobalContext* globalCtx) { if (DECR(this->finishDeathTimer) != 0) { EnSt_SpawnDeadEffect(this, globalCtx); } else { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -982,7 +1024,7 @@ void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002D7EC(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((this->stunTimer == 0) && (this->swayTimer == 0)) { // run the current action if the skulltulla isn't stunned @@ -1006,7 +1048,7 @@ void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) { EnSt_SetTeethColor(this, color.r, color.g, color.b, 8); EnSt_UpdateCylinders(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } } @@ -1037,7 +1079,7 @@ s32 EnSt_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dListP, void EnSt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dListP, Vec3s* rot, void* thisx) { EnSt* this = THIS; - func_800628A4(limbIndex, &this->colSph); + Collider_UpdateSpheres(limbIndex, &this->colSph); } void EnSt_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index c969c5450b..ad2d435afc 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -14,7 +14,7 @@ typedef struct EnSt { /* 0x0190 */ EnStActionFunc actionFunc; /* 0x0194 */ ColliderCylinder colCylinder[6]; /* 0x035C */ ColliderJntSph colSph; - /* 0x037C */ ColliderJntSphItem colSphItems[1]; + /* 0x037C */ ColliderJntSphElement colSphItems[1]; /* 0x03BC */ s16 initalYaw; /* 0x03BE */ s16 deathYawTarget; /* 0x03C0 */ s16 groundBounces; @@ -41,7 +41,7 @@ typedef struct EnSt { /* 0x03FC */ char unk_3FC[0x8]; /* 0x0404 */ s32 blureIdx; /* 0x0408 */ f32 colliderScale; - /* 0x040C */ f32 groundYOffset; + /* 0x040C */ f32 floorHeightOffset; /* 0x0410 */ s16 swayAngle; /* 0x0412 */ Vec3s jointTable[30]; /* 0x04C6 */ Vec3s morphTable[30]; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 1db2c5fd02..e7a81cb505 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -11,7 +11,7 @@ void EnSth_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sth_InitVars = { ACTOR_EN_STH, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSth), @@ -20,6 +20,26 @@ const ActorInit En_Sth_InitVars = { (ActorFunc)EnSth_Update, NULL, }; + +static ColliderCylinderInit D_80B0B404 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07540.s") diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 52f3af44b5..5c12e729e3 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -20,7 +20,7 @@ extern Gfx D_06000950[]; const ActorInit En_Stream_InitVars = { ACTOR_EN_STREAM, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_STREAM, sizeof(EnStream), @@ -91,16 +91,16 @@ void EnStream_SuckPlayer(EnStream* this, GlobalContext* globalCtx) { s32 pad30; s32 pad2C; - if (func_80B0B81C(&this->actor.posRot.pos, &player->actor.posRot.pos, &posDifference, this->actor.scale.y) != 0) { + if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &posDifference, this->actor.scale.y) != 0) { xzDist = sqrtf(SQ(posDifference.x) + SQ(posDifference.z)); - yDistWithOffset = player->actor.posRot.pos.y - (this->actor.posRot.pos.y - 90.0f); + yDistWithOffset = player->actor.world.pos.y - (this->actor.world.pos.y - 90.0f); player->windDirection = Math_FAtan2F(-posDifference.x, -posDifference.z) * 10430.378f; if (xzDist > 3.0f) { Math_SmoothStepToF(&player->windSpeed, 3.0f, 0.5f, xzDist, 0.0f); } else { player->windSpeed = 0.0f; - Math_SmoothStepToF(&player->actor.posRot.pos.x, this->actor.posRot.pos.x, 0.5f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->actor.posRot.pos.z, this->actor.posRot.pos.z, 0.5f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 0.5f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 0.5f, 3.0f, 0.0f); } if (yDistWithOffset > 0.0f) { Math_SmoothStepToF(&player->actor.velocity.y, -3.0f, 0.7f, yDistWithOffset, 0.0f); @@ -118,7 +118,7 @@ void EnStream_WaitForPlayer(EnStream* this, GlobalContext* globalCtx) { s16 pad; Vec3f temp; - if (func_80B0B81C(&this->actor.posRot.pos, &player->actor.posRot.pos, &temp, this->actor.scale.y) != 0) { + if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &temp, this->actor.scale.y) != 0) { EnStream_SetupAction(this, EnStream_SuckPlayer); } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index b6d30505d8..b547c8f41f 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06005298; /* const ActorInit En_Sw_InitVars = { ACTOR_EN_SW, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ST, sizeof(EnSw), @@ -34,6 +34,33 @@ const ActorInit En_Sw_InitVars = { (ActorFunc)EnSw_Update, (ActorFunc)EnSw_Draw, }; + +static ColliderJntSphElementInit D_80B0F040[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFC3FFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 2, { { 0, -300, 0 }, 21 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B0F064 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80B0F040, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0BDB0.s") diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index a4895c1b06..c51f5065b9 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -31,7 +31,7 @@ void EnSyatekiItm_EndGame(EnSyatekiItm* this, GlobalContext* globalCtx); const ActorInit En_Syateki_Itm_InitVars = { ACTOR_EN_SYATEKI_ITM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSyatekiItm), @@ -105,12 +105,12 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->signal == ENSYATEKI_START) { - player->actor.posRot.pos.x = -12.0f; - player->actor.posRot.pos.y = 20.0f; - player->actor.posRot.pos.z = 182.0f; - player->currentYaw = player->actor.posRot.rot.y = player->actor.shape.rot.y = 0x7F03; - player->actor.posRot.rot.x = player->actor.shape.rot.x = player->actor.posRot.rot.z = - player->actor.shape.rot.z = 0; + player->actor.world.pos.x = -12.0f; + player->actor.world.pos.y = 20.0f; + player->actor.world.pos.z = 182.0f; + player->currentYaw = player->actor.world.rot.y = player->actor.shape.rot.y = 0x7F03; + player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = + 0; func_8008EF44(globalCtx, 15); this->roundNum = this->hitCount = 0; for (i = 0; i < 6; i++) { @@ -346,8 +346,8 @@ void EnSyatekiItm_Update(Actor* thisx, GlobalContext* globalCtx) { this->unkTimer--; } if (BREG(0)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 4ab59cd0ad..ebb2ec4875 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -49,7 +49,7 @@ extern FlexSkeletonHeader D_06009B38; const ActorInit En_Syateki_Man_InitVars = { ACTOR_EN_SYATEKI_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OSSAN, sizeof(EnSyatekiMan), @@ -77,7 +77,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Old man appeared!! Muhohohohohohohon osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親父登場!!むほほほほほほほーん ☆☆☆☆☆ \n" VT_RST); - this->actor.unk_1F = 1; + this->actor.targetMode = 1; Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009B38, &D_06000338, this->jointTable, this->morphTable, 9); if (LINK_IS_CHILD) { @@ -86,7 +86,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { this->blinkTimer = 20; this->eyeState = 0; this->blinkFunc = EnSyatekiMan_BlinkWait; - this->actor.colChkInfo.unk_10 = 100; + this->actor.colChkInfo.cylRadius = 100; this->actionFunc = EnSyatekiMan_Start; } @@ -389,9 +389,9 @@ void EnSyatekiMan_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); EnSyatekiMan_SetBgm(); this->blinkFunc(this); - this->actor.posRot2.pos.y = 70.0f; - Actor_SetHeight(&this->actor, 70.0f); - func_80038290(globalCtx, &this->actor, &this->headRot, &this->bodyRot, this->actor.posRot2.pos); + this->actor.focus.pos.y = 70.0f; + Actor_SetFocus(&this->actor, 70.0f); + func_80038290(globalCtx, &this->actor, &this->headRot, &this->bodyRot, this->actor.focus.pos); } s32 func_80B1148C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 755e71db59..28e09b4e6b 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -34,7 +34,7 @@ extern FlexSkeletonHeader D_06002530; const ActorInit En_Syateki_Niw_InitVars = { ACTOR_EN_SYATEKI_NIW, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NIW, sizeof(EnSyatekiNiw), @@ -45,15 +45,29 @@ const ActorInit En_Syateki_Niw_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK5, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 20, 4, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -61,7 +75,7 @@ void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags &= ~1; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); this->unk_29E = this->actor.params; @@ -80,12 +94,12 @@ void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Bomb chicken osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ボムにわ! ☆☆☆☆☆ \n" VT_RST); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); } - this->unk_2DC = this->actor.posRot.pos; - this->unk_2E8 = this->actor.posRot.pos; + this->unk_2DC = this->actor.world.pos; + this->unk_2E8 = this->actor.world.pos; this->actionFunc = func_80B11DEC; } @@ -301,11 +315,11 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { } if (this->unk_25C != 0) { sp4A = 1; - Math_ApproachF(&this->actor.posRot.pos.x, this->unk_2E8.x, 1.0f, this->unk_2C8.y); - Math_ApproachF(&this->actor.posRot.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y); + Math_ApproachF(&this->actor.world.pos.x, this->unk_2E8.x, 1.0f, this->unk_2C8.y); + Math_ApproachF(&this->actor.world.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y); Math_ApproachF(&this->unk_2C8.y, 3.0f, 1.0f, 0.3f); - tmpf1 = this->unk_2E8.x - this->actor.posRot.pos.x; - tmpf2 = this->unk_2E8.z - this->actor.posRot.pos.z; + tmpf1 = this->unk_2E8.x - this->actor.world.pos.x; + tmpf2 = this->unk_2E8.z - this->actor.world.pos.z; if (fabsf(tmpf1) < 10.0f) { tmpf1 = 0; @@ -320,7 +334,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { this->unk_294 = 7; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(tmpf1, tmpf2) * 10430.378f, 3, this->unk_2C8.z, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(tmpf1, tmpf2) * 10430.378f, 3, this->unk_2C8.z, 0); Math_ApproachF(&this->unk_2C8.z, 10000.0f, 1.0f, 1000.0f); } @@ -332,7 +346,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { if ((globalCtx->gameplayFrames % 4) == 0) { dustVelocity.y = Rand_CenteredFloat(5.0f); dustAccel.y = 0.2f; - dustPos = this->actor.posRot.pos; + dustPos = this->actor.world.pos; func_8002836C(globalCtx, &dustPos, &dustVelocity, &dustAccel, &dustPrimColor, &dustEnvColor, 600, 40, 30); } } @@ -380,7 +394,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { } phi_f16 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; - if (this->actor.posRot.pos.z > 100.0f) { + if (this->actor.world.pos.z > 100.0f) { this->actor.speedXZ = 2.0f; this->actor.gravity = -0.3f; this->actor.velocity.y = 5.0f; @@ -389,11 +403,11 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; case 2: - if ((player->actor.posRot.pos.z - 40.0f) < this->actor.posRot.pos.z) { + if ((player->actor.world.pos.z - 40.0f) < this->actor.world.pos.z) { this->actor.speedXZ = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.posRot.pos.z > 110.0f)) { + if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->unk_284 = 0.0f; @@ -410,7 +424,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; case 3: - if ((player->actor.posRot.pos.z - 50.0f) < this->actor.posRot.pos.z) { + if ((player->actor.world.pos.z - 50.0f) < this->actor.world.pos.z) { this->actor.speedXZ = 0.0f; this->unk_262 = 0x3C; this->unk_25A = 0x14; @@ -444,7 +458,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { this->actor.speedXZ = 1.0f; } - if ((this->unk_25A == 0) && ((player->actor.posRot.pos.z - 30.0f) < this->actor.posRot.pos.z)) { + if ((this->unk_25A == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) { Audio_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_25E = 0x14; @@ -465,9 +479,9 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, - (s16)(Math_FAtan2F(player->actor.posRot.pos.x - this->actor.posRot.pos.x, - player->actor.posRot.pos.z - this->actor.posRot.pos.z) * + Math_SmoothStepToS(&this->actor.world.rot.y, + (s16)(Math_FAtan2F(player->actor.world.pos.x - this->actor.world.pos.x, + player->actor.world.pos.z - this->actor.world.pos.z) * 10430.378f) + phi_f16, 5, this->unk_2C8.y, 0); @@ -490,7 +504,7 @@ void func_80B128F8(EnSyatekiNiw* this, GlobalContext* globalCtx) { s16 sp26; s16 sp24; - Actor_SetHeight(&this->actor, this->unk_2D4); + Actor_SetFocus(&this->actor, this->unk_2D4); func_8002F374(globalCtx, &this->actor, &sp26, &sp24); if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) && (sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) { @@ -510,7 +524,7 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) { s16 sp2C; f32 tmpf2; - Actor_SetHeight(&this->actor, this->unk_2D4); + Actor_SetFocus(&this->actor, this->unk_2D4); func_8002F374(globalCtx, &this->actor, &sp2E, &sp2C); if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) || (sp2C > SCREEN_HEIGHT)) { @@ -530,14 +544,14 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) { phi_f2 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; tmpf2 = this->unk_2D8 + phi_f2; - Math_SmoothStepToS(&this->actor.posRot.rot.y, tmpf2, 3, this->unk_2C8.y, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->unk_2C8.y, 0); Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f); func_80B11A94(this, globalCtx, 2); } void func_80B12BA4(EnSyatekiNiw* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; switch (this->unk_29E) { case 0: if (this->unk_29C == 0) { @@ -606,18 +620,18 @@ void EnSyatekiNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_260--; } - this->actor.shape.rot = this->actor.posRot.rot; - this->actor.shape.unk_10 = 15.0f; + this->actor.shape.rot = this->actor.world.rot; + this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->unk_2A0 != 0) { for (i = 0; i < 20; i++) { - sp78.x = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.x; - sp78.y = Rand_CenteredFloat(10.0f) + (this->actor.posRot.pos.y + 20.0f); - sp78.z = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.z; + sp78.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x; + sp78.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 20.0f); + sp78.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z; sp6C.x = Rand_CenteredFloat(3.0f); sp6C.y = (Rand_ZeroFloat(2.0f) * 0.5f) + 2.0f; sp6C.z = Rand_CenteredFloat(3.0f); @@ -654,7 +668,7 @@ void EnSyatekiNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } if (i != 0) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 990290a587..01f6c19021 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -34,7 +34,7 @@ void func_80B16938(EnTa* this); const ActorInit En_Ta_InitVars = { ACTOR_EN_TA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TA, sizeof(EnTa), @@ -45,8 +45,22 @@ const ActorInit En_Ta_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -111,19 +125,19 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { EnTa* this = THIS; GlobalContext* globalCtx2 = globalCtx; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_0600B7B8, &D_06001C94, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx2, &this->collider); Collider_SetCylinder(globalCtx2, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_2E0 = 0; this->unk_2CE = 0; this->unk_2E2 = 0; this->unk_2B6 = 20; this->unk_2B0 = func_80B166CC; Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.velocity.y = -4.0f; this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; @@ -145,7 +159,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } break; case 2: @@ -179,7 +193,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } } else if (globalCtx2->sceneNum == SCENE_SOUKO) { osSyncPrintf(VT_FGCOL(CYAN) " ロンロン牧場の倉庫 の タロン\n" VT_RST); @@ -192,14 +206,14 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x10; this->unk_2C4[0] = this->unk_2C4[1] = this->unk_2C4[2] = 7; this->unk_2B8[0] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x + 5.0f, - this->actor.posRot.pos.y + 3.0f, this->actor.posRot.pos.z + 26.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 5.0f, + this->actor.world.pos.y + 3.0f, this->actor.world.pos.z + 26.0f, 0, 0, 0, 0xD); this->unk_2B8[1] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x - 20.0f, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z - 30.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x - 20.0f, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); this->unk_2B8[2] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x + 20.0f, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z - 30.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 20.0f, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); func_80B13AAC(this, globalCtx2); if (gSaveContext.eventInf[0] & 0x400) { @@ -219,7 +233,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } } } else { @@ -227,15 +241,15 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } break; } } void func_80B14248(EnTa* this) { - if (this->actor.shape.unk_10 > 36.0f) { - this->actor.shape.unk_10 -= 0.8f; + if (this->actor.shape.shadowScale > 36.0f) { + this->actor.shape.shadowScale -= 0.8f; } } @@ -260,8 +274,8 @@ s32 func_80B142F4(EnTa* this, GlobalContext* globalCtx, u16 textId) { this->actor.textId = textId; - if ((ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) && - (this->actor.xzDistToLink < 100.0f)) { + if ((ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) && + (this->actor.xzDistToPlayer < 100.0f)) { this->unk_2E0 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -402,7 +416,7 @@ void func_80B14818(EnTa* this, GlobalContext* globalCtx) { } void func_80B14898(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 0) { @@ -411,7 +425,7 @@ void func_80B14898(EnTa* this, GlobalContext* globalCtx) { } void func_80B1490C(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y += 0xC00; + this->actor.world.rot.y += 0xC00; this->actor.shape.rot.y += 0xC00; if (this->unk_2CC == 0) { @@ -421,7 +435,7 @@ void func_80B1490C(EnTa* this, GlobalContext* globalCtx) { } void func_80B1496C(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 0) { @@ -431,7 +445,7 @@ void func_80B1496C(EnTa* this, GlobalContext* globalCtx) { } void func_80B149F4(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y -= 0xD00; + this->actor.world.rot.y -= 0xD00; this->actor.shape.rot.y -= 0xD00; if (this->unk_2CC == 0) { @@ -441,7 +455,7 @@ void func_80B149F4(EnTa* this, GlobalContext* globalCtx) { } void func_80B14A54(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 20) { @@ -454,7 +468,7 @@ void func_80B14A54(EnTa* this, GlobalContext* globalCtx) { } void func_80B14AF4(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y -= 0xC00; + this->actor.world.rot.y -= 0xC00; this->actor.shape.rot.y -= 0xC00; if (this->unk_2CC == 0) { @@ -767,8 +781,8 @@ void func_80B1585C(EnTa* this, GlobalContext* globalCtx) { if (this->unk_2CC > 35) { for (i = 1; i < ARRAY_COUNT(this->unk_2B8); i++) { if (this->unk_2B8[i] != NULL) { - Math_SmoothStepToS(&this->unk_2B8[i]->actor.posRot.rot.y, i * -10000 - 3000, 2, 0x800, 0x100); - this->unk_2B8[i]->actor.shape.rot.y = this->unk_2B8[i]->actor.posRot.rot.y; + Math_SmoothStepToS(&this->unk_2B8[i]->actor.world.rot.y, i * -10000 - 3000, 2, 0x800, 0x100); + this->unk_2B8[i]->actor.shape.rot.y = this->unk_2B8[i]->actor.world.rot.y; } } } else if (this->unk_2CC == 35) { @@ -1140,10 +1154,10 @@ void EnTa_Update(Actor* thisx, GlobalContext* globalCtx) { EnTa* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->unk_260(this); this->unk_25C(this, globalCtx); @@ -1152,7 +1166,7 @@ void EnTa_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_2E0 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_2D4, &this->unk_2DA, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_2D4, &this->unk_2DA, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_2D4.x, 0, 6, 6200, 100); Math_SmoothStepToS(&this->unk_2D4.y, 0, 6, 6200, 100); @@ -1196,7 +1210,7 @@ void EnTa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnTa* this = THIS; if (limbIndex == 15) { - Matrix_MultVec3f(&D_80B16E7C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80B16E7C, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index d9b678c921..a0b9a62fc3 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -25,7 +25,7 @@ void func_80B17AC4(EnTakaraMan* this, GlobalContext* globalCtx); const ActorInit En_Takara_Man_InitVars = { ACTOR_EN_TAKARA_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TS, sizeof(EnTakaraMan), @@ -59,17 +59,17 @@ void EnTakaraMan_Init(Actor* thisx, GlobalContext* globalCtx) { globalCtx->actorCtx.flags.chest = 0; gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = -1; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004FE0, &D_06000498, this->jointTable, this->morphTable, 10); - thisx->posRot2.pos = thisx->posRot.pos; - this->pos = thisx->posRot.pos; - thisx->posRot.pos.x = 133.0f; - thisx->posRot.pos.y = -12.0f; - thisx->posRot.pos.z = 102.0f; + thisx->focus.pos = thisx->world.pos; + this->pos = thisx->world.pos; + thisx->world.pos.x = 133.0f; + thisx->world.pos.y = -12.0f; + thisx->world.pos.z = 102.0f; Actor_SetScale(&this->actor, 0.013f); this->height = 90.0f; this->originalRoomNum = thisx->room; thisx->room = -1; - thisx->posRot.rot.y = thisx->shape.rot.y = -0x4E20; - thisx->unk_1F = 1; + thisx->world.rot.y = thisx->shape.rot.y = -0x4E20; + thisx->targetMode = 1; this->actionFunc = func_80B176E0; } @@ -96,7 +96,7 @@ void func_80B1778C(EnTakaraMan* this, GlobalContext* globalCtx) { this->actionFunc = func_80B17B14; } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (globalCtx->roomCtx.curRoom.num == 6 && !this->unk_21A) { this->actor.textId = 0x6E; // "Great! You are a real gambler!" this->unk_21A = 1; @@ -187,8 +187,8 @@ void EnTakaraMan_Update(Actor* thisx, GlobalContext* globalCtx) { this->eyeTimer--; } - Actor_SetHeight(&this->actor, this->height); - func_80038290(globalCtx, &this->actor, &this->unk_22C, &this->unk_232, this->actor.posRot2.pos); + Actor_SetFocus(&this->actor, this->height); + func_80038290(globalCtx, &this->actor, &this->unk_22C, &this->unk_232, this->actor.focus.pos); if (this->eyeTimer == 0) { this->eyeTextureIdx++; if (this->eyeTextureIdx >= 2) { diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index aef58d5b72..6808f9646e 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -18,7 +18,7 @@ void func_80B1809C(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Tana_InitVars = { ACTOR_EN_TANA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SHOP_DUNGEN, sizeof(EnTana), diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 04d04cb2a4..ae069e51ec 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -64,7 +64,7 @@ extern UNK_TYPE D_0600E2B0; /* const ActorInit En_Test_InitVars = { ACTOR_EN_TEST, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SK2, sizeof(EnTest), @@ -73,6 +73,66 @@ const ActorInit En_Test_InitVars = { (ActorFunc)EnTest_Update, (ActorFunc)EnTest_Draw, }; + +static ColliderCylinderInit D_80864570 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 25, 65, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8086459C = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 70, -50, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_808645C8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_SetupAction.s") diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index 1e50abb903..7188b70fea 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600AE40; /* const ActorInit En_Tg_InitVars = { ACTOR_EN_TG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MU, sizeof(EnTg), @@ -30,6 +30,26 @@ const ActorInit En_Tg_InitVars = { (ActorFunc)EnTg_Update, (ActorFunc)EnTg_Draw, }; + +static ColliderCylinderInit D_80B18910 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 64, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tg/func_80B18360.s") diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index f7f39e9db9..fee2ec3a9f 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -92,7 +92,7 @@ extern u32 D_06002100; const ActorInit En_Tite_InitVars = { ACTOR_EN_TITE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_TITE, sizeof(EnTite), @@ -102,27 +102,71 @@ const ActorInit En_Tite_InitVars = { (ActorFunc)EnTite_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 0, { { 0, 1500, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static DamageTable sDamageTable[] = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF4, 0x02, 0x02, 0x02, - 0x02, 0xE0, 0xF3, 0xE0, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0xE), + /* Ice magic */ DMG_ENTRY(3, 0xF), + /* Light magic */ DMG_ENTRY(0, 0xE), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 69, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32(minVelocityY, 65496, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_STOP), }; @@ -149,18 +193,18 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) { EnTite* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - thisx->unk_1F = 3; + thisx->targetMode = 3; Actor_SetScale(thisx, 0.01f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003A20, &D_060012E4, this->jointTable, this->morphTable, 25); - ActorShape_Init(&thisx->shape, -200.0f, ActorShadow_DrawFunc_Circle, 70.0f); + ActorShape_Init(&thisx->shape, -200.0f, ActorShadow_DrawCircle, 70.0f); this->flipState = TEKTITE_INITIAL; thisx->colChkInfo.damageTable = sDamageTable; this->actionVar1 = 0; // value immediately overwritten in SetupIdle this->unk_2C4.unk_10 = 0; - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 20.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 20.0f; thisx->colChkInfo.health = 2; - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, thisx, &sJntSphInit, &this->colliderItem); this->unk_2DC = 0x1D; @@ -205,8 +249,8 @@ void EnTite_Idle(EnTite* this, GlobalContext* globalCtx) { // Float on water surface this->actor.gravity = 0.0f; Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); } else { this->actor.gravity = -1.0f; } @@ -216,7 +260,7 @@ void EnTite_Idle(EnTite* this, GlobalContext* globalCtx) { } if (this->vIdleTimer > 0) { this->vIdleTimer--; - } else if ((this->actor.xzDistToLink < 300.0f) && (this->actor.yDistToLink <= 80.0f)) { + } else if ((this->actor.xzDistToPlayer < 300.0f) && (this->actor.yDistToPlayer <= 80.0f)) { EnTite_SetupTurnTowardPlayer(this); } } @@ -229,7 +273,7 @@ void EnTite_SetupAttack(EnTite* this) { this->vQueuedJumps = Rand_S16Offset(1, 3); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnTite_SetupAction(this, EnTite_Attack); } @@ -245,12 +289,12 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { // Snap to ground or water, then lunge into the air with some initial speed this->vAttackState = TEKTITE_MID_LUNGE; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); } else { - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } this->actor.velocity.y = 8.0f; @@ -266,15 +310,15 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { if (this->actor.velocity.y <= 0.0f) { this->vAttackState = TEKTITE_LANDED; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (BGCHECK_Y_MIN < this->actor.groundY) { - this->actor.posRot.pos.y = this->actor.groundY; + if (BGCHECK_Y_MIN < this->actor.floorHeight) { + this->actor.world.pos.y = this->actor.floorHeight; } this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; } else { this->actor.gravity = 0.0f; if (this->actor.velocity.y < -8.0f) { - ripplePos = this->actor.posRot.pos; + ripplePos = this->actor.world.pos; ripplePos.y += this->actor.yDistToWater; this->vAttackState++; // TEKTITE_SUBMERGED this->actor.velocity.y *= 0.75f; @@ -285,7 +329,7 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } } break; @@ -294,7 +338,7 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { if (this->vQueuedJumps != 0) { this->vQueuedJumps--; this->vAttackState = TEKTITE_BEGIN_LUNGE; - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } else { EnTite_SetupTurnTowardPlayer(this); } @@ -316,10 +360,10 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { switch (this->vAttackState) { case TEKTITE_BEGIN_LUNGE: // Slightly turn to player and switch to turning/idling action if the player is too far - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 1000, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - angleToPlayer = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; + angleToPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f)) { EnTite_SetupIdle(this); } else if (ABS(angleToPlayer) >= 9000) { EnTite_SetupTurnTowardPlayer(this); @@ -335,16 +379,16 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { func_800355B8(globalCtx, &this->backLeftFootPos); } } - if (!(this->collider.base.atFlags & 2) && (this->actor.flags & 0x40)) { + if (!(this->collider.base.atFlags & AT_HIT) && (this->actor.flags & 0x40)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } else { Player* player = PLAYER; - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (&player->actor == this->collider.base.at) { - if (!(this->collider.base.atFlags & 4)) { + if (!(this->collider.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } } @@ -353,14 +397,14 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { break; case TEKTITE_LANDED: // Slightly turn to player - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 1500, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 1500, 0); break; case TEKTITE_SUBMERGED: // Float up to water surface Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); break; } // Create ripples on water surface where tektite feet landed @@ -417,15 +461,15 @@ void EnTite_TurnTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Calculate turn velocity and animation speed based on angle to player if ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)) { - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } - angleToPlayer = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; if (angleToPlayer > 0) { turnVelocity = (angleToPlayer / 42.0f) + 10.0f; - this->actor.posRot.rot.y += (turnVelocity * 2); + this->actor.world.rot.y += (turnVelocity * 2); } else { turnVelocity = (angleToPlayer / 42.0f) - 10.0f; - this->actor.posRot.rot.y += (turnVelocity * 2); + this->actor.world.rot.y += (turnVelocity * 2); } if (angleToPlayer > 0) { this->skelAnime.playSpeed = turnVelocity * 0.01f; @@ -446,11 +490,11 @@ void EnTite_TurnTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Idle if player is far enough away from the tektite, move or attack if almost facing player - this->actor.shape.rot.y = this->actor.posRot.rot.y; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f)) { + this->actor.shape.rot.y = this->actor.world.rot.y; + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f)) { EnTite_SetupIdle(this); } else if (func_8002E084(&this->actor, 3640)) { - if ((this->actor.xzDistToLink <= 180.0f) && (this->actor.yDistToLink <= 80.0f)) { + if ((this->actor.xzDistToPlayer <= 180.0f) && (this->actor.yDistToPlayer <= 80.0f)) { EnTite_SetupAttack(this); } else { EnTite_SetupMoveTowardPlayer(this); @@ -504,14 +548,14 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { (this->actor.velocity.y <= 0.0f)) { // slightly turn toward player upon landing and snap to ground or water. this->actor.speedXZ = 0.0f; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 4000, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 4000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else if (this->actor.bgCheckFlags & 0x40) { - Vec3f ripplePos = this->actor.posRot.pos; + Vec3f ripplePos = this->actor.world.pos; this->actor.bgCheckFlags &= ~0x40; ripplePos.y += this->actor.yDistToWater; this->actor.gravity = 0.0f; @@ -521,8 +565,8 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } else { // If submerged, float to surface Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); if (this->actor.yDistToWater != 0.0f) { // Do not change state until tekite has floated to surface return; @@ -530,9 +574,9 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Idle or turn if player is too far away, otherwise keep jumping - if (((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f))) { + if (((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f))) { EnTite_SetupIdle(this); - } else if (((this->actor.xzDistToLink <= 180.0f)) && ((this->actor.yDistToLink <= 80.0f))) { + } else if (((this->actor.xzDistToPlayer <= 180.0f)) && ((this->actor.yDistToPlayer <= 80.0f))) { if (this->vQueuedJumps <= 0) { EnTite_SetupTurnTowardPlayer(this); } else { @@ -561,7 +605,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } else { // Turn slowly toward player this->actor.flags |= 0x1000000; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 1000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); if (this->actor.velocity.y >= 6.0f) { if (this->actor.bgCheckFlags & 1) { func_800355B8(globalCtx, &this->frontLeftFootPos); @@ -577,7 +621,7 @@ void EnTite_SetupRecoil(EnTite* this) { this->action = TEKTITE_RECOIL; Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.gravity = -1.0f; EnTite_SetupAction(this, EnTite_Recoil); } @@ -593,13 +637,13 @@ void EnTite_Recoil(EnTite* this, GlobalContext* globalCtx) { if (((this->actor.bgCheckFlags & 3) || (this->actor.params == TEKTITE_BLUE && (this->actor.bgCheckFlags & 0x20))) && (this->actor.velocity.y <= 0.0f)) { if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } } @@ -618,17 +662,17 @@ void EnTite_Recoil(EnTite* this, GlobalContext* globalCtx) { } // If player is far away, idle. Otherwise attack or move - angleToPlayer = (this->actor.yawTowardsLink - this->actor.shape.rot.y); + angleToPlayer = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y); if ((this->actor.speedXZ == 0.0f) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->collider.base.atFlags &= ~0x2; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f) && + this->actor.world.rot.y = this->actor.shape.rot.y; + this->collider.base.atFlags &= ~AT_HIT; + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); - } else if ((this->actor.xzDistToLink < 180.0f) && (this->actor.yDistToLink <= 80.0f) && + } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && (ABS(angleToPlayer) <= 6000)) { EnTite_SetupAttack(this); } else { @@ -643,7 +687,7 @@ void EnTite_SetupStunned(EnTite* this) { 4.0f); this->action = TEKTITE_STUNNED; this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->damageEffect == 0xF) { this->spawnIceTimer = 48; } @@ -663,13 +707,13 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20))) && (this->actor.velocity.y <= 0.0f)) { if (((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20))) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } } // Play sounds and spawn dirt effects upon landing @@ -686,21 +730,21 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { } } // Decide on next action based on health, flip state and player distance - angleToPlayer = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (((this->actor.dmgEffectTimer == 0) && (this->actor.speedXZ == 0.0f)) && + angleToPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (((this->actor.colorFilterTimer == 0) && (this->actor.speedXZ == 0.0f)) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.colChkInfo.health == 0) { EnTite_SetupDeathCry(this); } else if (this->flipState == TEKTITE_FLIPPED) { EnTite_SetupFlipUpright(this); - } else if (((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f) && + } else if (((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000)) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); - } else if ((this->actor.xzDistToLink < 180.0f) && (this->actor.yDistToLink <= 80.0f) && + } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && (ABS(angleToPlayer) <= 6000)) { EnTite_SetupAttack(this); } else { @@ -712,7 +756,7 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { void EnTite_SetupDeathCry(EnTite* this) { this->action = TEKTITE_DEATH_CRY; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actor.speedXZ = 0.0f; EnTite_SetupAction(this, EnTite_DeathCry); } @@ -734,9 +778,9 @@ void EnTite_DeathCry(EnTite* this, GlobalContext* globalCtx) { void EnTite_FallApart(EnTite* this, GlobalContext* globalCtx) { if (func_8003305C(&this->actor, &this->unk_2C4, globalCtx, (this->actor.params + 0xB))) { if (this->actor.params == TEKTITE_BLUE) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); } else { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x40); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x40); } Actor_Kill(&this->actor); } @@ -770,7 +814,7 @@ void EnTite_FlipOnBack(EnTite* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 3) { // Upon landing, spawn dust and make noise if (this->actor.bgCheckFlags & 2) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 20.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 0xB, 4.0f, 0, 0, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } this->vOnBackTimer--; @@ -779,8 +823,8 @@ void EnTite_FlipOnBack(EnTite* this, GlobalContext* globalCtx) { } } else { // Gradually increase y offset during flip so that the actor position is at tektite's back instead of feet - if (this->actor.shape.unk_08 < 2800.0f) { - this->actor.shape.unk_08 += 400.0f; + if (this->actor.shape.yOffset < 2800.0f) { + this->actor.shape.yOffset += 400.0f; } } } @@ -803,8 +847,8 @@ void EnTite_FlipUpright(EnTite* this, GlobalContext* globalCtx) { func_80033480(globalCtx, &this->frontRightFootPos, 1.0f, 2, 80, 15, 1); func_80033480(globalCtx, &this->backRightFootPos, 1.0f, 2, 80, 15, 1); func_80033480(globalCtx, &this->backLeftFootPos, 1.0f, 2, 80, 15, 1); - this->actor.shape.unk_08 = 0.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.shape.yOffset = 0.0f; + this->actor.world.pos.y = this->actor.floorHeight; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); EnTite_SetupIdle(this); } @@ -813,11 +857,11 @@ void EnTite_FlipUpright(EnTite* this, GlobalContext* globalCtx) { void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { EnTite* this = THIS; - if ((this->collider.base.acFlags & 2) && (this->action >= TEKTITE_IDLE)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.acFlags & AC_HIT) && (this->action >= TEKTITE_IDLE)) { + this->collider.base.acFlags &= ~AC_HIT; if (thisx->colChkInfo.damageEffect != 0xE) { // Immune to fire magic this->damageEffect = thisx->colChkInfo.damageEffect; - func_80035650(thisx, &this->collider.list->body, 0); + func_80035650(thisx, &this->collider.elements[0].info, 0); // Stun if Tektite hit by nut, boomerang, hookshot, ice arrow or ice magic if ((thisx->colChkInfo.damageEffect == 1) || (thisx->colChkInfo.damageEffect == 0xF)) { if (this->action != TEKTITE_STUNNED) { @@ -827,7 +871,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { } // Otherwise apply damage and handle death where necessary } else { - if ((thisx->dmgEffectTimer == 0) || ((thisx->dmgEffectParams & 0x4000) == 0)) { + if ((thisx->colorFilterTimer == 0) || ((thisx->colorFilterParams & 0x4000) == 0)) { func_8003426C(thisx, 0x4000, 0xFF, 0, 8); Actor_ApplyDamage(thisx); } @@ -846,7 +890,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { } // If hammer has recently hit the floor and player is close to tektite, flip over } else if ((thisx->colChkInfo.health != 0) && (globalCtx->actorCtx.unk_02 != 0) && - (thisx->xzDistToLink <= 400.0f) && (thisx->bgCheckFlags & 1)) { + (thisx->xzDistToPlayer <= 400.0f) && (thisx->bgCheckFlags & 1)) { if (this->flipState == TEKTITE_FLIPPED) { EnTite_SetupFlipUpright(this); } else if ((this->action >= TEKTITE_IDLE) || (this->action >= TEKTITE_IDLE)) { @@ -868,7 +912,7 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->colChkInfo.damageEffect != 0xE) { this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); // If on water, snap feet to surface and spawn ripples if ((this->actor.params == TEKTITE_BLUE) && (thisx->bgCheckFlags & 0x20)) { floorPoly = thisx->floorPoly; @@ -914,14 +958,14 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { Math_SmoothStepToS(&thisx->shape.rot.x, 0, 1, 1000, 0); if (this->flipState <= TEKTITE_UNFLIPPED) { Math_SmoothStepToS(&thisx->shape.rot.z, 0, 1, 1000, 0); - if (thisx->shape.unk_08 > 0) { - thisx->shape.unk_08 -= 400.0f; + if (thisx->shape.yOffset > 0) { + thisx->shape.yOffset -= 400.0f; } } } } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 20.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 20.0f; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -954,7 +998,7 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_tite.c", 1704); func_80093D18(globalCtx->state.gfxCtx); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); if (this->actor.params == TEKTITE_BLUE) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06001300)); gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(&D_06001700)); @@ -970,14 +1014,14 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->spawnIceTimer != 0) { // Spawn chunks of ice all over the tektite's body - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->spawnIceTimer--; if ((this->spawnIceTimer & 3) == 0) { Vec3f iceChunk; s32 idx = this->spawnIceTimer >> 2; - iceChunk.x = thisx->posRot.pos.x + sIceChunks[idx].x; - iceChunk.y = thisx->posRot.pos.y + sIceChunks[idx].y; - iceChunk.z = thisx->posRot.pos.z + sIceChunks[idx].z; + iceChunk.x = thisx->world.pos.x + sIceChunks[idx].x; + iceChunk.y = thisx->world.pos.y + sIceChunks[idx].y; + iceChunk.z = thisx->world.pos.z + sIceChunks[idx].z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceChunk, 150, 150, 150, 250, 235, 245, 255, 1.0f); } } diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index dabc9e823e..40f2906778 100755 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -28,7 +28,7 @@ typedef struct EnTite { /* 0x02E3 */ u8 spawnIceTimer; /* 0x02E4 */ u8 damageEffect; /* 0x02E8 */ ColliderJntSph collider; - /* 0x0308 */ ColliderJntSphItem colliderItem; + /* 0x0308 */ ColliderJntSphElement colliderItem; /* 0x0348 */ Vec3f frontLeftFootPos; /* 0x0354 */ Vec3f frontRightFootPos; /* 0x0360 */ Vec3f backRightFootPos; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 6aceed9b8f..459ed39515 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -41,7 +41,7 @@ extern FlexSkeletonHeader D_0600BE40; const ActorInit En_Tk_InitVars = { ACTOR_EN_TK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TK, sizeof(EnTk), @@ -158,14 +158,26 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth /** z_en_tk_eff.c ends here probably **/ static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 52, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; void EnTk_RestAnim(EnTk* this, GlobalContext* globalCtx) { AnimationHeader* anim = &D_06002F84; @@ -215,7 +227,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) { s16 v0; s16 v1; - if (this->actor.xyzDistToLinkSq > 10000.0f) { + if (this->actor.xyzDistToPlayerSq > 10000.0f) { return 0; } @@ -223,7 +235,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) { v0 -= this->h_21E; v0 -= this->headRot; - v1 = this->actor.yawTowardsLink - v0; + v1 = this->actor.yawTowardsPlayer - v0; if (ABS(v1) < 0x1554) { return 1; } else { @@ -236,7 +248,7 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) { f32 dxz; f32 dy; - prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if (prop->id != ACTOR_EN_IT) { @@ -249,8 +261,8 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) { continue; } - dy = prop->posRot.pos.y - this->actor.groundY; - dxz = func_8002DB8C(&this->actor, prop); + dy = prop->world.pos.y - this->actor.floorHeight; + dxz = Actor_WorldDistXZToActor(&this->actor, prop); if (dxz > 40.0f || dy > 10.0f) { prop = prop->next; continue; @@ -268,8 +280,8 @@ void EnTk_CheckCurrentSpot(EnTk* this) { f32 dy; if (this->currentSpot != NULL) { - dy = this->currentSpot->posRot.pos.y - this->actor.groundY; - dxz = func_8002DB8C(&this->actor, this->currentSpot); + dy = this->currentSpot->world.pos.y - this->actor.floorHeight; + dxz = Actor_WorldDistXZToActor(&this->actor, this->currentSpot); if (dxz > 40.0f || dy > 10.0f) { this->currentSpot = NULL; } @@ -317,11 +329,11 @@ s32 EnTk_Orient(EnTk* this, GlobalContext* globalCtx) { point = SEGMENTED_TO_VIRTUAL(path->points); point += this->currentWaypoint; - dx = point->x - this->actor.posRot.pos.x; - dz = point->z - this->actor.posRot.pos.z; + dx = point->x - this->actor.world.pos.x; + dz = point->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 10, 1000, 1); - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; if (SQ(dx) + SQ(dz) < 10.0f) { this->currentWaypoint++; @@ -485,7 +497,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { EnTk* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BE40, NULL, this->jointTable, this->morphTable, 18); Animation_Change(&this->skelAnime, &D_06002F84, 1.0f, 0.0f, Animation_GetLastFrame(&D_06002F84), ANIMMODE_LOOP, @@ -494,7 +506,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || globalCtx->sceneNum != SCENE_SPOT02) { @@ -504,7 +516,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.gravity = -0.1f; this->currentReward = -1; this->currentSpot = NULL; @@ -524,7 +536,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { if (this->h_1E0 != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; if (this->h_1E0 == 2) { EnTk_DigAnim(this, globalCtx); @@ -538,7 +550,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { } else if (EnTk_CheckFacingPlayer(this)) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; this->actionCountdown = 0; func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.0f, func_80B1C54C, @@ -546,7 +558,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { } else if (func_8002F194(&this->actor, globalCtx)) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; this->actionCountdown = 0; this->h_1E0 = 1; @@ -605,9 +617,9 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW); Matrix_MultVec3f(&rewardOrigin, &rewardPos); - rewardPos.x += this->actor.posRot.pos.x; - rewardPos.y += this->actor.posRot.pos.y; - rewardPos.z += this->actor.posRot.pos.z; + rewardPos.x += this->actor.world.pos.x; + rewardPos.y += this->actor.world.pos.y; + rewardPos.z += this->actor.world.pos.z; this->currentReward = EnTk_ChooseReward(this); if (this->currentReward == 3) { @@ -660,14 +672,14 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { EnTk* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5); this->actionFunc(this, globalCtx); @@ -709,7 +721,7 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec /* Limb 16 - Jaw */ if (limbIndex == 16) { - Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sp1C, &this->actor.focus.pos); } /* Limb 14 - Neck */ diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index 87d4f04c3e..0b8e35ca8e 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -14,7 +14,7 @@ void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Torch_InitVars = { ACTOR_EN_TORCH, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnTorch), @@ -34,8 +34,8 @@ void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx) { /* Spawn chest with desired contents. Contents are passed to en_torch from grotto params via Save Context. */ - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, (sChestContents[(returnData >> 0x5) & 0x7] << 0x5) | 0x5000 | (returnData & 0x1F)); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index d9cff7d2d9..20f4d1f68a 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -57,7 +57,7 @@ extern FlexSkeletonHeader D_06004764; const ActorInit En_Torch2_InitVars = { ACTOR_EN_TORCH2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_TORCH2, sizeof(Player), @@ -89,8 +89,38 @@ const ActorInit En_Torch2_InitVars = { /* static */ u8 sAlpha; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0xE2, 0x60, 0xD3, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0xE), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(3, 0xD), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { @@ -104,18 +134,18 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { Player_SetModelGroup(this, 2); globalCtx->playerInit(this, globalCtx, &D_06004764); this->actor.naviEnemyId = 0x26; - this->cylinder.base.acFlags = 9; - this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = 0x11; - this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = 0xD; - this->swordQuads[0].base.type = this->swordQuads[1].base.type = 9; - this->swordQuads[0].body.toucher.damage = this->swordQuads[1].body.toucher.damage = 8; - this->swordQuads[0].body.bumperFlags = this->swordQuads[1].body.bumperFlags = 1; - this->shieldQuad.base.atFlags = 0x11; - this->shieldQuad.base.acFlags = 0xD; + this->cylinder.base.acFlags = AC_ON | AC_TYPE_PLAYER; + this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY; + this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; + this->swordQuads[0].base.colType = this->swordQuads[1].base.colType = COLTYPE_METAL; + this->swordQuads[0].info.toucher.damage = this->swordQuads[1].info.toucher.damage = 8; + this->swordQuads[0].info.bumperFlags = this->swordQuads[1].info.bumperFlags = BUMP_ON; + this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY; + this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = gSaveContext.healthCapacity >> 3; - this->actor.colChkInfo.unk_10 = 60; - this->actor.colChkInfo.unk_12 = 100; + this->actor.colChkInfo.cylRadius = 60; + this->actor.colChkInfo.cylHeight = 100; globalCtx->func_11D54(this, globalCtx); sActionState = ENTORCH2_WAIT; @@ -127,7 +157,7 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { sCounterState = sStaggerTimer = sStaggerCount = 0; sLastSwordAnim = 0; sAlpha = 95; - sSpawnPoint = this->actor.initPosRot.pos; + sSpawnPoint = this->actor.home.pos; } void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -190,8 +220,8 @@ s32 EnTorch2_SwingSword(GlobalContext* globalCtx, Input* input, Player* this) { } void EnTorch2_Backflip(Player* this, Input* input, Actor* thisx) { - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink; - sStickAngle = thisx->yawTowardsLink + 0x8000; + thisx->world.rot.y = thisx->shape.rot.y = thisx->yawTowardsPlayer; + sStickAngle = thisx->yawTowardsPlayer + 0x8000; sStickTilt = 127.0f; sZTargetFlag = true; input->cur.button = BTN_A; @@ -232,16 +262,16 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { attackItem = EnTorch2_GetAttackItem(globalCtx, this); switch (sActionState) { case ENTORCH2_WAIT: - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->skelAnime.curFrame = 0.0f; this->skelAnime.playSpeed = 0.0f; - this->actor.posRot.pos.x = (Math_SinS(this->actor.posRot.rot.y) * 25.0f) + sSpawnPoint.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.posRot.rot.y) * 25.0f) + sSpawnPoint.z; - if ((this->actor.xzDistToLink <= 120.0f) || func_80033A84(globalCtx, &this->actor) || + this->actor.world.pos.x = (Math_SinS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.x; + this->actor.world.pos.z = (Math_CosS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.z; + if ((this->actor.xzDistToPlayer <= 120.0f) || func_80033A84(globalCtx, &this->actor) || (attackItem != NULL)) { if (attackItem != NULL) { sDodgeRollState = 1; - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; input->cur.button = BTN_A; sZTargetFlag = false; @@ -260,12 +290,12 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles Dark Link's sword clanking on Link's sword - if ((this->swordQuads[0].base.acFlags & 0x80) || (this->swordQuads[1].base.acFlags & 0x80)) { - this->swordQuads[0].base.acFlags &= ~0x80; - this->swordQuads[1].base.acFlags &= ~0x80; - this->swordQuads[0].base.atFlags |= 4; // Loads these out of order - this->swordQuads[1].base.atFlags |= 4; - this->cylinder.base.acFlags &= ~2; + if ((this->swordQuads[0].base.acFlags & AC_BOUNCED) || (this->swordQuads[1].base.acFlags & AC_BOUNCED)) { + this->swordQuads[0].base.acFlags &= ~AC_BOUNCED; + this->swordQuads[1].base.acFlags &= ~AC_BOUNCED; + this->swordQuads[0].base.atFlags |= AT_BOUNCED; // Loads these out of order + this->swordQuads[1].base.atFlags |= AT_BOUNCED; + this->cylinder.base.atFlags &= ~AC_HIT; if (sLastSwordAnim != this->swordAnimation) { sStaggerCount++; @@ -290,8 +320,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Ignores hits when jumping on Link's sword if ((this->invincibilityTimer < 0) && (sActionState != ENTORCH2_DAMAGE) && - (this->cylinder.base.acFlags & 2)) { - this->cylinder.base.acFlags &= ~2; + (this->cylinder.base.acFlags & AC_HIT)) { + this->cylinder.base.atFlags &= ~AC_HIT; } // Handles Dark Link rolling to dodge item attacks @@ -300,7 +330,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sStickTilt = 127.0f; } else if (attackItem != NULL) { sDodgeRollState = 1; - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; input->cur.button = BTN_A; } else if (sJumpslashTimer == 0) { @@ -309,12 +339,12 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (((player->swordState != 0) || (player->actor.velocity.y > -3.0f)) && (player->swordAnimation == JUMPSLASH_START)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (globalCtx->gameplayFrames % 2) { - sStickAngle = this->actor.yawTowardsLink + 0x4000; + sStickAngle = this->actor.yawTowardsPlayer + 0x4000; } else { - sStickAngle = this->actor.yawTowardsLink - 0x4000; + sStickAngle = this->actor.yawTowardsPlayer - 0x4000; } sStickTilt = 127.0f; // Does not store with pointer sJumpslashFlag = false; // Does not store with POinter @@ -326,22 +356,22 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (sSwordJumpState != 0) { sStickTilt = 0.0f; player->stateFlags3 |= 4; - Math_SmoothStepToF(&this->actor.posRot.pos.x, + Math_SmoothStepToF(&this->actor.world.pos.x, (Math_SinS(player->actor.shape.rot.y - 0x3E8) * 45.0f) + - player->actor.posRot.pos.x, + player->actor.world.pos.x, 1.0f, 5.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, + Math_SmoothStepToF(&this->actor.world.pos.z, (Math_CosS(player->actor.shape.rot.y - 0x3E8) * 45.0f) + - player->actor.posRot.pos.z, + player->actor.world.pos.z, 1.0f, 5.0f, 0.0f); sSwordJumpTimer--; if ((sSwordJumpTimer == 0) || ((player->invincibilityTimer > 0) && (this->swordState == 0))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; input->cur.button = BTN_A; player->stateFlags3 &= ~4; sStickTilt = 127.0f; player->skelAnime.curFrame = 3.0f; - sStickAngle = this->actor.yawTowardsLink + 0x8000; + sStickAngle = this->actor.yawTowardsPlayer + 0x8000; sSwordJumpTimer = sSwordJumpState = 0; this->actor.flags |= 1; } else if (sSwordJumpState == 1) { @@ -361,15 +391,15 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles Dark Link's reaction to sword attack other than jumpslashes - if (func_800354B4(globalCtx, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.posRot.rot.y)) { + if (func_800354B4(globalCtx, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.world.rot.y)) { // Loads arguments in wrong order. Probably related to static variables problem. - if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToLink < 90.0f)) { + if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) { // Handles the reaction to a one-handed stab. If the conditions are satisfied, // Dark Link jumps on Link's sword. Otherwise he backflips away. if ((this->swordState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) && - (player->swordAnimation == STAB_1H) && (this->actor.xzDistToLink <= 85.0f) && + (player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) && func_80033A84(globalCtx, &this->actor)) { sStickTilt = 0.0f; @@ -392,7 +422,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles reactions to all other sword attacks - sStickAngle = this->actor.yawTowardsLink; // Not loaded into pointer + sStickAngle = this->actor.yawTowardsPlayer; // Not loaded into pointer input->cur.button = BTN_B; if (player->swordAnimation <= FORWARD_COMBO_2H) { @@ -419,31 +449,30 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles movement and attacks when not reacting to Link's actions - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sp50 = 0.0f; - if ((90.0f >= this->actor.xzDistToLink) && (this->actor.xzDistToLink > 70.0f) && - (ABS(sp5A) >= 0x7800) && - ((this->actor.unk_10C != 0) || !(player->stateFlags1 & 0x00400000))) { + if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && + (ABS(sp5A) >= 0x7800) && (this->actor.isTargeted || !(player->stateFlags1 & 0x00400000))) { EnTorch2_SwingSword(globalCtx, input, this); - } else if (((this->actor.xzDistToLink <= 70.0f) || - ((this->actor.xzDistToLink <= 80.0f + sp50) && (player->swordState != 0))) && + } else if (((this->actor.xzDistToPlayer <= 70.0f) || + ((this->actor.xzDistToPlayer <= 80.0f + sp50) && (player->swordState != 0))) && (this->swordState == 0)) { if (!EnTorch2_SwingSword(globalCtx, input, this) && (this->swordState == 0) && (sCounterState == 0)) { EnTorch2_Backflip(this, input, &this->actor); } - } else if (this->actor.xzDistToLink <= 50 + sp50) { + } else if (this->actor.xzDistToPlayer <= 50 + sp50) { sStickTilt = 127.0f; - sStickAngle = this->actor.yawTowardsLink; - if (this->actor.unk_10C == 0) { + sStickAngle = this->actor.yawTowardsPlayer; + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } - } else if (this->actor.xzDistToLink > 100.0f + sp50) { + } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { if ((player->swordState == 0) || (player->swordAnimation < SPIN_ATTACK_1H) || - (player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToLink >= 280.0f)) { + (player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToPlayer >= 280.0f)) { sStickTilt = 127.0f; - sStickAngle = this->actor.yawTowardsLink; - if (this->actor.unk_10C == 0) { + sStickAngle = this->actor.yawTowardsPlayer; + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } else { @@ -451,9 +480,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } } else if (((ABS(sp5A) < 0x7800) && (ABS(sp5A) >= 0x3000)) || !EnTorch2_SwingSword(globalCtx, input, this)) { - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; - if (this->actor.unk_10C == 0) { + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } @@ -465,7 +494,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (sJumpslashFlag && (sAlpha == 255) && (this->actor.velocity.y > 0)) { input->cur.button |= BTN_B; } else if (!sJumpslashFlag && (this->actor.bgCheckFlags & 1)) { - sStickAngle = this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + sStickAngle = this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (sAlpha != 255) { sStickAngle += 0x8000; sStickTilt = 127.0f; // Not loaded from pointer @@ -491,30 +520,28 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { case ENTORCH2_DAMAGE: this->swordState = 0; input->cur.stick_x = input->cur.stick_y = 0; - if ((this->invincibilityTimer > 0) && (this->actor.posRot.pos.y < (this->actor.groundY - 160.0f))) { + if ((this->invincibilityTimer > 0) && (this->actor.world.pos.y < (this->actor.floorHeight - 160.0f))) { this->stateFlags3 &= ~1; this->actor.flags |= 1; this->invincibilityTimer = 0; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = sSpawnPoint.y + 40.0f; - this->actor.posRot.pos.x = - (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = - (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.posRot.pos.z; - if (func_8002DB6C(&this->actor, &sSpawnPoint) > 800.0f) { + this->actor.world.pos.y = sSpawnPoint.y + 40.0f; + this->actor.world.pos.x = (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.x; + this->actor.world.pos.z = (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.z; + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) { sp50 = Rand_ZeroOne() * 20.0f; sp4E = Rand_CenteredFloat(4000.0f); - this->actor.shape.rot.y = this->actor.posRot.rot.y = - Math_Vec3f_Yaw(&sSpawnPoint, &player->actor.posRot.pos); - this->actor.posRot.pos.x = - (Math_SinS(this->actor.posRot.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.x; - this->actor.posRot.pos.z = - (Math_CosS(this->actor.posRot.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.z; - this->actor.posRot.pos.y = sSpawnPoint.y; + this->actor.shape.rot.y = this->actor.world.rot.y = + Math_Vec3f_Yaw(&sSpawnPoint, &player->actor.world.pos); + this->actor.world.pos.x = + (Math_SinS(this->actor.world.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.x; + this->actor.world.pos.z = + (Math_CosS(this->actor.world.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.z; + this->actor.world.pos.y = sSpawnPoint.y; } else { - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); globalCtx->func_11D54(this, globalCtx); sActionState = ENTORCH2_ATTACK; sStickTilt = 0.0f; @@ -532,7 +559,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { return; } sAlpha -= 13; - this->actor.shape.unk_14 -= 13; + this->actor.shape.shadowAlpha -= 13; break; } @@ -546,7 +573,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { input->cur.button = BTN_R; } - if ((sActionState == ENTORCH2_ATTACK) && (this->actor.xzDistToLink <= 610.0f) && sZTargetFlag) { + if ((sActionState == ENTORCH2_ATTACK) && (this->actor.xzDistToPlayer <= 610.0f) && sZTargetFlag) { input->cur.button |= BTN_Z; } @@ -578,9 +605,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_46A = 1; sDeathFlag = false; } - if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && (this->cylinder.base.acFlags & 2) && - !(this->stateFlags1 & 0x04000000) && !(this->swordQuads[0].base.atFlags & 2) && - !(this->swordQuads[1].base.atFlags & 2)) { + if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && + (this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & 0x04000000) && + !(this->swordQuads[0].base.acFlags & AT_HIT) && !(this->swordQuads[1].base.acFlags & AT_HIT)) { if (!Actor_ApplyDamage(&this->actor)) { func_800F5B58(); @@ -589,11 +616,11 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A4 = 6.0f; this->unk_8A8 = 6.0f; this->unk_8A0 = this->actor.colChkInfo.damage; - this->unk_8A2 = this->actor.yawTowardsLink + 0x8000; + this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; sDeathFlag++; sActionState = ENTORCH2_DEATH; func_80032C7C(globalCtx, &this->actor); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); this->stateFlags3 &= ~4; } else { func_800F5ACC(0x38); @@ -609,8 +636,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A8 = 6.0f; this->unk_8A0 = this->actor.colChkInfo.damage; this->unk_8A4 = 8.0f; - this->unk_8A2 = this->actor.yawTowardsLink + 0x8000; - func_80035650(&this->actor, &this->cylinder.body, 1); + this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; + func_80035650(&this->actor, &this->cylinder.info, 1); this->stateFlags3 &= ~4; this->stateFlags3 |= 1; sActionState = ENTORCH2_DAMAGE; @@ -627,7 +654,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles being frozen by a deku nut - if ((this->actor.dmgEffectTimer == 0) || (this->actor.dmgEffectParams & 0x4000)) { + if ((this->actor.colorFilterTimer == 0) || (this->actor.colorFilterParams & 0x4000)) { this->stateFlags3 &= ~4; } else { this->stateFlags3 |= 4; @@ -655,9 +682,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (gSaveContext.health < 0x50) { staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 3; } - if (this->actor.xzDistToLink > 80.0f) { + if (this->actor.xzDistToPlayer > 80.0f) { this->linearVelocity = 1.2f; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { this->linearVelocity = -1.5f; } else { this->linearVelocity = 1.0f; @@ -670,9 +697,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } } if (player->linearVelocity == -18.0f) { - if (this->actor.xzDistToLink > 80.0f) { + if (this->actor.xzDistToPlayer > 80.0f) { player->linearVelocity = 1.2f; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { player->linearVelocity = -1.5f; } else { player->linearVelocity = 1.0f; @@ -690,8 +717,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->skelAnime.curFrame = player->skelAnime.curFrame - player->skelAnime.playSpeed; this->skelAnime.playSpeed = player->skelAnime.playSpeed; LinkAnimation_Update(globalCtx, &this->skelAnime); - Collider_QuadSetAT(globalCtx, &this->swordQuads[0].base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[1].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base); } } if (sStaggerTimer != 0) { @@ -708,11 +735,11 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sDodgeRollState = (this->invincibilityTimer > 0) ? 2 : 0; } if (this->invincibilityTimer != 0) { - this->cylinder.base.type = 0xA; - this->cylinder.body.flags = 5; + this->cylinder.base.colType = COLTYPE_NONE; + this->cylinder.info.elemType = ELEMTYPE_UNK5; } else { - this->cylinder.base.type = 5; - this->cylinder.body.flags = 1; + this->cylinder.base.colType = COLTYPE_HIT5; + this->cylinder.info.elemType = ELEMTYPE_UNK1; } /* * Handles the jump movement onto Link's sword. Dark Link doesn't move during the @@ -723,7 +750,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_SmoothStepToF(&sSwordJumpHeight, 2630.0f, 1.0f, 2000.0f, 0.0f); this->actor.velocity.y -= 0.6f; } else if (sSwordJumpHeight != 0) { - this->actor.posRot.pos.y += sSwordJumpHeight * 0.01f; + this->actor.world.pos.y += sSwordJumpHeight * 0.01f; sSwordJumpHeight = 0; } if ((sActionState == ENTORCH2_WAIT) || (this->invincibilityTimer < 0)) { @@ -734,9 +761,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (sJumpslashTimer != 0) { sJumpslashTimer--; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 20.0f; - this->actor.shape.unk_08 = sSwordJumpHeight; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 20.0f; + this->actor.shape.yOffset = sSwordJumpHeight; } #else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s") diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index ce091eed50..09abd21944 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -21,7 +21,7 @@ void EnToryo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, const ActorInit En_Toryo_InitVars = { ACTOR_EN_TORYO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TORYO, sizeof(EnToryo), @@ -31,17 +31,61 @@ const ActorInit En_Toryo_InitVars = { (ActorFunc)EnToryo_Draw, }; -static ColliderCylinderInit sColliderCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 63, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sCollisionCheckInfoInit2 = { 0x00, 0x00, 0x00, 0x00, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static DamageTable sDamageTable = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; typedef struct { @@ -50,6 +94,7 @@ typedef struct { u8 mode; f32 transitionRate; } EnToryoAnimation; + static EnToryoAnimation sEnToryoAnimation = { 0x06000E50, 1.0f, 0, 0 }; static Vec3f sMultVec = { 800.0f, 1000.0f, 0.0f }; @@ -82,17 +127,17 @@ void EnToryo_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 42.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, NULL, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sColliderCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sCollisionCheckInfoInit2); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Animation_Change(&this->skelAnime, sEnToryoAnimation.anim, 1.0f, 0.0f, Animation_GetLastFrame(sEnToryoAnimation.anim), sEnToryoAnimation.mode, sEnToryoAnimation.transitionRate); this->stateFlags |= 8; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actionFunc = func_80B20914; } @@ -316,22 +361,22 @@ void EnToryo_Update(Actor* thisx, GlobalContext* globalCtx) { Player* player = PLAYER; f32 rot; - Collider_CylinderUpdate(thisx, collider); + Collider_UpdateCylinder(thisx, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, (Collider*)collider); this->actionFunc(this, globalCtx); if ((this->stateFlags & 8)) { - this->unk_1EC.unk_18.x = player->actor.posRot2.pos.x; - this->unk_1EC.unk_18.y = player->actor.posRot2.pos.y; - this->unk_1EC.unk_18.z = player->actor.posRot2.pos.z; + this->unk_1EC.unk_18.x = player->actor.focus.pos.x; + this->unk_1EC.unk_18.y = player->actor.focus.pos.y; + this->unk_1EC.unk_18.z = player->actor.focus.pos.z; if ((this->stateFlags & 0x10)) { func_80034A14(thisx, &this->unk_1EC, 0, 4); return; } - rot = thisx->yawTowardsLink - thisx->shape.rot.y; + rot = thisx->yawTowardsPlayer - thisx->shape.rot.y; if ((rot < 14563.0f) && (rot > -14563.0f)) { func_80034A14(thisx, &this->unk_1EC, 0, 2); } else { @@ -372,7 +417,7 @@ void EnToryo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, switch (limbIndex) { case 15: - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); break; } } diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 54806e7dab..6179091291 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_06000C68; /* const ActorInit En_Tp_InitVars = { ACTOR_EN_TP, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_TP, sizeof(EnTp), @@ -31,6 +31,33 @@ const ActorInit En_Tp_InitVars = { (ActorFunc)EnTp_Update, (ActorFunc)EnTp_Draw, }; + +static ColliderJntSphElementInit D_80B22A90[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 4 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B22AB4 = { + { + COLTYPE_HIT1, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80B22A90, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tp/func_80B20DE0.s") diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 03fb8292bf..8a1497bd75 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -26,7 +26,7 @@ extern UNK_TYPE D_06011688; /* const ActorInit En_Tr_InitVars = { ACTOR_EN_TR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TR, sizeof(EnTr), diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 1ed8aac7c6..d14cc71d7d 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06001400; /* const ActorInit En_Trap_InitVars = { ACTOR_EN_TRAP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TRAP, sizeof(EnTrap), @@ -29,6 +29,20 @@ const ActorInit En_Trap_InitVars = { (ActorFunc)EnTrap_Update, (ActorFunc)EnTrap_Draw, }; + +static ColliderCylinderInit D_80B25830 = { + { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_1 | OC1_TYPE_2, OC2_TYPE_1, +COLSHAPE_CYLINDER }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00001000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s") diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 840d8e70fc..f2a96cf564 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -22,14 +22,28 @@ void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 9, 23, 0, { 0 } }, }; const ActorInit En_Tubo_Trap_InitVars = { ACTOR_EN_TUBO_TRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnTuboTrap), @@ -45,7 +59,7 @@ extern Gfx D_05017870[]; void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { EnTuboTrap* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 2.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 2.0f); osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" Collider_InitCylinder(globalCtx, &this->collider); @@ -65,7 +79,7 @@ void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) { s16 param3FF = (params >> 6) & 0x3FF; if (param3FF >= 0 && param3FF < 0x1A) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, param3FF | ((params & 0x3F) << 8)); + Item_DropCollectible(globalCtx, &this->actor.world.pos, param3FF | ((params & 0x3F) << 8)); } } @@ -78,7 +92,7 @@ void EnTuboTrap_SpawnEffectsOnLand(EnTuboTrap* this, GlobalContext* globalCtx) { s16 var; s32 arg5; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; + Vec3f* actorPos = &this->actor.world.pos; for (i = 0, var = 0; i < 15; i++, var += 20000) { sin = Math_SinS(var); @@ -121,7 +135,7 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx) s16 var; s32 arg5; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; + Vec3f* actorPos = &this->actor.world.pos; pos = *actorPos; pos.y += this->actor.yDistToWater; @@ -162,38 +176,38 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { EnTuboTrap_SpawnEffectsInWater(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_BOMB_DROP_WATER); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; } - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == &player->actor) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); - Audio_PlaySoundAtPosition(globalCtx, &player2->actor.posRot.pos, 40, NA_SE_PL_BODY_HIT); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -202,7 +216,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -214,22 +228,22 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) { f32 targetHeight; if (BREG(2) != 0) { - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); // "You" - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.posRot.pos.y); // "Me" + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.world.pos.y); // "You" + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.world.pos.y); // "Me" osSyncPrintf("\n\n"); } - if (this->actor.xzDistToLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + if (this->actor.xzDistToPlayer < 200.0f && this->actor.world.pos.y <= player->actor.world.pos.y) { + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->actor.flags |= 1; targetHeight = 40.0f + -10.0f * gSaveContext.linkAge; - this->targetY = player->actor.posRot.pos.y + targetHeight; - if (this->targetY < this->actor.posRot.pos.y) { - this->targetY = this->actor.posRot.pos.y + targetHeight; + this->targetY = player->actor.world.pos.y + targetHeight; + if (this->targetY < this->actor.world.pos.y) { + this->targetY = this->actor.world.pos.y + targetHeight; } - this->originPos = this->actor.posRot.pos; + this->originPos = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EV_POT_MOVE_START); this->actionFunc = EnTuboTrap_Levitate; } @@ -237,19 +251,19 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) { void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 5000; - Math_ApproachF(&this->actor.posRot.pos.y, this->targetY, 0.8f, 3.0f); + Math_ApproachF(&this->actor.world.pos.y, this->targetY, 0.8f, 3.0f); - if (fabsf(this->actor.posRot.pos.y - this->targetY) < 10.0f) { + if (fabsf(this->actor.world.pos.y - this->targetY) < 10.0f) { this->actor.speedXZ = 10.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actionFunc = EnTuboTrap_Fly; } } void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) { - f32 dx = this->originPos.x - this->actor.posRot.pos.x; - f32 dy = this->originPos.y - this->actor.posRot.pos.y; - f32 dz = this->originPos.z - this->actor.posRot.pos.z; + f32 dx = this->originPos.x - this->actor.world.pos.x; + f32 dy = this->originPos.y - this->actor.world.pos.y; + f32 dz = this->originPos.z - this->actor.world.pos.z; Audio_PlayActorSound2(&this->actor, NA_SE_EN_TUBOOCK_FLY - SFX_FLAG); @@ -267,9 +281,9 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 20.0f, 0x1D); - Actor_SetHeight(&this->actor, 0.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 20.0f, 0x1D); + Actor_SetFocus(&this->actor, 0.0f); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index e3813d2bc2..fed63c2ee7 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -27,7 +27,7 @@ extern UNK_TYPE D_06004848; /* const ActorInit En_Vali_InitVars = { ACTOR_EN_VALI, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_VALI, sizeof(EnVali), @@ -36,6 +36,46 @@ const ActorInit En_Vali_InitVars = { (ActorFunc)EnVali_Update, (ActorFunc)EnVali_Draw, }; + +static ColliderQuadInit D_80B288A0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x07, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderCylinderInit D_80B288F0 = { + { + COLTYPE_HIT8, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x07, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, 35, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s") diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index 85bf977e1f..fe49bf9b70 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -17,7 +17,7 @@ void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Vase_InitVars = { ACTOR_EN_VASE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_VASE, sizeof(EnVase), @@ -31,8 +31,8 @@ void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) { EnVase* this = THIS; Actor_SetScale(&this->actor, 0.01f); - this->actor.posRot2.pos = this->actor.posRot.pos; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + this->actor.focus.pos = this->actor.world.pos; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 6.0f); } void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 337dcf3b33..d39556df84 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -18,7 +18,7 @@ void EnVbBall_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Vb_Ball_InitVars = { 0, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD, sizeof(EnVbBall), @@ -27,6 +27,26 @@ const ActorInit En_Vb_Ball_InitVars = { (ActorFunc)EnVbBall_Update, (ActorFunc)EnVbBall_Draw, }; + +static ColliderCylinderInit D_80B2A000 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK6, + { 0x00100700, 0x00, 0x20 }, + { 0x00100700, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Init.s") diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index e3a78a5cdf..02b11d5c91 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -69,16 +69,16 @@ extern UNK_TYPE D_06004EF0; extern AnimationHeader D_0600504C; extern AnimationHeader D_060050A8; extern UNK_TYPE D_060052F0; -extern FlexSkeletonHeader D_06006B2C; +extern SkeletonHeader D_06006B2C; extern AnimationHeader D_06007148; extern UNK_TYPE D_06007210; -extern FlexSkeletonHeader D_06008668; +extern SkeletonHeader D_06008668; extern UNK_TYPE D_0600A4E0; extern Gfx D_0600BE90[]; extern Gfx D_0600C410[]; extern Gfx D_0600D0D8[]; extern Gfx D_0600DE08[]; -extern SkeletonHeader D_0600E038; +extern FlexSkeletonHeader D_0600E038; extern Gfx D_0600E1A8[]; extern UNK_TYPE D_0600F178; extern UNK_TYPE D_0600F378; @@ -93,7 +93,7 @@ u8 D_80B2CEC0 = false; const ActorInit En_Viewer_InitVars = { ACTOR_EN_VIEWER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnViewer), @@ -129,8 +129,8 @@ EnViewerAnimFunc sAnimFuncs[] = { static void* sActorShadowDrawFunc[] = { NULL, - ActorShadow_DrawFunc_Circle, - ActorShadow_DrawFunc_Squiggly, + ActorShadow_DrawCircle, + ActorShadow_DrawHorse, }; // timer @@ -145,8 +145,7 @@ static EnViewerDrawFunc sDrawFuncs[] = { func_80B2C130, }; -// angle -s16 D_80B2CFEC = 0; +// angl EnGanonMant* sGanonCape; @@ -168,8 +167,8 @@ void EnViewer_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_1E5 = 0; this->unk_1E6 = false; if (params == 3 || params == 5 || params == 7 || params == 8 || params == 9) { - sGanonCape = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_GANON_MANT, 0.0f, 0.0f, - 0.0f, 0, 0, 0, 35); + sGanonCape = (EnGanonMant*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, + ACTOR_EN_GANON_MANT, 0.0f, 0.0f, 0.0f, 0, 0, 0, 35); } } @@ -762,9 +761,9 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) { endPos.z = globalCtx->csCtx.npcActions[0]->endPos.z; interpolated = func_8006F93C(globalCtx->csCtx.npcActions[0]->endFrame, globalCtx->csCtx.npcActions[0]->startFrame, globalCtx->csCtx.frames); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; } } else { if (globalCtx->csCtx.state != 0 && globalCtx->csCtx.npcActions[1] != NULL && @@ -777,19 +776,19 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) { endPos.z = globalCtx->csCtx.npcActions[1]->endPos.z; interpolated = func_8006F93C(globalCtx->csCtx.npcActions[1]->endFrame, globalCtx->csCtx.npcActions[1]->startFrame, globalCtx->csCtx.frames); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; if (globalCtx->csCtx.npcActions[1]->action == 12) { yaw = Math_Vec3f_Yaw(&startPos, &endPos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 10, 1000, 1); Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 10, 1000, 1); } if (params == 9) { - this->actor.posRot.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; - this->actor.posRot.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; - this->actor.posRot.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; + this->actor.world.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; + this->actor.world.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; + this->actor.world.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; this->actor.shape.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; this->actor.shape.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; this->actor.shape.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; @@ -880,16 +879,10 @@ void func_80B2C8AC(EnViewer* this2, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_viewer.c", 2034); } -// regalloc -// Using any of the three temps in the comments results in equivalency with only the stack pointer being too large. -// Can't find an equivalent without a temp -#ifdef NON_MATCHING void func_80B2CC1C(GlobalContext* globalCtx, EnViewer* this) { + static s16 D_80B2CFEC = 0; Vec3f vec1; Vec3f vec2; - // u8 index = 19; - // s16 angle_1 = 0x1000; - // s16 angle_2 = 0x2000; if (this->actor.params >> 8 == 5) { if (1) {} @@ -900,15 +893,9 @@ void func_80B2CC1C(GlobalContext* globalCtx, EnViewer* this) { sGanonCape->unk_16D0 = 0.0f; sGanonCape->unk_16C8 = (BREG(67) - 10) / 10.0f; vec1.x = KREG(16) - 13.0f; - - // Any of the temps defined above vec1.y results in a near match - // with only the stack pointer being too large vec1.y = KREG(17) + 3.0f + Math_SinS(D_80B2CFEC) * KREG(20); vec1.z = KREG(18) - 10.0f; D_80B2CFEC += KREG(19) * 0x1000 + 0x2000; - // D_80B2CFEC += KREG(index) * 0x1000 + 0x2000; - // D_80B2CFEC += KREG(19) * angle_1 + 0x2000; - // D_80B2CFEC += KREG(19) * 0x1000 + angle_2; Matrix_RotateY((this->actor.shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_NEW); Matrix_MultVec3f(&vec1, &vec2); @@ -922,6 +909,3 @@ void func_80B2CC1C(GlobalContext* globalCtx, EnViewer* this) { sGanonCape->unk_16E0.z = D_80B2D448.z + vec2.z; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Viewer/func_80B2CC1C.s") -#endif diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index c990844c94..72e8d22d34 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -18,7 +18,7 @@ typedef struct { /* 0x06 */ u8 actorShadowDrawFuncIndex; /* 0x07 */ u8 unk_7; /* 0x08 */ u8 drawFuncIndex; - /* 0x0C */ AnimationHeader* unk_C; + /* 0x0C */ FlexSkeletonHeader* unk_C; /* 0x10 */ AnimationHeader* unk_10; } struct_80B2CEE8; // size = 0x14 diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index c77837c362..257de1df2e 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -25,7 +25,7 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx); const ActorInit En_Vm_InitVars = { ACTOR_EN_VM, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_VM, sizeof(EnVm), @@ -36,20 +36,62 @@ const ActorInit En_Vm_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 70, 0, { 0, 0, 0 } }, }; static ColliderQuadInit sQuadInit1 = { - { COLTYPE_METAL_SHIELD, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x10 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static ColliderQuadInit sQuadInit2 = { - { COLTYPE_METAL_SHIELD, 0x00, 0x09, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -114,7 +156,7 @@ void EnVm_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); } - EnVm_SetupWait(thisx); + EnVm_SetupWait(this); } void EnVm_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -143,19 +185,19 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { switch (this->unk_25E) { case 0: Math_SmoothStepToS(&this->beamRot.x, 0, 10, 1500, 0); - headRot = this->actor.yawTowardsLink - this->headRotY - this->actor.shape.rot.y; - pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); + headRot = this->actor.yawTowardsPlayer - this->headRotY - this->actor.shape.rot.y; + pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); if (pitch > 0x1B91) { pitch = 0x1B91; } - dist = this->beamSightRange - this->actor.xzDistToLink; + dist = this->beamSightRange - this->actor.xzDistToPlayer; - if (this->actor.xzDistToLink <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 && - this->actor.yDistToLink <= 80.0f && this->actor.yDistToLink >= -160.0f) { - Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xFA0, 0); - if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, + if (this->actor.xzDistToPlayer <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 && + this->actor.yDistToPlayer <= 80.0f && this->actor.yDistToPlayer >= -160.0f) { + Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xFA0, 0); + if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, (ABS((s16)(dist * 180.0f)) / 3) + 0xFA0, 0) <= 5460) { this->timer--; if (this->timer == 0) { @@ -178,7 +220,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { return; } - Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F40, 0); + Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F40, 0); if (SkelAnime_Update(&this->skelAnime)) { this->unk_260++; @@ -186,8 +228,8 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { } if (this->unk_260 == 2) { - this->beamRot.y = this->actor.yawTowardsLink; - this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos.x); + this->beamRot.y = this->actor.yawTowardsPlayer; + this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); if (this->beamRot.x > 0x1B91) { this->beamRot.x = 0x1B91; @@ -213,13 +255,13 @@ void EnVm_SetupAttack(EnVm* this) { this->beamScale.x = 0.6f; this->beamSpeed = 40.0f; this->unk_21C = 1; - this->colliderQuad1.base.atFlags &= ~2; + this->colliderQuad1.base.atFlags &= ~AT_HIT; EnVm_SetupAction(this, EnVm_Attack); } void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); + s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); f32 dist; Vec3f playerPos; @@ -227,8 +269,8 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { pitch = 0x1B91; } - if (this->colliderQuad1.base.atFlags & 2) { - this->colliderQuad1.base.atFlags &= ~0x2; + if (this->colliderQuad1.base.atFlags & AT_HIT) { + this->colliderQuad1.base.atFlags &= ~AT_HIT; this->timer = 0; if (this->beamScale.x > 0.1f) { @@ -237,12 +279,11 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { } if (this->beamRot.x < 0xAAA || this->timer == 0) { - Math_SmoothStepToF(&this->beamScale, 0.0f, 1.0f, 0.03f, 0.0f); + Math_SmoothStepToF(&this->beamScale.x, 0.0f, 1.0f, 0.03f, 0.0f); this->unk_260 = 0; if (this->beamScale.x == 0.0f) { - this->beamScale.z = 0.0f; - this->beamScale.y = 0.0f; + this->beamScale.y = this->beamScale.z = 0.0f; EnVm_SetupWait(this); } } else { @@ -250,13 +291,13 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { return; } - Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0); - Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0); - Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xDAC, 0); - playerPos = player->actor.posRot.pos; + Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsPlayer, 10, 0xDAC, 0); + Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsPlayer, 10, 0xDAC, 0); + Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xDAC, 0); + playerPos = player->actor.world.pos; - if (player->actor.groundY > BGCHECK_Y_MIN) { - playerPos.y = player->actor.groundY; + if (player->actor.floorHeight > BGCHECK_Y_MIN) { + playerPos.y = player->actor.floorHeight; } dist = Math_Vec3f_DistXYZ(&this->beamPos1, &playerPos); @@ -265,7 +306,7 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BIMOS_LAZER - SFX_FLAG); if (this->unk_260 > 2) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderQuad1); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderQuad1.base); } this->unk_260 = 3; @@ -305,7 +346,7 @@ void EnVm_Stun(EnVm* this, GlobalContext* globalCtx) { } } } else { - Math_SmoothStepToS(&this->beamRot, 0, 10, 0x5DC, 0); + Math_SmoothStepToS(&this->beamRot.x, 0, 10, 0x5DC, 0); this->timer--; SkelAnime_Update(&this->skelAnime); } @@ -319,12 +360,12 @@ void EnVm_SetupDie(EnVm* this) { this->unk_21C = 3; this->beamScale.z = 0.0f; this->beamScale.y = 0.0f; - this->actor.shape.unk_08 = -5000.0f; - this->actor.posRot.pos.y += 5000.0f * this->actor.scale.y; + this->actor.shape.yOffset = -5000.0f; + this->actor.world.pos.y += 5000.0f * this->actor.scale.y; this->actor.velocity.y = 8.0f; this->actor.gravity = -0.5f; this->actor.speedXZ = Rand_ZeroOne() + 1.0f; - this->actor.posRot.rot.y = Rand_CenteredFloat(65535.0f); + this->actor.world.rot.y = Rand_CenteredFloat(65535.0f); EnVm_SetupAction(this, EnVm_Die); } @@ -336,14 +377,14 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (--this->timer == 0) { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0x6FF, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot, 0xA0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xA0); Actor_Kill(&this->actor); } } @@ -351,22 +392,22 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) { void EnVm_CheckHealth(EnVm* this, GlobalContext* globalCtx) { EnBom* bomb; - if (Actor_GetCollidedExplosive(globalCtx, &this->colliderCylinder) != NULL) { + if (Actor_GetCollidedExplosive(globalCtx, &this->colliderCylinder.base) != NULL) { this->actor.colChkInfo.health--; osSyncPrintf("hp down %d\n", this->actor.colChkInfo.health); } else { - if (!(this->colliderQuad2.base.acFlags & 2) || this->unk_21C == 2) { + if (!(this->colliderQuad2.base.acFlags & AC_HIT) || this->unk_21C == 2) { return; } - this->colliderQuad2.base.acFlags &= ~2; + this->colliderQuad2.base.acFlags &= ~AC_HIT; } if (this->actor.colChkInfo.health != 0) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); EnVm_SetupStun(this); } else { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 20.0f, this->actor.posRot.pos.z, 0, 0, 0x601, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 0, 0, 0x601, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; @@ -397,16 +438,16 @@ void EnVm_Update(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BIMOS_ROLL_HEAD - SFX_FLAG); } - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder); + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); + CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder.base); - if (this->actor.dmgEffectTimer == 0 && this->actor.colChkInfo.health != 0) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder); + if (this->actor.colorFilterTimer == 0 && this->actor.colChkInfo.health != 0) { + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder.base); } - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += (6500.0f + this->actor.shape.unk_08) * this->actor.scale.y; + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2.base); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += (6500.0f + this->actor.shape.yOffset) * this->actor.scale.y; } s32 EnVm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { @@ -460,16 +501,18 @@ void EnVm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Matrix_MultVec3f(&D_80B2EB70, &this->colliderQuad1.dim.quad[2]); Matrix_MultVec3f(&sp74, &this->colliderQuad1.dim.quad[1]); Matrix_MultVec3f(&sp68, &this->colliderQuad1.dim.quad[0]); - func_80062734(&this->colliderQuad1, &this->colliderQuad1.dim.quad[0], &this->colliderQuad1.dim.quad[1], - &this->colliderQuad1.dim.quad[2], &this->colliderQuad1.dim.quad[3]); + Collider_SetQuadVertices(&this->colliderQuad1, &this->colliderQuad1.dim.quad[0], + &this->colliderQuad1.dim.quad[1], &this->colliderQuad1.dim.quad[2], + &this->colliderQuad1.dim.quad[3]); } } Matrix_MultVec3f(&D_80B2EB34, &this->colliderQuad2.dim.quad[1]); Matrix_MultVec3f(&D_80B2EB40, &this->colliderQuad2.dim.quad[0]); Matrix_MultVec3f(&D_80B2EB4C, &this->colliderQuad2.dim.quad[3]); Matrix_MultVec3f(&D_80B2EB58, &this->colliderQuad2.dim.quad[2]); - func_80062734(&this->colliderQuad2, &this->colliderQuad2.dim.quad[0], &this->colliderQuad2.dim.quad[1], - &this->colliderQuad2.dim.quad[2], &this->colliderQuad2.dim.quad[3]); + Collider_SetQuadVertices(&this->colliderQuad2, &this->colliderQuad2.dim.quad[0], + &this->colliderQuad2.dim.quad[1], &this->colliderQuad2.dim.quad[2], + &this->colliderQuad2.dim.quad[3]); } } @@ -484,7 +527,7 @@ void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnVm_OverrideLimbDraw, EnVm_PostLimbDraw, this); - actorPos = this->actor.posRot.pos; + actorPos = this->actor.world.pos; func_80033C30(&actorPos, &D_80B2EB7C, 255, globalCtx); if (this->unk_260 >= 3) { diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index b8cdb50244..e548ef021e 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -24,7 +24,7 @@ void EnWallTubo_SetWallFall(EnWallTubo* this, GlobalContext* globalCtx); const ActorInit En_Wall_Tubo_InitVars = { ACTOR_EN_WALL_TUBO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWallTubo), @@ -40,7 +40,7 @@ void EnWallTubo_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Wall Target osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 壁のツボ ☆☆☆☆☆ \n" VT_RST); - this->unk_164 = this->actor.posRot.pos; + this->unk_164 = this->actor.world.pos; this->actionFunc = EnWallTubo_FindGirl; } @@ -50,7 +50,7 @@ void EnWallTubo_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnWallTubo_FindGirl(EnWallTubo* this, GlobalContext* globalCtx) { Actor* lookForGirl; - lookForGirl = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + lookForGirl = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; while (lookForGirl != NULL) { if (lookForGirl->id != ACTOR_EN_BOM_BOWL_MAN) { @@ -74,7 +74,7 @@ void EnWallTubo_DetectChu(EnWallTubo* this, GlobalContext* globalCtx) { if (this->chuGirl->minigamePlayStatus != 0) { if (globalCtx->cameraPtrs[0]->setting == 0x15) { - chu = (EnBomChu*)globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + chu = (EnBomChu*)globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (chu != NULL) { if ((&chu->actor == &this->actor) || (chu->actor.id != ACTOR_EN_BOM_CHU)) { @@ -82,9 +82,9 @@ void EnWallTubo_DetectChu(EnWallTubo* this, GlobalContext* globalCtx) { continue; } - chuPosDiff.x = chu->actor.posRot.pos.x - this->actor.posRot.pos.x; - chuPosDiff.y = chu->actor.posRot.pos.y - this->actor.posRot.pos.y; - chuPosDiff.z = chu->actor.posRot.pos.z - this->actor.posRot.pos.z; + chuPosDiff.x = chu->actor.world.pos.x - this->actor.world.pos.x; + chuPosDiff.y = chu->actor.world.pos.y - this->actor.world.pos.y; + chuPosDiff.z = chu->actor.world.pos.z - this->actor.world.pos.z; if (((fabsf(chuPosDiff.x) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.y) < 40.0f) || (BREG(2))) && (fabsf(chuPosDiff.z) < 40.0f || (BREG(2)))) { @@ -149,8 +149,8 @@ void EnWallTubo_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (BREG(0)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index f3f3324e3c..b117168f4d 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -42,7 +42,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx); const ActorInit En_Wallmas_InitVars = { ACTOR_EN_WALLMAS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WALLMASTER, sizeof(EnWallmas), @@ -53,27 +53,66 @@ const ActorInit En_Wallmas_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x04, - 0x001E, - 0x0028, - 0x96, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 30, 40, 150 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x4), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(4, 0x4), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x30, 1), - ICHAIN_F32(unk_4C, 0x157C, 1), - ICHAIN_F32_DIV1000(gravity, 0xFA24, 0), + ICHAIN_F32(targetArrowOffset, 0x157C, 1), + ICHAIN_F32_DIV1000(gravity, -1500, 0), }; extern AnimationHeader D_06000EA4; @@ -97,7 +136,7 @@ void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); this->switchFlag = (u8)(thisx->params >> 0x8); thisx->params = thisx->params & 0xFF; @@ -128,8 +167,8 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { this->actor.flags |= 0x20; this->timer = 0x82; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = player->actor.posRot.pos.y; - this->actor.groundY = player->actor.groundY; + this->actor.world.pos.y = player->actor.world.pos.y; + this->actor.floorHeight = player->actor.floorHeight; this->actor.draw = EnWallmas_Draw; this->actionFunc = EnWallmas_WaitToDrop; } @@ -141,10 +180,10 @@ void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, objSegChangee, 0.0f, 20.0f, Animation_GetLastFrame(&D_0600299C), ANIMMODE_ONCE, 0.0f); - this->yTarget = player->actor.posRot.pos.y; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 300.0f; - this->actor.posRot.rot.y = player->actor.shape.rot.y + 0x8000; - this->actor.groundY = player->actor.groundY; + this->yTarget = player->actor.world.pos.y; + this->actor.world.pos.y = player->actor.world.pos.y + 300.0f; + this->actor.world.rot.y = player->actor.shape.rot.y + 0x8000; + this->actor.floorHeight = player->actor.floorHeight; this->actor.flags |= 1; this->actor.flags &= ~0x20; this->actionFunc = EnWallmas_Drop; @@ -157,7 +196,7 @@ void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, objSegChangee, 1.0f, 41.0f, Animation_GetLastFrame(objSegFrameCount), ANIMMODE_ONCE, -3.0f); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND); this->actionFunc = EnWallmas_Land; } @@ -193,10 +232,10 @@ void EnWallmas_SetupReturnToCeiling(EnWallmas* this) { void EnWallmas_SetupTakeDamage(EnWallmas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); - if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x14); @@ -209,7 +248,7 @@ void EnWallmas_SetupCooldown(EnWallmas* this) { Animation_PlayOnce(&this->skelAnime, &D_06000EA4); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnWallmas_Cooldown; } @@ -218,10 +257,10 @@ void EnWallmas_SetupDie(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, 250, -10, 255, 255, 255, 255, 0, 0, - 255, 1, 9, true); + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, 250, -10, 255, 255, 255, 255, 0, 0, 255, + 1, 9, true); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); this->actionFunc = EnWallmas_Die; } @@ -232,7 +271,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->yTarget = this->actor.yDistToLink; + this->yTarget = this->actor.yDistToPlayer; func_8002DF38(globalCtx, &this->actor, 0x25); func_800800F8(globalCtx, 0x251C, 0x270F, &this->actor, 0); } @@ -265,10 +304,10 @@ void EnWallmas_SetupStun(EnWallmas* this) { void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; - this->actor.posRot.pos = *playerPos; - this->actor.groundY = player->actor.groundY; + this->actor.world.pos = *playerPos; + this->actor.floorHeight = player->actor.floorHeight; this->actor.floorPoly = player->actor.floorPoly; if (this->timer != 0) { @@ -276,7 +315,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { } if ((player->stateFlags1 & 0x100000) || (player->stateFlags1 & 0x8000000) || !(player->actor.bgCheckFlags & 1) || - ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, playerPos)))) { + ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos)))) { func_800F8D04(NA_SE_EN_FALL_AIM); this->timer = 0x82; } @@ -294,8 +333,8 @@ void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (!Player_InCsMode(globalCtx) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) && - (this->actor.xzDistToLink < 30.0f) && (this->actor.yDistToLink < -5.0f) && - (-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistToLink)) { + (this->actor.xzDistToPlayer < 30.0f) && (this->actor.yDistToPlayer < -5.0f) && + (-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistToPlayer)) { EnWallmas_SetupTakePlayer(this, globalCtx); } } @@ -311,7 +350,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { EnWallmas_SetupWalk(this); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0xB6); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xB6); } void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { @@ -319,7 +358,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { EnWallmas_SetupJumpToCeiling(this); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.yawTowardsLink + 0x8000), 0xB6); + Math_ScaledStepToS(&this->actor.world.rot.y, (s16)((s32)this->actor.yawTowardsPlayer + 0x8000), 0xB6); if ((Animation_OnFrame(&this->skelAnime, 0.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 12.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 24.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 36.0f) != 0)) { @@ -338,21 +377,21 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame > 20.0f) { this->timer += 9; - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 30.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 30.0f; } if (Animation_OnFrame(&this->skelAnime, 20.0f) != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP); } - if (this->actor.yDistToLink < -900.0f) { + if (this->actor.yDistToPlayer < -900.0f) { if (this->actor.params == WMT_FLAG) { Actor_Kill(&this->actor); return; } if (this->actor.params == WMT_TIMER || - Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { + Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); } else { EnWallmas_ProximityOrSwitchInit(this); @@ -384,7 +423,7 @@ void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015) != 0) { Actor_SetScale(&this->actor, 0.01f); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); Actor_Kill(&this->actor); } this->actor.scale.z = this->actor.scale.x; @@ -404,19 +443,19 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_CATCH); } if (SkelAnime_Update(&this->skelAnime) != 0) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x; - player->actor.posRot.pos.z = this->actor.posRot.pos.z; + player->actor.world.pos.x = this->actor.world.pos.x; + player->actor.world.pos.z = this->actor.world.pos.z; if (this->timer < 0) { - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 2.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 2.0f; } else { - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 10.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 10.0f; } if (LINK_IS_CHILD) { - player->actor.posRot.pos.y = this->actor.posRot.pos.y - 30.0f; + player->actor.world.pos.y = this->actor.world.pos.y - 30.0f; } else { - player->actor.posRot.pos.y = this->actor.posRot.pos.y - 50.0f; + player->actor.world.pos.y = this->actor.world.pos.y - 50.0f; } if (this->timer == -0x1E) { @@ -432,11 +471,11 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->timer = this->timer + 2; } else { - Math_StepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f); + Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f); } - Math_StepToF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 3.0f); - Math_StepToF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 3.0f); + Math_StepToF(&this->actor.world.pos.x, player->actor.world.pos.x, 3.0f); + Math_StepToF(&this->actor.world.pos.z, player->actor.world.pos.z, 3.0f); if (this->timer == 0x1E) { func_80078884(NA_SE_OC_ABYSS); @@ -446,7 +485,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); } } @@ -474,9 +513,9 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) { } void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) != 0) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -495,7 +534,7 @@ void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { } } else { if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) { - EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 40); + EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.world.pos, 40, 40); } EnWallmas_SetupTakeDamage(this); @@ -521,30 +560,30 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->actionFunc != EnWallmas_Drop) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D); - } else if (this->actor.posRot.pos.y <= this->yTarget) { - this->actor.posRot.pos.y = this->yTarget; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D); + } else if (this->actor.world.pos.y <= this->yTarget) { + this->actor.world.pos.y = this->yTarget; this->actor.velocity.y = 0.0f; EnWallmas_SetupLand(this, globalCtx); } if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actionFunc != EnWallmas_TakeDamage) && (this->actor.bgCheckFlags & 1) != 0 && (this->actor.freezeTimer == 0)) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } - Actor_SetHeight(&this->actor, 25.0f); + Actor_SetFocus(&this->actor, 25.0f); if (this->actionFunc == EnWallmas_TakeDamage) { return; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { @@ -561,7 +600,8 @@ void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); - func_80038A28(this->actor.floorPoly, this->actor.posRot.pos.x, this->actor.groundY, this->actor.posRot.pos.z, &mf); + func_80038A28(this->actor.floorPoly, this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z, + &mf); Matrix_Mult(&mf, MTXMODE_NEW); if ((this->actionFunc != EnWallmas_WaitToDrop) && (this->actionFunc != EnWallmas_ReturnToCeiling) && diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 27e02cdee7..23846eefbd 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -33,7 +33,7 @@ void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx); const ActorInit En_Weather_Tag_InitVars = { ACTOR_EN_WEATHER_TAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWeatherTag), @@ -134,7 +134,7 @@ u8 func_80B312C8(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 ret = 0; Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < (this->actor.params >> 8) * 100.0f) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < (this->actor.params >> 8) * 100.0f) { if ((globalCtx->envCtx.unk_1E != 0) || (!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) { D_8011FB38 = 1; @@ -175,7 +175,7 @@ u8 func_80B3149C(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 ret = 0; Player* player = PLAYER; - if ((((this->actor.params >> 8) * 100.0f) + 100.0f) < func_8002DB8C(&player->actor, &this->actor)) { + if ((((this->actor.params >> 8) * 100.0f) + 100.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) { if ((globalCtx->envCtx.unk_1E != 0) || (!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) { D_8011FB38 = 1; @@ -293,7 +293,7 @@ void func_80B31AA0(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { Math_SmoothStepToS(&globalCtx->envCtx.unk_9E, -0x50, 1, 2, 1); Math_SmoothStepToS(&globalCtx->envCtx.unk_A0, -0x7D0, 1, 0x32, 1); } else { @@ -305,7 +305,7 @@ void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { func_80077624(globalCtx); globalCtx->envCtx.lightning = 1; globalCtx->envCtx.unk_EE[0] = 0x19; @@ -316,7 +316,7 @@ void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((((this->actor.params >> 8) * 100.0f) + 10.0f) < func_8002DB8C(&player->actor, &this->actor)) { + if ((((this->actor.params >> 8) * 100.0f) + 10.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) { func_80077684(globalCtx); globalCtx->envCtx.lightning = 2; globalCtx->envCtx.unk_EE[0] = 0; @@ -330,8 +330,8 @@ void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (BREG(0) != 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 7327138672..0552dc9b28 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -23,7 +23,7 @@ extern UNK_TYPE D_06003410; /* const ActorInit En_Weiyer_InitVars = { ACTOR_EN_WEIYER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EI, sizeof(EnWeiyer), @@ -32,6 +32,26 @@ const ActorInit En_Weiyer_InitVars = { (ActorFunc)EnWeiyer_Update, (ActorFunc)EnWeiyer_Draw, }; + +static ColliderCylinderInit D_80B33A90 = { + { + COLTYPE_HIT0, + AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 16, 10, -6, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s") diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index a0a677f838..8ea84f7ace 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -28,7 +28,7 @@ extern UNK_TYPE D_0600A4AC; /* const ActorInit En_Wf_InitVars = { ACTOR_EN_WF, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WF, sizeof(EnWf), @@ -37,6 +37,106 @@ const ActorInit En_Wf_InitVars = { (ActorFunc)EnWf_Update, (ActorFunc)EnWf_Draw, }; + +static ColliderJntSphElementInit D_80B37990[4] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 15, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 21, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 17, { { 800, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B37A20 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 4, + D_80B37990, +}; + +static ColliderCylinderInit D_80B37A30 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 50, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80B37A5C = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 20, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33CB0.s") diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 1adb9c07b3..f250e374af 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -24,14 +24,28 @@ void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx); void EnWonderItem_RollDrop(EnWonderItem* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 20, 30, 0, { 0, 0, 0 } }, }; const ActorInit En_Wonder_Item_InitVars = { ACTOR_EN_WONDER_ITEM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderItem), @@ -70,16 +84,16 @@ void EnWonderItem_DropCollectible(EnWonderItem* this, GlobalContext* globalCtx, for (i = this->dropCount; i > 0; i--) { if (this->itemDrop < WONDERITEM_DROP_RANDOM) { if ((this->itemDrop == WONDERITEM_DROP_FLEXIBLE) || !autoCollect) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, dropTable[this->itemDrop]); + Item_DropCollectible(globalCtx, &this->actor.world.pos, dropTable[this->itemDrop]); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, dropTable[this->itemDrop] | 0x8000); + Item_DropCollectible(globalCtx, &this->actor.world.pos, dropTable[this->itemDrop] | 0x8000); } } else { randomDrop = this->itemDrop - WONDERITEM_DROP_RANDOM; if (!autoCollect) { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, randomDrop); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, randomDrop); } else { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, randomDrop | 0x8000); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, randomDrop | 0x8000); } } } @@ -111,7 +125,7 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 1; + this->actor.targetMode = 1; if ((this->switchFlag >= 0) && Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); @@ -119,30 +133,30 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { } switch (this->wonderMode) { case WONDERITEM_MULTITAG_FREE: - this->numTagPoints = this->actor.posRot.rot.z & 0xF; + this->numTagPoints = this->actor.world.rot.z & 0xF; rotZover10 = 0; - if (this->actor.posRot.rot.z >= 10) { - rotZover10 = this->actor.posRot.rot.z / 10; + if (this->actor.world.rot.z >= 10) { + rotZover10 = this->actor.world.rot.z / 10; this->timerMod = rotZover10 * 20; } - this->numTagPoints = this->actor.posRot.rot.z - rotZover10 * 10; + this->numTagPoints = this->actor.world.rot.z - rotZover10 * 10; // i.e timerMod = rot.z / 10 seconds, numTagPoints = rot.z % 10 this->updateFunc = EnWonderItem_MultitagFree; break; case WONDERITEM_TAG_POINT_FREE: - tagIndex = this->actor.posRot.rot.z & 0xFF; - sTagPointsFree[tagIndex] = this->actor.posRot.pos; + tagIndex = this->actor.world.rot.z & 0xFF; + sTagPointsFree[tagIndex] = this->actor.world.pos; Actor_Kill(&this->actor); break; case WONDERITEM_PROXIMITY_DROP: - this->dropCount = this->actor.posRot.rot.z & 0xFF; + this->dropCount = this->actor.world.rot.z & 0xFF; this->updateFunc = EnWonderItem_ProximityDrop; break; case WONDERITEM_INTERACT_SWITCH: - colTypeIndex = this->actor.posRot.rot.z & 0xFF; + colTypeIndex = this->actor.world.rot.z & 0xFF; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.body.bumper.flags = collisionTypes[colTypeIndex]; + this->collider.info.bumper.dmgFlags = collisionTypes[colTypeIndex]; this->collider.dim.radius = 20; this->collider.dim.height = 30; this->updateFunc = EnWonderItem_InteractSwitch; @@ -150,19 +164,19 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { case WONDERITEM_UNUSED: break; case WONDERITEM_MULTITAG_ORDERED: - this->numTagPoints = this->actor.posRot.rot.z & 0xF; + this->numTagPoints = this->actor.world.rot.z & 0xF; rotZover10 = 0; - if (this->actor.posRot.rot.z >= 10) { - rotZover10 = this->actor.posRot.rot.z / 10; + if (this->actor.world.rot.z >= 10) { + rotZover10 = this->actor.world.rot.z / 10; this->timerMod = rotZover10 * 20; } - this->numTagPoints = this->actor.posRot.rot.z - rotZover10 * 10; + this->numTagPoints = this->actor.world.rot.z - rotZover10 * 10; // i.e timerMod = rot.z / 10 seconds, numTagPoints = rot.z % 10 this->updateFunc = EnWonderItem_MultitagOrdered; break; case WONDERITEM_TAG_POINT_ORDERED: - tagIndex = this->actor.posRot.rot.z & 0xFF; - sTagPointsOrdered[tagIndex] = this->actor.posRot.pos; + tagIndex = this->actor.world.rot.z & 0xFF; + sTagPointsOrdered[tagIndex] = this->actor.world.pos; Actor_Kill(&this->actor); break; case WONDERITEM_PROXIMITY_SWITCH: @@ -171,14 +185,14 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { case WONDERITEM_BOMB_SOLDIER: Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.body.bumper.flags = 0x00000004; // slingshot - this->unkPos = this->actor.posRot.pos; + this->collider.info.bumper.dmgFlags = 0x00000004; // slingshot + this->unkPos = this->actor.world.pos; this->collider.dim.radius = 35; this->collider.dim.height = 75; this->updateFunc = EnWonderItem_BombSoldier; break; case WONDERITEM_ROLL_DROP: - this->dropCount = this->actor.posRot.rot.z & 0xFF; + this->dropCount = this->actor.world.rot.z & 0xFF; this->updateFunc = EnWonderItem_RollDrop; break; default: @@ -195,9 +209,9 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.posRot.pos.x - sTagPointsFree[i].x; - f32 dy = player->actor.posRot.pos.y - sTagPointsFree[i].y; - f32 dz = player->actor.posRot.pos.z - sTagPointsFree[i].z; + f32 dx = player->actor.world.pos.x - sTagPointsFree[i].x; + f32 dy = player->actor.world.pos.y - sTagPointsFree[i].y; + f32 dz = player->actor.world.pos.z - sTagPointsFree[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { this->tagFlags |= mask; @@ -207,8 +221,8 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { } if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); } } } @@ -227,14 +241,14 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_ProximityDrop(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { EnWonderItem_DropCollectible(this, globalCtx, true); } } void EnWonderItem_InteractSwitch(EnWonderItem* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnWonderItem_DropCollectible(this, globalCtx, false); } } @@ -242,7 +256,7 @@ void EnWonderItem_InteractSwitch(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_ProximitySwitch(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { if (this->switchFlag >= 0) { Flags_SetSwitch(globalCtx, this->switchFlag); } @@ -258,9 +272,9 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.posRot.pos.x - sTagPointsOrdered[i].x; - f32 dy = player->actor.posRot.pos.y - sTagPointsOrdered[i].y; - f32 dz = player->actor.posRot.pos.z - sTagPointsOrdered[i].z; + f32 dx = player->actor.world.pos.x - sTagPointsOrdered[i].x; + f32 dy = player->actor.world.pos.y - sTagPointsOrdered[i].y; + f32 dz = player->actor.world.pos.z - sTagPointsOrdered[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { if (prevTagFlags & mask) { @@ -277,8 +291,8 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) } } else if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } } @@ -292,10 +306,10 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) } void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HEISHI2, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HEISHI2, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 9) != NULL) { // Careless soldier spawned osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ うっかり兵セット完了 ☆☆☆☆☆ \n" VT_RST); @@ -310,8 +324,8 @@ void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_RollDrop(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (player->invincibilityTimer < 0) && - (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (player->invincibilityTimer < 0) && + (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { EnWonderItem_DropCollectible(this, globalCtx, true); } } @@ -331,10 +345,10 @@ void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx) { this->updateFunc(this, globalCtx); if (this->wonderMode == WONDERITEM_UNUSED) { - Actor_SetHeight(&this->actor, this->unkHeight); + Actor_SetFocus(&this->actor, this->unkHeight); } if ((this->wonderMode == WONDERITEM_INTERACT_SWITCH) || (this->wonderMode == WONDERITEM_BOMB_SOLDIER)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -343,8 +357,8 @@ void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx) { colorIndex = 0; } if (BREG(0) != 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, debugArrowColors[colorIndex], debugArrowColors[colorIndex + 1], debugArrowColors[colorIndex + 2], 255, 4, globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index fd3cea808c..2ecf6dadaa 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -21,7 +21,7 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx); const ActorInit En_Wonder_Talk_InitVars = { ACTOR_EN_WONDER_TALK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderTalk), @@ -47,7 +47,7 @@ void EnWonderTalk_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 1; + this->actor.targetMode = 1; if (this->switchFlag >= 0) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); @@ -150,8 +150,8 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx) { } this->actionFunc = func_80B391CC; } - } else if (!(this->unk_15C < this->actor.xzDistToLink)) { - yawDiffTemp = (this->actor.yawTowardsLink - this->actor.posRot.rot.y); + } else if (!(this->unk_15C < this->actor.xzDistToPlayer)) { + yawDiffTemp = (this->actor.yawTowardsPlayer - this->actor.world.rot.y); yawDiff = ABS(yawDiffTemp); if (yawDiff < 0x4000) { @@ -164,7 +164,7 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx) { // Actual message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); osSyncPrintf("\n\n"); } this->unk_15A = 0; @@ -213,8 +213,8 @@ void func_80B395F0(EnWonderTalk* this, GlobalContext* globalCtx) { case 3: func_80106CCC(globalCtx); if (this->unk_164 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 2); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 2); this->unk_164 = 1; } @@ -223,8 +223,8 @@ void func_80B395F0(EnWonderTalk* this, GlobalContext* globalCtx) { case 5: func_80106CCC(globalCtx); if (this->unk_164 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 3); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 3); this->unk_164 = 1; } this->actionFunc = func_80B391CC; @@ -241,18 +241,18 @@ void EnWonderTalk_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_158--; } this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); if (BREG(0) != 0) { if (this->unk_15A != 0) { if ((this->unk_15A & 1) == 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 10, 10, 10, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 10, 10, 10, 255, 4, globalCtx->state.gfxCtx); } } else { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 5a458bac40..0e2a7eba84 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -23,7 +23,7 @@ void EnWonderTalk2_DoNothing(EnWonderTalk2* this, GlobalContext* globalCtx); const ActorInit En_Wonder_Talk2_InitVars = { ACTOR_EN_WONDER_TALK2, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderTalk2), @@ -46,9 +46,9 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { // Transparent message osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->baseMsgId = (this->actor.params >> 6) & 0xFF; - if (this->actor.posRot.rot.z > 0) { + if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; - s16 rotZmod10 = this->actor.posRot.rot.z; + s16 rotZmod10 = this->actor.world.rot.z; while (rotZmod10 > 10) { rotZmod10 -= 10; @@ -60,13 +60,13 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { rangeIndex = 0; } - this->actor.unk_1F = D_80B3A8E0[rangeIndex]; + this->actor.targetMode = D_80B3A8E0[rangeIndex]; osSyncPrintf("\n\n"); // originally? - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); // The range is? - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.unk_1F); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.targetMode); // Is the range? osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ は、範囲わ? ☆☆☆☆☆ %f\n" VT_RST, this->triggerRange); osSyncPrintf("\n\n"); @@ -74,7 +74,7 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); } - this->initPos = this->actor.posRot.pos; + this->initPos = this->actor.world.pos; this->switchFlag = (this->actor.params & 0x3F); this->talkMode = ((this->actor.params >> 0xE) & 3); @@ -128,10 +128,10 @@ void func_80B3A15C(EnWonderTalk2* this, GlobalContext* globalCtx) { this->actionFunc = func_80B3A10C; } else { - s16 yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.posRot.rot.y)); + s16 yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y)); - if (!((this->actor.xzDistToLink > 40.0f + this->triggerRange) || - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { + if (!((this->actor.xzDistToPlayer > 40.0f + this->triggerRange) || + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { if (this->unk_158 >= 2) { osSyncPrintf("\n\n"); // Transparent Message Kimi Set @@ -143,7 +143,7 @@ void func_80B3A15C(EnWonderTalk2* this, GlobalContext* globalCtx) { // Actual message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); // Processing range osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); switch (this->talkMode) { @@ -215,10 +215,10 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) { } else if ((this->talkMode != 4) || !this->unk_15A) { if (BREG(2) != 0) { // distance - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ きょり %f\n" VT_RST, this->actor.xzDistToLink); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ きょり %f\n" VT_RST, this->actor.xzDistToPlayer); } - if (((this->actor.xzDistToLink < (40.0f + this->triggerRange)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f)) && + if (((this->actor.xzDistToPlayer < (40.0f + this->triggerRange)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && !Gameplay_InCsMode(globalCtx)) { if (this->unk_158 >= 2) { osSyncPrintf("\n\n"); @@ -231,11 +231,11 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) { // Real message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); // Processing range osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); // What is your range? - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.unk_1F); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.targetMode); osSyncPrintf("\n\n"); osSyncPrintf("\n\n"); switch (this->talkMode) { @@ -273,20 +273,20 @@ void EnWonderTalk2_Update(Actor* thisx, GlobalContext* globalCtx) { EnWonderTalk2* this = THIS; this->actionFunc(this, globalCtx); - this->actor.posRot.pos.y = this->initPos.y; + this->actor.world.pos.y = this->initPos.y; - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); if (BREG(0) != 0) { if (this->unk_158 != 0) { if ((this->unk_158 & 1) == 0) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx->state.gfxCtx); } } else { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 74f75420ae..9187929538 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -36,7 +36,7 @@ typedef enum { const ActorInit En_Wood02_InitVars = { ACTOR_EN_WOOD02, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_WOOD02, sizeof(EnWood02), @@ -47,8 +47,22 @@ const ActorInit En_Wood02_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK13, 0x00, 0x0D, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x05, { 0x00000000, 0x00, 0x00 }, { 0x0FC0074A, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_TREE, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK5, + { 0x00000000, 0x00, 0x00 }, + { 0x0FC0074A, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 18, 60, 0, { 0, 0, 0 } }, }; @@ -57,7 +71,7 @@ static f32 sSpawnDistance[] = { 707.0f, 525.0f, 510.0f, 500.0f, 566.0f, 141.0f } static s16 sSpawnAngle[] = { 0x1FFF, 0x4C9E, 0x77F5, 0xA5C9, 0xD6C3, 0xA000 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), }; static Gfx* D_80B3BF54[] = { @@ -109,11 +123,11 @@ void EnWood02_SpawnOffspring(EnWood02* this, GlobalContext* globalCtx) { extraRot = 0x4000; } childSpawnAngle = &sSpawnAngle[i]; - sSpawnCos = Math_CosS(*childSpawnAngle + this->actor.posRot.rot.y + extraRot); - sSpawnSin = Math_SinS(*childSpawnAngle + this->actor.posRot.rot.y + extraRot); - childPos.x = (sSpawnDistance[i] * sSpawnSin) + this->actor.initPosRot.pos.x; - childPos.y = this->actor.initPosRot.pos.y; - childPos.z = (sSpawnDistance[i] * sSpawnCos) + this->actor.initPosRot.pos.z; + sSpawnCos = Math_CosS(*childSpawnAngle + this->actor.world.rot.y + extraRot); + sSpawnSin = Math_SinS(*childSpawnAngle + this->actor.world.rot.y + extraRot); + childPos.x = (sSpawnDistance[i] * sSpawnSin) + this->actor.home.pos.x; + childPos.y = this->actor.home.pos.y; + childPos.z = (sSpawnDistance[i] * sSpawnCos) + this->actor.home.pos.z; if (EnWood02_SpawnZoneCheck(this, globalCtx, &childPos)) { if ((this->unk_14E[i] & 0x80) != 0) { childParams = (0xFF00 | (this->actor.params + 1)); @@ -122,7 +136,7 @@ void EnWood02_SpawnOffspring(EnWood02* this, GlobalContext* globalCtx) { } childWood = (EnWood02*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_WOOD02, childPos.x, childPos.y, childPos.z, - this->actor.posRot.rot.x, *childSpawnAngle, 0, childParams); + this->actor.world.rot.x, *childSpawnAngle, 0, childParams); if (childWood != NULL) { childWood->unk_14E[0] = i; this->unk_14E[i] |= 1; @@ -149,10 +163,10 @@ void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx2) { actorScale = 1.0f; this->unk_14C = (this->actor.params >> 8) & 0xFF; - if (this->actor.initPosRot.rot.z != 0) { - this->actor.initPosRot.rot.z = (this->actor.initPosRot.rot.z << 8) | this->unk_14C; + if (this->actor.home.rot.z != 0) { + this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; this->unk_14C = -1; - this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.world.rot.z = this->actor.shape.rot.z = 0; } else if (this->unk_14C & 0x80) { this->unk_14C = -1; } @@ -243,29 +257,28 @@ void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx2) { if (spawnType == WOOD_SPAWN_SPAWNER) { this->drawType |= this->unk_14C << 4; EnWood02_SpawnOffspring(this, globalCtx); - sSpawnCos = Math_CosS(sSpawnAngle[5] + this->actor.posRot.rot.y + extraRot); - sSpawnSin = Math_SinS(sSpawnAngle[5] + this->actor.posRot.rot.y + extraRot); - this->actor.posRot.pos.x += (sSpawnSin * sSpawnDistance[5]); - this->actor.posRot.pos.z += (sSpawnCos * sSpawnDistance[5]); + sSpawnCos = Math_CosS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); + sSpawnSin = Math_SinS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); + this->actor.world.pos.x += (sSpawnSin * sSpawnDistance[5]); + this->actor.world.pos.z += (sSpawnCos * sSpawnDistance[5]); } else { this->actor.flags |= 0x10; } // Snap to floor, or remove if over void - this->actor.posRot.pos.y += 200.0f; - floorY = - BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &outPoly, &bgId, &this->actor, &this->actor.posRot.pos); + this->actor.world.pos.y += 200.0f; + floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &outPoly, &bgId, &this->actor, &this->actor.world.pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY; + this->actor.world.pos.y = floorY; } else { Actor_Kill(&this->actor); return; } } ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - this->actor.initPosRot.rot.y = 0; - this->actor.colChkInfo.mass = 0xFF; + this->actor.home.rot.y = 0; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } void EnWood02_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -306,24 +319,24 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { } if (this->actor.params <= WOOD_TREE_KAKARIKO_ADULT) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_IT_REFLECTION_WOOD); } - if (this->actor.initPosRot.rot.y != 0) { - dropsSpawnPt = this->actor.posRot.pos; + if (this->actor.home.rot.y != 0) { + dropsSpawnPt = this->actor.world.pos; dropsSpawnPt.y += 200.0f; if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { Item_DropCollectibleRandom(globalCtx, &this->actor, &dropsSpawnPt, this->unk_14C << 4); } else { - if (this->actor.initPosRot.rot.z != 0) { - this->actor.initPosRot.rot.z &= 0x1FFF; - this->actor.initPosRot.rot.z |= 0xE000; + if (this->actor.home.rot.z != 0) { + this->actor.home.rot.z &= 0x1FFF; + this->actor.home.rot.z |= 0xE000; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, dropsSpawnPt.x, dropsSpawnPt.y, - dropsSpawnPt.z, 0, this->actor.posRot.rot.y, 0, this->actor.initPosRot.rot.z); - this->actor.initPosRot.rot.z = 0; + dropsSpawnPt.z, 0, this->actor.world.rot.y, 0, this->actor.home.rot.z); + this->actor.home.rot.z = 0; } } @@ -343,11 +356,11 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { } } this->unk_14C = -0x15; - this->actor.initPosRot.rot.y = 0; + this->actor.home.rot.y = 0; } - if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + if (this->actor.xzDistToPlayer < 600.0f) { + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -355,12 +368,12 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { Player* player = PLAYER; if (this->unk_14C >= -1) { - if (((player->rideActor == NULL) && (sqrt(this->actor.xyzDistToLinkSq) < 20.0) && + if (((player->rideActor == NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 20.0) && (player->linearVelocity != 0.0f)) || - ((player->rideActor != NULL) && (sqrt(this->actor.xyzDistToLinkSq) < 60.0) && + ((player->rideActor != NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 60.0) && (player->rideActor->speedXZ != 0.0f))) { if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, ((this->unk_14C << 4) | 0x8000)); } this->unk_14C = -0x15; @@ -384,8 +397,8 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_14C < -1) { this->unk_14C++; wobbleAmplitude = Math_SinS((this->unk_14C ^ 0xFFFF) * 0x3332) * 250.0f; - this->actor.shape.rot.x = (Math_CosS(this->actor.yawTowardsLink - this->actor.shape.rot.y) * wobbleAmplitude); - this->actor.shape.rot.z = (Math_SinS(this->actor.yawTowardsLink - this->actor.shape.rot.y) * wobbleAmplitude); + this->actor.shape.rot.x = (Math_CosS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) * wobbleAmplitude); + this->actor.shape.rot.z = (Math_SinS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) * wobbleAmplitude); } } diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 4cae1ff07d..95773b6b2a 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -49,7 +49,7 @@ extern UNK_TYPE D_0601C0E8; /* const ActorInit En_Xc_InitVars = { ACTOR_EN_XC, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_XC, sizeof(EnXc), @@ -58,6 +58,25 @@ const ActorInit En_Xc_InitVars = { (ActorFunc)EnXc_Update, (ActorFunc)EnXc_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 25, 80, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s") diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 057dd87f5a..10abcdbc44 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -17,7 +17,7 @@ void EnYabusameMark_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Yabusame_Mark_InitVars = { ACTOR_EN_YABUSAME_MARK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnYabusameMark), @@ -26,6 +26,26 @@ const ActorInit En_Yabusame_Mark_InitVars = { (ActorFunc)EnYabusameMark_Update, NULL, }; + +static ColliderQuadInit D_80B434F0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Destroy.s") diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 7f8daa3f97..99e2c543e1 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -21,7 +21,7 @@ void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx); const ActorInit En_Yukabyun_InitVars = { ACTOR_EN_YUKABYUN, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_YUKABYUN, sizeof(EnYukabyun), @@ -32,14 +32,28 @@ const ActorInit En_Yukabyun_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 28, 8, 0, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 16, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 16, ICHAIN_STOP), }; static UNK_PTR D_80B43F64[] = { 0x06000AF0, 0x06000000 }; @@ -51,7 +65,7 @@ void EnYukabyun_Init(Actor* thisx, GlobalContext* globalCtx) { EnYukabyun* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 0.4f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.4f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.params++; @@ -79,17 +93,17 @@ void func_80B43AD4(EnYukabyun* this, GlobalContext* globalCtx) { this->unk_150 += 0xA0; this->actor.shape.rot.y += this->unk_150; if (this->unk_150 >= 0x2000) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 10.0f; this->actionfunc = func_80B43B6C; } - Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 30.0f, 1.0f); + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 30.0f, 1.0f); func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); } void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += this->unk_150; - if (this->actor.xzDistToLink > 5000.0f) { + if (this->actor.xzDistToPlayer > 5000.0f) { Actor_Kill(&this->actor); return; } @@ -97,7 +111,7 @@ void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx) { } void EnYukabyun_Break(EnYukabyun* this, GlobalContext* globalCtx) { - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 8.0f, 0, 1300, 300, 15, OBJECT_YUKABYUN, 10, + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 8.0f, 0, 1300, 300, 15, OBJECT_YUKABYUN, 10, D_06000A60); Actor_Kill(&this->actor); } @@ -106,14 +120,14 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { EnYukabyun* this = THIS; s32 pad; - if (((this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) || - ((this->collider.base.maskA & 2) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || + if (((this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || + ((this->collider.base.ocFlags1 & OC1_HIT) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || ((this->actionfunc == func_80B43B6C) && (this->actor.bgCheckFlags & 8))) { - this->collider.base.atFlags &= ~0x2; - this->collider.base.acFlags &= ~0x2; - this->collider.base.maskA &= ~0x2; + this->collider.base.atFlags &= ~AT_HIT; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.base.ocFlags1 &= ~OC1_HIT; this->actor.flags &= ~0x5; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_ROCK); this->actionfunc = EnYukabyun_Break; } @@ -121,8 +135,8 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (!(this->actionfunc == func_80B43A94 || this->actionfunc == EnYukabyun_Break)) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); + Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; @@ -130,7 +144,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 4.0f); + Actor_SetFocus(&this->actor, 4.0f); } void EnYukabyun_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 4b5390b37a..edf2c03922 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -33,7 +33,7 @@ extern UNK_TYPE D_06016388; /* const ActorInit En_Zf_InitVars = { ACTOR_EN_ZF, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ZF, sizeof(EnZf), @@ -42,6 +42,46 @@ const ActorInit En_Zf_InitVars = { (ActorFunc)EnZf_Update, (ActorFunc)EnZf_Draw, }; + +static ColliderCylinderInit D_80B4A1D8 = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_80B4A204 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44050.s") diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index 7c652bc297..5075ea9af6 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -28,7 +28,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx); const ActorInit En_Zl1_InitVars = { ACTOR_EN_ZL1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL1, sizeof(EnZl1), @@ -39,8 +39,22 @@ const ActorInit En_Zl1_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 46, 0, { 0, 0, 0 } }, }; @@ -78,8 +92,8 @@ void EnZl1_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); - this->actor.unk_1F = 0; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); + this->actor.targetMode = 0; if (gSaveContext.sceneSetupIndex >= 4) { frameCount = Animation_GetLastFrame(&D_06000438); @@ -133,7 +147,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); if (this->unk_1E6 != 0) { if (func_8002F334(&this->actor, globalCtx)) { @@ -141,11 +155,11 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) { } } else if (func_8002F194(&this->actor, globalCtx)) { this->unk_1E6 = 1; - } else if (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) { + } else if (this->actor.world.pos.y <= player->actor.world.pos.y) { func_8002F2F4(&this->actor, globalCtx); } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -175,15 +189,15 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) { Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 30.0f); ShrinkWindow_SetVal(0x20); Interface_ChangeAlpha(2); - player->actor.posRot.pos = playerPos; + player->actor.world.pos = playerPos; player->actor.speedXZ = 0.0f; this->unk_1E2 = 0; this->actionFunc = func_80B4B240; func_800F5C64(0x51); } else { if (1) {} // necessary to match - rotDiff = ABS(this->actor.yawTowardsLink - this->actor.shape.rot.y); - if ((rotDiff < 0x238E) && !(player->actor.posRot.pos.y < this->actor.posRot.pos.y)) { + rotDiff = ABS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y); + if ((rotDiff < 0x238E) && !(player->actor.world.pos.y < this->actor.world.pos.y)) { func_8002F2F4(&this->actor, globalCtx); } } @@ -227,7 +241,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) { globalCtx->envCtx.unk_E1 = 0; Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp74, &sp68); Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 25.0f); - player->actor.posRot.pos = sp58; + player->actor.world.pos = sp58; this->actor.textId = 0x702F; func_8010B720(globalCtx, this->actor.textId); this->unk_1E2++; @@ -322,7 +336,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) { frameCount = Animation_GetLastFrame(animHeaderSeg); Animation_Change(&this->skelAnime, animHeaderSeg, 1.0f, 0.0f, frameCount, sp54[sp3C], -10.0f); } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); } void func_80B4B7F4(CsCmdActorAction* npcAction, Vec3f* pos) { @@ -375,8 +389,8 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) { func_80B4B834(npcAction, &sp68); if (this->unk_1E6 == 0) { sp48 = sp74; - this->actor.initPosRot.pos = sp48; - this->actor.posRot.pos = sp48; + this->actor.home.pos = sp48; + this->actor.world.pos = sp48; } if (this->unk_1E6 != npcAction->action) { frameCount = Animation_GetLastFrame(spB0[npcAction->action]); @@ -395,7 +409,7 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) { } this->actor.velocity.z = (sp68.z - sp74.z) / actionLength; } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp98, &sp8C); Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 70.0f); } @@ -442,7 +456,7 @@ void func_80B4BC78(EnZl1* this, GlobalContext* globalCtx) { func_80B4B7F4(npcAction, &sp70); func_80B4B834(npcAction, &sp64); if (this->unk_1E6 == 0) { - this->actor.posRot.pos = this->actor.initPosRot.pos = sp70; + this->actor.world.pos = this->actor.home.pos = sp70; } if (this->unk_1E6 != npcAction->action) { @@ -515,7 +529,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) { } break; case 4: - if (player->actor.posRot.pos.y < this->actor.posRot.pos.y) { + if (player->actor.world.pos.y < this->actor.world.pos.y) { break; } else { if (func_8002F194(&this->actor, globalCtx)) { @@ -539,7 +553,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) { } break; } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); } void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -549,15 +563,15 @@ void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actionFunc != func_80B4B8B4) && (this->actionFunc != func_80B4BC78)) { SkelAnime_Update(&this->skelAnime); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5); this->actionFunc(this, globalCtx); if (this->actionFunc != func_80B4B8B4) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0xA, 0x3E8, 1); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 0xA, 0x3E8, 1); - Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.posRot.rot.z, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0xA, 0x3E8, 1); func_80B4AE18(this); } @@ -587,7 +601,7 @@ void func_80B4C400(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* EnZl1* this = THIS; if (limbIndex == 17) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 3d65933671..681c44073d 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -91,7 +91,7 @@ static EnZl2DrawFunc sDrawFuncs[] = { const ActorInit En_Zl2_InitVars = { ACTOR_EN_ZL2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL2, sizeof(EnZl2), @@ -236,7 +236,7 @@ void func_80B4ED18(EnZl2* this, s16 arg1) { } void func_80B4ED2C(EnZl2* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 EnZl2_FrameUpdateMatrix(EnZl2* this) { @@ -254,10 +254,10 @@ void func_80B4EDB8(EnZl2* this, GlobalContext* globalCtx, s32 arg2) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, arg2); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -661,9 +661,9 @@ void EnZl2_GiveLightArrows(EnZl2* this, GlobalContext* globalCtx) { if (this->unk_244 == 0) { player = PLAYER; - posX = player->actor.posRot.pos.x; - posY = player->actor.posRot.pos.y + 80.0f; - posZ = player->actor.posRot.pos.z; + posX = player->actor.world.pos.x; + posY = player->actor.world.pos.y + 80.0f; + posZ = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0x17); Item_Give(globalCtx, ITEM_ARROW_LIGHT); this->unk_244 = 1; @@ -676,9 +676,9 @@ void func_80B4FF84(EnZl2* this, GlobalContext* globalCtx) { f32 posZ; if (this->unk_250 == 0) { - posX = this->actor.posRot.pos.x; - posY = this->actor.posRot.pos.y; - posZ = this->actor.posRot.pos.z; + posX = this->actor.world.pos.x; + posY = this->actor.world.pos.y; + posZ = this->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 4); this->unk_250 = 1; @@ -691,9 +691,9 @@ void func_80B4FFF0(EnZl2* this, GlobalContext* globalCtx) { f32 posZ; if (this->unk_248 == 0) { - posX = this->actor.posRot.pos.x; - posY = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - posZ = this->actor.posRot.pos.z; + posX = this->actor.world.pos.x; + posY = this->actor.world.pos.y + (kREG(5) + -26.0f); + posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0x4000, 0, 3); @@ -705,15 +705,15 @@ void func_80B5008C(EnZl2* this) { Actor* child = this->actor.child; if (child != NULL) { - child->posRot.pos.x = this->actor.posRot.pos.x; - child->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - child->posRot.pos.z = this->actor.posRot.pos.z; + child->world.pos.x = this->actor.world.pos.x; + child->world.pos.y = this->actor.world.pos.y + (kREG(5) + -26.0f); + child->world.pos.z = this->actor.world.pos.z; } } void func_80B500E0(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -746,7 +746,7 @@ void func_80B501E8(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); if (npcAction != NULL) { - this->actor.shape.unk_14 = this->alpha = + this->actor.shape.shadowAlpha = this->alpha = (1.0f - func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames)) * 255.0f; func_80B501C4(this, this->alpha); } @@ -755,24 +755,24 @@ void func_80B501E8(EnZl2* this, GlobalContext* globalCtx) { void func_80B50260(EnZl2* this, GlobalContext* globalCtx) { this->action = 1; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B50278(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; - this->actor.shape.unk_14 = 0xFF; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.shape.shadowAlpha = 0xFF; this->action = 2; this->drawConfig = 1; } void func_80B50304(EnZl2* this, GlobalContext* globalCtx) { s32 pad[2]; - ActorShape* actorShape = &this->actor.shape; + ActorShape* shape = &this->actor.shape; CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); f32 actionXDelta; f32 actionZDelta; @@ -783,8 +783,8 @@ void func_80B50304(EnZl2* this, GlobalContext* globalCtx) { this->action = 3; this->drawConfig = 1; this->unk_23C = 0.0f; - actorShape->unk_14 = 0xFF; - this->actor.posRot.rot.y = actorShape->rot.y = Math_FAtan2F(actionXDelta, actionZDelta) * 10430.3779296875f; + shape->shadowAlpha = 255; + this->actor.world.rot.y = shape->rot.y = Math_FAtan2F(actionXDelta, actionZDelta) * 10430.3779296875f; } void func_80B503DC(EnZl2* this, GlobalContext* globalCtx) { @@ -799,7 +799,7 @@ void func_80B5042C(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_060022D0, 2, -8.0f, 0); this->action = 5; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -817,7 +817,7 @@ void func_80B504D4(EnZl2* this, GlobalContext* globalCtx) { this->drawConfig = 1; this->unk_27C = 0.0f; func_80B4ED18(this, 1); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B5053C(EnZl2* this, s32 arg1) { @@ -831,7 +831,7 @@ void func_80B50580(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06000A50, 2, -8.0f, 0); this->action = 9; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B505D4(EnZl2* this, s32 arg1) { @@ -855,7 +855,7 @@ void func_80B50670(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_0600B5FC, 0, -8.0f, 0); this->action = 13; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B506C4(EnZl2* this, GlobalContext* globalCtx) { @@ -864,7 +864,7 @@ void func_80B506C4(EnZl2* this, GlobalContext* globalCtx) { this->drawConfig = 1; func_80B4ECE8(this, 4); func_80B4ED18(this, 2); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_80B4FE90(this); } @@ -879,7 +879,7 @@ void func_80B50780(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06001670, 2, -8.0f, 0); this->action = 16; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_80B4FFF0(this, globalCtx); func_80B4ECE8(this, 3); } @@ -895,7 +895,7 @@ void func_80B5082C(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06002B14, 2, -8.0f, 0); this->action = 18; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B50880(EnZl2* this, s32 arg1) { @@ -911,7 +911,7 @@ void func_80B508C8(EnZl2* this, GlobalContext* globalCtx) { this->action = 20; this->drawConfig = 1; func_80B4ECE8(this, 6); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B50928(EnZl2* this, s32 arg1) { @@ -1211,9 +1211,9 @@ void func_80B513A8(EnZl2* this, GlobalContext* globalCtx) { if (this->unk_250 == 0) { player = PLAYER; - posX = player->actor.posRot.pos.x; - posY = player->actor.posRot.pos.y; - posZ = player->actor.posRot.pos.z; + posX = player->actor.world.pos.x; + posY = player->actor.world.pos.y; + posZ = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 7); this->unk_250 = 1; } @@ -1272,7 +1272,7 @@ void func_80B5154C(EnZl2* this, GlobalContext* globalCtx) { void func_80B515C4(EnZl2* this) { this->action = 25; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B515D8(EnZl2* this, GlobalContext* globalCtx) { @@ -1280,7 +1280,7 @@ void func_80B515D8(EnZl2* this, GlobalContext* globalCtx) { func_80B4EDB8(this, globalCtx, 0); this->action = 26; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1294,7 +1294,7 @@ void func_80B51678(EnZl2* this) { func_80B4FD00(this, &D_06007D0C, 2, -8.0f, 0); this->action = 27; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1308,7 +1308,7 @@ void func_80B51704(EnZl2* this) { func_80B4FD00(this, &D_060090D8, 2, -8.0f, 0); this->action = 28; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1322,7 +1322,7 @@ void func_80B51790(EnZl2* this) { func_80B4FD00(this, &D_06005F40, 2, -8.0f, 0); this->action = 29; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B517E0(EnZl2* this, s32 arg1) { @@ -1336,7 +1336,7 @@ void func_80B51824(EnZl2* this) { func_80B4FD00(this, &D_060022D0, 2, -8.0f, 0); this->action = 30; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1351,7 +1351,7 @@ void func_80B518C0(EnZl2* this) { func_80B4FD00(this, SEGMENTED_TO_VIRTUAL(&D_06004900), 2, -8.0f, 0); this->action = 32; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1459,7 +1459,7 @@ void func_80B51CA8(EnZl2* this, GlobalContext* globalCtx) { void func_80B51D0C(EnZl2* this, GlobalContext* globalCtx) { this->action = 33; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { @@ -1470,7 +1470,7 @@ void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(skelAnime, 6.0f)) || (Animation_OnFrame(skelAnime, 0.0f))) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); func_80078914(&this->actor.projectedPos, sfxId); } } @@ -1478,7 +1478,7 @@ void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { void func_80B51DA4(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -1507,7 +1507,7 @@ void func_80B51DA4(EnZl2* this, GlobalContext* globalCtx) { void func_80B51EA8(EnZl2* this) { this->action = 33; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B51EBC(EnZl2* this, GlobalContext* globalCtx) { @@ -1515,11 +1515,11 @@ void func_80B51EBC(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); s32 pad[2]; - this->actor.posRot.rot.y = shape->rot.y = npcAction->rot.y; + this->actor.world.rot.y = shape->rot.y = npcAction->rot.y; func_80B4FD00(this, &D_0600B224, 0, 0.0f, 0); this->action = 34; this->drawConfig = 1; - shape->unk_14 = 0xFF; + shape->shadowAlpha = 255; } void func_80B51F38(EnZl2* this, GlobalContext* globalCtx) { @@ -1627,11 +1627,11 @@ void EnZl2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnZl2_Init(Actor* thisx, GlobalContext* globalCtx) { EnZl2* this = THIS; - ActorShape* actorShape = &thisx->shape; + ActorShape* shape = &thisx->shape; s32 pad; - ActorShape_Init(actorShape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - actorShape->unk_14 = 0; + ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + shape->shadowAlpha = 0; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D70, NULL, NULL, NULL, 0); switch (thisx->params) { diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index dcce2a523e..23675a6904 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -20,9 +20,22 @@ void EnZl3_Update(Actor* thisx, GlobalContext* globalCtx); void EnZl3_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80B59AD0(EnZl3* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -93,14 +106,14 @@ void func_80B533B0(Actor* thisx, GlobalContext* globalCtx) { EnZl3* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80B533FC(EnZl3* this, GlobalContext* globalCtx) { ColliderCylinder* collider = &this->collider; s32 pad[4]; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); } @@ -116,7 +129,7 @@ void func_80B53468(void) { BossGanon2* func_80B53488(EnZl3* this, GlobalContext* globalCtx) { if (this->unk_3D4 == NULL) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_BOSS_GANON2) { @@ -152,7 +165,7 @@ void func_80B53568(EnZl3* this, s16 arg1) { } void func_80B5357C(EnZl3* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f sp20; sp20.x = thisPos->x + ((Rand_ZeroOne() - 0.5f) * 10.0f); @@ -166,7 +179,7 @@ void func_80B53614(EnZl3* this, GlobalContext* globalCtx) { } void func_80B5366C(EnZl3* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } void func_80B536B4(EnZl3* this) { @@ -187,29 +200,29 @@ void func_80B536C4(EnZl3* this) { void func_80B53764(EnZl3* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_3F8.unk_18 = player->actor.posRot.pos; + this->unk_3F8.unk_18 = player->actor.world.pos; this->unk_3F8.unk_14 = kREG(16) - 16.0f; func_80034A14(&this->actor, &this->unk_3F8, kREG(17) + 0xC, 2); } s32 func_80B537E8(EnZl3* this) { - s16 yawTowardsLink = this->actor.yawTowardsLink; - s16* rotY = &this->actor.posRot.rot.y; + s16 yawTowardsPlayer = this->actor.yawTowardsPlayer; + s16* rotY = &this->actor.world.rot.y; s16* unk_3D0 = &this->unk_3D0; s16 pad[3]; - Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsLink - *rotY)), 5, 6200, 100); - Math_SmoothStepToS(rotY, yawTowardsLink, 5, *unk_3D0, 100); + Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsPlayer - *rotY)), 5, 6200, 100); + Math_SmoothStepToS(rotY, yawTowardsPlayer, 5, *unk_3D0, 100); this->actor.shape.rot.y = *rotY; // no return statement despite being of type s32 // the function directly below needs this to not be void I guess } void func_80B538B0(EnZl3* this) { - s16 yawTowardsLink = this->actor.yawTowardsLink; - s16* rotY = &this->actor.posRot.rot.y; + s16 yawTowardsPlayer = this->actor.yawTowardsPlayer; + s16* rotY = &this->actor.world.rot.y; - if (ABS((s16)(yawTowardsLink - *rotY)) >= 0x1556) { + if (ABS((s16)(yawTowardsPlayer - *rotY)) >= 0x1556) { D_80B5A468 = 1; } @@ -738,12 +751,12 @@ void EnZl3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } else if (limbIndex == 14) { sp24 = D_80B5A478; Matrix_MultVec3f(&sp24, &sp18); - this->actor.posRot2.pos.x = sp18.x; - this->actor.posRot2.pos.y = sp18.y; - this->actor.posRot2.pos.z = sp18.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = sp18.x; + this->actor.focus.pos.y = sp18.y; + this->actor.focus.pos.z = sp18.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } @@ -791,9 +804,9 @@ void func_80B54E14(EnZl3* this, AnimationHeader* animation, u8 arg2, f32 transit } void func_80B54EA4(EnZl3* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EG, posX, posY, posZ, 0, 0, 0, 0); } @@ -804,9 +817,9 @@ void func_80B54EF4(EnZl3* this) { void func_80B54F18(EnZl3* this, GlobalContext* globalCtx) { if (this->unk_2F8 == 0) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y + (kREG(5) + -26.0f); + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0x4000, 0, 3); @@ -823,8 +836,8 @@ void func_80B54FB4(EnZl3* this, GlobalContext* globalCtx) { this->drawConfig = 1; func_80B54F18(this, globalCtx); this->actor.shape.rot.z = 0; - this->unk_3C4 = this->actor.posRot.rot.z; - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->unk_3C4 = this->actor.world.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; osSyncPrintf("ゼルダ姫のEn_Zl3_Actor_inFinal_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); } @@ -850,9 +863,9 @@ void func_80B550F0(EnZl3* this) { Actor* child = this->actor.child; if (child != NULL) { - child->posRot.pos.x = this->actor.posRot.pos.x; - child->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - child->posRot.pos.z = this->actor.posRot.pos.z; + child->world.pos.x = this->actor.world.pos.x; + child->world.pos.y = this->actor.world.pos.y + (kREG(5) + -26.0f); + child->world.pos.z = this->actor.world.pos.z; } } @@ -1054,9 +1067,9 @@ void func_80B5585C(EnZl3* this) { void func_80B558A8(EnZl3* this) { s32 pad[4]; - s16 thisRotY = this->actor.posRot.rot.y; + s16 thisRotY = this->actor.world.rot.y; Vec3f* unk_338 = &this->unk_338; - Vec3f thisPos = this->actor.posRot.pos; + Vec3f thisPos = this->actor.world.pos; this->unk_32C = thisPos; *unk_338 = thisPos; @@ -1067,7 +1080,7 @@ void func_80B558A8(EnZl3* this) { } void func_80B559C4(EnZl3* this) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f* unk_32C = &this->unk_32C; Vec3f* unk_338 = &this->unk_338; f32 temp_f0 = func_8006F9BC(Animation_GetLastFrame(&D_06005248), 0, (s32)this->skelAnime.curFrame, 3, 3); @@ -1144,7 +1157,7 @@ void func_80B55CCC(EnZl3* this, s32 arg1) { void func_80B55D00(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 13; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { this->actor.flags |= 9; this->actor.flags |= 1; this->actor.textId = 0x70D5; @@ -1200,7 +1213,7 @@ void func_80B55F38(EnZl3* this, s32 arg1) { void func_80B55F6C(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 0x12; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { BossGanon2* bossGanon2 = func_80B53488(this, globalCtx); if ((bossGanon2 != NULL) && (bossGanon2->unk_324 <= 0.12345679104328156f)) { @@ -1261,7 +1274,7 @@ void func_80B561E0(EnZl3* this, s32 arg1) { void func_80B56214(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 21; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { BossGanon2* bossGanon2 = func_80B53488(this, globalCtx); if (bossGanon2 != NULL) { @@ -1582,7 +1595,7 @@ void func_80B56E38(EnZl3* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(sp20, 6.0f) || Animation_OnFrame(sp20, 0.0f)) && (this->actor.bgCheckFlags & 1)) { sfxId = 0x800; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); func_80078914(&this->actor.projectedPos, sfxId); } } @@ -1647,8 +1660,8 @@ s16 func_80B57104(EnZl3* this, s32 arg1) { Vec3s* point = func_80B56FAC(this, arg1); if (point != NULL) { - f32 xDiff = point->x - this->actor.posRot.pos.x; - f32 zDiff = point->z - this->actor.posRot.pos.z; + f32 xDiff = point->x - this->actor.world.pos.x; + f32 zDiff = point->z - this->actor.world.pos.z; if ((xDiff != 0.0f) || (zDiff != 0.0f)) { return Math_FAtan2F(xDiff, zDiff) * (0x8000 / M_PI); @@ -1682,14 +1695,14 @@ s32 func_80B571FC(EnZl3* this) { void func_80B57240(EnZl3* this) { s32 temp_a1 = func_80B571FC(this); - s16* rotY = &this->actor.posRot.rot.y; + s16* rotY = &this->actor.world.rot.y; Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); this->actor.shape.rot.y = *rotY; } void func_80B57298(EnZl3* this) { - s16* rotY = &this->actor.posRot.rot.y; + s16* rotY = &this->actor.world.rot.y; s16 temp_a1 = func_80B571A8(this); Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); @@ -1718,7 +1731,7 @@ s32 func_80B57324(EnZl3* this, GlobalContext* globalCtx) { } void func_80B57350(EnZl3* this, GlobalContext* globalCtx) { - s16 temp_v0 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(temp_v0) <= 0x4300) { this->actor.flags |= 9; @@ -1736,10 +1749,10 @@ s32 func_80B573C8(EnZl3* this, GlobalContext* globalCtx) { s32 func_80B573FC(EnZl3* this, GlobalContext* globalCtx, f32 arg2) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerZ = player->actor.posRot.pos.z; - f32 thisX = this->actor.posRot.pos.x; - f32 thisZ = this->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerZ = player->actor.world.pos.z; + f32 thisX = this->actor.world.pos.x; + f32 thisZ = this->actor.world.pos.z; if (SQ(playerX - thisX) + SQ(playerZ - thisZ) < SQ(arg2)) { return 1; @@ -1748,11 +1761,11 @@ s32 func_80B573FC(EnZl3* this, GlobalContext* globalCtx, f32 arg2) { } s32 func_80B57458(EnZl3* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 thisX = thisPos->x; f32 thisZ = thisPos->z; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; s32 pad; f32 playerX = playerPos->x; f32 playerZ = playerPos->z; @@ -1837,8 +1850,8 @@ void func_80B5772C(EnZl3* this, GlobalContext* globalCtx) { void func_80B57754(EnZl3* this, GlobalContext* globalCtx) { if (gSaveContext.unk_13F0 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OCEFF_WIPE4, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OCEFF_WIPE4, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1); func_80B56DA4(this); } } @@ -1846,7 +1859,7 @@ void func_80B57754(EnZl3* this, GlobalContext* globalCtx) { void func_80B577BC(GlobalContext* globalCtx, Vec3f* vec) { s32 pad; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; f32 posX = vec->x; f32 posY = vec->y; f32 posZ = vec->z; @@ -1912,7 +1925,7 @@ s32 func_80B57890(EnZl3* this, GlobalContext* globalCtx) { } void func_80B57A74(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_EN_ENCOUNT2) { @@ -1943,7 +1956,7 @@ void func_80B57AE0(EnZl3* this, GlobalContext* globalCtx) { this->unk_360 = 0.0f; this->unk_364 = 0.0f; this->unk_368 = 0.0f; - *unk_348 = this->actor.posRot.pos; + *unk_348 = this->actor.world.pos; temp_v0 = func_80B56FAC(this, this->unk_314); if (temp_v0 != NULL) { @@ -1979,7 +1992,7 @@ s32 func_80B57C8C(EnZl3* this) { void func_80B57CB4(EnZl3* this, GlobalContext* globalCtx) { Vec3f* unk_348 = &this->unk_348; Vec3f* unk_354 = &this->unk_354; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 temp_f0; this->unk_344 += 1; @@ -2003,19 +2016,19 @@ s32 func_80B57D80(EnZl3* this, GlobalContext* globalCtx) { s32 pad2; s16 phi_v1; - unk_3F8->unk_18.y = player->actor.posRot.pos.y; - unk_3F8->unk_18.x = (Math_SinS(temp_v0) * this->actor.xzDistToLink) + this->actor.posRot.pos.x; - unk_3F8->unk_18.z = (Math_CosS(temp_v0) * this->actor.xzDistToLink) + this->actor.posRot.pos.z; + unk_3F8->unk_18.y = player->actor.world.pos.y; + unk_3F8->unk_18.x = (Math_SinS(temp_v0) * this->actor.xzDistToPlayer) + this->actor.world.pos.x; + unk_3F8->unk_18.z = (Math_CosS(temp_v0) * this->actor.xzDistToPlayer) + this->actor.world.pos.z; unk_3F8->unk_14 = kREG(16) - 16.0f; func_80034A14(&this->actor, unk_3F8, kREG(17) + 0xC, 4); phi_v1 = ABS(temp_v0 - *sp32); if (phi_v1 <= 0x320) { *sp32 = temp_v0; - this->actor.posRot.rot.y = *sp32; + this->actor.world.rot.y = *sp32; phi_v1 = 0; } - this->actor.posRot.rot.y = *sp32; + this->actor.world.rot.y = *sp32; return phi_v1; } @@ -2137,7 +2150,7 @@ void func_80B584B4(EnZl3* this, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; s8 invincibilityTimer = player->invincibilityTimer; - Actor* nearbyEnTest = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_TEST, ACTORTYPE_ENEMY, 8000.0f); + Actor* nearbyEnTest = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f); if (D_80B5A4BC == 0) { if ((nearbyEnTest == NULL) && (!Gameplay_InCsMode(globalCtx))) { @@ -2275,7 +2288,7 @@ void func_80B58C08(EnZl3* this, GlobalContext* globalCtx) { s32 pad[2]; Vec3f* unk_348 = &this->unk_348; Vec3f* unk_354 = &this->unk_354; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; s32 unk_344; s32 unk_346; s32 sp28; @@ -2322,7 +2335,7 @@ void func_80B58DB0(EnZl3* this, GlobalContext* globalCtx) { void func_80B58E10(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2424,7 +2437,7 @@ void func_80B5922C(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2436,7 +2449,7 @@ void func_80B592A8(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2449,7 +2462,7 @@ void func_80B59340(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2463,7 +2476,7 @@ void func_80B593D0(EnZl3* this, GlobalContext* globalCtx) { func_80B57298(this); func_80B5366C(this, globalCtx); func_80B56E38(this, globalCtx); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B534CC(this); EnZl3_FrameUpdateMatrix(this); func_80B58C08(this, globalCtx); @@ -2547,10 +2560,10 @@ void func_80B59828(EnZl3* this, GlobalContext* globalCtx) { func_80B56F10(this, globalCtx); newRotY = func_80B571A8(this); this->actor.shape.rot.y = newRotY; - this->actor.posRot.rot.y = newRotY; - this->unk_3C4 = this->actor.posRot.rot.z; + this->actor.world.rot.y = newRotY; + this->unk_3C4 = this->actor.world.rot.z; this->actor.shape.rot.z = 0; - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; this->action = 28; this->drawConfig = 1; } else { @@ -2683,8 +2696,8 @@ void EnZl3_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; osSyncPrintf("ゼルダ姫のEn_Zl3_Actor_ct通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - ActorShape_Init(shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - shape->unk_14 = 0; + ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + shape->shadowAlpha = 0; func_80B533B0(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D70, NULL, this->jointTable, this->morphTable, 15); @@ -2788,7 +2801,7 @@ void EnZl3_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Zl3_InitVars = { ACTOR_EN_ZL3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL2, sizeof(EnZl3), diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 93b5c31cc7..b2c7adfa7e 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -39,7 +39,7 @@ extern UNK_TYPE D_0601CE08; /* const ActorInit En_Zl4_InitVars = { ACTOR_EN_ZL4, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL4, sizeof(EnZl4), @@ -48,6 +48,26 @@ const ActorInit En_Zl4_InitVars = { (ActorFunc)EnZl4_Update, (ActorFunc)EnZl4_Draw, }; + +static ColliderCylinderInit D_80B5E780 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 44, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zl4/func_80B5B7B0.s") diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 67f8f869b6..c425bc1561 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -73,7 +73,7 @@ void EnZo_Bubble(EnZo* this, Vec3f* pos) { for (i = 0; i < ARRAY_COUNT(this->effects); i++) { if (1) {} if (effect->type == ENZO_EFFECT_NONE) { - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (!(waterSurface <= pos->y)) { effect->type = ENZO_EFFECT_BUBBLE; effect->pos = *pos; @@ -142,7 +142,7 @@ void EnZo_UpdateBubbles(EnZo* this) { effect->pos.y += effect->vel.y; // Bubbles turn into ripples when they reach the surface - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (waterSurface <= effect->pos.y) { effect->type = ENZO_EFFECT_NONE; effect->pos.y = waterSurface; @@ -173,7 +173,7 @@ void EnZo_UpdateSplashes(EnZo* this) { } // Splash particles turn into ripples when they hit the surface - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (effect->pos.y < waterSurface) { effect->type = ENZO_EFFECT_NONE; effect->pos.y = waterSurface; @@ -285,23 +285,37 @@ void EnZo_DrawSplashes(EnZo* this, GlobalContext* globalCtx) { void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) { Vec3f pos = { 0.0f, 0.0f, 0.0f }; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + this->actor.yDistToWater; + pos.z = this->actor.world.pos.z; EnZo_Ripple(this, &pos, scale, targetScale, alpha); } static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 0x1A, 0x40, 0, { 0, 0, 0 } }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 26, 64, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Zo_InitVars = { ACTOR_EN_ZO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZO, sizeof(EnZo), @@ -333,7 +347,7 @@ void EnZo_SpawnSplashes(EnZo* this) { vel.x = sinf(angle) * speed; vel.z = cosf(angle) * speed; - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.x += vel.x * 6.0f; pos.z += vel.z * 6.0f; pos.y += this->actor.yDistToWater; @@ -491,12 +505,12 @@ void EnZo_Blink(EnZo* this) { void EnZo_Dialog(EnZo* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_194.unk_18 = player->actor.posRot.pos; + this->unk_194.unk_18 = player->actor.world.pos; if (this->actionFunc == EnZo_Standing) { // Look down at link if young, look up if old this->unk_194.unk_14 = LINK_IS_CHILD ? 10.0f : -10.0f; } else { - this->unk_194.unk_18.y = this->actor.posRot.pos.y; + this->unk_194.unk_18.y = this->actor.world.pos.y; } func_80034A14(&this->actor, &this->unk_194, 11, this->unk_64C); if (this->canSpeak == true) { @@ -510,12 +524,12 @@ s32 EnZo_PlayerInProximity(EnZo* this, GlobalContext* globalCtx) { f32 yDist; f32 hDist; - surfacePos.x = this->actor.posRot.pos.x; - surfacePos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - surfacePos.z = this->actor.posRot.pos.z; + surfacePos.x = this->actor.world.pos.x; + surfacePos.y = this->actor.world.pos.y + this->actor.yDistToWater; + surfacePos.z = this->actor.world.pos.z; - hDist = Math_Vec3f_DistXZ(&surfacePos, &player->actor.posRot.pos); - yDist = fabsf(player->actor.posRot.pos.y - surfacePos.y); + hDist = Math_Vec3f_DistXZ(&surfacePos, &player->actor.world.pos); + yDist = fabsf(player->actor.world.pos.y - surfacePos.y); if (hDist < 240.0f && yDist < 80.0f) { return 1; @@ -560,7 +574,7 @@ void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BFA8, NULL, this->jointTable, this->morphTable, 20); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); if (LINK_IS_ADULT && ((this->actor.params & 0x3F) == 8)) { Actor_Kill(&this->actor); @@ -569,16 +583,17 @@ void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) { func_80034EC0(&this->skelAnime, sAnimations, 2); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->dialogRadius = this->collider.dim.radius + 30.0f; this->unk_64C = 1; this->canSpeak = false; this->unk_194.unk_00 = 0; - func_8002E4B4(globalCtx, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, + 5); if (this->actor.yDistToWater < 54.0f || (this->actor.params & 0x3F) == 8) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; - this->actor.shape.unk_10 = 24.0f; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; + this->actor.shape.shadowScale = 24.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); this->canSpeak = true; this->alpha = 255.0f; @@ -602,7 +617,7 @@ void EnZo_Standing(EnZo* this, GlobalContext* globalCtx) { return; } - angle = ABS((s16)((f32)this->actor.yawTowardsLink - (f32)this->actor.shape.rot.y)); + angle = ABS((s16)((f32)this->actor.yawTowardsPlayer - (f32)this->actor.shape.rot.y)); if (angle < 0x4718) { if (EnZo_PlayerInProximity(this, globalCtx)) { this->unk_64C = 2; @@ -692,7 +707,7 @@ void EnZo_Dive(EnZo* this, GlobalContext* globalCtx) { if ((s16)this->alpha == 0) { func_80034EC0(&this->skelAnime, sAnimations, 2); - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; this->alpha = 0.0f; this->actionFunc = EnZo_Submerged; } @@ -709,13 +724,13 @@ void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) { } Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, this->collider.dim.radius, this->collider.dim.height * 0.25f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, thisx, this->collider.dim.radius, this->collider.dim.height * 0.25f, 0.0f, 5); this->actionFunc(this, globalCtx); EnZo_Dialog(this, globalCtx); // Spawn air bubbles if (globalCtx->state.frames & 8) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += (Rand_ZeroOne() - 0.5f) * 10.0f + 18.0f; pos.x += (Rand_ZeroOne() - 0.5f) * 28.0f; @@ -724,7 +739,7 @@ void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((s32)this->alpha != 0) { - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -765,7 +780,7 @@ void EnZo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec = { 0.0f, 600.0f, 0.0f }; if (limbIndex == 15) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 5ade725b77..207a55e926 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -18,7 +18,7 @@ void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_fHG_InitVars = { ACTOR_EN_FHG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_FHG, sizeof(EnfHG), diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index da6b35f9c4..e77f9aac96 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -18,7 +18,7 @@ void func_80B65DA8(Actor* thisx, GlobalContext* globalCtx); const ActorInit End_Title_InitVars = { ACTOR_END_TITLE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EndTitle), diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index ac92bbc417..55def2cee2 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -61,7 +61,7 @@ extern UNK_TYPE D_06015470; /* const ActorInit Fishing_InitVars = { ACTOR_FISHING, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FISH, sizeof(Fishing), @@ -70,6 +70,154 @@ const ActorInit Fishing_InitVars = { (ActorFunc)Fishing_Update, (ActorFunc)Fishing_Draw, }; + +static ColliderJntSphElementInit D_80B7A6D8[12] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B7A888 = { + { + COLTYPE_NONE, + AT_TYPE_ENEMY, + AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 12, + D_80B7A6D8, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Fishing/func_80B699A0.s") diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 60557a6788..194163b52f 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -22,7 +22,7 @@ extern Gfx D_06001470[]; const ActorInit Item_B_Heart_InitVars = { ACTOR_ITEM_B_HEART, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GI_HEARTS, sizeof(ItemBHeart), @@ -57,7 +57,7 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) { ItemBHeart* this = THIS; func_80B85264(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (Actor_HasParent(&this->actor, globalCtx)) { Flags_SetCollectible(globalCtx, 0x1F); Actor_Kill(&this->actor); @@ -71,7 +71,7 @@ void func_80B85264(ItemBHeart* this, GlobalContext* globalCtx) { this->unk_164 += 1; temp = ((Math_SinS(this->unk_164 * 1548) * 5.0f) + 20.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + temp, 0.1f, this->unk_158); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y + temp, 0.1f, this->unk_158); Math_ApproachF(&this->unk_158, 2.0f, 1.0f, 0.1f); this->actor.shape.rot.y += 0x400; @@ -86,7 +86,7 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_item_b_heart.c", 506); - actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (actorIt != NULL) { if ((actorIt->id == ACTOR_DOOR_WARP1) && (actorIt->projectedPos.z > this->actor.projectedPos.z)) { diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 8d66e9596f..7fd405e56b 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -26,7 +26,7 @@ void ItemEtcetera_UpdateFireArrow(ItemEtcetera* this, GlobalContext* globalCtx); const ActorInit Item_Etcetera_InitVars = { ACTOR_ITEM_ETCETERA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ItemEtcetera), @@ -89,7 +89,7 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) { this->futureActionFunc = ItemEtcetera_UpdateFireArrow; Actor_SetScale(&this->actor, 0.5f); this->actor.draw = NULL; - this->actor.shape.unk_08 = 50.0f; + this->actor.shape.yOffset = 50.0f; break; case ITEM_ETC_RUPEE_GREEN_CHEST_GAME: case ITEM_ETC_RUPEE_BLUE_CHEST_GAME: @@ -100,7 +100,7 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B85B28; this->drawFunc = ItemEtcetera_DrawThroughLens; - this->actor.posRot.pos.y += 15.0f; + this->actor.world.pos.y += 15.0f; break; } } @@ -139,7 +139,7 @@ void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) { if (0) {} // Necessary to match func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f); if ((globalCtx->gameplayFrames & 0xD) == 0) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 0.0f, 10.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); } } } @@ -155,14 +155,14 @@ void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, GlobalContext* globalCtx) { velocity.z = Rand_CenteredFloat(3.0f); velocity.y = -0.05f; accel.y = -0.025f; - pos.x = Rand_CenteredFloat(12.0f) + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 6.0f) + this->actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(12.0f) + this->actor.posRot.pos.z; + pos.x = Rand_CenteredFloat(12.0f) + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y; + pos.z = Rand_CenteredFloat(12.0f) + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 5000, 16); } void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); Actor_MoveForward(&this->actor); if (!(this->actor.bgCheckFlags & 1)) { ItemEtcetera_SpawnSparkles(this, globalCtx); diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 6c981bb662..47fdd74df2 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -19,7 +19,7 @@ void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx); const ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ItemInbox), diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index b884593995..19780cff9d 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -25,7 +25,7 @@ void ItemOcarina_DoNothing(ItemOcarina* this, GlobalContext* globalCtx); const ActorInit Item_Ocarina_InitVars = { ACTOR_ITEM_OCARINA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GI_OCARINA, sizeof(ItemOcarina), @@ -94,17 +94,17 @@ void ItemOcarina_Fly(ItemOcarina* this, GlobalContext* globalCtx) { } if (globalCtx->csCtx.frames == 881) { - this->actor.posRot.pos.x = 250.0f; - this->actor.posRot.pos.y = 60.0f; - this->actor.posRot.pos.z = 1075.0f; + this->actor.world.pos.x = 250.0f; + this->actor.world.pos.y = 60.0f; + this->actor.world.pos.z = 1075.0f; this->actor.velocity.x = 1.0f; this->actor.velocity.y = -5.0f; this->actor.velocity.z = -7.0f; } if (globalCtx->csCtx.frames == 897) { - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 100, 500, 0); - EffectSsGSplash_Spawn(globalCtx, &this->actor.posRot.pos, 0, 0, 1, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 100, 500, 0); + EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, 0, 0, 1, 0); this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; @@ -146,9 +146,9 @@ void func_80B864EC(ItemOcarina* this, GlobalContext* globalCtx) { } if (globalCtx->csCtx.frames == 220) { - this->actor.posRot.pos.x = 144.0f; - this->actor.posRot.pos.y = 80.0f; - this->actor.posRot.pos.z = 1686.0f; + this->actor.world.pos.x = 144.0f; + this->actor.world.pos.y = 80.0f; + this->actor.world.pos.z = 1686.0f; this->actor.velocity.x = 1.0f; this->actor.velocity.y = 2.0f; this->actor.velocity.z = -7.0f; @@ -186,7 +186,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) { func_8002F434(&this->actor, globalCtx, GI_OCARINA_OOT, 30.0f, 50.0f); if ((globalCtx->gameplayFrames & 13) == 0) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 0.0f, 10.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); } } } diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 420c4017d3..169a33d212 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_060224F8; /* const ActorInit Item_Shield_InitVars = { ACTOR_ITEM_SHIELD, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_LINK_CHILD, sizeof(ItemShield), @@ -29,6 +29,26 @@ const ActorInit Item_Shield_InitVars = { (ActorFunc)ItemShield_Update, (ActorFunc)ItemShield_Draw, }; + +static ColliderCylinderInit D_80B871A0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 15, 15, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86920.s") diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 09adad2501..ad6a2c6010 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -22,7 +22,7 @@ void MagicDark_DimLighting(GlobalContext* globalCtx, f32 intensity); const ActorInit Magic_Dark_InitVars = { ACTOR_MAGIC_DARK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicDark), @@ -47,7 +47,7 @@ void MagicDark_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.6f; } - thisx->posRot.pos = player->actor.posRot.pos; + thisx->world.pos = player->actor.world.pos; Actor_SetScale(&this->actor, 0.0f); thisx->room = -1; @@ -123,8 +123,8 @@ void MagicDark_DiamondUpdate(Actor* thisx, GlobalContext* globalCtx) { this->primAlpha = phi_a0; } - thisx->posRot.rot.y += 0x3E8; - thisx->shape.rot.y = thisx->posRot.rot.y + Camera_GetCamDirYaw(ACTIVE_CAM); + thisx->world.rot.y += 0x3E8; + thisx->shape.rot.y = thisx->world.rot.y + Camera_GetCamDirYaw(ACTIVE_CAM); this->timer++; gSaveContext.nayrusLoveTimer = nayrusLoveTimer + 1; @@ -206,15 +206,15 @@ void MagicDark_DiamondDraw(Actor* thisx, GlobalContext* globalCtx) { Player* player = PLAYER; f32 heightDiff; - this->actor.posRot.pos.x = player->bodyPartsPos[0].x; - this->actor.posRot.pos.z = player->bodyPartsPos[0].z; - heightDiff = player->bodyPartsPos[0].y - this->actor.posRot.pos.y; + this->actor.world.pos.x = player->bodyPartsPos[0].x; + this->actor.world.pos.z = player->bodyPartsPos[0].z; + heightDiff = player->bodyPartsPos[0].y - this->actor.world.pos.y; if (heightDiff < -2.0f) { - this->actor.posRot.pos.y = player->bodyPartsPos[0].y + 2.0f; + this->actor.world.pos.y = player->bodyPartsPos[0].y + 2.0f; } else if (heightDiff > 2.0f) { - this->actor.posRot.pos.y = player->bodyPartsPos[0].y - 2.0f; + this->actor.world.pos.y = player->bodyPartsPos[0].y - 2.0f; } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateY(this->actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_magic_dark.c", 553), diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index a5143cd2e3..4692637751 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -18,7 +18,7 @@ void MagicFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Magic_Fire_InitVars = { ACTOR_MAGIC_FIRE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicFire), @@ -27,6 +27,26 @@ const ActorInit Magic_Fire_InitVars = { (ActorFunc)MagicFire_Update, (ActorFunc)MagicFire_Draw, }; + +static ColliderCylinderInit D_80B8AF50 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00020000, 0x00, 0x01 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 9, 9, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s") diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index 661dac4b59..1c93d3087a 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -23,7 +23,7 @@ void MagicWind_Grow(MagicWind* this, GlobalContext* globalCtx); const ActorInit Magic_Wind_InitVars = { ACTOR_MAGIC_WIND, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicWind), diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 8bac9b91e8..a3dcd25a31 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -33,7 +33,7 @@ typedef enum { const ActorInit Mir_Ray_InitVars = { ACTOR_MIR_RAY, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_MIR_RAY, sizeof(MirRay), @@ -46,22 +46,50 @@ const ActorInit Mir_Ray_InitVars = { u8 D_80B8E670 = 0; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x00200000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00200000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00200000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 50 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static MirRayDataEntry sMirRayData[] = { @@ -89,16 +117,15 @@ extern Gfx D_06000C50[]; void MirRay_SetupCollider(MirRay* this) { Vec3f colliderOffset; - MirRayDataEntry* dataEntry; + MirRayDataEntry* dataEntry = &sMirRayData[this->actor.params]; - dataEntry = &sMirRayData[this->actor.params]; colliderOffset.x = (this->poolPt.x - this->sourcePt.x) * dataEntry->unk_10; colliderOffset.y = (this->poolPt.y - this->sourcePt.y) * dataEntry->unk_10; colliderOffset.z = (this->poolPt.z - this->sourcePt.z) * dataEntry->unk_10; - this->colliderSph.list->dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x; - this->colliderSph.list->dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y; - this->colliderSph.list->dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z; - this->colliderSph.list->dim.worldSphere.radius = dataEntry->unk_14 * this->colliderSph.list->dim.scale; + this->colliderSph.elements[0].dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x; + this->colliderSph.elements[0].dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y; + this->colliderSph.elements[0].dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z; + this->colliderSph.elements[0].dim.worldSphere.radius = dataEntry->unk_14 * this->colliderSph.elements->dim.scale; } // Set up a light point between source point and reflection point. Reflection point is the pool point (for windows) or @@ -109,12 +136,12 @@ void MirRay_MakeShieldLight(MirRay* this, GlobalContext* globalCtx) { Vec3f reflectionPt; Vec3s lightPt; - if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, player->actor.posRot.pos.x, - player->actor.posRot.pos.y + 30.0f, player->actor.posRot.pos.z, this->sourceEndRad, + if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, player->actor.world.pos.x, + player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad, this->poolEndRad)) { if (dataEntry->params & 8) { // Light beams from mirrors - Math_Vec3f_Diff(&player->actor.posRot.pos, &this->sourcePt, &reflectionPt); + Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt); } else { // Light beams from windows Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt); } @@ -381,7 +408,7 @@ void MirRay_ReflectedBeam(MirRay* this, GlobalContext* globalCtx, MirRayShieldRe vecC.y = vecD.y + (shieldMtx->xy * 300.0f); vecC.z = vecD.z + (shieldMtx->xz * 300.0f); - func_80062734(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); + Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); for (i = 0; i < 6; i++) { currentReflection = &reflection[i]; diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 0bcad33762..e1ea91e18f 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -29,7 +29,7 @@ typedef struct { typedef struct MirRay { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph colliderSph; - /* 0x016C */ ColliderJntSphItem colliderSphItem; + /* 0x016C */ ColliderJntSphElement colliderSphItem; /* 0x01AC */ ColliderQuad shieldRay; /* 0x022C */ f32 reflectIntensity; // Reflection occurs if it is positive, brightness depends on it /* 0x0230 */ Vec3f shieldCorners[6]; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 53717842c8..c644aaad9a 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06000650; /* const ActorInit Obj_Bean_InitVars = { ACTOR_OBJ_BEAN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MAMENOKI, sizeof(ObjBean), @@ -33,6 +33,26 @@ const ActorInit Obj_Bean_InitVars = { (ActorFunc)ObjBean_Update, (ActorFunc)ObjBean_Draw, }; + +static ColliderCylinderInit D_80B90E54 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 64, 30, -31, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s") diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 4a2fa9d1dc..fdbe56ef8e 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -17,7 +17,7 @@ void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Blockstop_InitVars = { ACTOR_OBJ_BLOCKSTOP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjBlockstop), @@ -33,7 +33,7 @@ void ObjBlockstop_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->actor.params)) { Actor_Kill(&this->actor); } else { - this->actor.posRot.pos.y += 1; + this->actor.world.pos.y += 1; } } @@ -47,7 +47,7 @@ void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx) { s32 bgId; s32 pad; - if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &this->actor.initPosRot.pos, &this->actor.posRot.pos, &sp4C, + if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &this->actor.home.pos, &this->actor.world.pos, &sp4C, &this->actor.floorPoly, 0, 0, 1, 1, &bgId, &this->actor)) { dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, bgId); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 872cf9a916..5b52c1eb13 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -21,7 +21,7 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx); const ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOMBIWA, sizeof(ObjBombiwa), @@ -32,17 +32,26 @@ const ActorInit Obj_Bombiwa_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 55, 70, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x00, - 0x000C, - 0x003C, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), @@ -62,7 +71,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -71,14 +80,14 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) { Actor_Kill(thisx); } else { - func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); if (thisx->shape.rot.y == 0) { s16 rand = (s16)Rand_ZeroFloat(65536.0f); - thisx->posRot.rot.y = rand; + thisx->world.rot.y = rand; thisx->shape.rot.y = rand; } - thisx->shape.unk_08 = -200.0f; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 20.0f; + thisx->shape.yOffset = -200.0f; + thisx->world.pos.y = thisx->home.pos.y + 20.0f; } } @@ -99,9 +108,9 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { dlist = D_060009E0; for (i = 0; i < ARRAY_COUNT(sEffectScales); i++) { - pos.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; - pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; - pos.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.x; + pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.home.pos.y) + 8.0f; + pos.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.z; velocity.x = (Rand_ZeroOne() - 0.5f) * 15.0f; velocity.y = (Rand_ZeroOne() * 16.0f) + 5.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 15.0f; @@ -110,27 +119,27 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, 10, 2, 0, scale, 1, 0, 80, KAKERA_COLOR_NONE, OBJECT_BOMBIWA, dlist); } - func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 8, 100, 160, 1); + func_80033480(globalCtx, &this->actor.world.pos, 60.0f, 8, 100, 160, 1); } void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { ObjBombiwa* this = THIS; s32 pad; - if (func_80033684(globalCtx, &this->actor) != NULL || - ((this->collider.base.acFlags & 2) != 0 && (this->collider.body.acHitItem->toucher.flags & 0x40000040) != 0)) { + if ((func_80033684(globalCtx, &this->actor) != NULL) || + ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040))) { ObjBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); if (((this->actor.params >> 0xF) & 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); } else { - this->collider.base.acFlags &= ~0x2; - if (this->actor.xzDistToLink < 800.0f) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + this->collider.base.acFlags &= ~AC_HIT; + if (this->actor.xzDistToPlayer < 800.0f) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 4c4dbc884b..95c37fe2bf 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -23,7 +23,7 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx); const ActorInit Obj_Comb_InitVars = { ACTOR_OBJ_COMB, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjComb), @@ -33,17 +33,31 @@ const ActorInit Obj_Comb_InitVars = { (ActorFunc)ObjComb_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0, 0, 0 }, 15 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4001FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 15 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -60,7 +74,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { Vec3f pos1; Vec3f pos; Vec3f velocity; - Gfx** dlist = D_05009940; + Gfx* dlist = D_05009940; s16 scale; s16 angle = 0; s16 gravity; @@ -78,7 +92,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { pos1.y = (i - 15) * 0.7f; pos1.z = Math_CosS(angle) * rand1; - Math_Vec3f_Sum(&pos1, &this->actor.posRot.pos, &pos); + Math_Vec3f_Sum(&pos1, &this->actor.world.pos, &pos); velocity.x = (Rand_ZeroOne() - 0.5f) + pos1.x * 0.5f; velocity.y = (Rand_ZeroOne() - 0.5f) + pos1.y * 0.6f; @@ -111,9 +125,9 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, dlist); } - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y - 10.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y - 10.0f; + pos.z = this->actor.world.pos.z; func_80033480(globalCtx, &pos, 40.0f, 6, 70, 60, 1); } @@ -131,7 +145,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { params = -1; } if (params >= 0) { - Item_DropCollectible(globalCtx, &this->actor.posRot, params); + Item_DropCollectible(globalCtx, &this->actor.world.pos, params); } } } @@ -141,7 +155,7 @@ void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, this, &sJntSphInit, &this->colliderItems); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); ObjComb_SetupWait(this); } @@ -157,17 +171,17 @@ void ObjComb_SetupWait(ObjComb* this) { } void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) { - s32 toucherFlags; + s32 dmgFlags; this->unk_1B0 -= 50; if (this->unk_1B0 < 0) { this->unk_1B0 = 0; } - if ((this->collider.base.acFlags & 0x2) != 0) { - this->collider.base.acFlags &= ~0x2; - toucherFlags = this->collider.list->body.acHitItem->toucher.flags; - if (toucherFlags & 0x4001F866) { + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + dmgFlags = this->collider.elements[0].info.acHitInfo->toucher.dmgFlags; + if (dmgFlags & 0x4001F866) { this->unk_1B0 = 1500; } else { ObjComb_Break(this, globalCtx); @@ -175,11 +189,11 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actor.update != NULL) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -188,7 +202,7 @@ void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_1B2 += 12000; this->actionFunc(this, globalCtx); - this->actor.shape.rot.x = Math_SinS(this->unk_1B2) * this->unk_1B0 + this->actor.initPosRot.rot.x; + this->actor.shape.rot.x = Math_SinS(this->unk_1B2) * this->unk_1B0 + this->actor.home.rot.x; } void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -198,8 +212,8 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (118.0f * this->actor.scale.y), - this->actor.posRot.pos.z, 0); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + (118.0f * this->actor.scale.y), + this->actor.world.pos.z, 0); Matrix_RotateY(this->actor.shape.rot.y * 0.0000958738f, 1); Matrix_RotateX(this->actor.shape.rot.x * 0.0000958738f, 1); Matrix_RotateZ(this->actor.shape.rot.z * 0.0000958738f, 1); @@ -211,7 +225,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_OPA_DISP++, D_050095B0); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_comb.c", 402); } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 83945325bf..7700b5c372 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -12,7 +12,7 @@ typedef struct ObjComb { /* 0x0000 */ Actor actor; /* 0x014C */ ObjCombActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 unk_1B0; /* 0x01B2 */ s16 unk_1B2; } ObjComb; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index 8f54370d02..d49677cc46 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -19,7 +19,7 @@ void ObjDekujr_ComeUp(ObjDekujr* this, GlobalContext* globalCtx); const ActorInit Obj_Dekujr_InitVars = { ACTOR_OBJ_DEKUJR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DEKUJR, sizeof(ObjDekujr), @@ -29,8 +29,14 @@ const ActorInit Obj_Dekujr_InitVars = { (ActorFunc)ObjDekujr_Draw, }; -static ColliderCylinderInit_Actor sCylinderInit = { - { NULL, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitToActor sCylinderInit = { + { + NULL, + 0x00, + 0x00, + 0x39, + COLSHAPE_CYLINDER, + }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 60, 80, 0, { 0, 0, 0 } }, }; @@ -59,8 +65,8 @@ void ObjDekujr_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(globalCtx, &this->collider); sCylinderInit.base.actor = thisx; // thisx required to match here - Collider_SetCylinder_Actor(globalCtx, &this->collider, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + Collider_SetCylinderToActor(globalCtx, &this->collider, &sCylinderInit); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.textId = func_80037C30(globalCtx, 0xF); Actor_SetScale(&this->actor, 0.4f); } @@ -101,7 +107,7 @@ void ObjDekujr_ComeUp(ObjDekujr* this, GlobalContext* globalCtx) { ObjDekujr_SetInitialPos(csCmdNPCAction, &initPos); ObjDekujr_SetFinalPos(csCmdNPCAction, &finalPos); if (this->unk_19C == 0) { - this->actor.posRot.pos = initPos; + this->actor.world.pos = initPos; this->unk_19C = 1; } this->actor.shape.rot.x = csCmdNPCAction->urot.x; @@ -127,7 +133,7 @@ void ObjDekujr_Update(Actor* thisx, GlobalContext* globalCtx) { ObjDekujr* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (this->unk_19B == 0)) { this->unk_19C = 0; @@ -135,12 +141,12 @@ void ObjDekujr_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_19B == 1) { ObjDekujr_ComeUp(this, globalCtx); - this->actor.posRot.pos.x += this->actor.velocity.x; - this->actor.posRot.pos.y += this->actor.velocity.y; - this->actor.posRot.pos.z += this->actor.velocity.z; + this->actor.world.pos.x += this->actor.velocity.x; + this->actor.world.pos.y += this->actor.velocity.y; + this->actor.world.pos.z += this->actor.velocity.z; } else { func_80037D98(globalCtx, &this->actor, 0xF, &this->unk_1A0); - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } } diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index e58bf131a8..d6aa0eb025 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -22,7 +22,7 @@ void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx); const ActorInit Obj_Elevator_InitVars = { ACTOR_OBJ_ELEVATOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_ELEVATOR, sizeof(ObjElevator), @@ -90,11 +90,11 @@ void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) { - sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y; + sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->initPosRot.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; + this->unk_168 = thisx->home.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; } else { - this->unk_168 = thisx->initPosRot.pos.y; + this->unk_168 = thisx->home.pos.y; } func_80B92D20(this); } @@ -107,7 +107,7 @@ void func_80B92D20(ObjElevator* this) { void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (fabsf(Math_SmoothStepToF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { + if (fabsf(Math_SmoothStepToF(&thisx->world.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH); func_80B92C5C(this); } else { diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 12c0133afe..80b2e1b2df 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -20,7 +20,7 @@ extern Gfx D_0500A5E8[]; const ActorInit Obj_Hamishi_InitVars = { ACTOR_OBJ_HAMISHI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjHamishi), @@ -31,12 +31,26 @@ const ActorInit Obj_Hamishi_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 50, 70, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 0xC, 0x3C, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static s16 sEffectScales[] = { 145, 135, 115, 85, 75, 53, 45, 40, 35, @@ -54,7 +68,7 @@ void ObjHamishi_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjHamishi_Shake(ObjHamishi* this) { @@ -66,19 +80,17 @@ void ObjHamishi_Shake(ObjHamishi* this) { Math_StepToF(&this->shakePosSize, 0.0f, 0.15f); Math_StepToF(&this->shakeRotSize, 0.0f, 40.0f); - this->actor.posRot.pos.x = - this->actor.initPosRot.pos.x + (Math_SinS(this->shakePosPhase * 4) * this->shakePosSize); - this->actor.posRot.pos.z = - this->actor.initPosRot.pos.z + (Math_CosS(this->shakePosPhase * 7) * this->shakePosSize); + this->actor.world.pos.x = this->actor.home.pos.x + (Math_SinS(this->shakePosPhase * 4) * this->shakePosSize); + this->actor.world.pos.z = this->actor.home.pos.z + (Math_CosS(this->shakePosPhase * 7) * this->shakePosSize); this->actor.shape.rot.x = - this->actor.initPosRot.rot.x + (s16)(Math_SinS(this->shakeRotPhase * 4) * this->shakeRotSize); + this->actor.home.rot.x + (s16)(Math_SinS(this->shakeRotPhase * 4) * this->shakeRotSize); this->actor.shape.rot.z = - this->actor.initPosRot.rot.z + (s16)(Math_CosS(this->shakeRotPhase * 7) * this->shakeRotSize); + this->actor.home.rot.z + (s16)(Math_CosS(this->shakeRotPhase * 7) * this->shakeRotSize); } else { - Math_StepToF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 1.0f); - Math_StepToF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 1.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.initPosRot.rot.x, 0xBB8); - Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.initPosRot.rot.z, 0xBB8); + Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f); + Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f); + Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0xBB8); + Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0xBB8); } } @@ -97,9 +109,9 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) { phi_s0 += 20000; temp_f20 = Rand_ZeroOne() * 10.0f; - pos.x = (Math_SinS(phi_s0) * temp_f20) + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 40.0f) + this->actor.posRot.pos.y + 5.0f; - pos.z = (Math_CosS(phi_s0) * temp_f20) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(phi_s0) * temp_f20) + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 40.0f) + this->actor.world.pos.y + 5.0f; + pos.z = (Math_CosS(phi_s0) * temp_f20) + this->actor.world.pos.z; temp_f20 = (Rand_ZeroOne() * 10.0f) + 2.0f; velocity.x = Math_SinS(phi_s0) * temp_f20; @@ -118,12 +130,12 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) { gravity = -320; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, gravity, phi_v0, 30, 5, 0, - sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, &D_0500A5E8); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, gravity, phi_v0, 30, 5, 0, + sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); } - func_80033480(globalCtx, &this->actor.posRot, 140.0f, 6, 180, 90, 1); - func_80033480(globalCtx, &this->actor.posRot, 140.0f, 12, 80, 90, 1); + func_80033480(globalCtx, &this->actor.world.pos, 140.0f, 6, 180, 90, 1); + func_80033480(globalCtx, &this->actor.world.pos, 140.0f, 12, 80, 90, 1); } void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -135,18 +147,18 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneForward += 1000.0f; } if (this->actor.shape.rot.y == 0) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.initPosRot.rot.y = Rand_ZeroFloat(65536.0f); + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.home.rot.y = Rand_ZeroFloat(65536.0f); } ObjHamishi_InitCollision(&this->actor, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { Actor_Kill(&this->actor); return; } - this->actor.shape.unk_08 = 80.0f; + this->actor.shape.yOffset = 80.0f; } void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -162,8 +174,8 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { ObjHamishi_Shake(this); - if ((this->collider.base.acFlags & 2) && (this->collider.body.acHitItem->toucher.flags & 0x40000040)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040)) { + this->collider.base.acFlags &= ~AC_HIT; this->hitCount++; if (this->hitCount < 2) { this->shakeFrames = 15; @@ -171,16 +183,16 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { this->shakeRotSize = 400.0f; } else { ObjHamishi_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); Actor_Kill(&this->actor); } } else { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.xzDistToLink < 600.0f) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider); + if (this->actor.xzDistToPlayer < 600.0f) { + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider.base); } } } @@ -193,7 +205,7 @@ void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 404), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 170, 130, 255); - gSPDisplayList(POLY_OPA_DISP++, &D_0500A3B8); + gSPDisplayList(POLY_OPA_DISP++, D_0500A3B8); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 411); } diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 6631b9fccd..bcb0219f9b 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -17,7 +17,7 @@ void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Hana_InitVars = { ACTOR_OBJ_HANA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjHana), @@ -28,12 +28,26 @@ const ActorInit Obj_Hana_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 8, 10, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 0xC, 0x3C, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; typedef struct { /* 0x00 */ Gfx* dList; @@ -63,14 +77,14 @@ void ObjHana_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, params->scale); - this->actor.shape.unk_08 = params->yOffset; + this->actor.shape.yOffset = params->yOffset; if (params->radius >= 0) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = params->radius; this->collider.dim.height = params->height; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); } if (type == 2 && (gSaveContext.eventChkInf[4] & 1)) { @@ -89,7 +103,7 @@ void ObjHana_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) { ObjHana* this = THIS; - if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToLink < 400.0f) { + if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 009e2f0586..de45b513c1 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -24,7 +24,7 @@ void func_80B93E38(ObjHsblock* this); const ActorInit Obj_Hsblock_InitVars = { ACTOR_OBJ_HSBLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_HSBLOCK, sizeof(ObjHsblock), @@ -69,9 +69,9 @@ void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, CollisionHeader* void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 5) & 1) { - Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.rot.x, - this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, 1); + Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, + this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); } } @@ -112,7 +112,7 @@ void func_80B93D90(ObjHsblock* this) { void func_80B93DB0(ObjHsblock* this) { this->dyna.actor.flags |= 0x10; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 105.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 105.0f; ObjHsblock_SetupAction(this, func_80B93DF4); } @@ -128,9 +128,9 @@ void func_80B93E38(ObjHsblock* this) { void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 16.0f, 0.1f, 0.8f, 0.0f); - if (fabsf(Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.3f, + if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.3f, this->dyna.actor.velocity.y, 0.3f)) < 0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; func_80B93D90(this); this->dyna.actor.flags &= ~0x10; } @@ -142,7 +142,7 @@ void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } - Actor_SetHeight(thisx, D_80B940C0[thisx->params & 3]); + Actor_SetFocus(thisx, D_80B940C0[thisx->params & 3]); } void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 3c9ca8ff0b..cbc41deec9 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -22,7 +22,7 @@ extern Gfx* D_04033EE0[]; const ActorInit Obj_Ice_Poly_InitVars = { ACTOR_OBJ_ICE_POLY, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjIcePoly), @@ -33,14 +33,42 @@ const ActorInit Obj_Ice_Poly_InitVars = { }; static ColliderCylinderInit sCylinderInitIce = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x02, 0x00 }, { 0x00020800, 0x00, 0x00 }, 0x19, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x02, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, { 50, 120, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInitHard = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4E01F7F6, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4E01F7F6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 120, 0, { 0, 0, 0 } }, }; @@ -59,20 +87,20 @@ void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx) { return; } Actor_SetScale(thisx, sScale[thisx->params]); - thisx->posRot.pos.y = sOffsetY[thisx->params] + thisx->initPosRot.pos.y; + thisx->world.pos.y = sOffsetY[thisx->params] + thisx->home.pos.y; Collider_InitCylinder(globalCtx, &this->colliderIce); Collider_SetCylinder(globalCtx, &this->colliderIce, thisx, &sCylinderInitIce); Collider_InitCylinder(globalCtx, &this->colliderHard); Collider_SetCylinder(globalCtx, &this->colliderHard, thisx, &sCylinderInitHard); - Collider_CylinderUpdate(thisx, &this->colliderIce); - Collider_CylinderUpdate(thisx, &this->colliderHard); - thisx->colChkInfo.mass = 0xFF; + Collider_UpdateCylinder(thisx, &this->colliderIce); + Collider_UpdateCylinder(thisx, &this->colliderHard); + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->alpha = 255; this->colliderIce.dim.radius *= thisx->scale.x; this->colliderIce.dim.height *= thisx->scale.y; this->colliderHard.dim.radius *= thisx->scale.x; this->colliderHard.dim.height *= thisx->scale.y; - Actor_SetHeight(thisx, thisx->scale.y * 30.0f); + Actor_SetFocus(thisx, thisx->scale.y * 30.0f); this->actionFunc = ObjIcePoly_Idle; } @@ -91,9 +119,9 @@ void ObjIcePoly_Idle(ObjIcePoly* this, GlobalContext* globalCtx) { s32 pad; Vec3f pos; - if (this->colliderIce.base.acFlags & 2) { - this->meltTimer = -this->colliderIce.body.acHitItem->toucher.damage; - this->actor.posRot2.rot.y = this->actor.yawTowardsLink; + if (this->colliderIce.base.acFlags & AC_HIT) { + this->meltTimer = -this->colliderIce.info.acHitInfo->toucher.damage; + this->actor.focus.rot.y = this->actor.yawTowardsPlayer; func_800800F8(globalCtx, 0x1400, 40, &this->actor, 0); this->actionFunc = ObjIcePoly_Melt; } else if (this->actor.parent != NULL) { @@ -105,11 +133,9 @@ void ObjIcePoly_Idle(ObjIcePoly* this, GlobalContext* globalCtx) { } else { Actor_Kill(&this->actor); } - pos.x = - this->actor.posRot.pos.x + this->actor.scale.x * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); - pos.y = this->actor.posRot.pos.y + this->actor.scale.y * Rand_S16Offset(10, 90); - pos.z = - this->actor.posRot.pos.z + this->actor.scale.z * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.x = this->actor.world.pos.x + this->actor.scale.x * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.y = this->actor.world.pos.y + this->actor.scale.y * Rand_S16Offset(10, 90); + pos.z = this->actor.world.pos.z + this->actor.scale.z * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); if ((globalCtx->gameplayFrames % 7) == 0) { EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &zeroVec, &zeroVec, &sColorWhite, &sColorGray, 2000, 5); } @@ -129,11 +155,11 @@ void ObjIcePoly_Melt(ObjIcePoly* this, GlobalContext* globalCtx) { vel.z = 0.0f; for (i = 0; i < 2; i++) { - pos.x = this->actor.posRot.pos.x + - this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); - pos.y = this->actor.posRot.pos.y + this->actor.scale.y * Rand_ZeroOne() * 50.0f; - pos.z = this->actor.posRot.pos.z + - this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.x = + this->actor.world.pos.x + this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.y = this->actor.world.pos.y + this->actor.scale.y * Rand_ZeroOne() * 50.0f; + pos.z = + this->actor.world.pos.z + this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); func_8002829C(globalCtx, &pos, &vel, &accel, &sColorWhite, &sColorGray, Rand_S16Offset(0x15E, 0x64) * this->actor.scale.x, this->actor.scale.x * 20.0f); } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index e1fecf29af..550f7f8524 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -28,7 +28,7 @@ extern Gfx D_05005380[]; const ActorInit Obj_Kibako_InitVars = { ACTOR_OBJ_KIBAKO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjKibako), @@ -39,12 +39,26 @@ const ActorInit Obj_Kibako_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x09, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000002, 0x00, 0x01 }, { 0x4FC00748, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000002, 0x00, 0x01 }, + { 0x4FC00748, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, 27, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sCCInfoInit = { 0, 0xC, 0x3C, 0xFE }; +static CollisionCheckInfoInit sCCInfoInit = { 0, 12, 60, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -58,7 +72,7 @@ void ObjKibako_SpawnCollectible(ObjKibako* this, GlobalContext* globalCtx) { collectible = this->actor.params & 0x1F; if ((collectible >= 0) && (collectible <= 0x19)) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, + Item_DropCollectible(globalCtx, &this->actor.world.pos, collectible | (((this->actor.params >> 8) & 0x3F) << 8)); } } @@ -75,7 +89,7 @@ void ObjKibako_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -86,7 +100,7 @@ void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.2f; this->actor.minVelocityY = -13.0f; ObjKibako_InitCollider(&this->actor, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sCCInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sCCInfoInit); ObjKibako_SetupIdle(this); // wooden box osSyncPrintf("(dungeon keep 木箱)(arg_data 0x%04x)\n", this->actor.params); @@ -102,7 +116,7 @@ void ObjKibako_Destroy(Actor* thisx, GlobalContext* globalCtx2) { void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) { s16 angle; s32 i; - Vec3f* breakPos = &this->actor.posRot.pos; + Vec3f* breakPos = &this->actor.world.pos; Vec3f pos; Vec3f velocity; @@ -133,13 +147,13 @@ void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) { (Rand_ZeroOne() * 30.0f) + 10.0f, 0, 32, 60, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05005380); } - func_80033480(globalCtx, &this->actor.posRot.pos, 40.0f, 3, 50, 140, 1); + func_80033480(globalCtx, &this->actor.world.pos, 40.0f, 3, 50, 140, 1); } void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) { s16 angle; s32 i; - Vec3f* breakPos = &this->actor.posRot.pos; + Vec3f* breakPos = &this->actor.world.pos; Vec3f pos; Vec3f velocity; @@ -172,38 +186,38 @@ void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) { void ObjKibako_SetupIdle(ObjKibako* this) { this->actionFunc = ObjKibako_Idle; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; } void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { + s32 pad; + if (Actor_HasParent(&this->actor, globalCtx)) { ObjKibako_SetupHeld(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 19.0f)) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); - } else if (this->collider.base.acFlags & 2) { + } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); - if (!(this->collider.base.maskA & 8) && (this->actor.xzDistToLink > 28.0f)) { - this->collider.base.maskA |= 8; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 28.0f)) { + this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } - if (this->actor.xzDistToLink < 600.0f) { - ColliderCylinder* collider = &this->collider; - - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base); - if (this->actor.xzDistToLink < 180.0f) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); + if (this->actor.xzDistToPlayer < 600.0f) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + if (this->actor.xzDistToPlayer < 180.0f) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8002F580(&this->actor, globalCtx); } } @@ -221,45 +235,44 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) { if (fabsf(this->actor.speedXZ) < 0.1f) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); ObjKibako_SetupIdle(this); - this->collider.base.maskA &= ~8; + this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } else { ObjKibako_SetupThrown(this); ObjKibako_ApplyGravity(this); func_8002D7EC(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); } } void ObjKibako_SetupThrown(ObjKibako* this) { - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.colChkInfo.mass = 240; this->actionFunc = ObjKibako_Thrown; } void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; + s32 pad; + s32 pad2; - if ((thisx->bgCheckFlags & 0xB) || (this->collider.base.atFlags & 2)) { + if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); - Actor_Kill(thisx); + Actor_Kill(&this->actor); } else if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); - Actor_Kill(thisx); + Actor_Kill(&this->actor); } else { - ColliderCylinder* collider = &this->collider; - ObjKibako_ApplyGravity(this); - func_8002D7EC(thisx); - func_8002E4B4(globalCtx, thisx, 19.0f, 20.0f, 0.0f, 5); - Collider_CylinderUpdate(thisx, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); + func_8002D7EC(&this->actor); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index bdce44d611..6d42214f55 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -24,7 +24,7 @@ extern Gfx D_06001000[]; const ActorInit Obj_Kibako2_InitVars = { ACTOR_OBJ_KIBAKO2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_KIBAKO2, sizeof(ObjKibako2), @@ -35,8 +35,22 @@ const ActorInit Obj_Kibako2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 31, 48, 0, { 0, 0, 0 } }, }; @@ -52,7 +66,7 @@ void ObjKibako2_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); } void ObjKibako2_Break(ObjKibako2* this, GlobalContext* globalCtx) { @@ -63,7 +77,7 @@ void ObjKibako2_Break(ObjKibako2* this, GlobalContext* globalCtx) { s16 angle; s32 i; - thisPos = &this->dyna.actor.posRot.pos; + thisPos = &this->dyna.actor.world.pos; for (i = 0, angle = 0; i < 0x10; i++, angle += 0x4E20) { f32 sn = Math_SinS(angle); f32 cs = Math_CosS(angle); @@ -99,9 +113,9 @@ void ObjKibako2_SpawnCollectible(ObjKibako2* this, GlobalContext* globalCtx) { s16 collectibleFlagTemp; collectibleFlagTemp = this->collectibleFlag; - itemDropped = this->dyna.actor.initPosRot.rot.x; + itemDropped = this->dyna.actor.home.rot.x; if (itemDropped >= 0 && itemDropped < 0x1A) { - Item_DropCollectible(globalCtx, &this->dyna.actor.posRot.pos, itemDropped | (collectibleFlagTemp << 8)); + Item_DropCollectible(globalCtx, &this->dyna.actor.world.pos, itemDropped | (collectibleFlagTemp << 8)); } } @@ -116,14 +130,14 @@ void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx) { ObjKibako2_InitCollider(thisx, globalCtx); CollisionHeader_GetVirtual(&D_06000B70, &colHeader); bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - this->collectibleFlag = this->dyna.actor.initPosRot.rot.z & 0x3F; + this->collectibleFlag = this->dyna.actor.home.rot.z & 0x3F; this->dyna.bgId = bgId; this->actionFunc = ObjKibako2_Idle; - this->dyna.actor.initPosRot.rot.z = this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x = 0; + this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0; // Wooden box (stationary) osSyncPrintf("木箱(据置)(arg %04xH)(item %04xH %d)\n", this->dyna.actor.params, this->collectibleFlag, - this->dyna.actor.initPosRot.rot.x); + this->dyna.actor.home.rot.x); } void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -134,17 +148,15 @@ void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjKibako2_Idle(ObjKibako2* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) || this->dyna.actor.initPosRot.rot.z != 0 || - func_80033684(globalCtx, &this->dyna.actor) != 0) { + if ((this->collider.base.acFlags & AC_HIT) || (this->dyna.actor.home.rot.z != 0) || + func_80033684(globalCtx, &this->dyna.actor) != NULL) { ObjKibako2_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); this->dyna.actor.flags |= 0x10; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; this->actionFunc = ObjKibako2_Kill; - return; - } - if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -153,8 +165,8 @@ void ObjKibako2_Kill(ObjKibako2* this, GlobalContext* globalCtx) { s16 params = this->dyna.actor.params; if ((params & 0x8000) == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, params | 0x8000); } ObjKibako2_SpawnCollectible(this, globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 94425981bb..83ac69ace3 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_060003D0; /* const ActorInit Obj_Lift_InitVars = { ACTOR_OBJ_LIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_LIFT, sizeof(ObjLift), diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index f66055ed5c..ef763fef6a 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -45,7 +45,7 @@ extern UNK_TYPE D_06001420[]; // rgba16 32x32 eyes open, smiling const ActorInit Obj_Lightswitch_InitVars = { ACTOR_OBJ_LIGHTSWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_LIGHTSWITCH, sizeof(ObjLightswitch), @@ -55,18 +55,33 @@ const ActorInit Obj_Lightswitch_InitVars = { (ActorFunc)ObjLightswitch_Draw, }; -static ColliderJntSphItemInit sColliderJntSphItemInit[] = { +static ColliderJntSphElementInit sColliderJntSphElementInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00200000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 19 }, 100 }, }, }; static ColliderJntSphInit sColliderJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sColliderJntSphItemInit, + sColliderJntSphElementInit, }; -static CollisionCheckInfoInit sCollisionCheckInfoInit = { 0, 0xC, 0x3C, 0xFF }; + +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static UNK_PTR faceTextures[] = { D_06000C20, D_06000420, D_06001420 }; @@ -85,10 +100,10 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, GlobalContext* globalCtx) Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems); - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y), - this->actor.posRot.pos.z, &this->actor.shape.rot); + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y), + this->actor.world.pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, GlobalContext* globalCtx) { @@ -143,9 +158,9 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, GlobalContext* g } x = 2.0f * (x * (Rand_ZeroOne() - 0.5f)); z = (30.0f - fabsf(x)) * 0.5f + 10.0f * Rand_ZeroOne(); - pos.x = this->actor.posRot.pos.x + ((z * s) + (x * c)); - pos.y = this->actor.posRot.pos.y + y + 10.0f; - pos.z = this->actor.posRot.pos.z + ((z * c) - (x * s)); + pos.x = this->actor.world.pos.x + ((z * s) + (x * c)); + pos.y = this->actor.world.pos.y + y + 10.0f; + pos.z = this->actor.world.pos.z + ((z * c) - (x * s)); EffectSsDeadDb_Spawn(globalCtx, &pos, &D_80B97F74, &D_80B97F74, 100, 0, 255, 255, 160, 160, 255, 0, 0, 1, 9, true); } @@ -157,7 +172,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; @@ -169,17 +184,17 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.params & 1) == 1) { if (switchFlagSet) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_80B97F68); - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &D_80B97F68); + Math_Vec3f_Copy(&this->actor.world.pos, &D_80B97F68); + Math_Vec3f_Copy(&this->actor.home.pos, &D_80B97F68); } this->actor.shape.rot.x = -0x4000; this->actor.shape.rot.z = 0; - this->actor.posRot.rot.x = this->actor.initPosRot.rot.x = this->actor.shape.rot.x; - this->actor.posRot.rot.z = this->actor.initPosRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.x = this->actor.home.rot.x = this->actor.shape.rot.x; + this->actor.world.rot.z = this->actor.home.rot.z = this->actor.shape.rot.z; this->actor.flags |= 0x20; if (Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_OBJ_OSHIHIKI, - this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - 0, this->actor.initPosRot.rot.y, 0, (0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) { + this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, + this->actor.home.rot.y, 0, (0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) { osSyncPrintf(VT_COL(RED, WHITE)); // Push-pull block occurrence failure osSyncPrintf("押引ブロック発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_obj_lightswitch.c", 452, @@ -189,7 +204,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { } } ObjLightswitch_InitCollider(this, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sCollisionCheckInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (removeSelf) { Actor_Kill(&this->actor); } @@ -217,19 +232,19 @@ void ObjLightswitch_Off(ObjLightswitch* this, GlobalContext* globalCtx) { switch (this->actor.params >> 4 & 3) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { ObjLightswitch_SetupTurnOn(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_1: - if ((this->collider.base.acFlags & 2) && !(this->prevFrameACflags & 2)) { + if ((this->collider.base.acFlags & AC_HIT) && !(this->prevFrameACflags & AC_HIT)) { ObjLightswitch_SetupTurnOn(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_BURN: - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { ObjLightswitch_SetupDisappearDelay(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } @@ -245,7 +260,7 @@ void ObjLightswitch_SetupTurnOn(ObjLightswitch* this) { } void ObjLightswitch_TurnOn(ObjLightswitch* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->actor.type || this->toggleDelay <= 0) { + if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) { if (this->timer == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRIFORCE_FLASH); } @@ -288,13 +303,13 @@ void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx) { } break; case OBJLIGHTSWITCH_TYPE_1: - if (this->collider.base.acFlags & 2 && !(this->prevFrameACflags & 2)) { + if (this->collider.base.acFlags & AC_HIT && !(this->prevFrameACflags & AC_HIT)) { ObjLightswitch_SetupTurnOff(this); ObjLightswitch_ClearSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_2: - if (!(this->collider.base.acFlags & 2)) { + if (!(this->collider.base.acFlags & AC_HIT)) { if (this->timer >= 7) { ObjLightswitch_SetupTurnOff(this); ObjLightswitch_ClearSwitchFlag(this, globalCtx); @@ -317,7 +332,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, GlobalContext* globalCtx) { - if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.type || + if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -342,7 +357,7 @@ void ObjLightswitch_SetupDisappearDelay(ObjLightswitch* this) { } void ObjLightswitch_DisappearDelay(ObjLightswitch* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->actor.type || this->toggleDelay <= 0) { + if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) { ObjLightswitch_SetupDisappear(this); } } @@ -372,14 +387,14 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.update != NULL) { if ((this->actor.params & 1) == 1) { - this->actor.posRot.pos.x = this->actor.child->posRot.pos.x; - this->actor.posRot.pos.y = this->actor.child->posRot.pos.y + 60.0f; - this->actor.posRot.pos.z = this->actor.child->posRot.pos.z; - Actor_SetHeight(&this->actor, 0.0f); + this->actor.world.pos.x = this->actor.child->world.pos.x; + this->actor.world.pos.y = this->actor.child->world.pos.y + 60.0f; + this->actor.world.pos.z = this->actor.child->world.pos.z; + Actor_SetFocus(&this->actor, 0.0f); } this->prevFrameACflags = this->collider.base.acFlags; - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } @@ -399,16 +414,16 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) { if ((this->actor.params & 1) == 1) { child = this->actor.child; - this->actor.posRot.pos.x = child->posRot.pos.x; - this->actor.posRot.pos.y = child->posRot.pos.y + 60.0f; - this->actor.posRot.pos.z = child->posRot.pos.z; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + this->actor.world.pos.x = child->world.pos.x; + this->actor.world.pos.y = child->world.pos.y + 60.0f; + this->actor.world.pos.z = child->world.pos.z; + Math_Vec3f_Copy(&pos, &this->actor.world.pos); func_800D1694(pos.x, pos.y, pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); } else { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08 * this->actor.scale.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y; + pos.z = this->actor.world.pos.z; } gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 841), @@ -447,9 +462,9 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) { (u8)(this->alpha >> 6)); gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280); - sp68.x = this->actor.posRot.pos.x; - sp68.y = this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y); - sp68.z = this->actor.posRot.pos.z; + sp68.x = this->actor.world.pos.x; + sp68.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); + sp68.z = this->actor.world.pos.z; gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 912), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -481,7 +496,7 @@ void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 alpha = this->alpha >> 6 & 0xFF; if ((this->actor.params & 1) == 1) { - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index 9a36dca8cb..17341ded90 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -19,7 +19,7 @@ typedef struct ObjLightswitch { /* 0x0000 */ Actor actor; /* 0x014C */ ObjLightswitchActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 timer; // collision-related threshold and controls animation/logic when turning on/off /* 0x01B2 */ s16 toggleDelay; // timer ticking down used for delaying tuning on/off or disappearing, can be bypassed /* 0x01B4 */ s16 faceTextureIndex; // texture used by the center part of the sun diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index ac2020d8ca..7c9698a8cf 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -19,7 +19,7 @@ void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx); const ActorInit Obj_Makekinsuta_InitVars = { ACTOR_OBJ_MAKEKINSUTA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMakekinsuta), @@ -49,9 +49,8 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx) { void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { if (this->unk_152 != 0) { if (this->timer >= 60 && !func_8002DEEC(PLAYER)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, - (this->actor.params | 0x8000)); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, (this->actor.params | 0x8000)); this->actionFunc = ObjMakekinsuta_DoNothing; } else { this->timer++; diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index 3d884045f7..e720d14d4e 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -16,7 +16,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx); void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Makeoshihiki_InitVars = { - ACTOR_OBJ_MAKEOSHIHIKI, ACTORTYPE_PROP, FLAGS, + ACTOR_OBJ_MAKEOSHIHIKI, ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjMakeoshihiki), (ActorFunc)ObjMakeoshihiki_Init, (ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjMakeoshihiki_Draw, }; @@ -51,7 +51,7 @@ static u32 sFlags[3][2] = { { 0, 0 }, { 1, 0 }, { 0, 1 } }; static void (*sFlagSwitchFuncs[])(GlobalContext* globalCtx, s32 flag) = { Flags_UnsetSwitch, Flags_SetSwitch }; void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { - BlockConfig* block = &sBlocks[thisx->initPosRot.rot.z & 1]; + BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; s32 typeIdx; Vec3f* spawnPos; @@ -78,13 +78,12 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { if (block->unk_24[typeIdx] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; } - thisx->posRot.rot.z = thisx->shape.rot.z = 0; - osSyncPrintf("(%s)(arg_data %04xF)(angleZ %d)\n", "../z_obj_makeoshihiki.c", thisx->params, - thisx->initPosRot.rot.z); + thisx->world.rot.z = thisx->shape.rot.z = 0; + osSyncPrintf("(%s)(arg_data %04xF)(angleZ %d)\n", "../z_obj_makeoshihiki.c", thisx->params, thisx->home.rot.z); } void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { - BlockConfig* block = &sBlocks[thisx->initPosRot.rot.z & 1]; + BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; s32 i; s32 sfxCond1; s32 sfxCond2; @@ -92,7 +91,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 cond2; for (i = 0; i < 3; i++) { - if (Math3D_Vec3fDistSq(&thisx->child->posRot.pos, &block->posVecs[i]) < 0.001f) { + if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) { if (block->unk_24[i] & 1) { if ((thisx->params >> 6) & 1) { sfxCond1 = false; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 6e10540c47..efce7a4db0 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -17,7 +17,7 @@ void ObjMure_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure_InitVars = { ACTOR_OBJ_MURE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure), diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 327144a17e..b9b42c4e19 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -32,7 +32,7 @@ void func_80B9A6E8(ObjMure2* this); const ActorInit Obj_Mure2_InitVars = { ACTOR_OBJ_MURE2, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure2), @@ -56,9 +56,9 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { Vec3f* vecPtr = vec; s32 i; - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); for (i = 1, vecPtr++; i < D_80B9A818[this->actor.params & 3]; vecPtr++, i++) { - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); vecPtr->x += (80.0f * Math_SinS((i - 1) * 0x2000)); vecPtr->z += (80.0f * Math_CosS((i - 1) * 0x2000)); } @@ -76,8 +76,8 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { Vec3f* vecPtr; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; // Required to match - ObjMure2* this2 = this; // Required to match + Vec3f* actorPos = &this->actor.world.pos; // Required to match + ObjMure2* this2 = this; // Required to match for (vecPtr = vec, i = 0; i < D_80B9A818[this2->actor.params & 3]; vecPtr++, i++) { Math_Vec3f_Copy(vecPtr, actorPos); @@ -92,7 +92,7 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; for (i = 0; i < D_80B9A818[this->actor.params & 3]; vecPtr++, i++) { - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); vecPtr->x += (80.0f * Math_SinS(i * 0x2000)); vecPtr->z += (80.0f * Math_CosS(i * 0x2000)); } @@ -134,7 +134,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, GlobalContext* globalCtx) { if (((this->currentActorNum >> i) & 1) == 0) { this->actorSpawnPtrList[i] = Actor_Spawn(&globalCtx->actorCtx, globalCtx, sActorSpawnIDs[actorNum], spawnPos[i].x, spawnPos[i].y, - spawnPos[i].z, this->actor.posRot.rot.x, 0, this->actor.posRot.rot.z, params); + spawnPos[i].z, this->actor.world.rot.x, 0, this->actor.world.rot.z, params); if (this->actorSpawnPtrList[i] != NULL) { this->actorSpawnPtrList[i]->room = this->actor.room; } diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index 050f8982ab..d58642b1fd 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -17,7 +17,7 @@ void ObjMure3_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure3_InitVars = { ACTOR_OBJ_MURE3, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure3), diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index c9538e19db..863bc26df5 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -33,7 +33,7 @@ extern Gfx D_05004CD0[]; const ActorInit Obj_Oshihiki_InitVars = { ACTOR_OBJ_OSHIHIKI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjOshihiki), @@ -151,7 +151,7 @@ ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalC Actor* dyna; if ((this->floorBgIds[this->highestFloor] != BGCHECK_SCENE) && - (fabsf(this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) < 0.001f)) { + (fabsf(this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) < 0.001f)) { dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]); if ((dyna != NULL) && (dyna->id == ACTOR_OBJ_OSHIHIKI)) { return (ObjOshihiki*)dyna; @@ -161,22 +161,22 @@ ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalC } void ObjOshihiki_UpdateInitPos(ObjOshihiki* this) { - if (this->dyna.actor.initPosRot.pos.x < this->dyna.actor.posRot.pos.x) { - while ((this->dyna.actor.posRot.pos.x - this->dyna.actor.initPosRot.pos.x) >= 20.0f) { - this->dyna.actor.initPosRot.pos.x += 20.0f; + if (this->dyna.actor.home.pos.x < this->dyna.actor.world.pos.x) { + while ((this->dyna.actor.world.pos.x - this->dyna.actor.home.pos.x) >= 20.0f) { + this->dyna.actor.home.pos.x += 20.0f; } } else { - while ((this->dyna.actor.initPosRot.pos.x - this->dyna.actor.posRot.pos.x) >= 20.0f) { - this->dyna.actor.initPosRot.pos.x -= 20.0f; + while ((this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x) >= 20.0f) { + this->dyna.actor.home.pos.x -= 20.0f; } } - if (this->dyna.actor.initPosRot.pos.z < this->dyna.actor.posRot.pos.z) { - while ((this->dyna.actor.posRot.pos.z - this->dyna.actor.initPosRot.pos.z) >= 20.0f) { - this->dyna.actor.initPosRot.pos.z += 20.0f; + if (this->dyna.actor.home.pos.z < this->dyna.actor.world.pos.z) { + while ((this->dyna.actor.world.pos.z - this->dyna.actor.home.pos.z) >= 20.0f) { + this->dyna.actor.home.pos.z += 20.0f; } } else { - while ((this->dyna.actor.initPosRot.pos.z - this->dyna.actor.posRot.pos.z) >= 20.0f) { - this->dyna.actor.initPosRot.pos.z -= 20.0f; + while ((this->dyna.actor.home.pos.z - this->dyna.actor.world.pos.z) >= 20.0f) { + this->dyna.actor.home.pos.z -= 20.0f; } } } @@ -306,7 +306,7 @@ void ObjOshihiki_Init(Actor* thisx, GlobalContext* globalCtx2) { ObjOshihiki_SetScale(this, globalCtx); ObjOshihiki_SetTexture(this, globalCtx); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; ObjOshihiki_SetColor(this, globalCtx); ObjOshihiki_ResetFloors(this); ObjOshihiki_SetupOnActor(this, globalCtx); @@ -334,9 +334,9 @@ void ObjOshihiki_SetFloors(ObjOshihiki* this, GlobalContext* globalCtx) { colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f); colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f); ObjOshihiki_RotateXZ(&colCheckPoint, &colCheckOffset, this->yawSin, this->yawCos); - colCheckPoint.x += this->dyna.actor.posRot.pos.x; - colCheckPoint.y += this->dyna.actor.pos4.y; - colCheckPoint.z += this->dyna.actor.posRot.pos.z; + colCheckPoint.x += this->dyna.actor.world.pos.x; + colCheckPoint.y += this->dyna.actor.prevPos.y; + colCheckPoint.z += this->dyna.actor.world.pos.z; floorPoly = &this->floorPolys[i]; floorBgId = &this->floorBgIds[i]; @@ -380,14 +380,14 @@ void ObjOshihiki_SetGround(ObjOshihiki* this, GlobalContext* globalCtx) { ObjOshihiki_ResetFloors(this); ObjOshihiki_SetFloors(this, globalCtx); this->highestFloor = ObjOshihiki_GetHighestFloor(this); - this->dyna.actor.groundY = this->floorHeights[this->highestFloor]; + this->dyna.actor.floorHeight = this->floorHeights[this->highestFloor]; } s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) { ObjOshihiki_SetGround(this, globalCtx); - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return 1; } @@ -395,15 +395,15 @@ s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) { } s32 ObjOshihiki_CheckGround(ObjOshihiki* this, GlobalContext* globalCtx) { - if (this->dyna.actor.posRot.pos.y <= -31990.0f) { + if (this->dyna.actor.world.pos.y <= -31990.0f) { // Warning : Push-pull block fell too much osSyncPrintf("Warning : 押し引きブロック落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 809, this->dyna.actor.params); Actor_Kill(&this->dyna.actor); return 0; } - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return 1; } return 0; @@ -427,9 +427,9 @@ s32 ObjOshihiki_CheckWall(GlobalContext* globalCtx, s16 angle, f32 direction, Ob faceVtxOffset.y = (sFaceVtx[i].y * this->dyna.actor.scale.y * 10.0f) + sFaceDirection[i].y; faceVtxOffset.z = 0.0f; ObjOshihiki_RotateXZ(&faceVtx, &faceVtxOffset, sn, cs); - faceVtx.x += this->dyna.actor.posRot.pos.x; - faceVtx.y += this->dyna.actor.posRot.pos.y; - faceVtx.z += this->dyna.actor.posRot.pos.z; + faceVtx.x += this->dyna.actor.world.pos.x; + faceVtx.y += this->dyna.actor.world.pos.y; + faceVtx.z += this->dyna.actor.world.pos.z; faceVtxNext.x = faceVtx.x + maxDist * sn; faceVtxNext.y = faceVtx.y; faceVtxNext.z = faceVtx.z + maxDist * cs; @@ -452,10 +452,10 @@ s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) if ((this->stateFlags & PUSHBLOCK_MOVE_UNDER) && (this->blockUnder != NULL)) { if (this->blockUnder->stateFlags & PUSHBLOCK_PUSH) { - this->underDistX = this->blockUnder->dyna.actor.posRot.pos.x - this->blockUnder->dyna.actor.pos4.x; - this->underDistZ = this->blockUnder->dyna.actor.posRot.pos.z - this->blockUnder->dyna.actor.pos4.z; - this->dyna.actor.posRot.pos.x += this->underDistX; - this->dyna.actor.posRot.pos.z += this->underDistZ; + this->underDistX = this->blockUnder->dyna.actor.world.pos.x - this->blockUnder->dyna.actor.prevPos.x; + this->underDistZ = this->blockUnder->dyna.actor.world.pos.z - this->blockUnder->dyna.actor.prevPos.z; + this->dyna.actor.world.pos.x += this->underDistX; + this->dyna.actor.world.pos.z += this->underDistZ; ObjOshihiki_UpdateInitPos(this); return 1; } else if (!(this->blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) { @@ -547,7 +547,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx) { if ((dynaActor != NULL) && (dynaActor->unk_15C & 1)) { func_800434A8(dynaActor); func_80043538(dynaActor); - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } else { ObjOshihiki_SetupFall(this, globalCtx); } @@ -572,12 +572,12 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist; - thisx->posRot.pos.x = thisx->initPosRot.pos.x + (pushDistSigned * this->yawSin); - thisx->posRot.pos.z = thisx->initPosRot.pos.z + (pushDistSigned * this->yawCos); + thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin); + thisx->world.pos.z = thisx->home.pos.z + (pushDistSigned * this->yawCos); if (!ObjOshihiki_CheckFloor(this, globalCtx)) { - thisx->initPosRot.pos.x = thisx->posRot.pos.x; - thisx->initPosRot.pos.z = thisx->posRot.pos.z; + thisx->home.pos.x = thisx->world.pos.x; + thisx->home.pos.z = thisx->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; @@ -589,8 +589,8 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); } - thisx->initPosRot.pos.x = thisx->posRot.pos.x; - thisx->initPosRot.pos.z = thisx->posRot.pos.z; + thisx->home.pos.x = thisx->world.pos.x; + thisx->home.pos.z = thisx->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; @@ -649,10 +649,10 @@ void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx) { this->timer--; } - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; + this->dyna.actor.world.rot.y = this->dyna.unk_158; - this->yawSin = Math_SinS(this->dyna.actor.posRot.rot.y); - this->yawCos = Math_CosS(this->dyna.actor.posRot.rot.y); + this->yawSin = Math_SinS(this->dyna.actor.world.rot.y); + this->yawCos = Math_CosS(this->dyna.actor.world.rot.y); if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index fe64164fe3..325f7b29a0 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -19,7 +19,7 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx); const ActorInit Obj_Roomtimer_InitVars = { ACTOR_OBJ_ROOMTIMER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjRoomtimer), @@ -61,7 +61,7 @@ void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx) { func_80088B34(this->actor.params); } - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); this->actionFunc = func_80B9D0B0; } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index a44c339508..899fba8df5 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -59,7 +59,7 @@ extern UNK_TYPE D_05014CB0[]; // blue plasma/cloud const ActorInit Obj_Switch_InitVars = { ACTOR_OBJ_SWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjSwitch), @@ -71,49 +71,105 @@ const ActorInit Obj_Switch_InitVars = { static f32 sHeights[] = { 10, 10, 0, 30, 30 }; -static ColliderTrisItemInit D_80B9EC34[2] = { +static ColliderTrisElementInit D_80B9EC34[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -20.0f, 19.0f, -20.0f }, { -20.0f, 19.0f, 20.0f }, { 20.0f, 19.0f, 20.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 20.0f, 19.0f, 20.0f }, { 20.0f, 19.0f, -20.0f }, { -20.0f, 19.0f, -20.0f } } }, }, }; static ColliderTrisInit sRustyFloorTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, D_80B9EC34, }; -static ColliderTrisItemInit D_80B9ECBC[2] = { +static ColliderTrisElementInit D_80B9ECBC[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { -23.0f, 0.0f, 8.5f }, { 0.0f, -23.0f, 8.5f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { 0.0f, -23.0f, 8.5f }, { 23.0f, 0.0f, 8.5f } } }, }, }; static ColliderTrisInit trisColliderEye = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, D_80B9ECBC, }; -static ColliderJntSphItemInit D_80B9ED44[1] = { +static ColliderJntSphElementInit D_80B9ED44[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xEFC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 300, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sCyrstalJntSphereInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, D_80B9ED44, }; @@ -156,11 +212,11 @@ void ObjSwitch_InitJntSphCollider(ObjSwitch* this, GlobalContext* globalCtx, Col Collider_InitJntSph(globalCtx, colliderJntSph); Collider_SetJntSph(globalCtx, colliderJntSph, &this->dyna.actor, colliderJntSphInit, this->jntSph.items); - func_800D1694(this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + this->dyna.actor.shape.unk_08 * this->dyna.actor.scale.y, - this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot); + func_800D1694(this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + this->dyna.actor.shape.yOffset * this->dyna.actor.scale.y, + this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); - func_800628A4(0, colliderJntSph); + Collider_UpdateSpheres(0, colliderJntSph); } void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, ColliderTrisInit* colliderTrisInit) { @@ -174,20 +230,20 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, Colli for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) { - ObjSwitch_RotateY(&pos[j], &colliderTrisInit->list[i].dim.vtx[j], this->dyna.actor.initPosRot.rot.y); - Math_Vec3f_Sum(&pos[j], &this->dyna.actor.posRot.pos, &pos[j]); + ObjSwitch_RotateY(&pos[j], &colliderTrisInit->elements[i].dim.vtx[j], this->dyna.actor.home.rot.y); + Math_Vec3f_Sum(&pos[j], &this->dyna.actor.world.pos, &pos[j]); } - func_800627A0(colliderTris, i, &pos[0], &pos[1], &pos[2]); + Collider_SetTrisVertices(colliderTris, i, &pos[0], &pos[1], &pos[2]); } } Actor* ObjSwitch_SpawnIce(ObjSwitch* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - return Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_ICE_POLY, thisx->posRot.pos.x, - thisx->posRot.pos.y, thisx->posRot.pos.z, thisx->posRot.rot.x, thisx->posRot.rot.y, - thisx->posRot.rot.z, (this->dyna.actor.params >> 8 & 0x3F) << 8); + return Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_ICE_POLY, thisx->world.pos.x, + thisx->world.pos.y, thisx->world.pos.z, thisx->world.rot.x, thisx->world.rot.y, + thisx->world.rot.z, (this->dyna.actor.params >> 8 & 0x3F) << 8); } void ObjSwitch_SetOn(ObjSwitch* this, GlobalContext* globalCtx) { @@ -245,10 +301,10 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 1.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 1.0f; } - Actor_SetHeight(&this->dyna.actor, sHeights[type]); + Actor_SetFocus(&this->dyna.actor, sHeights[type]); if (type == OBJSWITCH_TYPE_FLOOR_RUSTY) { ObjSwitch_InitTrisCollider(this, globalCtx, &sRustyFloorTrisInit); @@ -260,10 +316,10 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { if (type == OBJSWITCH_TYPE_CRYSTAL_TARGETABLE) { this->dyna.actor.flags |= 1; - this->dyna.actor.unk_1F = 4; + this->dyna.actor.targetMode = 4; } - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->dyna.actor.params >> 7 & 1) && (ObjSwitch_SpawnIce(this, globalCtx) == NULL)) { osSyncPrintf(VT_FGCOL(RED)); @@ -326,10 +382,10 @@ void ObjSwitch_FloorUpInit(ObjSwitch* this) { void ObjSwitch_FloorUp(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 7) == OBJSWITCH_TYPE_FLOOR_RUSTY) { - if (this->tris.col.base.acFlags & 2) { + if (this->tris.col.base.acFlags & AC_HIT) { ObjSwitch_FloorPressInit(this); ObjSwitch_SetOn(this, globalCtx); - this->tris.col.base.acFlags &= ~2; + this->tris.col.base.acFlags &= ~AC_HIT; } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->tris.col.base); } @@ -370,12 +426,12 @@ void ObjSwitch_FloorPressInit(ObjSwitch* this) { void ObjSwitch_FloorPress(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_FLOOR_3 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y -= 99.0f / 2000.0f; if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) { ObjSwitch_FloorDownInit(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 120, 20, 10); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); } } } @@ -426,13 +482,13 @@ void ObjSwitch_FloorRelease(ObjSwitch* this, GlobalContext* globalCtx) { s16 subType = (this->dyna.actor.params >> 4 & 7); if (((subType != OBJSWITCH_SUBTYPE_FLOOR_1) && (subType != OBJSWITCH_SUBTYPE_FLOOR_3)) || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y += 99.0f / 2000.0f; if (this->dyna.actor.scale.y >= 33.0f / 200.0f) { ObjSwitch_FloorUpInit(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); if (subType == OBJSWITCH_SUBTYPE_FLOOR_1) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 120, 20, 10); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); } } } @@ -442,10 +498,10 @@ s32 ObjSwitch_EyeIsHit(ObjSwitch* this) { Actor* collidingActor; s16 yawDiff; - if ((this->tris.col.base.acFlags & 2) && !(this->unk_17F & 2)) { + if ((this->tris.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2)) { collidingActor = this->tris.col.base.ac; if (collidingActor != NULL) { - yawDiff = collidingActor->posRot.rot.y - this->dyna.actor.shape.rot.y; + yawDiff = collidingActor->world.rot.y - this->dyna.actor.shape.rot.y; if (ABS(yawDiff) > 0x5000) { return 1; } @@ -485,7 +541,7 @@ void ObjSwitch_EyeClosingInit(ObjSwitch* this) { } void ObjSwitch_EyeClosing(ObjSwitch* this, GlobalContext* globalCtx) { - if (!this->cooldownOn || func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex++; if (this->eyeTexIndex >= 3) { ObjSwitch_EyeClosedInit(this); @@ -524,7 +580,7 @@ void ObjSwitch_EyeOpeningInit(ObjSwitch* this) { void ObjSwitch_EyeOpening(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_EYE_1 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex--; if (this->eyeTexIndex <= 0) { ObjSwitch_EyeOpenInit(this); @@ -544,14 +600,14 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) { void ObjSwitch_CrystalOff(ObjSwitch* this, GlobalContext* globalCtx) { switch ((this->dyna.actor.params >> 4 & 7)) { case OBJSWITCH_SUBTYPE_CRYSTAL_0: - if ((this->jntSph.col.base.acFlags & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); ObjSwitch_CrystalTurnOnInit(this); } break; case OBJSWITCH_SUBTYPE_CRYSTAL_4: - if (((this->jntSph.col.base.acFlags & 2) && this->disableAcTimer <= 0) || + if (((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) || Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8 & 0x3F))) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); @@ -559,7 +615,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, GlobalContext* globalCtx) { } break; case OBJSWITCH_SUBTYPE_CRYSTAL_1: - if ((this->jntSph.col.base.acFlags & 2) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); ObjSwitch_CrystalTurnOnInit(this); @@ -575,7 +631,7 @@ void ObjSwitch_CrystalTurnOnInit(ObjSwitch* this) { } void ObjSwitch_CrystalTurnOn(ObjSwitch* this, GlobalContext* globalCtx) { - if (!this->cooldownOn || func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOnInit(this); if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_CRYSTAL_1) { ObjSwitch_UpdateTwoTexScrollXY(this); @@ -601,7 +657,7 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, GlobalContext* globalCtx) { } break; case OBJSWITCH_SUBTYPE_CRYSTAL_1: - if ((this->jntSph.col.base.acFlags & 2) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; globalCtx = globalCtx; ObjSwitch_CrystalTurnOffInit(this); @@ -619,7 +675,7 @@ void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this) { void ObjSwitch_CrystalTurnOff(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_CRYSTAL_1 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOffInit(this); ObjSwitch_UpdateTwoTexScrollXY(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); @@ -645,7 +701,7 @@ void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { break; case OBJSWITCH_TYPE_EYE: this->unk_17F = this->tris.col.base.acFlags; - this->tris.col.base.acFlags &= ~2; + this->tris.col.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->tris.col.base); break; case OBJSWITCH_TYPE_CRYSTAL: @@ -654,7 +710,7 @@ void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { this->disableAcTimer--; } this->unk_17F = this->jntSph.col.base.acFlags; - this->jntSph.col.base.acFlags &= ~2; + this->jntSph.col.base.acFlags &= ~AC_HIT; if (this->disableAcTimer <= 0) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->jntSph.col.base); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index dd2bc3994b..337019be71 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -36,12 +36,12 @@ typedef enum { typedef struct { /* 0x00 */ ColliderJntSph col; - /* 0x20 */ ColliderJntSphItem items[2]; + /* 0x20 */ ColliderJntSphElement items[2]; } ObjSwitchJntSph; typedef struct { /* 0x00 */ ColliderTris col; - /* 0x20 */ ColliderTrisItem items[2]; + /* 0x20 */ ColliderTrisElement items[2]; } ObjSwitchTris; typedef struct ObjSwitch { diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 1d0513b5f6..914a0f3548 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -20,7 +20,7 @@ extern Gfx D_0404D4E0[]; const ActorInit Obj_Syokudai_InitVars = { ACTOR_OBJ_SYOKUDAI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SYOKUDAI, sizeof(ObjSyokudai), @@ -31,14 +31,42 @@ const ActorInit Obj_Syokudai_InitVars = { }; static ColliderCylinderInit sCylInitStand = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00100000, 0x00, 0x00 }, { 0xEE01FFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00100000, 0x00, 0x00 }, + { 0xEE01FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 12, 45, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylInitFlame = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00020820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00020820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 15, 45, 45, { 0, 0, 0 } }, }; @@ -62,15 +90,15 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderStand); Collider_SetCylinder(globalCtx, &this->colliderStand, &this->actor, &sCylInitStand); - this->colliderStand.base.type = sColTypesStand[this->actor.params >> 0xC]; + this->colliderStand.base.colType = sColTypesStand[this->actor.params >> 0xC]; Collider_InitCylinder(globalCtx, &this->colliderFlame); Collider_SetCylinder(globalCtx, &this->colliderFlame, &this->actor, &sCylInitFlame); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y + 70.0f, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y + 70.0f, + this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); if ((this->actor.params & 0x400) || ((torchType != 2) && Flags_GetSwitch(globalCtx, this->actor.params & 0x3F))) { @@ -79,7 +107,7 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { this->flameTexScroll = (s32)(Rand_ZeroOne() * 20.0f); sLitTorchCount = 0; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); } void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -105,18 +133,18 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { Player* player; EnArrow* arrow; s32 interactionType; - u32 toucherFlags; + u32 dmgFlags; Vec3f tipToFlame; - ColliderCylinder* colliderStand; - ColliderCylinder* colliderFlame; + s32 pad; + s32 pad2; litTimeScale = torchCount; if (torchCount == 10) { torchCount = 24; } - if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, + if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &waterSurface, &dummy) && - ((waterSurface - this->actor.posRot.pos.y) > 52.0f)) { + ((waterSurface - this->actor.world.pos.y) > 52.0f)) { this->litTimer = 0; if (torchType == 1) { Flags_UnsetSwitch(globalCtx, switchFlag); @@ -144,13 +172,13 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { this->litTimer = 20; } } - if (this->colliderFlame.base.acFlags & 2) { - toucherFlags = this->colliderFlame.body.acHitItem->toucher.flags; - if (toucherFlags & 0x20820) { + if (this->colliderFlame.base.acFlags & AC_HIT) { + dmgFlags = this->colliderFlame.info.acHitInfo->toucher.dmgFlags; + if (dmgFlags & 0x20820) { interactionType = 1; } } else if (player->heldItemActionParam == 6) { - Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.posRot.pos, &tipToFlame); + Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame); tipToFlame.y -= 67.0f; if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) { interactionType = -1; @@ -166,7 +194,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (player->unk_860 < 200) { player->unk_860 = 200; } - } else if (toucherFlags & 0x20) { + } else if (dmgFlags & 0x20) { arrow = (EnArrow*)this->colliderFlame.base.ac; if ((arrow->actor.update != NULL) && (arrow->actor.id == ACTOR_EN_ARROW)) { arrow->actor.params = 0; @@ -176,7 +204,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { if ((0 <= this->litTimer) && (this->litTimer < (50 * litTimeScale + 100)) && (torchType != 0)) { this->litTimer = 50 * litTimeScale + 100; } - } else if ((torchType != 0) && (((interactionType > 0) && (toucherFlags & 0x20800)) || + } else if ((torchType != 0) && (((interactionType > 0) && (dmgFlags & 0x20800)) || ((interactionType < 0) && (player->unk_860 != 0)))) { if ((interactionType < 0) && (player->unk_860 < 200)) { @@ -203,14 +231,13 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { } } } - colliderStand = &this->colliderStand; - Collider_CylinderUpdate(&this->actor, colliderStand); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &colliderStand->base); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &colliderStand->base); - colliderFlame = &this->colliderFlame; - Collider_CylinderUpdate(&this->actor, colliderFlame); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &colliderFlame->base); + Collider_UpdateCylinder(&this->actor, &this->colliderStand); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderStand.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderStand.base); + + Collider_UpdateCylinder(&this->actor, &this->colliderFlame); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderFlame.base); if (this->litTimer > 0) { this->litTimer--; diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index fbe9cf3f9c..8d03d921ad 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -31,7 +31,7 @@ extern CollisionHeader D_06000B30; const ActorInit Obj_Timeblock_InitVars = { ACTOR_OBJ_TIMEBLOCK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_TIMEBLOCK, sizeof(ObjTimeblock), @@ -55,7 +55,7 @@ static ObjTimeblockSizeOptions sSizeOptions[] = { static f32 sRanges[] = { 60.0, 100.0, 140.0, 180.0, 220.0, 260.0, 300.0, 300.0 }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1800, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP), @@ -85,8 +85,8 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { } void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, 0, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0, sSizeOptions[(this->dyna.actor.params >> 8) & 1].demoEffectParams); } @@ -104,7 +104,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = 0; + this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; CollisionHeader_GetVirtual(&D_06000B30, &colHeader); @@ -121,7 +121,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { this->songObserverFunc = ObjTimeblock_WaitForOcarina; - Actor_SetHeight(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); + Actor_SetFocus(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); this->unk_174 = (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) ? true : false; this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; @@ -137,7 +137,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { // "Block of time" osSyncPrintf("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.initPosRot.rot.z & 7, (this->dyna.actor.params >> 11) & 7, + this->unk_177, this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 11) & 7, (this->dyna.actor.params >> 10) & 1); } @@ -153,11 +153,11 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, GlobalContext* globalCtx) { return false; } - if (this->dyna.actor.xzDistToLink <= sRanges[(this->dyna.actor.params >> 11) & 7]) { + if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) { Vec3f distance; f32 blockSize; - func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.world.pos); blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f; // Return true if player's xz position is not inside the block if (blockSize < fabsf(distance.x) || blockSize < fabsf(distance.z)) { @@ -333,7 +333,7 @@ void ObjTimeblock_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx) { if (((ObjTimeblock*)thisx)->isVisible) { - Color_RGB8* primColor = &sPrimColors[thisx->initPosRot.rot.z & 7]; + Color_RGB8* primColor = &sPrimColors[thisx->home.rot.z & 7]; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_timeblock.c", 762); diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 01514b9fc3..f0c097cf92 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -17,7 +17,7 @@ void ObjTsubo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Tsubo_InitVars = { ACTOR_OBJ_TSUBO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjTsubo), @@ -26,6 +26,26 @@ const ActorInit Obj_Tsubo_InitVars = { (ActorFunc)ObjTsubo_Update, NULL, }; + +static ColliderCylinderInit D_80BA1B94 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000002, 0x00, 0x01 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, 26, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0D60.s") diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 247127a54d..fabaf2dc32 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -34,7 +34,7 @@ extern UNK_TYPE D_06000B30; /* const ActorInit Obj_Warp2block_InitVars = { ACTOR_OBJ_WARP2BLOCK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_TIMEBLOCK, sizeof(ObjWarp2block), diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 8ca5397443..ed8dc8753a 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -28,7 +28,7 @@ extern UNK_TYPE D_06009620; /* const ActorInit Object_Kankyo_InitVars = { ACTOR_OBJECT_KANKYO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjectKankyo), diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 0b3521a620..31b16fdee1 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -20,7 +20,7 @@ void OceffSpot_GrowCylinder(OceffSpot* this, GlobalContext* globalCtx); const ActorInit Oceff_Spot_InitVars = { ACTOR_OCEFF_SPOT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffSpot), @@ -48,12 +48,12 @@ void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); OceffSpot_SetupAction(this, OceffSpot_GrowCylinder); - Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->lightNode1 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo1); - Lights_PointNoGlowSetInfo(&this->lightInfo2, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo2, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->lightNode2 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo2); if (YREG(15)) { this->actor.scale.y = 2.4f; @@ -72,7 +72,7 @@ void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) { LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode1); LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode2); func_800876C8(globalCtx); - if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].length != 0)) { + if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) { player->stateFlags3 |= 0x40; } } @@ -129,20 +129,20 @@ void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.z = 0.42f * temp; this->actor.scale.x = 0.42f * temp; - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y += 5.0f; temp = (2.0f - this->unk_174) * this->unk_174; func_800773A8(globalCtx, temp * 0.5F, 880.0f, 0.2f, 0.9f); - Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 55.0f, - (s16)this->actor.posRot.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp), + Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.world.pos.x, (s16)this->actor.world.pos.y + 55.0f, + (s16)this->actor.world.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp)); Lights_PointNoGlowSetInfo(&this->lightInfo2, - (s16)this->actor.posRot.pos.x + Math_SinS(player->actor.shape.rot.y) * 20.0f, - (s16)this->actor.posRot.pos.y + 20.0f, - (s16)this->actor.posRot.pos.z + Math_CosS(player->actor.shape.rot.y) * 20.0f, + (s16)this->actor.world.pos.x + Math_SinS(player->actor.shape.rot.y) * 20.0f, + (s16)this->actor.world.pos.y + 20.0f, + (s16)this->actor.world.pos.z + Math_CosS(player->actor.shape.rot.y) * 20.0f, (s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp)); } diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 0419b964e4..c219a8239f 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -22,7 +22,7 @@ void OceffStorm_UnkAction(OceffStorm* this, GlobalContext* globalCtx); const ActorInit Oceff_Storm_InitVars = { ACTOR_OCEFF_STORM, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffStorm), @@ -54,8 +54,8 @@ void OceffStorm_Init(Actor* thisx, GlobalContext* globalCtx) { OceffStorm_SetupAction(this, OceffStorm_UnkAction); this->actor.draw = OceffStorm_Draw2; } else { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKARINA_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y - 30.0f, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKARINA_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y - 30.0f, this->actor.world.pos.z, 0, 0, 0, 1); } } @@ -96,7 +96,7 @@ void OceffStorm_DefaultAction(OceffStorm* this, GlobalContext* globalCtx) { } if (this->counter > 60) { - this->actor.posRot.pos.y += this->posYOff * 0.01f; + this->actor.world.pos.y += this->posYOff * 0.01f; this->posYOff += this->posYOffAdd; this->posYOffAdd += 10; } @@ -119,7 +119,7 @@ void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx) { OceffStorm* this = THIS; Player* player = PLAYER; - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; this->actor.shape.rot.y = Camera_GetCamDirYaw(ACTIVE_CAM); this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 1cc40ceb6a..d821665ee5 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -18,7 +18,7 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe_InitVars = { ACTOR_OCEFF_WIPE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe), @@ -40,7 +40,7 @@ void OceffWipe_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE arg_data = %d\n" VT_RST, this->actor.params); } @@ -57,7 +57,7 @@ void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 7e0b81107d..8289661391 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -18,7 +18,7 @@ void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe2_InitVars = { ACTOR_OCEFF_WIPE2, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe2), @@ -34,7 +34,7 @@ void OceffWipe2_Init(Actor* thisx, GlobalContext* globalCtx) { OceffWipe2* this = THIS; Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE2 arg_data = %d\n" VT_RST, this->actor.params); } @@ -50,7 +50,7 @@ void OceffWipe2_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe2_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe2* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 6d33abc9c2..47fdd66a52 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -18,7 +18,7 @@ void OceffWipe3_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe3_InitVars = { ACTOR_OCEFF_WIPE3, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe3), @@ -34,7 +34,7 @@ void OceffWipe3_Init(Actor* thisx, GlobalContext* globalCtx) { OceffWipe3* this = THIS; Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; // it's actually WIPE3... osSyncPrintf(VT_FGCOL(CYAN) " WIPE2 arg_data = %d\n" VT_RST, this->actor.params); } @@ -51,7 +51,7 @@ void OceffWipe3_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe3_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe3* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 379482ef45..94c337f432 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -18,7 +18,7 @@ void OceffWipe4_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe4_InitVars = { ACTOR_OCEFF_WIPE4, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe4), @@ -35,7 +35,7 @@ void OceffWipe4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE4 arg_data = %d\n" VT_RST, this->actor.params); } @@ -47,8 +47,8 @@ void OceffWipe4_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe4_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe4* this = THIS; - - this->actor.posRot.pos = ACTIVE_CAM->eye; + + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 50) { this->counter++; } else { diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index f2011f3439..338c9aeb77 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -25,7 +25,7 @@ extern CutsceneData D_02007020[]; const ActorInit Shot_Sun_InitVars = { ACTOR_SHOT_SUN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ShotSun), @@ -36,8 +36,22 @@ const ActorInit Shot_Sun_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000020, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000020, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 60, 0, { 0, 0, 0 } }, }; @@ -90,19 +104,19 @@ void ShotSun_SpawnFairy(ShotSun* this, GlobalContext* globalCtx) { } //! @bug fairyType may be uninitialized - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, 0, 0, 0, fairyType); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y, + this->actor.home.pos.z, 0, 0, 0, fairyType); Actor_Kill(&this->actor); } void ShotSun_TriggerFairy(ShotSun* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->actor.type) || (this->timer != 0)) { + if ((func_8005B198() == this->actor.category) || (this->timer != 0)) { this->actionFunc = ShotSun_SpawnFairy; this->timer = 50; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, 0, 0, 0, 0x11); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->actor.home.pos.x, this->actor.home.pos.y, + this->actor.home.pos.z, 0, 0, 0, 0x11); func_80078914(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); } @@ -113,7 +127,7 @@ void func_80BADF0C(ShotSun* this, GlobalContext* globalCtx) { s32 pad; s32 params = this->actor.params & 0xFF; - if (Math3D_Vec3fDistSq(&this->actor.posRot.pos, &player->actor.posRot.pos) > 22500.0f) { + if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > 22500.0f) { this->unk_1A4 = 0; } else { if (this->unk_1A4 == 0) { @@ -151,7 +165,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) { s32 pad; Vec3f spawnPos; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_80078884(NA_SE_SY_CORRECT_CHIME); osSyncPrintf(VT_FGCOL(CYAN) "SHOT_SUN HIT!!!!!!!\n" VT_RST); if (INV_CONTENT(SLOT_ARROW_FIRE) == ITEM_NONE) { @@ -172,14 +186,14 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); } else { - if (!(120.0f < this->actor.xzDistToLink) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) { + if (!(120.0f < this->actor.xzDistToPlayer) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) { cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.unk_04.x * 0.16666667f; cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.unk_04.y * 0.16666667f; cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.unk_04.z * 0.16666667f; this->hitboxPos = cylinderPos; - func_80062718(&this->collider, &cylinderPos); + Collider_SetCylinderPosition(&this->collider, &cylinderPos); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 2d55a4d005..b2cfc50a48 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1294,7 +1294,7 @@ void func_80832440(GlobalContext* globalCtx, Player* this) { this->stateFlags2 &= ~0x40090; this->actor.shape.rot.x = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->unk_845 = this->unk_844 = 0; } @@ -1332,13 +1332,13 @@ void func_80832630(GlobalContext* globalCtx) { } void func_8083264C(Player* this, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_800AA000(arg4, arg1, arg2, arg3); } } void func_80832698(Player* this, u16 sfxId) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_8002F7DC(&this->actor, sfxId + this->ageProperties->unk_92); } else { func_800F4190(&this->actor.projectedPos, sfxId); @@ -1523,15 +1523,15 @@ void func_80832E48(Player* this, s32 flags) { pos.x *= 0.64f; pos.z *= 0.64f; } - this->actor.posRot.pos.x += pos.x * this->actor.scale.x; - this->actor.posRot.pos.z += pos.z * this->actor.scale.z; + this->actor.world.pos.x += pos.x * this->actor.scale.x; + this->actor.world.pos.z += pos.z * this->actor.scale.z; } if (flags & 2) { if (!(flags & 4)) { pos.y *= this->ageProperties->unk_08; } - this->actor.posRot.pos.y += pos.y * this->actor.scale.y; + this->actor.world.pos.y += pos.y * this->actor.scale.y; } func_808322FC(this); @@ -1783,7 +1783,7 @@ void func_808337D4(GlobalContext* globalCtx, Player* this) { explosiveInfo = &sExplosiveInfos[explosiveType]; spawnedActor = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, explosiveInfo->actorId, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0); if (spawnedActor != NULL) { if ((explosiveType != 0) && (globalCtx->bombchuBowlingStatus != 0)) { @@ -1808,8 +1808,8 @@ void func_80833910(GlobalContext* globalCtx, Player* this) { this->unk_860 = -3; this->heldActor = - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_ARMS_HOOK, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_ARMS_HOOK, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0); } void func_80833984(GlobalContext* globalCtx, Player* this) { @@ -2030,7 +2030,7 @@ void func_808340DC(Player* this, GlobalContext* globalCtx) { } void func_80834298(Player* this, GlobalContext* globalCtx) { - if ((this->actor.type == ACTORTYPE_PLAYER) && !(this->stateFlags1 & 0x100) && + if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & 0x100) && ((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & 0x400000)) && (gSaveContext.health != 0) && (globalCtx->csCtx.state == 0) && (this->csMode == 0) && (globalCtx->shootingGalleryStatus == 0) && (globalCtx->activeCamera == 0) && @@ -2092,8 +2092,8 @@ s32 func_8083442C(Player* this, GlobalContext* globalCtx) { } this->heldActor = Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ARROW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, arrowType); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ARROW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, arrowType); } } } @@ -2511,7 +2511,7 @@ void func_808355DC(Player* this) { this->stateFlags1 |= 0x20000; if (!(this->skelAnime.moveFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x2000)) { - this->currentYaw = this->actor.shape.rot.y = this->actor.wallPolyRot + 0x8000; + this->currentYaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; } this->targetYaw = this->actor.shape.rot.y; @@ -2553,7 +2553,7 @@ s32 func_808356E8(Player* this, GlobalContext* globalCtx) { if ((heldActor->id == ACTOR_EN_NIW) && (this->actor.velocity.y <= 0.0f)) { this->actor.minVelocityY = -2.0f; this->actor.gravity = -0.5f; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } return 1; @@ -2617,12 +2617,12 @@ s32 func_808359FC(Player* this, GlobalContext* globalCtx) { func_80833638(this, func_80835B60); this->unk_834 = 0; } else if (LinkAnimation_OnFrame(&this->skelAnime2, 6.0f)) { - f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.posRot.pos.x; - f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.posRot.pos.z; + f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.x; + f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.z; s32 yaw = (this->unk_664 != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; EnBoom* boomerang = - (EnBoom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOOM, posX, this->actor.posRot.pos.y + 30.0f, - posZ, this->actor.posRot2.rot.x, yaw, 0, 0); + (EnBoom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOOM, posX, this->actor.world.pos.y + 30.0f, + posZ, this->actor.focus.rot.x, yaw, 0, 0); this->boomerangActor = &boomerang->actor; if (boomerang != NULL) { @@ -2771,7 +2771,7 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { ((actionParam == PLAYER_AP_BEAN) && (AMMO(ITEM_BEAN) == 0)) || (temp = Player_ActionToExplosive(this, actionParam), ((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) || - (globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].length >= 3)))))) { + (globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) { func_80078884(NA_SE_SY_ERROR); return; } @@ -2871,7 +2871,7 @@ void func_80836448(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* func_80832224(this); func_80832698(this, NA_SE_VO_LI_DOWN); - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_800F47BC(); if (Inventory_ConsumeFairy(globalCtx)) { @@ -2955,9 +2955,9 @@ void func_808368EC(Player* this, GlobalContext* globalCtx) { if (!(this->stateFlags2 & 0x60)) { if ((this->unk_664 != NULL) && - ((globalCtx->actorCtx.targetCtx.unk_4B != 0) || (this->actor.type != ACTORTYPE_PLAYER))) { + ((globalCtx->actorCtx.targetCtx.unk_4B != 0) || (this->actor.category != ACTORCAT_PLAYER))) { Math_ScaledStepToS(&this->actor.shape.rot.y, - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_664->posRot2.pos), 4000); + Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos), 4000); } else if ((this->stateFlags1 & 0x20000) && !(this->stateFlags2 & 0x60)) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 4000); } @@ -2994,17 +2994,16 @@ s32 func_80836AB8(Player* this, s32 arg1) { var = this->actor.shape.rot.y; if (arg1 != 0) { - var = this->actor.posRot2.rot.y; - this->unk_6BC = this->actor.posRot2.rot.x; + var = this->actor.focus.rot.y; + this->unk_6BC = this->actor.focus.rot.x; this->unk_6AE |= 0x41; } else { - func_808369C8( - &this->unk_6BC, - func_808369C8(&this->unk_6B6, this->actor.posRot2.rot.x, 600, 10000, this->actor.posRot2.rot.x, 0), 200, - 4000, this->unk_6B6, 10000); - sp36 = this->actor.posRot2.rot.y - var; + func_808369C8(&this->unk_6BC, + func_808369C8(&this->unk_6B6, this->actor.focus.rot.x, 600, 10000, this->actor.focus.rot.x, 0), + 200, 4000, this->unk_6B6, 10000); + sp36 = this->actor.focus.rot.y - var; func_808369C8(&sp36, 0, 200, 24000, this->unk_6BE, 8000); - var = this->actor.posRot2.rot.y - sp36; + var = this->actor.focus.rot.y - sp36; func_808369C8(&this->unk_6B8, sp36 - this->unk_6BE, 200, 8000, sp36, 8000); func_808369C8(&this->unk_6BE, sp36, 200, 8000, this->unk_6B8, 8000); this->unk_6AE |= 0xD9; @@ -3051,17 +3050,17 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { ((this->heldItemActionParam != PLAYER_AP_FISHING_POLE) || (this->unk_860 == 0)) && CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { actorToTarget = globalCtx->actorCtx.targetCtx.arrowPointedActor; } else { actorToTarget = &PLAYER->actor; } - holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.type != ACTORTYPE_PLAYER); + holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER); this->stateFlags1 |= 0x8000; if ((actorToTarget != NULL) && !(actorToTarget->flags & 0x8000000)) { - if ((actorToTarget == this->unk_664) && (this->actor.type == ACTORTYPE_PLAYER)) { + if ((actorToTarget == this->unk_664) && (this->actor.category == ACTORCAT_PLAYER)) { actorToTarget = globalCtx->actorCtx.targetCtx.unk_94; } @@ -3087,12 +3086,12 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { } if (this->unk_664 != NULL) { - if ((this->actor.type == ACTORTYPE_PLAYER) && (this->unk_664 != this->unk_684) && + if ((this->actor.category == ACTORCAT_PLAYER) && (this->unk_664 != this->unk_684) && func_8002F0C8(this->unk_664, this, sp1C)) { func_8008EDF0(this); this->stateFlags1 |= 0x40000000; } else if (this->unk_664 != NULL) { - this->unk_664->unk_10D = 40; + this->unk_664->targetPriority = 40; } } else if (this->unk_684 != NULL) { this->unk_664 = this->unk_684; @@ -3173,7 +3172,7 @@ s32 func_80837268(Player* this, f32* arg1, s16* arg2, f32 arg3, GlobalContext* g if (this->unk_664 != NULL) { if ((globalCtx->actorCtx.targetCtx.unk_4B != 0) && !(this->stateFlags2 & 0x40)) { - *arg2 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_664->posRot2.pos); + *arg2 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos); return 0; } } else if (func_80833B2C(this)) { @@ -3263,7 +3262,7 @@ void func_80837530(GlobalContext* globalCtx, Player* this, s32 arg2) { this->stateFlags1 |= 0x1000; - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_THUNDER, this->bodyPartsPos[0].x, this->bodyPartsPos[0].y, this->bodyPartsPos[0].z, 0, 0, 0, Player_GetSwordHeld(this) | arg2); } @@ -3371,12 +3370,12 @@ s32 func_80837818(Player* this) { } void func_80837918(Player* this, s32 quadIndex, u32 flags) { - this->swordQuads[quadIndex].body.toucher.flags = flags; + this->swordQuads[quadIndex].info.toucher.dmgFlags = flags; if (flags == 2) { - this->swordQuads[quadIndex].body.toucherFlags = 0x15; + this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD; } else { - this->swordQuads[quadIndex].body.toucherFlags = 5; + this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST; } } @@ -3445,7 +3444,7 @@ void func_80837AFC(Player* this, s32 timer) { } s32 func_80837B18(GlobalContext* globalCtx, Player* this, s32 damage) { - if ((this->invincibilityTimer != 0) || (this->actor.type != ACTORTYPE_PLAYER)) { + if ((this->invincibilityTimer != 0) || (this->actor.category != ACTORCAT_PLAYER)) { return 1; } @@ -3551,7 +3550,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f sp2C = &D_04002DB0; } - if ((this->actor.type != ACTORTYPE_PLAYER) && (this->actor.colChkInfo.health == 0)) { + if ((this->actor.category != ACTORCAT_PLAYER) && (this->actor.colChkInfo.health == 0)) { func_80832698(this, NA_SE_VO_BL_DOWN); } else { func_80832698(this, NA_SE_VO_LI_FALL_L); @@ -3596,7 +3595,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f this->actor.shape.rot.y += arg5; this->currentYaw = this->actor.shape.rot.y; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (ABS(arg5) > 0x4000) { this->actor.shape.rot.y += 0x8000; } @@ -3627,8 +3626,8 @@ s32 func_8083816C(s32 arg0) { void func_8083819C(Player* this, GlobalContext* globalCtx) { if (this->currentShield == PLAYER_SHIELD_DEKU) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_SHIELD, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_SHIELD, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1); Inventory_DeleteEquipment(globalCtx, EQUIP_SHIELD); func_8010B680(globalCtx, 0x305F, NULL); // "Your shield is gone!" } @@ -3714,14 +3713,14 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { this->actor.colChkInfo.damage += this->unk_8A0; func_80837C0C(globalCtx, this, sp5C[this->unk_8A1 - 1], this->unk_8A4, this->unk_8A8, this->unk_8A2, 20); } else { - sp64 = (this->shieldQuad.base.acFlags & 0x80) != 0; + sp64 = (this->shieldQuad.base.acFlags & AC_BOUNCED) != 0; // @bug The second set of conditions here seems intended as a way for Link to "block" hits by rolling. - // However, `ColliderBody.atFlags` is a byte so the flag check at the end is incorrect and cannot work. - // Additionally, `ColliderBody.atHit` can never be set while already colliding as AC, so it's also bugged. + // However, `Collider.atFlags` is a byte so the flag check at the end is incorrect and cannot work. + // Additionally, `Collider.atHit` can never be set while already colliding as AC, so it's also bugged. // This behavior was later fixed in MM, most likely by removing both the `atHit` and `atFlags` checks. - if (sp64 || ((this->invincibilityTimer < 0) && (this->cylinder.base.acFlags & 2) && - (this->cylinder.body.atHit != NULL) && (this->cylinder.body.atHit->atFlags & 0x20000000))) { + if (sp64 || ((this->invincibilityTimer < 0) && (this->cylinder.base.acFlags & AC_HIT) && + (this->cylinder.info.atHit != NULL) && (this->cylinder.info.atHit->atFlags & 0x20000000))) { func_8083264C(this, 180, 20, 100, 0); @@ -3754,7 +3753,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } } - if (sp64 && (this->shieldQuad.body.acHitItem->toucher.effect == 1)) { + if (sp64 && (this->shieldQuad.info.acHitInfo->toucher.effect == 1)) { func_8083819C(this, globalCtx); } @@ -3762,12 +3761,12 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & 0x4000000) || - (this->csMode != 0) || (this->swordQuads[0].base.atFlags & 2) || - (this->swordQuads[1].base.atFlags & 2)) { + (this->csMode != 0) || (this->swordQuads[0].base.atFlags & AT_HIT) || + (this->swordQuads[1].base.atFlags & AT_HIT)) { return 0; } - if (this->cylinder.base.acFlags & 2) { + if (this->cylinder.base.acFlags & AC_HIT) { Actor* ac = this->cylinder.base.ac; s32 sp4C; @@ -3788,7 +3787,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { sp4C = 0; } - func_80837C0C(globalCtx, this, sp4C, 4.0f, 5.0f, func_8002DA78(ac, &this->actor), 20); + func_80837C0C(globalCtx, this, sp4C, 4.0f, 5.0f, Actor_WorldYawTowardActor(ac, &this->actor), 20); } else if (this->invincibilityTimer != 0) { return 0; } else { @@ -3796,9 +3795,9 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { s32 sp48 = func_80838144(D_808535E4); if (((this->actor.wallPoly != NULL) && - SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource)) || + SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) || ((sp48 >= 0) && - SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) && + SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) && (this->unk_A79 >= D_808544F4[sp48])) || ((sp48 >= 0) && ((this->currentTunic != PLAYER_TUNIC_GORON) || (this->unk_A79 >= D_808544F4[sp48])))) { @@ -3862,7 +3861,7 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { return 0; } - if ((this->actor.wallPolySource != BGCHECK_SCENE) && (D_808535F0 & 0x40)) { + if ((this->actor.wallBgId != BGCHECK_SCENE) && (D_808535F0 & 0x40)) { if (this->unk_88D >= 6) { this->stateFlags2 |= 4; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { @@ -3902,11 +3901,11 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { sp34 -= (41.0f * this->ageProperties->unk_08); } - this->actor.shape.unk_08 -= sp34 * 100.0f; + this->actor.shape.yOffset -= sp34 * 100.0f; - this->actor.posRot.pos.x -= sp24 * sp2C; - this->actor.posRot.pos.y += this->wallHeight; - this->actor.posRot.pos.z -= sp24 * sp28; + this->actor.world.pos.x -= sp24 * sp2C; + this->actor.world.pos.y += this->wallHeight; + this->actor.world.pos.z -= sp24 * sp28; func_80832224(this); } @@ -3916,7 +3915,7 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { LinkAnimation_PlayOnceSetSpeed(globalCtx, &this->skelAnime, sp38, 1.3f); AnimationContext_DisableQueue(globalCtx); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; return 1; } @@ -3938,8 +3937,8 @@ void func_80838E70(GlobalContext* globalCtx, Player* this, f32 arg2, s16 arg3) { this->unk_84F = 1; this->unk_850 = 1; - this->unk_450.x = (Math_SinS(arg3) * arg2) + this->actor.posRot.pos.x; - this->unk_450.z = (Math_CosS(arg3) * arg2) + this->actor.posRot.pos.z; + this->unk_450.x = (Math_SinS(arg3) * arg2) + this->actor.world.pos.x; + this->unk_450.z = (Math_CosS(arg3) * arg2) + this->actor.world.pos.z; func_80832264(globalCtx, this, func_80833338(this)); } @@ -3984,7 +3983,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s if (1) {} - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { sp3C = 0; if (!(this->stateFlags1 & 0x80) && (globalCtx->sceneLoadFlag == 0) && (this->csMode == 0) && @@ -3992,7 +3991,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s (((poly != NULL) && (sp3C = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, poly, bgId), sp3C != 0)) || (func_8083816C(D_808535E4) && (this->unk_A7A == 12)))) { - sp34 = this->unk_A84 - (s32)this->actor.posRot.pos.y; + sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & 0x28800000) && !(this->actor.bgCheckFlags & 1) && (sp34 < 100) && (D_80853600 > 100.0f)) { @@ -4038,7 +4037,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s linearVel = this->linearVelocity; if (linearVel < 0.0f) { - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.y += 0x8000; linearVel = -linearVel; } @@ -4051,7 +4050,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s if (D_808535F4 != 0) { yaw = D_808535FC; } else { - yaw = this->actor.posRot.rot.y; + yaw = this->actor.world.rot.y; } func_80838E70(globalCtx, this, 400.0f, yaw); } @@ -4069,7 +4068,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s } else { if (globalCtx->sceneLoadFlag == 0) { - if ((this->actor.posRot.pos.y < -4000.0f) || + if ((this->actor.world.pos.y < -4000.0f) || (((this->unk_A7A == 5) || (this->unk_A7A == 12)) && ((D_80853600 < 100.0f) || (this->fallDistance > 400.0f) || ((globalCtx->sceneNum != SCENE_HAKADAN) && (this->fallDistance > 200.0f)))) || @@ -4094,7 +4093,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s } } - this->unk_A84 = this->actor.posRot.pos.y; + this->unk_A84 = this->actor.world.pos.y; } } } @@ -4120,7 +4119,7 @@ Actor* Player_SpawnFairy(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Ve } f32 func_808396F4(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Vec3f* arg3, CollisionPoly** arg4, s32* arg5) { - func_808395DC(this, &this->actor.posRot.pos, arg2, arg3); + func_808395DC(this, &this->actor.world.pos, arg2, arg3); return BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, arg4, arg5, arg3); } @@ -4136,11 +4135,11 @@ s32 func_80839768(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Collision Vec3f sp44; Vec3f sp38; - sp44.x = this->actor.posRot.pos.x; - sp44.y = this->actor.posRot.pos.y + arg2->y; - sp44.z = this->actor.posRot.pos.z; + sp44.x = this->actor.world.pos.x; + sp44.y = this->actor.world.pos.y + arg2->y; + sp44.z = this->actor.world.pos.z; - func_808395DC(this, &this->actor.posRot.pos, arg2, &sp38); + func_808395DC(this, &this->actor.world.pos, arg2, &sp38); return BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp44, &sp38, arg5, arg3, 1, 0, 0, 1, arg4); } @@ -4178,7 +4177,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { if (this->doorType == 2) { doorShutter = (DoorShutter*)doorActor; - this->currentYaw = doorShutter->dyna.actor.initPosRot.rot.y; + this->currentYaw = doorShutter->dyna.actor.home.rot.y; if (sp7C > 0) { this->currentYaw -= 0x8000; } @@ -4194,10 +4193,10 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->unk_447 = this->doorType; this->stateFlags1 |= 0x20000000; - this->unk_450.x = this->actor.posRot.pos.x + ((sp7C * 20.0f) * sp74); - this->unk_450.z = this->actor.posRot.pos.z + ((sp7C * 20.0f) * sp78); - this->unk_45C.x = this->actor.posRot.pos.x + ((sp7C * -120.0f) * sp74); - this->unk_45C.z = this->actor.posRot.pos.z + ((sp7C * -120.0f) * sp78); + this->unk_450.x = this->actor.world.pos.x + ((sp7C * 20.0f) * sp74); + this->unk_450.z = this->actor.world.pos.z + ((sp7C * 20.0f) * sp78); + this->unk_45C.x = this->actor.world.pos.x + ((sp7C * -120.0f) * sp74); + this->unk_45C.z = this->actor.world.pos.z + ((sp7C * -120.0f) * sp78); doorShutter->unk_164 = 1; func_80832224(this); @@ -4210,7 +4209,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->linearVelocity = 0.1f; } - if (doorShutter->dyna.actor.type == ACTORTYPE_DOOR) { + if (doorShutter->dyna.actor.category == ACTORCAT_DOOR) { this->unk_46A = globalCtx->transitionActorList[(u16)doorShutter->dyna.actor.params >> 10] .sides[(sp7C > 0) ? 0 : 1] .effects; @@ -4244,8 +4243,8 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->currentYaw = this->actor.shape.rot.y; sp6C = (sp7C * 22.0f); - this->actor.posRot.pos.x = doorActor->posRot.pos.x + sp6C * sp74; - this->actor.posRot.pos.z = doorActor->posRot.pos.z + sp6C * sp78; + this->actor.world.pos.x = doorActor->world.pos.x + sp6C * sp74; + this->actor.world.pos.z = doorActor->world.pos.z + sp6C * sp78; func_8083328C(globalCtx, this, sp5C); @@ -4267,9 +4266,9 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { func_800304B0(globalCtx); if (((doorActor->params >> 7) & 7) == 3) { - sp4C.x = doorActor->posRot.pos.x - (sp6C * sp74); - sp4C.y = doorActor->posRot.pos.y + 10.0f; - sp4C.z = doorActor->posRot.pos.z - (sp6C * sp78); + sp4C.x = doorActor->world.pos.x - (sp6C * sp74); + sp4C.y = doorActor->world.pos.y + 10.0f; + sp4C.z = doorActor->world.pos.z - (sp6C * sp78); BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp58, &sp4C); @@ -4287,7 +4286,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { } } - if ((this->doorType != 3) && (doorActor->type == ACTORTYPE_DOOR)) { + if ((this->doorType != 3) && (doorActor->category == ACTORCAT_DOOR)) { frontRoom = globalCtx->transitionActorList[(u16)doorActor->params >> 10].sides[(sp7C > 0) ? 0 : 1].room; if ((frontRoom >= 0) && (frontRoom != globalCtx->roomCtx.curRoom.num)) { @@ -4394,11 +4393,11 @@ void func_8083A0F4(GlobalContext* globalCtx, Player* this) { } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && (Player_GetStrength() <= PLAYER_STR_NONE)) { func_80835C58(globalCtx, this, func_80846408, 0); - this->actor.posRot.pos.x = - (Math_SinS(interactRangeActor->yawTowardsLink) * 20.0f) + interactRangeActor->posRot.pos.x; - this->actor.posRot.pos.z = - (Math_CosS(interactRangeActor->yawTowardsLink) * 20.0f) + interactRangeActor->posRot.pos.z; - this->currentYaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsLink + 0x8000; + this->actor.world.pos.x = + (Math_SinS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.x; + this->actor.world.pos.z = + (Math_CosS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.z; + this->currentYaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsPlayer + 0x8000; anim = &D_04003060; } else { func_80835C58(globalCtx, this, func_80846050, 0); @@ -4494,8 +4493,8 @@ void func_8083A5C4(GlobalContext* globalCtx, Player* this, CollisionPoly* arg2, func_80832564(globalCtx, this); func_80832264(globalCtx, this, arg4); - this->actor.posRot.pos.x -= (arg3 + 1.0f) * sp24; - this->actor.posRot.pos.z -= (arg3 + 1.0f) * sp20; + this->actor.world.pos.x -= (arg3 + 1.0f) * sp24; + this->actor.world.pos.z -= (arg3 + 1.0f) * sp20; this->actor.shape.rot.y = this->currentYaw = Math_Atan2S(sp20, sp24); func_80832224(this); @@ -4510,8 +4509,8 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { f32 temp1; if ((this->actor.yDistToWater < -80.0f) && (ABS(this->unk_898) < 2730) && (ABS(this->unk_89A) < 2730)) { - sp74.x = this->actor.pos4.x - this->actor.posRot.pos.x; - sp74.z = this->actor.pos4.z - this->actor.posRot.pos.z; + sp74.x = this->actor.prevPos.x - this->actor.world.pos.x; + sp74.z = this->actor.prevPos.z - this->actor.world.pos.z; temp1 = sqrtf(SQ(sp74.x) + SQ(sp74.z)); if (temp1 != 0.0f) { @@ -4520,11 +4519,11 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { temp1 = 0.0f; } - sp74.x = this->actor.pos4.x + (sp74.x * temp1); - sp74.y = this->actor.posRot.pos.y; - sp74.z = this->actor.pos4.z + (sp74.z * temp1); + sp74.x = this->actor.prevPos.x + (sp74.x * temp1); + sp74.y = this->actor.world.pos.y; + sp74.z = this->actor.prevPos.z + (sp74.z * temp1); - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &sp74, &sp68, &sp84, 1, 0, 0, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp74, &sp68, &sp84, 1, 0, 0, 1, &sp80) && (ABS(sp84->normal.y) < 600)) { f32 nx = COLPOLY_GET_NORMAL(sp84->normal.x); @@ -4533,7 +4532,7 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { f32 sp54; s32 sp50; - sp54 = Math3D_UDistPlaneToPos(nx, ny, nz, sp84->dist, &this->actor.posRot.pos); + sp54 = Math3D_UDistPlaneToPos(nx, ny, nz, sp84->dist, &this->actor.world.pos); sp50 = D_80853604 == 6; if (!sp50 && (func_80041DB8(&globalCtx->colCtx, sp84, sp80) & 8)) { @@ -4583,13 +4582,13 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { f32 sp40; f32 sp3C; - this->fallDistance = this->fallStartHeight - (s32)this->actor.posRot.pos.y; + this->fallDistance = this->fallStartHeight - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & 0x28000000) && !(this->actor.bgCheckFlags & 1)) { if (!func_80838FB8(globalCtx, this)) { if (D_80853604 == 8) { - this->actor.posRot.pos.x = this->actor.pos4.x; - this->actor.posRot.pos.z = this->actor.pos4.z; + this->actor.world.pos.x = this->actor.prevPos.x; + this->actor.world.pos.z = this->actor.prevPos.z; return; } @@ -4597,7 +4596,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { (func_80844A44 != this->func_674)) { if ((D_80853604 == 7) || (this->swordState != 0)) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); func_80832210(this); return; } @@ -4622,7 +4621,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { if ((D_80853604 == 11) && !(this->stateFlags1 & 0x800)) { sp40 = func_808396F4(globalCtx, this, &D_8085451C, &sp44, &sp58, &sp54); - sp3C = this->actor.posRot.pos.y; + sp3C = this->actor.world.pos.y; if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, sp44.x, sp44.z, &sp3C, &sp50) && ((sp3C - sp40) > 50.0f)) { @@ -4644,7 +4643,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { } } } else { - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } } @@ -4720,10 +4719,10 @@ void func_8083AF44(GlobalContext* globalCtx, Player* this, s32 magicSpell) { } void func_8083B010(Player* this) { - this->actor.posRot2.rot.x = this->actor.posRot2.rot.z = this->unk_6B6 = this->unk_6B8 = this->unk_6BA = - this->unk_6BC = this->unk_6BE = this->unk_6C0 = 0; + this->actor.focus.rot.x = this->actor.focus.rot.z = this->unk_6B6 = this->unk_6B8 = this->unk_6BA = this->unk_6BC = + this->unk_6BE = this->unk_6C0 = 0; - this->actor.posRot2.rot.y = this->actor.shape.rot.y; + this->actor.focus.rot.y = this->actor.shape.rot.y; } u8 D_80854528[] = { @@ -5008,7 +5007,7 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc s32 func_8083BB20(Player* this) { if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0)) { if (D_80853614 || - ((this->actor.type != ACTORTYPE_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { + ((this->actor.category != ACTORCAT_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { return 1; } } @@ -5060,12 +5059,12 @@ s32 func_8083BDBC(Player* this, GlobalContext* globalCtx) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (globalCtx->roomCtx.curRoom.unk_03 != 2) && (D_808535E4 != 7) && - (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) != 1)) { + (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) != 1)) { sp2C = this->unk_84B[this->unk_846]; if (sp2C <= 0) { if (func_80833BCC(this)) { - if (this->actor.type != ACTORTYPE_PLAYER) { + if (this->actor.category != ACTORCAT_PLAYER) { if (sp2C < 0) { func_808389E8(this, &D_04002FE0, REG(69) / 100.0f, globalCtx); } else { @@ -5281,10 +5280,10 @@ s32 func_8083C6B8(GlobalContext* globalCtx, Player* this) { } if (this->heldItemActionParam == PLAYER_AP_FISHING_POLE) { - sp24 = this->actor.posRot.pos; + sp24 = this->actor.world.pos; sp24.y += 50.0f; - if (!(this->actor.bgCheckFlags & 1) || (this->actor.posRot.pos.z > 1300.0f) || + if (!(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &sp24, 20.0f)) { func_80078884(NA_SE_SY_ERROR); return 0; @@ -5328,10 +5327,10 @@ s32 func_8083C910(GlobalContext* globalCtx, Player* this, f32 arg2) { WaterBox* sp2C; f32 sp28; - sp28 = this->actor.posRot.pos.y; - if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, &sp28, + sp28 = this->actor.world.pos.y; + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp28, &sp2C) != 0) { - sp28 -= this->actor.posRot.pos.y; + sp28 -= this->actor.world.pos.y; if (this->ageProperties->unk_24 <= sp28) { func_80835C58(globalCtx, this, func_8084D7C4, 0); func_80832C6C(globalCtx, this, &D_040032F0); @@ -5464,9 +5463,9 @@ s32 func_8083CFA8(GlobalContext* globalCtx, Player* this, f32 arg2, s32 splashSc if (sp3C > 2.0f) { splashPos.x = this->bodyPartsPos[0].x; splashPos.z = this->bodyPartsPos[0].z; - sp34 = this->actor.posRot.pos.y; + sp34 = this->actor.world.pos.y; if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, splashPos.x, splashPos.z, &sp34, &sp38)) { - if ((sp34 - this->actor.posRot.pos.y) < 100.0f) { + if ((sp34 - this->actor.world.pos.y) < 100.0f) { splashType = (sp3C <= 10.0f) ? 0 : 1; splashPos.y = sp34; EffectSsGSplash_Spawn(globalCtx, &splashPos, NULL, NULL, splashType, splashScale); @@ -5676,13 +5675,13 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) { if (this->unk_854 > 15.0f) { this->unk_854 = 0.0f; - ripplePos.x = (Rand_ZeroOne() * 10.0f) + this->actor.posRot.pos.x; - ripplePos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.posRot.pos.z; + ripplePos.x = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.x; + ripplePos.y = this->actor.world.pos.y + this->actor.yDistToWater; + ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.z; EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 0); if ((this->linearVelocity > 4.0f) && !func_808332B8(this) && - ((this->actor.posRot.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[0].y)) { + ((this->actor.world.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[0].y)) { func_8083CFA8(globalCtx, this, 20.0f, (fabsf(this->linearVelocity) * 50.0f) + (this->actor.yDistToWater * 5.0f)); } @@ -5702,7 +5701,7 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) { } for (i = 0; i < numBubbles; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 20.0f, 10.0f, 20.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 20.0f, 10.0f, 20.0f, 0.13f); } } } @@ -5714,13 +5713,13 @@ s32 func_8083DB98(Player* this, s32 arg1) { s16 sp2E; s16 sp2C; - sp30.x = this->actor.posRot.pos.x; + sp30.x = this->actor.world.pos.x; sp30.y = this->bodyPartsPos[7].y + 3.0f; - sp30.z = this->actor.posRot.pos.z; - sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->posRot2.pos); - sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->posRot2.pos); - Math_SmoothStepToS(&this->actor.posRot2.rot.y, sp2C, 4, 10000, 0); - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sp2E, 4, 10000, 0); + sp30.z = this->actor.world.pos.z; + sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->focus.pos); + sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->focus.pos); + Math_SmoothStepToS(&this->actor.focus.rot.y, sp2C, 4, 10000, 0); + Math_SmoothStepToS(&this->actor.focus.rot.x, sp2E, 4, 10000, 0); this->unk_6AE |= 2; return func_80836AB8(this, arg1); @@ -5744,16 +5743,16 @@ void func_8083DC54(Player* this, GlobalContext* globalCtx) { } if (D_808535E4 == 11) { - Math_SmoothStepToS(&this->actor.posRot2.rot.x, -20000, 10, 4000, 800); + Math_SmoothStepToS(&this->actor.focus.rot.x, -20000, 10, 4000, 800); } else { sp46 = 0; temp1 = func_8083973C(globalCtx, this, &D_8085456C, &sp34); if (temp1 > BGCHECK_Y_MIN) { - temp2 = Math_Atan2S(40.0f, this->actor.posRot.pos.y - temp1); + temp2 = Math_Atan2S(40.0f, this->actor.world.pos.y - temp1); sp46 = CLAMP(temp2, -4000, 4000); } - this->actor.posRot2.rot.y = this->actor.shape.rot.y; - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sp46, 14, 4000, 30); + this->actor.focus.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.focus.rot.x, sp46, 14, 4000, 30); } func_80836AB8(this, func_8002DD78(this) || func_808334B4(this)); @@ -5830,12 +5829,12 @@ s32 func_8083E0FC(Player* this, GlobalContext* globalCtx) { unk_04 = D_80854578[temp].unk_04; unk_08 = D_80854578[temp].unk_08; - this->actor.posRot.pos.x = - rideActor->actor.posRot.pos.x + rideActor->unk_258.x + ((unk_04 * sp38) + (unk_08 * sp34)); - this->actor.posRot.pos.z = - rideActor->actor.posRot.pos.z + rideActor->unk_258.z + ((unk_08 * sp38) - (unk_04 * sp34)); + this->actor.world.pos.x = + rideActor->actor.world.pos.x + rideActor->unk_258.x + ((unk_04 * sp38) + (unk_08 * sp34)); + this->actor.world.pos.z = + rideActor->actor.world.pos.z + rideActor->unk_258.z + ((unk_08 * sp38) - (unk_04 * sp34)); - this->unk_878 = rideActor->actor.posRot.pos.y - this->actor.posRot.pos.y; + this->unk_878 = rideActor->actor.world.pos.y - this->actor.world.pos.y; this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; func_8002DECC(globalCtx, this, &rideActor->actor); @@ -5873,7 +5872,7 @@ s32 func_8083E318(GlobalContext* globalCtx, Player* this, CollisionPoly* arg2) { s16 temp3; if (!Player_InBlockingCsMode(globalCtx, this) && (func_8084F390 != this->func_674) && - (SurfaceType_GetSlope(&globalCtx->colCtx, arg2, this->actor.floorPolySource) == 1)) { + (SurfaceType_GetSlope(&globalCtx->colCtx, arg2, this->actor.floorBgId) == 1)) { sp4A = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); func_8083E298(arg2, &sp3C, &sp3A); temp3 = sp3A - sp4A; @@ -5911,7 +5910,7 @@ void func_8083E4C4(GlobalContext* globalCtx, Player* this, GetItemEntry* giEntry s32 sp1C = giEntry->field & 0x1F; if (!(giEntry->field & 0x80)) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, sp1C | 0x8000); + Item_DropCollectible(globalCtx, &this->actor.world.pos, sp1C | 0x8000); if ((sp1C != 4) && (sp1C != 8) && (sp1C != 9) && (sp1C != 0xA) && (sp1C != 0) && (sp1C != 1) && (sp1C != 2) && (sp1C != 0x14) && (sp1C != 0x13)) { Item_Give(globalCtx, giEntry->itemId); @@ -5977,10 +5976,10 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_80836898(globalCtx, this, func_8083A434); this->stateFlags1 |= 0x20000C00; func_8083AE40(this, giEntry->objectId); - this->actor.posRot.pos.x = - chest->dyna.actor.posRot.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.434299469f); - this->actor.posRot.pos.z = - chest->dyna.actor.posRot.pos.z - (Math_CosS(chest->dyna.actor.shape.rot.y) * 29.434299469f); + this->actor.world.pos.x = + chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.434299469f); + this->actor.world.pos.z = + chest->dyna.actor.world.pos.z - (Math_CosS(chest->dyna.actor.shape.rot.y) * 29.434299469f); this->currentYaw = this->actor.shape.rot.y = chest->dyna.actor.shape.rot.y; func_80832224(this); @@ -6071,7 +6070,7 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { s32 sp8C = (arg2 & 8) ? 2 : 0; if ((sp8C != 0) || (arg2 & 2) || - func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource)) { + func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { f32 phi_f20; CollisionPoly* sp84 = this->actor.wallPoly; f32 sp80; @@ -6082,8 +6081,8 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { phi_f20 = phi_f12 = 0.0f; if (sp8C != 0) { - sp80 = this->actor.posRot.pos.x; - sp7C = this->actor.posRot.pos.z; + sp80 = this->actor.world.pos.x; + sp7C = this->actor.world.pos.z; } else { Vec3f sp50[3]; s32 i; @@ -6091,7 +6090,7 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { Vec3f* sp44 = &sp50[0]; s32 pad; - CollisionPoly_GetVerticesByBgId(sp84, this->actor.wallPolySource, &globalCtx->colCtx, sp50); + CollisionPoly_GetVerticesByBgId(sp84, this->actor.wallBgId, &globalCtx->colCtx, sp50); sp80 = phi_f12 = sp44->x; sp7C = phi_f14 = sp44->z; @@ -6118,9 +6117,9 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { sp80 = (sp80 + phi_f12) * 0.5f; sp7C = (sp7C + phi_f14) * 0.5f; - phi_f12 = ((this->actor.posRot.pos.x - sp80) * COLPOLY_GET_NORMAL(sp84->normal.z)) - - ((this->actor.posRot.pos.z - sp7C) * COLPOLY_GET_NORMAL(sp84->normal.x)); - sp48 = this->actor.posRot.pos.y - phi_f20; + phi_f12 = ((this->actor.world.pos.x - sp80) * COLPOLY_GET_NORMAL(sp84->normal.z)) - + ((this->actor.world.pos.z - sp7C) * COLPOLY_GET_NORMAL(sp84->normal.x)); + sp48 = this->actor.world.pos.y - phi_f20; phi_f20 = ((f32)(s32)((sp48 / 15.000000223517418) + 0.5) * 15.000000223517418) - sp48; phi_f12 = fabsf(phi_f12); @@ -6149,18 +6148,18 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { sp34 = sp34 - 1.0f; } this->unk_850 = -2; - this->actor.posRot.pos.y += phi_f20; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.world.pos.y += phi_f20; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; } else { sp30 = this->ageProperties->unk_A8; this->unk_850 = -4; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw; } - this->actor.posRot.pos.x = (sp34 * sp3C) + sp80; - this->actor.posRot.pos.z = (sp34 * sp38) + sp7C; + this->actor.world.pos.x = (sp34 * sp3C) + sp80; + this->actor.world.pos.z = (sp34 * sp38) + sp7C; func_80832224(this); - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); func_80832264(globalCtx, this, sp30); func_80832F54(globalCtx, this, 0x9F); @@ -6189,7 +6188,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { if (LINK_IS_CHILD && !(this->stateFlags1 & 0x8000000) && (arg2 & 0x30)) { wallPoly = this->actor.wallPoly; - CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallPolySource, &globalCtx->colCtx, &sp50); + CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallBgId, &globalCtx->colCtx, &sp50); sp4C = phi_f2 = sp50[0].x; sp44 = phi_f12 = sp50[0].z; @@ -6210,8 +6209,8 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { sp4C = (sp4C + phi_f2) * 0.5f; sp44 = (sp44 + phi_f12) * 0.5f; - phi_f2 = ((this->actor.posRot.pos.x - sp4C) * COLPOLY_GET_NORMAL(wallPoly->normal.z)) - - ((this->actor.posRot.pos.z - sp44) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); + phi_f2 = ((this->actor.world.pos.x - sp4C) * COLPOLY_GET_NORMAL(wallPoly->normal.z)) - + ((this->actor.world.pos.z - sp44) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); if (fabsf(phi_f2) < 8.0f) { this->stateFlags2 |= 0x10000; @@ -6223,11 +6222,11 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { func_80836898(globalCtx, this, func_8083A40C); this->stateFlags2 |= 0x40000; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; - this->actor.posRot.pos.x = sp4C + (sp30 * sp38); - this->actor.posRot.pos.z = sp44 + (sp30 * sp34); + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.world.pos.x = sp4C + (sp30 * sp38); + this->actor.world.pos.z = sp44 + (sp30 * sp34); func_80832224(this); - this->actor.pos4 = this->actor.posRot.pos; + this->actor.prevPos = this->actor.world.pos; func_80832264(globalCtx, this, &D_04002708); func_80832F54(globalCtx, this, 0x9D); @@ -6254,17 +6253,17 @@ s32 func_8083F360(GlobalContext* globalCtx, Player* this, f32 arg1, f32 arg2, f3 yawCos = Math_CosS(this->actor.shape.rot.y); yawSin = Math_SinS(this->actor.shape.rot.y); - sp6C.x = this->actor.posRot.pos.x + (arg4 * yawSin); - sp6C.z = this->actor.posRot.pos.z + (arg4 * yawCos); - sp60.x = this->actor.posRot.pos.x + (arg3 * yawSin); - sp60.z = this->actor.posRot.pos.z + (arg3 * yawCos); - sp60.y = sp6C.y = this->actor.posRot.pos.y + arg1; + sp6C.x = this->actor.world.pos.x + (arg4 * yawSin); + sp6C.z = this->actor.world.pos.z + (arg4 * yawCos); + sp60.x = this->actor.world.pos.x + (arg3 * yawSin); + sp60.z = this->actor.world.pos.z + (arg3 * yawCos); + sp60.y = sp6C.y = this->actor.world.pos.y + arg1; if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp6C, &sp60, &sp54, &this->actor.wallPoly, 1, 0, 0, 1, &sp78)) { wallPoly = this->actor.wallPoly; this->actor.bgCheckFlags |= 0x200; - this->actor.wallPolySource = sp78; + this->actor.wallBgId = sp78; D_808535F0 = func_80041DB8(&globalCtx->colCtx, wallPoly, sp78); @@ -6274,8 +6273,8 @@ s32 func_8083F360(GlobalContext* globalCtx, Player* this, f32 arg1, f32 arg2, f3 Math_ScaledStepToS(&this->actor.shape.rot.y, temp, 800); this->currentYaw = this->actor.shape.rot.y; - this->actor.posRot.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); - this->actor.posRot.pos.z = sp54.z - (Math_CosS(this->actor.shape.rot.y) * arg2); + this->actor.world.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); + this->actor.world.pos.z = sp54.z - (Math_CosS(this->actor.shape.rot.y) * arg2); return 1; } @@ -6294,7 +6293,7 @@ s32 func_8083F570(Player* this, GlobalContext* globalCtx) { if ((this->linearVelocity != 0.0f) && (this->actor.bgCheckFlags & 8) && (D_808535F0 & 0x30)) { - temp = this->actor.shape.rot.y - this->actor.wallPolyRot; + temp = this->actor.shape.rot.y - this->actor.wallYaw; if (this->linearVelocity < 0.0f) { temp += 0x8000; } @@ -6303,12 +6302,12 @@ s32 func_8083F570(Player* this, GlobalContext* globalCtx) { func_80835C58(globalCtx, this, func_8084C81C, 0); if (this->linearVelocity > 0.0f) { - this->actor.shape.rot.y = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; func_80832264(globalCtx, this, &D_04002700); func_80832F54(globalCtx, this, 0x9D); func_800800F8(globalCtx, 0x2581, 999, NULL, 0); } else { - this->actor.shape.rot.y = this->actor.wallPolyRot; + this->actor.shape.rot.y = this->actor.wallYaw; LinkAnimation_Change(globalCtx, &this->skelAnime, &D_04002708, -1.0f, Animation_GetLastFrame(&D_04002708), 0.0f, ANIMMODE_ONCE, 0.0f); func_80832F54(globalCtx, this, 0x9D); @@ -6333,7 +6332,7 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, GlobalContext* globa func_80832264(globalCtx, this, anim); func_80832224(this); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; } s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { @@ -6353,8 +6352,8 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { - if ((this->actor.wallPolySource != BGCHECK_SCENE) && - ((wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource)) != NULL)) { + if ((this->actor.wallBgId != BGCHECK_SCENE) && + ((wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId)) != NULL)) { if (wallPolyActor->actor.id == ACTOR_BG_HEAVY_BLOCK) { if (Player_GetStrength() < PLAYER_STR_GOLD_G) { @@ -6365,7 +6364,7 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { this->stateFlags1 |= 0x800; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; - this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->currentYaw = this->actor.wallYaw + 0x8000; func_80832224(this); return 1; @@ -6391,8 +6390,8 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { ((this->stateFlags2 & 0x10) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { DynaPolyActor* wallPolyActor = NULL; - if (this->actor.wallPolySource != BGCHECK_SCENE) { - wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if (this->actor.wallBgId != BGCHECK_SCENE) { + wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); } if (&wallPolyActor->actor == this->unk_3C4) { @@ -6431,7 +6430,7 @@ void func_8083FB7C(Player* this, GlobalContext* globalCtx) { s32 func_8083FBC0(Player* this, GlobalContext* globalCtx) { if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (this->actor.bgCheckFlags & 0x200) && ((D_808535F0 & 8) || (D_808535F0 & 2) || - func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource))) { + func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId))) { return 0; } @@ -6475,7 +6474,7 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, GlobalContext* globalCtx) if (this->unk_664 != NULL) { func_8083DB98(this, 1); } else { - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); + Math_SmoothStepToS(&this->actor.focus.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); func_80836AB8(this, 1); } } else { @@ -7409,10 +7408,12 @@ s32 func_8084269C(GlobalContext* globalCtx, Player* this) { Vec3f sp2C; if ((this->unk_89E == 0) || (this->unk_89E == 1)) { - func_8084260C(&this->actor.unk_CC[0], &sp2C, this->actor.groundY - this->actor.unk_CC[0].y, 7.0f, 5.0f); + func_8084260C(&this->actor.shape.feetPos[FOOT_LEFT], &sp2C, + this->actor.floorHeight - this->actor.shape.feetPos[FOOT_LEFT].y, 7.0f, 5.0f); func_800286CC(globalCtx, &sp2C, &D_808545B4, &D_808545C0, 50, 30); - func_8084260C(&this->actor.unk_CC[1], &sp2C, this->actor.groundY - this->actor.unk_CC[1].y, 7.0f, 5.0f); - func_800286CC(globalCtx, &this->actor.unk_CC[1], &D_808545B4, &D_808545C0, 50, 30); + func_8084260C(&this->actor.shape.feetPos[FOOT_RIGHT], &sp2C, + this->actor.floorHeight - this->actor.shape.feetPos[FOOT_RIGHT].y, 7.0f, 5.0f); + func_800286CC(globalCtx, &this->actor.shape.feetPos[FOOT_RIGHT], &D_808545B4, &D_808545C0, 50, 30); return 1; } @@ -7554,7 +7555,7 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { if (this->swordState > 0) { if (this->swordAnimation < 0x18) { - if (!(this->swordQuads[0].base.atFlags & 4) && !(this->swordQuads[1].base.atFlags & 4)) { + if (!(this->swordQuads[0].base.atFlags & AT_BOUNCED) && !(this->swordQuads[1].base.atFlags & AT_BOUNCED)) { if (this->skelAnime.curFrame >= 2.0f) { phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->swordInfo[0].tip, &this->swordInfo[0].base, &sp50); @@ -7583,9 +7584,9 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { sp48 = func_80041F10(&globalCtx->colCtx, sp78, sp74); if (sp48 == 0xA) { - func_80062E14(globalCtx, &sp5C, &this->actor.projectedPos); + CollisionCheck_SpawnShieldParticlesWood(globalCtx, &sp5C, &this->actor.projectedPos); } else { - func_80062CD4(globalCtx, &sp5C); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp5C); if (sp48 == 0xB) { func_8002F7DC(&this->actor, NA_SE_IT_WALL_HIT_SOFT); } else { @@ -7606,7 +7607,7 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { } } - temp1 = (this->swordQuads[0].base.atFlags & 2) || (this->swordQuads[1].base.atFlags & 2); + temp1 = (this->swordQuads[0].base.atFlags & AT_HIT) || (this->swordQuads[1].base.atFlags & AT_HIT); if (temp1) { if (this->swordAnimation < 0x18) { @@ -7672,7 +7673,7 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { sp4C = 3500; } - sp48 = ABS(sp4C - this->actor.posRot2.rot.x) * 0.25f; + sp48 = ABS(sp4C - this->actor.focus.rot.x) * 0.25f; if (sp48 < 100) { sp48 = 100; } @@ -7682,8 +7683,8 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { sp46 = 50; } - Math_ScaledStepToS(&this->actor.posRot2.rot.x, sp4C, sp48); - this->unk_6BC = this->actor.posRot2.rot.x; + Math_ScaledStepToS(&this->actor.focus.rot.x, sp4C, sp48); + this->unk_6BC = this->actor.focus.rot.x; Math_ScaledStepToS(&this->unk_6BE, sp4A, sp46); if (this->unk_84F != 0) { @@ -7791,7 +7792,8 @@ void func_8084377C(Player* this, GlobalContext* globalCtx) { if (this->unk_850 == 0) { func_80853080(this, globalCtx); } - } else if ((this->stateFlags1 & 0x20000000) || (!(this->cylinder.base.acFlags & 2) && (this->unk_8A1 == 0))) { + } else if ((this->stateFlags1 & 0x20000000) || + (!(this->cylinder.base.acFlags & AC_HIT) && (this->unk_8A1 == 0))) { if (this->stateFlags1 & 0x20000000) { this->unk_850++; } else { @@ -7881,7 +7883,7 @@ void func_80843AE8(GlobalContext* globalCtx, Player* this) { } } else if (this->unk_84F != 0) { this->unk_850 = 60; - Player_SpawnFairy(globalCtx, this, &this->actor.posRot.pos, &D_808545E4, FAIRY_REVIVE_DEATH); + Player_SpawnFairy(globalCtx, this, &this->actor.world.pos, &D_808545E4, FAIRY_REVIVE_DEATH); func_8002F7DC(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); func_800800F8(globalCtx, 0x26B4, 125, &this->actor, 0); } else if (globalCtx->unk_10A20 == 2) { @@ -7900,7 +7902,7 @@ void func_80843CEC(Player* this, GlobalContext* globalCtx) { if (this->currentTunic != PLAYER_TUNIC_GORON) { if ((globalCtx->roomCtx.curRoom.unk_02 == 3) || (D_808535E4 == 9) || ((func_80838144(D_808535E4) >= 0) && - !SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource))) { + !SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId))) { func_8083821C(this); } } @@ -7908,7 +7910,7 @@ void func_80843CEC(Player* this, GlobalContext* globalCtx) { func_8083721C(this); if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_80843AE8(globalCtx, this); } return; @@ -7997,7 +7999,7 @@ void func_8084409C(GlobalContext* globalCtx, Player* this, f32 speedXZ, f32 velo Actor* heldActor = this->heldActor; if (!func_80835644(globalCtx, this, heldActor)) { - heldActor->posRot.rot.y = this->actor.shape.rot.y; + heldActor->world.rot.y = this->actor.shape.rot.y; heldActor->speedXZ = speedXZ; heldActor->velocity.y = velocityY; func_80834644(globalCtx, this); @@ -8060,7 +8062,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { if ((this->wallHeight >= 150.0f) && (this->unk_84B[this->unk_846] == 0)) { func_8083EC18(this, globalCtx, D_808535F0); } else if ((this->unk_88C >= 2) && (this->wallHeight < 150.0f) && - (((this->actor.posRot.pos.y - this->actor.groundY) + this->wallHeight) > + (((this->actor.world.pos.y - this->actor.floorHeight) + this->wallHeight) > (70.0f * this->ageProperties->unk_08))) { AnimationContext_DisableQueue(globalCtx); if (this->stateFlags1 & 4) { @@ -8068,7 +8070,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { } else { func_80832698(this, NA_SE_VO_LI_HANG); } - this->actor.posRot.pos.y += this->wallHeight; + this->actor.world.pos.y += this->wallHeight; func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->wallDistance, D_80853CBC[this->modelAnimType]); this->actor.shape.rot.y = this->currentYaw += 0x8000; @@ -8152,17 +8154,17 @@ void func_80844708(Player* this, GlobalContext* globalCtx) { } else { if (this->linearVelocity >= 7.0f) { if (((this->actor.bgCheckFlags & 0x200) && (D_8085360C < 0x2000)) || - ((this->cylinder.base.maskA & 2) && + ((this->cylinder.base.ocFlags1 & OC1_HIT) && (cylinderOc = this->cylinder.base.oc, ((cylinderOc->id == ACTOR_EN_WOOD02) && - (ABS((s16)(this->actor.posRot.rot.y - cylinderOc->yawTowardsLink)) > 0x6000))))) { + (ABS((s16)(this->actor.world.rot.y - cylinderOc->yawTowardsPlayer)) > 0x6000))))) { if (cylinderOc != NULL) { - cylinderOc->initPosRot.rot.y = 1; - } else if (this->actor.wallPolySource != BGCHECK_SCENE) { - wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + cylinderOc->home.rot.y = 1; + } else if (this->actor.wallBgId != BGCHECK_SCENE) { + wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if ((wallPolyActor != NULL) && (wallPolyActor->actor.id == ACTOR_OBJ_KIBAKO2)) { - wallPolyActor->actor.initPosRot.rot.z = 1; + wallPolyActor->actor.home.rot.z = 1; } } @@ -8544,7 +8546,7 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { func_80832854(this); this->unk_850 = 1; } - Math_StepToF(&this->actor.shape.unk_08, 0.0f, 150.0f); + Math_StepToF(&this->actor.shape.yOffset, 0.0f, 150.0f); } } } @@ -8566,8 +8568,8 @@ s32 func_80845964(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2 if (arg5 != 2) { f32 sp34 = R_UPDATE_RATE * 0.5f; - f32 selfDistX = arg2->endPos.x - this->actor.posRot.pos.x; - f32 selfDistZ = arg2->endPos.z - this->actor.posRot.pos.z; + f32 selfDistX = arg2->endPos.x - this->actor.world.pos.x; + f32 selfDistZ = arg2->endPos.z - this->actor.world.pos.z; f32 sp28 = sqrtf(SQ(selfDistX) + SQ(selfDistZ)) / sp34; s32 sp24 = (arg2->endFrame - globalCtx->csCtx.frames) + 1; @@ -8601,10 +8603,10 @@ s32 func_80845964(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2 } s32 func_80845BA0(GlobalContext* arg0, Player* arg1, f32* arg2, s32 arg3) { - f32 dx = arg1->unk_450.x - arg1->actor.posRot.pos.x; - f32 dz = arg1->unk_450.z - arg1->actor.posRot.pos.z; + f32 dx = arg1->unk_450.x - arg1->actor.world.pos.x; + f32 dz = arg1->unk_450.z - arg1->actor.world.pos.z; s32 sp2C = sqrtf(SQ(dx) + SQ(dz)); - s16 yaw = Math_Vec3f_Yaw(&arg1->actor.posRot.pos, &arg1->unk_450); + s16 yaw = Math_Vec3f_Yaw(&arg1->actor.world.pos, &arg1->unk_450); if (sp2C < arg3) { *arg2 = 0.0f; @@ -8659,8 +8661,8 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { sp34 = gSaveContext.entranceSpeed; if (D_808535F4 != 0) { - this->unk_450.x = (Math_SinS(D_808535FC) * 400.0f) + this->actor.posRot.pos.x; - this->unk_450.z = (Math_CosS(D_808535FC) * 400.0f) + this->actor.posRot.pos.z; + this->unk_450.x = (Math_SinS(D_808535FC) * 400.0f) + this->actor.world.pos.x; + this->unk_450.z = (Math_CosS(D_808535FC) * 400.0f) + this->actor.world.pos.z; } } else if (this->unk_850 < 0) { this->unk_850++; @@ -8820,7 +8822,7 @@ void func_80846358(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_OnFrame(&this->skelAnime, 6.0f)) { Actor* heldActor = this->heldActor; - heldActor->posRot.rot.y = this->actor.shape.rot.y; + heldActor->world.rot.y = this->actor.shape.rot.y; heldActor->speedXZ = 10.0f; heldActor->velocity.y = 20.0f; func_80834644(globalCtx, this); @@ -8886,20 +8888,62 @@ void func_80846578(Player* this, GlobalContext* globalCtx) { } ColliderCylinderInit D_80854624 = { - { COLTYPE_UNK5, 0x00, 0x11, 0x39, 0x08, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; ColliderQuadInit D_80854650 = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000100, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000100, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; ColliderQuadInit D_808546A0 = { - { COLTYPE_METAL_SHIELD, 0x09, 0x15, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00100000, 0x00, 0x00 }, { 0xDFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_HARD | AC_TYPE_ENEMY, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00100000, 0x00, 0x00 }, + { 0xDFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -8918,7 +8962,7 @@ void func_80846660(GlobalContext* globalCtx, Player* this) { } this->stateFlags1 |= 0x20000000; LinkAnimation_Change(globalCtx, &this->skelAnime, &D_04003298, 2.0f / 3.0f, 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f); - this->actor.posRot.pos.y += 800.0f; + this->actor.world.pos.y += 800.0f; } u8 D_808546F0[] = { ITEM_SWORD_MASTER, ITEM_SWORD_KOKIRI }; @@ -8946,7 +8990,7 @@ Vec3f D_808546F4 = { -1.0f, 69.0f, 20.0f }; void func_808467D4(GlobalContext* globalCtx, Player* this) { func_80835C58(globalCtx, this, func_8084E9AC, 0); this->stateFlags1 |= 0x20000000; - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_808546F4); + Math_Vec3f_Copy(&this->actor.world.pos, &D_808546F4); this->currentYaw = this->actor.shape.rot.y = -0x8000; LinkAnimation_Change(globalCtx, &this->skelAnime, this->ageProperties->unk_A0, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); @@ -8966,7 +9010,7 @@ void func_808468E8(GlobalContext* globalCtx, Player* this) { func_808389E8(this, &D_04002FE0, 12.0f, globalCtx); func_80835C58(globalCtx, this, func_8084F9C0, 0); this->stateFlags1 |= 0x20000000; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; func_800800F8(globalCtx, 0x13F6, 40, &this->actor, 0); } @@ -8983,8 +9027,8 @@ void func_808469BC(GlobalContext* globalCtx, Player* this) { s16 D_80854700[] = { ACTOR_MAGIC_WIND, ACTOR_MAGIC_DARK, ACTOR_MAGIC_FIRE }; Actor* func_80846A00(GlobalContext* globalCtx, Player* this, s32 arg2) { - return Actor_Spawn(&globalCtx->actorCtx, globalCtx, D_80854700[arg2], this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + return Actor_Spawn(&globalCtx->actorCtx, globalCtx, D_80854700[arg2], this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } void func_80846A68(GlobalContext* globalCtx, Player* this) { @@ -8994,7 +9038,7 @@ void func_80846A68(GlobalContext* globalCtx, Player* this) { } InitChainEntry D_80854708[] = { - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; EffectBlureInit2 D_8085470C = { @@ -9008,7 +9052,7 @@ void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeade this->ageProperties = &sAgeProperties[gSaveContext.linkAge]; Actor_ProcessInitChain(&this->actor, D_80854708); this->swordEffectIndex = TOTAL_EFFECT_COUNT; - this->currentYaw = this->actor.posRot.rot.y; + this->currentYaw = this->actor.world.rot.y; func_80834644(globalCtx, this); SkelAnime_InitLink(globalCtx, &this->skelAnime, skelHeader, D_80853914[this->modelAnimType], 9, this->jointTable, @@ -9019,7 +9063,7 @@ void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeade this->skelAnime2.baseTransl = D_80854730; Effect_Add(globalCtx, &this->swordEffectIndex, EFFECT_BLURE2, 0, 0, &D_8085470C); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Teardrop, this->ageProperties->unk_04); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, this->ageProperties->unk_04); this->unk_46C = -1; Collider_InitCylinder(globalCtx, &this->cylinder); @@ -9040,14 +9084,12 @@ void (*D_80854738[])(GlobalContext* globalCtx, Player* this) = { Vec3f D_80854778 = { 0.0f, 50.0f, 0.0f }; -#ifdef NON_MATCHING -// single regalloc difference void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { Player* this = THIS; GlobalContext* globalCtx = globalCtx2; Scene* scene = globalCtx->loadedScene; + u32 titleFileSize; s32 initMode; - s32 pad; s32 sp50; s32 sp4C; @@ -9088,10 +9130,10 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { sp4C = 0; } else { sp4C = sp50 - 1; - Math_Vec3f_Copy(&thisx->posRot.pos, &gSaveContext.respawn[sp50 - 1].pos); - Math_Vec3f_Copy(&thisx->initPosRot.pos, &thisx->posRot.pos); - Math_Vec3f_Copy(&thisx->pos4, &thisx->posRot.pos); - this->fallStartHeight = thisx->posRot.pos.y; + Math_Vec3f_Copy(&thisx->world.pos, &gSaveContext.respawn[sp50 - 1].pos); + Math_Vec3f_Copy(&thisx->home.pos, &thisx->world.pos); + Math_Vec3f_Copy(&thisx->prevPos, &thisx->world.pos); + this->fallStartHeight = thisx->world.pos.y; this->currentYaw = thisx->shape.rot.y = gSaveContext.respawn[sp4C].yaw; thisx->params = gSaveContext.respawn[sp4C].playerParams; } @@ -9102,7 +9144,8 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { } if ((sp50 == 0) || (sp50 < -1)) { - if ((scene->titleFile.vromStart != scene->titleFile.vromEnd) && gSaveContext.showTitleCard) { + titleFileSize = scene->titleFile.vromEnd - scene->titleFile.vromStart; + if ((titleFileSize != 0) && gSaveContext.showTitleCard) { if ((gSaveContext.sceneSetupIndex < 4) && (gEntranceTable[(0, gSaveContext.entranceIndex) + (0, gSaveContext.sceneSetupIndex)].field & 0x4000) && ((globalCtx->sceneNum != SCENE_DDAN) || (gSaveContext.eventChkInf[11] & 1)) && @@ -9135,7 +9178,7 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { if (initMode != 0) { if ((gSaveContext.gameMode == 0) || (gSaveContext.gameMode == 3)) { - this->naviActor = Player_SpawnFairy(globalCtx, this, &thisx->posRot.pos, &D_80854778, FAIRY_NAVI); + this->naviActor = Player_SpawnFairy(globalCtx, this, &thisx->world.pos, &D_80854778, FAIRY_NAVI); if (gSaveContext.dogParams != 0) { gSaveContext.dogParams |= 0x8000; } @@ -9156,9 +9199,6 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { Map_SavePlayerInitialInfo(globalCtx); MREG(64) = 0; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_player_actor/Player_Init.s") -#endif void func_808471F4(s16* pValue) { s16 step; @@ -9173,13 +9213,13 @@ void func_80847298(Player* this) { s16 sp26; if (!(this->unk_6AE & 2)) { - sp26 = this->actor.posRot2.rot.y - this->actor.shape.rot.y; + sp26 = this->actor.focus.rot.y - this->actor.shape.rot.y; func_808471F4(&sp26); - this->actor.posRot2.rot.y = this->actor.shape.rot.y + sp26; + this->actor.focus.rot.y = this->actor.shape.rot.y + sp26; } if (!(this->unk_6AE & 1)) { - func_808471F4(&this->actor.posRot2.rot.x); + func_808471F4(&this->actor.focus.rot.x); } if (!(this->unk_6AE & 8)) { @@ -9191,7 +9231,7 @@ void func_80847298(Player* this) { } if (!(this->unk_6AE & 4)) { - func_808471F4(&this->actor.posRot2.rot.z); + func_808471F4(&this->actor.focus.rot.z); } if (!(this->unk_6AE & 0x10)) { @@ -9222,7 +9262,7 @@ f32 D_80854784[] = { 120.0f, 240.0f, 360.0f }; u8 D_80854790[] = { 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C }; void func_808473D4(GlobalContext* globalCtx, Player* this) { - if ((func_8010BDBC(&globalCtx->msgCtx) == 0) && (this->actor.type == ACTORTYPE_PLAYER)) { + if ((func_8010BDBC(&globalCtx->msgCtx) == 0) && (this->actor.category == ACTORCAT_PLAYER)) { Actor* heldActor = this->heldActor; Actor* interactRangeActor = this->interactRangeActor; s32 sp24; @@ -9258,7 +9298,7 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { } else if ((this->stateFlags1 & 0x800000) && !EN_HORSE_CHECK_4((EnHorse*)this->rideActor) && (func_8084D3E4 != this->func_674)) { if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { - if (this->targetActor->type == ACTORTYPE_NPC) { + if (this->targetActor->category == ACTORCAT_NPC) { doAction = 0xF; } else { doAction = 1; @@ -9267,7 +9307,7 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { doAction = 8; } } else if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { - if (this->targetActor->type == ACTORTYPE_NPC) { + if (this->targetActor->category == ACTORCAT_NPC) { doAction = 0xF; } else { doAction = 1; @@ -9390,7 +9430,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { if (this->stateFlags1 & 0x80000000) { this->actor.bgCheckFlags &= ~1; spA4 = 0x38; - } else if ((this->stateFlags1 & 1) && ((this->unk_A84 - (s32)this->actor.posRot.pos.y) >= 100)) { + } else if ((this->stateFlags1 & 1) && ((this->unk_A84 - (s32)this->actor.world.pos.y) >= 100)) { spA4 = 0x39; } else if (!(this->stateFlags1 & 1) && ((func_80845EF8 == this->func_674) || (func_80845CA4 == this->func_674))) { @@ -9411,20 +9451,20 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { this->stateFlags3 |= 0x10; } - Math_Vec3f_Copy(&spB4, &this->actor.posRot.pos); - func_8002E4B4(globalCtx, &this->actor, spAC, spB0, spA8, spA4); + Math_Vec3f_Copy(&spB4, &this->actor.world.pos); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, spAC, spB0, spA8, spA4); if (this->actor.bgCheckFlags & 0x10) { this->actor.velocity.y = 0.0f; } - D_80853600 = this->actor.posRot.pos.y - this->actor.groundY; + D_80853600 = this->actor.world.pos.y - this->actor.floorHeight; D_808535F4 = 0; spC0 = this->actor.floorPoly; if (spC0 != NULL) { - this->unk_A7A = func_80041EA4(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + this->unk_A7A = func_80041EA4(&globalCtx->colCtx, spC0, this->actor.floorBgId); this->unk_A82 = this->unk_89E; if (this->actor.bgCheckFlags & 0x20) { @@ -9437,36 +9477,35 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { if (this->stateFlags2 & 0x200) { this->unk_89E = 1; } else { - this->unk_89E = SurfaceType_GetSfx(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + this->unk_89E = SurfaceType_GetSfx(&globalCtx->colCtx, spC0, this->actor.floorBgId); } } - if (this->actor.type == ACTORTYPE_PLAYER) { - func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorPolySource)); + if (this->actor.category == ACTORCAT_PLAYER) { + func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId)); - if (this->actor.floorPolySource == BGCHECK_SCENE) { + if (this->actor.floorBgId == BGCHECK_SCENE) { func_80074CE8(globalCtx, - SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, spC0, this->actor.floorPolySource)); + SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, spC0, this->actor.floorBgId)); } else { - func_80043508(&globalCtx->colCtx, this->actor.floorPolySource); + func_80043508(&globalCtx->colCtx, this->actor.floorBgId); } } - D_808535F4 = SurfaceType_GetConveyorSpeed(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535F4 = SurfaceType_GetConveyorSpeed(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (D_808535F4 != 0) { - D_808535F8 = SurfaceType_IsConveyor(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535F8 = SurfaceType_IsConveyor(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (((D_808535F8 == 0) && (this->actor.yDistToWater > 20.0f) && (this->currentBoots != PLAYER_BOOTS_IRON)) || ((D_808535F8 != 0) && (this->actor.bgCheckFlags & 1))) { - D_808535FC = SurfaceType_GetConveyorDirection(&globalCtx->colCtx, spC0, this->actor.floorPolySource) - << 10; + D_808535FC = SurfaceType_GetConveyorDirection(&globalCtx->colCtx, spC0, this->actor.floorBgId) << 10; } else { D_808535F4 = 0; } } } - func_80839034(globalCtx, this, spC0, this->actor.floorPolySource); + func_80839034(globalCtx, this, spC0, this->actor.floorBgId); this->actor.bgCheckFlags &= ~0x200; @@ -9483,18 +9522,18 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { this->actor.bgCheckFlags |= 0x200; if (this->actor.wallPoly != spA0) { this->actor.wallPoly = spA0; - this->actor.wallPolySource = sp9C; - this->actor.wallPolyRot = Math_Atan2S(spA0->normal.z, spA0->normal.x); + this->actor.wallBgId = sp9C; + this->actor.wallYaw = Math_Atan2S(spA0->normal.z, spA0->normal.x); } } - sp9A = this->actor.shape.rot.y - (s16)(this->actor.wallPolyRot + 0x8000); + sp9A = this->actor.shape.rot.y - (s16)(this->actor.wallYaw + 0x8000); - D_808535F0 = func_80041DB8(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource); + D_808535F0 = func_80041DB8(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId); D_80853608 = ABS(sp9A); - sp9A = this->currentYaw - (s16)(this->actor.wallPolyRot + 0x8000); + sp9A = this->currentYaw - (s16)(this->actor.wallYaw + 0x8000); D_8085360C = ABS(sp9A); @@ -9525,30 +9564,30 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { f32 sp60; s32 temp3; - this->wallDistance = Math3D_UDistPlaneToPos(sp8C, sp88, sp84, wallPoly->dist, &this->actor.posRot.pos); + this->wallDistance = Math3D_UDistPlaneToPos(sp8C, sp88, sp84, wallPoly->dist, &this->actor.world.pos); spB0 = this->wallDistance + 10.0f; - sp68.x = this->actor.posRot.pos.x - (spB0 * sp8C); - sp68.z = this->actor.posRot.pos.z - (spB0 * sp84); - sp68.y = this->actor.posRot.pos.y + this->ageProperties->unk_0C; + sp68.x = this->actor.world.pos.x - (spB0 * sp8C); + sp68.z = this->actor.world.pos.z - (spB0 * sp84); + sp68.y = this->actor.world.pos.y + this->ageProperties->unk_0C; sp64 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp7C, &sp68); - wallHeight = sp64 - this->actor.posRot.pos.y; + wallHeight = sp64 - this->actor.world.pos.y; this->wallHeight = wallHeight; if ((this->wallHeight < 18.0f) || - BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp60, &this->actor.posRot.pos, - (sp64 - this->actor.posRot.pos.y) + 20.0f, &sp78, &sp74, &this->actor)) { + BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp60, &this->actor.world.pos, + (sp64 - this->actor.world.pos.y) + 20.0f, &sp78, &sp74, &this->actor)) { this->wallHeight = 399.96002f; } else { - D_80854798.y = (sp64 + 5.0f) - this->actor.posRot.pos.y; + D_80854798.y = (sp64 + 5.0f) - this->actor.world.pos.y; if (func_80839768(globalCtx, this, &D_80854798, &sp78, &sp74, &D_80858AA8) && - (temp3 = this->actor.wallPolyRot - Math_Atan2S(sp78->normal.z, sp78->normal.x), + (temp3 = this->actor.wallYaw - Math_Atan2S(sp78->normal.z, sp78->normal.x), ABS(temp3) < 0x4000) && !func_80041E18(&globalCtx->colCtx, sp78, sp74)) { this->wallHeight = 399.96002f; - } else if (func_80041DE4(&globalCtx->colCtx, wallPoly, this->actor.wallPolySource) == 0) { + } else if (func_80041DE4(&globalCtx->colCtx, wallPoly, this->actor.wallBgId) == 0) { if (this->ageProperties->unk_1C <= this->wallHeight) { if (ABS(sp7C->normal.y) > 28000) { if (this->ageProperties->unk_14 <= this->wallHeight) { @@ -9582,7 +9621,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { } if (this->actor.bgCheckFlags & 1) { - D_808535E4 = func_80041D4C(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535E4 = func_80041D4C(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (!func_80847A78(this)) { f32 sp58; @@ -9593,8 +9632,8 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { f32 sp44; s32 pad3; - if (this->actor.floorPolySource != BGCHECK_SCENE) { - func_800434C8(&globalCtx->colCtx, this->actor.floorPolySource); + if (this->actor.floorBgId != BGCHECK_SCENE) { + func_800434C8(&globalCtx->colCtx, this->actor.floorBgId); } sp58 = COLPOLY_GET_NORMAL(spC0->normal.x); @@ -9632,7 +9671,7 @@ void func_808486A8(GlobalContext* globalCtx, Player* this) { Actor* unk_664; s32 camMode; - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { sp27 = 0; if (this->csMode != 0) { @@ -9702,7 +9741,7 @@ void func_808486A8(GlobalContext* globalCtx, Player* this) { if (globalCtx->actorCtx.targetCtx.unk_90 != NULL) { sp27 = 1; - func_800F6114(sqrtf(globalCtx->actorCtx.targetCtx.unk_90->xyzDistToLinkSq)); + func_800F6114(sqrtf(globalCtx->actorCtx.targetCtx.unk_90->xyzDistToPlayerSq)); } if (globalCtx->sceneNum != SCENE_TURIBORI) { @@ -9759,9 +9798,9 @@ void func_80848B44(GlobalContext* globalCtx, Player* this) { } randBodyPart = this->bodyPartsPos + (s32)Rand_ZeroFloat(17.9f); - shockPos.x = (Rand_CenteredFloat(5.0f) + randBodyPart->x) - this->actor.posRot.pos.x; - shockPos.y = (Rand_CenteredFloat(5.0f) + randBodyPart->y) - this->actor.posRot.pos.y; - shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.posRot.pos.z; + shockPos.x = (Rand_CenteredFloat(5.0f) + randBodyPart->x) - this->actor.world.pos.x; + shockPos.y = (Rand_CenteredFloat(5.0f) + randBodyPart->y) - this->actor.world.pos.y; + shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.world.pos.z; EffectSsFhgFlash_SpawnShock(globalCtx, &this->actor, &shockPos, shockScale, FHGFLASH_SHOCK_PLAYER); func_8002F8F0(&this->actor, NA_SE_PL_SPARK - SFX_FLAG); @@ -9877,7 +9916,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } } - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.initPosRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.home.pos); if (this->unk_A73 != 0) { this->unk_A73--; @@ -9975,7 +10014,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Math_ScaledStepToS(&this->unk_6C2, 0, 400); func_80032CB4(this->unk_3A8, 20, 80, 6); - this->actor.shape.unk_06 = this->unk_3A8[0] + ((globalCtx->gameplayFrames & 32) ? 0 : 3); + this->actor.shape.face = this->unk_3A8[0] + ((globalCtx->gameplayFrames & 32) ? 0 : 3); if (this->currentMask == PLAYER_MASK_BUNNY) { func_8085002C(this); @@ -9990,7 +10029,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->stateFlags1 & 0x28000000))) { f32 sp70 = this->linearVelocity; s16 sp6E = this->currentYaw; - s16 yawDiff = this->actor.posRot.rot.y - sp6E; + s16 yawDiff = this->actor.world.rot.y - sp6E; s32 pad; if ((ABS(yawDiff) > 0x6000) && (this->actor.speedXZ != 0.0f)) { @@ -9999,7 +10038,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } if (Math_StepToF(&this->actor.speedXZ, sp70, 0.35f) && (sp70 == 0.0f)) { - this->actor.posRot.rot.y = this->currentYaw; + this->actor.world.rot.y = this->currentYaw; } if (this->linearVelocity != 0.0f) { @@ -10008,7 +10047,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { phi_v0 = (fabsf(this->linearVelocity) * 700.0f) - (fabsf(this->actor.speedXZ) * 100.0f); phi_v0 = CLAMP(phi_v0, 0, 1350); - Math_ScaledStepToS(&this->actor.posRot.rot.y, sp6E, phi_v0); + Math_ScaledStepToS(&this->actor.world.rot.y, sp6E, phi_v0); } if ((this->linearVelocity == 0.0f) && (this->actor.speedXZ != 0.0f)) { @@ -10016,7 +10055,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } } else { this->actor.speedXZ = this->linearVelocity; - this->actor.posRot.rot.y = this->currentYaw; + this->actor.world.rot.y = this->currentYaw; } func_8002D868(&this->actor); @@ -10043,7 +10082,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { func_808396F4(globalCtx, this, &D_80854814, &sp4C, &sp5C, &sp58); } else { sp5C = rideActor->actor.floorPoly; - sp58 = rideActor->actor.floorPolySource; + sp58 = rideActor->actor.floorBgId; } if ((sp5C != NULL) && func_80839034(globalCtx, this, sp5C, sp58)) { @@ -10085,7 +10124,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { if (!Player_InBlockingCsMode(globalCtx, this) && !(this->stateFlags2 & 0x40000)) { func_8083D53C(globalCtx, this); - if ((this->actor.type == ACTORTYPE_PLAYER) && (gSaveContext.health == 0)) { + if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.health == 0)) { if (this->stateFlags1 & 0x206000) { func_80832440(globalCtx, this); func_80837B9C(this, globalCtx); @@ -10099,14 +10138,14 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { ((globalCtx->sceneLoadFlag == 0x14) || (this->unk_A87 != 0) || !func_808382DC(this, globalCtx))) { func_8083AA10(this, globalCtx); } else { - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } func_80848EF8(this); } } if ((globalCtx->csCtx.state != 0) && (this->csMode != 6) && !(this->stateFlags1 & 0x800000) && - !(this->stateFlags2 & 0x80) && (this->actor.type == ACTORTYPE_PLAYER)) { + !(this->stateFlags2 & 0x80) && (this->actor.category == ACTORCAT_PLAYER)) { CsCmdActorAction* linkActionCsCmd = globalCtx->csCtx.linkAction; if ((linkActionCsCmd != NULL) && (D_808547C4[linkActionCsCmd->action] != 0)) { @@ -10190,7 +10229,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->stateFlags2 &= ~0x800000; this->unk_6A4 = FLT_MAX; - temp_f0 = this->actor.posRot.pos.y - this->actor.pos4.y; + temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; this->doorType = 0; this->unk_8A1 = 0; @@ -10206,13 +10245,13 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->cylinder.dim.height = -this->cylinder.dim.height; } - this->cylinder.dim.yShift = phi_f12 - this->actor.posRot.pos.y; + this->cylinder.dim.yShift = phi_f12 - this->actor.world.pos.y; if (this->stateFlags1 & 0x400000) { this->cylinder.dim.height = this->cylinder.dim.height * 0.8f; } - Collider_CylinderUpdate(&this->actor, &this->cylinder); + Collider_UpdateCylinder(&this->actor, &this->cylinder); if (!(this->stateFlags2 & 0x4000)) { if (!(this->stateFlags1 & 0x806080)) { @@ -10231,24 +10270,24 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { AnimationContext_SetNextQueue(globalCtx); } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[0]); if (this->stateFlags1 & 0x30000080) { - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { this->actor.colChkInfo.mass = 50; } this->stateFlags3 &= ~4; - Collider_CylinderSetAC(globalCtx, &this->cylinder.base); + Collider_ResetCylinderAC(globalCtx, &this->cylinder.base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[0].base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[1].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base); - Collider_QuadSetAC(globalCtx, &this->shieldQuad.base); - Collider_QuadSetAT(globalCtx, &this->shieldQuad.base); + Collider_ResetQuadAC(globalCtx, &this->shieldQuad.base); + Collider_ResetQuadAT(globalCtx, &this->shieldQuad.base); } Vec3f D_80854838 = { 0.0f, 0.0f, -30.0f }; @@ -10267,7 +10306,7 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { gSaveContext.dogParams = 0; } else { gSaveContext.dogParams &= 0x7FFF; - func_808395DC(this, &this->actor.posRot.pos, &D_80854838, &sDogSpawnPos); + func_808395DC(this, &this->actor.world.pos, &D_80854838, &sDogSpawnPos); dogParams = gSaveContext.dogParams; dog = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DOG, sDogSpawnPos.x, sDogSpawnPos.y, @@ -10299,10 +10338,10 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { Player_UpdateCommon(this, globalCtx, &sp44); } - MREG(52) = this->actor.posRot.pos.x; - MREG(53) = this->actor.posRot.pos.y; - MREG(54) = this->actor.posRot.pos.z; - MREG(55) = this->actor.posRot.rot.y; + MREG(52) = this->actor.world.pos.x; + MREG(53) = this->actor.world.pos.y; + MREG(54) = this->actor.world.pos.z; + MREG(55) = this->actor.world.rot.y; } struct_80858AC8 D_80858AC8; @@ -10324,7 +10363,7 @@ void func_8084A0E8(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* cullDLi gSPSegment(POLY_XLU_DISP++, 0x0C, cullDList); func_8008F470(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, lod, - this->currentTunic, this->currentBoots, this->actor.shape.unk_06, overrideLimbDraw, func_80090D20, + this->currentTunic, this->currentBoots, this->actor.shape.face, overrideLimbDraw, func_80090D20, this); if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) { @@ -10372,7 +10411,7 @@ void func_8084A0E8(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* cullDLi D_8085486C = D_8085486C * (sp5C * 0.11111111f); } - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 2.0f, this->actor.posRot.pos.z, + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + 2.0f, this->actor.world.pos.z, &D_80854864); Matrix_Scale(4.0f, 4.0f, 4.0f, MTXMODE_APPLY); @@ -10424,7 +10463,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_6AD != 0) { Vec3f sp7C; - SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &this->actor.posRot2.pos, &sp7C); + SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &this->actor.focus.pos, &sp7C); if (sp7C.z < -4.0f) { overrideLimbDraw = func_800902F0; } @@ -10440,10 +10479,10 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Push(); this->actor.scale.y = -this->actor.scale.y; - func_800D1694(this->actor.posRot.pos.x, - (this->actor.groundY + (this->actor.groundY - this->actor.posRot.pos.y)) + - (this->actor.shape.unk_08 * this->actor.scale.y), - this->actor.posRot.pos.z, &this->actor.shape.rot); + func_800D1694(this->actor.world.pos.x, + (this->actor.floorHeight + (this->actor.floorHeight - this->actor.world.pos.y)) + + (this->actor.shape.yOffset * this->actor.scale.y), + this->actor.world.pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateX(sp78, MTXMODE_APPLY); Matrix_RotateY(sp74, MTXMODE_APPLY); @@ -10508,24 +10547,24 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) { if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { temp2 = sControlInput->rel.stick_y * 240.0f; - Math_SmoothStepToS(&this->actor.posRot2.rot.x, temp2, 14, 4000, 30); + Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30); temp2 = sControlInput->rel.stick_x * -16.0f; temp2 = CLAMP(temp2, -3000, 3000); - this->actor.posRot2.rot.y += temp2; + this->actor.focus.rot.y += temp2; } else { temp1 = (this->stateFlags1 & 0x800000) ? 3500 : 14000; temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f); - this->actor.posRot2.rot.x += temp3; - this->actor.posRot2.rot.x = CLAMP(this->actor.posRot2.rot.x, -temp1, temp1); + this->actor.focus.rot.x += temp3; + this->actor.focus.rot.x = CLAMP(this->actor.focus.rot.x, -temp1, temp1); temp1 = 19114; - temp2 = this->actor.posRot2.rot.y - this->actor.shape.rot.y; + temp2 = this->actor.focus.rot.y - this->actor.shape.rot.y; temp3 = ((sControlInput->rel.stick_x >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_x * 200)) * -1500.0f); temp2 += temp3; - this->actor.posRot2.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; + this->actor.focus.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; } this->unk_6AE |= 2; @@ -10729,7 +10768,8 @@ void func_8084B530(Player* this, GlobalContext* globalCtx) { } else if (!func_8008E9C4(this) && LinkAnimation_Update(globalCtx, &this->skelAnime)) { if (this->skelAnime.moveFlags != 0) { func_80832DBC(this); - if ((this->targetActor->type == ACTORTYPE_NPC) && (this->heldItemActionParam != PLAYER_AP_FISHING_POLE)) { + if ((this->targetActor->category == ACTORCAT_NPC) && + (this->heldItemActionParam != PLAYER_AP_FISHING_POLE)) { func_808322D0(globalCtx, this, &D_040031A0); } else { func_80832284(globalCtx, this, func_80833338(this)); @@ -10766,11 +10806,11 @@ void func_8084B78C(Player* this, GlobalContext* globalCtx) { } void func_8084B840(GlobalContext* globalCtx, Player* this, f32 arg2) { - if (this->actor.wallPolySource != BGCHECK_SCENE) { - DynaPolyActor* dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if (this->actor.wallBgId != BGCHECK_SCENE) { + DynaPolyActor* dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if (dynaActor != NULL) { - func_8002DFA4(dynaActor, arg2, this->actor.posRot.rot.y); + func_8002DFA4(dynaActor, arg2, this->actor.world.rot.y); } } } @@ -10865,10 +10905,10 @@ void func_8084B9E4(Player* this, GlobalContext* globalCtx) { } if (this->stateFlags2 & 0x10) { - temp2 = func_8083973C(globalCtx, this, &D_80854880, &sp5C) - this->actor.posRot.pos.y; + temp2 = func_8083973C(globalCtx, this, &D_80854880, &sp5C) - this->actor.world.pos.y; if (fabsf(temp2) < 20.0f) { - sp44.x = this->actor.posRot.pos.x; - sp44.z = this->actor.posRot.pos.z; + sp44.x = this->actor.world.pos.x; + sp44.z = this->actor.world.pos.z; sp44.y = sp5C.y; if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp44, &sp5C, &sp38, &sp54, 1, 0, 0, 1, &sp50) == 0) { func_8084B840(globalCtx, this, -2.0f); @@ -10922,7 +10962,7 @@ void func_8084BBE4(Player* this, GlobalContext* globalCtx) { return; } - if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.unk_15 != 0)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.feetFloorFlags != 0)) { func_80837B60(this); if (this->unk_84F < 0) { this->linearVelocity = -0.8f; @@ -10973,7 +11013,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { sp84 = sControlInput->rel.stick_y; sp80 = sControlInput->rel.stick_x; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; this->stateFlags2 |= 0x40; if ((this->unk_84F != 0) && (ABS(sp84) < ABS(sp80))) { @@ -10999,15 +11039,15 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = phi_f2 * phi_f0; if (this->unk_850 >= 0) { - if ((this->actor.wallPoly != NULL) && (this->actor.wallPolySource != BGCHECK_SCENE)) { - DynaPolyActor* wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if ((this->actor.wallPoly != NULL) && (this->actor.wallBgId != BGCHECK_SCENE)) { + DynaPolyActor* wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if (wallPolyActor != NULL) { - Math_Vec3f_Diff(&wallPolyActor->actor.posRot.pos, &wallPolyActor->actor.pos4, &sp6C); - Math_Vec3f_Sum(&this->actor.posRot.pos, &sp6C, &this->actor.posRot.pos); + Math_Vec3f_Diff(&wallPolyActor->actor.world.pos, &wallPolyActor->actor.prevPos, &sp6C); + Math_Vec3f_Sum(&this->actor.world.pos, &sp6C, &this->actor.world.pos); } } - func_8002E4B4(globalCtx, &this->actor, 26.0f, 6.0f, this->ageProperties->unk_00, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 26.0f, 6.0f, this->ageProperties->unk_00, 7); func_8083F360(globalCtx, this, 26.0f, this->ageProperties->unk_3C, 50.0f, -20.0f); } @@ -11025,9 +11065,9 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { D_8085488C.y = this->ageProperties->unk_40; temp_f0 = func_8083973C(globalCtx, this, &D_8085488C, &sp5C); - if (this->actor.posRot.pos.y < temp_f0) { + if (this->actor.world.pos.y < temp_f0) { if (this->unk_84F != 0) { - this->actor.posRot.pos.y = temp_f0; + this->actor.world.pos.y = temp_f0; this->stateFlags1 &= ~0x200000; func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->ageProperties->unk_3C, &D_04003000); @@ -11043,7 +11083,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { func_80832264(globalCtx, this, this->ageProperties->unk_AC[sp68]); } } else { - if ((this->actor.posRot.pos.y - this->actor.groundY) < 15.0f) { + if ((this->actor.world.pos.y - this->actor.floorHeight) < 15.0f) { if (this->unk_84F != 0) { func_8083FB7C(this, globalCtx); } else { @@ -11138,9 +11178,9 @@ void func_8084C5F8(Player* this, GlobalContext* globalCtx) { } if (LinkAnimation_OnFrame(&this->skelAnime, sp38[0]) || LinkAnimation_OnFrame(&this->skelAnime, sp38[1])) { - sp24.x = this->actor.posRot.pos.x; - sp24.y = this->actor.posRot.pos.y + 20.0f; - sp24.z = this->actor.posRot.pos.z; + sp24.x = this->actor.world.pos.x; + sp24.y = this->actor.world.pos.y + 20.0f; + sp24.z = this->actor.world.pos.z; if (BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &sp34, &sp30, &sp24) != 0.0f) { this->unk_89E = func_80041F10(&globalCtx->colCtx, sp34, sp30); func_808328A0(this); @@ -11214,8 +11254,8 @@ s32 func_8084C89C(GlobalContext* globalCtx, Player* this, s32 arg2, f32* arg3) { CollisionPoly* sp30; u32 sp2C; - sp50 = rideActor->actor.posRot.pos.y + 20.0f; - sp4C = rideActor->actor.posRot.pos.y - 20.0f; + sp50 = rideActor->actor.world.pos.y + 20.0f; + sp4C = rideActor->actor.world.pos.y - 20.0f; *arg3 = func_8083973C(globalCtx, this, &D_808548FC[arg2], &sp40); @@ -11250,7 +11290,7 @@ s32 func_8084C9BC(Player* this, GlobalContext* globalCtx) { (EN_HORSE_CHECK_4(rideActor) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A))) { rideActor->actor.child = NULL; func_80835DAC(globalCtx, this, func_8084D3E4, 0); - this->unk_878 = sp34 - rideActor->actor.posRot.pos.y; + this->unk_878 = sp34 - rideActor->actor.world.pos.y; func_80832264(globalCtx, this, (this->unk_43C < 0) ? &D_04003390 : &D_040033A0); return 1; } @@ -11275,7 +11315,7 @@ void func_8084CBF4(Player* this, f32 arg1, f32 arg2) { } else { temp = this->unk_878; } - this->actor.posRot.pos.y += temp; + this->actor.world.pos.y += temp; this->unk_878 -= temp; } } @@ -11393,9 +11433,9 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { } } - this->actor.posRot.pos.x = rideActor->actor.posRot.pos.x + rideActor->unk_258.x; - this->actor.posRot.pos.y = (rideActor->actor.posRot.pos.y + rideActor->unk_258.y) - 27.0f; - this->actor.posRot.pos.z = rideActor->actor.posRot.pos.z + rideActor->unk_258.z; + this->actor.world.pos.x = rideActor->actor.world.pos.x + rideActor->unk_258.x; + this->actor.world.pos.y = (rideActor->actor.world.pos.y + rideActor->unk_258.y) - 27.0f; + this->actor.world.pos.z = rideActor->actor.world.pos.z + rideActor->unk_258.z; this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; @@ -11462,7 +11502,7 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { if (func_8002DD78(this) != 0) { this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y; this->unk_6BE = CLAMP(this->unk_6BE, -0x4AAA, 0x4AAA); - this->actor.posRot2.rot.y = this->actor.shape.rot.y + this->unk_6BE; + this->actor.focus.rot.y = this->actor.shape.rot.y + this->unk_6BE; this->unk_6BE += 5000; this->unk_6AE |= 0x80; } else { @@ -11498,9 +11538,9 @@ void func_8084D3E4(Player* this, GlobalContext* globalCtx) { AREG(6) = 0; if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { - gSaveContext.horseData.pos.x = rideActor->actor.posRot.pos.x; - gSaveContext.horseData.pos.y = rideActor->actor.posRot.pos.y; - gSaveContext.horseData.pos.z = rideActor->actor.posRot.pos.z; + gSaveContext.horseData.pos.x = rideActor->actor.world.pos.x; + gSaveContext.horseData.pos.y = rideActor->actor.world.pos.y; + gSaveContext.horseData.pos.z = rideActor->actor.world.pos.z; gSaveContext.horseData.angle = rideActor->actor.shape.rot.y; } } else { @@ -11960,8 +12000,8 @@ void func_8084E6D4(Player* this, GlobalContext* globalCtx) { this->stateFlags1 &= ~0xC00; if (this->getItemId != GI_ICE_TRAP) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 100.0f, this->actor.posRot.pos.z, 0, 0, 0, 0); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, + this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 0, 0, 0, 0); func_8083C0E8(this, globalCtx); } else { this->actor.colChkInfo.damage = 0; @@ -12327,7 +12367,7 @@ void func_8084F390(Player* this, GlobalContext* globalCtx) { sp4C = (sp50 * sp50) * 0.015f; sp48 = sp38.y * 0.01f; - if (SurfaceType_GetSlope(&globalCtx->colCtx, floorPoly, this->actor.floorPolySource) != 1) { + if (SurfaceType_GetSlope(&globalCtx->colCtx, floorPoly, this->actor.floorBgId) != 1) { sp50 = 0; sp48 = sp38.y * 10.0f; } @@ -12394,9 +12434,9 @@ void func_8084F710(Player* this, GlobalContext* globalCtx) { } if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.linkAction != NULL)) { - f32 sp28 = this->actor.posRot.pos.y; + f32 sp28 = this->actor.world.pos.y; func_808529D0(globalCtx, this, globalCtx->csCtx.linkAction); - this->actor.posRot.pos.y = sp28; + this->actor.world.pos.y = sp28; } } @@ -12470,7 +12510,7 @@ void func_8084FB10(Player* this, GlobalContext* globalCtx) { if (func_80832594(this, 1, 100)) { this->unk_84F = -1; - EffectSsIcePiece_SpawnBurst(globalCtx, &this->actor.posRot.pos, this->actor.scale.x); + EffectSsIcePiece_SpawnBurst(globalCtx, &this->actor.world.pos, this->actor.scale.x); func_8002F7DC(&this->actor, NA_SE_PL_ICE_BROKEN); } else { this->stateFlags2 |= 0x4000; @@ -12528,9 +12568,9 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_L)) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { - this->actor.posRot.pos.y += speed; + this->actor.world.pos.y += speed; } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { - this->actor.posRot.pos.y -= speed; + this->actor.world.pos.y -= speed; } if (CHECK_BTN_ANY(sControlInput->cur.button, BTN_DUP | BTN_DLEFT | BTN_DDOWN | BTN_DRIGHT)) { @@ -12547,8 +12587,8 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { angle = temp - 0x4000; } - this->actor.posRot.pos.x += speed * Math_SinS(angle); - this->actor.posRot.pos.z += speed * Math_CosS(angle); + this->actor.world.pos.x += speed * Math_SinS(angle); + this->actor.world.pos.z += speed * Math_CosS(angle); } } @@ -12563,7 +12603,7 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return 0; } @@ -12595,7 +12635,7 @@ void func_8085002C(Player* this) { D_80858AC8.unk_06 += -D_80858AC8.unk_00 >> 2; D_80858AC8.unk_08 += -D_80858AC8.unk_02 >> 2; - sp26 = this->actor.posRot.rot.y - this->actor.shape.rot.y; + sp26 = this->actor.world.rot.y - this->actor.shape.rot.y; sp28 = (s32)(this->actor.speedXZ * -200.0f * Math_CosS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; sp2A = (s32)(this->actor.speedXZ * 100.0f * Math_SinS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; @@ -12698,9 +12738,9 @@ void func_808502D0(Player* this, GlobalContext* globalCtx) { f32 sp2C; shockwavePos.y = func_8083973C(globalCtx, this, &D_80854A40, &shockwavePos); - sp2C = this->actor.posRot.pos.y - shockwavePos.y; + sp2C = this->actor.world.pos.y - shockwavePos.y; - Math_ScaledStepToS(&this->actor.posRot2.rot.x, Math_Atan2S(45.0f, sp2C), 800); + Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); func_80836AB8(this, 1); if ((((this->swordAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) || @@ -12763,7 +12803,7 @@ void func_8085076C(Player* this, GlobalContext* globalCtx) { if (this->unk_850 > 20) { this->actor.draw = Player_Draw; - this->actor.posRot.pos.y += 60.0f; + this->actor.world.pos.y += 60.0f; func_80837B9C(this, globalCtx); return; } @@ -12891,19 +12931,19 @@ void func_80850AEC(Player* this, GlobalContext* globalCtx) { func_80832284(globalCtx, this, &D_04002C98); } - Math_Vec3f_Sum(&this->actor.posRot.pos, &this->actor.velocity, &this->actor.posRot.pos); + Math_Vec3f_Sum(&this->actor.world.pos, &this->actor.velocity, &this->actor.world.pos); if (func_80834FBC(this)) { - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); func_80847BA0(globalCtx, this); - temp = this->actor.posRot.pos.y - this->actor.groundY; + temp = this->actor.world.pos.y - this->actor.floorHeight; if (temp > 20.0f) { temp = 20.0f; } - this->actor.posRot.rot.x = this->actor.shape.rot.x = 0; - this->actor.posRot.pos.y -= temp; + this->actor.world.rot.x = this->actor.shape.rot.x = 0; + this->actor.world.pos.y -= temp; this->linearVelocity = 1.0f; this->actor.velocity.y = 0.0f; func_80837B9C(this, globalCtx); @@ -12915,7 +12955,7 @@ void func_80850AEC(Player* this, GlobalContext* globalCtx) { if ((this->skelAnime.animation != &D_04002C90) || (4.0f <= this->skelAnime.curFrame)) { this->actor.gravity = 0.0f; - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0x800); + Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0x800); func_8083264C(this, 100, 2, 100, 0); } } @@ -13254,8 +13294,8 @@ void func_80851750(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg void func_80851788(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { this->stateFlags1 &= ~0x2000000; - this->currentYaw = this->actor.shape.rot.y = this->actor.posRot.rot.y = - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_450); + this->currentYaw = this->actor.shape.rot.y = this->actor.world.rot.y = + Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_450); if (this->linearVelocity <= 0.0f) { this->linearVelocity = 0.1f; @@ -13323,7 +13363,7 @@ LinkAnimationHeader* D_80855190[] = { Vec3f D_80855198 = { -1.0f, 70.0f, 20.0f }; void func_808519EC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_80855198); + Math_Vec3f_Copy(&this->actor.world.pos, &D_80855198); this->actor.shape.rot.y = -0x8000; func_808322D0(globalCtx, this, this->ageProperties->unk_9C); func_80832F54(globalCtx, this, 0x28F); @@ -13425,12 +13465,12 @@ void func_80851D80(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg void func_80851DEC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { LinkAnimation_Update(globalCtx, &this->skelAnime); - Math_StepToS(&this->actor.shape.unk_06, 0, 1); + Math_StepToS(&this->actor.shape.face, 0, 1); } void func_80851E28(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { LinkAnimation_Update(globalCtx, &this->skelAnime); - Math_StepToS(&this->actor.shape.unk_06, 2, 1); + Math_StepToS(&this->actor.shape.face, 2, 1); } void func_80851E64(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { @@ -13458,7 +13498,7 @@ void func_80851F14(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* } void func_80851F84(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; func_80851134(globalCtx, this, &D_04002420); } @@ -13475,7 +13515,7 @@ void func_80851FB0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } else if (this->unk_850 == 0) { func_80832924(this, D_808551BC); if (LinkAnimation_OnFrame(&this->skelAnime, 240.0f)) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Teardrop; + this->actor.shape.shadowDraw = ActorShadow_DrawFeet; } } } @@ -13506,9 +13546,9 @@ void func_808520BC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg f32 distZ = (arg2->endPos.z - startZ); f32 sp4 = (f32)(globalCtx->csCtx.frames - arg2->startFrame) / (f32)(arg2->endFrame - arg2->startFrame); - this->actor.posRot.pos.x = distX * sp4 + startX; - this->actor.posRot.pos.y = distY * sp4 + startY; - this->actor.posRot.pos.z = distZ * sp4 + startZ; + this->actor.world.pos.x = distX * sp4 + startX; + this->actor.world.pos.y = distY * sp4 + startY; + this->actor.world.pos.z = distZ * sp4 + startZ; } struct_80832924 D_808551D8[] = { @@ -13744,19 +13784,19 @@ void func_80852944(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } void func_808529D0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->actor.posRot.pos.x = arg2->startPos.x; - this->actor.posRot.pos.y = arg2->startPos.y; + this->actor.world.pos.x = arg2->startPos.x; + this->actor.world.pos.y = arg2->startPos.y; if ((globalCtx->sceneNum == SCENE_SPOT04) && LINK_IS_CHILD) { - this->actor.posRot.pos.y -= 1.0f; + this->actor.world.pos.y -= 1.0f; } - this->actor.posRot.pos.z = arg2->startPos.z; + this->actor.world.pos.z = arg2->startPos.z; this->currentYaw = this->actor.shape.rot.y = arg2->rot.y; } void func_80852A54(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - f32 dx = arg2->startPos.x - (s32)this->actor.posRot.pos.x; - f32 dy = arg2->startPos.y - (s32)this->actor.posRot.pos.y; - f32 dz = arg2->startPos.z - (s32)this->actor.posRot.pos.z; + f32 dx = arg2->startPos.x - (s32)this->actor.world.pos.x; + f32 dy = arg2->startPos.y - (s32)this->actor.world.pos.y; + f32 dz = arg2->startPos.z - (s32)this->actor.world.pos.z; f32 dist = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); s16 yawDiff = arg2->rot.y - this->actor.shape.rot.y; @@ -13941,11 +13981,11 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { if (func_808332B8(this)) { func_80836898(globalCtx, this, func_8083A2F8); func_80832C6C(globalCtx, this, &D_04003328); - } else if ((actor->type != ACTORTYPE_NPC) || (this->heldItemActionParam == PLAYER_AP_FISHING_POLE)) { + } else if ((actor->category != ACTORCAT_NPC) || (this->heldItemActionParam == PLAYER_AP_FISHING_POLE)) { func_8083A2F8(globalCtx, this); if (!func_8008E9C4(this)) { - if ((actor != this->naviActor) && (actor->xzDistToLink < 40.0f)) { + if ((actor != this->naviActor) && (actor->xzDistToPlayer < 40.0f)) { func_808322D0(globalCtx, this, &D_04002DF0); } else { func_80832284(globalCtx, this, func_80833338(this)); @@ -13953,7 +13993,7 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { } } else { func_80836898(globalCtx, this, func_8083A2F8); - func_808322D0(globalCtx, this, (actor->xzDistToLink < 40.0f) ? &D_04002DF0 : &D_040031A0); + func_808322D0(globalCtx, this, (actor->xzDistToPlayer < 40.0f) ? &D_04002DF0 : &D_040031A0); } if (this->skelAnime.animation == &D_04002DF0) { diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c index 7fac9d0ce2..79b8003789 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c @@ -44,10 +44,10 @@ u32 EffectSsEnFire_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, voi this->rUnused = -15; if (initParams->bodyPart < 0) { - this->rYaw = Math_Vec3f_Yaw(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.y; + this->rYaw = Math_Vec3f_Yaw(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.y; this->rPitch = - Math_Vec3f_Pitch(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.x; - this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->posRot.pos); + Math_Vec3f_Pitch(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.x; + this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->world.pos); } this->rScaleMax = initParams->scale; @@ -120,14 +120,14 @@ void EffectSsEnFire_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) this->rScroll++; if (this->actor != NULL) { - if (this->actor->dmgEffectTimer >= 22) { + if (this->actor->colorFilterTimer >= 22) { this->life++; } if (this->actor->update != NULL) { Math_SmoothStepToS(&this->rScale, this->rScaleMax, 1, this->rScaleMax >> 3, 0); if (this->rBodyPart < 0) { - Matrix_Translate(this->actor->posRot.pos.x, this->actor->posRot.pos.y, this->actor->posRot.pos.z, + Matrix_Translate(this->actor->world.pos.x, this->actor->world.pos.y, this->actor->world.pos.z, MTXMODE_NEW); Matrix_RotateY((this->rYaw + this->actor->shape.rot.y) * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateX((this->rPitch + this->actor->shape.rot.x) * 0.0000958738f, MTXMODE_APPLY); diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c index 0e5caa4840..07178c36ce 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c @@ -39,9 +39,9 @@ u32 EffectSsEnIce_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; this->pos = initParams->pos; - this->vec.x = this->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = this->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = this->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = this->pos.x - initParams->actor->world.pos.x; + this->vec.y = this->pos.y - initParams->actor->world.pos.y; + this->vec.z = this->pos.z - initParams->actor->world.pos.z; this->velocity = zeroVec; this->accel = zeroVec; this->life = 10; @@ -138,14 +138,14 @@ void EffectSsEnIce_UpdateFlying(GlobalContext* globalCtx, u32 index, EffectSs* t s16 rand; if ((this->actor != NULL) && (this->actor->update != NULL)) { - if ((this->life >= 9) && (this->actor->dmgEffectTimer != 0) && (!(this->actor->dmgEffectParams & 0xC000))) { - this->pos.x = this->actor->posRot.pos.x + this->vec.x; - this->pos.y = this->actor->posRot.pos.y + this->vec.y; - this->pos.z = this->actor->posRot.pos.z + this->vec.z; + if ((this->life >= 9) && (this->actor->colorFilterTimer != 0) && (!(this->actor->colorFilterParams & 0xC000))) { + this->pos.x = this->actor->world.pos.x + this->vec.x; + this->pos.y = this->actor->world.pos.y + this->vec.y; + this->pos.z = this->actor->world.pos.z + this->vec.z; this->life++; } else if (this->life == 9) { - this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); - this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); + this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); + this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); this->accel.y = -1.5f; this->velocity.y = 5.0f; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c index ed3fc838ef..b8fa5dd544 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c @@ -28,9 +28,9 @@ u32 EffectSsFcircle_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo this->pos = initParams->pos; this->actor = initParams->actor; - this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = initParams->pos.x - initParams->actor->world.pos.x; + this->vec.y = initParams->pos.y - initParams->actor->world.pos.y; + this->vec.z = initParams->pos.z - initParams->actor->world.pos.z; this->gfx = D_040184B0; this->life = 20; this->draw = EffectSsFcircle_Draw; @@ -77,15 +77,15 @@ void EffectSsFcircle_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) if (actor != NULL) { if (actor->update != NULL) { - this->pos.x = actor->posRot.pos.x + this->vec.x; - this->pos.y = actor->posRot.pos.y + this->vec.y; - this->pos.z = actor->posRot.pos.z + this->vec.z; + this->pos.x = actor->world.pos.x + this->vec.x; + this->pos.y = actor->world.pos.y + this->vec.y; + this->pos.z = actor->world.pos.z + this->vec.z; this->rYaw = actor->shape.rot.y; - if (actor->dmgEffectTimer > 20) { + if (actor->colorFilterTimer > 20) { this->life = 20; } else { - this->life = actor->dmgEffectTimer; + this->life = actor->colorFilterTimer; } Math_StepToS(&this->rScale, 100, 20); diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c index 56f29f956c..0db7f20ffa 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c @@ -85,8 +85,8 @@ void EffectSsFireTail_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) this->vec = this->actor->velocity; if (this->rBodyPart < 0) { - Matrix_Translate(this->pos.x + this->actor->posRot.pos.x, this->pos.y + this->actor->posRot.pos.y, - this->pos.z + this->actor->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->pos.x + this->actor->world.pos.x, this->pos.y + this->actor->world.pos.y, + this->pos.z + this->actor->world.pos.z, MTXMODE_NEW); } else { Player* player = PLAYER; s16 bodyPart = this->rBodyPart; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c index 9613bbfdb7..122b190643 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c @@ -40,9 +40,9 @@ u32 EffectSsGSpk_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* if (initParams->updateMode == 0) { this->life = 10; - this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = initParams->pos.x - initParams->actor->world.pos.x; + this->vec.y = initParams->pos.y - initParams->actor->world.pos.y; + this->vec.z = initParams->pos.z - initParams->actor->world.pos.z; this->update = EffectSsGSpk_Update; } else { this->life = 5; @@ -114,10 +114,10 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { this->accel.z = (Rand_ZeroOne() - 0.5f) * 3.0f; if (this->actor != NULL) { - if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) { - this->pos.x = this->actor->posRot.pos.x + this->vec.x; - this->pos.y = this->actor->posRot.pos.y + this->vec.y; - this->pos.z = this->actor->posRot.pos.z + this->vec.z; + if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) { + this->pos.x = this->actor->world.pos.x + this->vec.x; + this->pos.y = this->actor->world.pos.y + this->vec.y; + this->pos.z = this->actor->world.pos.z + this->vec.z; } } @@ -133,9 +133,9 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { // with this update mode, the sparks dont move randomly in the xz plane, appearing to be on top of each other void EffectSsGSpk_UpdateNoAccel(GlobalContext* globalCtx, u32 index, EffectSs* this) { if (this->actor != NULL) { - if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) { - this->pos.x += (Math_SinS(this->actor->posRot.rot.y) * this->actor->speedXZ); - this->pos.z += (Math_CosS(this->actor->posRot.rot.y) * this->actor->speedXZ); + if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) { + this->pos.x += (Math_SinS(this->actor->world.rot.y) * this->actor->speedXZ); + this->pos.z += (Math_CosS(this->actor->world.rot.y) * this->actor->speedXZ); } } diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index a71735a9d2..6c3f1b378d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -124,7 +124,7 @@ void EffectSsHahen_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { this->rPitch += 55; this->rYaw += 10; - if ((this->pos.y <= player->actor.groundY) && (this->life < this->rMinLife)) { + if ((this->pos.y <= player->actor.floorHeight) && (this->life < this->rMinLife)) { this->life = 0; } diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c index c6dac726f2..8f5cd55ea4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c @@ -44,7 +44,7 @@ u32 EffectSsHitMark_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo this->pos = initParams->pos; this->gfx = SEGMENTED_TO_VIRTUAL(D_04021770); - if (initParams->type == 1) { + if (initParams->type == EFFECT_HITMARK_DUST) { this->life = 16; } else { this->life = 8; @@ -101,7 +101,7 @@ void EffectSsHitMark_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) { void EffectSsHitMark_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { s32 colorIdx; - if (this->rType == 1) { + if (this->rType == EFFECT_HITMARK_DUST) { this->rTexIdx = (15 - this->life) / 2; } else { this->rTexIdx = 7 - this->life; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index 92c0734c22..23a94b1472 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -10,4 +10,11 @@ typedef struct { /* 0x08 */ Vec3f pos; } EffectSsHitMarkInitParams; // size = 0x14 +typedef enum { + EFFECT_HITMARK_WHITE, + EFFECT_HITMARK_DUST, + EFFECT_HITMARK_RED, + EFFECT_HITMARK_METAL +} EffectSsHitmarkType; + #endif diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 5d4caec916..d795fc7be8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -352,7 +352,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) { if (this->rReg8 == 0) { if ((((this->rReg4 >> 4) & 1) * 0x10) == 0x10) { - if (this->pos.y <= (player->actor.groundY - ((this->rReg4 >> 2) & 3))) { + if (this->pos.y <= (player->actor.floorHeight - ((this->rReg4 >> 2) & 3))) { this->rReg9 = 0; this->rReg0 = 0; this->rReg4 &= ~0x60; @@ -362,7 +362,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) { this->rGravity = this->rReg9; } } else { - if (this->pos.y <= ((player->actor.groundY - ((this->rReg4 >> 2) & 3)) - 600.0f)) { + if (this->pos.y <= ((player->actor.floorHeight - ((this->rReg4 >> 2) & 3)) - 600.0f)) { this->life = 0; } } diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index bb79b0a561..2b0467a8ae 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -87,7 +87,7 @@ void EffectSsSibuki_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) s16 yaw; Player* player = PLAYER; - if (this->pos.y <= player->actor.groundY) { + if (this->pos.y <= player->actor.floorHeight) { this->life = 0; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index d03a35b442..61ee5e3701 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -39,9 +39,9 @@ void EffectSsSolderSrchBall_Update(GlobalContext* globalCtx, u32 index, EffectSs linkDetected = this->actor; - playerPosDiffX = player->actor.posRot.pos.x - this->pos.x; - playerPosDiffY = player->actor.posRot.pos.y - this->pos.y; - playerPosDiffZ = player->actor.posRot.pos.z - this->pos.z; + playerPosDiffX = player->actor.world.pos.x - this->pos.x; + playerPosDiffY = player->actor.world.pos.y - this->pos.y; + playerPosDiffZ = player->actor.world.pos.z - this->pos.z; if (!BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, 30.0f)) { if (sqrtf(SQ(playerPosDiffX) + SQ(playerPosDiffY) + SQ(playerPosDiffZ)) < 70.0f) { diff --git a/tools/Makefile b/tools/Makefile index 6289929501..cdb50552f3 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -7,7 +7,7 @@ all: $(PROGRAMS) cd ZAPD && $(MAKE) clean: - $(RM) $(PROGRAMS) + $(RM) $(PROGRAMS) $(addsuffix .exe,$(PROGRAMS)) $(RM) ZAPD/ZAPD.out # Need to clean the above line later... diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo index 0fe928caf7..3fbd6a6ddf 100644 --- a/tools/ZAPD/.gitrepo +++ b/tools/ZAPD/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/zeldaret/ZAPD.git branch = master - commit = 6e6ad445a69089b721bea75f6e43b23b14a553b6 - parent = cf6d96f133d98c6b69066c5ff195dc8a4d029444 + commit = 2e1174063f3ed6bcf929bc7093cd2d1b05f8518b + parent = d73976503126d10a82016f8f72fac4092dff1932 method = merge cmdver = 0.4.3 diff --git a/tools/ZAPD/ZAPD/Globals.cpp b/tools/ZAPD/ZAPD/Globals.cpp index 50eb17f2b2..16ecd4bc14 100644 --- a/tools/ZAPD/ZAPD/Globals.cpp +++ b/tools/ZAPD/ZAPD/Globals.cpp @@ -50,7 +50,7 @@ string Globals::FindSymbolSegRef(int segNumber, uint32_t symbolAddress) { if (string(child->Name()) == "File") { - ZFile* file = new ZFile(fileMode, child, "", "", true); + ZFile* file = new ZFile(fileMode, child, "", "", "", true); file->GeneratePlaceholderDeclarations(); segmentRefFiles[segNumber] = file; break; diff --git a/tools/ZAPD/ZAPD/Main.cpp b/tools/ZAPD/ZAPD/Main.cpp index fd6fd4cfb2..8d53c979e2 100644 --- a/tools/ZAPD/ZAPD/Main.cpp +++ b/tools/ZAPD/ZAPD/Main.cpp @@ -180,9 +180,7 @@ int NewMain(int argc, char* argv[]) } if (Globals::Instance->verbosity >= VERBOSITY_INFO) - { printf("ZAPD: Zelda Asset Processor For Decomp\n"); - } if (fileMode == ZFileMode::Build || fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile) { @@ -239,7 +237,7 @@ bool Parse(const std::string& xmlFilePath, const std::string& basePath, const st { if (string(child->Name()) == "File") { - ZFile* file = new ZFile(fileMode, child, basePath, outPath, false); + ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", false); Globals::Instance->files.push_back(file); } } diff --git a/tools/ZAPD/ZAPD/Overlays/ZOverlay.cpp b/tools/ZAPD/ZAPD/Overlays/ZOverlay.cpp index 2554cf6d35..006aa84395 100644 --- a/tools/ZAPD/ZAPD/Overlays/ZOverlay.cpp +++ b/tools/ZAPD/ZAPD/Overlays/ZOverlay.cpp @@ -216,6 +216,11 @@ string ZOverlay::GetSourceOutputCode(const std::string& prefix) return output; } +ZResourceType ZOverlay::GetResourceType() +{ + return ZResourceType::Overlay; +} + SectionType ZOverlay::GetSectionTypeFromStr(string sectionName) { if (sectionName == ".rel.text" || sectionName == ".text") diff --git a/tools/ZAPD/ZAPD/Overlays/ZOverlay.h b/tools/ZAPD/ZAPD/Overlays/ZOverlay.h index 880adcb295..03dba43c36 100644 --- a/tools/ZAPD/ZAPD/Overlays/ZOverlay.h +++ b/tools/ZAPD/ZAPD/Overlays/ZOverlay.h @@ -55,7 +55,8 @@ public: ZOverlay(std::string nName); ~ZOverlay(); static ZOverlay* FromBuild(std::string buildPath, std::string cfgFolderPath); - std::string GetSourceOutputCode(const std::string& prefix); + std::string GetSourceOutputCode(const std::string& prefix) override; + ZResourceType GetResourceType() override; private: std::vector entries; diff --git a/tools/ZAPD/ZAPD/ZAPD.vcxproj b/tools/ZAPD/ZAPD/ZAPD.vcxproj index 0a7ef483de..654159cb91 100644 --- a/tools/ZAPD/ZAPD/ZAPD.vcxproj +++ b/tools/ZAPD/ZAPD/ZAPD.vcxproj @@ -142,6 +142,7 @@ + @@ -181,6 +182,7 @@ + @@ -214,6 +216,7 @@ + @@ -254,6 +257,7 @@ + diff --git a/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters b/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters index 54f797eaf3..aee2be95fd 100644 --- a/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters +++ b/tools/ZAPD/ZAPD/ZAPD.vcxproj.filters @@ -195,6 +195,12 @@ Source Files\Z64 + + Source Files\Z64 + + + Source Files + @@ -410,6 +416,12 @@ Header Files + + Header Files\Z64 + + + Header Files\Z64 + diff --git a/tools/ZAPD/ZAPD/ZAnimation.cpp b/tools/ZAPD/ZAPD/ZAnimation.cpp index 3a70f0e6a3..f1fccf622e 100644 --- a/tools/ZAPD/ZAPD/ZAnimation.cpp +++ b/tools/ZAPD/ZAPD/ZAnimation.cpp @@ -46,6 +46,11 @@ string ZAnimation::GetSourceOutputCode(const std::string& prefix) return ""; } +ZResourceType ZAnimation::GetResourceType() +{ + return ZResourceType::Animation; +} + ZNormalAnimation::ZNormalAnimation() : ZAnimation() { rotationValues = vector(); diff --git a/tools/ZAPD/ZAPD/ZAnimation.h b/tools/ZAPD/ZAPD/ZAnimation.h index f13c8035f8..25c066a072 100644 --- a/tools/ZAPD/ZAPD/ZAnimation.h +++ b/tools/ZAPD/ZAPD/ZAnimation.h @@ -23,7 +23,8 @@ public: ZAnimation(); - std::string GetSourceOutputCode(const std::string& prefix); + std::string GetSourceOutputCode(const std::string& prefix) override; + ZResourceType GetResourceType() override; protected: virtual void ParseRawData(); @@ -43,7 +44,7 @@ public: ZNormalAnimation(); std::string GetSourceOutputCode(const std::string& prefix); - virtual int GetRawDataSize(); + int GetRawDataSize() override; static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex, const std::string& nRelPath); @@ -59,7 +60,7 @@ public: ZLinkAnimation(); std::string GetSourceOutputCode(const std::string& prefix); - virtual int GetRawDataSize(); + int GetRawDataSize() override; static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex, const std::string& nRelPath); diff --git a/tools/ZAPD/ZAPD/ZArray.cpp b/tools/ZAPD/ZAPD/ZArray.cpp new file mode 100644 index 0000000000..622aef5a5d --- /dev/null +++ b/tools/ZAPD/ZAPD/ZArray.cpp @@ -0,0 +1,73 @@ +#include "ZArray.h" +#include "ZFile.h" +#include "Globals.h" +#include "StringHelper.h" + +ZArray::ZArray() +{ + +} + +void ZArray::ParseXML(tinyxml2::XMLElement* reader) +{ + ZResource::ParseXML(reader); + + arrayCnt = reader->IntAttribute("Count", 0); + testFile = new ZFile(ZFileMode::Extract, reader, Globals::Instance->baseRomPath, "", parent->GetName(), true); +} + +// TODO: This is a bit hacky, but until we refactor how ZFile parses the XML, it'll have to do. +std::string ZArray::GetSourceOutputCode(const std::string& prefix) +{ + std::string output = ""; + + if (testFile->resources.size() <= 0) + { + throw StringHelper::Sprintf("Error! Array needs at least one sub-element.\n"); + } + + ZResource* res = testFile->resources[0]; + int resSize = res->GetRawDataSize(); + + if (!res->DoesSupportArray()) + { + throw StringHelper::Sprintf("Error! Resource %s does not support being wrapped in an array!\n", res->GetName().c_str()); + } + + for (int i = 0; i < arrayCnt; i++) + { + int childIndex = rawDataIndex + (i * resSize); + res->SetRawDataIndex(childIndex); + res->ParseRawData(); + std::string test = res->GetSourceOutputCode(""); + //output += " { " + testFile->declarations[childIndex]->text + " }"; + output += testFile->declarations[childIndex]->text; + + if (i < arrayCnt - 1) + output += ",\n"; + + int bp = 0; + } + + if (parent != nullptr) + parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), res->GetSourceTypeName(), name, arrayCnt, output); + + return ""; +} + +int ZArray::GetRawDataSize() +{ + return arrayCnt * testFile->resources[0]->GetRawDataSize(); +} + +ZArray* ZArray::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath, ZFile* nParent) +{ + ZArray* arr = new ZArray(); + arr->rawData = nRawData; + arr->rawDataIndex = rawDataIndex; + arr->parent = nParent; + arr->ParseXML(reader); + //arr->ParseRawData(); + + return arr; +} diff --git a/tools/ZAPD/ZAPD/ZArray.h b/tools/ZAPD/ZAPD/ZArray.h new file mode 100644 index 0000000000..8fd2565055 --- /dev/null +++ b/tools/ZAPD/ZAPD/ZArray.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include +#include "ZResource.h" +#include "tinyxml2.h" + +class ZArray : public ZResource +{ +public: + ZArray(); + + void ParseXML(tinyxml2::XMLElement* reader) override; + std::string GetSourceOutputCode(const std::string& prefix) override; + int GetRawDataSize() override; + + static ZArray* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath, ZFile* nParent); + +protected: + int arrayCnt; + ZFile* testFile; + + //void ParseRawData(const std::vector& data, const int offset); +}; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZBlob.cpp b/tools/ZAPD/ZAPD/ZBlob.cpp index 59c9f5bd99..edb0e34c9c 100644 --- a/tools/ZAPD/ZAPD/ZBlob.cpp +++ b/tools/ZAPD/ZAPD/ZBlob.cpp @@ -98,6 +98,11 @@ string ZBlob::GetExternalExtension() return "bin"; } +std::string ZBlob::GetSourceTypeName() +{ + return "u8"; +} + ZResourceType ZBlob::GetResourceType() { return ZResourceType::Blob; diff --git a/tools/ZAPD/ZAPD/ZBlob.h b/tools/ZAPD/ZAPD/ZBlob.h index 5150517371..bb51bb1ff5 100644 --- a/tools/ZAPD/ZAPD/ZBlob.h +++ b/tools/ZAPD/ZAPD/ZBlob.h @@ -11,12 +11,13 @@ public: static ZBlob* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, int rawDataIndex, std::string nRelPath); static ZBlob* BuildFromXML(tinyxml2::XMLElement* reader, const std::string& inFolder, bool readFile); static ZBlob* FromFile(const std::string& filePath); - std::string GetSourceOutputCode(const std::string& prefix); - std::string GetSourceOutputHeader(const std::string& prefix); - void Save(const std::string& outFolder); - bool IsExternalResource(); - std::string GetExternalExtension(); - ZResourceType GetResourceType(); + std::string GetSourceOutputCode(const std::string& prefix) override; + std::string GetSourceOutputHeader(const std::string& prefix) override; + void Save(const std::string& outFolder) override; + bool IsExternalResource() override; + std::string GetExternalExtension() override; + std::string GetSourceTypeName() override; + ZResourceType GetResourceType() override; private: ZBlob(); diff --git a/tools/ZAPD/ZAPD/ZCollision.cpp b/tools/ZAPD/ZAPD/ZCollision.cpp index 10aace8542..d6af196780 100644 --- a/tools/ZAPD/ZAPD/ZCollision.cpp +++ b/tools/ZAPD/ZAPD/ZCollision.cpp @@ -24,23 +24,23 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con absMaxZ = BitConverter::ToInt16BE(data, rawDataIndex + 10); numVerts = BitConverter::ToInt16BE(data, rawDataIndex + 12); - vtxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 16) & 0x00FFFFFF; + vtxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 16); numPolygons = BitConverter::ToInt16BE(data, rawDataIndex + 20); - polySegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 24) & 0x00FFFFFF; - polyTypeDefSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 28) & 0x00FFFFFF; - camDataSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 32) & 0x00FFFFFF; + polySegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 24); + polyTypeDefSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 28); + camDataSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 32); numWaterBoxes = BitConverter::ToInt16BE(data, rawDataIndex + 36); waterBoxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 40) & 0x00FFFFFF; // HOTSPOT for (int i = 0; i < numVerts; i++) - vertices.push_back(new VertexEntry(rawData, vtxSegmentOffset + (i * 6))); + vertices.push_back(new VertexEntry(rawData, SEG2FILESPACE(vtxSegmentOffset) + (i * 6))); // HOTSPOT for (int i = 0; i < numPolygons; i++) - polygons.push_back(new PolygonEntry(rawData, polySegmentOffset + (i * 16))); + polygons.push_back(new PolygonEntry(rawData, SEG2FILESPACE(polySegmentOffset) + (i * 16))); int highestPolyType = 0; @@ -53,7 +53,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con //if (highestPolyType > 0) { for (int i = 0; i < highestPolyType + 1; i++) - polygonTypes.push_back(BitConverter::ToUInt64BE(data, polyTypeDefSegmentOffset + (i * 8))); + polygonTypes.push_back(BitConverter::ToUInt64BE(data, SEG2FILESPACE(polyTypeDefSegmentOffset) + (i * 8))); } //else //{ @@ -64,7 +64,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con //} if (camDataSegmentOffset != 0) - camData = new CameraDataList(parent, prefix, rawData, camDataSegmentOffset, polyTypeDefSegmentOffset, polygonTypes.size()); + camData = new CameraDataList(parent, prefix, rawData, SEG2FILESPACE(camDataSegmentOffset), SEG2FILESPACE(polyTypeDefSegmentOffset), polygonTypes.size()); for (int i = 0; i < numWaterBoxes; i++) waterBoxes.push_back(new WaterBoxHeader(rawData, waterBoxSegmentOffset + (i * 16))); @@ -76,7 +76,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con { for (int i = 0; i < waterBoxes.size(); i++) { - sprintf(line, "\t{ %i, %i, %i, %i, %i, 0x%08X },\n", waterBoxes[i]->xMin, waterBoxes[i]->ySurface, waterBoxes[i]->zMin, waterBoxes[i]->xLength, waterBoxes[i]->zLength, waterBoxes[i]->properties); + sprintf(line, " { %i, %i, %i, %i, %i, 0x%08X },\n", waterBoxes[i]->xMin, waterBoxes[i]->ySurface, waterBoxes[i]->zMin, waterBoxes[i]->xLength, waterBoxes[i]->zLength, waterBoxes[i]->properties); declaration += line; } } @@ -91,27 +91,29 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con for (int i = 0; i < polygons.size(); i++) { - sprintf(line, "\t{ 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X }, // 0x%08X\n", + sprintf(line, " { 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X }, // 0x%08X\n", (uint16_t)polygons[i]->type, (uint16_t)polygons[i]->vtxA, (uint16_t)polygons[i]->vtxB, (uint16_t)polygons[i]->vtxC, - (uint16_t)polygons[i]->a, (uint16_t)polygons[i]->b, (uint16_t)polygons[i]->c, (uint16_t)polygons[i]->d, polySegmentOffset + (i * 16)); + (uint16_t)polygons[i]->a, (uint16_t)polygons[i]->b, (uint16_t)polygons[i]->c, (uint16_t)polygons[i]->d, SEG2FILESPACE(polySegmentOffset) + (i * 16)); declaration += line; } if (polySegmentOffset != 0) { - parent->AddDeclarationArray(polySegmentOffset, DeclarationAlignment::None, polygons.size() * 16, "CollisionPoly", StringHelper::Sprintf("%s_polygons_%08X", prefix.c_str(), polySegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(polySegmentOffset), DeclarationAlignment::None, polygons.size() * 16, "CollisionPoly", StringHelper::Sprintf("%s_polygons_%08X", prefix.c_str(), SEG2FILESPACE(polySegmentOffset)), 0, declaration); } } declaration = ""; for (int i = 0; i < polygonTypes.size(); i++) { - sprintf(line, "\t 0x%08lX, 0x%08lX, \n", polygonTypes[i] >> 32, polygonTypes[i] & 0xFFFFFFFF); - declaration += line; + declaration += StringHelper::Sprintf(" 0x%08lX, 0x%08lX,", polygonTypes[i] >> 32, polygonTypes[i] & 0xFFFFFFFF); + + if (i < polygonTypes.size() - 1) + declaration += "\n"; } if (polyTypeDefSegmentOffset != 0) - parent->AddDeclarationArray(polyTypeDefSegmentOffset, DeclarationAlignment::None, polygonTypes.size() * 8, - "u32", StringHelper::Sprintf("%s_polygonTypes_%08X", prefix.c_str(), polyTypeDefSegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(polyTypeDefSegmentOffset), DeclarationAlignment::None, polygonTypes.size() * 8, + "u32", StringHelper::Sprintf("%s_polygonTypes_%08X", prefix.c_str(), SEG2FILESPACE(polyTypeDefSegmentOffset)), 0, declaration); declaration = ""; @@ -121,14 +123,15 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con for (int i = 0; i < vertices.size(); i++) { + declaration += StringHelper::Sprintf(" { %i, %i, %i }, // 0x%08X", vertices[i]->x, vertices[i]->y, vertices[i]->z, SEG2FILESPACE(vtxSegmentOffset) + (i * 6)); - sprintf(line, "{ %i, %i, %i }, // 0x%08X\n", vertices[i]->x, vertices[i]->y, vertices[i]->z, vtxSegmentOffset + (i * 6)); - declaration += line; + if (i < vertices.size() - 1) + declaration += "\n"; } if (vtxSegmentOffset != 0) - parent->AddDeclarationArray(vtxSegmentOffset, DeclarationAlignment::None, vertices.size() * 6, - "Vec3s", StringHelper::Sprintf("%s_vtx_%08X", prefix.c_str(), vtxSegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(vtxSegmentOffset), DeclarationAlignment::None, vertices.size() * 6, + "Vec3s", StringHelper::Sprintf("%s_vtx_%08X", prefix.c_str(), SEG2FILESPACE(vtxSegmentOffset)), 0, declaration); declaration = ""; } @@ -144,9 +147,9 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con declaration += StringHelper::Sprintf("%i, %i, %i, %i, %i, %i, %i, %s_vtx_%08X, %i, %s_polygons_%08X, %s_polygonTypes_%08X, &%s_camDataList_%08X, %i, %s", absMinX, absMinY, absMinZ, absMaxX, absMaxY, absMaxZ, - numVerts, prefix.c_str(), vtxSegmentOffset, numPolygons, - prefix.c_str(), polySegmentOffset, prefix.c_str(), polyTypeDefSegmentOffset, - prefix.c_str(), camDataSegmentOffset, numWaterBoxes, waterBoxStr); + numVerts, prefix.c_str(), SEG2FILESPACE(vtxSegmentOffset), numPolygons, + prefix.c_str(), SEG2FILESPACE(polySegmentOffset), prefix.c_str(), SEG2FILESPACE(polyTypeDefSegmentOffset), + prefix.c_str(), SEG2FILESPACE(camDataSegmentOffset), numWaterBoxes, waterBoxStr); parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, DeclarationPadding::Pad16, 44, "CollisionHeader", StringHelper::Sprintf("%s", prefix.c_str(), rawDataIndex), declaration); @@ -164,6 +167,11 @@ ZCollisionHeader::~ZCollisionHeader() delete waterBox; } +ZResourceType ZCollisionHeader::GetResourceType() +{ + return ZResourceType::CollisionHeader; +} + ZCollisionHeader* ZCollisionHeader::ExtractFromXML(tinyxml2::XMLElement* reader, vector nRawData, int rawDataIndex) { ZCollisionHeader* col = new ZCollisionHeader(); @@ -250,7 +258,10 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix, const s else sprintf(camSegLine, "0x%08X", entries[i]->cameraPosDataSeg); - declaration += StringHelper::Sprintf("\t{ 0x%04X, %i, %s }, // 0x%08X\n", entries[i]->cameraSType, entries[i]->numData, camSegLine, rawDataIndex + (i * 8)); + declaration += StringHelper::Sprintf("\t{ 0x%04X, %i, %s },", entries[i]->cameraSType, entries[i]->numData, camSegLine, rawDataIndex + (i * 8)); + + if (i < entries.size() - 1) + declaration += "\n"; } parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, entries.size() * 8, "CamData", StringHelper::Sprintf("%s_camDataList_%08X", prefix.c_str(), rawDataIndex), entries.size(), declaration); diff --git a/tools/ZAPD/ZAPD/ZCollision.h b/tools/ZAPD/ZAPD/ZCollision.h index 83290ffd98..aa0279d9b3 100644 --- a/tools/ZAPD/ZAPD/ZCollision.h +++ b/tools/ZAPD/ZAPD/ZCollision.h @@ -67,11 +67,11 @@ public: int16_t absMinX, absMinY, absMinZ; int16_t absMaxX, absMaxY, absMaxZ; int16_t numVerts; - int32_t vtxSegmentOffset; + segptr_t vtxSegmentOffset; int16_t numPolygons; - int32_t polySegmentOffset; - int32_t polyTypeDefSegmentOffset; - int32_t camDataSegmentOffset; + segptr_t polySegmentOffset; + segptr_t polyTypeDefSegmentOffset; + segptr_t camDataSegmentOffset; int32_t numWaterBoxes; int32_t waterBoxSegmentOffset; @@ -87,5 +87,7 @@ public: ZCollisionHeader(ZFile* parent, const std::string& prefix, const std::vector& rawData, int rawDataIndex); ~ZCollisionHeader(); + ZResourceType GetResourceType() override; + static ZCollisionHeader* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex); }; diff --git a/tools/ZAPD/ZAPD/ZCutscene.cpp b/tools/ZAPD/ZAPD/ZCutscene.cpp index 983b0de722..80ebeffbb6 100644 --- a/tools/ZAPD/ZAPD/ZCutscene.cpp +++ b/tools/ZAPD/ZAPD/ZCutscene.cpp @@ -126,6 +126,21 @@ int ZCutscene::GetRawDataSize() return size; } +ZCutscene* ZCutscene::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath) +{ + ZCutscene* cs = new ZCutscene(nRawData, rawDataIndex, 9999); + cs->rawData = nRawData; + cs->rawDataIndex = rawDataIndex; + cs->ParseXML(reader); + cs->ParseRawData(); + + return cs; +} + +void ZCutscene::ParseRawData() +{ +} + CutsceneCommands ZCutscene::GetCommandFromID(int id) { switch (id) @@ -166,6 +181,11 @@ CutsceneCommands ZCutscene::GetCommandFromID(int id) return CutsceneCommands::Error; } +ZResourceType ZCutscene::GetResourceType() +{ + return ZResourceType::Cutscene; +} + CutsceneCommand::CutsceneCommand(const vector& rawData, int rawDataIndex) { diff --git a/tools/ZAPD/ZAPD/ZCutscene.h b/tools/ZAPD/ZAPD/ZCutscene.h index f054e499c7..bf26b90280 100644 --- a/tools/ZAPD/ZAPD/ZCutscene.h +++ b/tools/ZAPD/ZAPD/ZCutscene.h @@ -402,14 +402,20 @@ class ZCutscene : public ZResource public: uint32_t segmentOffset; - CutsceneCommands GetCommandFromID(int id); ZCutscene(std::vector nRawData, int rawDataIndex, int rawDataSize); ~ZCutscene(); - std::string GetSourceOutputCode(const std::string& prefix); - int GetRawDataSize(); -private: + std::string GetSourceOutputCode(const std::string& prefix) override; + int GetRawDataSize() override; + CutsceneCommands GetCommandFromID(int id); + + ZResourceType GetResourceType() override; + + static ZCutscene* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath); +protected: int numCommands; int endFrame; std::vector commands; + + void ParseRawData(); }; diff --git a/tools/ZAPD/ZAPD/ZDisplayList.cpp b/tools/ZAPD/ZAPD/ZDisplayList.cpp index aaf9e53f4a..f1f1eb3e61 100644 --- a/tools/ZAPD/ZAPD/ZDisplayList.cpp +++ b/tools/ZAPD/ZAPD/ZDisplayList.cpp @@ -165,7 +165,7 @@ int ZDisplayList::OptimizationCheck_LoadTextureBlock(int startIndex, string& out Declaration* texDecl = nullptr; - if (parent != nullptr) + if (parent != nullptr && segmentNumber != 2) // HACK: Until we have declarations use segment addresses, we'll exclude scene references... { texDecl = parent->GetDeclaration(texAddr); @@ -345,22 +345,20 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) dListDecl = parent->GetDeclaration(SEG2FILESPACE(data)); - // TEST - if (segNum != 8 && scene != nullptr && scene->parent->GetDeclarationName(data & 0x00FFFFFF) != "ERROR_COULD_NOT_FIND_DECLARATION") - { - int bp = 0; - } - if (pp != 0) { - if (dListDecl != nullptr) + if (!Globals::Instance->HasSegment(segNum)) + sprintf(line, "gsSPBranchList(0x%08lX),", data & 0xFFFFFFFF); + else if (dListDecl != nullptr) sprintf(line, "gsSPBranchList(%s),", dListDecl->varName.c_str()); else sprintf(line, "gsSPBranchList(%sDlist0x%06lX),", prefix.c_str(), SEG2FILESPACE(data)); } else { - if (dListDecl != nullptr) + if (!Globals::Instance->HasSegment(segNum)) + sprintf(line, "gsSPDisplayList(0x%08lX),", data & 0xFFFFFFFF); + else if (dListDecl != nullptr) sprintf(line, "gsSPDisplayList(%s),", dListDecl->varName.c_str()); else sprintf(line, "gsSPDisplayList(%sDlist0x%06lX),", prefix.c_str(), SEG2FILESPACE(data)); @@ -379,6 +377,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) { ZDisplayList* nList = new ZDisplayList(fileData, data & 0x00FFFFFF, GetDListLength(fileData, data & 0x00FFFFFF)); nList->scene = scene; + nList->parent = parent; otherDLists.push_back(nList); } } @@ -446,27 +445,55 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (GETSEGNUM(data) == 0x80) // Are these vertices defined in code? vtxAddr -= SEG2FILESPACE(parent->baseAddress); - sprintf(line, "gsSPVertex(%sVtx_%06X, %i, %i),", prefix.c_str(), vtxAddr, nn, ((aa >> 1) - nn)); + //sprintf(line, "gsSPVertex(%sVtx_%06X, %i, %i),", prefix.c_str(), vtxAddr, nn, ((aa >> 1) - nn)); + sprintf(line, "gsSPVertex(@r, %i, %i),", nn, ((aa >> 1) - nn)); + references.push_back(vtxAddr); { - uint32_t currentPtr = data & 0x00FFFFFF; + uint32_t currentPtr = SEG2FILESPACE(data); if (GETSEGNUM(data) == 0x80) // Are these vertices defined in code? currentPtr -= SEG2FILESPACE(parent->baseAddress); - vector vtxList = vector(); - - vtxList.reserve(nn); - - for (int i = 0; i < nn; i++) + // Check for vertex intersections from other display lists + // TODO: These two could probably be condenced to one... + if (parent->GetDeclarationRanged(vtxAddr + (nn * 16)) != nullptr) { - Vertex vtx = Vertex(fileData, currentPtr); - vtxList.push_back(vtx); - - currentPtr += 16; + Declaration* decl = parent->GetDeclarationRanged(vtxAddr + (nn * 16)); + uint32_t addr = parent->GetDeclarationRangedAddress(vtxAddr + (nn * 16)); + int diff = addr - vtxAddr; + if (diff > 0) + nn = diff / 16; + else + nn = 0; } - vertices[vtxAddr] = vtxList; + if (parent->GetDeclarationRanged(vtxAddr) != nullptr) + { + Declaration* decl = parent->GetDeclarationRanged(vtxAddr); + uint32_t addr = parent->GetDeclarationRangedAddress(vtxAddr); + int diff = addr - vtxAddr; + if (diff > 0) + nn = diff / 16; + else + nn = 0; + } + + if (nn > 0) + { + vector vtxList = vector(); + vtxList.reserve(nn); + + for (int i = 0; i < nn; i++) + { + Vertex vtx = Vertex(fileData, currentPtr); + vtxList.push_back(vtx); + + currentPtr += 16; + } + + vertices[vtxAddr] = vtxList; + } } } @@ -502,6 +529,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) int32_t texAddress = SEG2FILESPACE(data); Declaration* texDecl = nullptr; + if (segmentNumber == 0x80) // Is this texture defined in code? + texAddress -= SEG2FILESPACE(parent->baseAddress); + if (parent != nullptr) { if (Globals::Instance->HasSegment(segmentNumber)) @@ -523,11 +553,13 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) //} //else { - sprintf(texStr, "0x%08lX", data); + sprintf(texStr, "0x%08lX", data & 0xFFFFFFFF); } } sprintf(line, "gsDPSetTextureImage(%s, %s, %i, %s),", fmtTbl[fmt].c_str(), sizTbl[siz].c_str(), www + 1, texStr); + //sprintf(line, "gsDPSetTextureImage(%s, %s, %i, @r),", fmtTbl[fmt].c_str(), sizTbl[siz].c_str(), www + 1); + //references.push_back(data & 0x00FFFFFF); } else { @@ -1002,6 +1034,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) ZDisplayList* nList = new ZDisplayList(fileData, h & 0x00FFFFFF, GetDListLength(fileData, h & 0x00FFFFFF)); nList->scene = scene; + nList->parent = parent; otherDLists.push_back(nList); i++; @@ -1056,9 +1089,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vector>> verticesSorted(vertices.begin(), vertices.end()); sort(verticesSorted.begin(), verticesSorted.end(), [](const auto& lhs, const auto& rhs) - { - return lhs.first < rhs.first; - }); + { + return lhs.first < rhs.first; + }); for (int i = 0; i < verticesSorted.size() - 1; i++) { @@ -1075,7 +1108,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vertices[verticesSorted[i].first].push_back(verticesSorted[i + 1].second[j]); } - defines += StringHelper::Sprintf("#define %sVtx_%06X ((u32)%sVtx_%06X + 0x%06X)\n", prefix.c_str(), verticesSorted[i + 1].first, prefix.c_str(), verticesSorted[i].first, verticesSorted[i + 1].first - verticesSorted[i].first); + //defines += StringHelper::Sprintf("#define %sVtx_%06X ((u32)%sVtx_%06X + 0x%06X)\n", prefix.c_str(), verticesSorted[i + 1].first, prefix.c_str(), verticesSorted[i].first, verticesSorted[i + 1].first - verticesSorted[i].first); int nSize = (int)vertices[verticesSorted[i].first].size(); @@ -1111,10 +1144,11 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) { - parent->AddDeclarationArray(item.first, DeclarationAlignment::None, item.second.size() * 16, "static Vtx", + parent->AddDeclarationArray(item.first, DeclarationAlignment::None, item.second.size() * 16, "static Vtx", StringHelper::Sprintf("%sVtx_%06X", prefix.c_str(), item.first, item.second.size()), item.second.size(), declaration); } } + } // Check for texture intersections { @@ -1153,9 +1187,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vector> texturesSorted(textures.begin(), textures.end()); sort(texturesSorted.begin(), texturesSorted.end(), [](const auto& lhs, const auto& rhs) - { - return lhs.first < rhs.first; - }); + { + return lhs.first < rhs.first; + }); for (int i = 0; i < texturesSorted.size() - 1; i++) { @@ -1163,15 +1197,15 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) break; int texSize = textures[texturesSorted[i].first]->GetRawDataSize(); - + if ((texturesSorted[i].first + texSize) > texturesSorted[i + 1].first) { int intersectAmt = (texturesSorted[i].first + texSize) - texturesSorted[i + 1].first; - + // If we're working with a palette, resize it to its "real" dimensions if (texturesSorted[i].second->isPalette) { - texturesSorted[i].second->SetWidth(intersectAmt / 2); + texturesSorted[i].second->SetWidth((texturesSorted[i + 1].first - texturesSorted[i].first) / 2); texturesSorted[i].second->SetHeight(1); } else @@ -1187,7 +1221,6 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) } } } - } // Generate Texture Declarations for (pair item : textures) @@ -1218,7 +1251,8 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) { - parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), "Gfx", StringHelper::Sprintf("%s", name.c_str()), 0, sourceOutput); + Declaration* decl = parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), "Gfx", StringHelper::Sprintf("%s", name.c_str()), 0, sourceOutput); + decl->references = references; return ""; } @@ -1244,7 +1278,7 @@ bool ZDisplayList::TextureGenCheck(vector fileData, mapverbosity >= VERBOSITY_DEBUG) printf("TextureGenCheck seg=%i width=%i height=%i ispal=%i addr=0x%06X\n", segmentNumber, texWidth, texHeight, texIsPalette, texAddr); - if (texAddr != 0 && texWidth != 0 && texHeight != 0 && texLoaded && Globals::Instance->HasSegment(segmentNumber)) + if ((texSeg != 0 || texAddr != 0) && texWidth != 0 && texHeight != 0 && texLoaded && Globals::Instance->HasSegment(segmentNumber)) { if (segmentNumber != 2) // Not from a scene file { @@ -1333,6 +1367,11 @@ void ZDisplayList::GenerateHLIntermediette(HLFileIntermediette& hlFile) mdl->blocks.push_back(new HLTerminator()); } +ZResourceType ZDisplayList::GetResourceType() +{ + return ZResourceType::DisplayList; +} + vector ZDisplayList::GetRawData() { return rawData; diff --git a/tools/ZAPD/ZAPD/ZDisplayList.h b/tools/ZAPD/ZAPD/ZDisplayList.h index cb8a75f111..dcfe6bb39d 100644 --- a/tools/ZAPD/ZAPD/ZDisplayList.h +++ b/tools/ZAPD/ZAPD/ZDisplayList.h @@ -214,14 +214,12 @@ public: class ZDisplayList : public ZResource { protected: - // Test uint32_t lastTexWidth, lastTexHeight, lastTexAddr, lastTexSeg; F3DZEXTexFormats lastTexFmt; F3DZEXTexSizes lastTexSiz, lastTexSizTest, lastCISiz; bool lastTexLoaded; bool lastTexIsPalette; - //void ParseXML(tinyxml2::XMLElement* reader); static TextureType TexFormatToTexType(F3DZEXTexFormats fmt, F3DZEXTexSizes siz); void ParseRawData(); @@ -244,6 +242,8 @@ public: std::map textures; std::map texDeclarations; + std::vector references; + std::string defines; // Hack for special cases where vertex arrays intersect... std::vector fileData; @@ -258,9 +258,11 @@ public: static int GetDListLength(std::vector rawData, int rawDataIndex); std::vector GetRawData(); - int GetRawDataSize(); - std::string GetSourceOutputHeader(const std::string& prefix); - std::string GetSourceOutputCode(const std::string& prefix); - void Save(const std::string& outFolder); - virtual void GenerateHLIntermediette(HLFileIntermediette& hlFile); + int GetRawDataSize() override; + std::string GetSourceOutputHeader(const std::string& prefix) override; + std::string GetSourceOutputCode(const std::string& prefix) override; + void Save(const std::string& outFolder) override; + virtual void GenerateHLIntermediette(HLFileIntermediette& hlFile) override; + + ZResourceType GetResourceType() override; }; diff --git a/tools/ZAPD/ZAPD/ZFile.cpp b/tools/ZAPD/ZAPD/ZFile.cpp index 0c48d6bf16..aaee5b60fe 100644 --- a/tools/ZAPD/ZAPD/ZFile.cpp +++ b/tools/ZAPD/ZAPD/ZFile.cpp @@ -8,6 +8,9 @@ #include "ZCollision.h" #include "ZScalar.h" #include "ZVector.h" +#include "ZVtx.h" +#include "ZCutscene.h" +#include "ZArray.h" #include "Path.h" #include "File.h" #include "Directory.h" @@ -37,7 +40,7 @@ ZFile::ZFile(string nOutPath, string nName) : ZFile() name = nName; } -ZFile::ZFile(ZFileMode mode, XMLElement* reader, string nBasePath, string nOutPath, bool placeholderMode) : ZFile() +ZFile::ZFile(ZFileMode mode, XMLElement* reader, string nBasePath, string nOutPath, std::string filename, bool placeholderMode) : ZFile() { if (nBasePath == "") basePath = Directory::GetCurrentDirectory(); @@ -49,7 +52,7 @@ ZFile::ZFile(ZFileMode mode, XMLElement* reader, string nBasePath, string nOutPa else outputPath = nOutPath; - ParseXML(mode, reader, placeholderMode); + ParseXML(mode, reader, filename, placeholderMode); } ZFile::~ZFile() @@ -58,9 +61,13 @@ ZFile::~ZFile() delete res; } -void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, bool placeholderMode) +void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, std::string filename, bool placeholderMode) { - name = reader->Attribute("Name"); + if (filename == "") + name = reader->Attribute("Name"); + else + name = filename; + int segment = -1; if (reader->Attribute("BaseAddress") != NULL) @@ -288,10 +295,58 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, bool placeholderMode) printf("No ZVector created!!"); } } + else if (string(child->Name()) == "Vtx") + { + ZVtx* vtx = nullptr; + + if (mode == ZFileMode::Extract) + vtx = ZVtx::ExtractFromXML(child, rawData, rawDataIndex, folderName); + + if (vtx != nullptr) + { + vtx->parent = this; + resources.push_back(vtx); + + rawDataIndex += vtx->GetRawDataSize(); + } + else + { + if (Globals::Instance->verbosity >= VERBOSITY_DEBUG) + printf("No ZVtx created!!"); + } + } + else if (string(child->Name()) == "Cutscene") + { + ZCutscene* cs = nullptr; + + if (mode == ZFileMode::Extract) + cs = ZCutscene::ExtractFromXML(child, rawData, rawDataIndex, folderName); + + if (cs != nullptr) + { + cs->parent = this; + resources.push_back(cs); + rawDataIndex += cs->GetRawDataSize(); + } + } + else if (string(child->Name()) == "Array") + { + ZArray* array = nullptr; + + if (mode == ZFileMode::Extract) + array = ZArray::ExtractFromXML(child, rawData, rawDataIndex, folderName, this); + + if (array != nullptr) + { + resources.push_back(array); + rawDataIndex += array->GetRawDataSize(); + } + } else { - if (Globals::Instance->verbosity >= VERBOSITY_DEBUG) - printf("Encountered unknown resource type: %s\n", string(child->Name()).c_str()); + std::cerr << "ERROR bad type\n"; + printf("Encountered unknown resource type: %s on line: %d\n", child->Name(), child->GetLineNum()); + std::exit(EXIT_FAILURE); } } } @@ -344,6 +399,11 @@ std::string ZFile::GetVarName(int address) return ""; } +std::string ZFile::GetName() +{ + return name; +} + void ZFile::ExtractResources(string outputDir) { string folderName = Path::GetFileNameWithoutExtension(outputPath); @@ -394,7 +454,7 @@ Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignm return decl; } -void ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, std::string body) +Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -406,9 +466,10 @@ void ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, Dec AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, padding, size, varType, varName, false, body); + return declarations[address]; } -void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body) +Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -420,10 +481,11 @@ void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, size, varType, varName, true, arrayItemCnt, body); + return declarations[address]; } -void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, int arrayItemCnt, std::string body) +Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, int arrayItemCnt, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -435,34 +497,41 @@ void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, padding, size, varType, varName, true, arrayItemCnt, body); + return declarations[address]; } -void ZFile::AddDeclarationPlaceholder(uint32_t address) +Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(DeclarationAlignment::None, 0, "", "", false, ""); + + return declarations[address]; } -void ZFile::AddDeclarationPlaceholder(uint32_t address, string varName) +Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address, string varName) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(DeclarationAlignment::None, 0, "", varName, false, ""); + + return declarations[address]; } -void ZFile::AddDeclarationInclude(uint32_t address, string includePath, uint32_t size, string varType, string varName) +Declaration* ZFile::AddDeclarationInclude(uint32_t address, string includePath, uint32_t size, string varType, string varName) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(includePath, size, varType, varName); + + return declarations[address]; } -void ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt) +Declaration* ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -479,12 +548,13 @@ void ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath decl->arrayItemCnt = arrayItemCnt; declarations[address] = decl; + return declarations[address]; } void ZFile::AddDeclarationDebugChecks(uint32_t address) { #ifdef _DEBUG - if (address == 0xB888E0) + if (address == 0x5600) { int bp = 0; } @@ -516,15 +586,24 @@ Declaration* ZFile::GetDeclarationRanged(uint32_t address) { for (const auto decl : declarations) { - if (address >= decl.first && address <= decl.first + decl.second->size) - { + if (address >= decl.first && address < decl.first + decl.second->size) return decl.second; - } } return nullptr; } +uint32_t ZFile::GetDeclarationRangedAddress(uint32_t address) +{ + for (const auto decl : declarations) + { + if (address >= decl.first && address < decl.first + decl.second->size) + return decl.first; + } + + return 0xFFFFFFFF; +} + bool ZFile::HasDeclaration(uint32_t address) { return (declarations.find(address) != declarations.end()); @@ -661,6 +740,41 @@ string ZFile::ProcessDeclarations() //printf("RANGE START: 0x%06X - RANGE END: 0x%06X\n", rangeStart, rangeEnd); + // Optimization: See if there are any arrays side by side that can be merged... + //pair lastItem = declarationKeysSorted[0]; + + //for (int i = 1; i < declarationKeysSorted.size(); i++) + //{ + // pair curItem = declarationKeysSorted[i]; + + // if (curItem.second->isArray && lastItem.second->isArray) + // { + // if (curItem.second->varType == lastItem.second->varType) + // { + // // TEST: For now just do Vtx declarations... + // if (lastItem.second->varType == "static Vtx") + // { + // lastItem.second->size += curItem.second->size; + // lastItem.second->arrayItemCnt += curItem.second->arrayItemCnt; + // lastItem.second->text += "\n" + curItem.second->text; + // declarations.erase(curItem.first); + // declarationKeysSorted.erase(declarationKeysSorted.begin() + i); + // i--; + // continue; + + // int bp = 0; + // } + // } + // } + + // lastItem = curItem; + //} + + for (pair item : declarations) + { + ProcessDeclarationText(item.second); + } + for (pair item : declarationKeysSorted) { while (declarations[item.first]->size % 4 != 0) @@ -756,7 +870,7 @@ string ZFile::ProcessDeclarations() uint8_t* rawDataArr = rawData.data(); - if (lastAddr + lastSize != item.first) + if (lastAddr + lastSize != item.first && lastAddr >= rangeStart && lastAddr + lastSize < rangeEnd) { //int diff = item.first - (lastAddr + declarations[lastAddr]->size); int diff = item.first - (lastAddr + lastSize); @@ -887,6 +1001,44 @@ string ZFile::ProcessDeclarations() return output; } +void ZFile::ProcessDeclarationText(Declaration* decl) +{ + int refIndex = 0; + + if (decl->references.size() > 0) + { + for (int i = 0; i < decl->text.size() - 1; i++) + { + char c = decl->text[i]; + char c2 = decl->text[i + 1]; + + if (c == '@' && c2 == 'r') + { + Declaration* refDecl = GetDeclarationRanged(decl->references[refIndex]); + uint32_t refDeclAddr = GetDeclarationRangedAddress(decl->references[refIndex]); + + if (refDecl != nullptr) + { + if (refDecl->isArray) + { + int itemSize = refDecl->size / refDecl->arrayItemCnt; + int itemIndex = (decl->references[refIndex] - refDeclAddr) / itemSize; + + decl->text.replace(i, 2, StringHelper::Sprintf("&%s[%i]", refDecl->varName.c_str(), itemIndex)); + } + else + { + decl->text.replace(i, 2, refDecl->varName); + } + } + else + decl->text.replace(i, 2, "ERROR"); + + refIndex++; + } + } + } +} string ZFile::ProcessExterns() { diff --git a/tools/ZAPD/ZAPD/ZFile.h b/tools/ZAPD/ZAPD/ZFile.h index 68b34dd8d0..89cb02c96d 100644 --- a/tools/ZAPD/ZAPD/ZFile.h +++ b/tools/ZAPD/ZAPD/ZFile.h @@ -27,27 +27,29 @@ public: uint32_t baseAddress, rangeStart, rangeEnd; ZFile(std::string nOutPath, std::string nName); - ZFile(ZFileMode mode, tinyxml2::XMLElement* reader, std::string nBasePath, std::string nOutPath, bool placeholderMode); + ZFile(ZFileMode mode, tinyxml2::XMLElement* reader, std::string nBasePath, std::string nOutPath, std::string filename, bool placeholderMode); ~ZFile(); std::string GetVarName(int address); + std::string GetName(); void ExtractResources(std::string outputDir); void BuildResources(); void BuildSourceFile(std::string outputDir); void AddResource(ZResource* res); Declaration* AddDeclaration(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, std::string body); - void AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, std::string body); - void AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); - void AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); - void AddDeclarationPlaceholder(uint32_t address); - void AddDeclarationPlaceholder(uint32_t address, std::string varName); - void AddDeclarationInclude(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName); - void AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt); + Declaration* AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, std::string body); + Declaration* AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); + Declaration* AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); + Declaration* AddDeclarationPlaceholder(uint32_t address); + Declaration* AddDeclarationPlaceholder(uint32_t address, std::string varName); + Declaration* AddDeclarationInclude(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName); + Declaration* AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt); std::string GetDeclarationName(uint32_t address); std::string GetDeclarationName(uint32_t address, std::string defaultResult); Declaration* GetDeclaration(uint32_t address); Declaration* GetDeclarationRanged(uint32_t address); + uint32_t GetDeclarationRangedAddress(uint32_t address); bool HasDeclaration(uint32_t address); std::string GetHeaderInclude(); void GeneratePlaceholderDeclarations(); @@ -60,10 +62,11 @@ protected: std::string sourceOutput; ZFile(); - void ParseXML(ZFileMode mode, tinyxml2::XMLElement* reader, bool placeholderMode); + void ParseXML(ZFileMode mode, tinyxml2::XMLElement* reader, std::string filename, bool placeholderMode); void GenerateSourceFiles(std::string outputDir); void GenerateHLIntermediette(); void AddDeclarationDebugChecks(uint32_t address); std::string ProcessDeclarations(); + void ProcessDeclarationText(Declaration* decl); std::string ProcessExterns(); }; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZResource.cpp b/tools/ZAPD/ZAPD/ZResource.cpp index efacafc8ab..153821207c 100644 --- a/tools/ZAPD/ZAPD/ZResource.cpp +++ b/tools/ZAPD/ZAPD/ZResource.cpp @@ -12,7 +12,6 @@ ZResource::ZResource() rawData = vector(); rawDataIndex = 0; outputDeclaration = true; - arrayCnt = -1; } void ZResource::ParseXML(tinyxml2::XMLElement* reader) @@ -54,6 +53,11 @@ bool ZResource::IsExternalResource() return false; } +bool ZResource::DoesSupportArray() +{ + return false; +} + std::string ZResource::GetExternalExtension() { return ""; @@ -94,11 +98,20 @@ string ZResource::GetSourceOutputHeader(const std::string& prefix) return ""; } +void ZResource::ParseRawData() +{ +} + void ZResource::GenerateHLIntermediette(HLFileIntermediette& hlFile) { } +std::string ZResource::GetSourceTypeName() +{ + return ""; +} + ZResourceType ZResource::GetResourceType() { return ZResourceType::Error; diff --git a/tools/ZAPD/ZAPD/ZResource.h b/tools/ZAPD/ZAPD/ZResource.h index c786339d9d..02921969fd 100644 --- a/tools/ZAPD/ZAPD/ZResource.h +++ b/tools/ZAPD/ZAPD/ZResource.h @@ -16,6 +16,8 @@ #define SEG2FILESPACE(x) (x & 0x00FFFFFF) #define GETSEGNUM(x) ((x >> 24) & 0xFF) +typedef uint32_t segptr_t; + class ZFile; class HLFileIntermediette; @@ -35,7 +37,9 @@ enum class ZResourceType Limb, Skeleton, Scalar, - Vector + Vector, + Vertex, + CollisionHeader }; class ZResource @@ -43,7 +47,6 @@ class ZResource public: ZFile* parent; bool outputDeclaration; - int arrayCnt; ZResource(); virtual void ParseXML(tinyxml2::XMLElement* reader); @@ -55,13 +58,16 @@ public: std::string GetRelativePath(); virtual std::vector GetRawData(); virtual bool IsExternalResource(); + virtual bool DoesSupportArray(); // Can this type be wrapped in an node? virtual std::string GetExternalExtension(); virtual int GetRawDataIndex(); virtual int GetRawDataSize(); virtual void SetRawDataIndex(int value); virtual std::string GetSourceOutputCode(const std::string& prefix); virtual std::string GetSourceOutputHeader(const std::string& prefix); + virtual void ParseRawData(); virtual void GenerateHLIntermediette(HLFileIntermediette& hlFile); + virtual std::string GetSourceTypeName(); virtual ZResourceType GetResourceType(); virtual void CalcHash(); @@ -108,6 +114,7 @@ public: std::string includePath; bool isArray; int arrayItemCnt; + std::vector references; Declaration(DeclarationAlignment nAlignment, uint32_t nSize, std::string nVarType, std::string nVarName, bool nIsArray, std::string nText); Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPadding, uint32_t nSize, std::string nVarType, std::string nVarName, bool nIsArray, std::string nText); diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp index b0c2f58a82..1f343c64ff 100644 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp +++ b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp @@ -47,6 +47,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr)); entry->opaqueDList->scene = zRoom->scene; + entry->opaqueDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->opaqueDList); } @@ -54,6 +55,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr)); entry->translucentDList->scene = zRoom->scene; + entry->translucentDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->translucentDList); } @@ -206,6 +208,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr)); entry->opaqueDList->scene = zRoom->scene; + entry->opaqueDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->opaqueDList); // HOTSPOT } @@ -213,6 +216,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr)); entry->translucentDList->scene = zRoom->scene; + entry->translucentDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->translucentDList); // HOTSPOT } @@ -291,16 +295,17 @@ SetMesh::~SetMesh() void SetMesh::GenDListDeclarations(std::vector rawData, ZDisplayList* dList) { - string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT - string srcVarName = ""; - if (Globals::Instance->includeFilePrefix) + //if (Globals::Instance->includeFilePrefix) srcVarName = StringHelper::Sprintf("%s%s", zRoom->GetName().c_str(), dList->GetName().c_str()); - else - srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str()); + //else + //srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str()); - zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput); + dList->SetName(srcVarName); + string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT + + //zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput); for (ZDisplayList* otherDList : dList->otherDLists) GenDListDeclarations(rawData, otherDList); @@ -324,7 +329,7 @@ void SetMesh::GenDListDeclarations(std::vector rawData, ZDisplayList* d zRoom->parent->AddDeclarationIncludeArray(texEntry.first, StringHelper::Sprintf("%s/%s.%s.inc.c", Globals::Instance->outputPath.c_str(), Path::GetFileNameWithoutExtension(zRoom->textures[texEntry.first]->GetName()).c_str(), zRoom->textures[texEntry.first]->GetExternalExtension().c_str()), - zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%sTex_%06X", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); + zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); } } diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp b/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp index 95d9fff027..dafc8109da 100644 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp +++ b/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp @@ -81,8 +81,10 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r for (XMLElement* child = reader->FirstChildElement(); child != NULL; child = child->NextSiblingElement()) { + // TODO: Bunch of repeated code between all of these that needs to be combined. if (string(child->Name()) == "DListHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -92,11 +94,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r int address = strtol(StringHelper::Split(addressStr, "0x")[1].c_str(), NULL, 16); ZDisplayList* dList = new ZDisplayList(room->rawData, address, ZDisplayList::GetDListLength(room->rawData, address)); - dList->GetSourceOutputCode(room->name); + + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = room->name; + + dList->GetSourceOutputCode(name); delete dList; } else if (string(child->Name()) == "BlobHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -109,10 +118,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r int size = strtol(StringHelper::Split(sizeStr, "0x")[1].c_str(), NULL, 16); ZBlob* blob = new ZBlob(room->rawData, address, size, StringHelper::Sprintf("%sBlob0x%06X", room->name.c_str(), address)); - room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str()), 0, blob->GetSourceOutputCode(room->name)); + + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str()); + + room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", name, 0, blob->GetSourceOutputCode(room->name)); + delete blob; } else if (string(child->Name()) == "CutsceneHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -123,11 +140,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r ZCutscene* cutscene = new ZCutscene(room->rawData, address, 9999); + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset); + room->parent->AddDeclarationArray(address, DeclarationAlignment::None, DeclarationPadding::Pad16, cutscene->GetRawDataSize(), "s32", - StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset), 0, cutscene->GetSourceOutputCode(room->name)); + name, 0, cutscene->GetSourceOutputCode(room->name)); + delete cutscene; } else if (string(child->Name()) == "AltHeaderHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -180,6 +204,7 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r ZTexture* tex = ZTexture::FromBinary(ZTexture::GetTextureTypeFromString(typeStr), room->rawData, address, StringHelper::Sprintf("%sTex_%06X", room->name.c_str(), address), width, height); room->parent->AddDeclarationArray(address, DeclarationAlignment::None, tex->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", tex->GetName().c_str()), 0, tex->GetSourceOutputCode(room->name)); + delete tex; } } @@ -533,6 +558,7 @@ Declaration::Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPa isArray = false; arrayItemCnt = 0; includePath = ""; + references = vector(); } Declaration::Declaration(DeclarationAlignment nAlignment, uint32_t nSize, string nVarType, string nVarName, bool nIsArray, string nText) : Declaration(nAlignment, DeclarationPadding::None, nSize, nText) diff --git a/tools/ZAPD/ZAPD/ZScalar.cpp b/tools/ZAPD/ZAPD/ZScalar.cpp index b96d5fed49..10866f1ef4 100644 --- a/tools/ZAPD/ZAPD/ZScalar.cpp +++ b/tools/ZAPD/ZAPD/ZScalar.cpp @@ -31,13 +31,12 @@ void ZScalar::ParseXML(tinyxml2::XMLElement* reader) { ZResource::ParseXML(reader); - name = reader->Attribute("Name"); - std::string type = reader->Attribute("Type"); scalarType = ZScalar::MapOutputTypeToScalarType(type); } -ZScalarType ZScalar::MapOutputTypeToScalarType(const std::string& type) { +ZScalarType ZScalar::MapOutputTypeToScalarType(const std::string& type) +{ if (type == "s8") { return ZSCALAR_S8; @@ -228,4 +227,9 @@ std::string ZScalar::GetSourceOutputCode(const std::string& prefix) ZResourceType ZScalar::GetResourceType() { return ZResourceType::Scalar; -} \ No newline at end of file +} + +bool ZScalar::DoesSupportArray() +{ + return true; +} diff --git a/tools/ZAPD/ZAPD/ZScalar.h b/tools/ZAPD/ZAPD/ZScalar.h index 0e49f4e516..26e6a9d8dc 100644 --- a/tools/ZAPD/ZAPD/ZScalar.h +++ b/tools/ZAPD/ZAPD/ZScalar.h @@ -43,12 +43,14 @@ public: ZScalar(); ZScalar(const ZScalarType scalarType); - void ParseXML(tinyxml2::XMLElement* reader); - std::string GetSourceTypeName(); + void ParseXML(tinyxml2::XMLElement* reader) override; + std::string GetSourceTypeName() override; std::string GetSourceValue(); - std::string GetSourceOutputCode(const std::string& prefix); - int GetRawDataSize(); - ZResourceType GetResourceType(); + std::string GetSourceOutputCode(const std::string& prefix) override; + int GetRawDataSize() override; + ZResourceType GetResourceType() override; + bool DoesSupportArray() override; + void ParseRawData() override; static ZScalar* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath); static int MapTypeToSize(const ZScalarType scalarType); @@ -56,6 +58,5 @@ public: static std::string MapScalarTypeToOutputType(const ZScalarType scalarType); protected: - void ParseRawData(); void ParseRawData(const std::vector& data, const int offset); }; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZSkeleton.cpp b/tools/ZAPD/ZAPD/ZSkeleton.cpp index d6234d8f9f..f09198f4ed 100644 --- a/tools/ZAPD/ZAPD/ZSkeleton.cpp +++ b/tools/ZAPD/ZAPD/ZSkeleton.cpp @@ -264,6 +264,11 @@ void ZSkeleton::Save(const std::string& outFolder) } +ZResourceType ZSkeleton::GetResourceType() +{ + return ZResourceType::Skeleton; +} + ZLimbLOD::ZLimbLOD() : ZLimbStandard() { farDListPtr = 0; diff --git a/tools/ZAPD/ZAPD/ZSkeleton.h b/tools/ZAPD/ZAPD/ZSkeleton.h index 345469ab45..836251a606 100644 --- a/tools/ZAPD/ZAPD/ZSkeleton.h +++ b/tools/ZAPD/ZAPD/ZSkeleton.h @@ -25,8 +25,8 @@ struct ZLimbStandard : public ZResource ZLimbStandard(); static ZLimbStandard* FromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex, std::string nRelPath, ZFile* parent); static ZLimbStandard* FromRawData(std::vector nRawData, int rawDataIndex); - std::string GetSourceOutputCode(const std::string& prefix); - virtual int GetRawDataSize(); + std::string GetSourceOutputCode(const std::string& prefix) override; + int GetRawDataSize() override; }; struct ZLimbLOD : ZLimbStandard @@ -36,8 +36,8 @@ struct ZLimbLOD : ZLimbStandard ZLimbLOD(); //static ZLimbLOD* FromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex, std::string nRelPath, ZFile* parent); static ZLimbLOD* FromRawData(std::vector nRawData, int rawDataIndex); - std::string GetSourceOutputCode(const std::string& prefix); - virtual int GetRawDataSize(); + std::string GetSourceOutputCode(const std::string& prefix) override; + int GetRawDataSize() override; }; enum ZSkeletonType @@ -58,7 +58,8 @@ public: ZSkeleton(); virtual void GenerateHLIntermediette(HLFileIntermediette& hlFile); static ZSkeleton* FromXML(tinyxml2::XMLElement* reader, std::vector nRawData, int rawDataIndex, std::string nRelPath, ZFile* nParent); - void Save(const std::string& outFolder); + void Save(const std::string& outFolder) override; + ZResourceType GetResourceType() override; - std::string GetSourceOutputCode(const std::string& prefix); + std::string GetSourceOutputCode(const std::string& prefix) override; }; diff --git a/tools/ZAPD/ZAPD/ZTexture.h b/tools/ZAPD/ZAPD/ZTexture.h index 1e84d47685..faf7d68fdc 100644 --- a/tools/ZAPD/ZAPD/ZTexture.h +++ b/tools/ZAPD/ZAPD/ZTexture.h @@ -29,7 +29,7 @@ protected: uint8_t* bmpRgb; uint8_t* bmpRgba; - virtual void ParseXML(tinyxml2::XMLElement* reader); + void ParseXML(tinyxml2::XMLElement* reader) override; void FixRawData(); void PrepareBitmap(); void PrepareBitmapRGBA16(); @@ -52,9 +52,9 @@ protected: void PrepareRawDataPalette4(std::string palPath); void PrepareRawDataPalette8(std::string palPath); float GetPixelMultiplyer(); - bool IsExternalResource(); - ZResourceType GetResourceType(); - void CalcHash(); + bool IsExternalResource() override; + ZResourceType GetResourceType() override; + void CalcHash() override; public: ZTexture(); @@ -72,8 +72,8 @@ public: std::string GetSourceOutputCode(const std::string& prefix) override; std::string GetSourceOutputHeader(const std::string& prefix) override; - std::vector GetRawData(); - int GetRawDataSize(); + std::vector GetRawData() override; + int GetRawDataSize() override; std::string GetIMFmtFromType(); std::string GetIMSizFromType(); int GetWidth(); @@ -81,6 +81,6 @@ public: void SetWidth(int nWidth); void SetHeight(int nHeight); TextureType GetTextureType(); - void Save(const std::string& outFolder); - std::string GetExternalExtension(); + void Save(const std::string& outFolder) override; + std::string GetExternalExtension() override; }; diff --git a/tools/ZAPD/ZAPD/ZVector.cpp b/tools/ZAPD/ZAPD/ZVector.cpp index c7a6c5293f..e9eba2f449 100644 --- a/tools/ZAPD/ZAPD/ZVector.cpp +++ b/tools/ZAPD/ZAPD/ZVector.cpp @@ -42,7 +42,9 @@ void ZVector::ParseRawData() int currentRawDataIndex = this->rawDataIndex; scalars.clear(); - for (int i = 0; i < this->dimensions; i++) { + + for (int i = 0; i < this->dimensions; i++) + { ZScalar* scalar = new ZScalar(this->scalarType); scalar->rawDataIndex = currentRawDataIndex; scalar->rawData = this->rawData; @@ -64,6 +66,11 @@ int ZVector::GetRawDataSize() return size; } +bool ZVector::DoesSupportArray() +{ + return true; +} + std::string ZVector::GetSourceTypeName() { if (dimensions == 3 && scalarType == ZSCALAR_F32) @@ -94,7 +101,7 @@ std::string ZVector::GetSourceValue() std::vector strings = std::vector(); for (int i = 0; i < this->scalars.size(); i++) strings.push_back(scalars[i]->GetSourceValue()); - return StringHelper::Implode(strings, ", "); + return "{ " + StringHelper::Implode(strings, ", ") + " }"; } std::string ZVector::GetSourceOutputCode(const std::string& prefix) diff --git a/tools/ZAPD/ZAPD/ZVector.h b/tools/ZAPD/ZAPD/ZVector.h index 843eb45d2f..0d6ea06eb3 100644 --- a/tools/ZAPD/ZAPD/ZVector.h +++ b/tools/ZAPD/ZAPD/ZVector.h @@ -17,14 +17,15 @@ public: ZVector(); void ParseXML(tinyxml2::XMLElement* reader); - std::string GetSourceTypeName(); + std::string GetSourceTypeName() override; std::string GetSourceValue(); std::string GetSourceOutputCode(const std::string& prefix); + void ParseRawData() override; int GetRawDataSize(); + bool DoesSupportArray() override; ZResourceType GetResourceType(); static ZVector* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath); protected: - void ParseRawData(); }; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZVtx.cpp b/tools/ZAPD/ZAPD/ZVtx.cpp new file mode 100644 index 0000000000..b951310429 --- /dev/null +++ b/tools/ZAPD/ZAPD/ZVtx.cpp @@ -0,0 +1,78 @@ +#include "ZVtx.h" +#include "ZFile.h" +#include "StringHelper.h" +#include "BitConverter.h" + +ZVtx::ZVtx() +{ + x = 0; + y = 0; + z = 0; + flag = 0; + s = 0; + t = 0; + r = 0; + g = 0; + b = 0; + a = 0; +} + +void ZVtx::ParseXML(tinyxml2::XMLElement* reader) +{ +} + +std::string ZVtx::GetSourceTypeName() +{ + return "Vtx"; +} + +std::string ZVtx::GetSourceOutputCode(const std::string& prefix) +{ + std::string output = StringHelper::Sprintf("VTX(%i, %i, %i, %i, %i, %i, %i, %i, %i)", x, y, z, s, t, r, g, b, a); + + if (parent != nullptr) + parent->AddDeclaration(rawDataIndex, DeclarationAlignment::Align16, GetRawDataSize(), GetSourceTypeName(), name, output); + + return ""; +} + +void ZVtx::ParseRawData() +{ + const uint8_t* data = rawData.data(); + + x = BitConverter::ToInt16BE(data, rawDataIndex + 0); + y = BitConverter::ToInt16BE(data, rawDataIndex + 2); + z = BitConverter::ToInt16BE(data, rawDataIndex + 4); + flag = BitConverter::ToInt16BE(data, rawDataIndex + 6); + s = BitConverter::ToInt16BE(data, rawDataIndex + 8); + t = BitConverter::ToInt16BE(data, rawDataIndex + 10); + r = data[rawDataIndex + 12]; + g = data[rawDataIndex + 13]; + b = data[rawDataIndex + 14]; + a = data[rawDataIndex + 15]; +} + +int ZVtx::GetRawDataSize() +{ + return 16; +} + +bool ZVtx::DoesSupportArray() +{ + return true; +} + +ZResourceType ZVtx::GetResourceType() +{ + return ZResourceType::Vertex; +} + +ZVtx* ZVtx::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath) +{ + ZVtx* vtx = new ZVtx(); + vtx->rawData = nRawData; + vtx->rawDataIndex = rawDataIndex; + vtx->ParseRawData(); + + return vtx; +} diff --git a/tools/ZAPD/ZAPD/ZVtx.h b/tools/ZAPD/ZAPD/ZVtx.h new file mode 100644 index 0000000000..83eb734d73 --- /dev/null +++ b/tools/ZAPD/ZAPD/ZVtx.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include +#include +#include "ZResource.h" +#include "ZScalar.h" +#include "tinyxml2.h" + +class ZVtx : public ZResource +{ +public: + int16_t x, y, z; + uint16_t flag; + int16_t s, t; + uint8_t r, g, b, a; + + ZVtx(); + + void ParseXML(tinyxml2::XMLElement* reader); + std::string GetSourceTypeName() override; + std::string GetSourceOutputCode(const std::string& prefix); + void ParseRawData() override; + int GetRawDataSize(); + bool DoesSupportArray() override; + ZResourceType GetResourceType(); + + static ZVtx* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath); + +protected: +}; \ No newline at end of file diff --git a/tools/bootstrap_actors.py b/tools/bootstrap_actors.py index e09aef6a59..fc7f2d4eb8 100644 --- a/tools/bootstrap_actors.py +++ b/tools/bootstrap_actors.py @@ -34,7 +34,7 @@ def get_actor_id_name(actor_id): def get_actor_type_name(actor_type): matches = re.findall(actor_type + " .*\n", z64actor_text) for m in matches: - if "ACTORTYPE" in m: + if "ACTORCAT" in m: match = m.replace(",", "").strip().split(" ")[-1] return match return "0x" + actor_type diff --git a/tools/ido_recomp/windows/5.3/as1.exe b/tools/ido_recomp/windows/5.3/as1.exe new file mode 100644 index 0000000000..fb67bb8b5c Binary files /dev/null and b/tools/ido_recomp/windows/5.3/as1.exe differ diff --git a/tools/ido_recomp/windows/5.3/cc.exe b/tools/ido_recomp/windows/5.3/cc.exe new file mode 100644 index 0000000000..402d6f489a Binary files /dev/null and b/tools/ido_recomp/windows/5.3/cc.exe differ diff --git a/tools/ido_recomp/windows/5.3/cfe.exe b/tools/ido_recomp/windows/5.3/cfe.exe new file mode 100644 index 0000000000..4b2fa59de4 Binary files /dev/null and b/tools/ido_recomp/windows/5.3/cfe.exe differ diff --git a/tools/ido_recomp/windows/5.3/err.english.cc b/tools/ido_recomp/windows/5.3/err.english.cc new file mode 100644 index 0000000000..6976e38a95 --- /dev/null +++ b/tools/ido_recomp/windows/5.3/err.english.cc @@ -0,0 +1,1260 @@ +@ + 358 358 358 + 6464 6482 6553 + 6553 6593 6728 + 6728 6746 6803 + 6803 6808 6808 + 6808 6818 6818 + 6818 6826 6826 + 6826 6847 6847 + 6847 6875 6922 + 6922 6930 6930 + 6930 6939 6939 + 6939 6948 6948 + 6948 6974 7120 + 7120 7149 7204 + 7210 7248 7311 + 7317 7350 7442 + 7450 7497 7627 + 7635 7709 7930 + 7938 7975 8063 + 8071 8113 8253 + 8261 8289 8289 + 8298 8338 8445 + 8460 8502 8635 + 8650 8690 8819 + 8834 8857 8965 + 8965 9008 9113 + 9119 9142 9227 + 9235 9282 9451 + 9451 9462 9462 + 9462 9477 9477 + 9477 9497 9497 + 9497 9545 9545 + 9545 9584 9584 + 9584 9604 9662 + 9662 9682 9720 + 9720 9749 9749 + 9749 9788 9788 + 9788 9802 9802 + 9802 9829 9829 + 9829 9861 9861 + 9861 9904 9904 + 9904 9920 9920 + 9920 9962 9962 + 9962 9988 9988 + 9988 10014 10014 +10014 10035 10035 +10035 10054 10097 +10097 10115 10115 +10115 10147 10147 +10147 10183 10183 +10183 10208 10208 +10208 10236 10236 +10236 10269 10269 +10269 10304 10304 +10304 10328 10328 +10328 10351 10351 +10351 10371 10371 +10371 10402 10402 +10402 10447 10447 +10447 10497 10497 +10497 10533 10533 +10533 10598 10598 +10606 10630 10630 +10640 10671 10671 +10690 10719 10719 +10728 10752 10795 +10795 10837 10837 +10837 10876 10876 +10876 10900 10900 +10900 10948 10948 +10960 11021 11103 +11103 11128 11128 +11128 11153 11153 +11153 11216 11216 +11216 11239 11239 +11239 11303 11303 +11303 11347 11347 +11357 11393 11393 +11393 11432 11432 +11442 11494 11494 +11494 11536 11536 +11536 11595 11595 +11595 11622 11622 +11622 11684 11684 +11684 11726 11726 +11738 11778 11778 +11782 11813 11813 +11813 11850 11850 +11850 11900 12087 +12111 12120 12120 +12120 12129 12129 +12129 12158 12158 +12158 12192 12192 +12192 12237 12237 +12237 12273 12273 +12273 12326 12326 +12330 12366 12366 +12366 12423 12423 +12427 12482 12482 +12486 12560 12560 +12568 12631 12631 +12637 12691 12691 +12691 12743 12743 +12743 12785 12785 +12785 12826 12826 +12826 12865 12865 +12865 12883 12883 +12883 12946 12946 +12956 12995 12995 +13005 13066 13066 +13077 13163 13163 +13163 13211 13211 +13211 13270 13270 +13270 13318 13318 +13318 13350 13350 +13350 13387 13387 +13387 13428 13428 +13428 13464 13533 +13533 13580 13737 +13737 13776 13854 +13854 13913 13913 +13913 13950 13950 +13950 14118 14118 +14118 14150 14150 +14150 14163 14194 +14194 14224 14255 +14255 14275 14319 +14319 14353 14458 +14466 14484 14530 +14534 14567 14567 +14567 14635 14682 +14690 14742 14742 +14742 14789 14789 +14801 14875 14875 +14886 14947 14947 +14947 14992 14992 +14992 15035 15085 +15085 15134 15205 +15214 15267 15448 +15454 15496 16810 +16822 16875 16960 +16972 17053 17179 +17191 17236 17332 +17344 17491 17841 +17853 17939 18304 +18316 18471 18774 +18786 18952 19323 +19335 19364 19496 +19500 19527 19598 +19598 19613 19776 +19797 19808 19837 +19837 19862 19862 +19868 19927 20026 +20034 20075 20179 +20187 20223 20223 +20223 20290 20382 +20392 20441 20589 +20601 20656 20656 +20656 20699 20818 +20826 20860 21038 +21046 21094 21191 +21203 21236 21314 +21326 21395 21457 +21469 21502 21502 +21502 21587 21731 +21756 21789 21864 +21875 21901 21976 +22013 22059 22220 +22257 22397 22561 +22561 22595 22595 +22603 22623 22623 +22631 22667 22828 +22865 22919 22994 +23031 23059 23120 +23132 23201 23201 +23212 23274 23274 +23285 23345 23345 +23356 23393 23393 +23399 23431 23532 +23542 23587 23646 +23656 23697 23745 +23755 23796 23844 +23854 23876 23928 +23942 23971 24153 +24160 24243 24243 +24247 24273 24743 +24755 24784 24984 +24996 25034 25034 +25034 25075 25273 +25281 25332 25410 +25420 25467 25544 +25554 25583 25744 +25754 25783 26061 +26071 26111 26185 +26194 26239 26525 +26535 26568 26914 +26924 26951 26998 +27008 27035 27082 +27093 27120 27167 +27178 27206 27251 +27261 27289 27334 +27345 27391 27931 +27938 27959 28007 +28019 28037 28037 +28043 28069 28069 +28077 28147 28199 +28207 28266 28266 +28274 28306 28306 +28314 28339 28339 +28347 28404 28510 +28518 28567 28682 +28690 28728 28728 +28736 28782 29023 +29033 29085 29234 +29246 29303 29383 +29395 29432 29570 +29592 29631 29644 +29644 29693 29758 +29767 29810 29875 +29875 29911 29976 +29984 30014 30014 +30027 30086 30151 +30157 30223 30293 +30301 30369 30445 +30457 30511 30568 +30580 30630 30743 +30755 30812 30874 +30886 30959 31035 +31043 31076 31175 +31183 31243 31243 +31251 31323 31323 +31331 31433 31433 +31445 31544 31686 +31698 31740 31740 +31740 31783 31783 +31783 31824 31824 +31824 31873 31996 +32008 32056 32164 +32176 32210 32210 +32229 32271 32271 +32279 32323 32569 +32581 32642 32718 +32739 32779 32916 +32926 32953 33047 +33057 33116 33315 +33325 33373 33373 +33373 33407 33469 +33494 33527 33527 +33536 33573 33573 +33584 33650 33697 +33705 33763 33763 +33763 33797 33797 +33797 33829 33906 +33915 33976 33976 +33985 34016 34098 +34098 34133 34198 +34198 34261 34261 +34269 34312 34312 +34324 34363 34438 +34444 34530 34530 +34538 34596 34626 +34636 34675 34754 +34764 34821 34821 +34821 34867 34950 +34959 35016 35135 +35145 35198 35198 +35208 35266 35344 +35355 35382 35537 +35547 35576 35629 +35637 35705 35705 +35713 35764 35764 +35764 35784 35876 +35888 35932 35950 +35950 36013 36138 +36150 36191 36280 +36286 36314 36419 +36431 36516 36516 +36516 36554 36642 +36642 36689 36808 +36818 36881 37105 +37113 37183 37204 +37204 37225 37225 +37225 37255 37348 +37348 37388 37388 +37388 37454 37454 +37454 37518 37518 +37518 37584 37584 +37584 37717 37717 +37717 37752 37752 +37752 37783 37889 +37901 37928 38034 +38046 38115 38115 +38115 38140 38187 +38195 38219 38339 +38351 38422 38422 +38422 38486 38486 +38486 38555 38555 +38555 38619 38619 +38619 38641 38641 +38641 38758 38758 +38758 38929 38929 +38929 38975 39043 +39055 39084 39133 +39133 39175 39265 +39275 39310 39494 +39504 39547 39576 +39587 39614 39668 +39674 39697 39797 +39797 39845 40094 +40094 40158 40264 +40264 40369 40523 +40523 40593 40593 +40593 40629 40876 +40876 40911 40971 +40977 41026 41026 +41038 41077 41077 +41077 41116 41116 +41116 41156 41156 +41156 41195 41195 +41195 41237 41237 +41237 41285 41285 +41285 41304 41304 +41304 41371 41371 +41371 41429 41429 +41429 41491 41491 +41491 41519 41519 +41519 41572 41572 +41572 41642 41642 +41642 41676 41676 +41676 41713 41713 +41713 41751 41751 +41751 41792 41792 +41792 41856 41856 +41856 41881 41881 +41881 41936 41936 +41936 41977 41977 +41977 42018 42018 +42018 42090 42090 +42090 42162 42162 +42162 42205 42205 +42205 42267 42267 +42267 42294 42294 +42294 42309 42309 +42309 42338 42386 +42393 42425 42522 +42530 42577 42577 +42577 42623 42623 +42623 42643 42725 +42725 42748 42748 +42748 42829 42897 +42901 42952 42952 +42952 42978 43025 +43025 43116 43116 +43116 43171 43171 +43171 43204 43376 +43386 43453 43471 +43471 43547 43780 +43798 43921 44116 +44120 44120 44120 +Out of memory: %s +There is no more memory left in the system for compiling this program. +Internal Error Unknown Error Message %s +1) An internal error, while attempting to print an unavailable message +2) The error message file is inaccessible or has other problems +Unknown Signal %s +1) An unknown signal has been caught +2) 2 Nested signals +line +Warning: +Fatal: +Source not available +Too many errors... goodbye. +There is a limit of 30 errors before aborting. +Error: +reserved +reserved +Unknown Control Statement +1) The line begins with a '#' and is not of the form: + # "" +2) Please compile this program with the preprocessor enabled. +Unknown character %s ignored +The character is not part of the source character set. +2.2.1 +Unknown control character \%s ignored +The control character is not part of the source character set. +2.2.1 +Illegal character %s in exponent +1) Digits or sign expected after 'e' or 'E'. +2) Digits are expected after sign in exponent. +3.1.3.1 +Constant is out of range and may be truncated. +The constant is too large to be accurately represented and may be +truncated. The limits are in the system include file limits.h. +2.2.4.2 +Constant is out of range for a 32-bit data type, but accepted as written. +The constant is too large to fit in a 32-bit data type, but will be +accurately represented in a wider data type. The value may be truncated, +depending on its context. The limits are in the system include file +limits.h. +2.2.4.2 +Character constant size out of range +1) No characters in a character constant. +2) More than 4 bytes in a character constant. +3.1.3.4 +Wide character constant size out of range +1) No characters in the multibyte sequence (0 assumed). +2) More than 1 byte in the multi-byte sequence (only the first byte was converted). +3.1.3.4 +Invalid multibyte character +4.10.7.2 +Newline in string or character constant +1) Terminate your string or character constant with closing quotes. +2) Put a backslash before the newline. +3.1.3.4, 3.1.4 +Octal character escape too large: %s > %s +1) Terminate end of octal sequence with a non-octal character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Hex character escape too large: %s > %s +1) Terminate end of hex sequence with a non-hex character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Unexpected End-of-file +1) Unterminated string or character constant +2) Missing closing comment marker (*/) +3) File system problems +Unrecognized escape sequence in string \%s +Recognized escape sequences are \a, \b, \f, \n, \r, \t, and \v. +Character will be treated as un-escaped. +3.9.2 +Illegal octal digit %s +Octal constants, beginning with 0, must only have digits between 0 and 7, +inclusive. +3.1.3.2 +Unable to open temporary file for compiling %s +1) TMPDIR environment variable is set to a directory that you have no + permissions for. +2) The file system is full. +3) System errors beyond the scope of the compiler. +%s: Hangup +%s: Interrupt +%s: Quit (ASCII FS) +%s: Illegal instruction (not reset when caught) +%s: Trace trap (not reset when caught) +%s: IOT instruction +Also SIGABRT, used by abort, replace SIGIOT in the future +%s: EMT instruction +Also SIGXCPU, Exceeded CPU time limit +%s: Floating point exception +%s: Kill (cannot be caught or ignored) +%s: Bus error +%s: Segmentation violation +%s: Bad argument to system call +%s: Write on a pipe with no one to read it +%s: Alarm clock +%s: Software termination signal from kill +%s: User defined signal 1 +%s: User defined signal 2 +%s: Death of a child +Power-fail restart +%s: Also SIGXFSZ, exceeded file size limit +%s: Window change +%s: Handset, line status change +%s: Sendablestop signalnot from tty +%s: Stop signal from tty +%s: Pollable event occurred +%s: Input/Output possible signal +%s: Urgent condition on IO channel +%s: Window size changes +%s: Virtual time alarm +%s: Profiling alarm +%s: Continue a stopped process +%s: To readers pgrp upon background tty read +%s: Like TTIN for output if (tp->t_local<OSTOP) +%s: Resource lost (eg, record-lock) +'auto' and 'register' are not allowed in an external declaration +3.7(10) +must have function type +3.7.1(30) +Functions cannot return arrays +3.7.1(33), 3.3.2.2 +Declaration list not allowed +3.7.1(5) +Too many input files %s +The command line may contain only one file +cpp internal error: input stack underflow +cpp internal error: if stack underflow +Cannot open the file %s +No new-line character at the end of the file %s +2.1.1.2(30) +Fatal: Exceeded the limit of nesting level for #include file +Fatal: Exceeded the limit of nesting level for #include file. This limit +is 200. +Fail to read the file %s +Cannot write the file %s +%s: %s: An if directive is not terminated properly in the file +%s: %s: nested comment +%s:%s: Illegal macro name %s; macro name shall be an identifier +%s:%s: Illegal preprocessing token sequence +3.8.3(35) +%s:%s: Illegal macro parameter name +%s:%s: Non-unique macro parameter name +3.8.3(18) +%s:%s: Missing ')' in parameter list for #define %s +%s:%s: Missing ')' in macro instantiation +%s:%s: Bad punctuator in the parameter list for #define %s +%s:%s: Macro %s redefined. +%s:%s: # operator should be followed by a macro argument name +%s:%s: Badly formed constant expression%s +3.4(9), 3.8 +%s:%s: Division by zero in #if or #elif +3.8 +unknown command line option %s +extraneous input/output file name %s +%s: %s: Unterminated string or character constant +A preprocessing string or character constant token was not +terminated. Note that preprocessing directives are processed +after the source file has been divided into preprocessing tokens. +2.1.1.2(30) 3.1(18) 3.8 +%s: %s: +%s: %s: +%s: %s: Unterminated comment +%s: %s: Unknown directive type %s +%s: %s: #elif or #else after #else directive +%s: %s: Bad identifier after the %s +%s: %s: #%s accepts only one identifier as parameter +3.8 +%s: %s: Bad identifier after the %s +%s: %s: text following #%s violates the ANSI C standard. +3.8 +%s: %s: Bad character %s occurs after the # directive. +3.8 +%s: %s: the ## operator shall not be the %s token in the replacement list +3.8.3.3 +%s: %s: the defined operator takes identifier as operand only. +3.8.1 +%s: %s: Not in a conditional directive while using %s +%s: %s: Illegal filename specification for #include +%s: %s: Invalid file name %s for #include +%s: %s: Cannot open file %s for #include +%s: %s: Bad argument for #line command +%s: %s: #error %s +%s: %s: Tried to redefine predefined macro %s, attempt ignored +3.8.7(22) +%s: %s: Undefining predefined macro %s +3.8.7(22) +%s: %s: Undefined the ANSI standard library defined macro %s +4.1.2.1(9) +%s: %s: The number of arguments in the macro invocation does not match the definition +%s: %s: Illegal character %s in preprocessor if +%s: %s: Illegal character %s for number in preprocessor if +%s: %s: No string is allowed in preprocessor if +%s: %s: Not supported pragma %s +%s: %s: Not supported #pragma format +%s: %s: ANSI C does not allow #ident; %s +%s: %s: Not supported #ident format +This cpp extension accepts the following format: +#ident "any string" +%s: %s: Not supported #assert/#unassert format +This cpp extension accepts the following format: +#assert identifier +#assert identifier ( pp-tokens ) +#unassert identifier +#unassert identifier ( pp-tokens ) +%s: %s: Bad assertion predicate format +The correct syntax for this cpp extension is: +#assert identifier ( pp-token ) +%s: %s: directive is an upward-compatible ANSI C extension +%s: This option requires an argument +%s: %s: A macro has expanded recursively more than %s times. Further expansion will be disabled! Use command-line option: -Wp,-max_rec_depth=depth to recurse deeper. +A status return from cpp to cfe +Syntax Error +The token read was unexpected. +Syntax Error -- cannot backup +The token read was unexpected. +Yacc stack overflow +The expression is too complicated to parse. +Trailing comma in enumerator list +The use of a trailing comma in an enumerator list is not standard C. There +may be portability problems. +3.5.2.2 +Empty declaration +Empty declarations are invalid in standard C. +3.5 +%s declared, but not referenced. +redeclaration of '%s'; previous declaration at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +'%s' undefined; reoccurrences will not be reported. +Non-function name referenced in function call. +3.3.2.2(18) +The number of arguments doesn't agree with the number in the declaration. +3.3.2.2(5) +'%s' section name longer than 8 characters. Name truncated. +'%s' is already placed by pragma alloc_text. +Cannot write ucode file while compiling %s +1) The file system is full +2) Permissions problem +Must have corresponding formal argument for '%s' +Parameter found in the declaration part, but not in the argument list. +3.7.1(7) +Non-prototype declaration is an obsolescent feature. +The use of function definitions with separate parameter identifier +and declaration lists (not prototype-format parameter type and +identifier declarators) is an obsolescent feature. +3.9.5 +Incompatible function declarations for %s +For two function types to be compatible, both shall specify compatible +return types. Moreover, the parameter type lists, if both are present, +shall agree in the number of parameters and in use of the ellipsis +terminator; corresponding parameters shall have compatible types. If +one type has a parameter type list and the other type is specified by +a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. If one type has a parameter type list and the +other is specified by a function definition that contains a (possibly +empty) identifier list, both shall agree in the number of parameters, +and the type of each prototype parameter shall be compatible with the +type that results from application of the default argument promotions +to the type of the corresponding identifier. (For each parameter +declared with function or array type, its type for these comparisons +is the one that results from conversion to a pointer type. For each +parameter declared with qualified type, its type for these comparisons +is the unqualified version of its declared type.) There you have it! +3.5.4.3(15) +Incompatible function return type for this function. +For two function types to be compatible, both shall specify compatible +return types. +3.5.4.3(15) +The number of parameters for function is different from the previous declaration +The parameter type lists, if both are present, shall agree in the +number of parameters and in use of the ellipsis terminator. +3.5.4.3(15) +Incompatible type for the function parameter +If both parameter type lists are present, corresponding +parameters shall have compatible types. +3.5.4.3(15) +Function %s is redeclared with an incompatible argument type (after default argument promotion), which could lead to undefined run-time behaviour. +The redeclaration could cause arguments at a call site to be passed +inconsistently with what the function implementation expects, and +parameters would therefore be accessed erroneously when executing the +function body. Note that a float argument is promoted to a double +when passed (potentially through fp registers) to an unprototyped +function. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, ellipsis terminator not allowed +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the type of each parameter shall be +compatible with the type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype declaration and non-prototype definition found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other is specified by a +function definition that contains a (possibly empty) identifier list, +both shall agree in the number of parameters, and the type of each +prototype parameter shall be compatible with the type that results +from application of the default argument promotions to the type of the +corresponding identifier. +3.5.4.3(15) +Empty declaration specifiers +Standard C requires at least a storage class specifier, type specifier, +or a type qualifier in declarations. 'extern int' assumed. +3.5 +Can't write to the file %s +1) The output file cannot be opened for writing. +2) Out of file space. +Duplicate '%s' +typedef, extern, static, auto, register, const, volatile may not +appear more than once in the same specifier list or qualifier list. +Duplicate occurrence ignored. +3.5.1(10) , 3.5.3(5) +Null input +There is nothing to compile. +Illegal type combination +3.5.2 +Missing ';' at end of structure / union member declaration +In standard C, each member declaration must be terminated by a ';'. A +terminating ';' is assumed. +3.5.2.1 +Missing member name in structure / union +In standard C, each member declaration have a member name. The missing +member is assumed to not exist. +3.5.2.1 +This variable is initialized twice. +Neither 'const' or 'volatile' have any effect on function results. +Qualifiers only apply to expressions designating an object that +can be altered or examined. +3.5.3(10) +An integer constant expression is required here. +The expression that defines the value of an enumeration constant +shall be an integral constant expression that has a value +representable as an int. +3.5.2.2(28) +(previous declaration of '%s' at line %s in file '%s') +Must be an integer type greater than zero. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +Array size cannot be a long long. +Arrays with more than 2^32 elements are not yet supported. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +bit-field '%s' width is not an integer constant +The expression that specifies the width of a bit-field shall be an +integral constant expression. +3.5.2.1(15) +bit-field '%s' width is negative +The expression that specifies the width of a bit-field shall be +non-negative. +3.5.2.1(15) +bit-field '%s' type required to be int, unsigned int, or signed int. +A bit-field shall have type int, unsigned int, or signed int. +3.5.2.1(30) +bit-field %s's type not integer. +Non-scalar type or pointer type to a non-object for increment or decrement operator. +The operand of the prefix/postfix increment or decrement operator shall have scalar type; if it is of pointer type, it must point to an object. +3.3.2.4(37), 3.3.3.1(25) +Assign value to a function type. +An assignment operator shall have a modifiable lvalue as its left operand. +3.2.2.1(5) +Assign value to an array. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for variable of incomplete type. +The operand of increment and decrement operator shall be a modifiable +scalar lvalue. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +The left-hand side of the '.' operator must be an addressable lvalue, when a bit-field is not contained within a unit of 32 bits alignment. +This is a restriction in our implementation, which can be worked +around by always accessing long long bit-fields indirectly (i.e. +by means of the '->' operator). +This expression is not an lvalue. +3.2.2.1 +Modified an rvalue. +3.2.2.1 +Change value for constant variable. +The operand of increment and decrement operators shall be modifiable +scalar lvalues. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for constant field of a struct or union. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Dereferenced a non-pointer. +The operand of the unary * operator shall have pointer type. +3.3.3.2(39) +The operand of the unary + or - operator shall have arithmetic type. +3.3.3.3(6) +The operand of the unary ~ operator shall have integral type. +3.3.3.3(6) +The operand of the unary ! operator shall have scalar type. +3.3.3.3(6) +Constants must have arithmetic type. +3.1.3 +Bad type name for cast operator +The type name for the cast operator should either be void or a +qualified or unqualified scalar type. +3.3.4(22) +Improper cast of non-scalar type expression. +The operand for the cast operator shall be of scalar type. +3.3.4(23) +Cast a pointer into a non-integral type. +A pointer may be converted to an integral type. +3.3.4(31) +Cast a non-integral type into a pointer. +An integral type may be converted to a pointer. +3.3.4(31) +Duplicate member '%s' +Two members of a struct may not have the same name. +3.1.2.2(7,25) +Invalid constant expression. +Constant expressions shall not contain assignment, increment, decrement, +function-call, or comma operators, except when they are contained within +the operand of the sizeof operator. +3.4(9) +Constant expressions must be derived from a constant value or a constant +variable. +3.4 +Dangerous operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. This operand is NOT an lvalue, but we let it pass. +Note that a segmentation error with possible core dump will result +when the resulting address does not denote a valid (declared) +storage location. This feature will be discontinued in future +releases of the compiler! +3.3.3.2(36) +Unacceptable operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. +3.3.3.2(36) +'&' before array or function; ignored +Unacceptable operand of sizeof operator. +The sizeof operator shall not be applied to an expression that has +function type or an incomplete type, to the parenthesized name of such +a type, or to an lvalue that designates a bit-field object. +3.3.3.4 +Unacceptable operand of a multiplicative operator. +Each of the operands of a multiplicative operator shall have arithmetic type. +3.3.5(18) +Unacceptable operand of the remainder operator +Each of the operands of the remainder (%) operator shall have integral type. +3.3.5(18) +Unacceptable operand of '+'. +For the + operator, either both operands shall have arithmetic type, or +one operand shall be a pointer to an object type and the other shall +have integral type. +3.3.6(39) +Unacceptable operand of '-'. +For the subtraction operator, one of the following shall hold: both operands +have arithmetic type; operands are pointers to qualified or unqualified +versions of compatible object types; or the left operand is a pointer +to an object type and the right operand has integral type. +3.3.6(39) +Unacceptable operand of shift operator. +Each of the operands of bitwise shift operators shall have integral type. +3.3.7(9) +Unacceptable operand of relational operator. +For relational operators, one of the following shall hold: both +operands have arithmetic type; both operands are pointers to qualified +or unqualified versions of compatible object types; or both operands +are pointers to qualified or unqualified versions of compatible +incomplete types. +3.3.8(32) +Unacceptable operand of == or != +For the == or != operator, one of the following shall hold: both operands +are pointers to qualified or unqualified versions of compatible types; one +operand is a pointer to an object or incomplete type and the other is a +pointer to a qualified or unqualified version of void; or one operand is +a pointer and the other is a null pointer constant. +3.3.9(21) +Unacceptable operand of &. +Each of the operands shall have integral type. +3.3.10(7) +Unacceptable operand of ^. +Each of the operands shall have integral type. +3.3.11(18) +Unacceptable operand of |. +Each of the operands shall have integral type. +3.3.12(30) +Unacceptable operand of &&. +Each of the operands shall have scalar type. +3.3.13(7) +Unacceptable operand of ||. +Each of the operands shall have scalar type. +3.3.14(20) +Unacceptable operand of conditional operator. +The first operand of conditional operator shall have scalar type. One +of the following shall hold for the second and third operands: +both operands have arithmetic type; both operands have compatible +structure or union types; both operands have void type; both operands +are pointers to qualified or unqualified versions of compatible types; +one operand is a pointer and the other is a null pointer constant; or +one operand is pointer to an object or incomplete type and the other +is a pointer to a qualified or unqualified version of void. +3.3.15 +Duplicate label '%s' +A label name can only occur once in a function. +3.1.2.1(25) +Division by zero. +3.3.5 +Subscripting a non-array. +3.3.2.1 +Subscripting an array of incomplete type which is not an object type. +The element of the array shall have an object type. +3.3.2.1 +Should only subscript an array with an integral expression +3.3.2.1 +Subscripting an unbounded array +3.3.2.1 +Array index out of range +3.3.2.1 +Selector requires struct/union pointer as left hand side +In K&R mode the expression is implicitly converted to the '.' selector +for a struct/union left-hand side. +3.3.2.3 +Selector requires struct/union as left hand side +In K&R mode the expression is implicitly converted to the '->' selector +for a struct/union pointer left-hand side. +3.3.2.3 +member of structure or union required +3.3.2.3 +types have different qualifier specifications +For two qualified types to be compatible, both shall have the +identically qualified version of a compatible type; qualified +and unqualified versions of a type are distinct types. For two +types to be compatible their types must be the same. +3.5.3(26) +Incompatible array type due to different array size +For two array types to be compatible, both shall have compatible element +types; if both size specifiers are present, they shall have the +same value. +3.5.4.2(11) +Incompatible array type due to incompatible element type +For two array types to be compatible, both shall have compatible element +types. +3.5.4.2(11) +Incompatible pointer type assignment +The type pointed to by the left-hand side of simple assignment +statement is incompatible with the type pointed to by the right-hand side. +3.3.16.1, 3.5.4.1(21) +Incompatible base type of pointer type +K&R feature. +Type %s of %s is incompatible with type %s of %s +Incompatible types can be resolved by casting or by other means. +3.3.16.1 +illegal combination of pointer and integer +Assigning an integral expression to a pointer is a bad practice. +Type for %s is incompatible with %s +Incompatible types can be resolved by casting or by other means. +3.1.2.6 +Bad operand type for += or -= +3.3.16.2(26) +A case or default label appears outside a switch statement +A case or default label shall appear only in a switch statement. +3.6.1 +The controlling expression of the if statement is not scalar type +The controlling expression of an if statement shall have scalar type. +3.6.4.1 +The controlling expression of switch statement is not integral type +The controlling expression of an switch statement shall have integral type. +3.6.4.2(20) +The case label is not an integral constant expression +The case label shall be an integral constant expression. +3.6.4.2(22) +Duplicate case label in the same switch statement +No two of the case constant expressions in the same switch statement +shall have the same value after conversion. +3.6.4.2(22) +More than one default label in the same switch statement +There may be at most one default label in a switch statement. +3.6.4.2(23) +The controlling expression of the iteration statement is not scalar +type +The controlling expression of a iteration statement shall have scalar +type. +3.6.5.1 +label '%s' used, but not defined +The identifier in a goto statement shall name a label located +somewhere in the enclosing function. +3.6.6.1 +A continue statement shall appear only in or as a loop body +3.6.6.2 +A break statement shall appear only in or as a switch body or loop body +3.6.6.3 +A return statement with an expression should not appear +in a function '%s', whose return type is void +3.6.6.4(24) +A return statement without an expression appears in a +function '%s', whose return type is not void +If a return statement without an expression is executed, and the value +of the function call is used by the caller, the behavior is undefined. +3.6.6.4(33) +Internal Error: statement stack underflow +Long double not supported; double assumed. +Long float not standard; double assumed. +Only 'register' allowed in parameter declaration +The only storage-class specifier that shall occur in a parameter +declaration is 'register'; illegal storage class ignored. +3.5.4.3(25) +Name(s) without types in a function declaration +An old-style function declaration is not allowed to have names +in the parameter list; useless names ignored +3.5.4.3(26) +Functions cannot return functions +3.7.1(33), 3.3.2.2 +Functions cannot return a non-object type +3.3.2.2 +enum declaration must contain enum literals +Although structs or unions may delay the declaration of their members, +a similar construction with enum does not exist and is not necessary, +as there can be no mutual dependencies between the declaration of an +enumerated type and any other type. +3.5.2.3(27) +Register qualification has no effect for this type of object +Register declarations for array, struct, and function types have +no effect. +3.5.1(16), 3.5.1(19) +Functions cannot be declared 'register' +The declaration of an identifier for a function that has block +scope shall have no explicit storage-class specifier other than +'extern'. +3.5.1(19) +'%s' cannot be initialized +The type of the entity to be initialized shall be an object type +or an array of unknown size. +3.5.7(32) +Cannot initialize 'extern' variable '%s' within a function +If the declaration of an identifier has block scope, and the +identifier has 'extern' or 'static' linkage, the declaration +shall have no initializer for the identifier; initialization +allowed anyway. +3.5.7(35) +initializing an 'extern' is an ANSI C extension +conflicting declarations for '%s' +'static' and 'extern' declarations conflict. Which is meant? +3.1.2.2(15), 3.1.2.2(27) +Too many initial values for '%s' +3.5.7(1) +incompatible types in initialization +3.3.16(35) +redefinition of '%s'; previous definition at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +bit-fields as members of a union are an ANSI C invention. +storage size for '%s' isn't known +type mismatch in initialization +Missing braces in a union initialization or illegally formed +initialization. +3.5.7(5) +union '%s' only allowed one initializer for the first member +3.5.7(5) +width of '%s' exceeds its type +the specified bitfield width is too large to be contained within a +bitfield type. +structure has no member named '%s' +This is allowed for compatibility with AT&T pcc-based compilers. +Reference of an expression of void type or an incomplete type. +3.2.2.1 +element size of an array shall not be zero +3.2.2.5(25) +invalid combination of type specifiers +Although order is unimportant, not all type specifiers can occur together. +3.5.2 +declaration must at least declare an identifier, tag, or the member of an enumeration +3.5(16) +at most one storage class may be given in the declaration +Duplicate occurrence ignored. +3.5.1(10) +size of function's return type is zero +The return type of a function must be void or an object type other than array. +3.7.1(33) +Expecting an integral return type from the main function +identifier missing from parameter declaration +Prototypes for function definitions require identifiers in parameter +declarations. +3.7.1(4) +only 'register' allowed for storage class for parameters +The declarations in the declaration list shall contain no storage class +other than 'register', and no initializations. +3.7.1(10) +parameters declarations can not have initializations +3.7.1(10) +only one instance of 'void' allowed in the parameter list +'void' must occur by itself (specifying that the function has no parameters). +3.5.4.3(1) +%s must have function type +1) An argument list must be explicitly present in the declarator; it cannot + be inherited from a typedef (3.5.4.3). +2) The declarator is not a function. +3.7.1(30) +Illegal hexadecimal constant +You have no digits after the 0x or 0X. 0x0 assumed. +3.1.3.2 +value overflows its type in this context. Value is set to be '%s'! +3.2.1.4 +value is outside range representable for type '%s' +missing member name +K&R mode permits a missing member name; otherwise, only bitfields can omit +the member name. +3.5.2.1(10) +useless keyword or type name in declaration +Type was ignored. +'%s' declared within and is limited to this function prototype +Possible program error, since parameter type checking will always fail +unless the type declaration is visible to the caller. +3.1.2.1(35) +Extra spaces within operator, %s assumed +In ANSI C, the compound assignment operator cannot have embedded +white space characters. +3.1.5 +missing size for array '%s' +Incomplete types permitted for identifiers with internal or +external linkage, but not automatic linkage. +3.1.2.5(10) +can't jump into (from outside of) the body of a 'try' or into either type of handler +'%s' missing, please #include excpt.h +excpt.h required to declare exception statements, intrinsics or compiler +runtime names. +local function declarations cannot be 'static' +A function declaration can only contain the storage-class 'static' +if it is at file scope. Declaration made 'extern'. +3.5.1(19) +static function '%s' declared and referenced, but not defined. +If an identifier declared with internal linkage is used in an +expression (other than as a part of the operand of a sizeof +operator), there shall be exactly one external definition for +the identifier in the translation unit. +3.7(12) +pragma argument '%s' must be declared prior to being used in a pragma +Pragma name ignored. +Pragma not supported +'%s' not enabled as intrinsic +It may have already appeared in a function pragma, or never occurred in +an intrinsic pragma. +'%s' is already enabled as an intrinsic +weak definition for '%s' is later redefined; pragma weak ignored. +definition of primary name '%s' not found; pragma weak ignored. +definition of secondary name '%s' not found; pragma weak ignored. +primary name '%s' is declared as a common or external, and is not defined +with initial value within this file; pragma weak ignored. +useless '%s' storage class ignored +array of functions not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +array of voids not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +argument for pragma pack must be an integer constant; pragma ignored +'%s' has wrong tag type. +Identifier redeclared in the same scope/block. +3.1.2.3 +missing dimension bound +For multidimensional arrays, the constant bounds of the array may be +omitted only for the first member of the sequence. +3.1.2.5(23) +Internal error in parameters to function substr; loc: '%s'; len: '%s'. +Internal error in parameters to function insertstr; indx: '%s'. +Internal error in function get_tag_name; input is a non-tagged type. +Internal error in function gen_type_str -- not a type tree '%s' +Cannot open file '%s' +Prototype should be moved after tag or a typedef declaration. +Please look for comments in the extracted header file. +The extracted header file includes prototypes for static functions, +which should be removed, if you wish to include the header in a source file +other than the originator. +ANSI C requires formal parameter before "..." +This extension is meant to be used for compatibility with varargs.h +3.5.4.3(35) +syntax error: "&..." invalid +extension used to access "..." formal arguments. +function '%s' initialized like a variable +The type of entity to be initialized shall be an object type or an +array of unknown size. +3.5.7(31) +initializer not an array aggregate +The initializer for an object that has aggregate type shall be a +brace-enclosed list of initializers for the members of the aggregate, +written in increasing subscript or member order. +3.5.7(20) +'%s' type is incomplete; cannot initialize +Was the struct ever defined? +3.5.7.(31) +'%s' is not standard ANSI. +This keyword/type is not defined in strict ANSI mode. +3.1.1 +not a legal asm string +The first operand of an asm string should be, after argument substitution, +a legal assembly string. +The -float option will be ignored in ANSI mode. +The -float option is ignored, since otherwise program semantics would +violate the ANSI standard. In particular, fp constants are always +'double' with ANSI-C, while with -float the type of fp constants will +depend on the context and may be 'float'. +ANSI C support unavailable with C compiler bundled with RISC/os +The C compiler bundled with RISC/os does not support ANSI C. ANSI +C support requires a separate license. +Ignored invalid warning number(s) in -woff option, %s%s ! +Warning numbers must be in the range %s to %s. +The set of warning numbers in cfe is disjoint from the set of warning numbers +in accom, since accom warnings cannot be mapped one-to-one to cfe warnings. +'%s' not handled as an intrinsic due to incompatible argument types . +'__unalign' only qualifies pointers +'__unalign' indicates the object pointed at by pointer is unaligned (e.g., +int * __unalign p). This is an extension to ANSI C and like 'volatile' +and 'const' can follow the '*' in pointer declarations, but unlike both +cannot qualify a base type. +index expression is an anachronism +ANSI C++ doesn't support array index expressions in delete. +5.3.4 +member cannot be of function or incomplete type. +3.5.2.1(12) +Illegal lint option, '%s', is ignored. +cannot open header message buffer file +cannot write header message buffer file +cannot read header message buffer file +cannot seek in header message buffer file +struct/union/enum '%s' is used, but not defined +static '%s' unused +nonportable character comparison (chars may be signed or unsigned) +redundant comparison of unsigned with constant expression +redundant statement, control flow cannot reach this statement +'%s' may be used before set +function parameter '%s' is not used in function '%s' +'%s' can be const qualified, since it is not set within its lifetime. +'%s' is not used in function '%s' +'%s' set but unused in function '%s' +control may fall through %s statement +function '%s' has return(e); and return; +function '%s' may return random value to place of invocation %s +label without goto: '%s' +width of %s constant is smaller than size of type (%s) +explicit conversion from '%s' to '%s' %s +implicit conversion from '%s' to '%s' %s +'%s' may be indistinguishable from '%s' due to internal name truncation +Promoted formal parameter and promoted argument have incompatible types +No prototype for the definition of '%s' %s +References to '%s' are substituted by its literal initializer + (as included in %s) +============== +unsupported language linkage +string-literal specifies an unsupported linkage +7.4(1) +No prototype for the call to %s +To achieve better type-checking, there should be a full prototype for +the function being called. +3.5.4.3 +'inline' only applies to function declarations +leave statment can occur only within try body +Microsoft extension +Use of a Microsoft extension detected without usage of the +compiler option -msft. +No parameter mentioned +A file with no declarations or definitions is accepted as an extension to ANSI C +The translation unit must contain at least one external definition. +3.7 +Incompatible signed and unsigned version of a type +Yacc initialization error +Internal error: yacc cannot initialize itself. +The cfe option %s may not be in future releases. We suggest that you not use this option! +Incompatible char and unsigned char versions of a type +Lshift with undefined behaviour. +Lshift with a negative right operand, or a right operand that is greater +than or equal to the width in bits of the promoted left operand, results +in undefined behaviour. +3.3.7(11) +useless type name in declaration, possibly a semicolon is missing. +Type was ignored. +constant initializer expression is invalid (refers to automatic variables). +All the expressions in an initializer for an object that has static storage +duration or in the initializer list for an object that has aggregate or +union type shall be constant expressions. Otherwise, unexpected results +may occur. +3.5.7(32) and 3.4 +invalid explicit or implicit conversion of an address constant to an integral value in a constant initializing expression. +An address constant in a constant initializing expression can neither +initialize a bit-field nor be directly or indirectly converted to an +integral type of size different from an address type. +6.4 diff --git a/tools/ido_recomp/windows/5.3/ugen.exe b/tools/ido_recomp/windows/5.3/ugen.exe new file mode 100644 index 0000000000..f74ee0d9e5 Binary files /dev/null and b/tools/ido_recomp/windows/5.3/ugen.exe differ diff --git a/tools/ido_recomp/windows/5.3/uopt.exe b/tools/ido_recomp/windows/5.3/uopt.exe new file mode 100644 index 0000000000..274d7e008a Binary files /dev/null and b/tools/ido_recomp/windows/5.3/uopt.exe differ diff --git a/tools/ido_recomp/windows/7.1/as1.exe b/tools/ido_recomp/windows/7.1/as1.exe new file mode 100644 index 0000000000..b41eba8415 Binary files /dev/null and b/tools/ido_recomp/windows/7.1/as1.exe differ diff --git a/tools/ido_recomp/windows/7.1/cc.exe b/tools/ido_recomp/windows/7.1/cc.exe new file mode 100644 index 0000000000..1ada0d5bbe Binary files /dev/null and b/tools/ido_recomp/windows/7.1/cc.exe differ diff --git a/tools/ido_recomp/windows/7.1/cfe.exe b/tools/ido_recomp/windows/7.1/cfe.exe new file mode 100644 index 0000000000..03f8fc7e89 Binary files /dev/null and b/tools/ido_recomp/windows/7.1/cfe.exe differ diff --git a/tools/ido_recomp/windows/7.1/err.english.cc b/tools/ido_recomp/windows/7.1/err.english.cc new file mode 100644 index 0000000000..b5d5be36ef --- /dev/null +++ b/tools/ido_recomp/windows/7.1/err.english.cc @@ -0,0 +1,1260 @@ +@ + 358 358 358 + 6464 6482 6553 + 6553 6593 6728 + 6728 6746 6803 + 6803 6808 6808 + 6808 6818 6818 + 6818 6826 6826 + 6826 6847 6847 + 6847 6875 6922 + 6922 6930 6930 + 6930 6939 6939 + 6939 6948 6948 + 6948 6974 7120 + 7120 7149 7204 + 7210 7248 7311 + 7317 7350 7442 + 7450 7497 7627 + 7635 7709 7930 + 7938 7975 8063 + 8071 8113 8253 + 8261 8289 8289 + 8298 8338 8445 + 8460 8502 8635 + 8650 8690 8819 + 8834 8857 8965 + 8965 9008 9113 + 9119 9142 9227 + 9235 9282 9451 + 9451 9462 9462 + 9462 9477 9477 + 9477 9497 9497 + 9497 9545 9545 + 9545 9584 9584 + 9584 9604 9662 + 9662 9682 9720 + 9720 9749 9749 + 9749 9788 9788 + 9788 9802 9802 + 9802 9829 9829 + 9829 9861 9861 + 9861 9904 9904 + 9904 9920 9920 + 9920 9962 9962 + 9962 9988 9988 + 9988 10014 10014 +10014 10035 10035 +10035 10054 10097 +10097 10115 10115 +10115 10147 10147 +10147 10183 10183 +10183 10208 10208 +10208 10236 10236 +10236 10269 10269 +10269 10304 10304 +10304 10328 10328 +10328 10351 10351 +10351 10371 10371 +10371 10402 10402 +10402 10447 10447 +10447 10497 10497 +10497 10533 10533 +10533 10598 10598 +10606 10630 10630 +10640 10671 10671 +10690 10719 10719 +10728 10752 10795 +10795 10837 10837 +10837 10876 10876 +10876 10900 10900 +10900 10948 10948 +10960 11021 11103 +11103 11128 11128 +11128 11153 11153 +11153 11216 11216 +11216 11239 11239 +11239 11303 11303 +11303 11347 11347 +11357 11393 11393 +11393 11432 11432 +11442 11494 11494 +11494 11536 11536 +11536 11595 11595 +11595 11622 11622 +11622 11684 11684 +11684 11726 11726 +11738 11778 11778 +11782 11813 11813 +11813 11850 11850 +11850 11900 12087 +12111 12120 12120 +12120 12129 12129 +12129 12158 12158 +12158 12192 12192 +12192 12237 12237 +12237 12273 12273 +12273 12326 12326 +12330 12366 12366 +12366 12423 12423 +12427 12482 12482 +12486 12560 12560 +12568 12631 12631 +12637 12691 12691 +12691 12743 12743 +12743 12785 12785 +12785 12826 12826 +12826 12865 12865 +12865 12883 12883 +12883 12946 12946 +12956 12995 12995 +13005 13066 13066 +13077 13163 13163 +13163 13211 13211 +13211 13270 13270 +13270 13318 13318 +13318 13350 13350 +13350 13387 13387 +13387 13428 13428 +13428 13464 13533 +13533 13580 13737 +13737 13776 13854 +13854 13913 13913 +13913 13950 13950 +13950 14118 14118 +14118 14150 14150 +14150 14163 14194 +14194 14224 14255 +14255 14275 14319 +14319 14353 14458 +14466 14484 14530 +14534 14567 14567 +14567 14635 14682 +14690 14742 14742 +14742 14789 14789 +14801 14875 14875 +14886 14947 14947 +14947 14992 14992 +14992 15035 15085 +15085 15134 15205 +15214 15267 15448 +15454 15496 16810 +16822 16875 16960 +16972 17053 17179 +17191 17236 17332 +17344 17491 17841 +17853 17939 18304 +18316 18471 18774 +18786 18952 19323 +19335 19364 19496 +19500 19527 19598 +19598 19613 19776 +19797 19808 19837 +19837 19862 19862 +19868 19927 20026 +20034 20075 20179 +20187 20223 20223 +20223 20290 20382 +20392 20441 20589 +20601 20656 20656 +20656 20699 20818 +20826 20860 21038 +21046 21094 21191 +21203 21236 21314 +21326 21395 21457 +21469 21502 21502 +21502 21587 21731 +21756 21789 21864 +21875 21901 21976 +22013 22059 22220 +22257 22397 22561 +22561 22595 22595 +22603 22623 22623 +22631 22667 22828 +22865 22919 22994 +23031 23059 23120 +23132 23201 23201 +23212 23274 23274 +23285 23345 23345 +23356 23393 23393 +23399 23431 23532 +23542 23587 23646 +23656 23697 23745 +23755 23796 23844 +23854 23876 23928 +23942 23971 24153 +24160 24243 24243 +24247 24273 24743 +24755 24784 24984 +24996 25034 25034 +25034 25075 25273 +25281 25332 25410 +25420 25467 25544 +25554 25583 25744 +25754 25783 26061 +26071 26111 26185 +26194 26239 26525 +26535 26568 26914 +26924 26951 26998 +27008 27035 27082 +27093 27120 27167 +27178 27206 27251 +27261 27289 27334 +27345 27391 27931 +27938 27959 28007 +28019 28037 28037 +28043 28069 28069 +28077 28147 28199 +28207 28266 28266 +28274 28306 28306 +28314 28339 28339 +28347 28404 28510 +28518 28567 28682 +28690 28728 28728 +28736 28782 29023 +29033 29085 29234 +29246 29303 29383 +29395 29432 29570 +29592 29631 29644 +29644 29693 29758 +29767 29810 29875 +29875 29911 29976 +29984 30014 30014 +30027 30086 30151 +30157 30223 30293 +30301 30369 30445 +30457 30511 30568 +30580 30630 30743 +30755 30812 30874 +30886 30959 31035 +31043 31076 31175 +31183 31243 31243 +31251 31323 31323 +31331 31433 31433 +31445 31544 31686 +31698 31740 31740 +31740 31783 31783 +31783 31824 31824 +31824 31873 31996 +32008 32056 32164 +32176 32210 32210 +32229 32271 32271 +32279 32323 32569 +32581 32642 32718 +32739 32779 32916 +32926 32953 33047 +33057 33116 33315 +33325 33373 33373 +33373 33407 33469 +33494 33527 33527 +33536 33573 33573 +33584 33650 33697 +33705 33763 33763 +33763 33797 33797 +33797 33829 33906 +33915 33976 33976 +33985 34016 34098 +34098 34133 34198 +34198 34261 34261 +34269 34312 34312 +34324 34363 34438 +34444 34530 34530 +34538 34596 34626 +34636 34675 34754 +34764 34821 34821 +34821 34867 34950 +34959 35016 35135 +35145 35198 35198 +35208 35266 35344 +35355 35382 35537 +35547 35576 35629 +35637 35705 35705 +35713 35764 35764 +35764 35784 35876 +35888 35932 35950 +35950 36013 36138 +36150 36191 36280 +36286 36314 36419 +36431 36516 36516 +36516 36554 36642 +36642 36689 36808 +36818 36881 37105 +37113 37183 37204 +37204 37225 37225 +37225 37255 37348 +37348 37388 37388 +37388 37454 37454 +37454 37518 37518 +37518 37584 37584 +37584 37717 37717 +37717 37752 37752 +37752 37783 37889 +37901 37928 38034 +38046 38115 38115 +38115 38140 38187 +38195 38219 38339 +38351 38422 38422 +38422 38486 38486 +38486 38555 38555 +38555 38619 38619 +38619 38641 38641 +38641 38758 38758 +38758 38929 38929 +38929 38975 39043 +39055 39084 39133 +39133 39175 39265 +39275 39310 39494 +39504 39547 39576 +39587 39614 39668 +39674 39697 39797 +39797 39845 40094 +40094 40158 40264 +40264 40369 40523 +40523 40593 40593 +40593 40629 40876 +40876 40911 40971 +40977 41026 41026 +41038 41077 41077 +41077 41116 41116 +41116 41156 41156 +41156 41195 41195 +41195 41237 41237 +41237 41285 41285 +41285 41304 41304 +41304 41371 41371 +41371 41429 41429 +41429 41491 41491 +41491 41519 41519 +41519 41572 41572 +41572 41642 41642 +41642 41676 41676 +41676 41713 41713 +41713 41751 41751 +41751 41792 41792 +41792 41856 41856 +41856 41881 41881 +41881 41944 41944 +41944 41985 41985 +41985 42026 42026 +42026 42098 42098 +42098 42170 42170 +42170 42213 42213 +42213 42275 42275 +42275 42302 42302 +42302 42317 42317 +42317 42346 42394 +42401 42433 42530 +42538 42585 42585 +42585 42631 42631 +42631 42651 42733 +42733 42756 42756 +42756 42837 42905 +42909 42960 42960 +42960 42986 43033 +43033 43124 43124 +43124 43179 43179 +43179 43212 43384 +43394 43461 43479 +43479 43555 43788 +43806 43929 44124 +44128 44128 44128 +Out of memory: %s +There is no more memory left in the system for compiling this program. +Internal Error Unknown Error Message %s +1) An internal error, while attempting to print an unavailable message +2) The error message file is inaccessible or has other problems +Unknown Signal %s +1) An unknown signal has been caught +2) 2 Nested signals +line +Warning: +Fatal: +Source not available +Too many errors... goodbye. +There is a limit of 30 errors before aborting. +Error: +reserved +reserved +Unknown Control Statement +1) The line begins with a '#' and is not of the form: + # "" +2) Please compile this program with the preprocessor enabled. +Unknown character %s ignored +The character is not part of the source character set. +2.2.1 +Unknown control character \%s ignored +The control character is not part of the source character set. +2.2.1 +Illegal character %s in exponent +1) Digits or sign expected after 'e' or 'E'. +2) Digits are expected after sign in exponent. +3.1.3.1 +Constant is out of range and may be truncated. +The constant is too large to be accurately represented and may be +truncated. The limits are in the system include file limits.h. +2.2.4.2 +Constant is out of range for a 32-bit data type, but accepted as written. +The constant is too large to fit in a 32-bit data type, but will be +accurately represented in a wider data type. The value may be truncated, +depending on its context. The limits are in the system include file +limits.h. +2.2.4.2 +Character constant size out of range +1) No characters in a character constant. +2) More than 4 bytes in a character constant. +3.1.3.4 +Wide character constant size out of range +1) No characters in the multibyte sequence (0 assumed). +2) More than 1 byte in the multi-byte sequence (only the first byte was converted). +3.1.3.4 +Invalid multibyte character +4.10.7.2 +Newline in string or character constant +1) Terminate your string or character constant with closing quotes. +2) Put a backslash before the newline. +3.1.3.4, 3.1.4 +Octal character escape too large: %s > %s +1) Terminate end of octal sequence with a non-octal character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Hex character escape too large: %s > %s +1) Terminate end of hex sequence with a non-hex character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Unexpected End-of-file +1) Unterminated string or character constant +2) Missing closing comment marker (*/) +3) File system problems +Unrecognized escape sequence in string \%s +Recognized escape sequences are \a, \b, \f, \n, \r, \t, and \v. +Character will be treated as un-escaped. +3.9.2 +Illegal octal digit %s +Octal constants, beginning with 0, must only have digits between 0 and 7, +inclusive. +3.1.3.2 +Unable to open temporary file for compiling %s +1) TMPDIR environment variable is set to a directory that you have no + permissions for. +2) The file system is full. +3) System errors beyond the scope of the compiler. +%s: Hangup +%s: Interrupt +%s: Quit (ASCII FS) +%s: Illegal instruction (not reset when caught) +%s: Trace trap (not reset when caught) +%s: IOT instruction +Also SIGABRT, used by abort, replace SIGIOT in the future +%s: EMT instruction +Also SIGXCPU, Exceeded CPU time limit +%s: Floating point exception +%s: Kill (cannot be caught or ignored) +%s: Bus error +%s: Segmentation violation +%s: Bad argument to system call +%s: Write on a pipe with no one to read it +%s: Alarm clock +%s: Software termination signal from kill +%s: User defined signal 1 +%s: User defined signal 2 +%s: Death of a child +Power-fail restart +%s: Also SIGXFSZ, exceeded file size limit +%s: Window change +%s: Handset, line status change +%s: Sendablestop signalnot from tty +%s: Stop signal from tty +%s: Pollable event occurred +%s: Input/Output possible signal +%s: Urgent condition on IO channel +%s: Window size changes +%s: Virtual time alarm +%s: Profiling alarm +%s: Continue a stopped process +%s: To readers pgrp upon background tty read +%s: Like TTIN for output if (tp->t_local<OSTOP) +%s: Resource lost (eg, record-lock) +'auto' and 'register' are not allowed in an external declaration +3.7(10) +must have function type +3.7.1(30) +Functions cannot return arrays +3.7.1(33), 3.3.2.2 +Declaration list not allowed +3.7.1(5) +Too many input files %s +The command line may contain only one file +cpp internal error: input stack underflow +cpp internal error: if stack underflow +Cannot open the file %s +No new-line character at the end of the file %s +2.1.1.2(30) +Fatal: Exceeded the limit of nesting level for #include file +Fatal: Exceeded the limit of nesting level for #include file. This limit +is 200. +Fail to read the file %s +Cannot write the file %s +%s: %s: An if directive is not terminated properly in the file +%s: %s: nested comment +%s:%s: Illegal macro name %s; macro name shall be an identifier +%s:%s: Illegal preprocessing token sequence +3.8.3(35) +%s:%s: Illegal macro parameter name +%s:%s: Non-unique macro parameter name +3.8.3(18) +%s:%s: Missing ')' in parameter list for #define %s +%s:%s: Missing ')' in macro instantiation +%s:%s: Bad punctuator in the parameter list for #define %s +%s:%s: Macro %s redefined. +%s:%s: # operator should be followed by a macro argument name +%s:%s: Badly formed constant expression%s +3.4(9), 3.8 +%s:%s: Division by zero in #if or #elif +3.8 +unknown command line option %s +extraneous input/output file name %s +%s: %s: Unterminated string or character constant +A preprocessing string or character constant token was not +terminated. Note that preprocessing directives are processed +after the source file has been divided into preprocessing tokens. +2.1.1.2(30) 3.1(18) 3.8 +%s: %s: +%s: %s: +%s: %s: Unterminated comment +%s: %s: Unknown directive type %s +%s: %s: #elif or #else after #else directive +%s: %s: Bad identifier after the %s +%s: %s: #%s accepts only one identifier as parameter +3.8 +%s: %s: Bad identifier after the %s +%s: %s: text following #%s violates the ANSI C standard. +3.8 +%s: %s: Bad character %s occurs after the # directive. +3.8 +%s: %s: the ## operator shall not be the %s token in the replacement list +3.8.3.3 +%s: %s: the defined operator takes identifier as operand only. +3.8.1 +%s: %s: Not in a conditional directive while using %s +%s: %s: Illegal filename specification for #include +%s: %s: Invalid file name %s for #include +%s: %s: Cannot open file %s for #include +%s: %s: Bad argument for #line command +%s: %s: #error %s +%s: %s: Tried to redefine predefined macro %s, attempt ignored +3.8.7(22) +%s: %s: Undefining predefined macro %s +3.8.7(22) +%s: %s: Undefined the ANSI standard library defined macro %s +4.1.2.1(9) +%s: %s: The number of arguments in the macro invocation does not match the definition +%s: %s: Illegal character %s in preprocessor if +%s: %s: Illegal character %s for number in preprocessor if +%s: %s: No string is allowed in preprocessor if +%s: %s: Not supported pragma %s +%s: %s: Not supported #pragma format +%s: %s: ANSI C does not allow #ident; %s +%s: %s: Not supported #ident format +This cpp extension accepts the following format: +#ident "any string" +%s: %s: Not supported #assert/#unassert format +This cpp extension accepts the following format: +#assert identifier +#assert identifier ( pp-tokens ) +#unassert identifier +#unassert identifier ( pp-tokens ) +%s: %s: Bad assertion predicate format +The correct syntax for this cpp extension is: +#assert identifier ( pp-token ) +%s: %s: directive is an upward-compatible ANSI C extension +%s: This option requires an argument +%s: %s: A macro has expanded recursively more than %s times. Further expansion will be disabled! Use command-line option: -Wp,-max_rec_depth=depth to recurse deeper. +A status return from cpp to cfe +Syntax Error +The token read was unexpected. +Syntax Error -- cannot backup +The token read was unexpected. +Yacc stack overflow +The expression is too complicated to parse. +Trailing comma in enumerator list +The use of a trailing comma in an enumerator list is not standard C. There +may be portability problems. +3.5.2.2 +Empty declaration +Empty declarations are invalid in standard C. +3.5 +%s declared, but not referenced. +redeclaration of '%s'; previous declaration at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +'%s' undefined; reoccurrences will not be reported. +Non-function name referenced in function call. +3.3.2.2(18) +The number of arguments doesn't agree with the number in the declaration. +3.3.2.2(5) +'%s' section name longer than 8 characters. Name truncated. +'%s' is already placed by pragma alloc_text. +Cannot write ucode file while compiling %s +1) The file system is full +2) Permissions problem +Must have corresponding formal argument for '%s' +Parameter found in the declaration part, but not in the argument list. +3.7.1(7) +Non-prototype declaration is an obsolescent feature. +The use of function definitions with separate parameter identifier +and declaration lists (not prototype-format parameter type and +identifier declarators) is an obsolescent feature. +3.9.5 +Incompatible function declarations for %s +For two function types to be compatible, both shall specify compatible +return types. Moreover, the parameter type lists, if both are present, +shall agree in the number of parameters and in use of the ellipsis +terminator; corresponding parameters shall have compatible types. If +one type has a parameter type list and the other type is specified by +a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. If one type has a parameter type list and the +other is specified by a function definition that contains a (possibly +empty) identifier list, both shall agree in the number of parameters, +and the type of each prototype parameter shall be compatible with the +type that results from application of the default argument promotions +to the type of the corresponding identifier. (For each parameter +declared with function or array type, its type for these comparisons +is the one that results from conversion to a pointer type. For each +parameter declared with qualified type, its type for these comparisons +is the unqualified version of its declared type.) There you have it! +3.5.4.3(15) +Incompatible function return type for this function. +For two function types to be compatible, both shall specify compatible +return types. +3.5.4.3(15) +The number of parameters for function is different from the previous declaration +The parameter type lists, if both are present, shall agree in the +number of parameters and in use of the ellipsis terminator. +3.5.4.3(15) +Incompatible type for the function parameter +If both parameter type lists are present, corresponding +parameters shall have compatible types. +3.5.4.3(15) +Function %s is redeclared with an incompatible argument type (after default argument promotion), which could lead to undefined run-time behaviour. +The redeclaration could cause arguments at a call site to be passed +inconsistently with what the function implementation expects, and +parameters would therefore be accessed erroneously when executing the +function body. Note that a float argument is promoted to a double +when passed (potentially through fp registers) to an unprototyped +function. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, ellipsis terminator not allowed +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the type of each parameter shall be +compatible with the type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype declaration and non-prototype definition found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other is specified by a +function definition that contains a (possibly empty) identifier list, +both shall agree in the number of parameters, and the type of each +prototype parameter shall be compatible with the type that results +from application of the default argument promotions to the type of the +corresponding identifier. +3.5.4.3(15) +Empty declaration specifiers +Standard C requires at least a storage class specifier, type specifier, +or a type qualifier in declarations. 'extern int' assumed. +3.5 +Can't write to the file %s +1) The output file cannot be opened for writing. +2) Out of file space. +Duplicate '%s' +typedef, extern, static, auto, register, const, volatile may not +appear more than once in the same specifier list or qualifier list. +Duplicate occurrence ignored. +3.5.1(10) , 3.5.3(5) +Null input +There is nothing to compile. +Illegal type combination +3.5.2 +Missing ';' at end of structure / union member declaration +In standard C, each member declaration must be terminated by a ';'. A +terminating ';' is assumed. +3.5.2.1 +Missing member name in structure / union +In standard C, each member declaration have a member name. The missing +member is assumed to not exist. +3.5.2.1 +This variable is initialized twice. +Neither 'const' or 'volatile' have any effect on function results. +Qualifiers only apply to expressions designating an object that +can be altered or examined. +3.5.3(10) +An integer constant expression is required here. +The expression that defines the value of an enumeration constant +shall be an integral constant expression that has a value +representable as an int. +3.5.2.2(28) +(previous declaration of '%s' at line %s in file '%s') +Must be an integer type greater than zero. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +Array size cannot be a long long. +Arrays with more than 2^32 elements are not yet supported. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +bit-field '%s' width is not an integer constant +The expression that specifies the width of a bit-field shall be an +integral constant expression. +3.5.2.1(15) +bit-field '%s' width is negative +The expression that specifies the width of a bit-field shall be +non-negative. +3.5.2.1(15) +bit-field '%s' type required to be int, unsigned int, or signed int. +A bit-field shall have type int, unsigned int, or signed int. +3.5.2.1(30) +bit-field %s's type not integer. +Non-scalar type or pointer type to a non-object for increment or decrement operator. +The operand of the prefix/postfix increment or decrement operator shall have scalar type; if it is of pointer type, it must point to an object. +3.3.2.4(37), 3.3.3.1(25) +Assign value to a function type. +An assignment operator shall have a modifiable lvalue as its left operand. +3.2.2.1(5) +Assign value to an array. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for variable of incomplete type. +The operand of increment and decrement operator shall be a modifiable +scalar lvalue. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +The left-hand side of the '.' operator must be an addressable lvalue, when a bit-field is not contained within a unit of 32 bits alignment. +This is a restriction in our implementation, which can be worked +around by always accessing long long bit-fields indirectly (i.e. +by means of the '->' operator). +This expression is not an lvalue. +3.2.2.1 +Modified an rvalue. +3.2.2.1 +Change value for constant variable. +The operand of increment and decrement operators shall be modifiable +scalar lvalues. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for constant field of a struct or union. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Dereferenced a non-pointer. +The operand of the unary * operator shall have pointer type. +3.3.3.2(39) +The operand of the unary + or - operator shall have arithmetic type. +3.3.3.3(6) +The operand of the unary ~ operator shall have integral type. +3.3.3.3(6) +The operand of the unary ! operator shall have scalar type. +3.3.3.3(6) +Constants must have arithmetic type. +3.1.3 +Bad type name for cast operator +The type name for the cast operator should either be void or a +qualified or unqualified scalar type. +3.3.4(22) +Improper cast of non-scalar type expression. +The operand for the cast operator shall be of scalar type. +3.3.4(23) +Cast a pointer into a non-integral type. +A pointer may be converted to an integral type. +3.3.4(31) +Cast a non-integral type into a pointer. +An integral type may be converted to a pointer. +3.3.4(31) +Duplicate member '%s' +Two members of a struct may not have the same name. +3.1.2.2(7,25) +Invalid constant expression. +Constant expressions shall not contain assignment, increment, decrement, +function-call, or comma operators, except when they are contained within +the operand of the sizeof operator. +3.4(9) +Constant expressions must be derived from a constant value or a constant +variable. +3.4 +Dangerous operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. This operand is NOT an lvalue, but we let it pass. +Note that a segmentation error with possible core dump will result +when the resulting address does not denote a valid (declared) +storage location. This feature will be discontinued in future +releases of the compiler! +3.3.3.2(36) +Unacceptable operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. +3.3.3.2(36) +'&' before array or function; ignored +Unacceptable operand of sizeof operator. +The sizeof operator shall not be applied to an expression that has +function type or an incomplete type, to the parenthesized name of such +a type, or to an lvalue that designates a bit-field object. +3.3.3.4 +Unacceptable operand of a multiplicative operator. +Each of the operands of a multiplicative operator shall have arithmetic type. +3.3.5(18) +Unacceptable operand of the remainder operator +Each of the operands of the remainder (%) operator shall have integral type. +3.3.5(18) +Unacceptable operand of '+'. +For the + operator, either both operands shall have arithmetic type, or +one operand shall be a pointer to an object type and the other shall +have integral type. +3.3.6(39) +Unacceptable operand of '-'. +For the subtraction operator, one of the following shall hold: both operands +have arithmetic type; operands are pointers to qualified or unqualified +versions of compatible object types; or the left operand is a pointer +to an object type and the right operand has integral type. +3.3.6(39) +Unacceptable operand of shift operator. +Each of the operands of bitwise shift operators shall have integral type. +3.3.7(9) +Unacceptable operand of relational operator. +For relational operators, one of the following shall hold: both +operands have arithmetic type; both operands are pointers to qualified +or unqualified versions of compatible object types; or both operands +are pointers to qualified or unqualified versions of compatible +incomplete types. +3.3.8(32) +Unacceptable operand of == or != +For the == or != operator, one of the following shall hold: both operands +are pointers to qualified or unqualified versions of compatible types; one +operand is a pointer to an object or incomplete type and the other is a +pointer to a qualified or unqualified version of void; or one operand is +a pointer and the other is a null pointer constant. +3.3.9(21) +Unacceptable operand of &. +Each of the operands shall have integral type. +3.3.10(7) +Unacceptable operand of ^. +Each of the operands shall have integral type. +3.3.11(18) +Unacceptable operand of |. +Each of the operands shall have integral type. +3.3.12(30) +Unacceptable operand of &&. +Each of the operands shall have scalar type. +3.3.13(7) +Unacceptable operand of ||. +Each of the operands shall have scalar type. +3.3.14(20) +Unacceptable operand of conditional operator. +The first operand of conditional operator shall have scalar type. One +of the following shall hold for the second and third operands: +both operands have arithmetic type; both operands have compatible +structure or union types; both operands have void type; both operands +are pointers to qualified or unqualified versions of compatible types; +one operand is a pointer and the other is a null pointer constant; or +one operand is pointer to an object or incomplete type and the other +is a pointer to a qualified or unqualified version of void. +3.3.15 +Duplicate label '%s' +A label name can only occur once in a function. +3.1.2.1(25) +Division by zero. +3.3.5 +Subscripting a non-array. +3.3.2.1 +Subscripting an array of incomplete type which is not an object type. +The element of the array shall have an object type. +3.3.2.1 +Should only subscript an array with an integral expression +3.3.2.1 +Subscripting an unbounded array +3.3.2.1 +Array index out of range +3.3.2.1 +Selector requires struct/union pointer as left hand side +In K&R mode the expression is implicitly converted to the '.' selector +for a struct/union left-hand side. +3.3.2.3 +Selector requires struct/union as left hand side +In K&R mode the expression is implicitly converted to the '->' selector +for a struct/union pointer left-hand side. +3.3.2.3 +member of structure or union required +3.3.2.3 +types have different qualifier specifications +For two qualified types to be compatible, both shall have the +identically qualified version of a compatible type; qualified +and unqualified versions of a type are distinct types. For two +types to be compatible their types must be the same. +3.5.3(26) +Incompatible array type due to different array size +For two array types to be compatible, both shall have compatible element +types; if both size specifiers are present, they shall have the +same value. +3.5.4.2(11) +Incompatible array type due to incompatible element type +For two array types to be compatible, both shall have compatible element +types. +3.5.4.2(11) +Incompatible pointer type assignment +The type pointed to by the left-hand side of simple assignment +statement is incompatible with the type pointed to by the right-hand side. +3.3.16.1, 3.5.4.1(21) +Incompatible base type of pointer type +K&R feature. +Type %s of %s is incompatible with type %s of %s +Incompatible types can be resolved by casting or by other means. +3.3.16.1 +illegal combination of pointer and integer +Assigning an integral expression to a pointer is a bad practice. +Type for %s is incompatible with %s +Incompatible types can be resolved by casting or by other means. +3.1.2.6 +Bad operand type for += or -= +3.3.16.2(26) +A case or default label appears outside a switch statement +A case or default label shall appear only in a switch statement. +3.6.1 +The controlling expression of the if statement is not scalar type +The controlling expression of an if statement shall have scalar type. +3.6.4.1 +The controlling expression of switch statement is not integral type +The controlling expression of an switch statement shall have integral type. +3.6.4.2(20) +The case label is not an integral constant expression +The case label shall be an integral constant expression. +3.6.4.2(22) +Duplicate case label in the same switch statement +No two of the case constant expressions in the same switch statement +shall have the same value after conversion. +3.6.4.2(22) +More than one default label in the same switch statement +There may be at most one default label in a switch statement. +3.6.4.2(23) +The controlling expression of the iteration statement is not scalar +type +The controlling expression of a iteration statement shall have scalar +type. +3.6.5.1 +label '%s' used, but not defined +The identifier in a goto statement shall name a label located +somewhere in the enclosing function. +3.6.6.1 +A continue statement shall appear only in or as a loop body +3.6.6.2 +A break statement shall appear only in or as a switch body or loop body +3.6.6.3 +A return statement with an expression should not appear +in a function '%s', whose return type is void +3.6.6.4(24) +A return statement without an expression appears in a +function '%s', whose return type is not void +If a return statement without an expression is executed, and the value +of the function call is used by the caller, the behavior is undefined. +3.6.6.4(33) +Internal Error: statement stack underflow +Long double not supported; double assumed. +Long float not standard; double assumed. +Only 'register' allowed in parameter declaration +The only storage-class specifier that shall occur in a parameter +declaration is 'register'; illegal storage class ignored. +3.5.4.3(25) +Name(s) without types in a function declaration +An old-style function declaration is not allowed to have names +in the parameter list; useless names ignored +3.5.4.3(26) +Functions cannot return functions +3.7.1(33), 3.3.2.2 +Functions cannot return a non-object type +3.3.2.2 +enum declaration must contain enum literals +Although structs or unions may delay the declaration of their members, +a similar construction with enum does not exist and is not necessary, +as there can be no mutual dependencies between the declaration of an +enumerated type and any other type. +3.5.2.3(27) +Register qualification has no effect for this type of object +Register declarations for array, struct, and function types have +no effect. +3.5.1(16), 3.5.1(19) +Functions cannot be declared 'register' +The declaration of an identifier for a function that has block +scope shall have no explicit storage-class specifier other than +'extern'. +3.5.1(19) +'%s' cannot be initialized +The type of the entity to be initialized shall be an object type +or an array of unknown size. +3.5.7(32) +Cannot initialize 'extern' variable '%s' within a function +If the declaration of an identifier has block scope, and the +identifier has 'extern' or 'static' linkage, the declaration +shall have no initializer for the identifier; initialization +allowed anyway. +3.5.7(35) +initializing an 'extern' is an ANSI C extension +conflicting declarations for '%s' +'static' and 'extern' declarations conflict. Which is meant? +3.1.2.2(15), 3.1.2.2(27) +Too many initial values for '%s' +3.5.7(1) +incompatible types in initialization +3.3.16(35) +redefinition of '%s'; previous definition at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +bit-fields as members of a union are an ANSI C invention. +storage size for '%s' isn't known +type mismatch in initialization +Missing braces in a union initialization or illegally formed +initialization. +3.5.7(5) +union '%s' only allowed one initializer for the first member +3.5.7(5) +width of '%s' exceeds its type +the specified bitfield width is too large to be contained within a +bitfield type. +structure has no member named '%s' +This is allowed for compatibility with AT&T pcc-based compilers. +Reference of an expression of void type or an incomplete type. +3.2.2.1 +element size of an array shall not be zero +3.2.2.5(25) +invalid combination of type specifiers +Although order is unimportant, not all type specifiers can occur together. +3.5.2 +declaration must at least declare an identifier, tag, or the member of an enumeration +3.5(16) +at most one storage class may be given in the declaration +Duplicate occurrence ignored. +3.5.1(10) +size of function's return type is zero +The return type of a function must be void or an object type other than array. +3.7.1(33) +Expecting an integral return type from the main function +identifier missing from parameter declaration +Prototypes for function definitions require identifiers in parameter +declarations. +3.7.1(4) +only 'register' allowed for storage class for parameters +The declarations in the declaration list shall contain no storage class +other than 'register', and no initializations. +3.7.1(10) +parameters declarations can not have initializations +3.7.1(10) +only one instance of 'void' allowed in the parameter list +'void' must occur by itself (specifying that the function has no parameters). +3.5.4.3(1) +%s must have function type +1) An argument list must be explicitly present in the declarator; it cannot + be inherited from a typedef (3.5.4.3). +2) The declarator is not a function. +3.7.1(30) +Illegal hexadecimal constant +You have no digits after the 0x or 0X. 0x0 assumed. +3.1.3.2 +value overflows its type in this context. Value is set to be '%s'! +3.2.1.4 +value is outside range representable for type '%s' +missing member name +K&R mode permits a missing member name; otherwise, only bitfields can omit +the member name. +3.5.2.1(10) +useless keyword or type name in declaration +Type was ignored. +'%s' declared within and is limited to this function prototype +Possible program error, since parameter type checking will always fail +unless the type declaration is visible to the caller. +3.1.2.1(35) +Extra spaces within operator, %s assumed +In ANSI C, the compound assignment operator cannot have embedded +white space characters. +3.1.5 +missing size for array '%s' +Incomplete types permitted for identifiers with internal or +external linkage, but not automatic linkage. +3.1.2.5(10) +can't jump into (from outside of) the body of a 'try' or into either type of handler +'%s' missing, please #include excpt.h +excpt.h required to declare exception statements, intrinsics or compiler +runtime names. +local function declarations cannot be 'static' +A function declaration can only contain the storage-class 'static' +if it is at file scope. Declaration made 'extern'. +3.5.1(19) +static function '%s' declared and referenced, but not defined. +If an identifier declared with internal linkage is used in an +expression (other than as a part of the operand of a sizeof +operator), there shall be exactly one external definition for +the identifier in the translation unit. +3.7(12) +pragma argument '%s' must be declared prior to being used in a pragma +Pragma name ignored. +Pragma not supported +'%s' not enabled as intrinsic +It may have already appeared in a function pragma, or never occurred in +an intrinsic pragma. +'%s' is already enabled as an intrinsic +weak definition for '%s' is later redefined; pragma weak ignored. +definition of primary name '%s' not found; pragma weak ignored. +definition of secondary name '%s' not found; pragma weak ignored. +primary name '%s' is declared as a common or external, and is not defined +with initial value within this file; pragma weak ignored. +useless '%s' storage class ignored +array of functions not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +array of voids not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +argument for pragma pack must be an integer constant; pragma ignored +'%s' has wrong tag type. +Identifier redeclared in the same scope/block. +3.1.2.3 +missing dimension bound +For multidimensional arrays, the constant bounds of the array may be +omitted only for the first member of the sequence. +3.1.2.5(23) +Internal error in parameters to function substr; loc: '%s'; len: '%s'. +Internal error in parameters to function insertstr; indx: '%s'. +Internal error in function get_tag_name; input is a non-tagged type. +Internal error in function gen_type_str -- not a type tree '%s' +Cannot open file '%s' +Prototype should be moved after tag or a typedef declaration. +Please look for comments in the extracted header file. +The extracted header file includes prototypes for static functions, +which should be removed, if you wish to include the header in a source file +other than the originator. +ANSI C requires formal parameter before "..." +This extension is meant to be used for compatibility with varargs.h +3.5.4.3(35) +syntax error: "&..." invalid +extension used to access "..." formal arguments. +function '%s' initialized like a variable +The type of entity to be initialized shall be an object type or an +array of unknown size. +3.5.7(31) +initializer not an array aggregate +The initializer for an object that has aggregate type shall be a +brace-enclosed list of initializers for the members of the aggregate, +written in increasing subscript or member order. +3.5.7(20) +'%s' type is incomplete; cannot initialize +Was the struct ever defined? +3.5.7.(31) +'%s' is not standard ANSI. +This keyword/type is not defined in strict ANSI mode. +3.1.1 +not a legal asm string +The first operand of an asm string should be, after argument substitution, +a legal assembly string. +The -float option will be ignored in ANSI mode. +The -float option is ignored, since otherwise program semantics would +violate the ANSI standard. In particular, fp constants are always +'double' with ANSI-C, while with -float the type of fp constants will +depend on the context and may be 'float'. +ANSI C support unavailable with C compiler bundled with RISC/os +The C compiler bundled with RISC/os does not support ANSI C. ANSI +C support requires a separate license. +Ignored invalid warning number(s) in -woff option, %s%s ! +Warning numbers must be in the range %s to %s. +The set of warning numbers in cfe is disjoint from the set of warning numbers +in accom, since accom warnings cannot be mapped one-to-one to cfe warnings. +'%s' not handled as an intrinsic due to incompatible argument types . +'__unalign' only qualifies pointers +'__unalign' indicates the object pointed at by pointer is unaligned (e.g., +int * __unalign p). This is an extension to ANSI C and like 'volatile' +and 'const' can follow the '*' in pointer declarations, but unlike both +cannot qualify a base type. +index expression is an anachronism +ANSI C++ doesn't support array index expressions in delete. +5.3.4 +member cannot be of function or incomplete type. +3.5.2.1(12) +Illegal lint option, '%s', is ignored. +cannot open header message buffer file +cannot write header message buffer file +cannot read header message buffer file +cannot seek in header message buffer file +struct/union/enum '%s' is used, but not defined +static '%s' unused +nonportable character comparison (chars may be signed or unsigned) +redundant comparison of unsigned with constant expression +redundant statement, control flow cannot reach this statement +'%s' may be used before set +function parameter '%s' is not used in function '%s' +'%s' can be const qualified, since it is not set within its lifetime. +'%s' is not used in function '%s' +'%s' set but unused in function '%s' +control may fall through %s statement +function '%s' has return(e); and return; +function '%s' may return random value to place of invocation %s +label without goto: '%s' +only %s bits of '%s' constant (type '%s') are explicitly given +explicit conversion from '%s' to '%s' %s +implicit conversion from '%s' to '%s' %s +'%s' may be indistinguishable from '%s' due to internal name truncation +Promoted formal parameter and promoted argument have incompatible types +No prototype for the definition of '%s' %s +References to '%s' are substituted by its literal initializer + (as included in %s) +============== +unsupported language linkage +string-literal specifies an unsupported linkage +7.4(1) +No prototype for the call to %s +To achieve better type-checking, there should be a full prototype for +the function being called. +3.5.4.3 +'inline' only applies to function declarations +leave statment can occur only within try body +Microsoft extension +Use of a Microsoft extension detected without usage of the +compiler option -msft. +No parameter mentioned +A file with no declarations or definitions is accepted as an extension to ANSI C +The translation unit must contain at least one external definition. +3.7 +Incompatible signed and unsigned version of a type +Yacc initialization error +Internal error: yacc cannot initialize itself. +The cfe option %s may not be in future releases. We suggest that you not use this option! +Incompatible char and unsigned char versions of a type +Lshift with undefined behaviour. +Lshift with a negative right operand, or a right operand that is greater +than or equal to the width in bits of the promoted left operand, results +in undefined behaviour. +3.3.7(11) +useless type name in declaration, possibly a semicolon is missing. +Type was ignored. +constant initializer expression is invalid (refers to automatic variables). +All the expressions in an initializer for an object that has static storage +duration or in the initializer list for an object that has aggregate or +union type shall be constant expressions. Otherwise, unexpected results +may occur. +3.5.7(32) and 3.4 +invalid explicit or implicit conversion of an address constant to an integral value in a constant initializing expression. +An address constant in a constant initializing expression can neither +initialize a bit-field nor be directly or indirectly converted to an +integral type of size different from an address type. +6.4 diff --git a/tools/ido_recomp/windows/7.1/ugen.exe b/tools/ido_recomp/windows/7.1/ugen.exe new file mode 100644 index 0000000000..e6533ab0bd Binary files /dev/null and b/tools/ido_recomp/windows/7.1/ugen.exe differ diff --git a/tools/ido_recomp/windows/7.1/uopt.exe b/tools/ido_recomp/windows/7.1/uopt.exe new file mode 100644 index 0000000000..5033f72b1b Binary files /dev/null and b/tools/ido_recomp/windows/7.1/uopt.exe differ diff --git a/tools/mipsdisasm b/tools/mipsdisasm deleted file mode 100644 index 4847ff12b2..0000000000 Binary files a/tools/mipsdisasm and /dev/null differ diff --git a/tools/overlayhelpers/DamageTable.py b/tools/overlayhelpers/DamageTable.py deleted file mode 100755 index 5bad30f425..0000000000 --- a/tools/overlayhelpers/DamageTable.py +++ /dev/null @@ -1,22 +0,0 @@ -import struct - -ROM_ADDR = 0xDA3210 -COUNT = 1 - -rom = open("../../baserom.z64", "rb") -rom.seek(ROM_ADDR) -data = bytearray(rom.read(0x20 * COUNT)) -rom.close() - -valFormat = "0x{:02X}" -sfmt = "" -for i in range(4): - sfmt += valFormat + ", " - -for i in range(3): - sfmt += sfmt - -sfmt = "{{ {{ " + sfmt + "}} }}," -for i in range(COUNT): - line = struct.unpack_from(">32B", data, i * 0x20) - print(sfmt.format(*line)) diff --git a/tools/overlayhelpers/colliderinit.py b/tools/overlayhelpers/colliderinit.py index 9d958405f9..da99e4e986 100755 --- a/tools/overlayhelpers/colliderinit.py +++ b/tools/overlayhelpers/colliderinit.py @@ -6,24 +6,24 @@ import argparse from filemap import FileResult, GetFromVRam, GetFromRom T_DEFAULT = '' -T_SET3 = '_Set3' +TType1 = 'Type1' T_ACTOR = '_Actor' TYPE_ENUM = [ - "COLTYPE_UNK0", - "COLTYPE_UNK1", - "COLTYPE_UNK2", - "COLTYPE_UNK3", - "COLTYPE_UNK4", - "COLTYPE_UNK5", - "COLTYPE_UNK6", - "COLTYPE_UNK7", - "COLTYPE_UNK8", - "COLTYPE_METAL_SHIELD", - "COLTYPE_UNK10", - "COLTYPE_WOODEN_SHIELD", - "COLTYPE_UNK12", - "COLTYPE_UNK13" ] + "COLTYPE_HIT0", + "COLTYPE_HIT1", + "COLTYPE_HIT2", + "COLTYPE_HIT3", + "COLTYPE_HIT4", + "COLTYPE_HIT5", + "COLTYPE_HIT6", + "COLTYPE_HIT7", + "COLTYPE_HIT8", + "COLTYPE_METAL", + "COLTYPE_NONE", + "COLTYPE_WOOD", + "COLTYPE_HARD", + "COLTYPE_TREE" ] SHAPE_ENUM = [ "COLSHAPE_JNTSPH", @@ -31,35 +31,188 @@ SHAPE_ENUM = [ "COLSHAPE_TRIS", "COLSHAPE_QUAD" ] +ELEMTYPE_UNKENUM = [ + "ELEMTYPE_UNK0", + "ELEMTYPE_UNK1", + "ELEMTYPE_UNK2", + "ELEMTYPE_UNK3", + "ELEMTYPE_UNK4", + "ELEMTYPE_UNK5", + "ELEMTYPE_UNK6"] + +ATFLAGS_ENUM = [ + "AT_ON", + "AT_HIT", + "AT_BOUNCED", + "AT_TYPE_PLAYER", + "AT_TYPE_ENEMY", + "AT_TYPE_OTHER", + "AT_SELF"] + +ACFLAGS_ENUM = [ + "AC_ON", + "AC_HIT", + "AC_HARD", + "AC_TYPE_PLAYER", + "AC_TYPE_ENEMY", + "AC_TYPE_OTHER", + "AC_NO_DAMAGE", + "AC_BOUNCED"] + +OCFLAGS_ENUM = [ + "OC1_ON", + "OC1_HIT", + "OC1_NO_PUSH", + "OC1_TYPE_PLAYER", + "OC1_TYPE_1", + "OC1_TYPE_2"] + +OCTYPE_ENUM = [ + "OC2_HIT_PLAYER", + "OC2_UNK1", + "OC2_UNK2", + "OC2_TYPE_PLAYER", + "OC2_TYPE_1", + "OC2_TYPE_2", + "OC2_FIRST_ONLY"] + +TOUCHERFLAGS_ENUM = [ + "TOUCH_ON", + "TOUCH_HIT", + "TOUCH_NEAREST", + "TOUCH_SFX_HARD", + "TOUCH_SFX_WOOD", + "TOUCH_AT_HITMARK", + "TOUCH_DREW_HITMARK", + "TOUCH_UNK7"] + +BUMPERFLAGS_ENUM = [ + "BUMP_ON", + "BUMP_HIT", + "BUMP_HOOKABLE", + "BUMP_NO_AT_INFO", + "BUMP_NO_DAMAGE", + "BUMP_NO_SWORD_SFX", + "BUMP_NO_HITMARK", + "BUMP_DRAW_HITMARK"] + +OCELEMFLAGS_ENUM = [ + "OCELEM_ON", + "OCELEM_HIT", + "OCELEM_UNK2", + "OCELEM_UNK3", + "OCELEM_UNK4", + "OCELEM_UNK5", + "OCELEM_UNK6", + "OCELEM_UNK7",] + sf_ColliderInit = ">BBBBBB" -sf_ColliderInit_Set3 = ">BBBBB" -sf_ColliderInit_Actor = ">IBBBB" +sf_ColliderInitType1 = ">BBBBB" +sf_ColliderInitToActor = ">IBBBB" sf_ColliderBodyInit = ">B3xIBB2xIBB2xBBB" sf_JntSph = ">II" -sf_JntSphItem = ">Bx5h" +sf_JntSphElement = ">Bx5h" sf_Cylinder16 = ">6h" sf_Tris = ">II" -sf_TrisItem = ">9f" +sf_TrisElement = ">9f" sf_Quad = ">12f" -f_ColliderInit = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, 0x{4:02X}, {5} }}" -f_ColliderInit_Set3 = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, {4} }}" -f_ColliderInit_Actor = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, {4} }}" -f_ColliderBodyInit = "{{ 0x{0:02X}, {{ 0x{1:08X}, 0x{2:02X}, 0x{3:02X} }}, {{ 0x{4:08X}, 0x{5:02X}, 0x{6:02X} }}, 0x{7:02X}, 0x{8:02X}, 0x{9:02X} }}" +f_ColliderInit = "{{ {0}, {1}, {2}, {3}, {4}, {5}, }}" +f_ColliderInitType1 = "{{ {0}, {1}, {2}, {3}, {4}, }}" +f_ColliderInitToActor = "{{ {0}, {1}, {2}, {3}, {4}, }}" +f_ColliderBodyInit = "{{ {0}, {{ 0x{1:08X}, 0x{2:02X}, 0x{3:02X} }}, {{ 0x{4:08X}, 0x{5:02X}, 0x{6:02X} }}, {7}, {8}, {9}, }}" f_JntSph = "{0}, D_{1:08X}" -f_JntSphItem = "{{ {0}, {{ {{ {1}, {2}, {3} }}, {4} }}, {5} }}" +f_JntSphElement = "{{ {0}, {{ {{ {1}, {2}, {3} }}, {4} }}, {5} }}" f_Cylinder16 = "{{ {0}, {1}, {2}, {{ {3}, {4}, {5} }} }}" f_Tris = "{0}, D_{1:08X}" -f_TrisItem = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }} }} }}" +f_TrisElement = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }} }} }}" f_Quad = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }}, {{ {9}f, {10}f, {11}f }} }} }}" +def GetATflags(at): + for i, flag in enumerate(ATFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "AT_ON" + else: + output = "AT_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("AT_TYPE_PLAYER | AT_TYPE_ENEMY | AT_TYPE_OTHER","AT_TYPE_ALL") + +def GetACflags(at): + for i, flag in enumerate(ACFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "AC_ON" + else: + output = "AC_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("AC_TYPE_OTHER | AC_TYPE_ENEMY | AC_TYPE_PLAYER","AC_TYPE_ALL") + +def GetOCflags(at): + for i, flag in enumerate(OCFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "OC1_ON" + else: + output = "OC1_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2","OC1_TYPE_ALL") + +def GetOCtype(at): + output = "" + for i, flag in enumerate(OCTYPE_ENUM): + if(at & (1 << i)): + output = " | " + flag + output + if(output == ""): + return "OC2_NONE" + else: + return output.strip(" | ") + +def GetToucherFlags(at): + for i, flag in enumerate(TOUCHERFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "TOUCH_ON" + else: + output = "TOUCH_NONE" + elif(at & (1 << i)): + output += " | " + flag + if(i == 4 and output.find("SFX") == -1 and output.find("OFF") == -1): + output += " | TOUCH_SFX_NORMAL" + return output.replace("TOUCH_SFX_HARD | TOUCH_SFX_WOOD", "TOUCH_SFX_NONE") + +def GetBumperFlags(at): + for i, flag in enumerate(BUMPERFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "BUMP_ON" + else: + output = "BUMP_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output + +def GetOcElemFlags(at): + for i, flag in enumerate(OCELEMFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "OCELEM_ON" + else: + output = "OCELEM_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output + def GetColliderFormat(type): if type == T_DEFAULT: return (sf_ColliderInit, f_ColliderInit) - if type == T_SET3: - return (sf_ColliderInit_Set3, f_ColliderInit_Set3) + if type == TType1: + return (sf_ColliderInitType1, f_ColliderInitType1) if type == T_ACTOR: - return (sf_ColliderInit_Actor, f_ColliderInit_Actor) + return (sf_ColliderInitToActor, f_ColliderInitToActor) return None def GetColliderStr(data, off, type): @@ -76,9 +229,15 @@ def GetColliderStr(data, off, type): else: cBase[0] = '0x{0:02X}'.format(cBase[0]) - i = 4 + cBase[1] = GetATflags(cBase[1]) + cBase[2] = GetACflags(cBase[2]) + cBase[3] = GetOCflags(cBase[3]) + if type == T_DEFAULT: + cBase[4] = GetOCtype(cBase[4]) i = 5 + else: + i = 4 if cBase[i] < 4: cBase[i] = SHAPE_ENUM[cBase[i]] @@ -91,8 +250,18 @@ def GetItems(data, off, count, structf, fmt, size): result = '' for i in range(count): ioff = (i * size) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + ioff) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + ioff)) cItem = struct.unpack_from(structf, data, off + 0x18 + ioff) + + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + result += ''' {{ {0}, @@ -100,10 +269,10 @@ def GetItems(data, off, count, structf, fmt, size): }},'''.format(f_ColliderBodyInit.format(*cBody), fmt.format(*cItem)) return result -def GetJntSphItems(data, off, count): - items = GetItems(data, off, count, sf_JntSphItem, f_JntSphItem, 0x24) - print(''' -static ColliderJntSphItemInit sJntSphItemsInit[{0}] = {{{1} +def GetJntSphElements(data, off, count): + items = GetItems(data, off, count, sf_JntSphElement, f_JntSphElement, 0x24) + return(''' +static ColliderJntSphElementInit sJntSphElementsInit[{0}] = {{{1} }}; '''.format(count, items)) @@ -111,79 +280,147 @@ def GetJntSph(data, off, type): sBase = GetColliderStr(data, off, type) cJntSph = struct.unpack_from(sf_JntSph, data, off + 8) - print(''' -static ColliderJntSphInit{0} sJntSphInit = -{{ + return(''' +static ColliderJntSphInit{0} sJntSphInit = {{ {1}, {2}, }}; - '''.format(type, sBase, f_JntSph.format(*cJntSph))) +'''.format(type, sBase, f_JntSph.format(*cJntSph))) -def GetTrisItems(data, off, count): - items = GetItems(data, off, count, sf_TrisItem, f_TrisItem, 0x3C) - print(''' -static ColliderTrisItemInit sTrisItemsInit[{0}] = {{{1} +def GetTrisElements(data, off, count): + items = GetItems(data, off, count, sf_TrisElement, f_TrisElement, 0x3C) + return(''' +static ColliderTrisElementInit sTrisElementsInit[{0}] = {{{1} }}; '''.format(count, items)) def GetCylinder(data, off, type): sBase = GetColliderStr(data, off, type) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08)) cCyl16 = struct.unpack_from(sf_Cylinder16, data, off + 0x20) - print(''' -static ColliderCylinderInit{0} sCylinderInit = -{{ + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + + return(''' +static ColliderCylinderInit{0} sCylinderInit = {{ {1}, {2}, {3}, }}; - '''.format(type, sBase, f_ColliderBodyInit.format(*cBody),f_Cylinder16.format(*cCyl16))) +'''.format(type,sBase,f_ColliderBodyInit.format(*cBody),f_Cylinder16.format(*cCyl16))) def GetTris(data, off, type): sBase = GetColliderStr(data, off, type) cTris = struct.unpack_from(sf_Tris, data, off + 8) - print(''' -static ColliderTrisInit{0} sTrisInit = -{{ + return(''' +static ColliderTrisInit{0} sTrisInit = {{ {1}, {2}, }}; - '''.format(type, sBase, f_Tris.format(*cTris))) +'''.format(type, sBase, f_Tris.format(*cTris))) def GetQuad(data, off, type): sBase = GetColliderStr(data, off, type) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08)) cQuad = struct.unpack_from(sf_Quad, data, off + 0x20) - print(''' -static ColliderQuadInit{0} sQuadInit = -{{ + + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + + return(''' +static ColliderQuadInit{0} sQuadInit = {{ {1}, {2}, {3}, }}; - '''.format(type, sBase, f_ColliderBodyInit.format(*cBody), f_Quad.format(*cQuad))) +'''.format(type, sBase, f_ColliderBodyInit.format(*cBody), f_Quad.format(*cQuad))) -TYPE_DICT = { - 'ColliderJntSphInit' : (GetJntSph, 'Shape', T_DEFAULT), - 'ColliderCylinderInit' : (GetCylinder, 'Shape', T_DEFAULT), - 'ColliderTrisInit': (GetTris, 'Shape', T_DEFAULT), - 'ColliderQuadInit': (GetQuad, 'Shape', T_DEFAULT), - 'ColliderJntSphItemInit' : (GetJntSphItems, 'Item'), - 'ColliderTrisItemInit' : (GetTrisItems, 'Item') -} +def GetColliderInit(address, type, num, path): + TYPE_DICT = { + 'ColliderJntSphInit' : (GetJntSph, 'Shape', T_DEFAULT), + 'ColliderCylinderInit' : (GetCylinder, 'Shape', T_DEFAULT), + 'ColliderTrisInit': (GetTris, 'Shape', T_DEFAULT), + 'ColliderQuadInit': (GetQuad, 'Shape', T_DEFAULT), + 'ColliderJntSphElementInit' : (GetJntSphElements, 'Item'), + 'ColliderTrisElementInit' : (GetTrisElements, 'Item') + } + + update = [(k, v[0]) for k,v in TYPE_DICT.items() if v[1] == 'Shape'] + for i in update: + for j in (TType1, T_ACTOR): + TYPE_DICT[i[0] + j] = (i[1], 'Shape', j) + + fileResult = None + + if address >= 0x80000000: + fileResult = GetFromVRam(address) + else: + fileResult = GetFromRom(address) + + if fileResult is None: + return("Invalid address") + + print(fileResult) + + selectedType = TYPE_DICT[type] + arg2 = None + if selectedType[1] == 'Shape': + arg2 = selectedType[2] + elif num > 0: + arg2 = num + else: + return("ItemInit type must specify number of elements") + + ovlFile = open(path + "/baserom/" + fileResult.name, "rb") + ovlData = bytearray(ovlFile.read()) + ovlFile.close() + + return selectedType[0](ovlData, fileResult.offset, arg2) + +def GetColliderInitFull(address, type, num, path): + if(type.find('Element') != -1): + return GetColliderInit(address, type, num, path) + + base = GetColliderInit(address, type, 0, path) + + if(type.find('JntSph') != -1): + [num, address2, dummy] = base.split('\n')[3].split(',') + hexaddress = int(address2.strip(' D_'), 16) + if(hexaddress == 0): + return base.replace(address2,' NULL') + else: + elements = GetColliderInit(hexaddress, 'ColliderJntSphElementInit', int(num), path) + return elements + base.replace(address2,' sJntSphElementsInit') + elif(type.find('Tris') != -1): + [num, address2, dummy] = base.split('\n')[3].split(',') + hexaddress = int(address2.strip(' D_'), 16) + if(hexaddress == 0): + return base.replace(address2,' NULL') + else: + elements = GetColliderInit(hexaddress, 'ColliderTrisElementInit', int(num), path) + return elements + base.replace(address2,' sTrisElementsInit') + else: + return base -update = [(k, v[0]) for k,v in TYPE_DICT.items() if v[1] == 'Shape'] -for i in update: - for j in (T_SET3, T_ACTOR): - TYPE_DICT[i[0] + j] = (i[1], 'Shape', j) - #ovlName = 'ovl_Obj_Comb' -#address = 0x000780 -#inputType = 'ColliderJntSphItemInit' +#address = 0x000780 +#inputType = 'ColliderJntSphElementInit' #ovlName = 'ovl_En_Boom' #address = 0x0007D0 @@ -201,33 +438,40 @@ parser.add_argument('num', nargs='?', default=0, type=HexParse, help="Number of args = parser.parse_args() -fileResult = None +scriptDir = os.path.dirname(os.path.realpath(__file__)) -if args.address >= 0x80000000: - fileResult = GetFromVRam(args.address) -else: - fileResult = GetFromRom(args.address) +repo = scriptDir + os.sep + ".." + os.sep + ".." -if fileResult is None: - print("Invalid address") - exit() +print(GetColliderInitFull(args.address, args.type, args.num, repo)) +# print(GetColliderInit(args.address, args.type, args.num, "../..")) -print(fileResult) +# fileResult = None -selectedType = TYPE_DICT[args.type] -arg2 = None -if selectedType[1] == 'Shape': - arg2 = selectedType[2] -elif args.num > 0: - arg2 = args.num -else: - print("ItemInit type must specify number of elements") - exit() +# if args.address >= 0x80000000: +# fileResult = GetFromVRam(args.address) +# else: +# fileResult = GetFromRom(args.address) -script_dir = os.path.dirname(os.path.realpath(__file__)) +# if fileResult is None: +# print("Invalid address") +# exit() -ovlFile = open(script_dir + "/../../baserom/" + fileResult.name, "rb") -ovlData = bytearray(ovlFile.read()) -ovlFile.close() +# print(fileResult) -selectedType[0](ovlData, fileResult.offset, arg2) +# selectedType = TYPE_DICT[args.type] +# arg2 = None +# if selectedType[1] == 'Shape': +# arg2 = selectedType[2] +# elif args.num > 0: +# arg2 = args.num +# else: +# print("ItemInit type must specify number of elements") +# exit() + +# script_dir = os.path.dirname(os.path.realpath(__file__)) + +# ovlFile = open(script_dir + "/../../baserom/" + fileResult.name, "rb") +# ovlData = bytearray(ovlFile.read()) +# ovlFile.close() + +# selectedType[0](ovlData, fileResult.offset, arg2) diff --git a/tools/overlayhelpers/damage_table.py b/tools/overlayhelpers/damage_table.py new file mode 100644 index 0000000000..3dedb31545 --- /dev/null +++ b/tools/overlayhelpers/damage_table.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 + +import os +import argparse +from filemap import FileResult, GetFromVRam, GetFromRom + +damage_types = [ + 'Deku nut', + 'Deku stick', + 'Slingshot', + 'Explosive', + 'Boomerang', + 'Normal arrow', + 'Hammer swing', + 'Hookshot', + 'Kokiri sword', + 'Master sword', + "Giant's Knife", + 'Fire arrow', + 'Ice arrow', + 'Light arrow', + 'Unk arrow 1', + 'Unk arrow 2', + 'Unk arrow 3', + 'Fire magic', + 'Ice magic', + 'Light magic', + 'Shield', + 'Mirror Ray', + 'Kokiri spin', + 'Giant spin', + 'Master spin', + 'Kokiri jump', + 'Giant jump', + 'Master jump', + 'Unknown 1', + 'Unblockable', + 'Hammer jump', + 'Unknown 2' +] + +def convert_dmg_table_str(dmg_table_str): + split_data = dmg_table_str.replace(' ','').replace('\n','').replace('{',',').replace('}',',').split(',') + hex_data = [int(x, 16) for x in split_data if '0x' in x] + + name = dmg_table_str.split('=')[0].split()[-1] + + return make_table(name, hex_data) + +def replace_damage_table_all(repo): + actors = 'src' + os.sep + 'overlays' + os.sep + 'actors' + for subdir, dirs, files in os.walk(repo + os.sep + actors): + for filename in files: + if(filename.endswith('.c')): + file = subdir + os.sep + filename + status = replace_damage_table(file) + if(status < 0): + print('Encountered error in', file) + elif(status > 0): + print('Updated', status, 'table' + ('s' if status > 1 else ''), file) + return 1 + +def replace_damage_table(src): + with open(src, 'r', encoding = 'utf-8') as srcfile: + srcdata = srcfile.readlines() + read_table = False + replacements = [] + + for i, line in enumerate(srcdata): + if("DamageTable" in line and "= {" in line): + if(read_table): + print('Bad formatting in', file, 'at line', i) + return -1 + else: + read_table = True + start = i + + if(read_table and "DMG_" in line): + read_table = False + + if(read_table and ";" in line): + dmg_table_str = "".join(srcdata[start:i+1]) + damage_table = convert_dmg_table_str(dmg_table_str) + replacements += [[dmg_table_str, damage_table]] + read_table = False + + if len(replacements) == 0: + return 0 + + with open(src,'r', encoding = 'utf-8') as srcfile: + srcstr = srcfile.read() + for replace in replacements: + srcstr = srcstr.replace(replace[0], replace[1]) + with open(src,'w', encoding = 'utf-8', newline = '\n') as outfile: + outfile.write(srcstr) + return len(replacements) + +def make_table(name, data): + damage_table = "DamageTable " + name + " = {\n" + linestart = " /* " + padlen = max([len(x) for x in damage_types]) + for i, dbyte in enumerate(data): + typestr = damage_types[i] + typestr += ' ' * (padlen - len(typestr)) + ' */ ' + damage_table += linestart + typestr + format_damage_byte(dbyte) + damage_table += '};\n' + + return damage_table + +def format_damage_byte(dbyte): + effect = (dbyte >> 4) & 0xF + damage = dbyte & 0xF + + effstr = format(effect, 'X') + dstr = str(damage) + + dtentry = 'DMG_ENTRY(' + dstr + ' , 0x' + effstr + '),\n' + + return dtentry + +def get_damage_bytes(address, repo): + file_result = None + + if address >= 0x80000000: + file_result = GetFromVRam(address) + else: + file_result = GetFromRom(address) + + if file_result is None: + print("Invalid address") + exit() + + print(file_result) + + with open(repo + os.sep + "baserom" + os.sep + file_result.name, "rb") as ovl_file: + ovl_data = bytearray(ovl_file.read()) + + damage_data = ovl_data[file_result.offset:file_result.offset+0x20] + + damage_table = make_table('D_' + format(address, 'X'), damage_data) + + return damage_table + +def hex_parse(s): + return int(s, 16) + +parser = argparse.ArgumentParser(description = "Converts raw bytes into a formatted damage table") +parser.add_argument('-a', metavar='address', dest='address', help="VRam or Rom address of the damage table", type=hex_parse) +parser.add_argument('-f', metavar='file', dest='file', help='C file with unformatted damage tables') + +if __name__ == "__main__": + args = parser.parse_args() + script_dir = os.path.dirname(os.path.realpath(__file__)) + repo = script_dir + os.sep + ".." + os.sep + ".." + if(args.address): + print(get_damage_bytes(args.address, repo)) + elif(args.file): + replace_damage_table(args.file) + else: + print('Error: address or file required. Use -h for more detail.') diff --git a/undefined_syms.txt b/undefined_syms.txt index 6dec19bf9b..24cf37f7be 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -567,6 +567,12 @@ D_060014E0 = 0x060014E0; D_060053D0 = 0x060053D0; D_06007564 = 0x06007564; +// z_bg_jya_cobra +D_0601167C = 0x0601167C; +D_06010790 = 0x06010790; +D_06010C20 = 0x06010C20; +D_060117D0 = 0x060117D0; + // z_en_lightbox D_06001F10 = 0x06001F10; D_06000B70 = 0x06000B70; @@ -1900,6 +1906,7 @@ D_0600ED7C = 0x0600ED7C; D_06000A10 = 0x06000A10; D_06005E30 = 0x06005E30; D_06006F70 = 0x06006F70; +D_06000C2C = 0x06000C2C; // z_bg_hidan_hamstep D_0600A548 = 0x0600A548;