Various small world/script functions (#702)

* matched func_8024068C_A2755C, mostly func_80242AD4_DF94D4

* matched func_8024089C_AD492C

* matched func_802405EC_AE5B7C

* matched func_802405D0_AE5B60

* deleted commented out INCLUDE_ASM call

* matched func_802411C4_A6F5A4

* matched func_80242AD4_DF94D4, was a big brain moment

* small changes for cleanup on a function

* matched another small function

* deleted assembly functions that were matched

* changes based on code review

* added arguments for script functions
This commit is contained in:
Kevin Klions 2022-05-05 07:53:05 -04:00 committed by GitHub
parent aee5626e5b
commit 8a170a33ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 34 additions and 76 deletions

View File

@ -1,7 +1,14 @@
#include "end_00.h"
#include "battle/battle.h"
#include "world/common/PlayFX3D.inc.c"
INCLUDE_ASM(s32, "world/area_end/end_00/DF9300", func_80242A30_DF9430);
INCLUDE_ASM(s32, "world/area_end/end_00/DF9300", func_80242AD4_DF94D4);
ApiStatus func_80242AD4_DF94D4(Evt *script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, *args++);
// TODO figure out the correct effect data struct
((s32*) effect->data)[1] = 1;
return ApiStatus_DONE2;
}

View File

@ -10,7 +10,9 @@ ApiStatus N(SetCamXXVfov)(Evt* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "world/area_hos/hos_04/A274B0", func_80240654_A27524);
INCLUDE_ASM(s32, "world/area_hos/hos_04/A274B0", func_8024068C_A2755C);
ApiStatus func_8024068C_A2755C(Evt* script, s32 isInitialCall) {
return ApiStatus_BLOCK;
}
INCLUDE_ASM(s32, "world/area_hos/hos_04/A274B0", func_80240694_A27564);

View File

@ -6,7 +6,12 @@
#include "world/common/GetPeachDisguise.inc.c"
INCLUDE_ASM(s32, "world/area_kkj/kkj_11/ACE9E0", func_80240F44_ACF084);
ApiStatus func_80240F44_ACF084(Evt* script, s32 isInitialCall) {
GameStatus* gameStatus = gGameStatusPtr;
gameStatus->peachFlags |= 8;
return ApiStatus_DONE2;
}
#define NAMESPACE dup_kkj_11
#include "world/common/UnkGooberFunc.inc.c"

View File

@ -8,6 +8,9 @@ INCLUDE_ASM(s32, "world/area_kkj/kkj_12/AD4100", func_80240714_AD47A4);
#include "world/common/UnkGooberFunc.inc.c"
INCLUDE_ASM(s32, "world/area_kkj/kkj_12/AD4100", func_8024089C_AD492C);
ApiStatus func_8024089C_AD492C(Evt* script, s32 isInitialCall) {
D_80151328->sources[1].flags = 0;
return ApiStatus_DONE2;
}
const char* kkj_12_str = "kkj_14";

View File

@ -1,5 +1,15 @@
#include "kkj_15.h"
INCLUDE_ASM(s32, "world/area_kkj/kkj_15/AE5B60", func_802405D0_AE5B60);
ApiStatus func_802405D0_AE5B60(void) {
GameStatus* gameStatus = gGameStatusPtr;
INCLUDE_ASM(s32, "world/area_kkj/kkj_15/AE5B60", func_802405EC_AE5B7C);
gameStatus->peachFlags |= 0x10;
return ApiStatus_DONE2;
}
ApiStatus func_802405EC_AE5B7C(Evt* script, s32 isInitialCall) {
GameStatus* gameStatus = gGameStatusPtr;
gameStatus->peachFlags &= ~0x10;
return ApiStatus_DONE2;
}

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80242AD4_DF94D4
/* DF94D4 80242AD4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* DF94D8 80242AD8 AFBF0010 */ sw $ra, 0x10($sp)
/* DF94DC 80242ADC 8C82000C */ lw $v0, 0xc($a0)
/* DF94E0 80242AE0 0C0B1EAF */ jal evt_get_variable
/* DF94E4 80242AE4 8C450000 */ lw $a1, ($v0)
/* DF94E8 80242AE8 8C44000C */ lw $a0, 0xc($v0)
/* DF94EC 80242AEC 24030001 */ addiu $v1, $zero, 1
/* DF94F0 80242AF0 AC830004 */ sw $v1, 4($a0)
/* DF94F4 80242AF4 8FBF0010 */ lw $ra, 0x10($sp)
/* DF94F8 80242AF8 24020002 */ addiu $v0, $zero, 2
/* DF94FC 80242AFC 03E00008 */ jr $ra
/* DF9500 80242B00 27BD0018 */ addiu $sp, $sp, 0x18
/* DF9504 80242B04 00000000 */ nop
/* DF9508 80242B08 00000000 */ nop
/* DF950C 80242B0C 00000000 */ nop

View File

@ -1,6 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8024068C_A2755C
/* A2755C 8024068C 03E00008 */ jr $ra
/* A27560 80240690 0000102D */ daddu $v0, $zero, $zero

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240F44_ACF084
/* ACF084 80240F44 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* ACF088 80240F48 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* ACF08C 80240F4C 9062007E */ lbu $v0, 0x7e($v1)
/* ACF090 80240F50 34420008 */ ori $v0, $v0, 8
/* ACF094 80240F54 A062007E */ sb $v0, 0x7e($v1)
/* ACF098 80240F58 03E00008 */ jr $ra
/* ACF09C 80240F5C 24020002 */ addiu $v0, $zero, 2

View File

@ -1,9 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8024089C_AD492C
/* AD492C 8024089C 3C028015 */ lui $v0, %hi(D_80151328)
/* AD4930 802408A0 8C421328 */ lw $v0, %lo(D_80151328)($v0)
/* AD4934 802408A4 A040001C */ sb $zero, 0x1c($v0)
/* AD4938 802408A8 03E00008 */ jr $ra
/* AD493C 802408AC 24020002 */ addiu $v0, $zero, 2

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802405D0_AE5B60
/* AE5B60 802405D0 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* AE5B64 802405D4 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* AE5B68 802405D8 9062007E */ lbu $v0, 0x7e($v1)
/* AE5B6C 802405DC 34420010 */ ori $v0, $v0, 0x10
/* AE5B70 802405E0 A062007E */ sb $v0, 0x7e($v1)
/* AE5B74 802405E4 03E00008 */ jr $ra
/* AE5B78 802405E8 24020002 */ addiu $v0, $zero, 2

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802405EC_AE5B7C
/* AE5B7C 802405EC 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* AE5B80 802405F0 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* AE5B84 802405F4 9062007E */ lbu $v0, 0x7e($v1)
/* AE5B88 802405F8 304200EF */ andi $v0, $v0, 0xef
/* AE5B8C 802405FC A062007E */ sb $v0, 0x7e($v1)
/* AE5B90 80240600 03E00008 */ jr $ra
/* AE5B94 80240604 24020002 */ addiu $v0, $zero, 2
/* AE5B98 80240608 00000000 */ nop
/* AE5B9C 8024060C 00000000 */ nop