More decomp + coverage fix

This commit is contained in:
Ethan Roseman 2020-09-25 21:51:54 -04:00
parent bbca99bd94
commit 210e65c3bf
159 changed files with 542 additions and 718 deletions

View File

@ -11,4 +11,5 @@
"-Isrc",
"-D_LANGUAGE_C",
],
"python.pythonPath": "/usr/bin/python3",
}

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetOwnerEncounterTrigger
/* 1FA00 80044600 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1FA04 80044604 AFBF0010 */ sw $ra, 0x10($sp)
/* 1FA08 80044608 8C82000C */ lw $v0, 0xc($a0)
/* 1FA0C 8004460C 8C830148 */ lw $v1, 0x148($a0)
/* 1FA10 80044610 8C450000 */ lw $a1, ($v0)
/* 1FA14 80044614 0C0B2026 */ jal set_variable
/* 1FA18 80044618 80660005 */ lb $a2, 5($v1)
/* 1FA1C 8004461C 8FBF0010 */ lw $ra, 0x10($sp)
/* 1FA20 80044620 24020002 */ addiu $v0, $zero, 2
/* 1FA24 80044624 03E00008 */ jr $ra
/* 1FA28 80044628 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel SetMessageValue
/* F56F4 802D0D44 27BDFFE0 */ addiu $sp, $sp, -0x20
/* F56F8 802D0D48 AFB10014 */ sw $s1, 0x14($sp)
/* F56FC 802D0D4C 0080882D */ daddu $s1, $a0, $zero
/* F5700 802D0D50 AFBF0018 */ sw $ra, 0x18($sp)
/* F5704 802D0D54 AFB00010 */ sw $s0, 0x10($sp)
/* F5708 802D0D58 8E30000C */ lw $s0, 0xc($s1)
/* F570C 802D0D5C 8E050000 */ lw $a1, ($s0)
/* F5710 802D0D60 0C0B1EAF */ jal get_variable
/* F5714 802D0D64 26100004 */ addiu $s0, $s0, 4
/* F5718 802D0D68 0220202D */ daddu $a0, $s1, $zero
/* F571C 802D0D6C 8E050000 */ lw $a1, ($s0)
/* F5720 802D0D70 0C0B1EAF */ jal get_variable
/* F5724 802D0D74 0040802D */ daddu $s0, $v0, $zero
/* F5728 802D0D78 0200202D */ daddu $a0, $s0, $zero
/* F572C 802D0D7C 0C0496FA */ jal set_message_value
/* F5730 802D0D80 0040282D */ daddu $a1, $v0, $zero
/* F5734 802D0D84 8FBF0018 */ lw $ra, 0x18($sp)
/* F5738 802D0D88 8FB10014 */ lw $s1, 0x14($sp)
/* F573C 802D0D8C 8FB00010 */ lw $s0, 0x10($sp)
/* F5740 802D0D90 24020002 */ addiu $v0, $zero, 2
/* F5744 802D0D94 03E00008 */ jr $ra
/* F5748 802D0D98 27BD0020 */ addiu $sp, $sp, 0x20
/* F574C 802D0D9C 00000000 */ nop

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel RemoveEffect
/* FC494 802D7AE4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* FC498 802D7AE8 AFBF0010 */ sw $ra, 0x10($sp)
/* FC49C 802D7AEC 8C82000C */ lw $v0, 0xc($a0)
/* FC4A0 802D7AF0 0C0B1EAF */ jal get_variable
/* FC4A4 802D7AF4 8C450000 */ lw $a1, ($v0)
/* FC4A8 802D7AF8 0C016914 */ jal remove_effect
/* FC4AC 802D7AFC 0040202D */ daddu $a0, $v0, $zero
/* FC4B0 802D7B00 8FBF0010 */ lw $ra, 0x10($sp)
/* FC4B4 802D7B04 24020002 */ addiu $v0, $zero, 2
/* FC4B8 802D7B08 03E00008 */ jr $ra
/* FC4BC 802D7B0C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D7B10
/* FC4C0 802D7B10 27BDFFE8 */ addiu $sp, $sp, -0x18
/* FC4C4 802D7B14 AFBF0010 */ sw $ra, 0x10($sp)
/* FC4C8 802D7B18 8C82000C */ lw $v0, 0xc($a0)
/* FC4CC 802D7B1C 0C0B1EAF */ jal get_variable
/* FC4D0 802D7B20 8C450000 */ lw $a1, ($v0)
/* FC4D4 802D7B24 0040202D */ daddu $a0, $v0, $zero
/* FC4D8 802D7B28 8C830000 */ lw $v1, ($a0)
/* FC4DC 802D7B2C 34630010 */ ori $v1, $v1, 0x10
/* FC4E0 802D7B30 AC830000 */ sw $v1, ($a0)
/* FC4E4 802D7B34 8FBF0010 */ lw $ra, 0x10($sp)
/* FC4E8 802D7B38 24020002 */ addiu $v0, $zero, 2
/* FC4EC 802D7B3C 03E00008 */ jr $ra
/* FC4F0 802D7B40 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D7B44
/* FC4F4 802D7B44 27BDFFE8 */ addiu $sp, $sp, -0x18
/* FC4F8 802D7B48 AFBF0010 */ sw $ra, 0x10($sp)
/* FC4FC 802D7B4C 8C82000C */ lw $v0, 0xc($a0)
/* FC500 802D7B50 0C0B1EAF */ jal get_variable
/* FC504 802D7B54 8C450000 */ lw $a1, ($v0)
/* FC508 802D7B58 8C44000C */ lw $a0, 0xc($v0)
/* FC50C 802D7B5C 2403000A */ addiu $v1, $zero, 0xa
/* FC510 802D7B60 AC830014 */ sw $v1, 0x14($a0)
/* FC514 802D7B64 8FBF0010 */ lw $ra, 0x10($sp)
/* FC518 802D7B68 24020002 */ addiu $v0, $zero, 2
/* FC51C 802D7B6C 03E00008 */ jr $ra
/* FC520 802D7B70 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D7B74
/* FC524 802D7B74 27BDFFE8 */ addiu $sp, $sp, -0x18
/* FC528 802D7B78 AFBF0010 */ sw $ra, 0x10($sp)
/* FC52C 802D7B7C 8C82000C */ lw $v0, 0xc($a0)
/* FC530 802D7B80 0C0B1EAF */ jal get_variable
/* FC534 802D7B84 8C450000 */ lw $a1, ($v0)
/* FC538 802D7B88 8C44000C */ lw $a0, 0xc($v0)
/* FC53C 802D7B8C 24030005 */ addiu $v1, $zero, 5
/* FC540 802D7B90 AC830030 */ sw $v1, 0x30($a0)
/* FC544 802D7B94 8FBF0010 */ lw $ra, 0x10($sp)
/* FC548 802D7B98 24020002 */ addiu $v0, $zero, 2
/* FC54C 802D7B9C 03E00008 */ jr $ra
/* FC550 802D7BA0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,68 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8006AA34
/* 45E34 8006AA34 03404021 */ addu $t0, $k0, $zero
/* 45E38 8006AA38 3C1A8009 */ lui $k0, 0x8009
/* 45E3C 8006AA3C 8F5A4660 */ lw $k0, 0x4660($k0)
/* 45E40 8006AA40 DD090020 */ ld $t1, 0x20($t0)
/* 45E44 8006AA44 FF490020 */ sd $t1, 0x20($k0)
/* 45E48 8006AA48 DD090118 */ ld $t1, 0x118($t0)
/* 45E4C 8006AA4C FF490118 */ sd $t1, 0x118($k0)
/* 45E50 8006AA50 DD090058 */ ld $t1, 0x58($t0)
/* 45E54 8006AA54 FF490058 */ sd $t1, 0x58($k0)
/* 45E58 8006AA58 DD090060 */ ld $t1, 0x60($t0)
/* 45E5C 8006AA5C FF490060 */ sd $t1, 0x60($k0)
/* 45E60 8006AA60 DD090068 */ ld $t1, 0x68($t0)
/* 45E64 8006AA64 FF490068 */ sd $t1, 0x68($k0)
/* 45E68 8006AA68 FF420028 */ sd $v0, 0x28($k0)
/* 45E6C 8006AA6C FF430030 */ sd $v1, 0x30($k0)
/* 45E70 8006AA70 FF440038 */ sd $a0, 0x38($k0)
/* 45E74 8006AA74 FF450040 */ sd $a1, 0x40($k0)
/* 45E78 8006AA78 FF460048 */ sd $a2, 0x48($k0)
/* 45E7C 8006AA7C FF470050 */ sd $a3, 0x50($k0)
/* 45E80 8006AA80 FF4B0070 */ sd $t3, 0x70($k0)
/* 45E84 8006AA84 FF4C0078 */ sd $t4, 0x78($k0)
/* 45E88 8006AA88 FF4D0080 */ sd $t5, 0x80($k0)
/* 45E8C 8006AA8C FF4E0088 */ sd $t6, 0x88($k0)
/* 45E90 8006AA90 FF4F0090 */ sd $t7, 0x90($k0)
/* 45E94 8006AA94 FF500098 */ sd $s0, 0x98($k0)
/* 45E98 8006AA98 FF5100A0 */ sd $s1, 0xa0($k0)
/* 45E9C 8006AA9C FF5200A8 */ sd $s2, 0xa8($k0)
/* 45EA0 8006AAA0 FF5300B0 */ sd $s3, 0xb0($k0)
/* 45EA4 8006AAA4 FF5400B8 */ sd $s4, 0xb8($k0)
/* 45EA8 8006AAA8 FF5500C0 */ sd $s5, 0xc0($k0)
/* 45EAC 8006AAAC FF5600C8 */ sd $s6, 0xc8($k0)
/* 45EB0 8006AAB0 FF5700D0 */ sd $s7, 0xd0($k0)
/* 45EB4 8006AAB4 FF5800D8 */ sd $t8, 0xd8($k0)
/* 45EB8 8006AAB8 FF5900E0 */ sd $t9, 0xe0($k0)
/* 45EBC 8006AABC FF5C00E8 */ sd $gp, 0xe8($k0)
/* 45EC0 8006AAC0 FF5D00F0 */ sd $sp, 0xf0($k0)
/* 45EC4 8006AAC4 FF5E00F8 */ sd $fp, 0xf8($k0)
/* 45EC8 8006AAC8 FF5F0100 */ sd $ra, 0x100($k0)
/* 45ECC 8006AACC 00004012 */ mflo $t0
/* 45ED0 8006AAD0 FF480108 */ sd $t0, 0x108($k0)
/* 45ED4 8006AAD4 00004010 */ mfhi $t0
/* 45ED8 8006AAD8 FF480110 */ sd $t0, 0x110($k0)
/* 45EDC 8006AADC 8F5B0118 */ lw $k1, 0x118($k0)
/* 45EE0 8006AAE0 3369FF00 */ andi $t1, $k1, 0xff00
/* 45EE4 8006AAE4 11200013 */ beqz $t1, savercp
/* 45EE8 8006AAE8 00000000 */ nop
/* 45EEC 8006AAEC 3C088009 */ lui $t0, 0x8009
/* 45EF0 8006AAF0 25085900 */ addiu $t0, $t0, 0x5900
/* 45EF4 8006AAF4 8D080000 */ lw $t0, ($t0)
/* 45EF8 8006AAF8 2401FFFF */ addiu $at, $zero, -1
/* 45EFC 8006AAFC 01015026 */ xor $t2, $t0, $at
/* 45F00 8006AB00 314AFF00 */ andi $t2, $t2, 0xff00
/* 45F04 8006AB04 012A6025 */ or $t4, $t1, $t2
/* 45F08 8006AB08 3C01FFFF */ lui $at, 0xffff
/* 45F0C 8006AB0C 342100FF */ ori $at, $at, 0xff
/* 45F10 8006AB10 03615824 */ and $t3, $k1, $at
/* 45F14 8006AB14 016C5825 */ or $t3, $t3, $t4
/* 45F18 8006AB18 AF4B0118 */ sw $t3, 0x118($k0)
/* 45F1C 8006AB1C 3108FF00 */ andi $t0, $t0, 0xff00
/* 45F20 8006AB20 01284824 */ and $t1, $t1, $t0
/* 45F24 8006AB24 3C01FFFF */ lui $at, 0xffff
/* 45F28 8006AB28 342100FF */ ori $at, $at, 0xff
/* 45F2C 8006AB2C 0361D824 */ and $k1, $k1, $at
/* 45F30 8006AB30 0369D825 */ or $k1, $k1, $t1

