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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 84 additions and 40 deletions

View File

@ -2690,11 +2690,7 @@ void func_801588D0(GlobalContext* globalCtx, s16 param_2);
// void func_8015E750(void);
void func_8015E7EC(GlobalContext* globalCtx, UNK_PTR puParm2);
// void func_8015F8A8(UNK_TYPE4 ctxt);
// void func_80160A90(void);
// void func_80160AF8(void);
// void func_80160B40(void);
// void func_80160B80(void);
// void func_80160BC0(void);
void ShrinkWindow_SetLetterboxTarget(s32 target);
s32 ShrinkWindow_GetLetterboxTarget(void);
void ShrinkWindow_SetLetterboxMagnitude(s32 magnitude);

View File

@ -34,6 +34,7 @@ extern EffectSsInit Effect_Ss_Ice_Smoke_InitVars;
extern EffectSsInit Effect_En_Ice_Block_InitVars;
extern EffectSsInit Effect_Ss_Sbn_InitVars;
extern ActorInit Player_InitVars;
extern ActorInit Arms_Hook_InitVars;
extern ActorInit Arrow_Fire_InitVars;
extern ActorInit Arrow_Ice_InitVars;

View File

@ -1535,7 +1535,6 @@ extern char D_801D0714[];
// extern UNK_TYPE1 D_801D08E4;
// extern UNK_TYPE1 D_801D08E8;
// extern UNK_TYPE1 D_801D0900;
extern ActorInit Player_InitVars;
extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[2];
// extern UNK_TYPE1 D_801D0B8C;
extern KaleidoMgrOverlay* gKaleidoMgrCurOvl;
@ -3294,10 +3293,6 @@ extern LightsBuffer sLightsBuffer;
// extern UNK_TYPE1 D_801F6B1E;
// extern UNK_TYPE1 D_801F6B20;
// extern UNK_TYPE1 D_801F6B22;
// extern UNK_TYPE1 D_801F6B30;
// extern UNK_TYPE1 D_801F6B34;
// extern UNK_TYPE1 D_801F6B38;
// extern UNK_TYPE1 D_801F6B3C;
extern ShrinkWindowContext gShrinkWindowContext;
extern ShrinkWindowContext* gShrinkWindowContextPtr;
// extern UNK_TYPE4 D_801F6B50;

2
spec
View File

@ -553,11 +553,9 @@ beginseg
include "build/data/code/z_message_nes.data.o"
include "build/src/code/z_message_staff.o"
include "build/src/code/z_player_call.o"
include "build/data/code/z_player_call.bss.o"
include "build/src/code/z_shrink_window.o"
include "build/src/code/db_camera.o"
include "build/data/code/db_camera.bss.o"
include "build/data/code/code_801D0B50.data.o"
include "build/src/code/z_kaleido_manager.o"
include "build/src/code/z_kaleido_scope_call.o"
include "build/src/code/z_fbdemo_dlftbls.o"

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

View File

@ -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")

View File

@ -562,7 +562,7 @@
0x801C5E30 : "z_vr_box",
0x801C5FC0 : "z_sram_NES",
0x801D0470 : "z_message_nes",
0x801D0B50 : "",
0x801D0B50 : "z_player_call",
0x801D0B70 : "z_kaleido_manager",
0x801D0BB0 : "",
0x801D0C80 : "z_fbdemo",

View File

@ -2887,11 +2887,11 @@
0x8015E750:("func_8015E750",),
0x8015E7EC:("func_8015E7EC",),
0x8015F8A8:("func_8015F8A8",),
0x80160A90:("func_80160A90",),
0x80160AF8:("func_80160AF8",),
0x80160B40:("func_80160B40",),
0x80160B80:("func_80160B80",),
0x80160BC0:("func_80160BC0",),
0x80160A90:("PlayerCall_InitFuncPtrs",),
0x80160AF8:("PlayerCall_Init",),
0x80160B40:("PlayerCall_Destroy",),
0x80160B80:("PlayerCall_Update",),
0x80160BC0:("PlayerCall_Draw",),
0x80160C00:("ShrinkWindow_SetLetterboxTarget",),
0x80160C14:("ShrinkWindow_GetLetterboxTarget",),
0x80160C28:("ShrinkWindow_SetLetterboxMagnitude",),
@ -4602,7 +4602,7 @@
0x80841744:("func_80841744",),
0x8084182C:("func_8084182C",),
0x80841A50:("func_80841A50",),
0x80841AC4:("func_80841AC4",),
0x80841AC4:("Player_Init",),
0x80842510:("func_80842510",),
0x808425B4:("func_808425B4",),
0x808426F0:("func_808426F0",),
@ -4615,11 +4615,11 @@
0x80844784:("func_80844784",),
0x80844D80:("func_80844D80",),
0x80844EF8:("func_80844EF8",),
0x808460B8:("func_808460B8",),
0x808460B8:("Player_Update",),
0x808463C0:("func_808463C0",),
0x80846460:("func_80846460",),
0x80846528:("func_80846528",),
0x808470D4:("func_808470D4",),
0x80846528:("Player_Draw",),
0x808470D4:("Player_Destroy",),
0x80847190:("func_80847190",),
0x8084748C:("func_8084748C",),
0x808475B4:("func_808475B4",),

View File

