Merge branch banjo-kazooie:master into documentation

This commit is contained in:
Cyrus Kashef 2024-09-01 00:00:26 +00:00
commit 0964b8e08a
11 changed files with 89 additions and 63 deletions

View File

@ -2307,8 +2307,8 @@ segments:
- [0x10BA9E0, c, code_76C0] #DONE
- [0x10BAEE0, c, code_7BC0] #DONE
- [0x10BAF10, c, code_7BF0] #DONE
- [0x10BB370, c, code_8050] #DONE
- [0x10BB990, c, code_8670] #DONE
- [0x10BB370, c, ch/grublinhood] #DONE
- [0x10BB990, c, ch/vacationtexttrigger] #DONE
- [0x10BBA80, .data, code_0]
- [0x10BBAD0, .data, code_160]
- [0x10BBB00, .data, code_950]
@ -2335,8 +2335,8 @@ segments:
- [0x10BC650, .data, code_76C0]
- [0x10BC7E0, .data, code_7BC0]
- [0x10BC820, .data, code_7BF0]
- [0x10BC860, .data, code_8050]
- [0x10BC930, .data, code_8670]
- [0x10BC860, .data, ch/grublinhood]
- [0x10BC930, .data, ch/vacationtexttrigger]
- [0x10BC960, .rodata, code_160]
- [0x10BC980, .rodata, code_950]
- [0x10BC9E0, .rodata, code_1B20]
@ -2355,7 +2355,7 @@ segments:
- [0x10BCC20, .rodata, code_6AC0]
- [0x10BCC40, .rodata, code_76C0]
- [0x10BCC50, .rodata, code_7BF0]
- [0x10BCC60, .rodata, code_8050]
- [0x10BCC60, .rodata, ch/grublinhood]
- [0x10BCD00, .bss, bss_pad]
- [0x10BCD00, .bss, code_3310]
- name: emptyLvl

View File