View File

@ -34,7 +34,7 @@ def funcs_in_c(text):
return (match.group(1) for match in c_func_pattern.finditer(text))
asm_func_pattern = re.compile(
r"INCLUDE_(?:API_)?ASM\([^,]+, ([^,)]+)",
r"INCLUDE_ASM\([^,]+, [^,]+, ([^,)]+)",
re.MULTILINE
)
def include_asms_in_c(text):

View File

@ -730,8 +730,8 @@ typedef struct StaticItem {
/* 0x14 */ s32 itemString;
/* 0x18 */ s16 typeFlags;
/* 0x1A */ u8 moveID;
/* 0x1B */ u8 potencyA;
/* 0x1C */ u8 potencyB;
/* 0x1B */ s8 potencyA;
/* 0x1C */ s8 potencyB;
/* 0x1D */ char unk_1D[3];
} StaticItem; // size = 0x20
@ -804,7 +804,9 @@ typedef struct PrintContext {
/* 0x45A */ char unk_45A[45];
/* 0x487 */ u8 unkArraySize;
/* 0x488 */ s16 unkArrayunkLength[4];
/* 0x490 */ char unk_490[108];
/* 0x490 */ char unk_490[0x58];
/* 0x4E8 */ u8 unk_4E8;
/* 0x4E9 */ char unk_4E9[19];
/* 0x4FC */ s32 stateFlags;
/* 0x500 */ char unk_500[9];
/* 0x509 */ u8 lerpElpasedTime;

View File

@ -22,10 +22,4 @@ typedef s32 ApiStatus;
#define API_FUN(NAME) ApiStatus (*NAME)(struct ScriptInstance* script, s32 isInitialCall)
#ifndef SPLAT
#define INCLUDE_API_ASM(FOLDER, NAME) INCLUDE_ASM(ApiStatus, FOLDER, NAME, struct ScriptInstance* script, s32 isInitialCall)
#else
#define INCLUDE_API_ASM(FOLDER, NAME)
#endif
#endif

View File

@ -74,6 +74,7 @@ extern BackgroundHeader gBackgroundImage;
extern s8 D_8014F12F;
extern PrintContext* gCurrentPrintContext;
extern s32 D_802DB264;
extern PrintContext* D_802DB268;
// Triggers

View File

@ -221,6 +221,7 @@ SECTIONS
build/src/code_ef070_len_3400.o(.text);
build/src/code_f2470_len_27f0.o(.text);
build/src/code_f4c60_len_4300.o(.text);
build/src/code_F5750.o(.text);
build/src/code_f8f60_len_1560.o(.text);
build/src/code_fa4c0_len_3bf0.o(.text);
build/src/code_fe0b0_len_5a0.o(.text);

View File

@ -56,7 +56,7 @@ INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F414);
INCLUDE_ASM(s32, "code_1a1f0_len_5390", func_8003F4CC);
INCLUDE_API_ASM("code_1a1f0_len_5390", OnDefeatEnemy);
INCLUDE_ASM(s32, "code_1a1f0_len_5390", OnDefeatEnemy, ScriptInstance* script, s32 isInitialCall);
ApiStatus OnFleeBattleDrops(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;

View File

@ -1,6 +1,6 @@
#include "common.h"
INCLUDE_API_ASM("code_1f580_len_1940", SetEncounterStatusFlags);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetEncounterStatusFlags, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800441F0);
@ -16,24 +16,24 @@ ApiStatus func_80044290(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_1f580_len_1940", MakeNpcs);
INCLUDE_ASM(s32, "code_1f580_len_1940", MakeNpcs, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", RemoveNpc);
INCLUDE_ASM(s32, "code_1f580_len_1940", RemoveNpc, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", RemoveEncounter);
INCLUDE_ASM(s32, "code_1f580_len_1940", RemoveEncounter, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", GetBattleOutcome);
INCLUDE_ASM(s32, "code_1f580_len_1940", GetBattleOutcome, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800445A8);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_800445D4);
ApiStatus GetOwnerEncountered(ScriptInstance* script, s32 isInitialCall) {
ApiStatus GetOwnerEncounterTrigger(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->encountered);
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_1f580_len_1940", DoNpcDefeat);
INCLUDE_ASM(s32, "code_1f580_len_1940", DoNpcDefeat, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", start_battle);
@ -47,7 +47,7 @@ ApiStatus StartBattleWith(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE1;
}
INCLUDE_API_ASM("code_1f580_len_1940", StartBossBattle);
INCLUDE_ASM(s32, "code_1f580_len_1940", StartBossBattle, ScriptInstance* script, s32 isInitialCall);
ApiStatus SetBattleMusic(ScriptInstance* script, s32 isInitialCall) {
Bytecode songID = get_variable(script, *script->ptrReadPos);
@ -59,44 +59,44 @@ ApiStatus SetBattleMusic(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcAI);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcAI, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcIdle);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcIdle, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", RestartNpcAI);
INCLUDE_ASM(s32, "code_1f580_len_1940", RestartNpcAI, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", EnableNpcAI);
INCLUDE_ASM(s32, "code_1f580_len_1940", EnableNpcAI, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", SetNpcAux);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetNpcAux, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcAux);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcAux, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", RestartNpcAux);
INCLUDE_ASM(s32, "code_1f580_len_1940", RestartNpcAux, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", EnableNpcAux);
INCLUDE_ASM(s32, "code_1f580_len_1940", EnableNpcAux, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcInteract);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcInteract, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcHit);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcHit, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", BindNpcDefeat);
INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcDefeat, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", SetSelfVar);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetSelfVar, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", GetSelfVar);
INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfVar, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", SetNpcVar);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetNpcVar, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", GetNpcVar);
INCLUDE_ASM(s32, "code_1f580_len_1940", GetNpcVar, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", SetSelfRotation);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetSelfRotation, ScriptInstance* script, s32 isInitialCall);
ApiStatus SetSelfEnemyFlags(ScriptInstance* script, s32 isInitialCall) {
script->ownerActorID->flags = *script->ptrReadPos;
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_1f580_len_1940", SetSelfEnemyFlagBits);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetSelfEnemyFlagBits, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045580);
@ -105,13 +105,13 @@ ApiStatus GetSelfNpcID(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_1f580_len_1940", ClearDefeatedEnemies);
INCLUDE_ASM(s32, "code_1f580_len_1940", ClearDefeatedEnemies, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_1f580_len_1940", SetEnemyFlagBits);
INCLUDE_ASM(s32, "code_1f580_len_1940", SetEnemyFlagBits, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_8004572C);
INCLUDE_API_ASM("code_1f580_len_1940", GetSelfAnimationFromTable);
INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfAnimationFromTable, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045798);

View File

@ -26,7 +26,7 @@ INCLUDE_ASM(s32, "code_42e0_len_1f60", _heap_free);
INCLUDE_ASM(s32, "code_42e0_len_1f60", _heap_realloc);
INCLUDE_API_ASM("code_42e0_len_1f60", cosine);
INCLUDE_ASM(s32, "code_42e0_len_1f60", cosine);
s32 sign(s32 val) {
s32 sign = -1;
@ -88,7 +88,7 @@ f32 signF(f32 val) {
return sign;
}
INCLUDE_API_ASM("code_42e0_len_1f60", round);
INCLUDE_ASM(s32, "code_42e0_len_1f60", round);
INCLUDE_ASM(f32, "code_42e0_len_1f60", clamp_angle, f32 theta);

View File

@ -717,6 +717,7 @@ void reset_status_menu(void) {
#ifdef NON_MATCHING
// uses a jumptable, which we need .rodata support for.
// Somewhat close. Needs work.
/*
s32 is_ability_active(s32 arg0) {
s32 iVar2;
u32 uVar3;
@ -964,6 +965,7 @@ s32 is_ability_active(s32 arg0) {
return iVar7;
}
}
*/
#else
INCLUDE_ASM(s32, "code_80850_len_3060", is_ability_active, s32 arg0);
#endif

View File

@ -1,14 +1,14 @@
#include "common.h"
INCLUDE_API_ASM("code_8230_len_1ae0", nuSiMgrInit);
INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrInit);
INCLUDE_API_ASM("code_8230_len_1ae0", nuSiSendMesg);
INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiSendMesg);
INCLUDE_API_ASM("code_8230_len_1ae0", nuSiMgrStop);
INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrStop);
INCLUDE_API_ASM("code_8230_len_1ae0", nuSiMgrRestart);
INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrRestart);
INCLUDE_API_ASM("code_8230_len_1ae0", nuSiMgrThread);
INCLUDE_ASM(s32, "code_8230_len_1ae0", nuSiMgrThread);
INCLUDE_ASM(s32, "code_8230_len_1ae0", func_8002D160);

260
src/code_F5750.c Normal file
View File

@ -0,0 +1,260 @@
#include "common.h"
ApiStatus HidePlayerShadow(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 hideShadow = get_variable(script, *args++);
if (hideShadow) {
disable_player_shadow();
} else {
enable_player_shadow();
}
return ApiStatus_DONE2;
}
ApiStatus DisablePlayerPhysics(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 disable = get_variable(script, *args++);
if (disable) {
disable_player_static_collisions();
} else {
enable_player_static_collisions();
}
return ApiStatus_DONE2;
}
ApiStatus DisablePlayerInput(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
s32 enable = get_variable(script, *args++);
if (enable) {
disable_player_input();
func_800EF628();
func_800E97B8();
func_800E984C();
if (playerStatus->actionState == ActionState_SPIN) {
playerStatus->animFlags |= 0x40000;
}
D_8009A650[0] |= 0x40;
} else {
enable_player_input();
func_800EF600();
func_800E01DC();
D_8009A650[0] &= ~0x40;
func_800E983C();
}
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", SetPlayerPos, ScriptInstance* script, s32 isInitialCall);
/*
ApiStatus SetPlayerPos(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
f32 x = get_variable(script, *args++);
f32 y = get_variable(script, *args++);
f32 z = get_variable(script, *args++);
Npc* playerNpc = gPlayerNpc;
playerNpc->pos.x = x;
playerNpc->pos.z = z;
playerNpc->pos.y = y;
playerStatus->position.x = x;
playerStatus->position.y = y;
playerStatus->position.z = z;
return ApiStatus_DONE2;
}
*/
INCLUDE_ASM(s32, "code_F5750", SetPlayerCollisionSize, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerSpeed, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerJumpscale, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerAnimation, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerActionState, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerAnimationSpeed, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", PlayerMoveTo, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", func_802D1270);
INCLUDE_ASM(s32, "code_F5750", func_802D1380);
INCLUDE_ASM(s32, "code_F5750", player_jump);
void PlayerJump(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 0);
}
void PlayerJump1(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 1);
}
void PlayerJump2(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 2);
}
INCLUDE_ASM(s32, "code_F5750", InterpPlayerYaw, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", PlayerFaceNpc, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", GetPlayerTargetYaw, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", SetPlayerFlagBits, ScriptInstance* script, s32 isInitialCall);
ApiStatus GetPlayerActionState(ScriptInstance* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos;
set_variable(script, outVar, gPlayerActionState);
return ApiStatus_DONE2;
}
ApiStatus GetPlayerPos(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
Bytecode outVar1 = *args++;
Bytecode outVar2 = *args++;
Bytecode outVar3 = *args++;
set_variable(script, outVar1, playerStatus->position.x);
set_variable(script, outVar2, playerStatus->position.y);
set_variable(script, outVar3, playerStatus->position.z);
return ApiStatus_DONE2;
}
ApiStatus GetPlayerAnimation(ScriptInstance* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos;
set_variable(script, outVar, gPlayerAnimation);
return ApiStatus_DONE2;
}
ApiStatus FullyRestoreHPandFP(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
playerData->curHP = playerData->curMaxHP;
playerData->curFP = playerData->curMaxFP;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_F5750", FullyRestoreSP);
INCLUDE_ASM(s32, "code_F5750", EnablePartner);
INCLUDE_ASM(s32, "code_F5750", DisablePartner);
INCLUDE_ASM(s32, "code_F5750", UseEntryHeading);
INCLUDE_ASM(s32, "code_F5750", func_802D2148);
INCLUDE_ASM(s32, "code_F5750", UseExitHeading);
INCLUDE_ASM(s32, "code_F5750", func_802D23F8);
INCLUDE_ASM(s32, "code_F5750", func_802D244C);
INCLUDE_ASM(s32, "code_F5750", func_802D2484);
INCLUDE_ASM(s32, "code_F5750", func_802D249C);
INCLUDE_ASM(s32, "code_F5750", func_802D24F4);
INCLUDE_ASM(s32, "code_F5750", func_802D2508);
INCLUDE_ASM(s32, "code_F5750", func_802D2520);
INCLUDE_ASM(s32, "code_F5750", func_802D286C);
INCLUDE_ASM(s32, "code_F5750", func_802D2884);
INCLUDE_ASM(s32, "code_F5750", DisablePulseStone);
INCLUDE_ASM(s32, "code_F5750", GetCurrentPartner, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", func_802D2B50);
INCLUDE_ASM(s32, "code_F5750", func_802D2B6C);
INCLUDE_ASM(s32, "code_F5750", Disable8bitMario, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", func_802D2C14);
INCLUDE_ASM(s32, "code_F5750", func_802D2C40);
INCLUDE_ASM(s32, "code_F5750", PlaySoundAtPlayer, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_F5750", func_802D2D30);
INCLUDE_ASM(s32, "code_F5750", func_802D2ED4);
INCLUDE_ASM(s32, "code_F5750", func_802D2F34);
INCLUDE_ASM(s32, "code_F5750", func_802D2FCC);
INCLUDE_ASM(s32, "code_F5750", func_802D3028);
INCLUDE_ASM(s32, "code_F5750", func_802D31E0);
INCLUDE_ASM(s32, "code_F5750", func_802D3398);
INCLUDE_ASM(s32, "code_F5750", func_802D33D4);
INCLUDE_ASM(s32, "code_F5750", func_802D3474);
INCLUDE_ASM(s32, "code_F5750", func_802D354C);
INCLUDE_ASM(s32, "code_F5750", func_802D3624);
INCLUDE_ASM(s32, "code_F5750", func_802D3674);
INCLUDE_ASM(s32, "code_F5750", func_802D36E0);
INCLUDE_ASM(s32, "code_F5750", func_802D378C);
INCLUDE_ASM(s32, "code_F5750", func_802D3840);
INCLUDE_ASM(s32, "code_F5750", func_802D38EC);
INCLUDE_ASM(s32, "code_F5750", func_802D3998);
INCLUDE_ASM(s32, "code_F5750", func_802D39FC);
INCLUDE_ASM(s32, "code_F5750", func_802D3A60);
INCLUDE_ASM(s32, "code_F5750", func_802D3C58);
INCLUDE_ASM(s32, "code_F5750", func_802D3EB8);
INCLUDE_ASM(s32, "code_F5750", func_802D3F74);
INCLUDE_ASM(s32, "code_F5750", func_802D3FC8);
INCLUDE_ASM(s32, "code_F5750", func_802D4050);
INCLUDE_ASM(s32, "code_F5750", func_802D4164);
INCLUDE_ASM(s32, "code_F5750", func_802D417C);
INCLUDE_ASM(s32, "code_F5750", func_802D420C);
INCLUDE_ASM(s32, "code_F5750", func_802D42AC);
INCLUDE_ASM(s32, "code_F5750", func_802D4364);
INCLUDE_ASM(s32, "code_F5750", func_802D43AC);
INCLUDE_ASM(s32, "code_F5750", func_802D43D0);
INCLUDE_ASM(s32, "code_F5750", func_802D43F4);
INCLUDE_ASM(s32, "code_F5750", func_802D4434);
INCLUDE_ASM(s32, "code_F5750", func_802D4488);
INCLUDE_ASM(s32, "code_F5750", func_802D4560);

View File

@ -104,23 +104,23 @@ INCLUDE_ASM(s32, "code_a5dd0_len_114e0", create_entity);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", create_shadow_from_data);
INCLUDE_API_ASM("code_a5dd0_len_114e0", MakeEntity);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", MakeEntity, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", func_80111E9C);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", func_80111F2C);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignScript);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignScript, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignAreaFlag);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignAreaFlag, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignBlockFlag);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignBlockFlag, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignFlag);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignFlag, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignPanelFlag);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignPanelFlag, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_a5dd0_len_114e0", AssignCrateFlag);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignCrateFlag, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_a5dd0_len_114e0", create_entity_shadow);

View File

@ -702,16 +702,16 @@ ApiStatus si_handle_does_script_exist(ScriptInstance* script) {
INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C6AD0);
INCLUDE_API_ASM("code_e92d0_len_5da0", si_handle_bind_lock);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_bind_lock, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", si_handle_thread);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_thread, ScriptInstance* script, s32 isInitialCall);
ApiStatus si_handle_end_thread(ScriptInstance* script) {
kill_script(script);
return ApiStatus_FINISH;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", si_handle_child_thread);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_child_thread, ScriptInstance* script, s32 isInitialCall);
ApiStatus si_handle_end_child_thread(ScriptInstance* script) {
kill_script(script);
@ -722,7 +722,7 @@ ApiStatus func_802C6E14(ScriptInstance* script) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", si_handle_print_debug_var);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_print_debug_var, ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802C739C(ScriptInstance* script) {
script->ptrSavedPosition = (Bytecode*)*script->ptrReadPos;
@ -749,6 +749,7 @@ INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_execute_next_command);
// TODO: consider renaming to si_get_variable
#ifdef NON_MATCHING
/*
s32 get_variable(ScriptInstance* script, Bytecode var) {
s32 wordIdx;
s32 bitIdx;
@ -802,6 +803,7 @@ s32 get_variable(ScriptInstance* script, Bytecode var) {
return var;
}
}
*/
#else
INCLUDE_ASM(s32, "code_e92d0_len_5da0", get_variable, ScriptInstance* script, Bytecode var);
#endif
@ -901,11 +903,11 @@ INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_goto_next_case, ScriptInstance* scrip
INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_goto_end_loop, ScriptInstance* script);
// Ethan: I think this is the start of a new file
//INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateModel);
//INCLUDE_ASM(s32, "code_e92d0_len_5da0", TranslateModel, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", RotateModel);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", RotateModel, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleModel);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", ScaleModel, ScriptInstance* script, s32 isInitialCall);
ApiStatus GetModelIndex(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
@ -1040,7 +1042,7 @@ ApiStatus SetGroupEnabled(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", SetTexPanOffset);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", SetTexPanOffset, ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802C9428(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
@ -1062,7 +1064,7 @@ ApiStatus func_802C94A0(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", SetModelFlags);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", SetModelFlags, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C95A0);
@ -1084,11 +1086,11 @@ ApiStatus func_802C9748(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateGroup);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", TranslateGroup, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", RotateGroup);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", RotateGroup, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleGroup);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", ScaleGroup, ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802C9B40(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
@ -1099,7 +1101,7 @@ ApiStatus func_802C9B40(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableGroup);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", EnableGroup, ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802C9C70(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
@ -1113,9 +1115,9 @@ ApiStatus func_802C9C70(ScriptInstance* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "code_e92d0_len_5da0", modify_collider_family_flags);
INCLUDE_API_ASM("code_e92d0_len_5da0", ModifyColliderFlags);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", ModifyColliderFlags, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", ResetFromLava);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", ResetFromLava, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C9FD4);
@ -1194,6 +1196,6 @@ ApiStatus SetRenderMode(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", PlaySoundAtModel);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", PlaySoundAtModel, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_e92d0_len_5da0", PlaySoundAtCollider);
INCLUDE_ASM(s32, "code_e92d0_len_5da0", PlaySoundAtCollider, ScriptInstance* script, s32 isInitialCall);

View File

@ -57,7 +57,7 @@ ApiStatus func_802CA90C(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_ef070_len_3400", func_802CA988);
INCLUDE_ASM(s32, "code_ef070_len_3400", func_802CA988, ScriptInstance* script, s32 isInitialCall);
/*
ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
@ -187,9 +187,9 @@ ApiStatus SetCamTarget(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_ef070_len_3400", func_802CB008);
INCLUDE_ASM(s32, "code_ef070_len_3400", func_802CB008, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_ef070_len_3400", ShakeCam);
INCLUDE_ASM(s32, "code_ef070_len_3400", ShakeCam, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_ef070_len_3400", exec_ShakeCam1);
@ -241,9 +241,9 @@ ApiStatus PanToTarget(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_ef070_len_3400", UseSettingsFrom);
INCLUDE_ASM(s32, "code_ef070_len_3400", UseSettingsFrom, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_ef070_len_3400", LoadSettings);
INCLUDE_ASM(s32, "code_ef070_len_3400", LoadSettings, ScriptInstance* script, s32 isInitialCall);
ApiStatus SetCamType(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
@ -452,11 +452,11 @@ ApiStatus WaitForCam(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_ef070_len_3400", SetCamProperties);
INCLUDE_ASM(s32, "code_ef070_len_3400", SetCamProperties, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_ef070_len_3400", AdjustCam);
INCLUDE_ASM(s32, "code_ef070_len_3400", AdjustCam, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_ef070_len_3400", ResetCam);
INCLUDE_ASM(s32, "code_ef070_len_3400", ResetCam, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_ef070_len_3400", func_802CCAC0);

View File

@ -34,11 +34,11 @@ ApiStatus GetNpcPointer(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcPos);
INCLUDE_ASM(s32, "code_f2470_len_27f0", SetNpcPos, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcRotation);
INCLUDE_ASM(s32, "code_f2470_len_27f0", SetNpcRotation, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", func_802CDE68);
INCLUDE_ASM(s32, "code_f2470_len_27f0", func_802CDE68, ScriptInstance* script, s32 isInitialCall);
ApiStatus SetNpcScale(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
@ -143,7 +143,7 @@ ApiStatus SetNpcAnimationSpeed(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f2470_len_27f0", NpcMoveTo);
INCLUDE_ASM(s32, "code_f2470_len_27f0", NpcMoveTo, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_f2470_len_27f0", _npc_jump_to);
@ -155,7 +155,7 @@ void NpcJump1(ScriptInstance* script, s32 isInitialCall) {
_npc_jump_to(script, isInitialCall, 1);
}
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFlyTo);
INCLUDE_ASM(s32, "code_f2470_len_27f0", NpcFlyTo, ScriptInstance* script, s32 isInitialCall);
ApiStatus GetNpcYaw(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
@ -185,15 +185,15 @@ ApiStatus SetNpcYaw(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f2470_len_27f0", InterpNpcYaw);
INCLUDE_ASM(s32, "code_f2470_len_27f0", InterpNpcYaw, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFacePlayer);
INCLUDE_ASM(s32, "code_f2470_len_27f0", NpcFacePlayer, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", NpcFaceNpc);
INCLUDE_ASM(s32, "code_f2470_len_27f0", NpcFaceNpc, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", SetNpcFlagBits);
INCLUDE_ASM(s32, "code_f2470_len_27f0", SetNpcFlagBits, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f2470_len_27f0", GetNpcPos);
INCLUDE_ASM(s32, "code_f2470_len_27f0", GetNpcPos, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_f2470_len_27f0", func_802CF1B4);
@ -243,7 +243,7 @@ ApiStatus ClearPartnerMoveHistory(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f2470_len_27f0", NpcSetHomePosToCurrent);
INCLUDE_ASM(s32, "code_f2470_len_27f0", NpcSetHomePosToCurrent, ScriptInstance* script, s32 isInitialCall);
ApiStatus GetPartnerPos(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;

View File

@ -1,5 +1,7 @@
#include "common.h"
ApiStatus _show_message(ScriptInstance* script, s32 isInitialCall, s32 arg2);
ApiStatus SpeakToPlayer(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 0);
}
@ -16,17 +18,30 @@ ApiStatus SpeakToNpc(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 3);
}
INCLUDE_ASM(s32, "code_f4c60_len_4300", _show_message);
INCLUDE_ASM(ApiStatus, "code_f4c60_len_4300", _show_message, ScriptInstance* script, s32 isInitialCall, s32 arg2);
INCLUDE_API_ASM("code_f4c60_len_4300", ShowMessageAtScreenPos);
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtScreenPos, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f4c60_len_4300", ShowMessageAtWorldPos);
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowMessageAtWorldPos, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f4c60_len_4300", CloseMessage);
INCLUDE_ASM(s32, "code_f4c60_len_4300", CloseMessage, ScriptInstance* script, s32 isInitialCall);
/*s32 CloseMessage(ScriptInstance* script, s32 isInitialCall) {
if (isInitialCall) {
close_message(gCurrentPrintContext);
}
INCLUDE_API_ASM("code_f4c60_len_4300", SwitchMessage);
if (!(gCurrentPrintContext->stateFlags & 0x40)) {
if (D_802DB264 == 1) {
script->varTable[0] = gCurrentPrintContext->unk_4E8;
}
return 0;
}
return 1;
}*/
INCLUDE_API_ASM("code_f4c60_len_4300", ShowChoice);
INCLUDE_ASM(s32, "code_f4c60_len_4300", SwitchMessage, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_f4c60_len_4300", ShowChoice, ScriptInstance* script, s32 isInitialCall);
ApiStatus CloseChoice(ScriptInstance* script, s32 isInitialCall) {
close_message(D_802DB268);
@ -59,283 +74,18 @@ ApiStatus func_802D0C94(ScriptInstance* script, s32 initialCall) {
ApiStatus SetMessageString(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Bytecode string = get_variable(script, *args++);
Bytecode index = get_variable(script, *args++);
s32 string = get_variable(script, *args++);
s32 index = get_variable(script, *args++);
set_message_string(string, index);
return ApiStatus_DONE2;
}
#ifdef NON_MATCHING
// TODO: Figure out why there's an extra NOP after this function
// It's probably because of a file split issue
ApiStatus SetMessageValue(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
Bytecode value = get_variable(script, *ptrReadPos++);
Bytecode index = get_variable(script, *ptrReadPos);
s32 value = get_variable(script, *ptrReadPos++);
s32 index = get_variable(script, *ptrReadPos);
set_message_value(value, index);
return ApiStatus_DONE2;
}
#else
INCLUDE_API_ASM("code_f4c60_len_4300", SetMessageValue);
#endif
ApiStatus HidePlayerShadow(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 hideShadow = get_variable(script, *args++);
if (hideShadow) {
disable_player_shadow();
} else {
enable_player_shadow();
}
return ApiStatus_DONE2;
}
ApiStatus DisablePlayerPhysics(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 disable = get_variable(script, *args++);
if (disable) {
disable_player_static_collisions();
} else {
enable_player_static_collisions();
}
return ApiStatus_DONE2;
}
ApiStatus DisablePlayerInput(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
s32 enable = get_variable(script, *args++);
if (enable) {
disable_player_input();
func_800EF628();
func_800E97B8();
func_800E984C();
if (playerStatus->actionState == ActionState_SPIN) {
playerStatus->animFlags |= 0x40000;
}
D_8009A650[0] |= 0x40;
} else {
enable_player_input();
func_800EF600();
func_800E01DC();
D_8009A650[0] &= ~0x40;
func_800E983C();
}
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerPos);
/*
ApiStatus SetPlayerPos(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
f32 x = get_variable(script, *args++);
f32 y = get_variable(script, *args++);
f32 z = get_variable(script, *args++);
Npc* playerNpc = gPlayerNpc;
playerNpc->pos.x = x;
playerNpc->pos.z = z;
playerNpc->pos.y = y;
playerStatus->position.x = x;
playerStatus->position.y = y;
playerStatus->position.z = z;
return ApiStatus_DONE2;
}
*/
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerCollisionSize);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerSpeed);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerJumpscale);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerAnimation);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerActionState);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerAnimationSpeed);
INCLUDE_API_ASM("code_f4c60_len_4300", PlayerMoveTo);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D1270);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D1380);
INCLUDE_ASM(s32, "code_f4c60_len_4300", player_jump);
void PlayerJump(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 0);
}
void PlayerJump1(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 1);
}
void PlayerJump2(ScriptInstance* script, s32 isInitialCall) {
player_jump(script, isInitialCall, 2);
}
INCLUDE_API_ASM("code_f4c60_len_4300", InterpPlayerYaw);
INCLUDE_API_ASM("code_f4c60_len_4300", PlayerFaceNpc);
INCLUDE_API_ASM("code_f4c60_len_4300", GetPlayerTargetYaw);
INCLUDE_API_ASM("code_f4c60_len_4300", SetPlayerFlagBits);
ApiStatus GetPlayerActionState(ScriptInstance* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos;
set_variable(script, outVar, gPlayerActionState);
return ApiStatus_DONE2;
}
ApiStatus GetPlayerPos(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
Bytecode outVar1 = *args++;
Bytecode outVar2 = *args++;
Bytecode outVar3 = *args++;
set_variable(script, outVar1, playerStatus->position.x);
set_variable(script, outVar2, playerStatus->position.y);
set_variable(script, outVar3, playerStatus->position.z);
return ApiStatus_DONE2;
}
ApiStatus GetPlayerAnimation(ScriptInstance* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos;
set_variable(script, outVar, gPlayerAnimation);
return ApiStatus_DONE2;
}
ApiStatus FullyRestoreHPandFP(ScriptInstance* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
playerData->curHP = playerData->curMaxHP;
playerData->curFP = playerData->curMaxFP;
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "code_f4c60_len_4300", FullyRestoreSP);
INCLUDE_ASM(s32, "code_f4c60_len_4300", EnablePartner);
INCLUDE_ASM(s32, "code_f4c60_len_4300", DisablePartner);
INCLUDE_ASM(s32, "code_f4c60_len_4300", UseEntryHeading);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2148);
INCLUDE_ASM(s32, "code_f4c60_len_4300", UseExitHeading);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D23F8);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D244C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2484);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D249C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D24F4);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2508);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2520);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D286C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2884);
INCLUDE_ASM(s32, "code_f4c60_len_4300", DisablePulseStone);
INCLUDE_API_ASM("code_f4c60_len_4300", GetCurrentPartner);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2B50);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2B6C);
INCLUDE_API_ASM("code_f4c60_len_4300", Disable8bitMario);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2C14);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2C40);
INCLUDE_API_ASM("code_f4c60_len_4300", PlaySoundAtPlayer);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2D30);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2ED4);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2F34);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D2FCC);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3028);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D31E0);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3398);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D33D4);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3474);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D354C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3624);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3674);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D36E0);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D378C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3840);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D38EC);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3998);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D39FC);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3A60);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3C58);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3EB8);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3F74);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D3FC8);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4050);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4164);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D417C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D420C);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D42AC);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4364);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D43AC);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D43D0);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D43F4);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4434);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4488);
INCLUDE_ASM(s32, "code_f4c60_len_4300", func_802D4560);

