chsnacker documentation

snackerctl documentation
gczoombox partial documentation
several warning resolutions
This commit is contained in:
Banjo Kazooie
2024-09-01 15:12:21 -05:00
parent 131e422275
commit 9cb645df24
31 changed files with 783 additions and 733 deletions

1022
src/core2/gc/dialog.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,9 @@
#include "functions.h"
#include "variables.h"
extern void func_8028A8D0(void);
#include "../snackerctl.h"
extern void func_8028F918(s32);
extern void func_80311714(int);
extern void func_803204E4(s32, s32);
@@ -285,7 +287,7 @@ void gcparade_update(void) {
return;
}
if (func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE) != 0) {
func_8028A8D0();
snackerctl_update();
switch (D_803830F0.state) {
case PARADE_STATE_3_WARP:
if (D_803830F0.unk5 == 0) {
@@ -315,7 +317,7 @@ void gcparade_update(void) {
break;
case PARADE_STATE_5_WAIT_ON_NAME: //name on screen (wait)
gcparade_print(D_803830F0.indx);
return;
break;
case PARADE_STATE_6_NAME_DISAPPEAR:// name scroll up off screen
gcparade_print(D_803830F0.indx);
D_803830F0.scroll_frame--;

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "zoombox.h"
#ifndef MIN
#define MIN(s,t) (((s) < t)?(s):(t))
#endif
@@ -20,10 +22,6 @@ typedef struct struct_1A_s{
u8 unkF;
}struct1As;
extern void func_803160A8(gczoombox_t *);
extern void gczoombox_close(gczoombox_t *);
extern void gczoombox_minimize(gczoombox_t *);
extern void gczoombox_maximize(gczoombox_t *);
extern void func_802C5994(void);
extern void func_802E412C(s32, s32);
void func_803204E4(s32, s32);
@@ -32,18 +30,14 @@ void mlMtxApply(Mtx*);
void func_80310D2C(void);
s32 level_get(void);
void gczoombox_update(gczoombox_t *);
void func_8024E6E0(s32, void *);
void func_8024E60C(s32, void *);
void func_8024E71C(s32, void *);
s32 getGameMode(void);
void gczoombox_highlight(gczoombox_t *, int);
void func_802DC5B8(void);
void func_802DC560(s32, s32);
s32 func_8024E67C(s32 controller_index);
bool func_803188B4(gczoombox_t*);
bool func_803183A4(gczoombox_t*, char *);
bool fileProgressFlag_get(enum file_progress_e);
enum map_e map_get(void);
bool func_802FD2D4(void);
@@ -54,10 +48,6 @@ extern void func_802DC528(s32,s32);
extern void func_802F5060(enum asset_e);
extern void func_802F5188(void);
extern void func_802FACA4(enum item_e);
extern void func_803184C8(gczoombox_t *, f32, s32, s32, f32, s32, s32);
extern void func_80318640(gczoombox_t *, s32, f32, f32, s32);
extern void func_80318734(gczoombox_t *, f32);
extern void func_80318964(gczoombox_t *);
extern void func_8033BD20(void *);
enum gcpausemenu_state_e {
@@ -69,17 +59,17 @@ enum gcpausemenu_state_e {
/* .data */
struct1As D_8036C4E0[4] = {
{0.0f, 0.0f, "RETURN TO GAME", 55, TALK_PIC_4_BANJO_1, 0},
{0.3f, 0.0f, "EXIT TO WITCH'S LAIR", -100, TALK_PIC_4_BANJO_1, 0},
{0.1f, 0.0f, "VIEW TOTALS", 90, TALK_PIC_6_JIGGY_1, 0},
{0.2f, 0.0f, "SAVE AND QUIT", 125, TALK_PIC_7_TOOTY_1, 0},
{0.0f, 0.0f, "RETURN TO GAME", 55, ZOOMBOX_SPRITE_4_BANJO_1, 0},
{0.3f, 0.0f, "EXIT TO WITCH'S LAIR", -100, ZOOMBOX_SPRITE_4_BANJO_1, 0},
{0.1f, 0.0f, "VIEW TOTALS", 90, ZOOMBOX_SPRITE_6_JIGGY_1, 0},
{0.2f, 0.0f, "SAVE AND QUIT", 125, ZOOMBOX_SPRITE_7_TOOTY_1, 0},
};
struct1As D_8036C520[4] = {
{0.0f, 0.0f, "cc999 / 999cc", 30, TALK_PIC_8_MUSIC_NOTE_1, 0},
{0.1f, 0.0f, "cc999 / 999cc", 66, TALK_PIC_9_JIGGY_2, 0},
{0.2f, 0.0f, "cc999 / 999cc", 102, TALK_PIC_A_EXTRA_HEALTH_MAX, 0},
{0.3f, 0.0f, "cc999 : 999cc", 138, TALK_PIC_B_CLOCK, 0},
{0.0f, 0.0f, "cc999 / 999cc", 30, ZOOMBOX_SPRITE_8_MUSIC_NOTE_1, 0},
{0.1f, 0.0f, "cc999 / 999cc", 66, ZOOMBOX_SPRITE_9_JIGGY_2, 0},
{0.2f, 0.0f, "cc999 / 999cc", 102, ZOOMBOX_SPRITE_A_EXTRA_HEALTH_MAX, 0},
{0.3f, 0.0f, "cc999 : 999cc", 138, ZOOMBOX_SPRITE_B_CLOCK, 0},
};
struct1Bs D_8036C560[] = {
@@ -153,7 +143,7 @@ struct{
s8 joystick_frame;
u8 joystick_frame_count;
f32 unkC;
gczoombox_t *zoombox[4];
GcZoombox *zoombox[4];
f32 unk20;
BKSprite * joystick_sprite;
f32 unk28;
@@ -190,8 +180,8 @@ void gcpausemenu_defrag(void){
s32 i;
for(i =0; i< 4; i++){
if(D_80383010.zoombox[i]){
func_80318C0C(D_80383010.zoombox[i]);
D_80383010.zoombox[i] = (gczoombox_t *)defrag(D_80383010.zoombox[i]);
gczoombox_defrag(D_80383010.zoombox[i]);
D_80383010.zoombox[i] = (GcZoombox *)defrag(D_80383010.zoombox[i]);
}
}
}
@@ -561,7 +551,7 @@ void gcPauseMenu_setState(enum gcpausemenu_state_e next_state){
else{
gczoombox_highlight(D_80383010.zoombox[i], 1);
}
if(func_80318604(D_80383010.zoombox[i])){
if(gczoombox_is_highlighted(D_80383010.zoombox[i])){
gczoombox_maximize(D_80383010.zoombox[i]);
func_803183A4( D_80383010.zoombox[i], D_8036C520[i].str);
}
@@ -741,7 +731,7 @@ s32 gcpausemenu_80312D78(struct1As *arg0, s32 arg1) {
gczoombox_open(D_80383010.zoombox[var_s2]);
gczoombox_maximize(D_80383010.zoombox[var_s2]);
}
if (!func_80318604(D_80383010.zoombox[var_s2])) {
if (!gczoombox_is_highlighted(D_80383010.zoombox[var_s2])) {
func_80318498(D_80383010.zoombox[var_s2]);
func_8031843C(D_80383010.zoombox[var_s2]);
}
@@ -887,7 +877,7 @@ s32 gcPauseMenu_update(void){
func_8024E6E0(0, sp50);
func_80310D2C();
for(i = 0; i < 4; i++){
gczoombox_update(D_80383010.zoombox[i]);//gczoombox_update;
gczoombox_update(D_80383010.zoombox[i]);
}

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "gc/gczoombox.h"
#include "zoombox.h"
extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]);
void func_80252330(f32, f32, f32);
@@ -429,18 +429,8 @@ void func_8030DA44(u8);
void func_80338338(s32, s32, s32);
void func_803382FC(u8);
s32 func_80316ED4(u8*);
void func_8031843C(gczoombox_t *this);
void func_80318478(gczoombox_t *this);
void func_80318488(gczoombox_t *this);
void func_80318498(gczoombox_t *this);
void gczoombox_resolve_minimize(gczoombox_t *this);
void func_803184C8(gczoombox_t *, f32, s32, s32, f32, bool, bool);
void func_80318760(gczoombox_t *this, s32 arg1);
/* .code */
void func_80315200(gczoombox_t *this){
void func_80315200(GcZoombox *this){
s32 s1 = 0;
if(-1.0f == this->unk110[0]){
if(func_8025AD7C(this->unk108[0])){
@@ -459,14 +449,14 @@ void func_80315200(gczoombox_t *this){
}
}
void func_803152C4(gczoombox_t *this){
void func_803152C4(GcZoombox *this){
if(this->unk100 != NULL){
func_8033BD20(&this->unk100);
this->unk100 = NULL;
}
}
void func_80315300(gczoombox_t *this){
void func_80315300(GcZoombox *this){
if(this->model != NULL){
func_8033BD20(&this->model);
this->model = NULL;
@@ -482,7 +472,7 @@ void func_80315300(gczoombox_t *this){
func_803152C4(this);
}
void gczoombox_free(gczoombox_t *this){
void gczoombox_free(GcZoombox *this){
if(this){
func_80315200(this);
func_80315300(this);
@@ -505,7 +495,7 @@ void _gczoombox_memClear(u8 *arg0, s32 size){
}
}
void func_80315484(gczoombox_t *this){
void func_80315484(GcZoombox *this){
if( this->unk1A4_31 && !this->unk1A4_26){
this->unk16C = 0.5 * ((this->unk1A4_19) ? 0xf : 0xc) * this->unk198 + this->unk166;
}
@@ -515,7 +505,7 @@ void func_80315484(gczoombox_t *this){
}
}
void func_80315524(gczoombox_t *this){
void func_80315524(GcZoombox *this){
if(this->unk1A4_26 || this->unk1A4_31){
this->state = 3;
this->unk181 = this->unk182;
@@ -527,7 +517,7 @@ void func_80315524(gczoombox_t *this){
this->unk1A4_23 = 0;
}
void func_8031556C(gczoombox_t *this){
void func_8031556C(GcZoombox *this){
this->state = 5;
animctrl_setPlaybackType(this->anim_ctrl, ANIMCTRL_ONCE);
animctrl_setDirection(this->anim_ctrl, 1);
@@ -536,7 +526,7 @@ void func_8031556C(gczoombox_t *this){
func_80318498(this);
}
void func_803155C8(gczoombox_t *this){
void func_803155C8(GcZoombox *this){
int i;
this->state = 6;
@@ -597,13 +587,13 @@ static int __get_str_print_len(u8 *arg0, s32 len){
static s32 _gczoombox_findLineBreak(char *string, s32 line_length){
s32 i;
for(i = func_80316ED4(string); (line_length < (__get_str_print_len(string, i)) || (' ' != string[i] )); i--);
for(i = gczoombox_strlen(string); (line_length < (__get_str_print_len(string, i)) || (' ' != string[i] )); i--);
return i;
}
void func_8031594C(gczoombox_t * this, u8 *str, s32 arg2, s32 arg3){
void func_8031594C(GcZoombox * this, u8 *str, s32 arg2, s32 arg3){
s32 s0;
gczoombox_t *s4;
GcZoombox *s4;
s32 s5;
s32 s3;
s32 s2;
@@ -613,7 +603,7 @@ void func_8031594C(gczoombox_t * this, u8 *str, s32 arg2, s32 arg3){
s0 = arg2;
s4 = this;
s1 = 0;
f22 = (this->portrait_id == TALK_PIC_5F_TOOTY_4) ? 0.4 : 0.8;
f22 = (this->portrait_id == ZOOMBOX_SPRITE_5F_TOOTY_4) ? 0.4 : 0.8;
if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE){
sfx_rand_sync_to_rand();
@@ -673,27 +663,27 @@ void func_8031594C(gczoombox_t * this, u8 *str, s32 arg2, s32 arg3){
}
}
u8 func_80315BC0(gczoombox_t *this, enum sfx_e sfx_id, s32 arg2){
u8 func_80315BC0(GcZoombox *this, enum sfx_e sfx_id, s32 arg2){
u8 sp1F = func_8030ED2C(sfx_id, arg2) & 0xff;
func_8030DD90(sp1F, 0);
if(this->portrait_id == TALK_PIC_66_LOCKUP){
if(this->portrait_id == ZOOMBOX_SPRITE_66_LOCKUP){
func_8030DCCC(sp1F, 0x40);
}
return sp1F;
}
void func_80315C1C(gczoombox_t *this){
void func_80315C1C(GcZoombox *this){
int i;
func_80315200(this);
func_80315300(this);
for(i = 0 ; i < 8; i++){
for(i = 0 ; i < ZOOMBOX_MAX_STRING_COUNT; i++){
this->raw_str[i] = NULL;
}
this->state = 0;
this->unk137 = this->unk1A4_20 = 0;
this->str_cnt = this->unk1A4_20 = 0;
}
void func_80315C90(gczoombox_t *this, s32 arg1) {
void func_80315C90(GcZoombox *this, s32 arg1) {
s32 phi_s1;
s32 current_sfx;
f32 phi_f12;
@@ -707,7 +697,7 @@ void func_80315C90(gczoombox_t *this, s32 arg1) {
current_sfx = 0U;
if (this != NULL && this->sfx_count != 0 && this->unk1A4_11) {
if (this->portrait_id == TALK_PIC_15_CLANKER) {
if (this->portrait_id == ZOOMBOX_SPRITE_15_CLANKER) {
for(phi_s1 = 0; phi_s1 < 5; phi_s1++){
if(func_8030E3FC(this->unk108[phi_s1]))
return;
@@ -772,7 +762,7 @@ void func_80315C90(gczoombox_t *this, s32 arg1) {
}
}
void func_803160A8(gczoombox_t *this) {
void func_803160A8(GcZoombox *this) {
f32 temp_f14;
f32 phi_f14;
s32 phi_a0;
@@ -804,7 +794,7 @@ void func_803160A8(gczoombox_t *this) {
}
}
void func_803162B4(gczoombox_t *this){
void func_803162B4(GcZoombox *this){
func_802F7B90(this->unk168, this->unk168, this->unk168);
if(this->unk1A4_30){
if(this->unk1A4_17){
@@ -826,7 +816,7 @@ void func_803162B4(gczoombox_t *this){
func_802F7B90(0xff, 0xff, 0xff);
}
void func_803163A8(gczoombox_t *this, Gfx **gfx, Mtx **mtx) {
void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx) {
f32 sp5C[3];
f32 sp50[3];
f32 sp44[3];
@@ -848,11 +838,11 @@ void func_803163A8(gczoombox_t *this, Gfx **gfx, Mtx **mtx) {
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, sp38, this->model);
}
void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) {
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) {
f32 sp2C[3];
f32 temp_f12;
if (this->portrait_id == TALK_PIC_46_TUMBLAR) {
if (this->portrait_id == ZOOMBOX_SPRITE_46_TUMBLAR) {
arg6 = 0.75f;
}
func_80338338(0xFF, 0xFF, 0xFF);
@@ -880,7 +870,7 @@ void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4,
func_8024C904(gfx, mtx);
}
void func_80316764(gczoombox_t *this, s32 arg1) {
void func_80316764(GcZoombox *this, s32 arg1) {
s32 sp38[6];
f32 phi_f0;
s32 sp2C[2];
@@ -986,7 +976,7 @@ void func_80316764(gczoombox_t *this, s32 arg1) {
}
void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr){
void gczoombox_draw(GcZoombox *this, Gfx **gdl, Mtx ** mptr, void *vptr){
if(!this)
return;
@@ -1015,13 +1005,13 @@ void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr){
func_803164B0(this, gdl, mptr, this->unk178, this->unk179, this->unk104, this->unk17C);
}//L80316D40
if( !this->unk1A4_18 && !(this->unk168 < 0x81)
if( !this->highlighted && !(this->unk168 < 0x81)
){
this->unk168 -= 0xC;
this->unk168 = !(this->unk168 < 0x81) ? this->unk168 : 0x80;
}
if(this->unk1A4_18 && this->unk168 < 0xff){
if(this->highlighted && this->unk168 < 0xff){
this->unk168 += 0xC;
this->unk168 = MIN(this->unk168, 0xff);
}
@@ -1033,7 +1023,7 @@ void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr){
}
void func_80316E08(gczoombox_t *this) {
void func_80316E08(GcZoombox *this) {
this->state = 8;
func_80318478(this);
if (this->unk1A4_24) {
@@ -1044,12 +1034,12 @@ void func_80316E08(gczoombox_t *this) {
}
}
void func_80316E60(gczoombox_t *this){
void func_80316E60(GcZoombox *this){
this->state = 9;
func_80318488(this);
}
void func_80316E84(gczoombox_t *this, s32 arg1){
void func_80316E84(GcZoombox *this, s32 arg1){
if(this->unk134 != arg1){
if(this->unk130 != NULL){
this->unk130(this->portrait_id, arg1);
@@ -1058,12 +1048,11 @@ void func_80316E84(gczoombox_t *this, s32 arg1){
}
}
//gczoombox_strLen
s32 func_80316ED4(u8 *arg0){
s32 gczoombox_strlen(u8 *arg0){
return strlen(arg0);
}
void gczoombox_update(gczoombox_t *this){
void gczoombox_update(GcZoombox *this){
s32 sp58[6];
s32 sp4C[3];
s32 sp48;
@@ -1090,11 +1079,11 @@ void gczoombox_update(gczoombox_t *this){
this->unk160 += this->unk15C + 1;
}
else{
this->unk160 = this->raw_str[this->unk138];
this->unk160 = this->raw_str[this->current_str_index];
this->unk1A4_19 = func_8031B604(this->unk160);
this->unk166 = ((this->unk1A4_19) ? 0x11 : 0x14) * this->unk198 + this->unk164;
}
this->unk15C = func_80316ED4(this->unk160);
this->unk15C = gczoombox_strlen(this->unk160);
if(this->unk15C >= 24){
this->unk15C = _gczoombox_findLineBreak(this->unk160, 24);
this->unk15D = 1;
@@ -1105,10 +1094,10 @@ void gczoombox_update(gczoombox_t *this){
func_803153A8(this->unk160, this->unk60, 0, this->unk15C);
this->unk60[this->unk15C] = 0;
if(!this->unk15D){
this->unk138++;
this->current_str_index++;
}
if(this->unk15D || this->unk138 < this->unk137){
if(this->unk15D || this->current_str_index < this->str_cnt){
this->unk1A4_25 = 0;
this->unk1A4_31 = 0;
}
@@ -1347,8 +1336,7 @@ void gczoombox_update(gczoombox_t *this){
}
}
//_gczoombox_loadSprite
void func_80317C90(gczoombox_t *this, s32 portrait_id){
void __gczoombox_load_sprite(GcZoombox *this, GcZoomboxSprite portrait_id){
this->unkF8 = func_8033B6C4(D_8036C6C0[portrait_id].spite_id, &this->unkFC);
this->frame_count = this->unkF8->frameCnt;
func_803382E4(-1);
@@ -1356,8 +1344,7 @@ void func_80317C90(gczoombox_t *this, s32 portrait_id){
func_80338308(func_802510A0(this->unkF8), func_802510A8(this->unkF8));
}
//_gczoombox_loadsfx
void func_80317D10(gczoombox_t *this, enum talk_pic_e portrait_id){
void __gczoombox_load_sfx(GcZoombox *this, GcZoomboxSprite portrait_id){
s32 i;
this->sfx_count = 0;
@@ -1387,19 +1374,19 @@ void func_80317D10(gczoombox_t *this, enum talk_pic_e portrait_id){
}
}
gczoombox_t *gczoombox_new(s32 arg0, enum talk_pic_e portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32)){
gczoombox_t *this;
GcZoombox *gczoombox_new(s32 arg0, GcZoomboxSprite portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32)){
GcZoombox *this;
s32 i;
s32 temp_v1;
this = (gczoombox_t *)malloc(sizeof(gczoombox_t));
this = (GcZoombox *)malloc(sizeof(GcZoombox));
this->unk130 = arg4;
this->state = 0xB;
this->portrait_id = portrait_id;
this->unk134 = this->unk137 = this->unk138 = 0;
this->unk134 = this->str_cnt = this->current_str_index = 0;
this->unk139 = arg2;
this->unk13A = 0x20;
for(i = 0; i < 8; i++){
for(i = 0; i < ZOOMBOX_MAX_STRING_COUNT; i++){
this->raw_str[i] = NULL;
}
this->unk15E = 0;
@@ -1451,10 +1438,10 @@ gczoombox_t *gczoombox_new(s32 arg0, enum talk_pic_e portrait_id, s32 arg2, s32
this->unk1A4_14 =\
this->unk1A4_13 = 0;
this->unk1A4_11 = this->unk1A4_18 = 1;
this->unk1A4_11 = this->highlighted = 1;
this->model = assetcache_get(0x89d);
func_80317C90(this, portrait_id);
__gczoombox_load_sprite(this, portrait_id);
this->anim_ctrl = animctrl_new(0);
animctrl_reset(this->anim_ctrl);
animctrl_setIndex(this->anim_ctrl, ASSET_138_ANIM_ZOOMBOX);
@@ -1468,7 +1455,7 @@ gczoombox_t *gczoombox_new(s32 arg0, enum talk_pic_e portrait_id, s32 arg2, s32
this->unk17C = 1.0f;
this->unk178 = this->unk179 = 0;
func_80317D10(this, portrait_id);
__gczoombox_load_sfx(this, portrait_id);
func_80318760(this, 18000);
_gczoombox_memClear( this->unk0, 0x30);
_gczoombox_memClear( this->unk30, 0x30);
@@ -1478,19 +1465,25 @@ gczoombox_t *gczoombox_new(s32 arg0, enum talk_pic_e portrait_id, s32 arg2, s32
return this;
}
bool func_80318284(gczoombox_t *this, s32 str_cnt, char **str_ptrs) {
/**
* @brief Manually sets the strings gczoombox displays. Assumed that
* `str_cnt <= ZOOMBOX_MAX_STRING_COUNT`. Returns 1 on success, 0 on
* failure
*/
bool gczoombox_setStrings(GcZoombox *this, s32 str_cnt, char **str_ptrs) {
// assert!(str_cnt <= ZOOMBOX_MAX_STRING_COUNT)
s32 phi_v0;
if ((this->unk13A & 4) || (str_ptrs == NULL) || (str_cnt == 0)) {
return FALSE;
}
this->unk138 = 0;
this->unk137 = str_cnt;
this->current_str_index = 0;
this->str_cnt = str_cnt;
for(phi_v0 = 0; phi_v0 < str_cnt; phi_v0++){
this->raw_str[phi_v0] = str_ptrs[phi_v0];
}
for(phi_v0 = str_cnt; phi_v0 < 8; phi_v0++){
for(phi_v0 = str_cnt; phi_v0 < ZOOMBOX_MAX_STRING_COUNT; phi_v0++){
this->raw_str[phi_v0] = NULL;
}
@@ -1498,70 +1491,70 @@ bool func_80318284(gczoombox_t *this, s32 str_cnt, char **str_ptrs) {
return 1;
}
bool func_803183A4(gczoombox_t *this, char *arg1) {
bool func_803183A4(GcZoombox *this, char *arg1) {
char *sp1C;
if ((this->unk13A & 4) || (arg1 == NULL)) {
return FALSE;
}
sp1C = arg1;
return func_80318284(this, 1, &sp1C);
return gczoombox_setStrings(this, 1, &sp1C);
}
void gczoombox_open(gczoombox_t *this){
void gczoombox_open(GcZoombox *this){
this->unk13A |= 0x1;
}
void gczoombox_close(gczoombox_t *this){
void gczoombox_close(GcZoombox *this){
this->unk13A |= 0x10;
}
void gczoombox_maximize(gczoombox_t *this){
void gczoombox_maximize(GcZoombox *this){
this->unk13A |= 0x2;
}
void gczoombox_minimize(gczoombox_t *this){
void gczoombox_minimize(GcZoombox *this){
this->unk13A |= 0x8;
}
void func_8031842C(gczoombox_t *this){
void func_8031842C(GcZoombox *this){
this->unk13A |= 0x20;
}
void func_8031843C(gczoombox_t *this){
void func_8031843C(GcZoombox *this){
void *temp_v1;
void *phi_v1;
s32 phi_v0;
for(phi_v0 = 0; phi_v0 < 8; phi_v0++){
for(phi_v0 = 0; phi_v0 < ZOOMBOX_MAX_STRING_COUNT; phi_v0++){
this->raw_str[phi_v0] = NULL;
};
this->unk137 = 0;
this->str_cnt = 0;
this->unk13A &= (u8)~(0x4);
}
void func_80318478(gczoombox_t *this){
void func_80318478(GcZoombox *this){
this->unk13A &= (u8)~(0x1);
}
void func_80318488(gczoombox_t *this){
void func_80318488(GcZoombox *this){
this->unk13A &= (u8)~(0x10);
}
void func_80318498(gczoombox_t *this){
void func_80318498(GcZoombox *this){
this->unk13A &= (u8)~(0x2);
}
void gczoombox_resolve_minimize(gczoombox_t *this){
void gczoombox_resolve_minimize(GcZoombox *this){
this->unk13A &= (u8)~(0x8);
}
void func_803184B8(gczoombox_t *this){
void func_803184B8(GcZoombox *this){
this->unk13A &= (u8)~(0x20);
}
void func_803184C8(gczoombox_t *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6) {
void func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6) {
if (this != NULL) {
this->unk182 = arg2;
@@ -1575,7 +1568,7 @@ void func_803184C8(gczoombox_t *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bo
}
}
bool func_8031857C(gczoombox_t *this, u8 *str){
bool func_8031857C(GcZoombox *this, u8 *str){
if(func_803183A4(this, str)){
gczoombox_open(this);
gczoombox_maximize(this);
@@ -1586,26 +1579,25 @@ bool func_8031857C(gczoombox_t *this, u8 *str){
return FALSE;
}
void gczoombox_highlight(gczoombox_t *this, bool arg1){
void gczoombox_highlight(GcZoombox *this, bool arg1){
if(arg1)
this->unk1A4_18 = 1;
this->highlighted = 1;
else
this->unk1A4_18 = 0;
this->highlighted = 0;
}
//gczoombox_isHiglighted
bool func_80318604(gczoombox_t *this){
return this->unk1A4_18;
bool gczoombox_is_highlighted(GcZoombox *this){
return this->highlighted;
}
void func_80318614(gczoombox_t *this, int arg1){
void func_80318614(GcZoombox *this, int arg1){
if(arg1)
this->unk1A4_11 = 1;
else
this->unk1A4_11 = 0;
}
void func_80318640(gczoombox_t *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) {
void func_80318640(GcZoombox *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) {
s32 phi_v0;
if (this != NULL) {
@@ -1626,21 +1618,21 @@ void func_80318640(gczoombox_t *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) {
}
void func_80318734(gczoombox_t *this, f32 arg1){
void func_80318734(GcZoombox *this, f32 arg1){
if(this)
this->unk1A0 = 1.0/arg1;
}
void func_80318760(gczoombox_t *this, s32 arg1){
void func_80318760(GcZoombox *this, s32 arg1){
if(this)
this->unk12E = arg1;
}
void func_80318774(gczoombox_t *this){
void func_80318774(GcZoombox *this){
this->unk13A = 0;
}
bool func_8031877C(gczoombox_t *this){
bool func_8031877C(GcZoombox *this){
if( this == NULL
|| this->state == 0 || this->state == 0xb || this->state == 0x9 || this->state == 0x6 || this->state == 0x7
){
@@ -1663,7 +1655,7 @@ bool func_8031877C(gczoombox_t *this){
return TRUE;
}
bool func_803188B4(gczoombox_t *this) {
bool func_803188B4(GcZoombox *this) {
if ((this == NULL) || (this->state == 0) || (this->state == 7) || (this->state == 9)) {
return FALSE;
@@ -1683,7 +1675,7 @@ bool func_803188B4(gczoombox_t *this) {
}
bool func_80318964(gczoombox_t *this) {
bool func_80318964(GcZoombox *this) {
if (this == NULL || this->state == 0 || this->state == 7 || this->state == 9) {
return FALSE;
}
@@ -1693,7 +1685,7 @@ bool func_80318964(gczoombox_t *this) {
return TRUE;
}
bool func_803189C4(gczoombox_t *this, enum talk_pic_e arg1){
bool gczoombox_loadSprite(GcZoombox *this, GcZoomboxSprite arg1){
if( this == NULL
|| arg1 == this->portrait_id
|| ( this->state != 6
@@ -1710,11 +1702,11 @@ bool func_803189C4(gczoombox_t *this, enum talk_pic_e arg1){
this->unkF8 = NULL;
}
func_803152C4(this);
func_80317C90(this, arg1);
__gczoombox_load_sprite(this, arg1);
this->unk176 = D_8036C6C0[arg1].unk2;
this->unk177 = D_8036C6C0[arg1].unk3;
func_80315200(this);
func_80317D10(this, arg1);
__gczoombox_load_sfx(this, arg1);
this->portrait_id = arg1;
}
else{//L80318AAC
@@ -1730,11 +1722,11 @@ bool func_803189C4(gczoombox_t *this, enum talk_pic_e arg1){
}
this->unk178 = this->unk176;
this->unk179 = this->unk177;
func_80317C90(this, arg1);
__gczoombox_load_sprite(this, arg1);
this->unk176 = D_8036C6C0[arg1].unk2;
this->unk177 = D_8036C6C0[arg1].unk3;
func_80315200(this);
func_80317D10(this, arg1);
__gczoombox_load_sfx(this, arg1);
this->unk1A4_14 = 1;
this->portrait_id = arg1;
this->unk1A4_13 = 1;
@@ -1743,7 +1735,7 @@ bool func_803189C4(gczoombox_t *this, enum talk_pic_e arg1){
return TRUE;
}
void func_80318B7C(gczoombox_t *this, s32 arg1) {
void func_80318B7C(GcZoombox *this, s32 arg1) {
s32 phi_v0;
if (this != NULL) {
@@ -1755,11 +1747,11 @@ void func_80318B7C(gczoombox_t *this, s32 arg1) {
}
}
bool func_80318BEC(gczoombox_t *this){
bool func_80318BEC(GcZoombox *this){
return this != NULL && !this->state;
}
void func_80318C0C(gczoombox_t *this) {
void gczoombox_defrag(GcZoombox *this) {
AnimCtrl *temp_a0;
if (this != NULL) {
@@ -1769,7 +1761,7 @@ void func_80318C0C(gczoombox_t *this) {
}
}
void func_80318C48(gczoombox_t *this, s32 arg1) {
void func_80318C48(GcZoombox *this, s32 arg1) {
if (this != NULL) {
if (this->unk1A4_30) {
if (arg1 != 0) {

252
src/core2/gc/zoombox.h Normal file
View File

@@ -0,0 +1,252 @@
#ifndef __BANJO_KAZOOIE_CORE2_GC_ZOOMBOX_H__
#define __BANJO_KAZOOIE_CORE2_GC_ZOOMBOX_H__
#include <ultra64.h>
#include "structs.h"
#define ZOOMBOX_MAX_STRING_COUNT 8
typedef enum talk_pic_e {
ZOOMBOX_SPRITE_0_GRUNTILDA_1,
ZOOMBOX_SPRITE_1_VILE_1,
ZOOMBOX_SPRITE_2_VILE_2,
ZOOMBOX_SPRITE_3_VILE_3,
ZOOMBOX_SPRITE_4_BANJO_1,
ZOOMBOX_SPRITE_5_GRUNTILDA_2,
ZOOMBOX_SPRITE_6_JIGGY_1,
ZOOMBOX_SPRITE_7_TOOTY_1,
ZOOMBOX_SPRITE_8_MUSIC_NOTE_1,
ZOOMBOX_SPRITE_9_JIGGY_2,
ZOOMBOX_SPRITE_A_EXTRA_HEALTH_MAX,
ZOOMBOX_SPRITE_B_CLOCK,
ZOOMBOX_SPRITE_C_BANJO_2,
ZOOMBOX_SPRITE_D_KAZOOIE_1,
ZOOMBOX_SPRITE_E_KAZOOIE_2,
ZOOMBOX_SPRITE_F_BOTTLES,
ZOOMBOX_SPRITE_10_MUMBO_1,
ZOOMBOX_SPRITE_11_CHIMPY,
ZOOMBOX_SPRITE_12_CONGA,
ZOOMBOX_SPRITE_13_BLUBBER,
ZOOMBOX_SPRITE_14_NIPPER,
ZOOMBOX_SPRITE_15_CLANKER,
ZOOMBOX_SPRITE_16_SNIPPET,
ZOOMBOX_SPRITE_17_VILE_4,
ZOOMBOX_SPRITE_18_TIPTUP,
ZOOMBOX_SPRITE_19_TANKTUP,
ZOOMBOX_SPRITE_1A_FLIBBIT,
ZOO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MBOX_SPRITE_65_GRUNTILDA_4,
ZOOMBOX_SPRITE_66_LOCKUP,
ZOOMBOX_SPRITE_67_VILE_5,
ZOOMBOX_SPRITE_68_VILE_6,
ZOOMBOX_SPRITE_69_VILE_7
}GcZoomboxSprite;
typedef struct {
u8 unk0[0x30]; //string1
u8 unk30[0x30]; //string2
u8 unk60[0x30];
u8 unk90[0x20];
u8 unkB0[0x40];
BKModelBin *model;
AnimCtrl *anim_ctrl;
BKSprite *unkF8;
BKSpriteDisplayData *unkFC;
BKSprite *unk100;
BKSpriteDisplayData *unk104;
u8 unk108[5]; //sfx_ids
u8 pad10D[3];
f32 unk110[5]; //sfx_???
s16 unk124[5]; //sfx_???
s16 unk12E;
void (*unk130)(s32, s32);
u8 unk134;
u8 state;
u8 portrait_id; //0x136
u8 str_cnt; //string_cnt
u8 current_str_index; //current_string
u8 unk139;
u8 unk13A;
u8 sfx_count;
char *raw_str[ZOOMBOX_MAX_STRING_COUNT]; //string_ptrs
u8 unk15C;
u8 unk15D;
u8 unk15E;
u8 pad15F[0x1];
u8 *unk160;
s16 unk164;
s16 unk166; //top_transparency???
s16 unk168; //rgb???
s16 unk16A; //x_pos
s16 unk16C; //y1_pos
s16 unk16E; //y2_pos
s16 unk170;
s16 unk172;
s16 unk174;
s8 unk176;
s8 unk177;
s8 unk178;
s8 unk179;
u8 pad17A[0x2];
f32 unk17C;
s8 unk180;
s8 unk181;
u8 unk182;
u8 unk183;
u8 unk184;
u8 unk185;
s8 unk186;
u8 unk187;
u8 frame_count; //sprite frame count
u8 unk189;
u8 unk18A;
u8 prev_sfx; //next_sfx
f32 unk18C;
f32 unk190;
f32 unk194;
f32 unk198;
f32 unk19C;
f32 unk1A0;
u32 unk1A4_31:1;
u32 unk1A4_30:1;
u32 unk1A4_29:1;
u32 unk1A4_28:1;
u32 unk1A4_27:1;
u32 unk1A4_26:1;
u32 unk1A4_25:1;
u32 unk1A4_24:1;
u32 unk1A4_23:1;
u32 unk1A4_22:1;
u32 unk1A4_21:1;
u32 unk1A4_20:1;
u32 unk1A4_19:1;
u32 highlighted:1;
u32 unk1A4_17:1;
u32 unk1A4_16:1;
u32 unk1A4_15:1;
u32 unk1A4_14:1;
u32 unk1A4_13:1;
u32 unk1A4_12:1;
u32 unk1A4_11:1;
u32 unk1A4_10:1;
u32 pad1A4_9:10;
}GcZoombox; //size 0x1A8
void gczoombox_free(GcZoombox *this);
void func_803160A8(GcZoombox *this);
void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx);
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6);
void func_80316764(GcZoombox *this, s32 arg1);
void gczoombox_draw(GcZoombox *this, Gfx **gdl, Mtx ** mptr, void *vptr);
void func_80316E08(GcZoombox *this);
void func_80316E60(GcZoombox *this);
void func_80316E84(GcZoombox *this, s32 arg1);
s32 gczoombox_strlen(u8 *arg0);
void gczoombox_update(GcZoombox *this);
GcZoombox *gczoombox_new(s32 arg0, GcZoomboxSprite portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32));
bool gczoombox_setStrings(GcZoombox *this, s32 str_cnt, char **str_ptrs);
bool func_803183A4(GcZoombox *this, char *arg1);
void gczoombox_open(GcZoombox *this);
void gczoombox_close(GcZoombox *this);
void gczoombox_maximize(GcZoombox *this);
void gczoombox_minimize(GcZoombox *this);
void func_8031842C(GcZoombox *this);
void func_8031843C(GcZoombox *this);
void func_80318478(GcZoombox *this);
void func_80318488(GcZoombox *this);
void func_80318498(GcZoombox *this);
void gczoombox_resolve_minimize(GcZoombox *this);
void func_803184B8(GcZoombox *this);
void func_803184C8(GcZoombox *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6);
bool func_8031857C(GcZoombox *this, u8 *str);
void gczoombox_highlight(GcZoombox *this, bool arg1);
bool gczoombox_is_highlighted(GcZoombox *this);
void func_80318614(GcZoombox *this, int arg1);
void func_80318640(GcZoombox *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4);
void func_80318734(GcZoombox *this, f32 arg1);
void func_80318760(GcZoombox *this, s32 arg1);
void func_80318774(GcZoombox *this);
bool func_8031877C(GcZoombox *this);
bool func_803188B4(GcZoombox *this);
bool func_80318964(GcZoombox *this);
bool gczoombox_loadSprite(GcZoombox *this, GcZoomboxSprite arg1);
void func_80318B7C(GcZoombox *this, s32 arg1);
bool func_80318BEC(GcZoombox *this);
void gczoombox_defrag(GcZoombox *this);
void func_80318C48(GcZoombox *this, s32 arg1);
#endif // __BANJO_KAZOOIE_CORE2_GC_ZOOMBOX_H__