@ -235,6 +235,8 @@ enum unkflags_1{
UNKFLAGS1_A_HAS_SEEN_TIPTUP_FF_MINIGAME,
UNKFLAGS1_B_HAS_SEEN_SANDCASTLE_FF_MINIGAME,
UNKFLAGS1_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT = 0x13,
UNKFLAGS1_1F_IN_CHARACTER_PARADE = 0x1F,
UNKFLAGS1_20_BEGIN_CHARACTER_PARADE,
@ -1847,7 +1849,8 @@ enum actor_e
ACTOR_TOPPER_B = 0x36F,
ACTOR_370_GOLD_FEATHER = 0x370,
ACTOR_375_GRUBLIN_HOOD = 0x375,
ACTOR_374_VACATION_TEXT_TRIGGER = 0x374,
ACTOR_375_GRUBLIN_HOOD,
ACTOR_376_FF_MINIGAME,
ACTOR_379_UNKNOWN = 0x379,
@ -4376,6 +4379,8 @@ enum marker_e{
MARKER_1E1_FF_MINIGAME = 0x1E1,
MARKER_1E2_GRUBLIN_HOOD,
MARKER_1E3_VACATION_TEXT_TRIGGER,
MARKER_1E5_GOLD_FEATHER_COLLECTIBLE = 0x1E5,
MARKER_1E6_TOPPER_B,

6
include/math.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef __BANJO_KAZOOIE_MATH_H__
#define __BANJO_KAZOOIE_MATH_H__
#define SQ(x) ((x)*(x))
#endif // __BANJO_KAZOOIE_MATH_H__

View File

@ -1,2 +0,0 @@
./src/FP/code_5CC0.c:#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C428.s")

View File

@ -36,11 +36,11 @@ typedef struct {
f32 unk3C;
} ActorLocal_CCW_8050;
void func_8038E964(Actor *this);
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void chgrublinhood_update(Actor *this);
Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_8038F930[] = {
ActorAnimationInfo chGrublinHood_animations[] = {
{0x000, 0.0f},
{0x243, 4.0f},
{0x243, 0.7f},
@ -54,15 +54,15 @@ ActorAnimationInfo D_8038F930[] = {
{0x243, 1e+06f}
};
ActorInfo D_8038F988 = {
ActorInfo chGrublinHood = {
MARKER_1E2_GRUBLIN_HOOD, ACTOR_375_GRUBLIN_HOOD, ASSET_52C_MODEL_GRUBLIN_HOOD,
0x1, D_8038F930,
func_8038E964, func_80326224, func_8038E56C,
0x1, chGrublinHood_animations,
chgrublinhood_update, func_80326224, chgrublinhood_draw,
2500, 0, 1.0f, 0
};
/* .code */
void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
void __chgrublinhood_emitHat(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
static struct43s D_8038F9AC = {
{{-200.0f, 200.0f, -200.0f}, {200.0f, 400.0f, 200.0f}},
{{ 0.0f, -1800.0f, 0.0f}, { 0.0f, -1800.0f, 0.0f}},
@ -78,7 +78,7 @@ void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){
particleEmitter_emitN(pCtrl, 1);
}
void func_8038E4C0(ActorMarker* marker, s32 arg1) {
void __chgrublinhood_die(ActorMarker* marker, s32 arg1) {
Actor* actor = marker_getActor(marker);
ParticleEmitter *pCtrl;
@ -86,13 +86,13 @@ void func_8038E4C0(ActorMarker* marker, s32 arg1) {
actor_playAnimationOnce(actor);
FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500);
pCtrl = partEmitMgr_newEmitter(1);
func_8038E440(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT);
__chgrublinhood_emitHat(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT);
__spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z));
actor_collisionOff(actor);
actor->unk138_24 = 1;
}
Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chgrublinhood_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_CCW_8050 *local;
@ -113,10 +113,9 @@ Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
return actor_draw(marker, gfx, mtx, vtx);
}
void func_8038E868(Actor *this){
void __chgrublinhood_initialize(Actor *this){
ActorLocal_CCW_8050 *local = (ActorLocal_CCW_8050 *)&this->local;
local->unk8 = 6;
local->unk9 = 0xC;
local->unkA = 0x10;
@ -126,14 +125,14 @@ void func_8038E868(Actor *this){
local->unk12 = 25000;
local->unkC_28 = 1;
local->unk30 = func_802DB548;
local->unk34 = func_8038E4C0;
local->unk34 = __chgrublinhood_die;
local->unk0 = 5.0f;
local->unk4 = 8.0f;
local->unk14 = 1.0f;
local->unk3C = 1.5f;
}
enum ccw_season_e func_8038E8FC(Actor *this){
enum ccw_season_e __get_current_season(Actor *this){
switch(map_get()){
case MAP_43_CCW_SPRING: //// 8038E930
case MAP_4A_CCW_SPRING_MUMBOS_SKULL:// 8038E930
@ -171,15 +170,15 @@ enum ccw_season_e func_8038E8FC(Actor *this){
}
}
void func_8038E964(Actor *this) {
void chgrublinhood_update(Actor *this) {
ActorLocal_CCW_8050 *local;
f32 temp_a0;
local = (ActorLocal_CCW_8050 *)&this->local;
if (!this->unk16C_4) {
func_8038E868(this);
local->season = func_8038E8FC(this);
__chgrublinhood_initialize(this);
local->season = __get_current_season(this);
}
if(local->season < 4){

View File

@ -0,0 +1,43 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "math.h" // for SQ()
void chVacationTextTrigger_update(Actor* this);
/* .data */
ActorInfo gChVacationTextTrigger = {
MARKER_1E3_VACATION_TEXT_TRIGGER, ACTOR_374_VACATION_TEXT_TRIGGER, 0x0,
0x0, NULL,
chVacationTextTrigger_update, func_80326224, func_80325340,
0, 0, 0.0f, 0
};
/* .code */
/**
* @brief Returns if player is within a specified horizontal radius of the
* supplied x,z positions.
*/
static bool __playerIsWithinTrigger(s32 x, s32 z, s32 distance) {
s32 player_position[3];
player_getPosition_s32(player_position);
return (SQ(x - player_position[0]) + SQ(z - player_position[2])) < SQ(distance);
}
void chVacationTextTrigger_update(Actor* this) {
// Despawn if already triggered
if (func_803203FC(UNKFLAGS1_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT)) {
marker_despawn(this->marker);
return;
}
// Start dialog if player is within trigger
if (__playerIsWithinTrigger(0, -107, 188) != 0) {
func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL);
func_803204E4(UNKFLAGS1_13_HAS_TRIGGERED_MUMBO_VACATION_TEXT, 1);
}
}

View File

@ -51,8 +51,8 @@ extern ActorInfo D_8038F720;
extern ActorInfo D_8038F744;
extern ActorInfo D_8038F768;
extern ActorInfo D_8038F78C;
extern ActorInfo D_8038F988;
extern ActorInfo D_8038FA00;
extern ActorInfo chGrublinHood;
extern ActorInfo gChVacationTextTrigger;
extern ActorInfo D_8038F7D4;
extern ActorInfo D_8038F7B0;
extern ActorInfo D_8038F888;
@ -143,8 +143,8 @@ void CCW_func_8038DB6C(void)
spawnableActorList_add(&D_8038F744, actor_new, 0);
spawnableActorList_add(&D_8038F768, actor_new, 0);
spawnableActorList_add(&D_8038F78C, actor_new, 0);
spawnableActorList_add(&D_8038F988, actor_new, 0X2010121);
spawnableActorList_add(&D_8038FA00, actor_new, 0);
spawnableActorList_add(&chGrublinHood, actor_new, 0X2010121);
spawnableActorList_add(&gChVacationTextTrigger, actor_new, 0);
spawnableActorList_add(&D_8038F7D4, actor_new, 0X400);
spawnableActorList_add(&D_8038F7B0, actor_new, 0X400);
spawnableActorList_add(&D_8038F888, actor_new, 0X80);

View File

@ -1,31 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038EAD4(Actor *this);
/* .data */
ActorInfo D_8038FA00 = { 0x1E3, 0x374, 0x0, 0x0, NULL, func_8038EAD4, func_80326224, func_80325340, 0, 0, 0.0f, 0};
/* .code */
bool func_8038EA60(s32 arg0, s32 arg1, s32 arg2) {
s32 sp24;
s32 temp_a0;
s32 sp1C;
s32 temp_v1;
player_getPosition_s32(&sp1C);
temp_v1 = arg1 - sp24;
temp_a0 = arg0 - sp1C;
return ((temp_v1 * temp_v1) + (temp_a0 * temp_a0)) < (arg2 * arg2);
}
void func_8038EAD4(Actor* this) {
if (func_803203FC(0x13)) {
marker_despawn(this->marker);
return;
}
if (func_8038EA60(0, -0x6B, 0xBC) != 0) {
func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL);
func_803204E4(0x13, 1);
}
}

View File

@ -5,8 +5,6 @@
#include "core2/animctrl.h"
#include "animation.h"
extern u32 D_A0000238;
/* .code */
void animctrl_80286F90(AnimCtrl *this){
Animation *anim;

View File

@ -1,3 +1,11 @@
/**
* @file anim/commoncache.c
* @brief This file controls a cache of common animations consisting of
* player move animations. This main difference between this cache and
* the normal anim/cache.c is that these assets default to persist even
* after they become stall, and are cleaned up much later in memory
* defragmentation.
*/
#include <ultra64.h>
#include "functions.h"
#include "variables.h"

@ -1 +1 @@
Subproject commit 934ff321b4d284db197dd5c5b8b446a8e3233520
Subproject commit 48ac16ba5bb0f3e926a7634c4837bf87a58cbbb5