View File

@ -188,7 +188,7 @@ ApiStatus AddVectorPolar(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_f8f60_len_1560", func_802D4BDC);
INCLUDE_ASM(s32, "code_f8f60_len_1560", func_802D4BDC, ScriptInstance* script, s32 isInitialCall);
/*
ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) {
s32* t0 = &script->functionTemp[0];
@ -220,7 +220,7 @@ ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) {
*/
// Very similar to func_802D4BDC
INCLUDE_API_ASM("code_f8f60_len_1560", func_802D4C4C);
INCLUDE_ASM(s32, "code_f8f60_len_1560", func_802D4C4C, ScriptInstance* script, s32 isInitialCall);
ApiStatus func_802D4CC4(ScriptInstance* script, s32 initialCall) {
s32 value = get_variable(script, *script->ptrReadPos);
@ -252,9 +252,9 @@ INCLUDE_ASM(s32, "code_f8f60_len_1560", setup_path_data);
INCLUDE_ASM(s32, "code_f8f60_len_1560", func_802D5270);
INCLUDE_API_ASM("code_f8f60_len_1560", LoadPath);
INCLUDE_ASM(s32, "code_f8f60_len_1560", LoadPath, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_f8f60_len_1560", GetNextPathPos);
INCLUDE_ASM(s32, "code_f8f60_len_1560", GetNextPathPos, ScriptInstance* script, s32 isInitialCall);
ApiStatus GetDist2D(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;

View File

@ -22,7 +22,7 @@ ApiStatus SetMusicTrack(ScriptInstance* script, s32 isInitialCall) {
return (set_music_track(musicPlayer, songID, variation, 0x1F4, volume) != 0) * 2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", FadeInMusic);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", FadeInMusic, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D5EE0);
@ -106,7 +106,7 @@ ApiStatus func_802D6340(ScriptInstance* script, s32 initialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", PlaySoundAtF);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", PlaySoundAtF, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D6420);
@ -283,11 +283,11 @@ ApiStatus RemoveFortressKeys(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", MakeItemEntity);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", MakeItemEntity, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_fa4c0_len_3bf0", DropItemEntity);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", DropItemEntity, ScriptInstance* script, s32 isInitialCall);
INCLUDE_API_ASM("code_fa4c0_len_3bf0", DropItemEntityB);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", DropItemEntityB, ScriptInstance* script, s32 isInitialCall);
/*
// Close to working
ApiStatus DropItemEntityB(ScriptInstance* script, s32 isInitialCall) {
@ -322,7 +322,7 @@ ApiStatus AddBadge(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", RemoveBadge);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", RemoveBadge, ScriptInstance* script, s32 isInitialCall);
ApiStatus SetItemPos(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
@ -342,7 +342,7 @@ ApiStatus SetItemPos(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_fa4c0_len_3bf0", SetItemFlags);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", SetItemFlags, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D721C);
@ -362,23 +362,22 @@ ApiStatus AddStarPieces(ScriptInstance* script, s32 isInitialCall) {
}
#ifdef NON_MATCHING
// Close to working
/*
ApiStatus GetItemPower(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = ptrReadPos++;
item_table_entry* item = &gItemTable[itemID];
StaticItem* item = &gItemTable[get_variable(script, *ptrReadPos++)];
Bytecode out1 = *ptrReadPos++;
Bytecode out2 = *ptrReadPos++;
set_variable(script, ptrNextPos++, item->potencyA);
set_variable(script, ptrNextPos++, item->potencyB);
set_variable(script, out1, item->potencyA);
set_variable(script, out2, item->potencyB);
return ApiStatus_DONE2;
}
}*/
#else
INCLUDE_API_ASM("code_fa4c0_len_3bf0", GetItemPower);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", GetItemPower, ScriptInstance* script, s32 isInitialCall);
#endif
INCLUDE_API_ASM("code_fa4c0_len_3bf0", ShowGotItem);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ShowGotItem, ScriptInstance* script, s32 isInitialCall);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7460);
@ -390,10 +389,8 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D75D8);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7690);
INCLUDE_API_ASM("code_fa4c0_len_3bf0", ShowEmote);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ShowEmote, ScriptInstance* script, s32 isInitialCall);
#ifdef NON_MATCHING
// Works
ApiStatus RemoveEffect(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
@ -401,7 +398,6 @@ ApiStatus RemoveEffect(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
// Works
ApiStatus func_802D7B10(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
@ -410,7 +406,6 @@ ApiStatus func_802D7B10(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
// Works
ApiStatus func_802D7B44(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
@ -420,27 +415,15 @@ ApiStatus func_802D7B44(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
// Works
ApiStatus func_802D7B74(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
s32* ptrTemp = ptrValue[3];
ptrTemp[11] = 5;
ptrTemp[12] = 5;
return ApiStatus_DONE2;
}
// TODO: More functions still in RemoveEffect.s but the ones above are matching properly
#else
INCLUDE_API_ASM("code_fa4c0_len_3bf0", RemoveEffect);
#endif
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7B10);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7B44);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7B74);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7BA4);
INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7CF8);

View File

@ -1,6 +1,6 @@
#include "common.h"
INCLUDE_API_ASM("code_fe0b0_len_5a0", SetSpriteShading);
INCLUDE_ASM(s32, "code_fe0b0_len_5a0", SetSpriteShading);
ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
if (get_variable(script, *script->ptrReadPos) != 0) {

Some files were not shown because too many files have changed in this diff Show More