From 955312954f787ffb9026d5fcb3f6a0e140e8914c Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Sat, 29 Jun 2024 14:38:03 -0500 Subject: [PATCH] documentation. Include nonmatched functions in README --- decompressed.us.v10.yaml | 6 +- include/core2/anim/sprite.h | 51 +++++++ include/functions.h | 13 +- include/structs.h | 16 -- src/BGS/ch/code_2270.c | 2 +- src/BGS/ch/code_8A60.c | 4 +- src/BGS/ch/croctus.c | 2 +- src/BGS/ch/frogminigame.c | 2 +- src/BGS/ch/mudhut.c | 2 +- src/BGS/ch/pinkegg.c | 2 +- src/BGS/ch/tanktup.c | 2 +- src/BGS/code_3420.c | 4 +- src/CC/ch/tooth.c | 2 +- src/CC/code_1F70.c | 2 +- src/CCW/code_14B0.c | 4 +- src/CCW/code_1B20.c | 2 +- src/CCW/code_4960.c | 2 +- src/CCW/code_5540.c | 2 +- src/CCW/code_950.c | 4 +- src/FP/ch/bearcub.c | 2 +- src/FP/ch/boggy1.c | 2 +- src/FP/ch/wozzasjig.c | 2 +- src/FP/racectrl.c | 4 +- src/FP/sirslushgame.c | 2 +- src/FP/snowmanbuttongame.c | 2 +- src/GV/ch/ancientone.c | 2 +- src/GV/ch/gobi2.c | 2 +- src/GV/ch/gobirock.c | 2 +- src/GV/matchinggame.c | 2 +- src/MM/ch/hut.c | 2 +- src/MM/ch/juju.c | 2 +- src/MM/ch/lmonkey.c | 2 +- src/MM/ch/orangepad.c | 2 +- src/MMM/code_3420.c | 2 +- src/MMM/code_DC0.c | 2 +- src/RBB/ch/anchorctrl.c | 2 +- src/RBB/ch/bossboombox.c | 2 +- src/RBB/ch/cog.c | 22 +-- src/RBB/ch/whistlectrl.c | 2 +- src/TTC/ch/blubber.c | 2 +- src/TTC/ch/treasure.c | 2 +- src/core1/audio/n_csplayer.c | 12 +- src/core1/code_11AC0.c | 2 +- src/core1/code_5650.c | 6 +- src/core1/code_9D30.c | 10 ++ src/core2/anim/sprite.c | 275 +++++++++++++++++++++++++++++++++++ src/core2/ch/badShad.c | 6 +- src/core2/ch/beehive.c | 4 +- src/core2/ch/crab.c | 2 +- src/core2/ch/jinjo.c | 2 +- src/core2/ch/soundsource.c | 4 +- src/core2/code_47BD0.c | 8 +- src/core2/code_5BEB0.c | 2 +- src/core2/code_5C870.c | 12 +- src/core2/code_72B10.c | 4 +- src/core2/code_7AF80.c | 84 +++++------ src/core2/code_85800.c | 29 ++-- src/core2/code_956B0.c | 52 +++---- src/core2/code_9B990.c | 110 +++++++------- src/core2/code_ABC00.c | 126 ++++++++-------- src/core2/code_AD0.c | 156 -------------------- src/core2/code_AD5B0.c | 40 ++--- src/core2/code_AE290.c | 24 +-- src/core2/code_B5E00.c | 61 ++++---- src/core2/code_B6EA0.c | 18 +-- src/core2/code_B6EA0.h | 7 +- src/core2/code_C8760.c | 4 +- src/core2/code_CB610.c | 8 +- src/core2/code_CBD10.c | 18 ++- src/core2/code_CC1E0.c | 19 +-- src/core2/code_CD0A0.c | 7 +- src/core2/code_CD3F0.c | 7 +- src/core2/code_CD6E0.c | 53 +++---- src/core2/code_CECD0.c | 7 +- src/core2/code_CF090.c | 17 ++- src/core2/gc/section.c | 2 +- src/core2/mapModel.c | 4 +- src/core2/timedfuncqueue.c | 2 +- src/lair/code_0.c | 2 +- 79 files changed, 784 insertions(+), 612 deletions(-) create mode 100644 include/core2/anim/sprite.h create mode 100644 src/core2/anim/sprite.c delete mode 100644 src/core2/code_AD0.c diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index cc6df50a..fa7e0ea9 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -501,7 +501,7 @@ segments: follows_vram: core1 subsegments: - [0xF55960, c, animctrl] #DONE - - [0xF56430, c, code_AD0] #DONE + - [0xF56430, c, anim/sprite] #DONE - [0xF56A40, c, animcache] #DONE - [0xF56EB0, c, code_1550] #DONE - [0xF57290, c, code_1930] #DONE @@ -1116,7 +1116,7 @@ segments: - [0x1041CB0, .data, code_DB010] - [0x1042790, .data, code_DC4B0] - [0x10427C0, ".rodata", animctrl] - - [0x10427F0, .rodata, code_AD0] + - [0x10427F0, .rodata, anim/sprite] - [0x1042800, .rodata, code_1930] - [0x1042880, .rodata, ba/anim] - [0x1042890, .rodata, code_3480] @@ -1366,7 +1366,7 @@ segments: - [0x1048450, .rodata, code_DA3A0] - [0x1048460, .rodata, code_DA760] - [0x1048480, .rodata, code_DB010] - - [0x1048560, .bss, code_AD0] + - [0x1048560, .bss, anim/sprite] - [0x1048560, .bss, animcache] - [0x1048560, .bss, code_1550] - [0x1048560, .bss, code_1930] diff --git a/include/core2/anim/sprite.h b/include/core2/anim/sprite.h new file mode 100644 index 00000000..d6427bb1 --- /dev/null +++ b/include/core2/anim/sprite.h @@ -0,0 +1,51 @@ +#ifndef __CORE2_ANIM_SPRITE_H__ +#define __CORE2_ANIM_SPRITE_H__ + +#include + + +typedef struct{ + u8 index; + u8 duration; +} AnimSpriteStep; + +typedef enum { + ANIM_SPRITE_STATE_NONE, + ANIM_SPRITE_STATE_ONCE, + ANIM_SPRITE_STATE_LOOP, + ANIM_SPRITE_STATE_STOPPED +} AnimSpriteState; + +typedef struct{ + AnimSpriteStep *steps; + f32 remaining_time; + f32 speed_multiplier; + u32 step_count:7; //This is the index in the AnimSpriteStep list + u32 current_step:7; //current frame + u32 start_step:7; + u32 current_frame:7; //This is the actual sprite frame + u32 state:2; + u32 unknown:1; + u32 active:1; //active +} AnimSprite; + +void animsprite_init(void); +AnimSprite * animsprite_new(void); +void animsprite_free(AnimSprite *this); +void animsprite_terminate(void); +void animsprite_update(AnimSprite *this); +void animsprite_default(AnimSprite *this); +void animsprite_loop(AnimSprite *this); +void animsprite_set_steps(AnimSprite *this, AnimSpriteStep *step_list, s32 size); +void animsprite_set_state(AnimSprite *this, AnimSpriteState step); +void animsprite_set_unknown(AnimSprite *this, s32 value); +void animsprite_set_frame(AnimSprite *this, s32 frame_index); +void animsprite_set_speed(AnimSprite *this, f32 speed); +void animsprite_set_start_step(AnimSprite *this, s32 step); +s32 animsprite_get_frame(AnimSprite *this); +AnimSpriteState animsprite_get_current_state(AnimSprite *this); +s32 animsprite_get_unknown(AnimSprite *this); +f32 animsprite_get_speed(AnimSprite *this); +int animsprite_is_stopped(AnimSprite *this); +int animsprite_is_at_step(AnimSprite *this, s32 frame); +#endif diff --git a/include/functions.h b/include/functions.h index 13ab48d5..39a82013 100644 --- a/include/functions.h +++ b/include/functions.h @@ -162,7 +162,7 @@ Actor *func_802C8C04(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); Actor *marker_getActor(ActorMarker *); f32 time_getDelta(void); -void jiggySpawn(enum jiggy_e jiggy_id, f32 pos[3]); +void jiggy_spawn(enum jiggy_e jiggy_id, f32 pos[3]); struct3s *func_802F8264(s32 arg0); struct6s *func_802F8BE0(s32 arg0); @@ -276,13 +276,6 @@ void comusic_8025AB44(enum comusic_e comusic_id, s32 arg1, s32 arg2); f32 cosf(f32); -struct54s * func_80287CA8(void); -void func_80287F50(struct54s *, struct53s *, s32); -void func_80287FD0(struct54s *, f32); -void func_80287F7C(struct54s *arg0, s32 arg1); -void func_80287F98(struct54s *arg0, s32 arg1); -void func_80287FDC(struct54s *arg0, s32 arg1); - void baanim_setDurationRange(f32, f32); @@ -395,7 +388,7 @@ u8 func_8030D90C(void); void sfxsource_setSfxId(u8 indx, enum sfx_e uid); void func_8030DBB4(u8, f32); void func_8030DD14(u8, int); -void func_8030DF68(u8, f32[3]); +void sfxsource_set_position(u8, f32[3]); void func_8030DFF0(u8, s32); void func_8030E04C(u8, f32, f32, f32); void func_8030E0FC(u8, f32, f32, f32); @@ -515,7 +508,7 @@ Actor *actorArray_findActorFromActorId(enum actor_e); f32 func_8038A6B8(ActorMarker *); void *defrag_asset(void *); void ml_interpolate_vec3f(f32 [3], f32 [3], f32 [3], f32); -void func_8030DEB4(u8, f32, f32); +void sfxsource_set_fade_distances(u8, f32, f32); void func_8030DB04(u8, s32, f32 position[3], f32, f32); void func_80258A4C(f32 [3], f32, f32 [3], f32 *, f32 *, f32 *); diff --git a/include/structs.h b/include/structs.h index c3f12473..14c19aab 100644 --- a/include/structs.h +++ b/include/structs.h @@ -504,23 +504,7 @@ typedef struct{ u8 pad4[8]; }struct52s; -typedef struct{ - u8 unk0; - u8 unk1; -} struct53s; -typedef struct{ - struct53s *unk0; - f32 unk4; - f32 unk8; - u32 unkC_31:7; - u32 unkC_24:7; - u32 unkC_17:7; - u32 unkC_10:7; - u32 unkC_3:2; - u32 unkC_1:1; - u32 unkC_0:1; -} struct54s; typedef struct{ s32 unk0; diff --git a/src/BGS/ch/code_2270.c b/src/BGS/ch/code_2270.c index 036df038..d778bbee 100644 --- a/src/BGS/ch/code_2270.c +++ b/src/BGS/ch/code_2270.c @@ -38,7 +38,7 @@ void BGS_func_80388660(ActorMarker *this){ } void BGS_func_8038868C(void){ - jiggySpawn(JIGGY_27_BGS_TIPTUP, D_80390868); + jiggy_spawn(JIGGY_27_BGS_TIPTUP, D_80390868); } void func_803886B4(ActorMarker *this, s32 arg1){ diff --git a/src/BGS/ch/code_8A60.c b/src/BGS/ch/code_8A60.c index 670920e1..8e8218fd 100644 --- a/src/BGS/ch/code_8A60.c +++ b/src/BGS/ch/code_8A60.c @@ -25,7 +25,7 @@ void func_8038EE50(void){ f32 sp24[3]; if(nodeProp_findPositionFromActorId(0x14d, sp24)){ - jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24); + jiggy_spawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), @@ -68,7 +68,7 @@ void func_8038F018(void){ f32 sp24[3]; if(nodeProp_findPositionFromActorId(0x1fc, sp24)){ - jiggySpawn(JIGGY_25_BGS_MAZE, sp24); + jiggy_spawn(JIGGY_25_BGS_MAZE, sp24); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c index ca653add..0bffffd5 100644 --- a/src/BGS/ch/croctus.c +++ b/src/BGS/ch/croctus.c @@ -65,7 +65,7 @@ void *func_80387D90(ActorMarker * arg0){ spawnPos[2] = this->position_z; marker->propPtr->unk8_3 = 0; func_802BAFE4(0x19); - jiggySpawn(JIGGY_22_CROCTUS, spawnPos); + jiggy_spawn(JIGGY_22_CROCTUS, spawnPos); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); } diff --git a/src/BGS/ch/frogminigame.c b/src/BGS/ch/frogminigame.c index f42acb3b..410cc4fe 100644 --- a/src/BGS/ch/frogminigame.c +++ b/src/BGS/ch/frogminigame.c @@ -22,7 +22,7 @@ u8 D_80391240[4]; /* .code */ static void __chFrogMinigame_spawnJiggy(void){ static f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f}; - jiggySpawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4); + jiggy_spawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4); } static void __chFrogMinigame_textCallback(ActorMarker *marker, enum asset_e text_id, s32 arg2){ diff --git a/src/BGS/ch/mudhut.c b/src/BGS/ch/mudhut.c index 995c20db..8b960673 100644 --- a/src/BGS/ch/mudhut.c +++ b/src/BGS/ch/mudhut.c @@ -111,7 +111,7 @@ void chmudhut_update(Actor *this){ reinterpret_cast(s32, diffPos[2]) ); } else { - jiggySpawn(JIGGY_23_BGS_HUTS, diffPos); + jiggy_spawn(JIGGY_23_BGS_HUTS, diffPos); } } break; diff --git a/src/BGS/ch/pinkegg.c b/src/BGS/ch/pinkegg.c index 9e305c61..a455aabb 100644 --- a/src/BGS/ch/pinkegg.c +++ b/src/BGS/ch/pinkegg.c @@ -92,7 +92,7 @@ void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker){ if(D_803906C4[(tmp = (ActorLocal_PinkEgg *) &thisActor->local)->unk0] != 0){ __spawnQueue_add_2(chpinkegg_spawn_next, thisActor->marker, tmp->unk0); } else { - jiggySpawn(JIGGY_21_BGS_PINKEGG, thisActor->position); + jiggy_spawn(JIGGY_21_BGS_PINKEGG, thisActor->position); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); } } diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c index be84802e..005ea00c 100644 --- a/src/BGS/ch/tanktup.c +++ b/src/BGS/ch/tanktup.c @@ -207,7 +207,7 @@ void func_8038F6A4(Actor *this) func_8034A174(this->marker->unk44, 6, sp34); func_802C8F70(this->yaw); sp34[1] -= 125.0f; - jiggySpawn(JIGGY_26_BGS_TANKTUP, sp34); + jiggy_spawn(JIGGY_26_BGS_TANKTUP, sp34); } if (actor_animationIsAt(this, 0.9f) != 0) { diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c index a3ce6840..0b96adf0 100644 --- a/src/BGS/code_3420.c +++ b/src/BGS/code_3420.c @@ -74,7 +74,7 @@ void BGS_func_80389850(Actor *this, s32 arg1) { sp94[1] = vile->position[1] + sp7C[1]; sp94[2] = vile->position[2] + sp7C[2]; func_802C8F70(vile->yaw); - jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94); + jiggy_spawn(JIGGY_28_BGS_MR_VILE, sp94); } else { sp7C[0] = 0.0f - vile->position[0]; sp7C[1] = 0.0f; @@ -85,7 +85,7 @@ void BGS_func_80389850(Actor *this, s32 arg1) { sp94[1] = vile->position[1] + sp7C[1]; sp94[2] = vile->position[2] + sp7C[2]; func_802C8F70(func_8025715C(sp7C[0], sp7C[2])); - jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94); + jiggy_spawn(JIGGY_28_BGS_MR_VILE, sp94); } } for(var_s0 = 2; var_s0 != 0x3C; var_s0++){ diff --git a/src/CC/ch/tooth.c b/src/CC/ch/tooth.c index 3fba9968..91d2148a 100644 --- a/src/CC/ch/tooth.c +++ b/src/CC/ch/tooth.c @@ -84,7 +84,7 @@ extern void chTooth_update(Actor * this){ player_getPosition(sp24); if(sp24[0] < 0.0f && 5400.0f < sp24[2]){ func_80333334(local->unk0->jiggy_id); - jiggySpawn(local->unk0->jiggy_id, local->unk0->jiggy_position); + jiggy_spawn(local->unk0->jiggy_id, local->unk0->jiggy_position); } else{//L8038774C sp24[0] = local->unk0->jiggy_position[0]; diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index d051be8b..54508c3a 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -110,7 +110,7 @@ void func_80388518(s32 arg0){ } void func_80388664(void) { - jiggySpawn(JIGGY_17_CC_CLANKER_RAISED, D_80389C00); + jiggy_spawn(JIGGY_17_CC_CLANKER_RAISED, D_80389C00); } void CC_func_8038868C(void) { diff --git a/src/CCW/code_14B0.c b/src/CCW/code_14B0.c index b4b49855..58c67841 100644 --- a/src/CCW/code_14B0.c +++ b/src/CCW/code_14B0.c @@ -114,8 +114,8 @@ void CCW_func_80387A40(Actor *this) { if(this->position[0]); func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f); - func_8030DEB4(local->unk0, 500.0f, 1500.0f); - func_8030DF68(local->unk0, this->position); + sfxsource_set_fade_distances(local->unk0, 500.0f, 1500.0f); + sfxsource_set_position(local->unk0, this->position); func_8030E2C4(local->unk0); sfxsource_setSampleRate(local->unk0, 2000.0f + 8000.0f*(gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])/ local->unk8)); if (!mapSpecificFlags_get(local->unk4->unk2)) { diff --git a/src/CCW/code_1B20.c b/src/CCW/code_1B20.c index 990dbc5d..0e2eb0dd 100644 --- a/src/CCW/code_1B20.c +++ b/src/CCW/code_1B20.c @@ -33,7 +33,7 @@ f32 D_8038EC94[3] = {200.0f, 2120.0f, -5570.0f}; /* .code */ void func_80387F10() { - jiggySpawn(JIGGY_4D_CCW_FLOWER, D_8038EC94); + jiggy_spawn(JIGGY_4D_CCW_FLOWER, D_8038EC94); } void func_80387F38(ActorMarker* marker, s32 arg1) { diff --git a/src/CCW/code_4960.c b/src/CCW/code_4960.c index 5f8f65a8..be2d5c08 100644 --- a/src/CCW/code_4960.c +++ b/src/CCW/code_4960.c @@ -95,7 +95,7 @@ void func_8038AEBC(Actor *this) { func_80326224(this); skeletalAnim_getProgressRange(this->unk148, &sp30, &sp2C); if ((sp30 <= 0.5) && (sp2C >= 0.5)) { - jiggySpawn(JIGGY_49_CCW_EYRIE, this->position); + jiggy_spawn(JIGGY_49_CCW_EYRIE, this->position); } if (skeletalAnim_getLoopCount(this->unk148) > 0) { func_8038AD50(this, 2); diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c index 9b4106cb..2f6611cc 100644 --- a/src/CCW/code_5540.c +++ b/src/CCW/code_5540.c @@ -56,7 +56,7 @@ void chnabnut_setState(Actor *this, s32 next_state) { skeletalAnim_set(this->unk148, ASSET_22E_ANIM_NABNUT_STAND, 0.2f, 3.53f); skeletalAnim_setBehavior(this->unk148, SKELETAL_ANIM_1_LOOP); func_802C8F70(this->yaw - 40.0f); - jiggySpawn(JIGGY_4A_CCW_NABNUT, this->position); + jiggy_spawn(JIGGY_4A_CCW_NABNUT, this->position); } if (next_state == NABNUT_STATE_5_EXIT) { diff --git a/src/CCW/code_950.c b/src/CCW/code_950.c index d5c98b88..582aaaed 100644 --- a/src/CCW/code_950.c +++ b/src/CCW/code_950.c @@ -208,8 +208,8 @@ void chwasp_update(Actor *this) { } else { func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f); } - func_8030DEB4(local->unk0, 500.0f, 1500.0f); - func_8030DF68(local->unk0, this->position); + sfxsource_set_fade_distances(local->unk0, 500.0f, 1500.0f); + sfxsource_set_position(local->unk0, this->position); func_8030E2C4(local->unk0); sfxsource_setSampleRate(local->unk0, (s32) ((local->unk18 / local->unk14) * 10000.0f)); } diff --git a/src/FP/ch/bearcub.c b/src/FP/ch/bearcub.c index 82298626..2ced0299 100644 --- a/src/FP/ch/bearcub.c +++ b/src/FP/ch/bearcub.c @@ -72,7 +72,7 @@ void func_8038A274(Actor *this){ void func_8038A318(ActorMarker *caller, enum asset_e text_id, s32 arg1){ if(text_id == 0xc19){ func_802BAFE4(0x25); - jiggySpawn(JIGGY_2E_FP_PRESENTS, FP_D_80391E74); + jiggy_spawn(JIGGY_2E_FP_PRESENTS, FP_D_80391E74); func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000); func_8025A6EC(COMUSIC_5B_FP_IGLOO_HAPPY, 25000); func_8025A58C(0, 4000); diff --git a/src/FP/ch/boggy1.c b/src/FP/ch/boggy1.c index ba2bff24..d1c4101a 100644 --- a/src/FP/ch/boggy1.c +++ b/src/FP/ch/boggy1.c @@ -73,7 +73,7 @@ void func_803877A8(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this = marker_getActor(caller); if(arg2 == 1){ - jiggySpawn(JIGGY_2A_FP_BOGGY_1, this->velocity); + jiggy_spawn(JIGGY_2A_FP_BOGGY_1, this->velocity); } else if(arg2 == 2){ subaddie_set_state_with_direction(this, 4, 0.0001f, 1); diff --git a/src/FP/ch/wozzasjig.c b/src/FP/ch/wozzasjig.c index f246ad17..d4d6ab70 100644 --- a/src/FP/ch/wozzasjig.c +++ b/src/FP/ch/wozzasjig.c @@ -75,7 +75,7 @@ void func_8038FF54(Actor *this){ sp40[1] = (f32)(s32)sp40[1]; sp40[2] = (f32)(s32)sp40[2]; func_802C8F70(this->yaw + 90.0f); - jiggySpawn(JIGGY_32_FP_WOZZA, sp40); + jiggy_spawn(JIGGY_32_FP_WOZZA, sp40); levelSpecificFlags_set(0x26, TRUE); marker_despawn(this->marker); } diff --git a/src/FP/racectrl.c b/src/FP/racectrl.c index 00caaac9..7292abe2 100644 --- a/src/FP/racectrl.c +++ b/src/FP/racectrl.c @@ -197,10 +197,10 @@ void func_8038B0F8(void){ void func_8038B130(enum jiggy_e jiggy_id){ if(jiggy_id == JIGGY_2C_FP_BOGGY_3 && !jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ - jiggySpawn(jiggy_id, D_80391F38); + jiggy_spawn(jiggy_id, D_80391F38); } else{ - jiggySpawn(jiggy_id, D_80391F2C); + jiggy_spawn(jiggy_id, D_80391F2C); } } diff --git a/src/FP/sirslushgame.c b/src/FP/sirslushgame.c index cf96cafd..aae2f377 100644 --- a/src/FP/sirslushgame.c +++ b/src/FP/sirslushgame.c @@ -53,7 +53,7 @@ void fp_sirslushgame_update(void){ if(D_80392F30.unk1C){ func_802BAFE4(0x12); - jiggySpawn(JIGGY_31_FP_SIR_SLUSH, D_80392F30.spawn_pos); + jiggy_spawn(JIGGY_31_FP_SIR_SLUSH, D_80392F30.spawn_pos); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, D_80392F30.spawn_pos[0]), reinterpret_cast(s32, D_80392F30.spawn_pos[1]), diff --git a/src/FP/snowmanbuttongame.c b/src/FP/snowmanbuttongame.c index f3738e61..99a0c14c 100644 --- a/src/FP/snowmanbuttongame.c +++ b/src/FP/snowmanbuttongame.c @@ -51,7 +51,7 @@ void fp_snowmanButtonGame_update(void){ if(D_80392F50.unk18){ func_802BAFE4(0x11); - jiggySpawn(JIGGY_2D_FP_SNOWMAN_BUTTONS, D_80392F50.spawn_pos); + jiggy_spawn(JIGGY_2D_FP_SNOWMAN_BUTTONS, D_80392F50.spawn_pos); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, D_80392F50.spawn_pos[0]), reinterpret_cast(s32, D_80392F50.spawn_pos[1]), diff --git a/src/GV/ch/ancientone.c b/src/GV/ch/ancientone.c index e3859bb5..3554ed04 100644 --- a/src/GV/ch/ancientone.c +++ b/src/GV/ch/ancientone.c @@ -88,7 +88,7 @@ void func_803867F4(void){ f32 sp24[3]; func_802BAFE4(4); if(nodeProp_findPositionFromActorId(0x148, sp24)){ - jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24); + jiggy_spawn(JIGGY_46_GV_ANCIENT_ONES, sp24); __spawnQueue_add_4((GenFunction_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } } diff --git a/src/GV/ch/gobi2.c b/src/GV/ch/gobi2.c index f319e9e5..d576eaac 100644 --- a/src/GV/ch/gobi2.c +++ b/src/GV/ch/gobi2.c @@ -34,7 +34,7 @@ void func_80387984(ActorMarker *this){ void __chGobi2_spawnJIggy(void){ static f32 jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f}; - jiggySpawn(JIGGY_45_GV_GOBI_2, jiggy_position); + jiggy_spawn(JIGGY_45_GV_GOBI_2, jiggy_position); } void func_803879D4(ActorMarker *this_marker){ diff --git a/src/GV/ch/gobirock.c b/src/GV/ch/gobirock.c index 9632cbdb..64a76f61 100644 --- a/src/GV/ch/gobirock.c +++ b/src/GV/ch/gobirock.c @@ -120,7 +120,7 @@ void chGobiRock_update(Actor *this){ particleEmitter_update(local->unkC); particleEmitter_update(local->unk10); if(ml_timer_update(&local->unk14, sp24)){ - jiggySpawn(JIGGY_44_GV_GOBI_1, jiggy_position); + jiggy_spawn(JIGGY_44_GV_GOBI_1, jiggy_position); func_802BB3DC(0, 60.0f, 0.65f); } if(this->state == 2){ diff --git a/src/GV/matchinggame.c b/src/GV/matchinggame.c index 8fb1cf3b..9631ddc8 100644 --- a/src/GV/matchinggame.c +++ b/src/GV/matchinggame.c @@ -63,7 +63,7 @@ void func_80390218(void *arg0){ void __matchingGame_spawnJIggy(void){ static f32 jiggy_position[3] = {0.0f, 100.0f, 0.0f}; - jiggySpawn(JIGGY_40_GV_MATCHING_GAME, jiggy_position); + jiggy_spawn(JIGGY_40_GV_MATCHING_GAME, jiggy_position); } void __matchingGame_setState(s32 next_state){ diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c index 82919a05..338f8b51 100644 --- a/src/MM/ch/hut.c +++ b/src/MM/ch/hut.c @@ -90,7 +90,7 @@ void chhut_update(Actor *this){ __spawnQueue_add_4((GenFunction_4)func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2])); } else{ - jiggySpawn(JIGGY_5_MM_HUTS, sp3C); + jiggy_spawn(JIGGY_5_MM_HUTS, sp3C); } D_8037DCB0 = ( D_8037DCB0 + 1 ) % 6; } diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c index bedb8c5b..9600d4ec 100644 --- a/src/MM/ch/juju.c +++ b/src/MM/ch/juju.c @@ -89,7 +89,7 @@ void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){ sp1C[0] = x; sp1C[1] = y + 0x14; sp1C[2] = z; - jiggySpawn(JIGGY_4_MM_JUJU, sp1C); + jiggy_spawn(JIGGY_4_MM_JUJU, sp1C); } void func_80389244(s32 x, s32 y, s32 z, s32 yaw){ diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c index 50313885..098b7ee3 100644 --- a/src/MM/ch/lmonkey.c +++ b/src/MM/ch/lmonkey.c @@ -64,7 +64,7 @@ void MM_func_803883AC(Actor *this){ void __chLMonkey_spawnJiggy(s32 x, s32 y, s32 z){ f32 sp1C[3]; TUPLE_ASSIGN(sp1C, x, y, z); - jiggySpawn(JIGGY_9_MM_CHIMPY, sp1C); + jiggy_spawn(JIGGY_9_MM_CHIMPY, sp1C); } void __chLMonkey_complete(ActorMarker *marker, enum asset_e arg1, s32 arg2){ diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c index a1178cf5..a63347df 100644 --- a/src/MM/ch/orangepad.c +++ b/src/MM/ch/orangepad.c @@ -24,7 +24,7 @@ void MM_func_803863F0(s32 x, s32 y, s32 z){ TUPLE_ASSIGN(pos, x, y, z); - jiggySpawn(JIGGY_8_MM_ORANGE_PADS, pos); + jiggy_spawn(JIGGY_8_MM_ORANGE_PADS, pos); } void func_80386444(ActorMarker *arg0){ diff --git a/src/MMM/code_3420.c b/src/MMM/code_3420.c index 8b796ea4..8c4eebc3 100644 --- a/src/MMM/code_3420.c +++ b/src/MMM/code_3420.c @@ -163,7 +163,7 @@ void MMM_func_80389810(ActorMarker *caller, enum asset_e text_id, s32 arg2) { } void MMM_func_803898A0() { - jiggySpawn(JIGGY_60_MMM_MOTZHAND, D_8038C1E0); + jiggy_spawn(JIGGY_60_MMM_MOTZHAND, D_8038C1E0); } void MMM_func_803898C8() { diff --git a/src/MMM/code_DC0.c b/src/MMM/code_DC0.c index 8879059b..a1bfcd0a 100644 --- a/src/MMM/code_DC0.c +++ b/src/MMM/code_DC0.c @@ -83,7 +83,7 @@ bool MMM_func_80387340(ActorMarker *marker){ ml_vec3f_copy(sp20, actor->position); sp20[1] += 80.0f; func_8025A70C(COMUSIC_2D_PUZZLE_SOLVED_FANFARE); - jiggySpawn(JIGGY_63_MMM_FLOWER_POTS, sp20); + jiggy_spawn(JIGGY_63_MMM_FLOWER_POTS, sp20); } else{ func_8025A70C(COMUSIC_2B_DING_B); diff --git a/src/RBB/ch/anchorctrl.c b/src/RBB/ch/anchorctrl.c index 825aacd1..c5f87d46 100644 --- a/src/RBB/ch/anchorctrl.c +++ b/src/RBB/ch/anchorctrl.c @@ -31,7 +31,7 @@ void __chAnchorCtrl_spawnJiggy(ActorMarker *marker, s32 arg1, s32 arg2){ static f32 D_80390B34[3] = {-5100.0f, -2550.0f, 1470.0f}; Actor *actor = marker_getActor(marker); - jiggySpawn(JIGGY_53_RBB_SNORKEL, &D_80390B34); + jiggy_spawn(JIGGY_53_RBB_SNORKEL, &D_80390B34); timed_setStaticCameraToNode(0.5f, 0xb); __chAnchorCtrl_setState(actor, 3); } diff --git a/src/RBB/ch/bossboombox.c b/src/RBB/ch/bossboombox.c index b4a3417d..c8e006c2 100644 --- a/src/RBB/ch/bossboombox.c +++ b/src/RBB/ch/bossboombox.c @@ -198,7 +198,7 @@ void chbossboombox_respawnJiggy(s32 position_x, s32 position_y, s32 position_z){ D_80391288[0] = (f32)position_x; D_80391288[1] = (f32)(position_y + 0x28); D_80391288[2] = (f32)position_z; - jiggySpawn(JIGGY_56_RBB_BOSS_BOOM_BOX, &D_80391288); + jiggy_spawn(JIGGY_56_RBB_BOSS_BOOM_BOX, &D_80391288); } void func_8038CA70(Actor *this, f32(*arg1)[3]){ diff --git a/src/RBB/ch/cog.c b/src/RBB/ch/cog.c index 4ab3b568..d164470c 100644 --- a/src/RBB/ch/cog.c +++ b/src/RBB/ch/cog.c @@ -4,7 +4,7 @@ /* typedefs and declarations */ typedef struct { - u8 unk0; + u8 sfxsource_index; }ActorLocal_RBB_27E0; void func_80388C20(Actor *this); @@ -38,7 +38,7 @@ void func_80388BD0(Actor *this, s32 arg1){ void func_80388BE8(Actor *actor){ ActorLocal_RBB_27E0 *local = (ActorLocal_RBB_27E0 *)&actor->local; if(actor->modelCacheIndex == 0x17b){ - func_8030DA44(local->unk0); + func_8030DA44(local->sfxsource_index); } } @@ -51,14 +51,14 @@ void func_80388C20(Actor *this){ this->marker->unk30 = func_80388BE8; this->unk16C_4 = 1; if(this->modelCacheIndex == 0x17B){ - local->unk0 = func_8030D90C(); - func_8030DEB4(local->unk0, 1000.0f, 2000.0f); - func_8030DF68(local->unk0, &this->position); - func_8030DBB4(local->unk0, 0.5f); - sfxsource_setSfxId(local->unk0, SFX_9F_GENERATOR_RUNNING); - func_8030DD14(local->unk0, 3); - sfxsource_setSampleRate(local->unk0, 0); - func_8030E2C4(local->unk0); + local->sfxsource_index = func_8030D90C(); + sfxsource_set_fade_distances(local->sfxsource_index, 1000.0f, 2000.0f); + sfxsource_set_position(local->sfxsource_index, &this->position); + func_8030DBB4(local->sfxsource_index, 0.5f); + sfxsource_setSfxId(local->sfxsource_index, SFX_9F_GENERATOR_RUNNING); + func_8030DD14(local->sfxsource_index, 3); + sfxsource_setSampleRate(local->sfxsource_index, 0); + func_8030E2C4(local->sfxsource_index); }//L80388CFC if(this->state == 0){ if(this->modelCacheIndex == 0x17B){ @@ -78,7 +78,7 @@ void func_80388C20(Actor *this){ if(360.0f <= this->roll) this->roll -= 360.0f; if(this->modelCacheIndex == 0x17B){ - func_8030DB04(local->unk0, 0x61a8, &this->position, 1000.0f, 2000.0f); + func_8030DB04(local->sfxsource_index, 25000, &this->position, 1000.0f, 2000.0f); } } } diff --git a/src/RBB/ch/whistlectrl.c b/src/RBB/ch/whistlectrl.c index 97737055..81d5a1a8 100644 --- a/src/RBB/ch/whistlectrl.c +++ b/src/RBB/ch/whistlectrl.c @@ -28,7 +28,7 @@ void __chWhistleCtrl_setState(Actor *actor, s32 arg1){ void __chWhistleCtrl_soundWhistle(void){ func_802C8F70(225.0f); - jiggySpawn(JIGGY_54_RBB_WHISTLE, D_80390A74); + jiggy_spawn(JIGGY_54_RBB_WHISTLE, D_80390A74); } void __chWhistleCtrl_correct(void){ diff --git a/src/TTC/ch/blubber.c b/src/TTC/ch/blubber.c index f004dfa5..e2829a75 100644 --- a/src/TTC/ch/blubber.c +++ b/src/TTC/ch/blubber.c @@ -68,7 +68,7 @@ void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){ f32 sp24[3]; if(nodeProp_findPositionFromActorId(0x14b, sp24)){ - jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24); + jiggy_spawn(JIGGY_14_TTC_BLUBBER, sp24); __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } } diff --git a/src/TTC/ch/treasure.c b/src/TTC/ch/treasure.c index 32d87422..dab5530f 100644 --- a/src/TTC/ch/treasure.c +++ b/src/TTC/ch/treasure.c @@ -25,7 +25,7 @@ void __chtreasure_die(ActorMarker *marker, ActorMarker *otherMarker){ __spawnQueue_add_4((GenFunction_4) func_802C4140, 0x4C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); func_802EE278(this, 3, 0xf, 0x3C, 0.2f, 1.2f); func_803115C4(0xA19); - jiggySpawn(JIGGY_11_TTC_RED_X, this->position); + jiggy_spawn(JIGGY_11_TTC_RED_X, this->position); marker_despawn(marker); } diff --git a/src/core1/audio/n_csplayer.c b/src/core1/audio/n_csplayer.c index 40d5cbd8..5561155c 100644 --- a/src/core1/audio/n_csplayer.c +++ b/src/core1/audio/n_csplayer.c @@ -51,7 +51,7 @@ void __n_seqpReleaseVoice(ALSeqPlayer *seqp, ALVoice *voice, ALMicroTime deltaT * 1 Fine Tuning * 2 Coarse Tuning */ -void func_8025D7C0(ALCSPlayer *seqp); +void __n_CSPPostNextSeqEvent(ALCSPlayer *seqp); static ALMicroTime __n_CSPVoiceHandler(void *node); static void __CSPHandleNextSeqEvent(ALCSPlayer *seqp); @@ -232,7 +232,7 @@ static ALMicroTime __n_CSPVoiceHandler(void *node) { seqp->state = AL_PLAYING; func_80250650(); - func_8025D7C0(seqp); /* seqp must be AL_PLAYING before we call this routine. */ + __n_CSPPostNextSeqEvent(seqp); /* seqp must be AL_PLAYING before we call this routine. */ } break; @@ -344,7 +344,7 @@ static ALMicroTime __n_CSPVoiceHandler(void *node) is no target sequence. sct 11/7/95 */ -void func_8025D7C0(ALCSPlayer *seqp) +void __n_CSPPostNextSeqEvent(ALCSPlayer *seqp) { ALEvent evt; s32 deltaTicks; @@ -383,12 +383,12 @@ __CSPHandleNextSeqEvent(ALCSPlayer *seqp) { case AL_SEQ_MIDI_EVT: __n_CSPHandleMIDIMsg(seqp, &evt); - func_8025D7C0(seqp); + __n_CSPPostNextSeqEvent(seqp); break; case AL_TEMPO_EVT: __CSPHandleMetaMsg(seqp, &evt); - func_8025D7C0(seqp); + __n_CSPPostNextSeqEvent(seqp); break; case AL_SEQ_END_EVT: @@ -400,7 +400,7 @@ __CSPHandleNextSeqEvent(ALCSPlayer *seqp) case AL_TRACK_END: case AL_CSP_LOOPSTART: case AL_CSP_LOOPEND: - func_8025D7C0(seqp); + __n_CSPPostNextSeqEvent(seqp); break; default: diff --git a/src/core1/code_11AC0.c b/src/core1/code_11AC0.c index 62e57610..f2a05573 100644 --- a/src/core1/code_11AC0.c +++ b/src/core1/code_11AC0.c @@ -258,7 +258,7 @@ void musicInstruments_init(void){ func_8024FB8C(); } -ALBank *func_8024F758(void){ +ALBank *music_get_sound_bank(void){ return D_80282108; } diff --git a/src/core1/code_5650.c b/src/core1/code_5650.c index 086987be..fe4fc37d 100644 --- a/src/core1/code_5650.c +++ b/src/core1/code_5650.c @@ -329,10 +329,10 @@ void func_802432F8(N_ALSndPlayer *sndp, N_ALEvent *event) { case 0x200: if (temp_s0->unk3F & 0x10) { sp68 = func_80244608(var_s5->msg.midi.duration, (s16)var_s5->msg.generic.data[1].i, temp_s0->unk30); - func_80244978(sp68, 8, temp_s0->unk34); - func_80244978(sp68, 4, temp_s0->unk3D); + func_80244978(sp68, AL_SEQP_PROG_EVT, temp_s0->unk34); + func_80244978(sp68, AL_SEQ_END_EVT, temp_s0->unk3D); func_80244978(sp68, 0x100, temp_s0->unk3E); - func_80244978(sp68, 0x10, reinterpret_cast(s32, temp_s0->unk2C)); + func_80244978(sp68, AL_SEQP_STOP_EVT, reinterpret_cast(s32, temp_s0->unk2C)); } break; diff --git a/src/core1/code_9D30.c b/src/core1/code_9D30.c index fe8de73b..cb9187a9 100644 --- a/src/core1/code_9D30.c +++ b/src/core1/code_9D30.c @@ -318,28 +318,38 @@ void func_80248098(f32 arg0) { func_80248520(); } +//letter to font index??? s32 func_8024824C(s32 arg0) { + //lowercase_letter if ((arg0 >= (s32) D_80275BE8[0]) && ((s32) D_80275BE8[1] >= arg0)) { return (arg0 - D_80275BE8[0]) + 0xA; } + //uppercase_letter if ((arg0 >= (s32) D_80275BE8[2]) && ((s32) D_80275BE8[3] >= arg0)) { return (arg0 - D_80275BE8[2]) + 0xA; } + //number if ((arg0 >= (s32) D_80275BE8[4]) && ((s32) D_80275BE8[5] >= arg0)) { return (arg0 - D_80275BE8[4]); } + //. if (arg0 == D_80275BE8[6]) { return 0x24; } + + //: if (arg0 == D_80275BE8[7]) { return 0x25; } + + //- if (arg0 == D_80275BE8[8]) { return 0x26; } + // if (arg0 == D_80275BE8[9]) { return 0x27; } diff --git a/src/core2/anim/sprite.c b/src/core2/anim/sprite.c new file mode 100644 index 00000000..eb0542a2 --- /dev/null +++ b/src/core2/anim/sprite.c @@ -0,0 +1,275 @@ +#include +#include "core2/anim/sprite.h" + +#include "functions.h" +#include "variables.h" + + + +/* .bss */ +u8 D_80379B90[0x10]; +static AnimSprite s_animsprite_list[40]; + +/* .code */ +static void __animsprite_reset_loop(AnimSprite *this){ + this->remaining_time += this->steps[this->current_step].duration*(1.0/30.0)*this->speed_multiplier; +} + +static void __animsprite_update_looped(AnimSprite *this){ + this->remaining_time -= time_getDelta(); + while(this->remaining_time <= 0.0f){ + this->current_step++; + if(this->current_step >= this->step_count) + this->current_step = 0; + __animsprite_reset_loop(this); + } +} + +static void __animsprite_update_once(AnimSprite *this){ + this->remaining_time -= time_getDelta(); + while(this->remaining_time <= 0.0f){ + this->current_step++; + if(this->step_count <= this->current_step){ + this->current_step--; + this->state = ANIM_SPRITE_STATE_STOPPED; + } + __animsprite_reset_loop(this); + } +} + +/** + * @brief initializes the use of AnimSprite structures + * + */ +void animsprite_init(void){ + int i; + for(i = 0; i < 40; i++){ + s_animsprite_list[i].active = 0; + } +} + +/** + * @brief Returns pointer to first free AnimSprite slot. + * Returns NULL if not slots are free + * + * @return AnimSprite* + */ +AnimSprite * animsprite_new(void){ + int i; + for(i = 0; i < 40; i++){ + if(!s_animsprite_list[i].active){ + s_animsprite_list[i].active = 1; + s_animsprite_list[i].current_step = 0; + s_animsprite_list[i].state = 0; + s_animsprite_list[i].step_count = 1; + s_animsprite_list[i].start_step = 0; + s_animsprite_list[i].steps = 0; + s_animsprite_list[i].unknown = 1; + s_animsprite_list[i].remaining_time = 0.0f; + s_animsprite_list[i].speed_multiplier = 1.0f; + s_animsprite_list[i].current_frame = 0; + return &s_animsprite_list[i]; + } + } + return NULL; +} + +/** + * @brief Marks AnimSprite as inactive/free + * + * @param this + */ +void animsprite_free(AnimSprite *this){ + this->active = 0; +} + +/** + * @brief Destructs all AnimSprites + * + */ +void animsprite_terminate(void){ + int i; + for(i = 0; i < 40; i++){ + if(s_animsprite_list[i].active){ + animsprite_free(&s_animsprite_list[i]); + } + } +} + +/** + * @brief performs frame update of an AnimSprite + * + * @param this + */ +void animsprite_update(AnimSprite *this){ + switch(this->state){ + case ANIM_SPRITE_STATE_NONE: + break; + case ANIM_SPRITE_STATE_ONCE: + __animsprite_update_once(this); + this->current_frame = this->steps[this->current_step].index; + break; + case ANIM_SPRITE_STATE_LOOP: + __animsprite_update_looped(this); + this->current_frame = this->steps[this->current_step].index; + break; + case ANIM_SPRITE_STATE_STOPPED: + break; + } +} + +/** + * @brief sets an AnimSprite to default settings + * + * @param this + */ +void animsprite_default(AnimSprite *this){ + this->current_step = 0; + this->remaining_time = 0.0f; + animsprite_set_steps(this, NULL, 1); + animsprite_set_speed(this, 1.0f); + animsprite_set_start_step(this, 0); + animsprite_set_state(this, ANIM_SPRITE_STATE_LOOP); + animsprite_set_unknown(this, 1); +} + +/** + * @brief starts the lopping of a AnimSprite + * + * @param this + */ +void animsprite_loop(AnimSprite *this){ + this->current_step = this->start_step; + __animsprite_reset_loop(this); +} + +/** + * @brief sets the steps of a AnimSprite + * + * @param this pointer to AnimSprite + * @param step_list pointer to AnimSpriteStep array + * @param size size of step list in bytes + */ +void animsprite_set_steps(AnimSprite *this, AnimSpriteStep *step_list, s32 size){ + this->steps = step_list; + this->step_count = size/2; +} + +/** + * @brief sets the state of a AnimSpriteState + * + * @param this + * @param arg1 + */ +void animsprite_set_state(AnimSprite *this, AnimSpriteState arg1){ + this->state = arg1; +} + +/** + * @brief sets an unknown bit bit in a AnimSprite + * + * @param this + * @return s32 + * + * @note This bit is not used in the final release of Banjo-Kazooie + */ +void animsprite_set_unknown(AnimSprite *this, s32 arg1){ + this->unknown = arg1; +} + +/** + * @brief sets the current frame index of a AnimSprite + * + * @param this + * @param arg1 + * + * @note this only persists if the AnimSprite is stopped + */ +void animsprite_set_frame(AnimSprite *this, s32 arg1){ + this->current_frame = arg1; +} + +/** + * @brief sets the speed multiplier of a AnimSprite + * + * @param this pointer to AnimSprite + * @param speed speed multiplier to default speed of 1 sprite frame per game + * frame (30 fps) + */ +void animsprite_set_speed(AnimSprite *this, f32 speed){ + this->speed_multiplier = speed; +} + +/** + * @brief sets the start position of a AnimSprite + * + * @param this + * @param step + */ +void animsprite_set_start_step(AnimSprite *this, s32 step){ + this->start_step = step; +} + +/** + * @brief returns the frame index corresponding to the current step of a + * AnimSprite + * + * @param this + * @return s32 + */ +s32 animsprite_get_frame(AnimSprite *this){ + return this->current_frame; +} + +/** + * @brief returns the current state of a AnimSprite + * + * @param this + * @return AnimSpriteState + */ +AnimSpriteState animsprite_get_current_state(AnimSprite *this){ + return this->state; +} + +/** + * @brief returns a bit from a AnimSprite + * + * @param this + * @return s32 + * + * @note This bit is not used in the final release of Banjo-Kazooie + */ +s32 animsprite_get_unknown(AnimSprite *this){ + return this->unknown; +} + +/** + * @brief returns the speed multiplier applied to a AnimSprite + * + * @param this + * @return f32 + */ +f32 animsprite_get_speed(AnimSprite *this){ + return this->speed_multiplier; +} + +/** + * @brief returns true if AnimSprite is stopped + * + * @param this + * @return int + */ +int animsprite_is_stopped(AnimSprite *this){ + return animsprite_get_current_state(this) == 3; +} + +/** + * @brief returns true if AnimSprite is on specified step + * + * @param this + * @param frame + * @return int + */ +int animsprite_is_at_step(AnimSprite *this, s32 frame){ + return this->current_step == frame; +} diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index 20b9469c..6ee83745 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -86,10 +86,10 @@ f32 func_802D7038(Actor *this) { } void func_802D7124(Actor *actor, f32 arg1) { - f32 sp1C[3]; + f32 vp[3]; - viewport_getPosition(&sp1C); - if ((actor->position[0] - sp1C[0]) * (actor->position[0] - sp1C[0]) + (actor->position[2] - sp1C[2]) * (actor->position[2] - sp1C[2]) < 12250000.0f) { + viewport_getPosition(&vp); + if ((actor->position[0] - vp[0]) * (actor->position[0] - vp[0]) + (actor->position[2] - vp[2]) * (actor->position[2] - vp[2]) < 12250000.0f) { func_802D729C(actor, arg1); } } diff --git a/src/core2/ch/beehive.c b/src/core2/ch/beehive.c index 5a0303d5..61db5e17 100644 --- a/src/core2/ch/beehive.c +++ b/src/core2/ch/beehive.c @@ -72,8 +72,8 @@ void func_802CE8D4(Actor *this){ sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK); sfxsource_setSampleRate(this->unk44_31, 12000); func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4); - func_8030DF68(this->unk44_31, this->position); - func_8030DEB4(this->unk44_31, 300.0f, 1500.0f); + sfxsource_set_position(this->unk44_31, this->position); + sfxsource_set_fade_distances(this->unk44_31, 300.0f, 1500.0f); func_8030DD14(this->unk44_31, 3); func_8030E2C4(this->unk44_31); } diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index 5d0582f2..1dc83447 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -140,7 +140,7 @@ void __chCrab_spawn_mutant_crab_jiggy(void) { sp1C[0] = 13814.0f; sp1C[1] = 3812.0f; sp1C[2] = 0.0f; - jiggySpawn(JIGGY_16_CC_SNIPPETS, sp1C); + jiggy_spawn(JIGGY_16_CC_SNIPPETS, sp1C); } void __chCrab_mutantTextCallback(ActorMarker *caller, enum asset_e text_id, s32 model_id){ diff --git a/src/core2/ch/jinjo.c b/src/core2/ch/jinjo.c index 9438d729..cf29848b 100644 --- a/src/core2/ch/jinjo.c +++ b/src/core2/ch/jinjo.c @@ -172,7 +172,7 @@ void chJinjo_update(Actor * this){ sp40[1] = this->position_y; sp40[2] = this->position_z; sp40[1] += 50.0f; - jiggySpawn(10*level_get()-9, sp40); + jiggy_spawn(10*level_get()-9, sp40); }//L802CE0CC func_8024BD08(0); func_8032BB88(this, 0, 4000); diff --git a/src/core2/ch/soundsource.c b/src/core2/ch/soundsource.c index 7a2477b3..cdfc21d7 100644 --- a/src/core2/ch/soundsource.c +++ b/src/core2/ch/soundsource.c @@ -60,8 +60,8 @@ void func_802D05A0(Actor *this, s32 next_state){ sfxsource_setSfxId(local->unk0, D_80367340[(s32)this->yaw].unk0); func_8030DD14(local->unk0, 3); func_8030DFF0(local->unk0, 1); - func_8030DF68(local->unk0, this->position); - func_8030DEB4(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale); + sfxsource_set_position(local->unk0, this->position); + sfxsource_set_fade_distances(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale); func_8030DFB4(local->unk0, 1); func_802D0500(this); if(-1.0f != D_80367340[(s32)this->yaw].unkC) diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index b5018790..820098ec 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -6,8 +6,8 @@ extern void func_8030DBFC(u32, f32, f32, f32); extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32); extern void fileProgressFlag_set(s32, bool); -extern void func_8030DEB4(u8, f32, f32); -extern void func_8030DF68(u8, f32[3]); +extern void sfxsource_set_fade_distances(u8, f32, f32); +extern void sfxsource_set_position(u8, f32[3]); extern void func_8030E2C4(u8); extern void sfxsource_setSampleRate(u8, s32); extern void ml_vec3f_normalize(f32[3]); @@ -544,8 +544,8 @@ void chBeeSwarm_update(Actor *this) { ((this->state == 3) || (this->state == 4)) ? 1.1 : 0.9, 0.05f ); - func_8030DEB4(this->unk44_31, 500.0f, 1500.0f); - func_8030DF68(this->unk44_31, this->position); + sfxsource_set_fade_distances(this->unk44_31, 500.0f, 1500.0f); + sfxsource_set_position(this->unk44_31, this->position); func_8030E2C4(this->unk44_31); sfxsource_setSampleRate(this->unk44_31, (s32)(((gu_sqrtf(this->velocity[0]*this->velocity[0] + this->velocity[1]*this->velocity[1] + this->velocity[2]*this->velocity[2])/ this->unk28) * 8000.0f) + 2000.0f)); } diff --git a/src/core2/code_5BEB0.c b/src/core2/code_5BEB0.c index cbc35ade..a92a825b 100644 --- a/src/core2/code_5BEB0.c +++ b/src/core2/code_5BEB0.c @@ -13,7 +13,7 @@ u8 pad_8037E8A8[0x18]; /* public functions */ void func_802E3BD0(s32 frame_buffer_indx); -int func_802E49F0(void); +int game_is_frozen(void); /* .code */ void mapSavestate_init(void){ diff --git a/src/core2/code_5C870.c b/src/core2/code_5C870.c index ad41b168..8a445ee7 100644 --- a/src/core2/code_5C870.c +++ b/src/core2/code_5C870.c @@ -141,17 +141,17 @@ void func_802E39D0(Gfx **gdl, Mtx **mptr, Vtx **vptr, s32 arg3, s32 arg4){ func_8030C2D4(gdl, mptr, vptr); } - if(!func_802E49F0() && func_80335134()){ + if(!game_is_frozen() && func_80335134()){ func_8032D474(gdl, mptr, vptr); } gcpausemenu_draw(gdl, mptr, vptr); - if(!func_802E49F0()){ + if(!game_is_frozen()){ func_8025AFC0(gdl, mptr, vptr); } gcdialog_draw(gdl, mptr, vptr); - if(!func_802E49F0()){ + if(!game_is_frozen()){ itemPrint_draw(gdl, mptr, vptr); } @@ -274,7 +274,7 @@ void func_802E3E7C(enum game_mode_e mode){ mapSavestate_apply(map); D_8037E8E0.unk0 = prev_mode; func_802E3BF8(mode, sp30); - func_80332CCC(); + jiggylist_map_actors(); func_80346CA8(); } @@ -554,7 +554,7 @@ bool func_802E4424(void) { break; case GAME_MODE_4_PAUSED: /* switch 2 */ - if (gcPauseMenu_update() || func_8031C880()) { + if (gcPauseMenu_update() || cutscenetrigger_update()) { FUNC_8030E624(SFX_C9_PAUSEMENU_ENTER, 0.899316, 32736); func_80335110(1); func_8025A430(-1, 2000, 3); @@ -615,7 +615,7 @@ void func_802E49E0(void){ D_8037E8E0.unkC = TRUE; } -int func_802E49F0(void){ +int game_is_frozen(void){ return D_8037E8E0.unkC; } diff --git a/src/core2/code_72B10.c b/src/core2/code_72B10.c index 6a37f26d..22fb7118 100644 --- a/src/core2/code_72B10.c +++ b/src/core2/code_72B10.c @@ -127,8 +127,8 @@ void func_802F9EC4(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ iPtr = vector_at(D_803810A0, arg0); if(iPtr->unk0){ - func_8030DEB4(iPtr->unk0, (f32)arg2, (f32)arg3); - func_8030DF68(iPtr->unk0, arg1); + sfxsource_set_fade_distances(iPtr->unk0, (f32)arg2, (f32)arg3); + sfxsource_set_position(iPtr->unk0, arg1); } } diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index be3b9851..c10d279e 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -369,9 +369,9 @@ void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3 } void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { - f32 sp6C[3]; - s32 sp60[3]; - f32 sp54[3]; + f32 vp_position[3]; + s32 vp_cube_indices[3]; + f32 vp_rotation[3]; s32 i; s32 sp44[3]; s32 sp38[3]; @@ -381,65 +381,65 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { return; func_8032D3A8(); - viewport_getPosition(sp6C); - viewport_getRotation(sp54); - func_80256664(sp54); - cube_positionToIndices(sp60, sp6C); - sp60[0] -= D_80381FA0.min[0];\ - sp60[1] -= D_80381FA0.min[1];\ - sp60[2] -= D_80381FA0.min[2]; + viewport_getPosition(vp_position); + viewport_getRotation(vp_rotation); + func_80256664(vp_rotation); + cube_positionToIndices(vp_cube_indices, vp_position); + vp_cube_indices[0] -= D_80381FA0.min[0];\ + vp_cube_indices[1] -= D_80381FA0.min[1];\ + vp_cube_indices[2] -= D_80381FA0.min[2]; func_80308EC8(); sp44[0] = sp44[1] = sp44[2] = 0; sp38[0] = D_80381FA0.width[0] - 1;\ sp38[1] = D_80381FA0.width[1] - 1;\ sp38[2] = D_80381FA0.width[2] - 1; - if ((sp54[0]> 250.0f) && (sp54[0]< 290.0f)) { - if ((sp54[1] >= 225.0f) && (sp54[1] <= 315.0f)) { - sp44[0] = (sp60[0] > sp44[0]) ? sp60[0] - 1 : sp44[0]; + if ((vp_rotation[0]> 250.0f) && (vp_rotation[0]< 290.0f)) { + if ((vp_rotation[1] >= 225.0f) && (vp_rotation[1] <= 315.0f)) { + sp44[0] = (vp_cube_indices[0] > sp44[0]) ? vp_cube_indices[0] - 1 : sp44[0]; } else { - if ((sp54[1] >= 45.0f) && (sp54[1] <= 135.0f)) { - sp38[0] = sp60[0]; + if ((vp_rotation[1] >= 45.0f) && (vp_rotation[1] <= 135.0f)) { + sp38[0] = vp_cube_indices[0]; } } - if ((sp54[0]>= 45.0f) && (sp54[0]<= 135.0f)) { - sp44[1] = sp60[1]; - } else if ((sp54[0]>= 225.0f) && (sp54[0]<= 315.0f)) { - sp38[1] = sp60[1]; + if ((vp_rotation[0]>= 45.0f) && (vp_rotation[0]<= 135.0f)) { + sp44[1] = vp_cube_indices[1]; + } else if ((vp_rotation[0]>= 225.0f) && (vp_rotation[0]<= 315.0f)) { + sp38[1] = vp_cube_indices[1]; } - if ((sp54[1] >= 135.0f) && (sp54[1] <= 225.0f)) { - sp44[2] = (sp60[2] > sp44[2]) ? sp60[2] - 1 : sp44[2]; - } else if ((315.0f <= sp54[1]) || (sp54[1] <= 45.0f)) { - sp38[2] = sp60[2]; + if ((vp_rotation[1] >= 135.0f) && (vp_rotation[1] <= 225.0f)) { + sp44[2] = (vp_cube_indices[2] > sp44[2]) ? vp_cube_indices[2] - 1 : sp44[2]; + } else if ((315.0f <= vp_rotation[1]) || (vp_rotation[1] <= 45.0f)) { + sp38[2] = vp_cube_indices[2]; } } else { - if ((sp54[1] >= 225.0f) && (sp54[1] <= 315.0f)) { - sp44[0] = sp60[0]; + if ((vp_rotation[1] >= 225.0f) && (vp_rotation[1] <= 315.0f)) { + sp44[0] = vp_cube_indices[0]; } else { - if ((sp54[1] >= 45.0f) && (sp54[1] <= 135.0f)) { - sp38[0] = sp60[0]; + if ((vp_rotation[1] >= 45.0f) && (vp_rotation[1] <= 135.0f)) { + sp38[0] = vp_cube_indices[0]; } } - if ((sp54[0]>= 45.0f) && (sp54[0]<= 135.0f)) { - sp44[1] = sp60[1]; - } else if ((sp54[0]>= 225.0f) && (sp54[0]<= 315.0f)) { - sp38[1] = sp60[1]; + if ((vp_rotation[0]>= 45.0f) && (vp_rotation[0]<= 135.0f)) { + sp44[1] = vp_cube_indices[1]; + } else if ((vp_rotation[0]>= 225.0f) && (vp_rotation[0]<= 315.0f)) { + sp38[1] = vp_cube_indices[1]; } - if ((sp54[1] >= 135.0f) && (sp54[1] <= 225.0f)) { - sp44[2] = sp60[2]; - } else if ((315.0f <= sp54[1]) || (sp54[1] <= 45.0f)) { - sp38[2] = sp60[2]; + if ((vp_rotation[1] >= 135.0f) && (vp_rotation[1] <= 225.0f)) { + sp44[2] = vp_cube_indices[2]; + } else if ((315.0f <= vp_rotation[1]) || (vp_rotation[1] <= 45.0f)) { + sp38[2] = vp_cube_indices[2]; } } for(i = 0; i < 3; i++){ - if(sp60[i] - sp44[i] >= 5){ - sp44[i] = sp60[i] - 4; + if(vp_cube_indices[i] - sp44[i] >= 5){ + sp44[i] = vp_cube_indices[i] - 4; } - if(sp38[i] - sp60[i] >= 5){ - sp38[i] = sp60[i] + 4; + if(sp38[i] - vp_cube_indices[i] >= 5){ + sp38[i] = vp_cube_indices[i] + 4; } } if (D_80381FA0.unk3C != NULL) { @@ -449,10 +449,10 @@ void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { if (D_80381FA0.unk40 != NULL) { func_8032D510(D_80381FA0.unk40, gfx, mtx, vtx); } - if (((45.0f <= sp54[1]) && (sp54[1] <= 135.0f)) || ((225.0f <= sp54[1]) && (sp54[1] <= 315.0f))) { - func_80301F50(gfx, mtx, vtx, sp60, sp44, sp38); + if (((45.0f <= vp_rotation[1]) && (vp_rotation[1] <= 135.0f)) || ((225.0f <= vp_rotation[1]) && (vp_rotation[1] <= 315.0f))) { + func_80301F50(gfx, mtx, vtx, vp_cube_indices, sp44, sp38); } else { - func_80302634(gfx, mtx, vtx, sp60, sp44, sp38); + func_80302634(gfx, mtx, vtx, vp_cube_indices, sp44, sp38); } func_80308D2C(gfx, mtx, vtx); } diff --git a/src/core2/code_85800.c b/src/core2/code_85800.c index f3dc6043..753920af 100644 --- a/src/core2/code_85800.c +++ b/src/core2/code_85800.c @@ -18,8 +18,8 @@ extern f32 sfx_randf2(f32, f32); typedef struct { f32 position[3]; - f32 unkC; //inner_radius_squared - f32 unk10; //outer_radius_squared + f32 fade_inner_radius_sqr; //inner_radius_squared + f32 fade_outer_radius_sqr; //outer_radius_squared s16 unk14; u8 unk16; u8 pad17[0x1]; @@ -202,10 +202,10 @@ s32 func_8030CCF0(struct45s *arg0, s32 arg1){ diff[1] = arg0->position[1] - plyr_pos[1]; diff[2] = arg0->position[2] - plyr_pos[2]; dist_sqr = diff[0]*diff[0] + diff[1]*diff[1] + diff[2]*diff[2]; - if( dist_sqr < arg0->unkC) + if( dist_sqr < arg0->fade_inner_radius_sqr) retVal = arg1; - else if( dist_sqr < arg0->unk10) - retVal = arg0->unk14 + (((arg0->unk10-dist_sqr))/(arg0->unk10 - arg0->unkC))*(arg1 - arg0->unk14); + else if( dist_sqr < arg0->fade_outer_radius_sqr) + retVal = arg0->unk14 + (((arg0->fade_outer_radius_sqr-dist_sqr))/(arg0->fade_outer_radius_sqr - arg0->fade_inner_radius_sqr))*(arg1 - arg0->unk14); else retVal = arg0->unk14; return retVal; @@ -497,8 +497,8 @@ u8 func_8030D90C(void){ sfxsource_setFlag(s0, SFX_SRC_FLAG_2_UNKOWN); sfxsource_setFlag(s0, SFX_SRC_FLAG_3_UNKOWN); sfxsource_setFlag(s0, SFX_SRC_FLAG_4_UNKOWN); - s0->unkC = 62500.0f; - s0->unk10 = 1440000.0f; + s0->fade_inner_radius_sqr = 62500.0f; + s0->fade_outer_radius_sqr = 1440000.0f; s0->unk14 = 0xa; s0->unk16 = 0; s0->unk18 = 64.0f; @@ -643,12 +643,12 @@ void func_8030DE44(u8 indx, s32 arg1, f32 arg2){ } } -void func_8030DEB4(u8 indx, f32 arg1, f32 arg2){ +void sfxsource_set_fade_distances(u8 indx, f32 min, f32 max){ struct45s *ptr; if(indx){ ptr = sfxsource_at(indx); - ptr->unkC = arg1*arg1; - ptr->unk10 = arg2*arg2; + ptr->fade_inner_radius_sqr = min*min; + ptr->fade_outer_radius_sqr = max*max; func_8030DFF0(indx, 1); } } @@ -662,8 +662,7 @@ void func_8030DF18(u8 indx, f32 arg1){ } } -//sfxsource_setPostion -void func_8030DF68(u8 indx, f32 position[3]){ +void sfxsource_set_position(u8 indx, f32 position[3]){ struct45s *ptr; if(indx){ ptr = sfxsource_at(indx); @@ -914,8 +913,8 @@ void func_8030E78C(enum sfx_e uid, f32 arg1, u32 arg2, f32 position[3], f32 arg4 sfxsource_setSfxId(s0, uid); sfxsource_setSampleRate(s0, arg2); func_8030DBB4(s0, arg1); - func_8030DEB4(s0, arg4, arg5); - func_8030DF68(s0, position); + sfxsource_set_fade_distances(s0, arg4, arg5); + sfxsource_set_position(s0, position); func_8030DD14(s0, 1); func_8030E2C4(s0); } @@ -984,7 +983,7 @@ void func_8030EC74(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4, f32 a sfxsource_setSfxId(indx, uid); sfxsource_setSampleRate(indx, sfx_randi2(arg3, arg4)); func_8030DBB4(indx, sfx_randf2(arg1, arg2)); - func_8030DF68(indx, arg5); + sfxsource_set_position(indx, arg5); func_8030DD14(indx, 1); func_8030E2C4(indx); } diff --git a/src/core2/code_956B0.c b/src/core2/code_956B0.c index 1aaf0a7c..2a6d1924 100644 --- a/src/core2/code_956B0.c +++ b/src/core2/code_956B0.c @@ -78,7 +78,7 @@ bool func_8031C7C8(void){ } //checks is a cutscene can be inturrupted and performs take me there -void func_8031C7EC(s32 cs_map, s32 arg1, s32 return_map, s32 return_exit, bool (* condFunc)(void)){ +void cutscenetrigger_check(s32 cs_map, s32 arg1, s32 return_map, s32 return_exit, bool (* condFunc)(void)){ if(map_get() != cs_map) return; @@ -89,31 +89,31 @@ void func_8031C7EC(s32 cs_map, s32 arg1, s32 return_map, s32 return_exit, bool ( } //check cutscene interrupts -s32 func_8031C880(void){ - func_8031C7EC(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0, MAP_89_CS_INTRO_BANJOS_HOUSE_2, -1, NULL); - func_8031C7EC(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0, MAP_7C_CS_INTRO_BANJOS_HOUSE_1, -1, NULL); - func_8031C7EC(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0, MAP_86_CS_SPIRAL_MOUNTAIN_4, -1, NULL); - func_8031C7EC(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, NULL); - func_8031C7EC(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, MAP_7B_CS_INTRO_GL_DINGPOT_1, -1, NULL); - func_8031C7EC(MAP_7B_CS_INTRO_GL_DINGPOT_1, 1, MAP_81_CS_INTRO_GL_DINGPOT_2, -1, NULL); - func_8031C7EC(MAP_81_CS_INTRO_GL_DINGPOT_2, 0, MAP_7D_CS_SPIRAL_MOUNTAIN_1, -1, NULL); - func_8031C7EC(MAP_82_CS_ENTERING_GL_MACHINE_ROOM, 0, MAP_69_GL_MM_LOBBY, 0x12, func_8031C688); - func_8031C7EC(MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0, MAP_1F_CS_START_RAREWARE, -1, func_8031C6E4); - func_8031C7EC(MAP_87_CS_SPIRAL_MOUNTAIN_5, 0, MAP_88_CS_SPIRAL_MOUNTAIN_6, -1, NULL); - func_8031C7EC(MAP_94_CS_INTRO_SPIRAL_7, 0, MAP_8E_GL_FURNACE_FUN, 4, NULL); - func_8031C7EC(MAP_88_CS_SPIRAL_MOUNTAIN_6, 1, MAP_96_CS_END_BEACH_1, -1, NULL); - func_8031C7EC(MAP_98_CS_END_SPIRAL_MOUNTAIN_1, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); - func_8031C7EC(MAP_99_CS_END_SPIRAL_MOUNTAIN_2, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); - func_8031C7EC(MAP_20_CS_END_NOT_100, 0, MAP_98_CS_END_SPIRAL_MOUNTAIN_1, -1, NULL); - func_8031C7EC(MAP_95_CS_END_ALL_100, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, NULL); - func_8031C7EC(MAP_97_CS_END_BEACH_2, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, func_8031C7C8); - func_8031C7EC(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_7B_CS_INTRO_GL_DINGPOT_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_81_CS_INTRO_GL_DINGPOT_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); - func_8031C7EC(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); +s32 cutscenetrigger_update(void){ + cutscenetrigger_check(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0, MAP_89_CS_INTRO_BANJOS_HOUSE_2, -1, NULL); + cutscenetrigger_check(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0, MAP_7C_CS_INTRO_BANJOS_HOUSE_1, -1, NULL); + cutscenetrigger_check(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0, MAP_86_CS_SPIRAL_MOUNTAIN_4, -1, NULL); + cutscenetrigger_check(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, NULL); + cutscenetrigger_check(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, MAP_7B_CS_INTRO_GL_DINGPOT_1, -1, NULL); + cutscenetrigger_check(MAP_7B_CS_INTRO_GL_DINGPOT_1, 1, MAP_81_CS_INTRO_GL_DINGPOT_2, -1, NULL); + cutscenetrigger_check(MAP_81_CS_INTRO_GL_DINGPOT_2, 0, MAP_7D_CS_SPIRAL_MOUNTAIN_1, -1, NULL); + cutscenetrigger_check(MAP_82_CS_ENTERING_GL_MACHINE_ROOM, 0, MAP_69_GL_MM_LOBBY, 0x12, func_8031C688); + cutscenetrigger_check(MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0, MAP_1F_CS_START_RAREWARE, -1, func_8031C6E4); + cutscenetrigger_check(MAP_87_CS_SPIRAL_MOUNTAIN_5, 0, MAP_88_CS_SPIRAL_MOUNTAIN_6, -1, NULL); + cutscenetrigger_check(MAP_94_CS_INTRO_SPIRAL_7, 0, MAP_8E_GL_FURNACE_FUN, 4, NULL); + cutscenetrigger_check(MAP_88_CS_SPIRAL_MOUNTAIN_6, 1, MAP_96_CS_END_BEACH_1, -1, NULL); + cutscenetrigger_check(MAP_98_CS_END_SPIRAL_MOUNTAIN_1, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); + cutscenetrigger_check(MAP_99_CS_END_SPIRAL_MOUNTAIN_2, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); + cutscenetrigger_check(MAP_20_CS_END_NOT_100, 0, MAP_98_CS_END_SPIRAL_MOUNTAIN_1, -1, NULL); + cutscenetrigger_check(MAP_95_CS_END_ALL_100, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, NULL); + cutscenetrigger_check(MAP_97_CS_END_BEACH_2, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, func_8031C7C8); + cutscenetrigger_check(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_7B_CS_INTRO_GL_DINGPOT_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_81_CS_INTRO_GL_DINGPOT_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + cutscenetrigger_check(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); if(map_get() == MAP_95_CS_END_ALL_100 && mapSpecificFlags_get(1)){ func_8034B9E4(); mapSpecificFlags_set(1, 0); diff --git a/src/core2/code_9B990.c b/src/core2/code_9B990.c index ab21b511..fb7e3fd0 100644 --- a/src/core2/code_9B990.c +++ b/src/core2/code_9B990.c @@ -6,67 +6,67 @@ /* !!!!!!!!!!!!!!!!!!!!!!!!!!! BREAK??? !!!!!!!!!!!!!!!!!!!!!!!!!*/ void __overlay_mmm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322930(void); +void __overlay_mmm_release(void); void func_80322960(void); void __overlay_mmm_update(void); void func_803229C0(s32, s32); void __overlay_cc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322A00(void); +void __overlay_cc_release(void); void func_80322A28(void); void __overlay_cc_update(void); void func_80322A78(s32, s32); void __overlay_gv_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322A94(void); +void __overlay_gv_release(void); void func_80322ACC(void); void __overlay_gv_update(void); void func_80322B3C(s32, s32); void __overlay_ttc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322B58(void); +void __overlay_ttc_release(void); void func_80322B78(void); void __overlay_ttc_update(void); void func_80322BB8(s32, s32); void __overlay_mm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322CC8(void); +void __overlay_mm_release(void); void func_80322CD0(void); void __overlay_mm_update(void); void func_80322CE0(s32, s32); void __overlay_bgs_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322D30(void); +void __overlay_bgs_release(void); void func_80322D38(void); void __overlay_bgs_update(void); void func_80322D94(s32, s32); void __overlay_sm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322BD4(void); +void __overlay_sm_release(void); void func_80322BDC(void); void __overlay_sm_update(void); void func_80322BEC(s32, s32); void __overlay_lair_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322C18(void); +void __overlay_lair_release(void); void func_80322C38(void); void __overlay_lair_update(void); void func_80322C78(s32, s32); void __overlay_fight_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322C94(void); +void __overlay_fight_release(void); void func_80322C9C(void); void __overlay_fight_update(void); void func_80322CAC(s32, s32); void __overlay_intro_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322CFC(void); +void __overlay_intro_release(void); void func_80322D04(void); void __overlay_intro_update(void); void func_80322D14(s32, s32); void __overlay_fp_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_80322DB0(void); +void __overlay_fp_release(void); void func_80322DE8(void); void __overlay_fp_update(void); void func_80322E58(s32, s32); @@ -80,10 +80,10 @@ typedef struct{ s16 unk0; u8 unk2; u8 unk3; - void (*unk4)(void); - void (*unk8)(void); - void (*unkC)(void); - void (*unk10)(Gfx **, Mtx **, Vtx **); + void (*init)(void); + void (*update)(void); + void (*release)(void); + void (*draw)(Gfx **, Mtx **, Vtx **); void (*unk14)(s32, s32); } level_overlay_update_struct; @@ -106,17 +106,17 @@ level_overlay_map_elem D_8036E2C0[] = { }; level_overlay_update_struct D_8036E2F8[] = { - { OVERLAY_2_WHALE, 1, 0, func_80322A28, __overlay_cc_update, func_80322A00, __overlay_cc_draw, func_80322A78}, - { OVERLAY_3_HAUNTED, 1, 0, func_80322960, __overlay_mmm_update, func_80322930, __overlay_mmm_draw, func_803229C0}, - { OVERLAY_4_DESERT, 1, 0, func_80322ACC, __overlay_gv_update, func_80322A94, __overlay_gv_draw, func_80322B3C}, - { OVERLAY_5_BEACH, 1, 0, func_80322B78, __overlay_ttc_update, func_80322B58, __overlay_ttc_draw, func_80322BB8}, - { OVERLAY_6_JUNGLE, 1, 0, func_80322CD0, __overlay_mm_update, func_80322CC8, __overlay_mm_draw, func_80322CE0}, - { OVERLAY_7_SWAMP, 1, 0, func_80322D38, __overlay_bgs_update, func_80322D30, __overlay_bgs_draw, func_80322D94}, - { OVERLAY_B_TRAINING, 1, 0, func_80322BDC, __overlay_sm_update, func_80322BD4, __overlay_sm_draw, func_80322BEC}, - { OVERLAY_C_INTRO, 1, 0, func_80322D04, __overlay_intro_update, func_80322CFC, __overlay_intro_draw, func_80322D14}, - { OVERLAY_D_WITCH, 1, 0, func_80322C38, __overlay_lair_update, func_80322C18, __overlay_lair_draw, func_80322C78}, - { OVERLAY_E_BATTLE, 1, 0, func_80322C9C, __overlay_fight_update, func_80322C94, __overlay_fight_draw, func_80322CAC}, - { OVERLAY_9_SNOW, 0, 1, func_80322DE8, __overlay_fp_update, func_80322DB0, __overlay_fp_draw, func_80322E58}, + { OVERLAY_2_WHALE, 1, 0, func_80322A28, __overlay_cc_update, __overlay_cc_release, __overlay_cc_draw, func_80322A78}, + { OVERLAY_3_HAUNTED, 1, 0, func_80322960, __overlay_mmm_update, __overlay_mmm_release, __overlay_mmm_draw, func_803229C0}, + { OVERLAY_4_DESERT, 1, 0, func_80322ACC, __overlay_gv_update, __overlay_gv_release, __overlay_gv_draw, func_80322B3C}, + { OVERLAY_5_BEACH, 1, 0, func_80322B78, __overlay_ttc_update, __overlay_ttc_release, __overlay_ttc_draw, func_80322BB8}, + { OVERLAY_6_JUNGLE, 1, 0, func_80322CD0, __overlay_mm_update, __overlay_mm_release, __overlay_mm_draw, func_80322CE0}, + { OVERLAY_7_SWAMP, 1, 0, func_80322D38, __overlay_bgs_update, __overlay_bgs_release, __overlay_bgs_draw, func_80322D94}, + { OVERLAY_B_TRAINING, 1, 0, func_80322BDC, __overlay_sm_update, __overlay_sm_release, __overlay_sm_draw, func_80322BEC}, + { OVERLAY_C_INTRO, 1, 0, func_80322D04, __overlay_intro_update, __overlay_intro_release, __overlay_intro_draw, func_80322D14}, + { OVERLAY_D_WITCH, 1, 0, func_80322C38, __overlay_lair_update, __overlay_lair_release, __overlay_lair_draw, func_80322C78}, + { OVERLAY_E_BATTLE, 1, 0, func_80322C9C, __overlay_fight_update, __overlay_fight_release, __overlay_fight_draw, func_80322CAC}, + { OVERLAY_9_SNOW, 0, 1, func_80322DE8, __overlay_fp_update, __overlay_fp_release, __overlay_fp_draw, func_80322E58}, {0} }; @@ -125,17 +125,17 @@ struct { u8 unk0; u8 unk1; u8 pad2[2]; - void (*unk4)(void); - void (*unk8)(void); - void (*unkC)(void); - void (*unk10)(Gfx **, Mtx **, Vtx **); + void (*init)(void); + void (*update)(void); + void (*release)(void); + void (*draw)(Gfx **, Mtx **, Vtx **); void (*unk14)(s32, s32); } D_80383350; /* .code */ void __overlay_mmm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322930(void){ +void __overlay_mmm_release(void){ func_8038953C(); MMM_func_80389CD8(); func_8038A994(); @@ -161,7 +161,7 @@ void __overlay_cc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ CC_func_80388760(gfx, mtx, vtx); } -void func_80322A00(void){ +void __overlay_cc_release(void){ func_80388CB4(); func_803880D4(); } @@ -182,7 +182,7 @@ void func_80322A78(s32 arg0, s32 arg1){ return; } void __overlay_gv_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322A94(void){ +void __overlay_gv_release(void){ func_8038FF60(); func_803900F8(); gv_matchingGame_reset(); //gv_matchingGame_reset @@ -207,7 +207,7 @@ void func_80322B3C(s32 arg0, s32 arg1){ return; } void __overlay_ttc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322B58(void){ +void __overlay_ttc_release(void){ func_8038B04C(); } @@ -223,7 +223,7 @@ void func_80322BB8(s32 arg0, s32 arg1){ return; } void __overlay_sm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322BD4(void){ return; } +void __overlay_sm_release(void){ return; } void func_80322BDC(void){ return; } @@ -235,7 +235,7 @@ void __overlay_lair_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ lair_func_8038E768(gfx, mtx, vtx); } -void func_80322C18(void){ +void __overlay_lair_release(void){ lair_func_8038CD48(); } @@ -252,7 +252,7 @@ void func_80322C78(s32 arg0, s32 arg1){ return; } void __overlay_fight_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322C94(void){ return; } +void __overlay_fight_release(void){ return; } void func_80322C9C(void){ return; } @@ -262,7 +262,7 @@ void func_80322CAC(s32 arg0, s32 arg1){ return; } void __overlay_mm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322CC8(void){ return; } +void __overlay_mm_release(void){ return; } void func_80322CD0(void){ return; } @@ -272,7 +272,7 @@ void func_80322CE0(s32 arg0, s32 arg1){ return; } void __overlay_intro_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322CFC(void){ return; } +void __overlay_intro_release(void){ return; } void func_80322D04(void){ return; } @@ -282,7 +282,7 @@ void func_80322D14(s32 arg0, s32 arg1){ return; } void __overlay_bgs_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322D30(void){ return; } +void __overlay_bgs_release(void){ return; } void func_80322D38(void){ if( map_get() == MAP_10_BGS_MR_VILE @@ -299,7 +299,7 @@ void func_80322D94(s32 arg0, s32 arg1){ return; } void __overlay_fp_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } -void func_80322DB0(void){ +void __overlay_fp_release(void){ fp_sirslushgame_end(); fp_snowmanButtonGame_end(); func_8038B8A8(); @@ -323,8 +323,8 @@ void __overlay_fp_update(void){ void func_80322E58(s32 arg0, s32 arg1){ return; } void func_80322E64(Gfx **gfx, Mtx **mtx, Vtx **vtx){ - if(D_80383350.unk10) - D_80383350.unk10(gfx, mtx, vtx); + if(D_80383350.draw) + D_80383350.draw(gfx, mtx, vtx); } enum overlay_e level_to_overlay(enum level_e lvl){ @@ -337,14 +337,14 @@ enum overlay_e level_to_overlay(enum level_e lvl){ } void func_80322EDC(int arg0){ - if(arg0 == D_80383350.unk1 && D_80383350.unkC){ - D_80383350.unkC(); + if(arg0 == D_80383350.unk1 && D_80383350.release){ + D_80383350.release(); } } void func_80322F1C(int arg0){ - if(arg0 == D_80383350.unk0 && D_80383350.unk4){ - D_80383350.unk4(); + if(arg0 == D_80383350.unk0 && D_80383350.init){ + D_80383350.init(); } } @@ -371,17 +371,17 @@ void func_80322FE4(void){ s32 overlay_id; func_80356714(); overlay_id = overlayManagergetLoadedId(); - D_80383350.unk4 = D_80383350.unk8 = D_80383350.unkC = NULL; - D_80383350.unk10 = NULL; + D_80383350.init = D_80383350.update = D_80383350.release = NULL; + D_80383350.draw = NULL; D_80383350.unk14 = NULL; for(i = 0; D_8036E2F8[i].unk0 != 0; i++){ if(overlay_id == D_8036E2F8[i].unk0){ D_80383350.unk0 = D_8036E2F8[i].unk2; D_80383350.unk1 = D_8036E2F8[i].unk3; - D_80383350.unk4 = D_8036E2F8[i].unk4; - D_80383350.unk8 = D_8036E2F8[i].unk8; - D_80383350.unkC = D_8036E2F8[i].unkC; - D_80383350.unk10 = D_8036E2F8[i].unk10; + D_80383350.init = D_8036E2F8[i].init; + D_80383350.update = D_8036E2F8[i].update; + D_80383350.release = D_8036E2F8[i].release; + D_80383350.draw = D_8036E2F8[i].draw; D_80383350.unk14 = D_8036E2F8[i].unk14; break; } @@ -394,6 +394,6 @@ void func_80323098(s32 arg0, s32 arg1){ } void overlay_update(void){ - if(D_80383350.unk8) - D_80383350.unk8(); + if(D_80383350.update) + D_80383350.update(); } diff --git a/src/core2/code_ABC00.c b/src/core2/code_ABC00.c index f0f060ff..5f686538 100644 --- a/src/core2/code_ABC00.c +++ b/src/core2/code_ABC00.c @@ -19,19 +19,19 @@ void func_80347FB8(Struct81s*); typedef struct { - void (*unk0)(Struct81s *); - void (*unk4)(Struct81s *); - void (*unk8)(Struct81s *, Gfx**, Mtx **, Vtx **); - void (*unkC)(Struct81s *); + void (*init)(Struct81s *); + void (*update)(Struct81s *); + void (*draw)(Struct81s *, Gfx**, Mtx **, Vtx **); + void (*free)(Struct81s *); Struct81s unk10; }Struct_core2_ABC00_0; void func_803331D8(enum jiggy_e, f32[3]); -void func_803332D0(Actor *); +void jiggy_free(Actor *); /* .data */ u8 D_8036E830 = 0; -Struct_core2_ABC00_0 D_8036E834[] = { +Struct_core2_ABC00_0 jiggylist_list[] = { {func_80347E34, func_80347E60, func_80347FA4, func_80347FB8, {0x7, NULL, {0.0f, 0.0f, 0.0f}, NULL, NULL}}, {func_80347B54, func_80347B80, func_80347C5C, func_80347C70, {0, NULL, {0.0f, 0.0f, 0.0f}, NULL, NULL}}, {func_80347B54, func_80347B80, func_80347C5C, func_80347C70, {0, NULL, {0.0f, 0.0f, 0.0f}, NULL, NULL}}, @@ -135,10 +135,10 @@ Struct_core2_ABC00_0 D_8036E834[] = { }; /* .bss */ -s32 D_80383560; -s32 D_80383564; -s32 D_80383568; -s32 D_8038356C; +s32 s_jiggyList_level_start_index; +s32 s_jiggyList_level_end_index; +s32 s_jiggyList_level_jiggy_count; +s32 s_jiggylist_current_index; /* .code */ void func_80332B90(void){ @@ -150,34 +150,34 @@ void func_80332BB0(void) { func_8025A55C(-1, 4000, 5); } -void func_80332BEC(enum map_e map_id) { +void jiggylist_set_level(enum map_e map_id) { s32 temp_a2; s32 temp_at; s32 temp_hi; s32 temp_lo; s32 temp_t4; - s32 var_a1; + s32 level_index; s32 var_v1; s32 var_v0; - var_v1 = (map_getLevel(map_id) - 1) % (D_80383568 = 0xA); - var_a1 = MAX(0, var_v1); - D_80383560 = var_a1 * 0xA; - D_80383564 = (var_a1 + 1) * 0xA; - for(D_8038356C = D_80383560; D_8038356C < D_80383564; D_8038356C++){ - D_8036E834[D_8038356C].unk10.marker = NULL; + var_v1 = (map_getLevel(map_id) - 1) % (s_jiggyList_level_jiggy_count = 0xA); + level_index = MAX(0, var_v1); + s_jiggyList_level_start_index = level_index * 0xA; + s_jiggyList_level_end_index = (level_index + 1) * 0xA; + for(s_jiggylist_current_index = s_jiggyList_level_start_index; s_jiggylist_current_index < s_jiggyList_level_end_index; s_jiggylist_current_index++){ + jiggylist_list[s_jiggylist_current_index].unk10.marker = NULL; } D_8036E830 = 0; } -void func_80332CCC(void) { - Actor **temp_v0; +void jiggylist_map_actors(void) { + Actor **jiggy_actors; s32 i; - temp_v0 = actorArray_findJiggyActors(); - for(D_8038356C = 0; temp_v0[D_8038356C] != NULL; D_8038356C++){ - if(!temp_v0[D_8038356C]->unk44_2){ - D_8036E834[chjiggy_getJiggyId(temp_v0[D_8038356C]) - 1].unk10.marker = temp_v0[D_8038356C]->marker; + jiggy_actors = actorArray_findJiggyActors(); + for(s_jiggylist_current_index = 0; jiggy_actors[s_jiggylist_current_index] != NULL; s_jiggylist_current_index++){ + if(!jiggy_actors[s_jiggylist_current_index]->unk44_2){ + jiggylist_list[chjiggy_getJiggyId(jiggy_actors[s_jiggylist_current_index]) - 1].unk10.marker = jiggy_actors[s_jiggylist_current_index]->marker; } } } @@ -200,10 +200,10 @@ void func_80332E08(void) { s32 var_v0; void *temp_v1; - for(D_8038356C = D_80383560; D_8038356C < D_80383564; D_8038356C++) { - if (D_8036E834[D_8038356C].unk10.marker != NULL) { - D_8036E834[D_8038356C].unk4(&D_8036E834[D_8038356C].unk10); - var_v0 = D_8038356C; + for(s_jiggylist_current_index = s_jiggyList_level_start_index; s_jiggylist_current_index < s_jiggyList_level_end_index; s_jiggylist_current_index++) { + if (jiggylist_list[s_jiggylist_current_index].unk10.marker != NULL) { + jiggylist_list[s_jiggylist_current_index].update(&jiggylist_list[s_jiggylist_current_index].unk10); + var_v0 = s_jiggylist_current_index; } } func_80332D98(MAP_69_GL_MM_LOBBY, JIGGY_34_LAIR_MM_WITCH_SWITCH, FILEPROG_18_MM_WITCH_SWITCH_JIGGY_PRESSED, 0x205); @@ -217,32 +217,32 @@ void func_80332E08(void) { D_8036E830 = 1; } -void func_80332F4C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { - for(D_8038356C = D_80383560; D_8038356C < D_80383564; D_8038356C++) { - if (D_8036E834[D_8038356C].unk10.marker != NULL) { - D_8036E834[D_8038356C].unk8(&D_8036E834[D_8038356C].unk10, gfx, mtx, vtx); +void jiggylist_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + for(s_jiggylist_current_index = s_jiggyList_level_start_index; s_jiggylist_current_index < s_jiggyList_level_end_index; s_jiggylist_current_index++) { + if (jiggylist_list[s_jiggylist_current_index].unk10.marker != NULL) { + jiggylist_list[s_jiggylist_current_index].draw(&jiggylist_list[s_jiggylist_current_index].unk10, gfx, mtx, vtx); } } } void func_8033301C(void) { - for(D_8038356C = D_80383560; D_8038356C < D_80383564; D_8038356C++) { - if (D_8036E834[D_8038356C].unk10.marker != NULL) { - func_803332D0(marker_getActor(D_8036E834[D_8038356C].unk10.marker)); + for(s_jiggylist_current_index = s_jiggyList_level_start_index; s_jiggylist_current_index < s_jiggyList_level_end_index; s_jiggylist_current_index++) { + if (jiggylist_list[s_jiggylist_current_index].unk10.marker != NULL) { + jiggy_free(marker_getActor(jiggylist_list[s_jiggylist_current_index].unk10.marker)); } } } -void jiggySpawn(enum jiggy_e jiggy_id, f32 pos[3]) { +void jiggy_spawn(enum jiggy_e jiggy_id, f32 pos[3]) { Struct_core2_ABC00_0 *temp_v0; - jiggy_id = ((jiggy_id <= 0) || (jiggy_id >= (D_80383568 * 10))) ? 10 : jiggy_id; - temp_v0 = &D_8036E834[jiggy_id - 1]; - if (D_8036E834[jiggy_id - 1].unk10.marker == NULL) { + jiggy_id = ((jiggy_id <= 0) || (jiggy_id >= (s_jiggyList_level_jiggy_count * 10))) ? JIGGY_A_MM_CONGA : jiggy_id; + temp_v0 = &jiggylist_list[jiggy_id - 1]; + if (jiggylist_list[jiggy_id - 1].unk10.marker == NULL) { temp_v0->unk10.position[0] = pos[0]; temp_v0->unk10.position[1] = pos[1]; temp_v0->unk10.position[2] = pos[2]; - temp_v0->unk0(&temp_v0->unk10); + temp_v0->init(&temp_v0->unk10); jiggyscore_setSpawned(jiggy_id, TRUE); if (!jiggyscore_isCollected(jiggy_id) && (jiggy_id != JIGGY_3E_GV_GRABBA) && (jiggy_id != JIGGY_0B_TTC_JINJO)) { func_8024BD08(0); @@ -254,53 +254,53 @@ void jiggySpawn(enum jiggy_e jiggy_id, f32 pos[3]) { } void func_803331D8(enum jiggy_e jiggy_id, f32 arg1[3]) { - jiggy_id = ((jiggy_id <= 0) || (jiggy_id >= (D_80383568 * 10))) ? JIGGY_A_MM_CONGA : jiggy_id; + jiggy_id = ((jiggy_id <= 0) || (jiggy_id >= (s_jiggyList_level_jiggy_count * 10))) ? JIGGY_A_MM_CONGA : jiggy_id; - D_8036E834[jiggy_id - 1].unk10.position[0] = arg1[0]; - D_8036E834[jiggy_id - 1].unk10.position[1] = arg1[1]; - D_8036E834[jiggy_id - 1].unk10.position[2] = arg1[2]; - D_8036E834[jiggy_id - 1].unk0(&D_8036E834[jiggy_id - 1].unk10); + jiggylist_list[jiggy_id - 1].unk10.position[0] = arg1[0]; + jiggylist_list[jiggy_id - 1].unk10.position[1] = arg1[1]; + jiggylist_list[jiggy_id - 1].unk10.position[2] = arg1[2]; + jiggylist_list[jiggy_id - 1].init(&jiggylist_list[jiggy_id - 1].unk10); jiggyscore_setSpawned(jiggy_id, TRUE); } void func_80333270(enum jiggy_e jiggy_id, f32 position[3], void (*method)(Actor *, ActorMarker *), ActorMarker *other_marker) { Struct_core2_ABC00_0 *ptr; - ptr = &D_8036E834[jiggy_id - 1]; - jiggySpawn(jiggy_id, position); + ptr = &jiggylist_list[jiggy_id - 1]; + jiggy_spawn(jiggy_id, position); ptr->unk10.unk14 = method; ptr->unk10.unk18 = other_marker; } -void func_803332D0(Actor *arg0) +void jiggy_free(Actor *arg0) { s32 indx = chjiggy_getJiggyId(arg0) - 1; - Struct81s *sp18 = &D_8036E834[indx].unk10; - if (D_8036E834[indx].unkC) + Struct81s *sp18 = &jiggylist_list[indx].unk10; + if (jiggylist_list[indx].free) { } - D_8036E834[indx].unkC(sp18); + jiggylist_list[indx].free(sp18); sp18->marker = 0; } void func_80333334(enum jiggy_e jiggy_id) { Struct_core2_ABC00_0 *temp_v0; - temp_v0 = &D_8036E834[jiggy_id - 1]; - temp_v0->unk0 = func_80347B54; - temp_v0->unk4 = func_80347B80; - temp_v0->unk8 = func_80347C5C; - temp_v0->unkC = func_80347C70; + temp_v0 = &jiggylist_list[jiggy_id - 1]; + temp_v0->init = func_80347B54; + temp_v0->update = func_80347B80; + temp_v0->draw = func_80347C5C; + temp_v0->free = func_80347C70; } void func_80333388(enum jiggy_e jiggy_id) { Struct_core2_ABC00_0 *temp_v0; - temp_v0 = &D_8036E834[jiggy_id - 1]; - temp_v0->unk0 = func_80347CC8; - temp_v0->unk4 = func_80347CF4; - temp_v0->unk8 = func_80347DD0; - temp_v0->unkC = func_80347DE4; + temp_v0 = &jiggylist_list[jiggy_id - 1]; + temp_v0->init = func_80347CC8; + temp_v0->update = func_80347CF4; + temp_v0->draw = func_80347DD0; + temp_v0->free = func_80347DE4; } @@ -311,8 +311,8 @@ void func_803333DC(Struct81s *arg0, Actor *arg1) { if (arg0->unk14 != NULL) { arg0->unk14(arg1, arg0->unk18); } - marker_setFreeMethod(arg1->marker, func_803332D0); - jiggy_id = ((s32) ((s32)arg0 - (s32)&D_8036E834) / 0x2C) + 1; + marker_setFreeMethod(arg1->marker, jiggy_free); + jiggy_id = ((s32) ((s32)arg0 - (s32)&jiggylist_list) / 0x2C) + 1; chjiggy_setJiggyId(arg1, jiggy_id); if ((jiggy_id == JIGGY_49_CCW_EYRIE) || (jiggy_id == JIGGY_39_LAIR_MMM_WITCH_SWITCH) || (jiggy_id == JIGGY_3C_LAIR_CCW_WITCH_SWITCH)) { arg1->marker->unk40_21 = TRUE; diff --git a/src/core2/code_AD0.c b/src/core2/code_AD0.c deleted file mode 100644 index 933b0e5b..00000000 --- a/src/core2/code_AD0.c +++ /dev/null @@ -1,156 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - - -/* .bss */ -u8 D_80379B90[0x10]; -struct54s D_80379BA0[40]; - -/* .code */ -void func_80287A60(struct54s *arg0){ - arg0->unk4 += arg0->unk0[arg0->unkC_24].unk1*(1.0/30.0)*arg0->unk8; -} - -void func_80287ACC(struct54s *arg0){ - arg0->unk4 -= time_getDelta(); - while(arg0->unk4 <= 0.0f){ - arg0->unkC_24++; - if(arg0->unkC_24 >= arg0->unkC_31) - arg0->unkC_24 = 0; - func_80287A60(arg0); - } -} - -void func_80287B84(struct54s *arg0){ - arg0->unk4 -= time_getDelta(); - while(arg0->unk4 <= 0.0f){ - arg0->unkC_24++; - if(arg0->unkC_31 <= arg0->unkC_24){ - arg0->unkC_24--; - arg0->unkC_3 = 3; - } - func_80287A60(arg0); - } -} - -void func_80287C58(void){ - int i; - for(i = 0; i < 40; i++){ - D_80379BA0[i].unkC_0 = 0; - } -} - -struct54s * func_80287CA8(void){ - int i; - for(i = 0; i < 40; i++){ - if(!D_80379BA0[i].unkC_0){ - D_80379BA0[i].unkC_0 = 1; - D_80379BA0[i].unkC_24 = 0; - D_80379BA0[i].unkC_3 = 0; - D_80379BA0[i].unkC_31 = 1; - D_80379BA0[i].unkC_17 = 0; - D_80379BA0[i].unk0 = 0; - D_80379BA0[i].unkC_1 = 1; - D_80379BA0[i].unk4 = 0.0f; - D_80379BA0[i].unk8 = 1.0f; - D_80379BA0[i].unkC_10 = 0; - return &D_80379BA0[i]; - } - } - return NULL; -} - -void func_80287D60(struct54s *arg0){ - arg0->unkC_0 = 0; -} - -void func_80287D70(void){ - int i; - for(i = 0; i < 40; i++){ - if(D_80379BA0[i].unkC_0){ - func_80287D60(&D_80379BA0[i]); - } - } -} - -void func_80287DC8(struct54s *arg0){ - switch(arg0->unkC_3){ - case 0: - break; - case 1: - func_80287B84(arg0); - arg0->unkC_10 = arg0->unk0[arg0->unkC_24].unk0; - break; - case 2: - func_80287ACC(arg0); - arg0->unkC_10 = arg0->unk0[arg0->unkC_24].unk0; - break; - case 3: - break; - } -} - -void func_80287E9C(struct54s *arg0){ - arg0->unkC_24 = 0; - arg0->unk4 = 0.0f; - func_80287F50(arg0, 0, 1); - func_80287FD0(arg0, 1.0f); - func_80287FDC(arg0, 0); - func_80287F7C(arg0, 2); - func_80287F98(arg0, 1); -} - -void func_80287F10(struct54s *arg0){ - arg0->unkC_24 = arg0->unkC_17; - func_80287A60(arg0); -} - -void func_80287F50(struct54s *arg0, struct53s *arg1, s32 arg2){ - arg0->unk0 = arg1; - arg0->unkC_31 = arg2/2; -} - -void func_80287F7C(struct54s *arg0, s32 arg1){ - arg0->unkC_3 = arg1; -} - -void func_80287F98(struct54s *arg0, s32 arg1){ - arg0->unkC_1 = arg1; -} - -void func_80287FB4(struct54s *arg0, s32 arg1){ - arg0->unkC_10 = arg1; -} - -void func_80287FD0(struct54s *arg0, f32 arg1){ - arg0->unk8 = arg1; -} - -void func_80287FDC(struct54s *arg0, s32 arg1){ - arg0->unkC_17 = arg1; -} - -s32 func_80287FFC(struct54s *arg0){ - return arg0->unkC_10; -} - -s32 func_8028800C(struct54s *arg0){ - return arg0->unkC_3; -} - -s32 func_8028801C(struct54s *arg0){ - return arg0->unkC_1; -} - -f32 func_8028802C(struct54s *arg0){ - return arg0->unk8; -} - -int func_80288034(struct54s *arg0){ - return func_8028800C(arg0) == 3; -} - -int func_80288058(struct54s *arg0, s32 arg1){ - return arg0->unkC_24 == arg1; -} diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c index c40de0e9..718e9aa7 100644 --- a/src/core2/code_AD5B0.c +++ b/src/core2/code_AD5B0.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" #include "core2/particle.h" - +#include "core2/anim/sprite.h" /* .data */ extern u8 D_80370250 = 0; @@ -43,39 +43,39 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) { func_802BBD2C(&sp44, &sp40); func_8024CE60(sp44, sp40); func_8024C904(gdl, mptr); - if (func_80309F78() != 0) { + if (mapModel_has_xlu_bin() != 0) { mapModel_opa_draw(gdl, mptr, vptr); - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_80322E64(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { player_draw(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_80302C94(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { - func_80332F4C(gdl, mptr, vptr); + if (game_is_frozen() == 0) { + jiggylist_draw(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_803500D8(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_802F2ED0(func_8032994C(), gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { partEmitMgr_drawPass0(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { mapModel_xlu_draw(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_8032D3D8(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { partEmitMgr_drawPass1(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_8034F6F0(gdl, mptr, vptr); } func_802D520C(gdl, mptr, vptr); @@ -86,16 +86,16 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) { player_draw(gdl, mptr, vptr); func_80302C94(gdl, mptr, vptr); func_8032D3D8(gdl, mptr, vptr); - func_80332F4C(gdl, mptr, vptr); + jiggylist_draw(gdl, mptr, vptr); func_803500D8(gdl, mptr, vptr); func_802F2ED0(func_8032994C(), gdl, mptr, vptr); func_802D520C(gdl, mptr, vptr); partEmitMgr_draw(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_80350818(gdl, mptr, vptr); } - if (func_802E49F0() == 0) { + if (game_is_frozen() == 0) { func_802BBD0C(gdl, mptr, vptr); } spawnQueue_lock(); @@ -144,7 +144,7 @@ void func_80334910(void) { func_8033E184(); func_8033FA24(); func_80344C80(); - func_80287D70(); + animsprite_terminate(); animBinCache_free(); func_802BC10C(); ncCameraNodeList_free(); @@ -222,7 +222,7 @@ void func_80334B20(enum map_e arg0, s32 arg1, s32 arg2) { func_80323230(); commonParticleType_init(); animBinCache_init(); - func_80287C58(); + animsprite_init(); func_80344C50(); func_8033F9C0(); ncCameraNodeList_init(); @@ -351,7 +351,7 @@ s32 func_80334ECC(void) { overlay_update(); func_80321924(); func_80334428(); - func_8031C880(); + cutscenetrigger_update(); func_802D2CDC(); func_803306C8(1); func_8032AD7C(1); diff --git a/src/core2/code_AE290.c b/src/core2/code_AE290.c index 73afd2d0..fde2f575 100644 --- a/src/core2/code_AE290.c +++ b/src/core2/code_AE290.c @@ -3,7 +3,7 @@ #include "variables.h" #include "n_libaudio.h" -extern ALBank *func_8024F758(void); +extern ALBank *music_get_sound_bank(void); extern u8 D_D846C0; extern u8 D_D954B0; @@ -15,7 +15,7 @@ struct { ALHeap *unkC; //heap s16 unk10; } D_803835F0; -ALBank * D_80383604; +ALBank * sfx_sound_bank; /* .code */ void sfxInstruments_init(void){ @@ -39,25 +39,25 @@ void sfxInstruments_init(void){ D_803835F0.unk8 = 0x18; D_803835F0.unkC = func_802405B8(); func_80243070(&D_803835F0); - D_80383604 = bnk; + sfx_sound_bank = bnk; } int func_8033531C(enum sfx_e uid, struct46s *arg1){ - return func_80244608(D_80383604, (s16) (uid + 1), arg1); + return func_80244608(sfx_sound_bank, (s16) (uid + 1), arg1); } int func_80335354(int uid, struct46s *arg1){ - return func_80244608(func_8024F758(), (s16) (uid + 1), arg1); + return func_80244608(music_get_sound_bank(), (s16) (uid + 1), arg1); } void func_80335394(s32 arg0, f32 arg1){ - func_80244978(arg0, 0x10, reinterpret_cast(s32, arg1)); + func_80244978(arg0, AL_SEQP_STOP_EVT, reinterpret_cast(s32, arg1)); } void func_803353BC(s32 arg0, u16 arg1){ if(arg1 > 0x7fff) arg1 = 0x7fff; - func_80244978(arg0, 0x8, arg1); + func_80244978(arg0, AL_SEQP_PROG_EVT, arg1); } void func_803353F4(s32 arg0, s32 arg1){ @@ -65,7 +65,7 @@ void func_803353F4(s32 arg0, s32 arg1){ } void func_80335418(s32 arg0, s32 arg1){ - func_80244978(arg0, 0x4, arg1); + func_80244978(arg0, AL_SEQ_END_EVT, arg1); } void func_8033543C(Struct81s *arg0){ @@ -83,17 +83,17 @@ u32 func_80335494(Struct81s *arg0){ } s32 func_803354B4(void){ - return D_80383604->instArray[0]->soundCount; + return sfx_sound_bank->instArray[0]->soundCount; } s32 func_803354C8(void){ - return func_8024F758()->instArray[0]->soundCount; + return music_get_sound_bank()->instArray[0]->soundCount; } bool func_803354EC(enum sfx_e sfx_id){ - return func_802445C4(D_80383604, (s16)(sfx_id + 1)); + return func_802445C4(sfx_sound_bank, (s16)(sfx_id + 1)); } bool func_80335520(s32 arg0){ - return func_802445C4(func_8024F758(), (s16)(arg0 + 1)); + return func_802445C4(music_get_sound_bank(), (s16)(arg0 + 1)); } diff --git a/src/core2/code_B5E00.c b/src/core2/code_B5E00.c index e042dc6a..b339f91c 100644 --- a/src/core2/code_B5E00.c +++ b/src/core2/code_B5E00.c @@ -16,12 +16,12 @@ int __gameFile_8033CD90(s32 filenum){ void *save_data_ptr; save_data_ptr = &gameFile_saveData[filenum]; i = 3; - while(i != 0){ + do{ tmp_v1 = savedata_8033CA2C(filenum, save_data_ptr); if(!tmp_v1) break; i--; - } + }while(i != 0); if(tmp_v1) savedata_clear(save_data_ptr); return tmp_v1; @@ -32,34 +32,39 @@ void __gameFile_8033CE14(s32 gamenum){ } void gameFile_8033CE40(void) { - s32 i; - s32 var_s0; - s32 sp48[4]; + s32 game_index; + s32 file_index; + s32 file_state[4]; - + //unmap all files D_80383F04 = -1; - sp48[3] = i = 0; - if (sp48[3] < 3) { - for(i = i; i < 3; i++) { - gameFile_GameIdToFileIdMap[i] = -1; - sp48[i] = 0; - i++; i--; //do nothing + file_state[3] = game_index = 0; + if (file_state[3] < 3) { + for(game_index = game_index; game_index < 3; game_index++) { + gameFile_GameIdToFileIdMap[game_index] = -1; + file_state[game_index] = 0; + game_index++; game_index--; //do nothing } } - for(var_s0 = 0; var_s0 < 4; var_s0++){ - if( (__gameFile_8033CD90(var_s0) == 0) && (gameFile_GameIdToFileIdMap[gameFile_saveData[var_s0].unk1 - 1] == -1)) { - gameFile_GameIdToFileIdMap[gameFile_saveData[var_s0].unk1 - 1] = var_s0; - sp48[var_s0] = 1; + + //map games to files + for(file_index = 0; file_index < 4; file_index++){ + if( (__gameFile_8033CD90(file_index) == 0) + && (gameFile_GameIdToFileIdMap[gameFile_saveData[file_index].unk1 - 1] == -1) + ) { + gameFile_GameIdToFileIdMap[gameFile_saveData[file_index].unk1 - 1] = file_index; + file_state[file_index] = 1; } else { - D_80383F04 = var_s0; + D_80383F04 = file_index; } } - sp48[D_80383F04] = 1; - for(i = 0; i < 3; i++){ - for(var_s0 = 0; (var_s0 < 4) && (gameFile_GameIdToFileIdMap[i] == -1); var_s0++){ - if (sp48[var_s0] == 0) { - sp48[var_s0] = 1; - gameFile_GameIdToFileIdMap[i] = var_s0; + + file_state[D_80383F04] = 1; + for(game_index = 0; game_index < 3; game_index++){ + for(file_index = 0; (file_index < 4) && (gameFile_GameIdToFileIdMap[game_index] == -1); file_index++){ + if (file_state[file_index] == 0) { + file_state[file_index] = 1; + gameFile_GameIdToFileIdMap[game_index] = file_index; } } } @@ -70,18 +75,18 @@ s32 gameFile_8033CFD4(s32 gamenum){ s32 filenum; u32 i = 3; s32 eeprom_error; - SaveData *var_a1; + SaveData *save_data; filenum = D_80383F04; next = gameFile_GameIdToFileIdMap[gamenum]; gameFile_GameIdToFileIdMap[gamenum] = D_80383F04; bcopy(&gameFile_saveData[next], &gameFile_saveData[filenum], 0xF*8); - var_a1 = gameFile_saveData + filenum; - var_a1->unk1 = gamenum + 1; - savedata_update_crc(var_a1, sizeof(SaveData)); + save_data = gameFile_saveData + filenum; + save_data->unk1 = gamenum + 1; + savedata_update_crc(save_data, sizeof(SaveData)); for(eeprom_error = 1; eeprom_error && i > 0; i--){//L8033D070 - eeprom_error = savedata_8033CC98(filenum, var_a1); + eeprom_error = savedata_8033CC98(filenum, save_data); if(!eeprom_error){ __gameFile_8033CE14(gamenum); } diff --git a/src/core2/code_B6EA0.c b/src/core2/code_B6EA0.c index 4afb40fd..22cd0e4c 100644 --- a/src/core2/code_B6EA0.c +++ b/src/core2/code_B6EA0.c @@ -1,8 +1,9 @@ +#include "code_B6EA0.h" #include #include "functions.h" #include "variables.h" -#include "code_B6EA0.h" +#include "core2/anim/sprite.h" extern s32 func_8033FA84(void); extern s32 func_8035287C(void); @@ -13,7 +14,6 @@ extern void func_8033FFB8(s32 , s32); extern void projectile_getPosition(s32 , f32[3]); extern void func_8032F64C(f32[3] , ActorMarker *); extern void func_8033FB64(s32); -extern void func_80287D60(s32); extern void func_803529DC(s32); extern void func_80344D70(s32); extern void func_80352B20(s32); @@ -153,8 +153,8 @@ void func_8033E1E0(void){ projectile_getPosition(D_80384490[D_80384FD0].unk45, sp4C); func_803451B0(D_80384490[D_80384FD0].unk47, sp4C); projectile_setPosition(D_80384490[D_80384FD0].unk45, sp4C); - func_80287DC8(D_80384490[D_80384FD0].unk34); - func_8033FFB8(D_80384490[D_80384FD0].unk45, func_80287FFC(D_80384490[D_80384FD0].unk34)); + animsprite_update(D_80384490[D_80384FD0].unk34); + func_8033FFB8(D_80384490[D_80384FD0].unk45, animsprite_get_frame(D_80384490[D_80384FD0].unk34)); func_8032F64C(sp4C, D_80384490[D_80384FD0].marker_30); } else{ @@ -192,7 +192,7 @@ int func_8033E3F0(enum common_particle_e particle_id, int arg1){ D_80384490[D_80384FD0].unk45 = func_8033FA84(); - D_80384490[D_80384FD0].unk34 = func_80287CA8(); + D_80384490[D_80384FD0].unk34 = animsprite_new(); D_80384490[D_80384FD0].unk46 = func_8035287C(); D_80384490[D_80384FD0].unk47 = func_80344CDC(); @@ -207,7 +207,7 @@ int func_8033E3F0(enum common_particle_e particle_id, int arg1){ } a0 = D_80384490[D_80384FD0].unk34; if(a0){ - func_80287D60(a0); + animsprite_free(a0); } a0 = D_80384490[D_80384FD0].unk46; if(a0){ @@ -227,7 +227,7 @@ int func_8033E3F0(enum common_particle_e particle_id, int arg1){ func_8032FFEC(D_80384490[D_80384FD0].marker_30, (u32)D_80384FD0); D_80384490[D_80384FD0].marker_30->collidable = FALSE; func_80352A38(D_80384490[D_80384FD0].unk46, particle_id); - func_8033FFB8(D_80384490[D_80384FD0].unk45, func_80287FFC(D_80384490[D_80384FD0].unk34)); + func_8033FFB8(D_80384490[D_80384FD0].unk45, animsprite_get_frame(D_80384490[D_80384FD0].unk34)); projectile_getPosition(D_80384490[D_80384FD0].unk45, sp34); func_8032F64C(sp34, D_80384490[D_80384FD0].marker_30); return D_80384FD0; @@ -238,7 +238,7 @@ void func_8033E6D4(s32 arg0){ func_803529DC(D_80384490[arg0].unk46); func_80344D70(D_80384490[arg0].unk47); func_8033FB64(D_80384490[arg0].unk45); - func_80287D60(D_80384490[arg0].unk34); + animsprite_free(D_80384490[arg0].unk34); marker_free(D_80384490[arg0].marker_30); D_80384490[arg0].marker_30 = NULL; D_80384490[arg0].unk38 = 0; @@ -288,7 +288,7 @@ u8 func_8033E8D0(void){ return D_80384490[D_80384FD0].unk45; } -struct54s * func_8033E8F4(void){ +AnimSprite * func_8033E8F4(void){ return D_80384490[D_80384FD0].unk34; } diff --git a/src/core2/code_B6EA0.h b/src/core2/code_B6EA0.h index 9835bedb..8a883ccb 100644 --- a/src/core2/code_B6EA0.h +++ b/src/core2/code_B6EA0.h @@ -4,6 +4,7 @@ #include #include "functions.h" #include "variables.h" +#include "core2/anim/sprite.h" typedef s32 (*FuncUnk40)(ActorMarker *, s32, f32[3]); @@ -16,7 +17,7 @@ typedef struct particle_struct_1_s{ s32 unk28; u8 pad24[0x4]; ActorMarker *marker_30; - struct54s *unk34; + AnimSprite *unk34; ActorMarker *unk38; s32 unk3C; FuncUnk40 unk40; @@ -39,7 +40,7 @@ typedef struct particle_struct_0_s{ s32 unk28; u8 pad24[0x4]; ActorMarker *marker_30; - struct54s *unk34; + AnimSprite *unk34; ActorMarker *unk38; s32 unk3C; FuncUnk40 unk40; @@ -52,7 +53,7 @@ typedef struct particle_struct_0_s{ ActorMarker *func_8033E864(void); FuncUnk40 func_8033E888(void); u8 func_8033E8D0(void); -struct54s *func_8033E8F4(void); +AnimSprite *func_8033E8F4(void); ParticleStruct0s *func_8033E960(void); void func_8033E984(void); void projectile_setSprite(u8, enum asset_e); diff --git a/src/core2/code_C8760.c b/src/core2/code_C8760.c index 75ffb6d5..57110965 100644 --- a/src/core2/code_C8760.c +++ b/src/core2/code_C8760.c @@ -55,8 +55,8 @@ void func_8034F774(void){ sfxsource_setSfxId(D_803720A0.unk5, 0x3EC); func_8030DD14(D_803720A0.unk5, 3); func_8030DFF0(D_803720A0.unk5, 1); - func_8030DF68(D_803720A0.unk5, &sp44); - func_8030DEB4(D_803720A0.unk5, 400.0f, 3200.0f); + sfxsource_set_position(D_803720A0.unk5, &sp44); + sfxsource_set_fade_distances(D_803720A0.unk5, 400.0f, 3200.0f); func_8030DE44(D_803720A0.unk5, 2, 0.5f); func_8030E2C4(D_803720A0.unk5); } diff --git a/src/core2/code_CB610.c b/src/core2/code_CB610.c index 8d1c1ba4..4134a9a3 100644 --- a/src/core2/code_CB610.c +++ b/src/core2/code_CB610.c @@ -2,6 +2,8 @@ #include "functions.h" #include "variables.h" + +#include "core2/anim/sprite.h" #include "code_B6EA0.h" extern u8 func_8033E8D0(void); @@ -27,7 +29,7 @@ void func_80352614(void){} void func_8035261C(void) { ParticleStruct0s *sp2C; u8 sp2B; - struct54s *sp24; + AnimSprite *sp24; u8 sp23; s32 sp1C; f32 temp_f6; @@ -43,8 +45,8 @@ void func_8035261C(void) { projectile_setSprite(sp2B, ASSET_718_SPRITE_SPARKLE_WHITE_2); func_8033FFE4(sp2B, sp1C, sp1C); func_8033FCD8(sp2B, 0xC); - func_80287E9C(sp24); - func_80287F7C(sp24, 3); + animsprite_default(sp24); + animsprite_set_state(sp24, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp23, 3); } diff --git a/src/core2/code_CBD10.c b/src/core2/code_CBD10.c index 20807352..e2da7b97 100644 --- a/src/core2/code_CBD10.c +++ b/src/core2/code_CBD10.c @@ -2,6 +2,8 @@ #include "functions.h" #include "variables.h" + +#include "core2/anim/sprite.h" #include "code_B6EA0.h" extern f32 func_8033DDEC(void); @@ -13,7 +15,7 @@ extern void func_80344D94(u8, f32[3]); extern void func_80344E3C(u8, f32[3]); /* .data */ -struct53s D_80372670[] = { +AnimSpriteStep D_80372670[] = { { 0x0, 1}, { 0x1, 1}, { 0x2, 1}, @@ -68,7 +70,7 @@ s32 func_80352D9C(void) { void func_80352DE4(void) { u8 temp_s0; - struct54s *sp58; + AnimSprite *sp58; u8 sp57; ParticleStruct0s *temp_s1; f32 sp44[3]; @@ -92,10 +94,10 @@ void func_80352DE4(void) { sp2C[1] = 0.0f; sp2C[2] = randf() * 359.0f; func_8033FD98(temp_s0, sp2C); - func_80287E9C(sp58); - func_80287F7C(sp58, 1); - func_80287F50(sp58, D_80372670, 0x28); - func_80287F10(sp58); + animsprite_default(sp58); + animsprite_set_state(sp58, ANIM_SPRITE_STATE_ONCE); + animsprite_set_steps(sp58, D_80372670, sizeof(D_80372670)); + animsprite_loop(sp58); sp38[0] = 0.0f; sp38[1] = 40.0f; sp38[2] = 0.0f; @@ -107,10 +109,10 @@ void func_80352DE4(void) { void func_80352F58(void){ f32 *sp2C = func_8033E960(); - struct54s *sp28 = func_8033E8F4(); + AnimSprite *sp28 = func_8033E8F4(); u8 sp27 = func_8033E8D0(); f32 sp20 = func_8033DDEC(); - if(func_80288034(sp28)){ + if(animsprite_is_stopped(sp28)){ func_8033E984(); } else{ diff --git a/src/core2/code_CC1E0.c b/src/core2/code_CC1E0.c index 9d97997f..ae89d5ed 100644 --- a/src/core2/code_CC1E0.c +++ b/src/core2/code_CC1E0.c @@ -3,6 +3,7 @@ #include "variables.h" #include "code_B6EA0.h" +#include "core2/anim/sprite.h" extern void func_80244D94(f32[3], f32[3], f32[3], u32, f32); @@ -27,7 +28,7 @@ extern ActorProp *func_80320EB0(ActorMarker *, f32, s32); void fxegg_collide(s32 arg0, ActorMarker *arg1, s32 arg2); /* .data */ -struct53s D_803726A0[] = { +AnimSpriteStep D_803726A0[] = { {9, 1}, {8, 1}, {7, 1}, @@ -156,7 +157,7 @@ void func_80353580(ActorMarker *marker){ void fxegg_head_spawn(void){ u8 projectile_indx = func_8033E8D0(); - struct54s *sp78 = func_8033E8F4(); + AnimSprite *sp78 = func_8033E8F4(); u8 sp77 = func_8033E93C(); f32 sp68[3]; f32 sp5C[3]; @@ -187,9 +188,9 @@ void fxegg_head_spawn(void){ projectile_setPosition(projectile_indx, sp50); func_8033FCD8(projectile_indx, 0xe); - func_80287E9C(sp78); - func_80287F50(sp78, D_803726A0, 0x14); - func_80287F10(sp78); + animsprite_default(sp78); + animsprite_set_steps(sp78, D_803726A0, sizeof(D_803726A0)); + animsprite_loop(sp78); func_80344E18(sp77, 1); func_80344EE4(sp77, 0.0f, 0.0f); @@ -263,7 +264,7 @@ void fxegg_head_destroy(void){} void fxegg_ass_spawn(void) { u8 projectile_indx; - struct54s *sp58; + AnimSprite *sp58; u8 sp57; f32 sp48[3]; f32 marker[3]; @@ -293,9 +294,9 @@ void fxegg_ass_spawn(void) { func_8033FFE4(projectile_indx, (s32)temp_f18, (s32)temp_f18); projectile_setPosition(projectile_indx, marker); func_8033FCD8(projectile_indx, 0xE); - func_80287E9C(sp58); - func_80287F50(sp58, &D_803726A0, 0x14); - func_80287F10(sp58); + animsprite_default(sp58); + animsprite_set_steps(sp58, D_803726A0, sizeof(D_803726A0)); + animsprite_loop(sp58); func_80344E18(sp57, 4); func_80344EE4(sp57, -2200.0f, -22000.0f); func_80344D94(sp57, marker); diff --git a/src/core2/code_CD0A0.c b/src/core2/code_CD0A0.c index 09173bd5..8004dc33 100644 --- a/src/core2/code_CD0A0.c +++ b/src/core2/code_CD0A0.c @@ -2,6 +2,7 @@ #include "functions.h" #include "variables.h" +#include "core2/anim/sprite.h" #include "code_B6EA0.h" struct{ @@ -31,7 +32,7 @@ void func_803540AC(void){} void func_803540B4(void){ ParticleStruct0s *sp34; u8 sp33; - struct54s *sp2C; + AnimSprite *sp2C; u8 sp2B; f32 sp1C[3]; @@ -43,8 +44,8 @@ void func_803540B4(void){ projectile_setSprite(sp33, D_803863D0.unk0 + 0x710); func_8033FFE4(sp33, D_803863D0.unk4, D_803863D0.unk4); func_8033FCD8(sp33, 0xC); - func_80287E9C(sp2C); - func_80287F7C(sp2C, 3); + animsprite_default(sp2C); + animsprite_set_state(sp2C, ANIM_SPRITE_STATE_STOPPED); sp1C[0] = randf2(-100.0f, 100.0f); sp1C[1] = randf2(-100.0f, 100.0f); sp1C[2] = randf2(-100.0f, 100.0f); diff --git a/src/core2/code_CD3F0.c b/src/core2/code_CD3F0.c index fdfa7187..3cc6c690 100644 --- a/src/core2/code_CD3F0.c +++ b/src/core2/code_CD3F0.c @@ -3,6 +3,7 @@ #include "variables.h" #include "code_B6EA0.h" +#include "core2/anim/sprite.h" extern f64 D_80379470; extern f32 D_80379478; @@ -27,7 +28,7 @@ void func_803543F4(void){} void func_803543FC(void) { ParticleStruct0s* sp3C; u8 sp3B; - struct54s* sp34; + AnimSprite* sp34; u8 sp33; f32 sp24[3]; s32 temp_f16; @@ -42,8 +43,8 @@ void func_803543FC(void) { projectile_setSprite(sp3B, ASSET_710_SPRITE_SPARKLE_PURPLE); func_8033FFE4(sp3B, temp_f16, temp_f16); func_8033FCD8(sp3B, 0xC); - func_80287E9C(sp34); - func_80287F7C(sp34, 3); + animsprite_default(sp34); + animsprite_set_state(sp34, ANIM_SPRITE_STATE_STOPPED); sp24[0] = randf2(-100.0f, 100.0f); sp24[1] = 250.0f; sp24[2] = randf2(-100.0f, 100.0f); diff --git a/src/core2/code_CD6E0.c b/src/core2/code_CD6E0.c index c3550eb2..ddded45e 100644 --- a/src/core2/code_CD6E0.c +++ b/src/core2/code_CD6E0.c @@ -3,6 +3,7 @@ #include "variables.h" #include "code_B6EA0.h" +#include "core2/anim/sprite.h" extern f32 player_getYaw(void); extern void projectile_getPosition(u8 arg0, f32 arg1[3]); @@ -22,7 +23,7 @@ void func_80354670(u8 arg0, s32 arg1) { void func_803546E8(void) { u8 sp4F; - struct54s* sp48; + AnimSprite* sp48; u8 sp47; ParticleStruct1s* temp_s0; f32 sp34[3]; @@ -44,8 +45,8 @@ void func_803546E8(void) { projectile_setSprite(sp4F, ASSET_713_SPRITE_SPARKLE_YELLOW); projectile_setPosition(sp4F, sp34); func_8033FCD8(sp4F, 0xC); - func_80287E9C(sp48); - func_80287F7C(sp48, 3); + animsprite_default(sp48); + animsprite_set_state(sp48, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp47, 5); func_80344EE4(sp47, -700.0f, -22000.0f); func_802589E4(sp28, D_803726EC, 250.0f); @@ -90,7 +91,7 @@ void func_80354990(void){} void func_80354998(void) { u8 sp57; ActorMarker *sp50; - struct54s *sp4C; + AnimSprite *sp4C; u8 sp4B; ParticleStruct1s *temp_s0; f32 sp38[3]; @@ -110,9 +111,9 @@ void func_80354998(void) { temp_s0->unkC[0] = 0.0f; temp_s0->unkC[1] = -0.05f; temp_s0->unkC[2] = 0.0f; - func_80287E9C(sp4C); - func_80287FD0(sp4C, 3.0f); - func_80287F7C(sp4C, 3); + animsprite_default(sp4C); + animsprite_set_speed(sp4C, 3.0f); + animsprite_set_state(sp4C, ANIM_SPRITE_STATE_STOPPED); switch (sp50->modelId) { /* irregular */ case 0x3BB: sp28 = 7; @@ -216,7 +217,7 @@ void func_80354DC8(void){} void func_80354DD0(void) { ParticleStruct1s* temp_s0; - struct54s* sp40; + AnimSprite* sp40; u8 sp3F; u8 pad3C[3]; u8 temp_s1; @@ -234,8 +235,8 @@ void func_80354DD0(void) { projectile_setSprite(temp_s1, ASSET_710_SPRITE_SPARKLE_PURPLE); func_8033FC60(temp_s1, 0xE1, 0xFF, 0); projectile_setPosition(temp_s1, sp2C); - func_80287E9C(sp40); - func_80287F7C(sp40, 3); + animsprite_default(sp40); + animsprite_set_state(sp40, ANIM_SPRITE_STATE_STOPPED); func_80344E18(sp3F, 3); sp20[0] = 0.0f; sp20[1] = 0.0f; @@ -285,7 +286,7 @@ void func_80355004(void){} void func_8035500C(void) { u8 sp47; - struct54s* sp40; + AnimSprite* sp40; u8 sp3F; ParticleStruct1s* temp_s0; f32 sp2C[3]; @@ -302,9 +303,9 @@ void func_8035500C(void) { projectile_setSprite(sp47, 0x70F); func_8033FC60(sp47, 0xFF, 0xE6, 0xF5); projectile_setPosition(sp47, sp2C); - func_80287E9C(sp40); - func_80287F7C(sp40, 3); - func_80287FB4(sp40, 0); //set frame + animsprite_default(sp40); + animsprite_set_state(sp40, ANIM_SPRITE_STATE_STOPPED); + animsprite_set_frame(sp40, 0); //set frame func_80344E18(sp3F, 3); sp20[0] = 0.0f; sp20[1] = 0.0f; @@ -356,7 +357,7 @@ void func_80355294(void){} void func_8035529C(void) { u8 sp4F; - struct54s* sp48; + AnimSprite* sp48; u8 sp47; ParticleStruct1s* sp40; f32 sp34[3]; @@ -373,9 +374,9 @@ void func_8035529C(void) { projectile_setSprite(sp4F, 0x70F); func_8033FC60(sp4F, randi2(0xD2, 0xFF), randi2(0xBE, 0xFF), randi2(0xC8, 0xFF)); projectile_setPosition(sp4F, sp34); - func_80287E9C(sp48); - func_80287F7C(sp48, 3); - func_80287FB4(sp48, 0); + animsprite_default(sp48); + animsprite_set_state(sp48, ANIM_SPRITE_STATE_STOPPED); + animsprite_set_frame(sp48, 0); func_80344E18(sp47, 3); sp28[0] = 0.0f; sp28[1] = 0.0f; @@ -428,7 +429,7 @@ void func_80355548(void){} void func_80355550(void) { static s32 D_803863E0; u8 sp3F; - struct54s *sp38; + AnimSprite *sp38; u8 sp37; ParticleStruct1s *sp30; f32 sp24[3]; @@ -451,9 +452,9 @@ void func_80355550(void) { } func_8033FC60(sp3F, 0xFF, 0xFF, 0xFF); projectile_setPosition(sp3F, sp24); - func_80287E9C(sp38); - func_80287F7C(sp38, 3); - func_80287FB4(sp38, 0); + animsprite_default(sp38); + animsprite_set_state(sp38, ANIM_SPRITE_STATE_STOPPED); + animsprite_set_frame(sp38, 0); if (D_803863E0 >= 4) { D_803863E0 = 0; } @@ -506,7 +507,7 @@ void func_8035585C(void){} void func_80355864(void) { u8 sp5F; - struct54s *sp58; + AnimSprite *sp58; u8 sp57; static s32 D_803863E4; f32 var_f2; @@ -533,9 +534,9 @@ void func_80355864(void) { projectile_setSprite(sp5F, 0x713); projectile_setPosition(sp5F, &sp38); func_8033FCD8(sp5F, 0xC); - func_80287E9C(sp58); - func_80287F7C(sp58, 3); - func_80287FD0(sp58, (sp44)? 16.0 : 3.0); + animsprite_default(sp58); + animsprite_set_state(sp58, ANIM_SPRITE_STATE_STOPPED); + animsprite_set_speed(sp58, (sp44)? 16.0 : 3.0); func_80344E18(sp57, 5); func_80344EE4(sp57, -700.0f, -22000.0f); sp28 = (sp44) ? randf2(-75.0f, 75.0f) + 400.0f diff --git a/src/core2/code_CECD0.c b/src/core2/code_CECD0.c index 87ecd80a..6d8a2813 100644 --- a/src/core2/code_CECD0.c +++ b/src/core2/code_CECD0.c @@ -3,6 +3,7 @@ #include "variables.h" #include "code_B6EA0.h" +#include "core2/anim/sprite.h" typedef struct { s32 unk0;//asset_id @@ -40,7 +41,7 @@ void func_80355D50(void){} void func_80355D58(void){ ParticleStruct0s * sp3C; u8 sp3B; - struct54s *sp34; + AnimSprite *sp34; u8 temp_s0; f32 sp24[3]; @@ -52,8 +53,8 @@ void func_80355D58(void){ projectile_setSprite(sp3B, D_803726F0.unk0 + ASSET_710_SPRITE_SPARKLE_PURPLE); func_8033FFE4(sp3B, D_803726F0.unk4, D_803726F0.unk4); func_8033FCD8(sp3B, 0xC); - func_80287E9C(sp34); - func_80287F7C(sp34, 3); + animsprite_default(sp34); + animsprite_set_state(sp34, ANIM_SPRITE_STATE_STOPPED); sp24[0] = randf2(-40.0f, 40.0f); sp24[1] = randf2(-40.0f, 40.0f); diff --git a/src/core2/code_CF090.c b/src/core2/code_CF090.c index 179cad35..daacb50c 100644 --- a/src/core2/code_CF090.c +++ b/src/core2/code_CF090.c @@ -3,9 +3,10 @@ #include "variables.h" #include "code_B6EA0.h" +#include "core2/anim/sprite.h" /* .data */ -struct53s D_80372700[] = { +AnimSpriteStep D_80372700[] = { {0x00, 1}, {0x01, 1}, {0x02, 1}, @@ -56,7 +57,7 @@ void func_80356074(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3){ void func_8035611C(void){ u8 temp_s0; - struct54s *sp58; + AnimSprite *sp58; u8 sp57; ParticleStruct0s *sp54; f32 sp44[3]; @@ -81,10 +82,10 @@ void func_8035611C(void){ sp2C[1] = 0.0f; sp2C[2] = randf()*359.0f; func_8033FD98(temp_s0, sp2C); - func_80287E9C(sp58); - func_80287F7C(sp58, 1); - func_80287F50(sp58, D_80372700, 0x28); - func_80287F10(sp58); + animsprite_default(sp58); + animsprite_set_state(sp58, ANIM_SPRITE_STATE_ONCE); + animsprite_set_steps(sp58, D_80372700, sizeof(D_80372700)); + animsprite_loop(sp58); sp38[0] = 0.0f; sp38[1] = 40.0f; @@ -97,13 +98,13 @@ void func_8035611C(void){ void func_803562E8(void){ ParticleStruct0s *sp24; - struct54s *sp20; + AnimSprite *sp20; u8 sp1F; sp24 = func_8033E960(); sp20 = func_8033E8F4(); sp1F = func_8033E8D0(); - if(func_80288034(sp20)){ + if(animsprite_is_stopped(sp20)){ func_8033E984(); } else{ diff --git a/src/core2/gc/section.c b/src/core2/gc/section.c index ee9be77a..006ece56 100644 --- a/src/core2/gc/section.c +++ b/src/core2/gc/section.c @@ -263,7 +263,7 @@ bool func_8030AF58(enum map_e arg0) { void func_8030AFA0(enum map_e arg0){ s32 level = map_getLevel(arg0); if(level > 0 && level < LEVEL_C_BOSS){ - func_80332BEC(arg0); + jiggylist_set_level(arg0); } } diff --git a/src/core2/mapModel.c b/src/core2/mapModel.c index e749f78c..1e447f8e 100644 --- a/src/core2/mapModel.c +++ b/src/core2/mapModel.c @@ -343,7 +343,7 @@ void mapModel_opa_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { } modelRender_setEnvColor(mapModel.env_red, mapModel.env_green, mapModel.env_blue, 0xFF); modelRender_draw(gfx, mtx, NULL, NULL, mapModel.description->scale, NULL, mapModel.model_bin_opa); - if (!func_80309F78()) { + if (!mapModel_has_xlu_bin()) { func_802F7BC0(gfx, mtx, vtx); } } @@ -539,7 +539,7 @@ UNK_TYPE(s32) func_80309EB0(f32 arg0[3], f32 arg1, f32 arg2[3], s32 arg3) { return (temp_v0_2 != 0) ? temp_v0_2 : sp24; } -bool func_80309F78(void) { +bool mapModel_has_xlu_bin(void) { return (mapModel.model_bin_opa != NULL) && (mapModel.model_bin_xlu != NULL); } diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c index 66a5a63a..419e1559 100644 --- a/src/core2/timedfuncqueue.c +++ b/src/core2/timedfuncqueue.c @@ -150,7 +150,7 @@ void func_80324BA0(s32 arg0){ } void __spawnjiggy(DelayedJiggyInfo *jigInfo){ - jiggySpawn(jigInfo->id, jigInfo->pos); + jiggy_spawn(jigInfo->id, jigInfo->pos); } void func_80324C58(void){ diff --git a/src/lair/code_0.c b/src/lair/code_0.c index b24a7d0a..3d00e15d 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -820,7 +820,7 @@ void func_80387F1C(void) if (nodeProp_findPositionFromActorId(400, tmp)) { - jiggySpawn(JIGGY_35_LAIR_CC_WITCH_SWITCH, tmp); + jiggy_spawn(JIGGY_35_LAIR_CC_WITCH_SWITCH, tmp); // FIXME: macro? __spawnQueue_add_4((GenFunction_4)func_802C4140, ACTOR_4C_STEAM, *(s32 *)&tmp[0], *(s32 *)&tmp[1], *(s32 *)&tmp[2]); }