ovl_En_Jsjutan with 1 non_matching (#713)

* Init

Signed-off-by: angie <angheloalf95@gmail.com>

* destroy and non_matching update

Signed-off-by: angie <angheloalf95@gmail.com>

* declare externs to data

Signed-off-by: angie <angheloalf95@gmail.com>

* nonmatching draw

Signed-off-by: angie <angheloalf95@gmail.com>

* everything is a disaster

Signed-off-by: angie <angheloalf95@gmail.com>

* import bss

Signed-off-by: angie <angheloalf95@gmail.com>

* first step to extract data

Signed-off-by: angie <angheloalf95@gmail.com>

* import data

Signed-off-by: angie <angheloalf95@gmail.com>

* func_80A89860

Signed-off-by: angie <angheloalf95@gmail.com>

* draw

Signed-off-by: angie <angheloalf95@gmail.com>

* func_80A89A6C is crap

Signed-off-by: angie <angheloalf95@gmail.com>

* EnJsjutan_Update

Signed-off-by: angie <angheloalf95@gmail.com>

* change some hexs into decs

Signed-off-by: angie <angheloalf95@gmail.com>

* convert hexs of D_80A8AA98 into decimals and run format.sh

Signed-off-by: angie <angheloalf95@gmail.com>

* move data to its own file

Signed-off-by: angie <angheloalf95@gmail.com>

* this function is nightmare

Signed-off-by: angie <angheloalf95@gmail.com>

* i'm really trying

Signed-off-by: angie <angheloalf95@gmail.com>

* i think i am finally doing it

Signed-off-by: angie <angheloalf95@gmail.com>

* move the temps to where they are used

Signed-off-by: angie <angheloalf95@gmail.com>

* rename distance

Signed-off-by: Angie <angheloalf95@gmail.com>

* rename a few variables

Signed-off-by: Angie <angheloalf95@gmail.com>

* unclamp stuff :s

Signed-off-by: Angie <angheloalf95@gmail.com>

* i tried to see if i'm going better that older way

Signed-off-by: Angie <angheloalf95@gmail.com>

* moving stuff around

Signed-off-by: Angie <angheloalf95@gmail.com>

* this is the third try

Signed-off-by: angie <angheloalf95@gmail.com>

* changing bit by bit

Signed-off-by: angie <angheloalf95@gmail.com>

* step by step

Signed-off-by: angie <angheloalf95@gmail.com>

* more stuff

Signed-off-by: angie <angheloalf95@gmail.com>

* slow

Signed-off-by: angie <angheloalf95@gmail.com>

* a few small changes

Signed-off-by: angie <angheloalf95@gmail.com>

* go back to second try

Signed-off-by: Angie <angheloalf95@gmail.com>

* changing a s8 to u8 made a bigger difference than expected

Signed-off-by: Angie <angheloalf95@gmail.com>

* i am slowly doing it

Signed-off-by: Angie <angheloalf95@gmail.com>

* some problems are so dumb

Signed-off-by: Angie <angheloalf95@gmail.com>

* it is improving slowly again

Signed-off-by: Angie <angheloalf95@gmail.com>

* erase the old tries

Signed-off-by: Angie <angheloalf95@gmail.com>

* remove four variables

Signed-off-by: Angie <angheloalf95@gmail.com>

* fix the missing instructions at the end

Signed-off-by: angie <angheloalf95@gmail.com>

* theres only regalloc problems left

Signed-off-by: angie <angheloalf95@gmail.com>

* fix stack

Signed-off-by: angie <angheloalf95@gmail.com>

* add ifdef non_matching

Signed-off-by: Angie <angheloalf95@gmail.com>

* i'm getting desesperate

Signed-off-by: Angie <angheloalf95@gmail.com>

* Remove unnecessary casts

Signed-off-by: Angie <angheloalf95@gmail.com>

* random stuff that improves codegen

Signed-off-by: angie <angheloalf95@gmail.com>

* dumb is dumb

Signed-off-by: angie <angheloalf95@gmail.com>

* erase stuff

Signed-off-by: angie <angheloalf95@gmail.com>

* add some comments

Signed-off-by: Angie <angheloalf95@gmail.com>

* use bomb_explosion param and add some comments

Signed-off-by: angie <angheloalf95@gmail.com>

* add a few comments in about stuff

Signed-off-by: Angie <angheloalf95@gmail.com>

* extract carpet's texture instead of hardcode it

Signed-off-by: Angie <angheloalf95@gmail.com>

* set segment 128 in the xml

Signed-off-by: Angie <angheloalf95@gmail.com>

* Add baseaddress, which fixes dlist in xml

Signed-off-by: Angie <angheloalf95@gmail.com>

* fix the second dlist

Signed-off-by: Angie <angheloalf95@gmail.com>

* compiler complain that the symbol doesn't exists

Signed-off-by: angie <angheloalf95@gmail.com>

* last cleanup

Signed-off-by: angie <angheloalf95@gmail.com>

* format and delete unused asm

Signed-off-by: angie <angheloalf95@gmail.com>

* Cleanup and add a few comments

Signed-off-by: Angie <angheloalf95@gmail.com>

* add non matching to spec

Signed-off-by: angie <angheloalf95@gmail.com>

* update xml and add a note to future people

Signed-off-by: angie <angheloalf95@gmail.com>

* Finally remove z_en_jsjutan_data.c

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename extracted variables

Signed-off-by: angie <angheloalf95@gmail.com>

* Update src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-03-27 23:47:25 -03:00 committed by GitHub
parent 43b45b91c9
commit 833dc2928d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 532 additions and 657 deletions

View File

@ -1,14 +0,0 @@
glabel EnJsjutan_Destroy
/* 00090 80A89830 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8
/* 00094 80A89834 AFA40018 */ sw $a0, 0x0018($sp)
/* 00098 80A89838 8FAE0018 */ lw $t6, 0x0018($sp)
/* 0009C 80A8983C AFBF0014 */ sw $ra, 0x0014($sp)
/* 000A0 80A89840 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 000A4 80A89844 24A50810 */ addiu $a1, $a1, 0x0810 ## $a1 = 00000810
/* 000A8 80A89848 0C00FB56 */ jal DynaPoly_DeleteBgActor
## DynaPoly_DeleteBgActor
/* 000AC 80A8984C 8DC6014C */ lw $a2, 0x014C($t6) ## 0000014C
/* 000B0 80A89850 8FBF0014 */ lw $ra, 0x0014($sp)
/* 000B4 80A89854 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000
/* 000B8 80A89858 03E00008 */ jr $ra
/* 000BC 80A8985C 00000000 */ nop

View File

@ -1,309 +0,0 @@
.rdata
glabel D_80A8E430
.asciz "../z_en_jsjutan.c"
.balign 4
glabel D_80A8E444
.asciz "../z_en_jsjutan.c"
.balign 4
glabel D_80A8E458
.asciz "../z_en_jsjutan.c"
.balign 4
glabel D_80A8E46C
.asciz "../z_en_jsjutan.c"
.balign 4
.text
glabel EnJsjutan_Draw
/* 00E78 80A8A618 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78
/* 00E7C 80A8A61C AFBF001C */ sw $ra, 0x001C($sp)
/* 00E80 80A8A620 AFB10018 */ sw $s1, 0x0018($sp)
/* 00E84 80A8A624 AFB00014 */ sw $s0, 0x0014($sp)
/* 00E88 80A8A628 AFA5008C */ sw $a1, 0x008C($sp)
/* 00E8C 80A8A62C 8C820118 */ lw $v0, 0x0118($a0) ## 00000118
/* 00E90 80A8A630 8CA50000 */ lw $a1, 0x0000($a1) ## 00000000
/* 00E94 80A8A634 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00E98 80A8A638 3C0680A9 */ lui $a2, %hi(D_80A8E430) ## $a2 = 80A90000
/* 00E9C 80A8A63C 24C6E430 */ addiu $a2, $a2, %lo(D_80A8E430) ## $a2 = 80A8E430
/* 00EA0 80A8A640 27A40064 */ addiu $a0, $sp, 0x0064 ## $a0 = FFFFFFDC
/* 00EA4 80A8A644 240702BD */ addiu $a3, $zero, 0x02BD ## $a3 = 000002BD
/* 00EA8 80A8A648 AFA20078 */ sw $v0, 0x0078($sp)
/* 00EAC 80A8A64C 0C031AB1 */ jal Graph_OpenDisps
/* 00EB0 80A8A650 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000
/* 00EB4 80A8A654 860F001C */ lh $t7, 0x001C($s0) ## 0000001C
/* 00EB8 80A8A658 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001
/* 00EBC 80A8A65C 8FA20078 */ lw $v0, 0x0078($sp)
/* 00EC0 80A8A660 55E10013 */ bnel $t7, $at, .L80A8A6B0
/* 00EC4 80A8A664 92090175 */ lbu $t1, 0x0175($s0) ## 00000175
/* 00EC8 80A8A668 C4440024 */ lwc1 $f4, 0x0024($v0) ## 00000024
/* 00ECC 80A8A66C 92180175 */ lbu $t8, 0x0175($s0) ## 00000175
/* 00ED0 80A8A670 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001
/* 00ED4 80A8A674 E6040024 */ swc1 $f4, 0x0024($s0) ## 00000024
/* 00ED8 80A8A678 C4460028 */ lwc1 $f6, 0x0028($v0) ## 00000028
/* 00EDC 80A8A67C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00EE0 80A8A680 E6060028 */ swc1 $f6, 0x0028($s0) ## 00000028
/* 00EE4 80A8A684 C448002C */ lwc1 $f8, 0x002C($v0) ## 0000002C
/* 00EE8 80A8A688 C60A0028 */ lwc1 $f10, 0x0028($s0) ## 00000028
/* 00EEC 80A8A68C E608002C */ swc1 $f8, 0x002C($s0) ## 0000002C
/* 00EF0 80A8A690 1700002B */ bne $t8, $zero, .L80A8A740
/* 00EF4 80A8A694 E60A0168 */ swc1 $f10, 0x0168($s0) ## 00000168
/* 00EF8 80A8A698 A2190175 */ sb $t9, 0x0175($s0) ## 00000175
/* 00EFC 80A8A69C 0C2A2618 */ jal func_80A89860
/* 00F00 80A8A6A0 8FA5008C */ lw $a1, 0x008C($sp)
/* 00F04 80A8A6A4 10000027 */ beq $zero, $zero, .L80A8A744
/* 00F08 80A8A6A8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00F0C 80A8A6AC 92090175 */ lbu $t1, 0x0175($s0) ## 00000175
.L80A8A6B0:
/* 00F10 80A8A6B0 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001
/* 00F14 80A8A6B4 55200023 */ bnel $t1, $zero, .L80A8A744
/* 00F18 80A8A6B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00F1C 80A8A6BC A20A0175 */ sb $t2, 0x0175($s0) ## 00000175
/* 00F20 80A8A6C0 844400B6 */ lh $a0, 0x00B6($v0) ## 000000B6
/* 00F24 80A8A6C4 0C01DE1C */ jal Math_SinS
## sins?
/* 00F28 80A8A6C8 AFA20078 */ sw $v0, 0x0078($sp)
/* 00F2C 80A8A6CC 3C014270 */ lui $at, 0x4270 ## $at = 42700000
/* 00F30 80A8A6D0 44818000 */ mtc1 $at, $f16 ## $f16 = 60.00
/* 00F34 80A8A6D4 8FA20078 */ lw $v0, 0x0078($sp)
/* 00F38 80A8A6D8 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000
/* 00F3C 80A8A6DC 46100482 */ mul.s $f18, $f0, $f16
/* 00F40 80A8A6E0 C4440024 */ lwc1 $f4, 0x0024($v0) ## 00000024
/* 00F44 80A8A6E4 44815000 */ mtc1 $at, $f10 ## $f10 = 5.00
/* 00F48 80A8A6E8 3C014120 */ lui $at, 0x4120 ## $at = 41200000
/* 00F4C 80A8A6EC 46049180 */ add.s $f6, $f18, $f4
/* 00F50 80A8A6F0 44819000 */ mtc1 $at, $f18 ## $f18 = 10.00
/* 00F54 80A8A6F4 E6060024 */ swc1 $f6, 0x0024($s0) ## 00000024
/* 00F58 80A8A6F8 C4480028 */ lwc1 $f8, 0x0028($v0) ## 00000028
/* 00F5C 80A8A6FC 460A4400 */ add.s $f16, $f8, $f10
/* 00F60 80A8A700 46128101 */ sub.s $f4, $f16, $f18
/* 00F64 80A8A704 E6040028 */ swc1 $f4, 0x0028($s0) ## 00000028
/* 00F68 80A8A708 0C01DE0D */ jal Math_CosS
## coss?
/* 00F6C 80A8A70C 844400B6 */ lh $a0, 0x00B6($v0) ## 000000B6
/* 00F70 80A8A710 3C014270 */ lui $at, 0x4270 ## $at = 42700000
/* 00F74 80A8A714 44813000 */ mtc1 $at, $f6 ## $f6 = 60.00
/* 00F78 80A8A718 8FA20078 */ lw $v0, 0x0078($sp)
/* 00F7C 80A8A71C C6120028 */ lwc1 $f18, 0x0028($s0) ## 00000028
/* 00F80 80A8A720 46060202 */ mul.s $f8, $f0, $f6
/* 00F84 80A8A724 C44A002C */ lwc1 $f10, 0x002C($v0) ## 0000002C
/* 00F88 80A8A728 E6120168 */ swc1 $f18, 0x0168($s0) ## 00000168
/* 00F8C 80A8A72C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00F90 80A8A730 460A4400 */ add.s $f16, $f8, $f10
/* 00F94 80A8A734 E610002C */ swc1 $f16, 0x002C($s0) ## 0000002C
/* 00F98 80A8A738 0C2A2618 */ jal func_80A89860
/* 00F9C 80A8A73C 8FA5008C */ lw $a1, 0x008C($sp)
.L80A8A740:
/* 00FA0 80A8A740 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
.L80A8A744:
/* 00FA4 80A8A744 0C2A269B */ jal func_80A89A6C
/* 00FA8 80A8A748 8FA5008C */ lw $a1, 0x008C($sp)
/* 00FAC 80A8A74C 920B0164 */ lbu $t3, 0x0164($s0) ## 00000164
/* 00FB0 80A8A750 11600017 */ beq $t3, $zero, .L80A8A7B0
/* 00FB4 80A8A754 3C0480A9 */ lui $a0, %hi(D_80A8AA98) ## $a0 = 80A90000
/* 00FB8 80A8A758 3C0380A9 */ lui $v1, %hi(D_80A8E610) ## $v1 = 80A90000
/* 00FBC 80A8A75C A2000164 */ sb $zero, 0x0164($s0) ## 00000164
/* 00FC0 80A8A760 2463E610 */ addiu $v1, $v1, %lo(D_80A8E610) ## $v1 = 80A8E610
/* 00FC4 80A8A764 2484AA98 */ addiu $a0, $a0, %lo(D_80A8AA98) ## $a0 = 80A8AA98
/* 00FC8 80A8A768 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000
/* 00FCC 80A8A76C 240500FF */ addiu $a1, $zero, 0x00FF ## $a1 = 000000FF
/* 00FD0 80A8A770 00026040 */ sll $t4, $v0, 1
.L80A8A774:
/* 00FD4 80A8A774 008C6821 */ addu $t5, $a0, $t4
/* 00FD8 80A8A778 95AE0000 */ lhu $t6, 0x0000($t5) ## 00000000
/* 00FDC 80A8A77C 00627821 */ addu $t7, $v1, $v0
/* 00FE0 80A8A780 0062C021 */ addu $t8, $v1, $v0
/* 00FE4 80A8A784 51C00004 */ beql $t6, $zero, .L80A8A798
/* 00FE8 80A8A788 A3000000 */ sb $zero, 0x0000($t8) ## 00000000
/* 00FEC 80A8A78C 10000002 */ beq $zero, $zero, .L80A8A798
/* 00FF0 80A8A790 A1E50000 */ sb $a1, 0x0000($t7) ## 00000000
/* 00FF4 80A8A794 A3000000 */ sb $zero, 0x0000($t8) ## 00000000
.L80A8A798:
/* 00FF8 80A8A798 24420001 */ addiu $v0, $v0, 0x0001 ## $v0 = 00000001
/* 00FFC 80A8A79C 00021400 */ sll $v0, $v0, 16
/* 01000 80A8A7A0 00021403 */ sra $v0, $v0, 16
/* 01004 80A8A7A4 28410800 */ slti $at, $v0, 0x0800
/* 01008 80A8A7A8 5420FFF2 */ bnel $at, $zero, .L80A8A774
/* 0100C 80A8A7AC 00026040 */ sll $t4, $v0, 1
.L80A8A7B0:
/* 01010 80A8A7B0 8FB9008C */ lw $t9, 0x008C($sp)
/* 01014 80A8A7B4 0C024F46 */ jal func_80093D18
/* 01018 80A8A7B8 8F240000 */ lw $a0, 0x0000($t9) ## 00000000
/* 0101C 80A8A7BC 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01020 80A8A7C0 3C0AFA00 */ lui $t2, 0xFA00 ## $t2 = FA000000
/* 01024 80A8A7C4 3C014040 */ lui $at, 0x4040 ## $at = 40400000
/* 01028 80A8A7C8 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008
/* 0102C 80A8A7CC AE2902C0 */ sw $t1, 0x02C0($s1) ## 000002C0
/* 01030 80A8A7D0 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000
/* 01034 80A8A7D4 C604016C */ lwc1 $f4, 0x016C($s0) ## 0000016C
/* 01038 80A8A7D8 44817000 */ mtc1 $at, $f14 ## $f14 = 3.00
/* 0103C 80A8A7DC 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000
/* 01040 80A8A7E0 4600218D */ trunc.w.s $f6, $f4
/* 01044 80A8A7E4 440E3000 */ mfc1 $t6, $f6
/* 01048 80A8A7E8 00000000 */ nop
/* 0104C 80A8A7EC 31CF00FF */ andi $t7, $t6, 0x00FF ## $t7 = 00000000
/* 01050 80A8A7F0 AC4F0004 */ sw $t7, 0x0004($v0) ## 00000004
/* 01054 80A8A7F4 8E06002C */ lw $a2, 0x002C($s0) ## 0000002C
/* 01058 80A8A7F8 0C034261 */ jal Matrix_Translate
/* 0105C 80A8A7FC C60C0024 */ lwc1 $f12, 0x0024($s0) ## 00000024
/* 01060 80A8A800 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000
/* 01064 80A8A804 44817000 */ mtc1 $at, $f14 ## $f14 = 1.00
/* 01068 80A8A808 C60C0050 */ lwc1 $f12, 0x0050($s0) ## 00000050
/* 0106C 80A8A80C 8E060058 */ lw $a2, 0x0058($s0) ## 00000058
/* 01070 80A8A810 0C0342A3 */ jal Matrix_Scale
/* 01074 80A8A814 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001
/* 01078 80A8A818 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 0107C 80A8A81C 3C19DA38 */ lui $t9, 0xDA38 ## $t9 = DA380000
/* 01080 80A8A820 37390003 */ ori $t9, $t9, 0x0003 ## $t9 = DA380003
/* 01084 80A8A824 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008
/* 01088 80A8A828 AE3802C0 */ sw $t8, 0x02C0($s1) ## 000002C0
/* 0108C 80A8A82C AC590000 */ sw $t9, 0x0000($v0) ## 00000000
/* 01090 80A8A830 8FA9008C */ lw $t1, 0x008C($sp)
/* 01094 80A8A834 3C0580A9 */ lui $a1, %hi(D_80A8E444) ## $a1 = 80A90000
/* 01098 80A8A838 24A5E444 */ addiu $a1, $a1, %lo(D_80A8E444) ## $a1 = 80A8E444
/* 0109C 80A8A83C 8D240000 */ lw $a0, 0x0000($t1) ## 00000000
/* 010A0 80A8A840 2406030E */ addiu $a2, $zero, 0x030E ## $a2 = 0000030E
/* 010A4 80A8A844 0C0346A2 */ jal Matrix_NewMtx
/* 010A8 80A8A848 AFA2005C */ sw $v0, 0x005C($sp)
/* 010AC 80A8A84C 8FA3005C */ lw $v1, 0x005C($sp)
/* 010B0 80A8A850 3C0B80A9 */ lui $t3, %hi(D_80A8D618) ## $t3 = 80A90000
/* 010B4 80A8A854 256BD618 */ addiu $t3, $t3, %lo(D_80A8D618) ## $t3 = 80A8D618
/* 010B8 80A8A858 AC620004 */ sw $v0, 0x0004($v1) ## 00000004
/* 010BC 80A8A85C 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 010C0 80A8A860 3C07DE00 */ lui $a3, 0xDE00 ## $a3 = DE000000
/* 010C4 80A8A864 3C0DE700 */ lui $t5, 0xE700 ## $t5 = E7000000
/* 010C8 80A8A868 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008
/* 010CC 80A8A86C AE2A02C0 */ sw $t2, 0x02C0($s1) ## 000002C0
/* 010D0 80A8A870 AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004
/* 010D4 80A8A874 AC470000 */ sw $a3, 0x0000($v0) ## 00000000
/* 010D8 80A8A878 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 010DC 80A8A87C 3C010001 */ lui $at, 0x0001 ## $at = 00010000
/* 010E0 80A8A880 3C19DB06 */ lui $t9, 0xDB06 ## $t9 = DB060000
/* 010E4 80A8A884 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008
/* 010E8 80A8A888 AE2C02C0 */ sw $t4, 0x02C0($s1) ## 000002C0
/* 010EC 80A8A88C AC400004 */ sw $zero, 0x0004($v0) ## 00000004
/* 010F0 80A8A890 AC4D0000 */ sw $t5, 0x0000($v0) ## 00000000
/* 010F4 80A8A894 8FA8008C */ lw $t0, 0x008C($sp)
/* 010F8 80A8A898 3C0BDB06 */ lui $t3, 0xDB06 ## $t3 = DB060000
/* 010FC 80A8A89C 37390030 */ ori $t9, $t9, 0x0030 ## $t9 = DB060030
/* 01100 80A8A8A0 01013021 */ addu $a2, $t0, $at
/* 01104 80A8A8A4 8CCE1DE4 */ lw $t6, 0x1DE4($a2) ## 00001DE4
/* 01108 80A8A8A8 356B0030 */ ori $t3, $t3, 0x0030 ## $t3 = DB060030
/* 0110C 80A8A8AC 31CF0001 */ andi $t7, $t6, 0x0001 ## $t7 = 00000000
/* 01110 80A8A8B0 51E0000A */ beql $t7, $zero, .L80A8A8DC
/* 01114 80A8A8B4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01118 80A8A8B8 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 0111C 80A8A8BC 3C0980A9 */ lui $t1, %hi(D_80A8BA98) ## $t1 = 80A90000
/* 01120 80A8A8C0 2529BA98 */ addiu $t1, $t1, %lo(D_80A8BA98) ## $t1 = 80A8BA98
/* 01124 80A8A8C4 24580008 */ addiu $t8, $v0, 0x0008 ## $t8 = 00000008
/* 01128 80A8A8C8 AE3802C0 */ sw $t8, 0x02C0($s1) ## 000002C0
/* 0112C 80A8A8CC AC490004 */ sw $t1, 0x0004($v0) ## 00000004
/* 01130 80A8A8D0 10000008 */ beq $zero, $zero, .L80A8A8F4
/* 01134 80A8A8D4 AC590000 */ sw $t9, 0x0000($v0) ## 00000000
/* 01138 80A8A8D8 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
.L80A8A8DC:
/* 0113C 80A8A8DC 3C0C80A9 */ lui $t4, %hi(D_80A8C398) ## $t4 = 80A90000
/* 01140 80A8A8E0 258CC398 */ addiu $t4, $t4, %lo(D_80A8C398) ## $t4 = 80A8C398
/* 01144 80A8A8E4 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008
/* 01148 80A8A8E8 AE2A02C0 */ sw $t2, 0x02C0($s1) ## 000002C0
/* 0114C 80A8A8EC AC4C0004 */ sw $t4, 0x0004($v0) ## 00000004
/* 01150 80A8A8F0 AC4B0000 */ sw $t3, 0x0000($v0) ## 00000000
.L80A8A8F4:
/* 01154 80A8A8F4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01158 80A8A8F8 3C0580A9 */ lui $a1, %hi(D_80A8D688) ## $a1 = 80A90000
/* 0115C 80A8A8FC 24A5D688 */ addiu $a1, $a1, %lo(D_80A8D688) ## $a1 = 80A8D688
/* 01160 80A8A900 244D0008 */ addiu $t5, $v0, 0x0008 ## $t5 = 00000008
/* 01164 80A8A904 AE2D02C0 */ sw $t5, 0x02C0($s1) ## 000002C0
/* 01168 80A8A908 AC450004 */ sw $a1, 0x0004($v0) ## 00000004
/* 0116C 80A8A90C AC470000 */ sw $a3, 0x0000($v0) ## 00000000
/* 01170 80A8A910 8D040000 */ lw $a0, 0x0000($t0) ## 00000000
/* 01174 80A8A914 AFA60028 */ sw $a2, 0x0028($sp)
/* 01178 80A8A918 0C024F46 */ jal func_80093D18
/* 0117C 80A8A91C AFA5002C */ sw $a1, 0x002C($sp)
/* 01180 80A8A920 3C014040 */ lui $at, 0x4040 ## $at = 40400000
/* 01184 80A8A924 44815000 */ mtc1 $at, $f10 ## $f10 = 3.00
/* 01188 80A8A928 C6080168 */ lwc1 $f8, 0x0168($s0) ## 00000168
/* 0118C 80A8A92C C60C0024 */ lwc1 $f12, 0x0024($s0) ## 00000024
/* 01190 80A8A930 8E06002C */ lw $a2, 0x002C($s0) ## 0000002C
/* 01194 80A8A934 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000
/* 01198 80A8A938 0C034261 */ jal Matrix_Translate
/* 0119C 80A8A93C 460A4380 */ add.s $f14, $f8, $f10
/* 011A0 80A8A940 C60C0050 */ lwc1 $f12, 0x0050($s0) ## 00000050
/* 011A4 80A8A944 C60E0054 */ lwc1 $f14, 0x0054($s0) ## 00000054
/* 011A8 80A8A948 8E060058 */ lw $a2, 0x0058($s0) ## 00000058
/* 011AC 80A8A94C 0C0342A3 */ jal Matrix_Scale
/* 011B0 80A8A950 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001
/* 011B4 80A8A954 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 011B8 80A8A958 3C0FDA38 */ lui $t7, 0xDA38 ## $t7 = DA380000
/* 011BC 80A8A95C 35EF0003 */ ori $t7, $t7, 0x0003 ## $t7 = DA380003
/* 011C0 80A8A960 244E0008 */ addiu $t6, $v0, 0x0008 ## $t6 = 00000008
/* 011C4 80A8A964 AE2E02C0 */ sw $t6, 0x02C0($s1) ## 000002C0
/* 011C8 80A8A968 AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000
/* 011CC 80A8A96C 8FB8008C */ lw $t8, 0x008C($sp)
/* 011D0 80A8A970 3C0580A9 */ lui $a1, %hi(D_80A8E458) ## $a1 = 80A90000
/* 011D4 80A8A974 24A5E458 */ addiu $a1, $a1, %lo(D_80A8E458) ## $a1 = 80A8E458
/* 011D8 80A8A978 24060325 */ addiu $a2, $zero, 0x0325 ## $a2 = 00000325
/* 011DC 80A8A97C 00408025 */ or $s0, $v0, $zero ## $s0 = 00000000
/* 011E0 80A8A980 0C0346A2 */ jal Matrix_NewMtx
/* 011E4 80A8A984 8F040000 */ lw $a0, 0x0000($t8) ## 00000000
/* 011E8 80A8A988 AE020004 */ sw $v0, 0x0004($s0) ## 00000004
/* 011EC 80A8A98C 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 011F0 80A8A990 3C0980A9 */ lui $t1, %hi(D_80A8D598) ## $t1 = 80A90000
/* 011F4 80A8A994 2529D598 */ addiu $t1, $t1, %lo(D_80A8D598) ## $t1 = 80A8D598
/* 011F8 80A8A998 24590008 */ addiu $t9, $v0, 0x0008 ## $t9 = 00000008
/* 011FC 80A8A99C AE3902C0 */ sw $t9, 0x02C0($s1) ## 000002C0
/* 01200 80A8A9A0 3C04DE00 */ lui $a0, 0xDE00 ## $a0 = DE000000
/* 01204 80A8A9A4 AC440000 */ sw $a0, 0x0000($v0) ## 00000000
/* 01208 80A8A9A8 AC490004 */ sw $t1, 0x0004($v0) ## 00000004
/* 0120C 80A8A9AC 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01210 80A8A9B0 3C0BE700 */ lui $t3, 0xE700 ## $t3 = E7000000
/* 01214 80A8A9B4 3C18DB06 */ lui $t8, 0xDB06 ## $t8 = DB060000
/* 01218 80A8A9B8 244A0008 */ addiu $t2, $v0, 0x0008 ## $t2 = 00000008
/* 0121C 80A8A9BC AE2A02C0 */ sw $t2, 0x02C0($s1) ## 000002C0
/* 01220 80A8A9C0 AC400004 */ sw $zero, 0x0004($v0) ## 00000004
/* 01224 80A8A9C4 AC4B0000 */ sw $t3, 0x0000($v0) ## 00000000
/* 01228 80A8A9C8 8FAC0028 */ lw $t4, 0x0028($sp)
/* 0122C 80A8A9CC 3C0ADB06 */ lui $t2, 0xDB06 ## $t2 = DB060000
/* 01230 80A8A9D0 37180030 */ ori $t8, $t8, 0x0030 ## $t8 = DB060030
/* 01234 80A8A9D4 8D8D1DE4 */ lw $t5, 0x1DE4($t4) ## 00001DE4
/* 01238 80A8A9D8 354A0030 */ ori $t2, $t2, 0x0030 ## $t2 = DB060030
/* 0123C 80A8A9DC 31AE0001 */ andi $t6, $t5, 0x0001 ## $t6 = 00000000
/* 01240 80A8A9E0 51C0000A */ beql $t6, $zero, .L80A8AA0C
/* 01244 80A8A9E4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01248 80A8A9E8 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 0124C 80A8A9EC 3C1980A9 */ lui $t9, %hi(D_80A8CC98) ## $t9 = 80A90000
/* 01250 80A8A9F0 2739CC98 */ addiu $t9, $t9, %lo(D_80A8CC98) ## $t9 = 80A8CC98
/* 01254 80A8A9F4 244F0008 */ addiu $t7, $v0, 0x0008 ## $t7 = 00000008
/* 01258 80A8A9F8 AE2F02C0 */ sw $t7, 0x02C0($s1) ## 000002C0
/* 0125C 80A8A9FC AC590004 */ sw $t9, 0x0004($v0) ## 00000004
/* 01260 80A8AA00 10000008 */ beq $zero, $zero, .L80A8AA24
/* 01264 80A8AA04 AC580000 */ sw $t8, 0x0000($v0) ## 00000000
/* 01268 80A8AA08 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
.L80A8AA0C:
/* 0126C 80A8AA0C 3C0B80A9 */ lui $t3, %hi(D_80A8DAB8) ## $t3 = 80A90000
/* 01270 80A8AA10 256BDAB8 */ addiu $t3, $t3, %lo(D_80A8DAB8) ## $t3 = 80A8DAB8
/* 01274 80A8AA14 24490008 */ addiu $t1, $v0, 0x0008 ## $t1 = 00000008
/* 01278 80A8AA18 AE2902C0 */ sw $t1, 0x02C0($s1) ## 000002C0
/* 0127C 80A8AA1C AC4B0004 */ sw $t3, 0x0004($v0) ## 00000004
/* 01280 80A8AA20 AC4A0000 */ sw $t2, 0x0000($v0) ## 00000000
.L80A8AA24:
/* 01284 80A8AA24 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0
/* 01288 80A8AA28 3C0680A9 */ lui $a2, %hi(D_80A8E46C) ## $a2 = 80A90000
/* 0128C 80A8AA2C 24C6E46C */ addiu $a2, $a2, %lo(D_80A8E46C) ## $a2 = 80A8E46C
/* 01290 80A8AA30 244C0008 */ addiu $t4, $v0, 0x0008 ## $t4 = 00000008
/* 01294 80A8AA34 AE2C02C0 */ sw $t4, 0x02C0($s1) ## 000002C0
/* 01298 80A8AA38 AC440000 */ sw $a0, 0x0000($v0) ## 00000000
/* 0129C 80A8AA3C 8FAD002C */ lw $t5, 0x002C($sp)
/* 012A0 80A8AA40 27A40064 */ addiu $a0, $sp, 0x0064 ## $a0 = FFFFFFDC
/* 012A4 80A8AA44 24070337 */ addiu $a3, $zero, 0x0337 ## $a3 = 00000337
/* 012A8 80A8AA48 AC4D0004 */ sw $t5, 0x0004($v0) ## 00000004
/* 012AC 80A8AA4C 8FAE008C */ lw $t6, 0x008C($sp)
/* 012B0 80A8AA50 0C031AD5 */ jal Graph_CloseDisps
/* 012B4 80A8AA54 8DC50000 */ lw $a1, 0x0000($t6) ## 00000000
/* 012B8 80A8AA58 8FBF001C */ lw $ra, 0x001C($sp)
/* 012BC 80A8AA5C 8FB00014 */ lw $s0, 0x0014($sp)
/* 012C0 80A8AA60 8FB10018 */ lw $s1, 0x0018($sp)
/* 012C4 80A8AA64 03E00008 */ jr $ra
/* 012C8 80A8AA68 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000
/* 012CC 80A8AA6C 00000000 */ nop

View File

@ -1,41 +0,0 @@
glabel EnJsjutan_Init
/* 00000 80A897A0 27BDFFD0 */ addiu $sp, $sp, 0xFFD0 ## $sp = FFFFFFD0
/* 00004 80A897A4 AFBF001C */ sw $ra, 0x001C($sp)
/* 00008 80A897A8 AFB00018 */ sw $s0, 0x0018($sp)
/* 0000C 80A897AC AFA50034 */ sw $a1, 0x0034($sp)
/* 00010 80A897B0 AFA00024 */ sw $zero, 0x0024($sp)
/* 00014 80A897B4 8C8E0004 */ lw $t6, 0x0004($a0) ## 00000004
/* 00018 80A897B8 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE
/* 0001C 80A897BC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00020 80A897C0 01C17824 */ and $t7, $t6, $at
/* 00024 80A897C4 AC8F0004 */ sw $t7, 0x0004($a0) ## 00000004
/* 00028 80A897C8 0C010D20 */ jal DynaPolyActor_Init
/* 0002C 80A897CC 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000
/* 00030 80A897D0 3C0480A9 */ lui $a0, %hi(D_80A8E400) ## $a0 = 80A90000
/* 00034 80A897D4 2484E400 */ addiu $a0, $a0, %lo(D_80A8E400) ## $a0 = 80A8E400
/* 00038 80A897D8 0C010620 */ jal CollisionHeader_GetVirtual
/* 0003C 80A897DC 27A50024 */ addiu $a1, $sp, 0x0024 ## $a1 = FFFFFFF4
/* 00040 80A897E0 8FA40034 */ lw $a0, 0x0034($sp)
/* 00044 80A897E4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000
/* 00048 80A897E8 8FA70024 */ lw $a3, 0x0024($sp)
/* 0004C 80A897EC 0C00FA9D */ jal DynaPoly_SetBgActor
## DynaPoly_SetBgActor
/* 00050 80A897F0 24850810 */ addiu $a1, $a0, 0x0810 ## $a1 = 00000810
/* 00054 80A897F4 3C053CA3 */ lui $a1, 0x3CA3 ## $a1 = 3CA30000
/* 00058 80A897F8 AE02014C */ sw $v0, 0x014C($s0) ## 0000014C
/* 0005C 80A897FC 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 3CA3D70A
/* 00060 80A89800 0C00B58B */ jal Actor_SetScale
/* 00064 80A89804 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00068 80A89808 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000
/* 0006C 80A8980C 44812000 */ mtc1 $at, $f4 ## $f4 = 100.00
/* 00070 80A89810 24180001 */ addiu $t8, $zero, 0x0001 ## $t8 = 00000001
/* 00074 80A89814 A2180164 */ sb $t8, 0x0164($s0) ## 00000164
/* 00078 80A89818 E604016C */ swc1 $f4, 0x016C($s0) ## 0000016C
/* 0007C 80A8981C 8FBF001C */ lw $ra, 0x001C($sp)
/* 00080 80A89820 8FB00018 */ lw $s0, 0x0018($sp)
/* 00084 80A89824 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000
/* 00088 80A89828 03E00008 */ jr $ra
/* 0008C 80A8982C 00000000 */ nop

View File

@ -1,57 +0,0 @@
glabel EnJsjutan_Update
/* 00DA0 80A8A540 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00DA4 80A8A544 3C010001 */ lui $at, 0x0001 ## $at = 00010000
/* 00DA8 80A8A548 AFBF0014 */ sw $ra, 0x0014($sp)
/* 00DAC 80A8A54C AFA40020 */ sw $a0, 0x0020($sp)
/* 00DB0 80A8A550 AFA50024 */ sw $a1, 0x0024($sp)
/* 00DB4 80A8A554 00A11021 */ addu $v0, $a1, $at
/* 00DB8 80A8A558 8C441DE4 */ lw $a0, 0x1DE4($v0) ## 00001DE4
/* 00DBC 80A8A55C AFA20018 */ sw $v0, 0x0018($sp)
/* 00DC0 80A8A560 00800821 */ addu $at, $a0, $zero
/* 00DC4 80A8A564 00042080 */ sll $a0, $a0, 2
/* 00DC8 80A8A568 00812023 */ subu $a0, $a0, $at
/* 00DCC 80A8A56C 00042100 */ sll $a0, $a0, 4
/* 00DD0 80A8A570 00812023 */ subu $a0, $a0, $at
/* 00DD4 80A8A574 000420C0 */ sll $a0, $a0, 3
/* 00DD8 80A8A578 00812023 */ subu $a0, $a0, $at
/* 00DDC 80A8A57C 000420C0 */ sll $a0, $a0, 3
/* 00DE0 80A8A580 00042400 */ sll $a0, $a0, 16
/* 00DE4 80A8A584 0C01DE1C */ jal Math_SinS
## sins?
/* 00DE8 80A8A588 00042403 */ sra $a0, $a0, 16
/* 00DEC 80A8A58C 3C014396 */ lui $at, 0x4396 ## $at = 43960000
/* 00DF0 80A8A590 44812000 */ mtc1 $at, $f4 ## $f4 = 300.00
/* 00DF4 80A8A594 8FB80020 */ lw $t8, 0x0020($sp)
/* 00DF8 80A8A598 8FA20018 */ lw $v0, 0x0018($sp)
/* 00DFC 80A8A59C 46040182 */ mul.s $f6, $f0, $f4
/* 00E00 80A8A5A0 4600320D */ trunc.w.s $f8, $f6
/* 00E04 80A8A5A4 440F4000 */ mfc1 $t7, $f8
/* 00E08 80A8A5A8 00000000 */ nop
/* 00E0C 80A8A5AC A70F00B4 */ sh $t7, 0x00B4($t8) ## 000000B4
/* 00E10 80A8A5B0 8C441DE4 */ lw $a0, 0x1DE4($v0) ## 00001DE4
/* 00E14 80A8A5B4 00800821 */ addu $at, $a0, $zero
/* 00E18 80A8A5B8 000420C0 */ sll $a0, $a0, 3
/* 00E1C 80A8A5BC 00812023 */ subu $a0, $a0, $at
/* 00E20 80A8A5C0 000420C0 */ sll $a0, $a0, 3
/* 00E24 80A8A5C4 00812023 */ subu $a0, $a0, $at
/* 00E28 80A8A5C8 00042080 */ sll $a0, $a0, 2
/* 00E2C 80A8A5CC 00812023 */ subu $a0, $a0, $at
/* 00E30 80A8A5D0 00042080 */ sll $a0, $a0, 2
/* 00E34 80A8A5D4 00812023 */ subu $a0, $a0, $at
/* 00E38 80A8A5D8 00042080 */ sll $a0, $a0, 2
/* 00E3C 80A8A5DC 00042400 */ sll $a0, $a0, 16
/* 00E40 80A8A5E0 0C01DE0D */ jal Math_CosS
## coss?
/* 00E44 80A8A5E4 00042403 */ sra $a0, $a0, 16
/* 00E48 80A8A5E8 3C014396 */ lui $at, 0x4396 ## $at = 43960000
/* 00E4C 80A8A5EC 44815000 */ mtc1 $at, $f10 ## $f10 = 300.00
/* 00E50 80A8A5F0 8FA90020 */ lw $t1, 0x0020($sp)
/* 00E54 80A8A5F4 460A0402 */ mul.s $f16, $f0, $f10
/* 00E58 80A8A5F8 4600848D */ trunc.w.s $f18, $f16
/* 00E5C 80A8A5FC 44089000 */ mfc1 $t0, $f18
/* 00E60 80A8A600 00000000 */ nop
/* 00E64 80A8A604 A52800B8 */ sh $t0, 0x00B8($t1) ## 000000B8
/* 00E68 80A8A608 8FBF0014 */ lw $ra, 0x0014($sp)
/* 00E6C 80A8A60C 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 00E70 80A8A610 03E00008 */ jr $ra
/* 00E74 80A8A614 00000000 */ nop

View File

@ -1,140 +0,0 @@
.late_rodata
glabel D_80A8E480
.float 0.02
.text
glabel func_80A89860
/* 000C0 80A89860 27BDFF80 */ addiu $sp, $sp, 0xFF80 ## $sp = FFFFFF80
/* 000C4 80A89864 AFBE0050 */ sw $s8, 0x0050($sp)
/* 000C8 80A89868 AFBF0054 */ sw $ra, 0x0054($sp)
/* 000CC 80A8986C AFB7004C */ sw $s7, 0x004C($sp)
/* 000D0 80A89870 AFB60048 */ sw $s6, 0x0048($sp)
/* 000D4 80A89874 AFB50044 */ sw $s5, 0x0044($sp)
/* 000D8 80A89878 AFB40040 */ sw $s4, 0x0040($sp)
/* 000DC 80A8987C AFB3003C */ sw $s3, 0x003C($sp)
/* 000E0 80A89880 AFB20038 */ sw $s2, 0x0038($sp)
/* 000E4 80A89884 AFB10034 */ sw $s1, 0x0034($sp)
/* 000E8 80A89888 AFB00030 */ sw $s0, 0x0030($sp)
/* 000EC 80A8988C F7B60028 */ sdc1 $f22, 0x0028($sp)
/* 000F0 80A89890 F7B40020 */ sdc1 $f20, 0x0020($sp)
/* 000F4 80A89894 AFA50084 */ sw $a1, 0x0084($sp)
/* 000F8 80A89898 249E0024 */ addiu $s8, $a0, 0x0024 ## $s8 = 00000024
/* 000FC 80A8989C 8FD80000 */ lw $t8, 0x0000($s8) ## 00000024
/* 00100 80A898A0 27AE0068 */ addiu $t6, $sp, 0x0068 ## $t6 = FFFFFFE8
/* 00104 80A898A4 3C0280A9 */ lui $v0, %hi(D_80A8BA98) ## $v0 = 80A90000
/* 00108 80A898A8 ADD80000 */ sw $t8, 0x0000($t6) ## FFFFFFE8
/* 0010C 80A898AC 8FCF0004 */ lw $t7, 0x0004($s8) ## 00000028
/* 00110 80A898B0 2442BA98 */ addiu $v0, $v0, %lo(D_80A8BA98) ## $v0 = 80A8BA98
/* 00114 80A898B4 3C0380A9 */ lui $v1, %hi(D_80A8C398) ## $v1 = 80A90000
/* 00118 80A898B8 ADCF0004 */ sw $t7, 0x0004($t6) ## FFFFFFEC
/* 0011C 80A898BC 8FD80008 */ lw $t8, 0x0008($s8) ## 0000002C
/* 00120 80A898C0 0002C900 */ sll $t9, $v0, 4
/* 00124 80A898C4 2463C398 */ addiu $v1, $v1, %lo(D_80A8C398) ## $v1 = 80A8C398
/* 00128 80A898C8 3C068016 */ lui $a2, %hi(gSegments)
/* 0012C 80A898CC 00194F02 */ srl $t1, $t9, 28
/* 00130 80A898D0 00037900 */ sll $t7, $v1, 4
/* 00134 80A898D4 ADD80008 */ sw $t8, 0x0008($t6) ## FFFFFFF0
/* 00138 80A898D8 24C66FA8 */ addiu $a2, %lo(gSegments)
/* 0013C 80A898DC 00095080 */ sll $t2, $t1, 2
/* 00140 80A898E0 000FC702 */ srl $t8, $t7, 28
/* 00144 80A898E4 00CA5821 */ addu $t3, $a2, $t2
/* 00148 80A898E8 0018C880 */ sll $t9, $t8, 2
/* 0014C 80A898EC 8D6C0000 */ lw $t4, 0x0000($t3) ## 00000000
/* 00150 80A898F0 3C0700FF */ lui $a3, 0x00FF ## $a3 = 00FF0000
/* 00154 80A898F4 00D94821 */ addu $t1, $a2, $t9
/* 00158 80A898F8 8D2A0000 */ lw $t2, 0x0000($t1) ## 00000000
/* 0015C 80A898FC 34E7FFFF */ ori $a3, $a3, 0xFFFF ## $a3 = 00FFFFFF
/* 00160 80A89900 3C0180A9 */ lui $at, %hi(D_80A8E480) ## $at = 80A90000
/* 00164 80A89904 00476824 */ and $t5, $v0, $a3
/* 00168 80A89908 C436E480 */ lwc1 $f22, %lo(D_80A8E480)($at)
/* 0016C 80A8990C 3C088000 */ lui $t0, 0x8000 ## $t0 = 80000000
/* 00170 80A89910 00675824 */ and $t3, $v1, $a3
/* 00174 80A89914 3C014120 */ lui $at, 0x4120 ## $at = 41200000
/* 00178 80A89918 018D7021 */ addu $t6, $t4, $t5
/* 0017C 80A8991C 3C1480A9 */ lui $s4, %hi(D_80A8EE10) ## $s4 = 80A90000
/* 00180 80A89920 014B6021 */ addu $t4, $t2, $t3
/* 00184 80A89924 4481A000 */ mtc1 $at, $f20 ## $f20 = 10.00
/* 00188 80A89928 00808825 */ or $s1, $a0, $zero ## $s1 = 00000000
/* 0018C 80A8992C 01C88021 */ addu $s0, $t6, $t0
/* 00190 80A89930 01889021 */ addu $s2, $t4, $t0
/* 00194 80A89934 2694EE10 */ addiu $s4, $s4, %lo(D_80A8EE10) ## $s4 = 80A8EE10
/* 00198 80A89938 00009825 */ or $s3, $zero, $zero ## $s3 = 00000000
/* 0019C 80A8993C 24150006 */ addiu $s5, $zero, 0x0006 ## $s5 = 00000006
/* 001A0 80A89940 24160001 */ addiu $s6, $zero, 0x0001 ## $s6 = 00000001
/* 001A4 80A89944 24170585 */ addiu $s7, $zero, 0x0585 ## $s7 = 00000585
.L80A89948:
/* 001A8 80A89948 02750019 */ multu $s3, $s5
/* 001AC 80A8994C 860E0000 */ lh $t6, 0x0000($s0) ## 00000000
/* 001B0 80A89950 00006812 */ mflo $t5
/* 001B4 80A89954 028D1021 */ addu $v0, $s4, $t5
/* 001B8 80A89958 A44E0000 */ sh $t6, 0x0000($v0) ## 80A8BA98
/* 001BC 80A8995C 860F0004 */ lh $t7, 0x0004($s0) ## 00000004
/* 001C0 80A89960 A44F0004 */ sh $t7, 0x0004($v0) ## 80A8BA9C
/* 001C4 80A89964 8638001C */ lh $t8, 0x001C($s1) ## 0000001C
/* 001C8 80A89968 56D80006 */ bnel $s6, $t8, .L80A89984
/* 001CC 80A8996C 86090000 */ lh $t1, 0x0000($s0) ## 00000000
/* 001D0 80A89970 A6570002 */ sh $s7, 0x0002($s2) ## 00000002
/* 001D4 80A89974 86590002 */ lh $t9, 0x0002($s2) ## 00000002
/* 001D8 80A89978 10000027 */ beq $zero, $zero, .L80A89A18
/* 001DC 80A8997C A6190002 */ sh $t9, 0x0002($s0) ## 00000002
/* 001E0 80A89980 86090000 */ lh $t1, 0x0000($s0) ## 00000000
.L80A89984:
/* 001E4 80A89984 C7AA0068 */ lwc1 $f10, 0x0068($sp)
/* 001E8 80A89988 4406A000 */ mfc1 $a2, $f20
/* 001EC 80A8998C 44892000 */ mtc1 $t1, $f4 ## $f4 = 0.00
/* 001F0 80A89990 4407A000 */ mfc1 $a3, $f20
/* 001F4 80A89994 240B0004 */ addiu $t3, $zero, 0x0004 ## $t3 = 00000004
/* 001F8 80A89998 468021A0 */ cvt.s.w $f6, $f4
/* 001FC 80A8999C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000
/* 00200 80A899A0 46163202 */ mul.s $f8, $f6, $f22
/* 00204 80A899A4 460A4400 */ add.s $f16, $f8, $f10
/* 00208 80A899A8 E6300024 */ swc1 $f16, 0x0024($s1) ## 00000024
/* 0020C 80A899AC 860A0004 */ lh $t2, 0x0004($s0) ## 00000004
/* 00210 80A899B0 C7A80070 */ lwc1 $f8, 0x0070($sp)
/* 00214 80A899B4 448A9000 */ mtc1 $t2, $f18 ## $f18 = 0.00
/* 00218 80A899B8 00000000 */ nop
/* 0021C 80A899BC 46809120 */ cvt.s.w $f4, $f18
/* 00220 80A899C0 46162182 */ mul.s $f6, $f4, $f22
/* 00224 80A899C4 46083280 */ add.s $f10, $f6, $f8
/* 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 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
/* 00244 80A899E4 4600848D */ trunc.w.s $f18, $f16
/* 00248 80A899E8 44029000 */ mfc1 $v0, $f18
/* 0024C 80A899EC 00000000 */ nop
/* 00250 80A899F0 00021400 */ sll $v0, $v0, 16
/* 00254 80A899F4 00021403 */ sra $v0, $v0, 16
/* 00258 80A899F8 A6420002 */ sh $v0, 0x0002($s2) ## 00000002
/* 0025C 80A899FC A6020002 */ sh $v0, 0x0002($s0) ## 00000002
/* 00260 80A89A00 8DAF0000 */ lw $t7, 0x0000($t5) ## FFFFFFE8
/* 00264 80A89A04 AFCF0000 */ sw $t7, 0x0000($s8) ## 00000024
/* 00268 80A89A08 8DAE0004 */ lw $t6, 0x0004($t5) ## FFFFFFEC
/* 0026C 80A89A0C AFCE0004 */ sw $t6, 0x0004($s8) ## 00000028
/* 00270 80A89A10 8DAF0008 */ lw $t7, 0x0008($t5) ## FFFFFFF0
/* 00274 80A89A14 AFCF0008 */ sw $t7, 0x0008($s8) ## 0000002C
.L80A89A18:
/* 00278 80A89A18 26730001 */ addiu $s3, $s3, 0x0001 ## $s3 = 00000001
/* 0027C 80A89A1C 00139C00 */ sll $s3, $s3, 16
/* 00280 80A89A20 00139C03 */ sra $s3, $s3, 16
/* 00284 80A89A24 2A610090 */ slti $at, $s3, 0x0090
/* 00288 80A89A28 26100010 */ addiu $s0, $s0, 0x0010 ## $s0 = 00000010
/* 0028C 80A89A2C 1420FFC6 */ bne $at, $zero, .L80A89948
/* 00290 80A89A30 26520010 */ addiu $s2, $s2, 0x0010 ## $s2 = 00000010
/* 00294 80A89A34 8FBF0054 */ lw $ra, 0x0054($sp)
/* 00298 80A89A38 D7B40020 */ ldc1 $f20, 0x0020($sp)
/* 0029C 80A89A3C D7B60028 */ ldc1 $f22, 0x0028($sp)
/* 002A0 80A89A40 8FB00030 */ lw $s0, 0x0030($sp)
/* 002A4 80A89A44 8FB10034 */ lw $s1, 0x0034($sp)
/* 002A8 80A89A48 8FB20038 */ lw $s2, 0x0038($sp)
/* 002AC 80A89A4C 8FB3003C */ lw $s3, 0x003C($sp)
/* 002B0 80A89A50 8FB40040 */ lw $s4, 0x0040($sp)
/* 002B4 80A89A54 8FB50044 */ lw $s5, 0x0044($sp)
/* 002B8 80A89A58 8FB60048 */ lw $s6, 0x0048($sp)
/* 002BC 80A89A5C 8FB7004C */ lw $s7, 0x004C($sp)
/* 002C0 80A89A60 8FBE0050 */ lw $s8, 0x0050($sp)
/* 002C4 80A89A64 03E00008 */ jr $ra
/* 002C8 80A89A68 27BD0080 */ addiu $sp, $sp, 0x0080 ## $sp = 00000000

View File

@ -55,8 +55,8 @@ glabel func_80A89A6C
/* 00328 80A89AC8 33190001 */ andi $t9, $t8, 0x0001 ## $t9 = 00000000
/* 0032C 80A89ACC 1320001B */ beq $t9, $zero, .L80A89B3C
/* 00330 80A89AD0 00005825 */ or $t3, $zero, $zero ## $t3 = 00000000
/* 00334 80A89AD4 3C0280A9 */ lui $v0, %hi(D_80A8CC98) ## $v0 = 80A90000
/* 00338 80A89AD8 2442CC98 */ addiu $v0, $v0, %lo(D_80A8CC98) ## $v0 = 80A8CC98
/* 00334 80A89AD4 3C0280A9 */ lui $v0, %hi(gJsjutanCarpetOddVtx) ## $v0 = 80A90000
/* 00338 80A89AD8 2442CC98 */ addiu $v0, $v0, %lo(gJsjutanCarpetOddVtx) ## $v0 = 80A8CC98
/* 0033C 80A89ADC 00027100 */ sll $t6, $v0, 4
/* 00340 80A89AE0 3C048016 */ lui $a0, %hi(gSegments)
/* 00344 80A89AE4 000E7F02 */ srl $t7, $t6, 28
@ -67,8 +67,8 @@ glabel func_80A89A6C
/* 00358 80A89AF8 3C0900FF */ lui $t1, 0x00FF ## $t1 = 00FF0000
/* 0035C 80A89AFC 3529FFFF */ ori $t1, $t1, 0xFFFF ## $t1 = 00FFFFFF
/* 00360 80A89B00 00497824 */ and $t7, $v0, $t1
/* 00364 80A89B04 3C0380A9 */ lui $v1, %hi(D_80A8BA98) ## $v1 = 80A90000
/* 00368 80A89B08 2463BA98 */ addiu $v1, $v1, %lo(D_80A8BA98) ## $v1 = 80A8BA98
/* 00364 80A89B04 3C0380A9 */ lui $v1, %hi(gJsjutanShadowOddVtx) ## $v1 = 80A90000
/* 00368 80A89B08 2463BA98 */ addiu $v1, $v1, %lo(gJsjutanShadowOddVtx) ## $v1 = 80A8BA98
/* 0036C 80A89B0C 01CFC021 */ addu $t8, $t6, $t7
/* 00370 80A89B10 0003C900 */ sll $t9, $v1, 4
/* 00374 80A89B14 3C0A8000 */ lui $t2, 0x8000 ## $t2 = 80000000
@ -82,8 +82,8 @@ glabel func_80A89A6C
/* 00394 80A89B34 1000001A */ beq $zero, $zero, .L80A89BA0
/* 00398 80A89B38 01EA9821 */ addu $s3, $t7, $t2
.L80A89B3C:
/* 0039C 80A89B3C 3C0280A9 */ lui $v0, %hi(D_80A8DAB8) ## $v0 = 80A90000
/* 003A0 80A89B40 2442DAB8 */ addiu $v0, $v0, %lo(D_80A8DAB8) ## $v0 = 80A8DAB8
/* 0039C 80A89B3C 3C0280A9 */ lui $v0, %hi(gJsjutanCarpetEvenVtx) ## $v0 = 80A90000
/* 003A0 80A89B40 2442DAB8 */ addiu $v0, $v0, %lo(gJsjutanCarpetEvenVtx) ## $v0 = 80A8DAB8
/* 003A4 80A89B44 0002C100 */ sll $t8, $v0, 4
/* 003A8 80A89B48 3C048016 */ lui $a0, %hi(gSegments)
/* 003AC 80A89B4C 0018CF02 */ srl $t9, $t8, 28
@ -94,8 +94,8 @@ glabel func_80A89A6C
/* 003C0 80A89B60 3C0900FF */ lui $t1, 0x00FF ## $t1 = 00FF0000
/* 003C4 80A89B64 3529FFFF */ ori $t1, $t1, 0xFFFF ## $t1 = 00FFFFFF
/* 003C8 80A89B68 0049C824 */ and $t9, $v0, $t1
/* 003CC 80A89B6C 3C0380A9 */ lui $v1, %hi(D_80A8C398) ## $v1 = 80A90000
/* 003D0 80A89B70 2463C398 */ addiu $v1, $v1, %lo(D_80A8C398) ## $v1 = 80A8C398
/* 003CC 80A89B6C 3C0380A9 */ lui $v1, %hi(gJsjutanShadowEvenVtx) ## $v1 = 80A90000
/* 003D0 80A89B70 2463C398 */ addiu $v1, $v1, %lo(gJsjutanShadowEvenVtx) ## $v1 = 80A8C398
/* 003D4 80A89B74 03197021 */ addu $t6, $t8, $t9
/* 003D8 80A89B78 00037900 */ sll $t7, $v1, 4
/* 003DC 80A89B7C 3C0A8000 */ lui $t2, 0x8000 ## $t2 = 80000000
@ -353,15 +353,15 @@ glabel func_80A89A6C
.L80A89F30:
/* 00790 80A89F30 3C014348 */ lui $at, 0x4348 ## $at = 43480000
/* 00794 80A89F34 44815000 */ mtc1 $at, $f10 ## $f10 = 200.00
/* 00798 80A89F38 46028202 */ mul.s $f8, $f16, $f2
/* 00798 80A89F38 46028202 */ mul.s $f8, $f16, $f2 # $f8 = (phi_f16 * phi_f2_4)
/* 0079C 80A89F3C 3C0180A9 */ lui $at, %hi(D_80A8E498) ## $at = 80A90000
/* 007A0 80A89F40 46088181 */ sub.s $f6, $f16, $f8
/* 007A0 80A89F40 46088181 */ sub.s $f6, $f16, $f8 # $f6 = phi_f16 - (phi_f16 * phi_f2_4)
/* 007A4 80A89F44 C7A800B4 */ lwc1 $f8, 0x00B4($sp)
/* 007A8 80A89F48 460A3101 */ sub.s $f4, $f6, $f10
/* 007A8 80A89F48 460A3101 */ sub.s $f4, $f6, $f10 # $f4 = (phi_f16 - (phi_f16 * phi_f2_4)) - $f10
/* 007AC 80A89F4C C42AE498 */ lwc1 $f10, %lo(D_80A8E498)($at)
/* 007B0 80A89F50 46024182 */ mul.s $f6, $f8, $f2
/* 007B4 80A89F54 460A0301 */ sub.s $f12, $f0, $f10
/* 007B8 80A89F58 4618603C */ c.lt.s $f12, $f24
/* 007B0 80A89F50 46024182 */ mul.s $f6, $f8, $f2 # $f6 = spB4 * phi_f2_4
/* 007B4 80A89F54 460A0301 */ sub.s $f12, $f0, $f10 # distance = distance - 1500.0f;
/* 007B8 80A89F58 4618603C */ c.lt.s $f12, $f24 # distance < 0.0f
/* 007BC 80A89F5C 46043700 */ add.s $f28, $f6, $f4
/* 007C0 80A89F60 45000002 */ bc1f .L80A89F6C
/* 007C4 80A89F64 00000000 */ nop

View File

@ -0,0 +1,38 @@
<Root>
<File Name="ovl_En_Jsjutan" BaseAddress="0x80A897A0" RangeStart="0x12F8" RangeEnd="0x4C88" Segment="128">
<!-- D_80A8AA98. Carpet texture. -->
<Texture Name="gJsjutanCarpetTex" OutName="carpet" Format="rgb5a1" Width="32" Height="64" Offset="0x12F8"/>
<!-- D_80A8BA98. Carpet's shadow vertices. Same vertex type as gJsjutanShadowEvenVtx. Used when gameplayFrames is odd. -->
<Array Name="gJsjutanShadowOddVtx" Count="144" Offset="0x22F8">
<Vtx/>
</Array>
<!-- D_80A8C398. Carpet's shadow vertices. Same vertex type as gJsjutanShadowOddVtx. Used when gameplayFrames is even. -->
<Array Name="gJsjutanShadowEvenVtx" Count="144" Offset="0x2BF8">
<Vtx/>
</Array>
<!-- D_80A8CC98. Carpet vertices. Same vertex type as gJsjutanCarpetEvenVtx. Used when gameplayFrames is odd. -->
<Array Name="gJsjutanCarpetOddVtx" Count="144" Offset="0x34F8">
<Vtx/>
</Array>
<!-- D_80A8E610. Variable declared in `.bss` of EnJsjutan. Used by gJsjutanShadowVisualDL -->
<Symbol Name="gJsjutanShadowTex" Type="u8" Size="1" Count="0x800" Offset="0x4E70"/>
<!-- D_80A8D598. Draws the carpet's texture. -->
<DList Name="gJsjutanCarpetVisualDL" Offset="0x3DF8"/>
<!-- D_80A8D618. Draws the carpet's shadow texture. -->
<DList Name="gJsjutanShadowVisualDL" Offset="0x3E78"/>
<!-- D_80A8D688. Draws vertexs in segment 0x0C. -->
<DList Name="gJsjutanGeometryDL" Offset="0x3EE8"/>
<!-- D_80A8DAB8. Carpet vertices. Same vertex type as gJsjutanCarpetOddVtx. Used when gameplayFrames is even. -->
<Array Name="gJsjutanCarpetEvenVtx" Count="144" Offset="0x4318">
<Vtx/>
</Array>
<!-- D_80A8E400 -->
<Collision Name="gJsjutanCol" Offset="0x4C60"/>
</File>
</Root>

View File

@ -1,16 +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 .bss
.balign 16
glabel D_80A8E610
.space 0x800
glabel D_80A8EE10
.space 0x360

File diff suppressed because one or more lines are too long

6
spec
View File

@ -2522,9 +2522,11 @@ endseg
beginseg
name "ovl_En_Jsjutan"
include "build/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.o"
include "build/data/overlays/actors/z_en_jsjutan.data.o"
include "build/data/overlays/actors/z_en_jsjutan.bss.o"
#ifdef NON_MATCHING
include "build/src/overlays/actors/ovl_En_Jsjutan/ovl_En_Jsjutan_reloc.o"
#else
include "build/data/overlays/actors/z_en_jsjutan.reloc.o"
#endif
endseg
beginseg

View File

@ -1,4 +1,11 @@
/*
* File: z_en_jsjutan.c
* Overlay: ovl_En_Jsjutan
* Description: Magic carpet man's carpet
*/
#include "z_en_jsjutan.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#define FLAGS 0x00000009
@ -9,7 +16,6 @@ void EnJsjutan_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnJsjutan_Update(Actor* thisx, GlobalContext* globalCtx);
void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
const ActorInit En_Jsjutan_InitVars = {
ACTOR_EN_JSJUTAN,
ACTORCAT_NPC,
@ -21,15 +27,466 @@ const ActorInit En_Jsjutan_InitVars = {
(ActorFunc)EnJsjutan_Update,
(ActorFunc)EnJsjutan_Draw,
};
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Destroy.s")
// Shadow texture. 32x64 I8.
u8 gJsjutanShadowTex[0x800];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s")
Vec3s D_80A8EE10[0x90];
static s32 sUnused[2] = { 0, 0 };
#include "overlays/ovl_En_Jsjutan/ovl_En_Jsjutan.c"
void EnJsjutan_Init(Actor* thisx, GlobalContext* globalCtx) {
EnJsjutan* this = THIS;
s32 pad;
CollisionHeader* header = NULL;
this->dyna.actor.flags &= ~1;
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&gJsjutanCol, &header);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, header);
Actor_SetScale(thisx, 0.02f);
this->unk_164 = 1;
this->shadowAlpha = 100.0f;
}
void EnJsjutan_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnJsjutan* this = THIS;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void func_80A89860(EnJsjutan* this, GlobalContext* globalCtx) {
s32 pad;
Vtx* phi_s0;
Vtx* phi_s2;
Vec3f actorPos = this->dyna.actor.world.pos;
s16 i;
phi_s0 = SEGMENTED_TO_VIRTUAL(gJsjutanShadowOddVtx);
phi_s2 = SEGMENTED_TO_VIRTUAL(gJsjutanShadowEvenVtx);
for (i = 0; i < ARRAY_COUNT(D_80A8EE10); i++, phi_s0++, phi_s2++) {
D_80A8EE10[i].x = phi_s0->v.ob[0];
D_80A8EE10[i].z = phi_s0->v.ob[2];
if (this->dyna.actor.params == ENJSJUTAN_TYPE_01) {
phi_s0->v.ob[1] = phi_s2->v.ob[1] = 0x585;
} else {
this->dyna.actor.world.pos.x = phi_s0->v.ob[0] * 0.02f + actorPos.x;
this->dyna.actor.world.pos.z = phi_s0->v.ob[2] * 0.02f + actorPos.z;
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 10.0f, 10.0f, 10.0f, 4);
phi_s0->v.ob[1] = phi_s2->v.ob[1] = this->dyna.actor.floorHeight;
this->dyna.actor.world.pos = actorPos;
}
}
}
#ifdef NON_MATCHING
// regalloc differences
void func_80A89A6C(EnJsjutan* this, GlobalContext* globalCtx) {
u8 isPlayerOnTop;
s16 i;
s16 j;
Vtx* phi_s0;
Vtx* phi_s3;
Vtx* phi_s0_2;
Vec3f sp108;
Vec3f spFC;
Vtx* phi_s0_3;
f32 temp_f0_3;
Player* player;
Actor* parent;
Actor* actorExplosive;
f32 phi_f28;
// 0 if no actor in that index of diffToTracked
u8 spE0[3];
// Tracks distance to other actors.
// Index 0 is always the Magic Carpet Man. 1 and 2 could be bombs, or EnMk and EnMs if in credits.
f32 spD4[3]; // diffToTracked X
f32 spC8[3]; // diffToTracked Y
f32 spBC[3]; // diffToTracked Z
// Tracks distance to Link
f32 spB8; // diffToPlayer X
f32 spB4; // diffToPlayer Y
f32 spB0; // diffToPlayer Z
f32 phi_f2_4;
f32 spA8; // wave amplitude (?)
Actor* actorProfessor;
Actor* actorBeanGuy;
f32 distance_1;
f32 temp_f14_2;
f32 distance_2;
f32 phi_f2_2;
f32 phi_f2_3;
u8 isInCreditsScene;
s16 index; // phi_v1_5
f32 phi_f22;
f32 aux_f20;
s16 phi_v1_4;
s16 temp_a0_3;
u16 dayTime;
isPlayerOnTop = 0;
player = PLAYER;
parent = this->dyna.actor.parent;
actorExplosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head;
isInCreditsScene = 0;
if (globalCtx->gameplayFrames % 2 != 0) {
phi_s0 = SEGMENTED_TO_VIRTUAL(gJsjutanCarpetOddVtx);
phi_s3 = SEGMENTED_TO_VIRTUAL(gJsjutanShadowOddVtx);
} else {
phi_s0 = SEGMENTED_TO_VIRTUAL(gJsjutanCarpetEvenVtx);
phi_s3 = SEGMENTED_TO_VIRTUAL(gJsjutanShadowEvenVtx);
}
// Distance of player to carpet.
spB8 = (player->actor.world.pos.x - this->dyna.actor.world.pos.x) * 50.0f;
spB4 = (player->actor.world.pos.y - this->unk_168) * 50.0f;
spB0 = (player->actor.world.pos.z - this->dyna.actor.world.pos.z) * 50.0f;
phi_s0_2 = phi_s0;
if ((fabsf(spB8) < 5500.0f) && (fabsf(spB4) < 3000.0f) && (fabsf(spB0) < 5500.0f)) {
isPlayerOnTop = 1;
}
// Distance of Magic Carpet Salesman to carpet.
spD4[0] = (parent->world.pos.x - this->dyna.actor.world.pos.x) * 50.0f;
spC8[0] = ((parent->world.pos.y - 8.0f) - this->unk_168) * 50.0f;
spBC[0] = (parent->world.pos.z - this->dyna.actor.world.pos.z) * 50.0f;
spE0[0] = 1;
for (i = 1; i < 3; i++) {
spE0[i] = 0;
}
i = 1;
// Credits scene. The magic carpet man is friends with the bean guy and the lakeside professor.
if ((gSaveContext.entranceIndex == 0x157) && (gSaveContext.sceneSetupIndex == 8)) {
isInCreditsScene = 1;
actorProfessor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head;
while (actorProfessor != NULL) {
if (actorProfessor->id == ACTOR_EN_MK) {
break;
}
actorProfessor = actorProfessor->next;
}
actorBeanGuy = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head;
while (actorBeanGuy != NULL) {
if (actorBeanGuy->id == ACTOR_EN_MS) {
break;
}
actorBeanGuy = actorBeanGuy->next;
}
// If somehow, neither of these two actors is not found, the game
// will dereference a NULL pointer, but this is unlikely to happen.
spD4[1] = 50.0f * (actorProfessor->world.pos.x - this->dyna.actor.world.pos.x);
spC8[1] = 50.0f * (actorProfessor->world.pos.y - this->unk_168);
spBC[1] = 50.0f * (actorProfessor->world.pos.z - this->dyna.actor.world.pos.z);
spE0[1] = 1;
spD4[2] = 50.0f * (actorBeanGuy->world.pos.x - this->dyna.actor.world.pos.x);
spC8[2] = 50.0f * (actorBeanGuy->world.pos.y - this->unk_168);
spBC[2] = 50.0f * (actorBeanGuy->world.pos.z - this->dyna.actor.world.pos.z);
spE0[2] = 1;
} else {
// Player can place bombs in carpet and it will react to it.
while (actorExplosive != NULL) {
if (i < 3) {
spD4[i] = 50.0f * (actorExplosive->world.pos.x - this->dyna.actor.world.pos.x);
spC8[i] = 50.0f * (actorExplosive->world.pos.y - this->unk_168);
spBC[i] = 50.0f * (actorExplosive->world.pos.z - this->dyna.actor.world.pos.z);
if ((fabsf(spD4[i]) < 5500.0f) && (fabsf(spC8[i]) < 3000.0f) && (fabsf(spBC[i]) < 5500.0f)) {
if (actorExplosive->params == BOMB_EXPLOSION) {
spE0[i] = 35; // Code never checks this, so it goes unused. Maybe it was planned to damage the
// carpet with explosions (?)
} else {
spE0[i] = 1;
}
}
i++;
}
actorExplosive = actorExplosive->next;
}
}
if (1) {}
// Fancy math to make a woobly and reactive carpet.
for (j = 0; j < ARRAY_COUNT(D_80A8EE10); j++, phi_s0++, phi_s3++) {
if (isPlayerOnTop) {
// Linear distance from j-th wave to player, in XZ plane.
distance_1 = sqrtf(SQ(phi_s0->n.ob[2] - spB0) + SQ(phi_s0->n.ob[0] - spB8));
// Distance percentage. 0.0f to 1.0f. 2500.0f is the max distance to an actor that this wave will consider.
phi_f2_4 = (2500.0f - distance_1) / 2500.0f;
if (phi_f2_4 < 0.0f) {
phi_f2_4 = 0.0f;
}
// phi_f28 = (spB4 * phi_f2_4) + ((this->unk_170 - (this->unk_170 * phi_f2_4)) - 200.0f);
spA8 = (spB4 * phi_f2_4) + ((this->unk_170 - (this->unk_170 * phi_f2_4)) - 200.0f);
phi_f28 = spA8;
distance_1 -= 1500.0f;
if (distance_1 < 0.0f) {
distance_1 = 0.0f;
}
spA8 = 100.0f * distance_1 * 0.01f;
if (spA8 > 100.0f) {
spA8 = 100.0f;
}
} else {
phi_f28 = this->unk_170 - 200.f;
spA8 = 100.0f;
}
for (i = 0; i < 3; i++) {
if (spE0[i] != 0) {
// Linear distance from j-th wave to whatever actor is there, in XZ plane.
distance_2 = sqrtf(SQ(phi_s0->n.ob[2] - spBC[i]) + SQ(phi_s0->n.ob[0] - spD4[i]));
if ((i == 0) || isInCreditsScene) {
phi_f2_2 = (3000.0f - distance_2) / 3000.0f;
} else {
phi_f2_2 = (2000.0f - distance_2) / 2000.0f;
}
if (phi_f2_2 < 0.0f) {
phi_f2_2 = 0.0f;
}
// temp_f14_2 = (spC8[i] * phi_f2_2) + ((this->unk_170 - (this->unk_170 * phi_f2_2)) - 200.0f);
temp_f14_2 = (spC8[i] * phi_f2_2);
temp_f14_2 += ((this->unk_170 - (this->unk_170 * phi_f2_2)) - 200.0f);
distance_2 = distance_2 - 1500.0f;
if (distance_2 < 0.0f) {
distance_2 = 0.0f;
}
phi_f2_3 = 100.0f * distance_2 * 0.01f;
if (phi_f2_3 > 100.0f) {
phi_f2_3 = 100.0f;
}
if (temp_f14_2 < phi_f28) {
phi_f28 = temp_f14_2;
}
if (phi_f2_3 < spA8) {
spA8 = phi_f2_3;
}
}
}
/**
* See https://en.wikipedia.org/wiki/Sine_wave#General_form
* k: 10000
* x: j
* w: 4000
* t: gameplayFrames
* A: spA8
* D: phi_f28
*/
temp_f0_3 = Math_SinS(globalCtx->gameplayFrames * 4000 + j * 10000);
if (this->unk_174) {
temp_f14_2 = temp_f0_3 * spA8;
phi_v1_4 = phi_f28 + (temp_f14_2);
temp_a0_3 = (phi_s3->n.ob[1] - this->unk_168) * 50.0f;
if (phi_v1_4 < temp_a0_3) {
phi_v1_4 = temp_a0_3;
}
phi_s0->n.ob[1] = phi_v1_4;
} else {
temp_f14_2 = temp_f0_3 * spA8;
phi_s0->n.ob[1] = phi_f28 + (temp_f14_2);
phi_v1_4 = temp_f14_2 * 0.5f;
phi_s0->n.ob[0] = D_80A8EE10[j].x + phi_v1_4;
phi_s0->n.ob[2] = D_80A8EE10[j].z + phi_v1_4;
phi_v1_4 = temp_f14_2;
phi_s3->n.ob[0] = D_80A8EE10[j].x + phi_v1_4;
phi_s3->n.ob[2] = D_80A8EE10[j].z + phi_v1_4;
}
}
// address: ac4 ~ bb8
if (!this->unk_174) {
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.world.pos.y = this->unk_168;
dayTime = gSaveContext.dayTime;
if (dayTime >= 0x8000) {
dayTime = 0xFFFF - dayTime;
}
this->shadowAlpha = (dayTime * 0.00275f) + 10.0f; // (1.0f / 364.0f) ?
this->unk_170 = 1000.0f;
} else {
Math_ApproachF(&this->dyna.actor.world.pos.y, this->unk_168 - 1000.0f, 1.0f, this->dyna.actor.velocity.y);
//! Note to whoever tries to match this function:
//! daytime commonly needs the (void)0 trick.
//! could help with the temp above and some of these other memes.
//! -fig02 (https://github.com/zeldaret/oot/pull/713#discussion_r593921251)
if (!gSaveContext.dayTime) {
if (1) {}
if (1) {}
if (1) {}
if (1) {}
}
Math_ApproachF(&this->dyna.actor.velocity.y, 5.0f, 1.0f, 0.5f);
Math_ApproachF(&this->shadowAlpha, 0.0f, 1.0f, 3.0f);
Math_ApproachF(&this->unk_170, -5000.0f, 1.0f, 100.0f);
}
// address: bbc
phi_s0_3 = phi_s0_2;
if (1) {}
if (1) {}
sp108.x = 0.0f;
sp108.y = 0.0f;
sp108.z = 120.0f;
// Fancy math to smooth each part of the wave considering its neighborhood.
for (j = 0; j < ARRAY_COUNT(gJsjutanCarpetOddVtx); j++, phi_s0_3++) {
// Carpet size is 12x12.
if ((j % 12) == 11) { // Last column.
index = j - 1;
phi_f22 = phi_s0_3->n.ob[2] - phi_s0_2[index].n.ob[2];
} else {
index = j + 1;
phi_f22 = phi_s0_2[index].n.ob[2] - phi_s0_3->n.ob[2];
}
temp_f0_3 = phi_s0_2[index].n.ob[1] - phi_s0_3->n.ob[1];
phi_f22 = Math_Atan2F(phi_f22, temp_f0_3);
if (j >= 132) { // Last row.
index = j - 12;
aux_f20 = phi_s0_3->n.ob[0] - phi_s0_2[index].n.ob[0];
} else {
index = j + 12;
aux_f20 = phi_s0_2[index].n.ob[0] - phi_s0_3->n.ob[0];
}
aux_f20 = Math_Atan2F(aux_f20, temp_f0_3);
Matrix_RotateX(phi_f22, MTXMODE_NEW);
Matrix_RotateZ(aux_f20, MTXMODE_APPLY);
Matrix_MultVec3f(&sp108, &spFC);
phi_s0_3->n.n[0] = spFC.x;
phi_s0_3->n.n[1] = spFC.y;
phi_s0_3->n.n[2] = spFC.z;
}
}
#else
void func_80A89A6C(EnJsjutan* this, GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89A6C.s")
#endif
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Update.s")
void EnJsjutan_Update(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jsjutan/EnJsjutan_Draw.s")
thisx->shape.rot.x = Math_SinS(globalCtx->gameplayFrames * 3000) * 300.0f;
thisx->shape.rot.z = Math_CosS(globalCtx->gameplayFrames * 3500) * 300.0f;
}
void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx2) {
EnJsjutan* this = THIS;
GlobalContext* globalCtx = globalCtx2;
s16 i;
Actor* parent = thisx->parent;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_jsjutan.c", 701);
if (thisx->params == ENJSJUTAN_TYPE_01) {
thisx->world.pos.x = parent->world.pos.x;
thisx->world.pos.y = parent->world.pos.y;
thisx->world.pos.z = parent->world.pos.z;
this->unk_168 = thisx->world.pos.y;
if (this->unk_175 == 0) {
this->unk_175 = 1;
func_80A89860(this, globalCtx);
}
} else if (this->unk_175 == 0) {
this->unk_175 = 1;
thisx->world.pos.x = Math_SinS(parent->shape.rot.y) * 60.0f + parent->world.pos.x;
thisx->world.pos.y = (parent->world.pos.y + 5.0f) - 10.0f;
thisx->world.pos.z = Math_CosS(parent->shape.rot.y) * 60.0f + parent->world.pos.z;
this->unk_168 = thisx->world.pos.y;
func_80A89860(this, globalCtx);
}
func_80A89A6C(this, globalCtx);
if (this->unk_164 != 0) {
this->unk_164 = 0;
for (i = 0; i < ARRAY_COUNT(gJsjutanShadowTex); i++) {
if (((u16*)gJsjutanCarpetTex)[i] != 0) { // Hack to bypass ZAPD exporting textures as u64.
gJsjutanShadowTex[i] = 0xFF;
} else {
gJsjutanShadowTex[i] = 0;
}
}
}
func_80093D18(globalCtx->state.gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (s16)this->shadowAlpha);
Matrix_Translate(thisx->world.pos.x, 3.0f, thisx->world.pos.z, MTXMODE_NEW);
Matrix_Scale(thisx->scale.x, 1.0f, thisx->scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_jsjutan.c", 782),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
// Draws the carpet's shadow texture.
gSPDisplayList(POLY_OPA_DISP++, gJsjutanShadowVisualDL);
gDPPipeSync(POLY_OPA_DISP++);
// Draws the carpet's shadow vertices. Swaps them between frames to get a smoother result.
if (globalCtx->gameplayFrames % 2 != 0) {
gSPSegment(POLY_OPA_DISP++, 0x0C, gJsjutanShadowOddVtx);
} else {
gSPSegment(POLY_OPA_DISP++, 0x0C, gJsjutanShadowEvenVtx);
}
gSPDisplayList(POLY_OPA_DISP++, gJsjutanGeometryDL);
func_80093D18(globalCtx->state.gfxCtx);
Matrix_Translate(thisx->world.pos.x, this->unk_168 + 3.0f, thisx->world.pos.z, MTXMODE_NEW);
Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_jsjutan.c", 805),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
// Draws the carpet's texture.
gSPDisplayList(POLY_OPA_DISP++, gJsjutanCarpetVisualDL);
gDPPipeSync(POLY_OPA_DISP++);
// Draws the carpet vertices.
if (globalCtx->gameplayFrames % 2 != 0) {
gSPSegment(POLY_OPA_DISP++, 0x0C, gJsjutanCarpetOddVtx);
} else {
gSPSegment(POLY_OPA_DISP++, 0x0C, gJsjutanCarpetEvenVtx);
}
gSPDisplayList(POLY_OPA_DISP++, gJsjutanGeometryDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_jsjutan.c", 823);
}

View File

@ -7,10 +7,20 @@
struct EnJsjutan;
typedef struct EnJsjutan {
/* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x2C];
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ u8 unk_164; // flag to set carpet shadow textures.
/* 0x0168 */ f32 unk_168; // actorYPos
/* 0x016C */ f32 shadowAlpha;
/* 0x0170 */ f32 unk_170;
/* 0x0174 */ u8 unk_174; // flag?
/* 0x0175 */ u8 unk_175; // setup flag?
} EnJsjutan; // size = 0x0178
typedef enum {
/* 0 */ ENJSJUTAN_TYPE_00,
/* 1 */ ENJSJUTAN_TYPE_01
} EnJsjutanType;
extern const ActorInit En_Jsjutan_InitVars;
#endif