item_inbox OK (#95)

* item_inbox OK

* renamed func_80945534 to suggested name
This commit is contained in:
kyleburnette 2021-04-30 20:36:55 -07:00 committed by GitHub
parent 536a484f73
commit 441f33968c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 11 deletions

View File

@ -2294,9 +2294,9 @@ SECTIONS
ovl_Item_Inbox : AT(RomLocation) ovl_Item_Inbox : AT(RomLocation)
{ {
build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o(.text) build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o(.text)
build/asm/overlays/ovl_Item_Inbox_data.o(.data) build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o(.data)
build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o(.rodata) build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.o(.rodata)
build/asm/overlays/ovl_Item_Inbox_rodata.o(.rodata) build/src/overlays/actors/ovl_Item_Inbox/z_item_inbox_overlay.o(.ovl)
} }
SegmentEnd = .; SegmentEnd = .;
SegmentSize = SegmentEnd - SegmentStart; SegmentSize = SegmentEnd - SegmentStart;

View File

@ -9,7 +9,8 @@ void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx); void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx);
/* void ItemInbox_Idle(ItemInbox* this, GlobalContext* globalCtx);
const ActorInit Item_Inbox_InitVars = { const ActorInit Item_Inbox_InitVars = {
ACTOR_ITEM_INBOX, ACTOR_ITEM_INBOX,
ACTORCAT_NPC, ACTORCAT_NPC,
@ -21,14 +22,33 @@ const ActorInit Item_Inbox_InitVars = {
(ActorFunc)ItemInbox_Update, (ActorFunc)ItemInbox_Update,
(ActorFunc)ItemInbox_Draw (ActorFunc)ItemInbox_Draw
}; };
*/
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Init.asm") void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Destroy.asm") this->actionFunc = ItemInbox_Idle;
Actor_SetScale(&this->actor, 0.2f);
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/func_80945534.asm") void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Update.asm") void ItemInbox_Idle(ItemInbox* this, GlobalContext* globalCtx) {
if (Actor_GetChestFlag(globalCtx, (this->actor.params >> 8) & 0x1F)) {
Actor_MarkForDeath(&this->actor);
}
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Draw.asm") void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
this->actionFunc(this, globalCtx);
}
void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
func_800B8050(&this->actor, globalCtx, 0);
func_800B8118(&this->actor, globalCtx, 0);
GetItem_Draw(globalCtx, this->actor.params & 0xFF);
}

View File

@ -5,9 +5,11 @@
struct ItemInbox; struct ItemInbox;
typedef void (*ItemInboxActionFunc)(struct ItemInbox*, GlobalContext*);
typedef struct ItemInbox { typedef struct ItemInbox {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4]; /* 0x144 */ ItemInboxActionFunc actionFunc;
} ItemInbox; // size = 0x148 } ItemInbox; // size = 0x148
extern const ActorInit Item_Inbox_InitVars; extern const ActorInit Item_Inbox_InitVars;

View File

@ -7547,7 +7547,7 @@
0x80945310:("func_80945310",), 0x80945310:("func_80945310",),
0x809454F0:("ItemInbox_Init",), 0x809454F0:("ItemInbox_Init",),
0x80945524:("ItemInbox_Destroy",), 0x80945524:("ItemInbox_Destroy",),
0x80945534:("func_80945534",), 0x80945534:("ItemInbox_Idle",),
0x8094557C:("ItemInbox_Update",), 0x8094557C:("ItemInbox_Update",),
0x809455A0:("ItemInbox_Draw",), 0x809455A0:("ItemInbox_Draw",),
0x80945650:("EnGe1_Init",), 0x80945650:("EnGe1_Init",),