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);
}