z_player_call OK (#693)

* Match functions

* Rename functions

* Import data and bss, and minor fixes

* Format

* Whoops

* Add some protos to z_player
This commit is contained in:
Anghelo Carvajal
2022-03-05 11:51:51 -03:00
committed by GitHub
parent d9155eb498
commit 6017869b1e
10 changed files with 84 additions and 40 deletions
+54 -5
View File
@@ -1,11 +1,60 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_call/func_80160A90.s")
#define FLAGS \
(ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200000 | ACTOR_FLAG_2000000 | \
ACTOR_FLAG_4000000 | ACTOR_FLAG_80000000)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_call/func_80160AF8.s")
ActorFunc sPlayerCallInitFunc;
ActorFunc sPlayerCallDestroyFunc;
ActorFunc sPlayerCallUpdateFunc;
ActorFunc sPlayerCallDrawFunc;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_call/func_80160B40.s")
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_call/func_80160B80.s")
const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORCAT_PLAYER,
FLAGS,
GAMEPLAY_KEEP,
sizeof(Player),
(ActorFunc)PlayerCall_Init,
(ActorFunc)PlayerCall_Destroy,
(ActorFunc)PlayerCall_Update,
(ActorFunc)PlayerCall_Draw,
};
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_call/func_80160BC0.s")
void Player_Init(Actor* thisx, GlobalContext* globalCtx);
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx);
void Player_Update(Actor* thisx, GlobalContext* globalCtx);
void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_InitFuncPtrs(void) {
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(Player_Init);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(Player_Destroy);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(Player_Update);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
}
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(thisx, globalCtx);
}
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(thisx, globalCtx);
}
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(thisx, globalCtx);
}
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(thisx, globalCtx);
}
@@ -12,6 +12,11 @@ extern UNK_TYPE D_06008860;
extern UNK_TYPE D_0600BDD8;
extern UNK_TYPE D_060178D0;
void Player_Init(Actor* thisx, GlobalContext* globalCtx);
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx);
void Player_Update(Actor* thisx, GlobalContext* globalCtx);
void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_8082DA90.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_8082DABC.s")
@@ -728,7 +733,7 @@ extern UNK_TYPE D_060178D0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80841A50.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80841AC4.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/Player_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80842510.s")
@@ -754,15 +759,15 @@ extern UNK_TYPE D_060178D0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80844EF8.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_808460B8.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/Player_Update.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_808463C0.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80846460.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80846528.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/Player_Draw.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_808470D4.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/Player_Destroy.s")
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_player_actor/func_80847190.s")