mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
Match DeleteNpc
This commit is contained in:
parent
03b27e3142
commit
19b143fdd3
@ -1,22 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel DeleteNpc
|
||||
/* 0F25CC 802CDC1C 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 0F25D0 802CDC20 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 0F25D4 802CDC24 8C82000C */ lw $v0, 0xc($a0)
|
||||
/* 0F25D8 802CDC28 0C0B1EAF */ jal get_variable
|
||||
/* 0F25DC 802CDC2C 8C450000 */ lw $a1, ($v0)
|
||||
/* 0F25E0 802CDC30 0C00EABB */ jal get_npc_unsafe
|
||||
/* 0F25E4 802CDC34 0040202D */ daddu $a0, $v0, $zero
|
||||
/* 0F25E8 802CDC38 50400004 */ beql $v0, $zero, .L802CDC4C
|
||||
/* 0F25EC 802CDC3C 24020002 */ addiu $v0, $zero, 2
|
||||
/* 0F25F0 802CDC40 0C00E273 */ jal free_npc
|
||||
/* 0F25F4 802CDC44 0040202D */ daddu $a0, $v0, $zero
|
||||
/* 0F25F8 802CDC48 24020002 */ addiu $v0, $zero, 2
|
||||
.L802CDC4C:
|
||||
/* 0F25FC 802CDC4C 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 0F2600 802CDC50 03E00008 */ jr $ra
|
||||
/* 0F2604 802CDC54 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
|
@ -4,6 +4,12 @@
|
||||
#include "ultra64.h"
|
||||
#include "types.h"
|
||||
|
||||
typedef struct vec3f {
|
||||
/* 0x00 */ f32 x;
|
||||
/* 0x04 */ f32 y;
|
||||
/* 0x08 */ f32 z;
|
||||
} vec3f; // size = 0x0C
|
||||
|
||||
typedef struct matrix4f {
|
||||
/* 0x00 */ f32 mtx[4][4];
|
||||
} matrix4f; // size = 0x40
|
||||
@ -671,6 +677,42 @@ typedef struct npc_blur_data {
|
||||
/* 0xA4 */ f32 zpos[20];
|
||||
} npc_blur_data; // size = 0xF4
|
||||
|
||||
typedef struct npc {
|
||||
/* 0x000 */ s32 flags;
|
||||
/* 0x004 */ UNK_PTR onUpdate; /* run before anything else for this npc in the npc update step */
|
||||
/* 0x008 */ UNK_PTR onRender; /* run after the display list for this npc is built */
|
||||
/* 0x00C */ f32 yaw;
|
||||
/* 0x010 */ f32 planarFlyDist; /* also used for speech, temp0? */
|
||||
/* 0x014 */ f32 jumpScale; /* also used for speech, temp1? */
|
||||
/* 0x018 */ f32 moveSpeed;
|
||||
/* 0x01C */ f32 jumpVelocity;
|
||||
/* 0x020 */ struct npc_blur_data* blurData; /* related to movement somehow... */
|
||||
/* 0x024 */ char unk_24[4];
|
||||
/* 0x028 */ u32 currentAnim;
|
||||
/* 0x02C */ char unk_2C[12];
|
||||
/* 0x038 */ struct vec3f pos;
|
||||
/* 0x044 */ struct vec3f rotation;
|
||||
/* 0x050 */ char unk_50[4];
|
||||
/* 0x054 */ struct vec3f scale;
|
||||
/* 0x060 */ struct vec3f moveToPos;
|
||||
/* 0x06C */ struct vec3f colliderPos; /* used during collision with player */
|
||||
/* 0x078 */ s32 shadowIndex;
|
||||
/* 0x07C */ f32 shadowScale;
|
||||
/* 0x080 */ char unk_80[8];
|
||||
/* 0x088 */ s16 isFacingAway;
|
||||
/* 0x08A */ s16 yawCamOffset;
|
||||
/* 0x08C */ char unk_8C[2];
|
||||
/* 0x08E */ s16 duration; /* formerly interp_counter */
|
||||
/* 0x090 */ s16 homePos[3];
|
||||
/* 0x096 */ char unk_96[14];
|
||||
/* 0x0A4 */ u8 npcID;
|
||||
/* 0x0A5 */ char unk_A5;
|
||||
/* 0x0A6 */ s16 collisionRadius;
|
||||
/* 0x0A8 */ s16 collisionHeight;
|
||||
/* 0x0AA */ u8 renderMode;
|
||||
/* 0x0AB */ char unk_AB[661];
|
||||
} npc; // size = 0x340
|
||||
|
||||
typedef struct collider_aabb {
|
||||
/* 0x00 */ f32 min[3];
|
||||
/* 0x0C */ f32 max[3];
|
||||
|
@ -4,7 +4,16 @@ INCLUDE_ASM(code_f2470_len_27f0, func_802CDAC0);
|
||||
|
||||
INCLUDE_ASM(code_f2470_len_27f0, set_npc_animation);
|
||||
|
||||
INCLUDE_ASM(code_f2470_len_27f0, DeleteNpc);
|
||||
s32 DeleteNpc(script_context* script, s32 initialCall) {
|
||||
bytecode* ptrReadPos = script->ptrReadPos;
|
||||
npc* npcPtr = get_npc_unsafe(get_variable(script, *ptrReadPos));
|
||||
|
||||
if (npcPtr) {
|
||||
free_npc(npcPtr);
|
||||
return 2;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_f2470_len_27f0, GetNpcPointer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user