@ -4095,10 +4095,10 @@
0x801F6B1E:("D_801F6B1E","UNK_TYPE1","",0x1),
0x801F6B20:("D_801F6B20","UNK_TYPE1","",0x1),
0x801F6B22:("D_801F6B22","UNK_TYPE1","",0x1),
0x801F6B30:("D_801F6B30","UNK_TYPE1","",0x1),
0x801F6B34:("D_801F6B34","UNK_TYPE1","",0x1),
0x801F6B38:("D_801F6B38","UNK_TYPE1","",0x1),
0x801F6B3C:("D_801F6B3C","UNK_TYPE1","",0x1),
0x801F6B30:("sPlayerCallInitFunc","UNK_TYPE1","",0x1),
0x801F6B34:("sPlayerCallDestroyFunc","UNK_TYPE1","",0x1),
0x801F6B38:("sPlayerCallUpdateFunc","UNK_TYPE1","",0x1),
0x801F6B3C:("sPlayerCallDrawFunc","UNK_TYPE1","",0x1),
0x801F6B40:("gShrinkWindowContext","ShrinkWindowContext","",0x4),
0x801F6B44:("gShrinkWindowContextPtr","ShrinkWindowContext*","",0x4),
0x801F6B50:("D_801F6B50","UNK_TYPE4","",0x4),

View File

@ -2401,11 +2401,11 @@ asm/non_matchings/code/z_message_nes/func_8015B198.s,func_8015B198,0x8015B198,0x
asm/non_matchings/code/z_message_staff/func_8015E750.s,func_8015E750,0x8015E750,0x27
asm/non_matchings/code/z_message_staff/func_8015E7EC.s,func_8015E7EC,0x8015E7EC,0x42F
asm/non_matchings/code/z_message_staff/func_8015F8A8.s,func_8015F8A8,0x8015F8A8,0x47A
asm/non_matchings/code/z_player_call/func_80160A90.s,func_80160A90,0x80160A90,0x1A
asm/non_matchings/code/z_player_call/func_80160AF8.s,func_80160AF8,0x80160AF8,0x12
asm/non_matchings/code/z_player_call/func_80160B40.s,func_80160B40,0x80160B40,0x10
asm/non_matchings/code/z_player_call/func_80160B80.s,func_80160B80,0x80160B80,0x10
asm/non_matchings/code/z_player_call/func_80160BC0.s,func_80160BC0,0x80160BC0,0x10
asm/non_matchings/code/z_player_call/PlayerCall_InitFuncPtrs.s,PlayerCall_InitFuncPtrs,0x80160A90,0x1A
asm/non_matchings/code/z_player_call/PlayerCall_Init.s,PlayerCall_Init,0x80160AF8,0x12
asm/non_matchings/code/z_player_call/PlayerCall_Destroy.s,PlayerCall_Destroy,0x80160B40,0x10
asm/non_matchings/code/z_player_call/PlayerCall_Update.s,PlayerCall_Update,0x80160B80,0x10
asm/non_matchings/code/z_player_call/PlayerCall_Draw.s,PlayerCall_Draw,0x80160BC0,0x10
asm/non_matchings/code/z_shrink_window/ShrinkWindow_SetLetterboxTarget.s,ShrinkWindow_SetLetterboxTarget,0x80160C00,0x5
asm/non_matchings/code/z_shrink_window/ShrinkWindow_GetLetterboxTarget.s,ShrinkWindow_GetLetterboxTarget,0x80160C14,0x5
asm/non_matchings/code/z_shrink_window/ShrinkWindow_SetLetterboxMagnitude.s,ShrinkWindow_SetLetterboxMagnitude,0x80160C28,0x5

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2401 asm/non_matchings/code/z_message_staff/func_8015E750.s func_8015E750 0x8015E750 0x27
2402 asm/non_matchings/code/z_message_staff/func_8015E7EC.s func_8015E7EC 0x8015E7EC 0x42F
2403 asm/non_matchings/code/z_message_staff/func_8015F8A8.s func_8015F8A8 0x8015F8A8 0x47A
2404 asm/non_matchings/code/z_player_call/func_80160A90.s asm/non_matchings/code/z_player_call/PlayerCall_InitFuncPtrs.s func_80160A90 PlayerCall_InitFuncPtrs 0x80160A90 0x1A
2405 asm/non_matchings/code/z_player_call/func_80160AF8.s asm/non_matchings/code/z_player_call/PlayerCall_Init.s func_80160AF8 PlayerCall_Init 0x80160AF8 0x12
2406 asm/non_matchings/code/z_player_call/func_80160B40.s asm/non_matchings/code/z_player_call/PlayerCall_Destroy.s func_80160B40 PlayerCall_Destroy 0x80160B40 0x10
2407 asm/non_matchings/code/z_player_call/func_80160B80.s asm/non_matchings/code/z_player_call/PlayerCall_Update.s func_80160B80 PlayerCall_Update 0x80160B80 0x10
2408 asm/non_matchings/code/z_player_call/func_80160BC0.s asm/non_matchings/code/z_player_call/PlayerCall_Draw.s func_80160BC0 PlayerCall_Draw 0x80160BC0 0x10
2409 asm/non_matchings/code/z_shrink_window/ShrinkWindow_SetLetterboxTarget.s ShrinkWindow_SetLetterboxTarget 0x80160C00 0x5
2410 asm/non_matchings/code/z_shrink_window/ShrinkWindow_GetLetterboxTarget.s ShrinkWindow_GetLetterboxTarget 0x80160C14 0x5
2411 asm/non_matchings/code/z_shrink_window/ShrinkWindow_SetLetterboxMagnitude.s ShrinkWindow_SetLetterboxMagnitude 0x80160C28 0x5