mirror of
https://github.com/pmret/papermario.git
synced 2024-11-13 22:43:00 +01:00
ED510 stuff
This commit is contained in:
parent
b1ee019af2
commit
7614b51d70
@ -1,47 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
glabel PlaySoundAtCollider
|
|
||||||
/* EEFC4 802CA614 27BDFFC8 */ addiu $sp, $sp, -0x38
|
|
||||||
/* EEFC8 802CA618 AFB1002C */ sw $s1, 0x2c($sp)
|
|
||||||
/* EEFCC 802CA61C 0080882D */ daddu $s1, $a0, $zero
|
|
||||||
/* EEFD0 802CA620 AFBF0034 */ sw $ra, 0x34($sp)
|
|
||||||
/* EEFD4 802CA624 AFB20030 */ sw $s2, 0x30($sp)
|
|
||||||
/* EEFD8 802CA628 AFB00028 */ sw $s0, 0x28($sp)
|
|
||||||
/* EEFDC 802CA62C 8E30000C */ lw $s0, 0xc($s1)
|
|
||||||
/* EEFE0 802CA630 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EEFE4 802CA634 0C0B1EAF */ jal get_variable
|
|
||||||
/* EEFE8 802CA638 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EEFEC 802CA63C 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EEFF0 802CA640 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EEFF4 802CA644 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EEFF8 802CA648 0C0B1EAF */ jal get_variable
|
|
||||||
/* EEFFC 802CA64C 0040902D */ daddu $s2, $v0, $zero
|
|
||||||
/* EF000 802CA650 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EF004 802CA654 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EF008 802CA658 0C0B1EAF */ jal get_variable
|
|
||||||
/* EF00C 802CA65C 0040802D */ daddu $s0, $v0, $zero
|
|
||||||
/* EF010 802CA660 0240202D */ daddu $a0, $s2, $zero
|
|
||||||
/* EF014 802CA664 27A50018 */ addiu $a1, $sp, 0x18
|
|
||||||
/* EF018 802CA668 27A6001C */ addiu $a2, $sp, 0x1c
|
|
||||||
/* EF01C 802CA66C 27A70020 */ addiu $a3, $sp, 0x20
|
|
||||||
/* EF020 802CA670 0C016F84 */ jal get_collider_center
|
|
||||||
/* EF024 802CA674 0040882D */ daddu $s1, $v0, $zero
|
|
||||||
/* EF028 802CA678 0200202D */ daddu $a0, $s0, $zero
|
|
||||||
/* EF02C 802CA67C C7A00018 */ lwc1 $f0, 0x18($sp)
|
|
||||||
/* EF030 802CA680 C7A2001C */ lwc1 $f2, 0x1c($sp)
|
|
||||||
/* EF034 802CA684 44060000 */ mfc1 $a2, $f0
|
|
||||||
/* EF038 802CA688 44071000 */ mfc1 $a3, $f2
|
|
||||||
/* EF03C 802CA68C C7A00020 */ lwc1 $f0, 0x20($sp)
|
|
||||||
/* EF040 802CA690 0220282D */ daddu $a1, $s1, $zero
|
|
||||||
/* EF044 802CA694 0C052757 */ jal play_sound_at_position
|
|
||||||
/* EF048 802CA698 E7A00010 */ swc1 $f0, 0x10($sp)
|
|
||||||
/* EF04C 802CA69C 8FBF0034 */ lw $ra, 0x34($sp)
|
|
||||||
/* EF050 802CA6A0 8FB20030 */ lw $s2, 0x30($sp)
|
|
||||||
/* EF054 802CA6A4 8FB1002C */ lw $s1, 0x2c($sp)
|
|
||||||
/* EF058 802CA6A8 8FB00028 */ lw $s0, 0x28($sp)
|
|
||||||
/* EF05C 802CA6AC 24020002 */ addiu $v0, $zero, 2
|
|
||||||
/* EF060 802CA6B0 03E00008 */ jr $ra
|
|
||||||
/* EF064 802CA6B4 27BD0038 */ addiu $sp, $sp, 0x38
|
|
||||||
/* EF068 802CA6B8 00000000 */ nop
|
|
||||||
/* EF06C 802CA6BC 00000000 */ nop
|
|
@ -1,51 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
glabel PlaySoundAtModel
|
|
||||||
/* EEF08 802CA558 27BDFFB8 */ addiu $sp, $sp, -0x48
|
|
||||||
/* EEF0C 802CA55C AFB1003C */ sw $s1, 0x3c($sp)
|
|
||||||
/* EEF10 802CA560 0080882D */ daddu $s1, $a0, $zero
|
|
||||||
/* EEF14 802CA564 AFBF0044 */ sw $ra, 0x44($sp)
|
|
||||||
/* EEF18 802CA568 AFB20040 */ sw $s2, 0x40($sp)
|
|
||||||
/* EEF1C 802CA56C AFB00038 */ sw $s0, 0x38($sp)
|
|
||||||
/* EEF20 802CA570 8E30000C */ lw $s0, 0xc($s1)
|
|
||||||
/* EEF24 802CA574 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EEF28 802CA578 0C0B1EAF */ jal get_variable
|
|
||||||
/* EEF2C 802CA57C 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EEF30 802CA580 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EEF34 802CA584 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EEF38 802CA588 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EEF3C 802CA58C 0C0B1EAF */ jal get_variable
|
|
||||||
/* EEF40 802CA590 0040902D */ daddu $s2, $v0, $zero
|
|
||||||
/* EEF44 802CA594 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EEF48 802CA598 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EEF4C 802CA59C 0C0B1EAF */ jal get_variable
|
|
||||||
/* EEF50 802CA5A0 0040882D */ daddu $s1, $v0, $zero
|
|
||||||
/* EEF54 802CA5A4 3244FFFF */ andi $a0, $s2, 0xffff
|
|
||||||
/* EEF58 802CA5A8 27A50020 */ addiu $a1, $sp, 0x20
|
|
||||||
/* EEF5C 802CA5AC 27A60024 */ addiu $a2, $sp, 0x24
|
|
||||||
/* EEF60 802CA5B0 27A70028 */ addiu $a3, $sp, 0x28
|
|
||||||
/* EEF64 802CA5B4 27A3002C */ addiu $v1, $sp, 0x2c
|
|
||||||
/* EEF68 802CA5B8 AFA30010 */ sw $v1, 0x10($sp)
|
|
||||||
/* EEF6C 802CA5BC 27A30030 */ addiu $v1, $sp, 0x30
|
|
||||||
/* EEF70 802CA5C0 AFA30014 */ sw $v1, 0x14($sp)
|
|
||||||
/* EEF74 802CA5C4 27A30034 */ addiu $v1, $sp, 0x34
|
|
||||||
/* EEF78 802CA5C8 0040802D */ daddu $s0, $v0, $zero
|
|
||||||
/* EEF7C 802CA5CC 0C046C3B */ jal get_model_center_and_size
|
|
||||||
/* EEF80 802CA5D0 AFA30018 */ sw $v1, 0x18($sp)
|
|
||||||
/* EEF84 802CA5D4 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EEF88 802CA5D8 C7A00020 */ lwc1 $f0, 0x20($sp)
|
|
||||||
/* EEF8C 802CA5DC C7A20024 */ lwc1 $f2, 0x24($sp)
|
|
||||||
/* EEF90 802CA5E0 44060000 */ mfc1 $a2, $f0
|
|
||||||
/* EEF94 802CA5E4 44071000 */ mfc1 $a3, $f2
|
|
||||||
/* EEF98 802CA5E8 C7A00028 */ lwc1 $f0, 0x28($sp)
|
|
||||||
/* EEF9C 802CA5EC 0200282D */ daddu $a1, $s0, $zero
|
|
||||||
/* EEFA0 802CA5F0 0C052757 */ jal play_sound_at_position
|
|
||||||
/* EEFA4 802CA5F4 E7A00010 */ swc1 $f0, 0x10($sp)
|
|
||||||
/* EEFA8 802CA5F8 8FBF0044 */ lw $ra, 0x44($sp)
|
|
||||||
/* EEFAC 802CA5FC 8FB20040 */ lw $s2, 0x40($sp)
|
|
||||||
/* EEFB0 802CA600 8FB1003C */ lw $s1, 0x3c($sp)
|
|
||||||
/* EEFB4 802CA604 8FB00038 */ lw $s0, 0x38($sp)
|
|
||||||
/* EEFB8 802CA608 24020002 */ addiu $v0, $zero, 2
|
|
||||||
/* EEFBC 802CA60C 03E00008 */ jr $ra
|
|
||||||
/* EEFC0 802CA610 27BD0048 */ addiu $sp, $sp, 0x48
|
|
@ -1,79 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
glabel RotateModel
|
|
||||||
/* ED614 802C8C64 27BDFF78 */ addiu $sp, $sp, -0x88
|
|
||||||
/* ED618 802C8C68 AFB1005C */ sw $s1, 0x5c($sp)
|
|
||||||
/* ED61C 802C8C6C 0080882D */ daddu $s1, $a0, $zero
|
|
||||||
/* ED620 802C8C70 AFBF0064 */ sw $ra, 0x64($sp)
|
|
||||||
/* ED624 802C8C74 AFB20060 */ sw $s2, 0x60($sp)
|
|
||||||
/* ED628 802C8C78 AFB00058 */ sw $s0, 0x58($sp)
|
|
||||||
/* ED62C 802C8C7C F7BA0080 */ sdc1 $f26, 0x80($sp)
|
|
||||||
/* ED630 802C8C80 F7B80078 */ sdc1 $f24, 0x78($sp)
|
|
||||||
/* ED634 802C8C84 F7B60070 */ sdc1 $f22, 0x70($sp)
|
|
||||||
/* ED638 802C8C88 F7B40068 */ sdc1 $f20, 0x68($sp)
|
|
||||||
/* ED63C 802C8C8C 8E30000C */ lw $s0, 0xc($s1)
|
|
||||||
/* ED640 802C8C90 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* ED644 802C8C94 0C0B1EAF */ jal get_variable
|
|
||||||
/* ED648 802C8C98 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* ED64C 802C8C9C 0C046C04 */ jal get_model_list_index_from_tree_index
|
|
||||||
/* ED650 802C8CA0 0040202D */ daddu $a0, $v0, $zero
|
|
||||||
/* ED654 802C8CA4 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* ED658 802C8CA8 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* ED65C 802C8CAC 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* ED660 802C8CB0 0C0B210B */ jal get_float_variable
|
|
||||||
/* ED664 802C8CB4 0040902D */ daddu $s2, $v0, $zero
|
|
||||||
/* ED668 802C8CB8 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* ED66C 802C8CBC 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* ED670 802C8CC0 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* ED674 802C8CC4 0C0B210B */ jal get_float_variable
|
|
||||||
/* ED678 802C8CC8 46000686 */ mov.s $f26, $f0
|
|
||||||
/* ED67C 802C8CCC 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* ED680 802C8CD0 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* ED684 802C8CD4 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* ED688 802C8CD8 0C0B210B */ jal get_float_variable
|
|
||||||
/* ED68C 802C8CDC 46000606 */ mov.s $f24, $f0
|
|
||||||
/* ED690 802C8CE0 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* ED694 802C8CE4 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* ED698 802C8CE8 0C0B210B */ jal get_float_variable
|
|
||||||
/* ED69C 802C8CEC 46000506 */ mov.s $f20, $f0
|
|
||||||
/* ED6A0 802C8CF0 0240202D */ daddu $a0, $s2, $zero
|
|
||||||
/* ED6A4 802C8CF4 0C046B4C */ jal get_model_from_list_index
|
|
||||||
/* ED6A8 802C8CF8 46000586 */ mov.s $f22, $f0
|
|
||||||
/* ED6AC 802C8CFC 0040802D */ daddu $s0, $v0, $zero
|
|
||||||
/* ED6B0 802C8D00 96020000 */ lhu $v0, ($s0)
|
|
||||||
/* ED6B4 802C8D04 30420400 */ andi $v0, $v0, 0x400
|
|
||||||
/* ED6B8 802C8D08 1440000B */ bnez $v0, .L802C8D38
|
|
||||||
/* ED6BC 802C8D0C 27A40018 */ addiu $a0, $sp, 0x18
|
|
||||||
/* ED6C0 802C8D10 4405D000 */ mfc1 $a1, $f26
|
|
||||||
/* ED6C4 802C8D14 4406C000 */ mfc1 $a2, $f24
|
|
||||||
/* ED6C8 802C8D18 4407A000 */ mfc1 $a3, $f20
|
|
||||||
/* ED6CC 802C8D1C 26040058 */ addiu $a0, $s0, 0x58
|
|
||||||
/* ED6D0 802C8D20 0C019EC8 */ jal guRotateF
|
|
||||||
/* ED6D4 802C8D24 E7B60010 */ swc1 $f22, 0x10($sp)
|
|
||||||
/* ED6D8 802C8D28 96020000 */ lhu $v0, ($s0)
|
|
||||||
/* ED6DC 802C8D2C 34421400 */ ori $v0, $v0, 0x1400
|
|
||||||
/* ED6E0 802C8D30 080B2357 */ j .L802C8D5C
|
|
||||||
/* ED6E4 802C8D34 A6020000 */ sh $v0, ($s0)
|
|
||||||
.L802C8D38:
|
|
||||||
/* ED6E8 802C8D38 4405D000 */ mfc1 $a1, $f26
|
|
||||||
/* ED6EC 802C8D3C 4406C000 */ mfc1 $a2, $f24
|
|
||||||
/* ED6F0 802C8D40 4407A000 */ mfc1 $a3, $f20
|
|
||||||
/* ED6F4 802C8D44 0C019EC8 */ jal guRotateF
|
|
||||||
/* ED6F8 802C8D48 E7B60010 */ swc1 $f22, 0x10($sp)
|
|
||||||
/* ED6FC 802C8D4C 27A40018 */ addiu $a0, $sp, 0x18
|
|
||||||
/* ED700 802C8D50 26050058 */ addiu $a1, $s0, 0x58
|
|
||||||
/* ED704 802C8D54 0C019D80 */ jal guMtxCatF
|
|
||||||
/* ED708 802C8D58 00A0302D */ daddu $a2, $a1, $zero
|
|
||||||
.L802C8D5C:
|
|
||||||
/* ED70C 802C8D5C 8FBF0064 */ lw $ra, 0x64($sp)
|
|
||||||
/* ED710 802C8D60 8FB20060 */ lw $s2, 0x60($sp)
|
|
||||||
/* ED714 802C8D64 8FB1005C */ lw $s1, 0x5c($sp)
|
|
||||||
/* ED718 802C8D68 8FB00058 */ lw $s0, 0x58($sp)
|
|
||||||
/* ED71C 802C8D6C D7BA0080 */ ldc1 $f26, 0x80($sp)
|
|
||||||
/* ED720 802C8D70 D7B80078 */ ldc1 $f24, 0x78($sp)
|
|
||||||
/* ED724 802C8D74 D7B60070 */ ldc1 $f22, 0x70($sp)
|
|
||||||
/* ED728 802C8D78 D7B40068 */ ldc1 $f20, 0x68($sp)
|
|
||||||
/* ED72C 802C8D7C 24020002 */ addiu $v0, $zero, 2
|
|
||||||
/* ED730 802C8D80 03E00008 */ jr $ra
|
|
||||||
/* ED734 802C8D84 27BD0088 */ addiu $sp, $sp, 0x88
|
|
@ -1,55 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
glabel SetTexPanOffset
|
|
||||||
/* EDD14 802C9364 27BDFFD8 */ addiu $sp, $sp, -0x28
|
|
||||||
/* EDD18 802C9368 AFB10014 */ sw $s1, 0x14($sp)
|
|
||||||
/* EDD1C 802C936C 0080882D */ daddu $s1, $a0, $zero
|
|
||||||
/* EDD20 802C9370 AFBF0020 */ sw $ra, 0x20($sp)
|
|
||||||
/* EDD24 802C9374 AFB3001C */ sw $s3, 0x1c($sp)
|
|
||||||
/* EDD28 802C9378 AFB20018 */ sw $s2, 0x18($sp)
|
|
||||||
/* EDD2C 802C937C AFB00010 */ sw $s0, 0x10($sp)
|
|
||||||
/* EDD30 802C9380 8E30000C */ lw $s0, 0xc($s1)
|
|
||||||
/* EDD34 802C9384 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EDD38 802C9388 0C0B1EAF */ jal get_variable
|
|
||||||
/* EDD3C 802C938C 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EDD40 802C9390 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EDD44 802C9394 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EDD48 802C9398 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EDD4C 802C939C 0C0B1EAF */ jal get_variable
|
|
||||||
/* EDD50 802C93A0 0040982D */ daddu $s3, $v0, $zero
|
|
||||||
/* EDD54 802C93A4 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EDD58 802C93A8 26100004 */ addiu $s0, $s0, 4
|
|
||||||
/* EDD5C 802C93AC 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EDD60 802C93B0 0C0B1EAF */ jal get_variable
|
|
||||||
/* EDD64 802C93B4 0040902D */ daddu $s2, $v0, $zero
|
|
||||||
/* EDD68 802C93B8 0220202D */ daddu $a0, $s1, $zero
|
|
||||||
/* EDD6C 802C93BC 8E050000 */ lw $a1, ($s0)
|
|
||||||
/* EDD70 802C93C0 0C0B1EAF */ jal get_variable
|
|
||||||
/* EDD74 802C93C4 0040802D */ daddu $s0, $v0, $zero
|
|
||||||
/* EDD78 802C93C8 16400009 */ bnez $s2, .L802C93F0
|
|
||||||
/* EDD7C 802C93CC 0040882D */ daddu $s1, $v0, $zero
|
|
||||||
/* EDD80 802C93D0 0260202D */ daddu $a0, $s3, $zero
|
|
||||||
/* EDD84 802C93D4 0C046F07 */ jal set_main_pan_u
|
|
||||||
/* EDD88 802C93D8 0200282D */ daddu $a1, $s0, $zero
|
|
||||||
/* EDD8C 802C93DC 0260202D */ daddu $a0, $s3, $zero
|
|
||||||
/* EDD90 802C93E0 0C046F0D */ jal set_main_pan_v
|
|
||||||
/* EDD94 802C93E4 0220282D */ daddu $a1, $s1, $zero
|
|
||||||
/* EDD98 802C93E8 080B2502 */ j .L802C9408
|
|
||||||
/* EDD9C 802C93EC 00000000 */ nop
|
|
||||||
.L802C93F0:
|
|
||||||
/* EDDA0 802C93F0 0260202D */ daddu $a0, $s3, $zero
|
|
||||||
/* EDDA4 802C93F4 0C046F13 */ jal set_aux_pan_u
|
|
||||||
/* EDDA8 802C93F8 0200282D */ daddu $a1, $s0, $zero
|
|
||||||
/* EDDAC 802C93FC 0260202D */ daddu $a0, $s3, $zero
|
|
||||||
/* EDDB0 802C9400 0C046F19 */ jal set_aux_pan_v
|
|
||||||
/* EDDB4 802C9404 0220282D */ daddu $a1, $s1, $zero
|
|
||||||
.L802C9408:
|
|
||||||
/* EDDB8 802C9408 8FBF0020 */ lw $ra, 0x20($sp)
|
|
||||||
/* EDDBC 802C940C 8FB3001C */ lw $s3, 0x1c($sp)
|
|
||||||
/* EDDC0 802C9410 8FB20018 */ lw $s2, 0x18($sp)
|
|
||||||
/* EDDC4 802C9414 8FB10014 */ lw $s1, 0x14($sp)
|
|
||||||
/* EDDC8 802C9418 8FB00010 */ lw $s0, 0x10($sp)
|
|
||||||
/* EDDCC 802C941C 24020002 */ addiu $v0, $zero, 2
|
|
||||||
/* EDDD0 802C9420 03E00008 */ jr $ra
|
|
||||||
/* EDDD4 802C9424 27BD0028 */ addiu $sp, $sp, 0x28
|
|
127
src/code_ED510.c
127
src/code_ED510.c
@ -1,10 +1,81 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
// Works to set model->flags & 0x400 to modelListIndex, but that seems wrong and misleading (fake match)
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
ApiStatus TranslateModel(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
s32 var1 = get_variable(script, *args++);
|
||||||
|
s32 modelListIndex = get_model_list_index_from_tree_index(var1);
|
||||||
|
f32 x = get_float_variable(script, *args++);
|
||||||
|
f32 y = get_float_variable(script, *args++);
|
||||||
|
f32 z = get_float_variable(script, *args++);
|
||||||
|
Model* model = get_model_from_list_index(modelListIndex);
|
||||||
|
|
||||||
|
if ((model->flags & 0x400) == 0) {
|
||||||
|
guTranslateF(&model->transformMatrix, x, y, z);
|
||||||
|
model->flags |= 0x1400;
|
||||||
|
} else {
|
||||||
|
Matrix4f mtx;
|
||||||
|
|
||||||
|
guTranslateF(&mtx, x, y, z);
|
||||||
|
guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
#else
|
||||||
INCLUDE_ASM(s32, "code_ED510", TranslateModel, ScriptInstance* script, s32 isInitialCall);
|
INCLUDE_ASM(s32, "code_ED510", TranslateModel, ScriptInstance* script, s32 isInitialCall);
|
||||||
|
#endif
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_ED510", RotateModel, ScriptInstance* script, s32 isInitialCall);
|
ApiStatus RotateModel(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
s32 var1 = get_variable(script, *args++);
|
||||||
|
s32 modelListIndex = get_model_list_index_from_tree_index(var1);
|
||||||
|
f32 a = get_float_variable(script, *args++);
|
||||||
|
f32 x = get_float_variable(script, *args++);
|
||||||
|
f32 y = get_float_variable(script, *args++);
|
||||||
|
f32 z = get_float_variable(script, *args++);
|
||||||
|
Model* model = get_model_from_list_index(modelListIndex);
|
||||||
|
|
||||||
|
if ((model->flags & 0x400) == 0) {
|
||||||
|
guRotateF(&model->transformMatrix, a, x, y, z);
|
||||||
|
model->flags |= 0x1400;
|
||||||
|
} else {
|
||||||
|
Matrix4f mtx;
|
||||||
|
|
||||||
|
guRotateF(&mtx, a, x, y, z);
|
||||||
|
guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same as TranslateModel above
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
ApiStatus ScaleModel(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
s32 var1 = get_variable(script, *args++);
|
||||||
|
s32 modelListIndex = get_model_list_index_from_tree_index(var1);
|
||||||
|
f32 x = get_float_variable(script, *args++);
|
||||||
|
f32 y = get_float_variable(script, *args++);
|
||||||
|
f32 z = get_float_variable(script, *args++);
|
||||||
|
Model* model = get_model_from_list_index(modelListIndex);
|
||||||
|
|
||||||
|
if ((model->flags & 0x400) == 0) {
|
||||||
|
guScaleF(&model->transformMatrix, x, y, z);
|
||||||
|
model->flags |= 0x1400;
|
||||||
|
} else {
|
||||||
|
Matrix4f mtx;
|
||||||
|
|
||||||
|
guScaleF(&mtx, x, y, z);
|
||||||
|
guMtxCatF(&mtx, &model->transformMatrix, &model->transformMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
#else
|
||||||
INCLUDE_ASM(s32, "code_ED510", ScaleModel, ScriptInstance* script, s32 isInitialCall);
|
INCLUDE_ASM(s32, "code_ED510", ScaleModel, ScriptInstance* script, s32 isInitialCall);
|
||||||
|
#endif
|
||||||
|
|
||||||
ApiStatus GetModelIndex(ScriptInstance* script, s32 isInitialCall) {
|
ApiStatus GetModelIndex(ScriptInstance* script, s32 isInitialCall) {
|
||||||
Bytecode* thisPos = script->ptrReadPos;
|
Bytecode* thisPos = script->ptrReadPos;
|
||||||
@ -139,7 +210,23 @@ ApiStatus SetGroupEnabled(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_DONE2;
|
return ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_ED510", SetTexPanOffset, ScriptInstance* script, s32 isInitialCall);
|
ApiStatus SetTexPanOffset(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* thisPos = script->ptrReadPos;
|
||||||
|
Bytecode var1 = get_variable(script, *thisPos++);
|
||||||
|
Bytecode var2 = get_variable(script, *thisPos++);
|
||||||
|
Bytecode var3 = get_variable(script, *thisPos++);
|
||||||
|
Bytecode var4 = get_variable(script, *thisPos++);
|
||||||
|
|
||||||
|
if (var2 == 0) {
|
||||||
|
set_main_pan_u(var1, var3);
|
||||||
|
set_main_pan_v(var1, var4);
|
||||||
|
} else {
|
||||||
|
set_aux_pan_u(var1, var3);
|
||||||
|
set_aux_pan_v(var1, var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
|
||||||
ApiStatus func_802C9428(ScriptInstance* script, s32 isInitialCall) {
|
ApiStatus func_802C9428(ScriptInstance* script, s32 isInitialCall) {
|
||||||
Bytecode* thisPos = script->ptrReadPos;
|
Bytecode* thisPos = script->ptrReadPos;
|
||||||
@ -167,13 +254,10 @@ ApiStatus SetModelFlags(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
s32 treeIndex = get_variable(script, *args++);
|
s32 treeIndex = get_variable(script, *args++);
|
||||||
s32 listIndex = get_model_list_index_from_tree_index(treeIndex);
|
s32 listIndex = get_model_list_index_from_tree_index(treeIndex);
|
||||||
s32 a1 = *args++;
|
s32 a1 = *args++;
|
||||||
s32 var2;
|
s32 var2 = get_variable(script, *args++);
|
||||||
Model* model;
|
Model* model = get_model_from_list_index(listIndex);
|
||||||
|
|
||||||
var2 = get_variable(script, *args);
|
if (var2) {
|
||||||
model = get_model_from_list_index(listIndex);
|
|
||||||
|
|
||||||
if (var2 != 0) {
|
|
||||||
model->flags |= a1;
|
model->flags |= a1;
|
||||||
} else {
|
} else {
|
||||||
model->flags &= ~a1;
|
model->flags &= ~a1;
|
||||||
@ -315,6 +399,29 @@ ApiStatus SetRenderMode(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_DONE2;
|
return ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_ED510", PlaySoundAtModel, ScriptInstance* script, s32 isInitialCall);
|
ApiStatus PlaySoundAtModel(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
s32 modelID = get_variable(script, *args++);
|
||||||
|
SoundId soundID = get_variable(script, *args++);
|
||||||
|
s32 var3 = get_variable(script, *args++);
|
||||||
|
f32 x, y, z;
|
||||||
|
f32 n1, n2, n3;
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_ED510", PlaySoundAtCollider, ScriptInstance* script, s32 isInitialCall);
|
get_model_center_and_size((u16)modelID, &x, &y, &z, &n1, &n2, &n3);
|
||||||
|
play_sound_at_position(soundID, var3, x, y, z);
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiStatus PlaySoundAtCollider(ScriptInstance* script, s32 isInitialCall) {
|
||||||
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
s32 colliderID = get_variable(script, *args++);
|
||||||
|
SoundId soundID = get_variable(script, *args++);
|
||||||
|
s32 var3 = get_variable(script, *args++);
|
||||||
|
f32 x, y, z;
|
||||||
|
|
||||||
|
get_collider_center(colliderID, &x, &y, &z);
|
||||||
|
play_sound_at_position(soundID, var3, x, y, z);
|
||||||
|
|
||||||
|
return ApiStatus_DONE2;
|
||||||
|
}
|
||||||
|
@ -10,7 +10,7 @@ Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_f2470_len_27f0", set_npc_animation);
|
INCLUDE_ASM(void, "code_f2470_len_27f0", set_npc_animation, Npc* npc, u32 arg1);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "code_f2470_len_27f0", CreateNpc);
|
INCLUDE_ASM(s32, "code_f2470_len_27f0", CreateNpc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user