diff --git a/include/variables.h b/include/variables.h index 0f4d82a942..7aa54cc0f4 100644 --- a/include/variables.h +++ b/include/variables.h @@ -291,6 +291,7 @@ extern s32 D_800F7B44; extern f32 D_8010C938; extern f32 D_8010C990; extern s32 D_8010C978; +extern Vec3s D_80283524[]; extern PartnerActionStatus gPartnerActionStatus; // something with partners extern Temp8010F250 D_8010F250; // sfx_play_sound state struct? diff --git a/src/190B20.c b/src/190B20.c index 0ebd04cfaa..6b2aa3776b 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -1005,10 +1005,24 @@ ActorPartDesc bMarioParts[] = { }, }; -s32 D_80283524[] = { - 0x00050000, 0xFFEC002D, 0x0000FFFB, 0x00550000, 0x000A007D, 0x00000019, 0x000A0032, 0xFFEC0032, 0x002DFFFB, - 0x005A0032, 0x000A0082, 0x00370019, 0x000F0055, 0xFFEC0037, 0x0050FFFB, 0x005F0055, 0x000A0087, 0x005A0019, - 0x000F007D, 0xFFEC0037, 0x0078FFFB, 0x005F007D, 0x000A0087, 0x00820019, 0x00690000, 0x00000000 +Vec3s D_80283524[] = { + { 0x0005, 0x0000, 0xFFEC }, + { 0x002D, 0x0000, 0xFFFB }, + { 0x0055, 0x0000, 0x000A }, + { 0x007D, 0x0000, 0x0019 }, + { 0x000A, 0x0032, 0xFFEC }, + { 0x0032, 0x002D, 0xFFFB }, + { 0x005A, 0x0032, 0x000A }, + { 0x0082, 0x0037, 0x0019 }, + { 0x000F, 0x0055, 0xFFEC }, + { 0x0037, 0x0050, 0xFFFB }, + { 0x005F, 0x0055, 0x000A }, + { 0x0087, 0x005A, 0x0019 }, + { 0x000F, 0x007D, 0xFFEC }, + { 0x0037, 0x0078, 0xFFFB }, + { 0x005F, 0x007D, 0x000A }, + { 0x0087, 0x0082, 0x0019 }, + { 0x0069, 0x0000, 0x0000 }, }; s32 D_8028358C[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, diff --git a/src/197F40.c b/src/197F40.c index d7064a221b..7000074a91 100644 --- a/src/197F40.c +++ b/src/197F40.c @@ -162,7 +162,23 @@ ApiStatus SetIdleGoalToHome(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "197F40", SetGoalToIndex); +ApiStatus SetGoalToIndex(Evt* script, s32 isInitialCall) { + s32* args = script->ptrReadPos; + s32 actorID = evt_get_variable(script, *args++); + s32 index = evt_get_variable(script, *args++); + Actor* actor; + + if (actorID == ACTOR_SELF) { + actorID = script->owner1.actorID; + } + + actor = get_actor(actorID); + actor->state.goalPos.x = D_80283524[index].x; + actor->state.goalPos.y = D_80283524[index].y; + actor->state.goalPos.z = D_80283524[index].z; + + return ApiStatus_DONE2; +} ApiStatus GetIndexFromPos(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; @@ -2312,7 +2328,23 @@ ApiStatus RemovePlayerBuffs(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "197F40", SetPartAlpha); +ApiStatus SetPartAlpha(Evt* script, s32 isInitialCall) { + Actor* actor; + s32* args = script->ptrReadPos; + s32 actorID = evt_get_variable(script, *args++); + s32 partIndex = evt_get_variable(script, *args++); + s32 opacity = evt_get_variable(script, *args++); + + if (actorID == ACTOR_SELF) { + actorID = script->owner1.actorID; + } + + actor = get_actor(actorID); + get_actor_part(actor, partIndex)->opacity = opacity; + + actor->renderMode = (opacity == 255) ? RENDER_MODE_ALPHATEST : RENDER_MODE_SURFACE_XLU_LAYER3; + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "197F40", CreatePartShadow); diff --git a/ver/us/asm/nonmatchings/197F40/SetGoalToIndex.s b/ver/us/asm/nonmatchings/197F40/SetGoalToIndex.s deleted file mode 100644 index dc248bf463..0000000000 --- a/ver/us/asm/nonmatchings/197F40/SetGoalToIndex.s +++ /dev/null @@ -1,55 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetGoalToIndex -/* 198874 80269F94 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 198878 80269F98 AFB20018 */ sw $s2, 0x18($sp) -/* 19887C 80269F9C 0080902D */ daddu $s2, $a0, $zero -/* 198880 80269FA0 AFBF001C */ sw $ra, 0x1c($sp) -/* 198884 80269FA4 AFB10014 */ sw $s1, 0x14($sp) -/* 198888 80269FA8 AFB00010 */ sw $s0, 0x10($sp) -/* 19888C 80269FAC 8E50000C */ lw $s0, 0xc($s2) -/* 198890 80269FB0 8E050000 */ lw $a1, ($s0) -/* 198894 80269FB4 0C0B1EAF */ jal evt_get_variable -/* 198898 80269FB8 26100004 */ addiu $s0, $s0, 4 -/* 19889C 80269FBC 0040882D */ daddu $s1, $v0, $zero -/* 1988A0 80269FC0 8E050000 */ lw $a1, ($s0) -/* 1988A4 80269FC4 0C0B1EAF */ jal evt_get_variable -/* 1988A8 80269FC8 0240202D */ daddu $a0, $s2, $zero -/* 1988AC 80269FCC 0040802D */ daddu $s0, $v0, $zero -/* 1988B0 80269FD0 2402FF81 */ addiu $v0, $zero, -0x7f -/* 1988B4 80269FD4 16220002 */ bne $s1, $v0, .L80269FE0 -/* 1988B8 80269FD8 00000000 */ nop -/* 1988BC 80269FDC 8E510148 */ lw $s1, 0x148($s2) -.L80269FE0: -/* 1988C0 80269FE0 0C09A75B */ jal get_actor -/* 1988C4 80269FE4 0220202D */ daddu $a0, $s1, $zero -/* 1988C8 80269FE8 3C048028 */ lui $a0, %hi(D_80283524) -/* 1988CC 80269FEC 24843524 */ addiu $a0, $a0, %lo(D_80283524) -/* 1988D0 80269FF0 00101840 */ sll $v1, $s0, 1 -/* 1988D4 80269FF4 00701821 */ addu $v1, $v1, $s0 -/* 1988D8 80269FF8 00031840 */ sll $v1, $v1, 1 -/* 1988DC 80269FFC 00641821 */ addu $v1, $v1, $a0 -/* 1988E0 8026A000 84640000 */ lh $a0, ($v1) -/* 1988E4 8026A004 0040282D */ daddu $a1, $v0, $zero -/* 1988E8 8026A008 44840000 */ mtc1 $a0, $f0 -/* 1988EC 8026A00C 00000000 */ nop -/* 1988F0 8026A010 46800020 */ cvt.s.w $f0, $f0 -/* 1988F4 8026A014 E4A00018 */ swc1 $f0, 0x18($a1) -/* 1988F8 8026A018 84620002 */ lh $v0, 2($v1) -/* 1988FC 8026A01C 44820000 */ mtc1 $v0, $f0 -/* 198900 8026A020 00000000 */ nop -/* 198904 8026A024 46800020 */ cvt.s.w $f0, $f0 -/* 198908 8026A028 E4A0001C */ swc1 $f0, 0x1c($a1) -/* 19890C 8026A02C 84630004 */ lh $v1, 4($v1) -/* 198910 8026A030 44830000 */ mtc1 $v1, $f0 -/* 198914 8026A034 00000000 */ nop -/* 198918 8026A038 46800020 */ cvt.s.w $f0, $f0 -/* 19891C 8026A03C E4A00020 */ swc1 $f0, 0x20($a1) -/* 198920 8026A040 8FBF001C */ lw $ra, 0x1c($sp) -/* 198924 8026A044 8FB20018 */ lw $s2, 0x18($sp) -/* 198928 8026A048 8FB10014 */ lw $s1, 0x14($sp) -/* 19892C 8026A04C 8FB00010 */ lw $s0, 0x10($sp) -/* 198930 8026A050 24020002 */ addiu $v0, $zero, 2 -/* 198934 8026A054 03E00008 */ jr $ra -/* 198938 8026A058 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/197F40/SetPartAlpha.s b/ver/us/asm/nonmatchings/197F40/SetPartAlpha.s deleted file mode 100644 index 45ecddb8ff..0000000000 --- a/ver/us/asm/nonmatchings/197F40/SetPartAlpha.s +++ /dev/null @@ -1,53 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetPartAlpha -/* 19DD50 8026F470 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 19DD54 8026F474 AFB20018 */ sw $s2, 0x18($sp) -/* 19DD58 8026F478 0080902D */ daddu $s2, $a0, $zero -/* 19DD5C 8026F47C AFBF0024 */ sw $ra, 0x24($sp) -/* 19DD60 8026F480 AFB40020 */ sw $s4, 0x20($sp) -/* 19DD64 8026F484 AFB3001C */ sw $s3, 0x1c($sp) -/* 19DD68 8026F488 AFB10014 */ sw $s1, 0x14($sp) -/* 19DD6C 8026F48C AFB00010 */ sw $s0, 0x10($sp) -/* 19DD70 8026F490 8E50000C */ lw $s0, 0xc($s2) -/* 19DD74 8026F494 8E050000 */ lw $a1, ($s0) -/* 19DD78 8026F498 0C0B1EAF */ jal evt_get_variable -/* 19DD7C 8026F49C 26100004 */ addiu $s0, $s0, 4 -/* 19DD80 8026F4A0 0040882D */ daddu $s1, $v0, $zero -/* 19DD84 8026F4A4 8E050000 */ lw $a1, ($s0) -/* 19DD88 8026F4A8 26100004 */ addiu $s0, $s0, 4 -/* 19DD8C 8026F4AC 0C0B1EAF */ jal evt_get_variable -/* 19DD90 8026F4B0 0240202D */ daddu $a0, $s2, $zero -/* 19DD94 8026F4B4 0240202D */ daddu $a0, $s2, $zero -/* 19DD98 8026F4B8 8E050000 */ lw $a1, ($s0) -/* 19DD9C 8026F4BC 0C0B1EAF */ jal evt_get_variable -/* 19DDA0 8026F4C0 0040A02D */ daddu $s4, $v0, $zero -/* 19DDA4 8026F4C4 0040982D */ daddu $s3, $v0, $zero -/* 19DDA8 8026F4C8 2402FF81 */ addiu $v0, $zero, -0x7f -/* 19DDAC 8026F4CC 16220002 */ bne $s1, $v0, .L8026F4D8 -/* 19DDB0 8026F4D0 00000000 */ nop -/* 19DDB4 8026F4D4 8E510148 */ lw $s1, 0x148($s2) -.L8026F4D8: -/* 19DDB8 8026F4D8 0C09A75B */ jal get_actor -/* 19DDBC 8026F4DC 0220202D */ daddu $a0, $s1, $zero -/* 19DDC0 8026F4E0 0040802D */ daddu $s0, $v0, $zero -/* 19DDC4 8026F4E4 0200202D */ daddu $a0, $s0, $zero -/* 19DDC8 8026F4E8 0C099117 */ jal get_actor_part -/* 19DDCC 8026F4EC 0280282D */ daddu $a1, $s4, $zero -/* 19DDD0 8026F4F0 A4530098 */ sh $s3, 0x98($v0) -/* 19DDD4 8026F4F4 240200FF */ addiu $v0, $zero, 0xff -/* 19DDD8 8026F4F8 16620002 */ bne $s3, $v0, .L8026F504 -/* 19DDDC 8026F4FC 24020022 */ addiu $v0, $zero, 0x22 -/* 19DDE0 8026F500 2402000D */ addiu $v0, $zero, 0xd -.L8026F504: -/* 19DDE4 8026F504 A6020434 */ sh $v0, 0x434($s0) -/* 19DDE8 8026F508 8FBF0024 */ lw $ra, 0x24($sp) -/* 19DDEC 8026F50C 8FB40020 */ lw $s4, 0x20($sp) -/* 19DDF0 8026F510 8FB3001C */ lw $s3, 0x1c($sp) -/* 19DDF4 8026F514 8FB20018 */ lw $s2, 0x18($sp) -/* 19DDF8 8026F518 8FB10014 */ lw $s1, 0x14($sp) -/* 19DDFC 8026F51C 8FB00010 */ lw $s0, 0x10($sp) -/* 19DE00 8026F520 24020002 */ addiu $v0, $zero, 2 -/* 19DE04 8026F524 03E00008 */ jr $ra -/* 19DE08 8026F528 27BD0028 */ addiu $sp, $sp, 0x28