Merge branch banjo-kazooie:master into documentation

This commit is contained in:
Cyrus Kashef
2024-08-31 05:56:33 +00:00
52 changed files with 553 additions and 1036 deletions

View File

@@ -1 +0,0 @@
char pad_FP_803935A8[0x20];

View File

@@ -29,8 +29,8 @@ ActorInfo D_80391318 = { MARKER_AA_HISTUP, ACTOR_11C_HISTUP, ASSET_3DE_MODEL_HIS
extern struct {
s32 unk0;
s32 unk4;
s32 unk8;
}GV_D_80391AB0;
extern s32 D_80391AB8;
/* .code */
int func_8038D920(Actor *this, f32 arg1){
@@ -114,7 +114,7 @@ void func_8038DBDC(Actor *this){
actor_collisionOff(this);
subaddie_set_state_with_direction(this, 1, 0.99f, 0);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
D_80391AB8 = 0;
GV_D_80391AB0.unk8 = 0;
func_8038DB4C(0);
this->unk1C[0] = 0.0f;
}//L8038DC90
@@ -134,7 +134,7 @@ void func_8038DBDC(Actor *this){
case 2: //8038DD3C
if(!(func_8038E178() < 5)){
func_8038DB88(this);
if(D_80391AB8){
if(GV_D_80391AB0.unk8){
subaddie_set_state_with_direction(this, 3, 0.99f, 0);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
this->unk1C[0] = 0.0f;
@@ -196,7 +196,7 @@ void func_8038DBDC(Actor *this){
animctrl_setDuration(this->animctrl, 1.6f);
func_80386608();
func_8038DB4C(0);
D_80391AB8 = FALSE;
GV_D_80391AB0.unk8 = FALSE;
func_8025A58C(-1, 0x190);
func_8025A7DC(COMUSIC_27_GV_RUBEES_SONG);
if(!this->unk44_31){

View File

@@ -4,7 +4,7 @@
struct {
s32 unk0;
u8 pad4[4];
s32 unk4;
s32 unk8;
}GV_D_80391AB0;

View File

@@ -1 +0,0 @@
char pad_MM_D_80389C80[0x10];

View File

@@ -19,6 +19,7 @@ void func_80389598(Actor *this);
Actor* func_80389014(ActorMarker *, Gfx **, Mtx**, Vtx** );
/* .bss */
u8 MM_pad_80389C80[0x10];
s32 MM_D_80389C90;
/* .data */

View File

@@ -2,16 +2,18 @@
#include "functions.h"
#include "variables.h"
s32 pad_803912C0[2];
u8 __propellorCtrlState;
f32 __propellorTimer;
void __propellorCtrl_setState(s32 arg0){
static f32 __propellorTimer;
void __propellorCtrl_setState(s32 arg0){
f32* timerPtr = &__propellorTimer;
*timerPtr = 0.0f;
__propellorTimer = 0.0f;
if(arg0 == 1)
__propellorTimer = 6.5f;
if(arg0 == 1) {
*timerPtr = 6.5f;
}
if(arg0 == 2){
item_set(ITEM_3_PROPELLOR_TIMER, 3900 - 1);
@@ -49,8 +51,6 @@ void rbb_propellorCtrl_start(void){
}
void rbb_propellorCtrl_update(void){
extern f32 __propellorTimer;
if( __propellorCtrlState == 0)
if(levelSpecificFlags_get(0x27) && levelSpecificFlags_get(0x28))
__propellorCtrl_setState(1);

View File

@@ -2,12 +2,7 @@
#include "functions.h"
#include "variables.h"
#ifndef CORE2_DATA_CRC2
#define CORE2_DATA_CRC2 0
#endif
extern s32 core2_D_803727F4;
extern s32 D_803727F4;
extern struct {
u8 pad0[4];
@@ -32,7 +27,7 @@ typedef struct {
f32 joystick[2];
}Struct_core1_10A00_1;
extern s32 D_80276574; // = CORE2_DATA_CRC2
extern s32 D_80276574;
/* .data */
s32 D_80275D30 = 0xC3A68832; //WHAT IS THIS?
@@ -73,7 +68,7 @@ f32 func_8024E420(s32 arg0, s32 arg1, s32 arg2) {
f32 phi_f2;
phi_f2 = 0.0125f;
if ((D_80379B90.unk4 != core2_D_803727F4) || (D_80379B90.unkC != D_80276574)) {
if ((D_80379B90.unk4 != D_803727F4) || (D_80379B90.unkC != D_80276574)) {
phi_f2 = 0.00625f;
}
if (arg0 > 0) {
@@ -341,6 +336,10 @@ void func_8024F1F0(void){
void func_8024F224(void){
s32 iCont, j;
// for(iCont = 0; iCont < 4; iCont++){
// D_80281250[iCont].unk0 = 0;
// }
for(iCont = 0; iCont < 4; iCont++){
D_80281250[iCont].unk0 = 0;
D_80281250[iCont].unk2 = 0;

View File

@@ -9,8 +9,9 @@ extern void func_8025F570(ALCSPlayer *, u8);
extern void func_8025F510(ALCSPlayer *, u8, u8);
extern void func_8025F5C0(ALCSPlayer *, u8);
extern ALBankFile D_EA3EB0;
extern ALWaveTable D_EADE60;
extern u8 soundfont2ctl_ROM_START[];
extern u8 soundfont2ctl_ROM_END[];
extern u8 soundfont2tbl_ROM_START[];
/* dependent functions */
void func_8024FA98(u8, enum comusic_e);
@@ -220,10 +221,10 @@ void musicInstruments_init(void){
s32 i;
f32 tmpf1;
size = (u8*)&D_EADE60 - (u8*)&D_EA3EB0;
size = soundfont2ctl_ROM_END - soundfont2ctl_ROM_START;
bnk_f = malloc(size);
osWriteBackDCacheAll();
osPiStartDma(func_802405D0(), 0, 0, &D_EA3EB0, bnk_f, size, func_802405C4());
osPiStartDma(func_802405D0(), 0, 0, (u32)soundfont2ctl_ROM_START, bnk_f, size, func_802405C4());
osRecvMesg(func_802405C4(), 0, 1); //osRecvMesg
D_80282104 = 0xAD;
D_802820E0 = (MusicTrack **) malloc(D_80282104 * sizeof(MusicTrack *));
@@ -242,7 +243,7 @@ void musicInstruments_init(void){
n_alCSPNew(&D_80281720[i].cseqp, &D_802820E8);
}
alBnkfNew(bnk_f, (u8 *)&D_EADE60);
alBnkfNew(bnk_f, soundfont2tbl_ROM_START);
D_80282108 = bnk_f->bankArray[0];
for(i = 0; i < 6; i++){
alCSPSetBank(&D_80281720[i].cseqp, D_80282108);

View File

@@ -9,7 +9,7 @@ f32 func_80263FF0(f32);
f32 cosf(f32);
#ifndef CORE2_DATA_CRC2
#define CORE2_DATA_CRC2 0
#define CORE2_DATA_CRC2 0x84D7B4F8
#endif
s32 D_80276570 = 0xFF62C2B8; //WHAT IS THIS?

View File

@@ -147,9 +147,9 @@ ALHeap D_8027CFF0;
u8 * D_8027D000;
s32 D_8027D004;
OSMesgQueue D_8027D008;
OSMesg D_8027D020;
OSMesg D_8027D020[50];
OSIoMesg D_8027D0E8;
Struct_core1_1D00_4 D_8027D100[58];
Struct_core1_1D00_4 D_8027D100[50];
struct {
u8 unk0;
Struct_1D00_3 *unk4;
@@ -297,7 +297,7 @@ void audioManager_create(void) {
int i;
f32 var_f0;
osCreateMesgQueue(&D_8027D008, &D_8027D020, 0x32);
osCreateMesgQueue(&D_8027D008, D_8027D020, 50);
osCreateMesgQueue(&audioManager.audioReplyMsgQ, audioManager.audioReplyMsgBuf, 8); //audioReplyMesgQueue
osCreateMesgQueue(&audioManager.audioFrameMsgQ, audioManager.audioFrameMsgBuf, 8);
var_f0 = 733.333313f;

View File

@@ -3,8 +3,10 @@
#include "variables.h"
OSIoMesg D_8027E090;
OSMesg D_8027E0A8;
OSMesgQueue D_8027E0AC;
struct {
OSMesg mesg;
OSMesgQueue queue;
} D_8027E0A8;
OSMesg D_8027E0C8[16]; //g_PimgrMesgBuffer
OSMesgQueue D_8027E108; //g_PimgrMesgQueue
@@ -19,20 +21,20 @@ void func_802405F0(u32 * arg0, s32 arg1, s32 size){
block_remainder = size % block_size;
for(i = 0; i < block_cnt; i++){
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, 0x20000, &D_8027E0AC);
osRecvMesg(&D_8027E0AC, NULL, 1);
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, 0x20000, &D_8027E0A8.queue);
osRecvMesg(&D_8027E0A8.queue, NULL, 1);
arg1 += 0x20000;
arg0 += 0x8000;
}
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_remainder, &D_8027E0AC);
osRecvMesg(&D_8027E0AC, NULL, 1);
osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_remainder, &D_8027E0A8.queue);
osRecvMesg(&D_8027E0A8.queue, NULL, 1);
osInvalDCache(arg0, size);
}
void piMgr_create(void){
osCreateMesgQueue(&D_8027E0AC, &D_8027E0A8, 1);
osCreateMesgQueue(&D_8027E0A8.queue, &D_8027E0A8.mesg, 1);
osCreateMesgQueue(&D_8027E108, &D_8027E0C8[0], 16);
osCreatePiManager(OS_PRIORITY_PIMGR, &D_8027E108, &D_8027E0C8[0], 16);
}

View File

@@ -21,7 +21,7 @@ void func_80244978(s32 arg0, s16 type, s32 arg2);
N_ALSndPlayer D_8027EEC0;
s16 *D_8027EF14;
extern struct {
struct {
s32 volume[4];
}D_8027EF18;

View File

@@ -53,7 +53,7 @@ s32 D_80275768 = 6; //dbits
/* .data */
extern struct huft D_803FBE00;
struct huft *D_8027BF00;
u8 pad_8027BF00[0xC];
u8 pad_8027BF08[0x8];
u8 *D_8027BF10; //inbuf
u8 *D_8027BF14; //slide
u32 D_8027BF18; //inptr

View File

@@ -12,7 +12,6 @@ extern f32 func_8031C5D4(struct0*);
extern void func_8031C5AC(struct0 *, f32 *);
/* .bss */
u8 pad_D_8027EF20[0x10];
f32 D_8027EF30;
/* .code */

View File

@@ -61,7 +61,7 @@ s32 D_8027599C = 0;
/* .bss */
u64 D_8027EF40[OS_YIELD_DATA_SIZE / sizeof(u64)];
static u8 pad[0x28]; // 8027FB40
static u8 pad[0x20]; // 8027FB40
OSMesgQueue D_8027FB60;
OSMesg D_8027FB78[20];
OSMesgQueue D_8027FBC8;
@@ -74,7 +74,7 @@ s32 D_8027FC18;
s32 D_8027FC1C;
s32 D_8027FC20;
s32 D_8027FC24;
u8 D_8027FC28[2040]; //stack for thread D_80280428;
u8 D_8027FC28[2048]; //stack for thread D_80280428;
OSThread D_80280428;
Struct_Core1_8C50_s * D_802805D8[20];
volatile s32 D_80280628;
@@ -458,7 +458,7 @@ void func_80247560(void){
tmp_v0 = D_8027EF40;
while((u32)tmp_v0 % 0x10){((u32)tmp_v0)++;}
D_80275950.t.yield_data_ptr = tmp_v0;
osCreateThread(&D_80280428, 5, func_802473B4, NULL, &D_8027FC28[2040], 60);
osCreateThread(&D_80280428, 5, func_802473B4, NULL, &D_8027FC28[2048], 60);
osStartThread(&D_80280428);
}

View File

@@ -61,12 +61,16 @@ u32 D_80280724;
u32 D_80280728;
struct1 D_80280730[8];
OSMesgQueue D_80280770;
OSMesg D_80280788[10];
OSMesgQueue D_802807B0;
OSMesg D_802807C8[1];
OSMesgQueue D_802807D0;
OSMesg D_802807E8[60];
volatile s32 D_802808D8;
s32 D_802808DC;
OSThread D_802808E0;
u8 pad_80280970[0x520];
#define THREAD0_STACK_SIZE 0x400
u8 thread0_stack[THREAD0_STACK_SIZE];
extern u8 D_803A5D00[2][0x1ECC0]; //framebuffer
@@ -100,7 +104,6 @@ void func_8024BDAC(OSMesgQueue *mq, OSMesg msg){
}
void func_8024BE30(void){
extern s32 D_80280E90;
s32 i;
func_8024C428();
@@ -113,9 +116,9 @@ void func_8024BE30(void){
osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON);
osViSetSpecialFeatures(OS_VI_GAMMA_OFF);
osViSwapBuffer(&D_803A5D00);
osCreateMesgQueue(&D_80280770, (&D_80280770 + 1), 10);
osCreateMesgQueue(&D_802807B0, (&D_802807B0 + 1), 1);
osCreateMesgQueue(&D_802807D0, (&D_802807D0 + 1), 0x3C);
osCreateMesgQueue(&D_80280770, D_80280788, 10);
osCreateMesgQueue(&D_802807B0, D_802807C8, 1);
osCreateMesgQueue(&D_802807D0, D_802807E8, 60);
osViSetEvent(&D_80280770,NULL,1);
D_80280720 = 0;
D_80280724 = 1;
@@ -125,7 +128,7 @@ void func_8024BE30(void){
}
D_802808D8 = 0;
func_8024BF94(2);
osCreateThread(&D_802808E0,0,func_8024C2F8,NULL,&D_80280E90,0x50);
osCreateThread(&D_802808E0,0,func_8024C2F8,NULL,&thread0_stack[THREAD0_STACK_SIZE],80);
osStartThread(&D_802808E0);
}

View File

@@ -12,6 +12,7 @@ struct {
f32 unkC;
f32 unk10;
}D_8037D450;
u32 pad_8037D464;
u8 D_8037D468;
/* .code */

View File

@@ -7,7 +7,7 @@
#endif
extern s16 D_803A5D00[2][0xF660]; //framebuffer
extern u8 D_8037DCC8[]; //bottels bonus flags???
extern u8 D_8037DCC8; //bottles bonus flags???
extern void ml_vec3f_assign(f32[3], f32, f32, f32);
@@ -61,9 +61,8 @@ ActorInfo D_80368418 = {
/* .bss */
ActorMarker *chBottlesBonusCursorMarker;
f32 D_8037E068[20][2];
f32 D_8037E068[60][2];
Struct_core2_584D0_0 D_8037E248[20]; //puzzle pieces
u8 pad_8037E478[0x140];
s32 D_8037E5B8;
struct {
s32 unk0;

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/code_C9E70.h"
#include "core2/modelRender.h"
#ifndef ABS
@@ -77,10 +78,21 @@ ActorInfo D_80365F00 = { 0xE6, 0x197, 0x532, 0x1, D_80365ED0, func_802C4C14, fun
/* .bss */
// Remove this when this memory region is properly symbolized
u8 unk_8037DCB0[0x8037DCE0 - 0x8037DCB0];
extern u8 D_8037DCCE[0x12];
s32 D_8037DCB0;
u32 D_8037DCB4;
struct FF_StorageStruct* D_8037DCB8;
s32 D_8037DCBC;
u8 D_8037DCC0[7];
u8 D_8037DCC7;
u8 D_8037DCC8;
u8 D_8037DCC9;
u8 D_8037DCCA;
u8 D_8037DCCB;
u8 D_8037DCCC;
u8 D_8037DCCD;
u8 D_8037DCCE[3];
s32 pad_8037DCD4;
s32 pad_8037DCD8;
struct {
u8 *unk0;

View File

@@ -93,14 +93,14 @@ struct {
D_8037C6F0;
/*.code */
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_12F30/func_80299EC0.s")
#else
void func_80299EC0(f32 arg0[3]) {
f32 spEC[3]; //player_pos
f32 spE0[3];
f32 spD4[3];
f32 a;
f32 f0;
BKModelBin *spC8;
f32 f2;
f32 spB8[3];
f32 spAC[3];
f32 spA0[3];
@@ -110,17 +110,14 @@ void func_80299EC0(f32 arg0[3]) {
f32 sp70;
BKCollisionTri *sp6C; //floor_vtx_list
f32 sp48[3][3]; //tri_vtx_coord
f32 temp_f0_2;
f32 temp_f2_2;
f32 temp_f2_4;
Vtx *vtx_buffer;
Vtx *temp_v1;
f32 phi_f18;
f32 f18;
arg0[2] =
arg0[1] =
arg0[0] = 255;
arg0[0] = 255.0f;\
arg0[1] = 255.0f;\
arg0[2] = 255.0f;
if (D_8037C6F0.unk0 == 1) {
sp78 = 50;
} else if (func_8028EE84() == BSWATERGROUP_0_NONE) {
@@ -134,77 +131,89 @@ void func_80299EC0(f32 arg0[3]) {
if (spC8 == NULL) {
sp6C = NULL;
}
if ((spEC[1] - func_80294438()) > 100.0f) {
if ((spEC[1] - func_80294438()) > 100) {
sp6C = NULL;
}
if (sp6C == NULL) return;
if (sp6C->unk6 &2) return;
vtx_buffer = vtxList_getVertices(model_getVtxList(spC8));
for(i = 0; i<3; i++){
temp_v1 = vtx_buffer + sp6C->unk0[i];
sp48[i][0] = (f32) temp_v1->v.ob[0];
sp48[i][1] = (f32) temp_v1->v.ob[1];
sp48[i][2] = (f32) temp_v1->v.ob[2];
sp48[i][1] = 0.0f;
sp48[i][1] = 0;
sp7C[i][0] = (f32) temp_v1->v.cn[0];
sp7C[i][1] = (f32) temp_v1->v.cn[1];
sp7C[i][2] = (f32) temp_v1->v.cn[2];
}
// spEC[1] = 0.0f;
spEC[1] = 0;
spE0[0] = spEC[0] - sp48[0][0];
spE0[1] = 0;
spE0[2] = spEC[2] - sp48[0][2];
spE0[1] = 0.0f;
spAC[0] = sp48[0][0] - sp48[1][0];
spAC[1] = 0;
spAC[2] = sp48[0][2] - sp48[1][2];
spAC[1] = 0.0f;
spB8[0] = -(sp48[2][2] - sp48[1][2]);
spB8[2] = sp48[2][0] - sp48[1][0];
spB8[1] = 0.0f;
phi_f18 = (spE0[0] * spB8[0]) + (spE0[1] * spB8[1]) + (spB8[2] * spE0[2]);
phi_f18 = (phi_f18 == 0.0f)? 0.1f : phi_f18;
temp_f0_2 = -((spB8[2] * spAC[2]) + ((spAC[0] * spB8[0]) + 0.0f)) / phi_f18;
spA0[0] = (spE0[0] * temp_f0_2) + sp48[0][0];
spA0[1] = 0.0f;
spA0[2] = (spE0[2] * temp_f0_2) + sp48[0][2];
spB8[0] = sp48[2][0] - sp48[1][0];
spB8[1] = 0;
spB8[2] = sp48[2][2] - sp48[1][2];
//swap
sp70 = spB8[0];
spB8[0] = -spB8[2];
spB8[2] = sp70;
f18 = spE0[0]*spB8[0] + spE0[1]*spB8[1] + spE0[2]*spB8[2];
if (f18 == 0) {
f18 = 0.1;
}
f0 = -(spAC[0]*spB8[0] + spAC[1]*spB8[1] + spAC[2]*spB8[2]) / f18;
spA0[0] = sp48[0][0] + (spE0[0] * f0);
spA0[1] = 0;
spA0[2] = sp48[0][2] + (spE0[2] * f0);
spD4[0] = spA0[0] - sp48[1][0];
spD4[1] = spA0[1] - sp48[1][1];
spD4[2] = spA0[2] - sp48[1][2];
temp_f2_2 = gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) / (gu_sqrtf(spB8[0] * spB8[0] + spB8[1] * spB8[1] + spB8[2] * spB8[2]) + 0.01);
f2 = gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2])
/ (gu_sqrtf(spB8[0]*spB8[0] + spB8[1]*spB8[1] + spB8[2]*spB8[2]) + 0.01);
for(i = 0; i < 3; i++){
arg0[i] = sp7C[1][i] + (sp7C[2][i] - sp7C[1][i])*temp_f2_2;
arg0[i] = sp7C[1][i] + (sp7C[2][i] - sp7C[1][i]) * f2;
}
spD4[0] = spA0[0] - sp48[0][0];
spD4[1] = spA0[1] - sp48[0][1];
spD4[2] = spA0[2] - sp48[0][2];
temp_f2_4 = (1.0 - (gu_sqrtf(spE0[0]*spE0[0] + spE0[1]*spE0[1] + spE0[2]*spE0[2]) / (gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) + 0.01)));
f2 = 1 - (gu_sqrtf(spE0[0]*spE0[0] + spE0[1]*spE0[1] + spE0[2]*spE0[2])
/ (gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) + 0.01));
for(i = 0; i < 3; i++){
arg0[i] += (sp7C[0][i] - arg0[i])*temp_f2_4;
arg0[i] = arg0[i] + (sp7C[0][i] - arg0[i]) * f2;
}
f2 = func_80294404() / 100;
for(i = 0; i < 3; i++){
arg0[i] = arg0[i] + (255 - arg0[i]) * f2;
}
for(i = 0; i < 3; i++){
arg0[i] += (255.0f - arg0[i]) * (func_80294404() / 100.0f);
if(arg0[i] > 255){ arg0[i] = 255; }
if(arg0[i] < 0) { arg0[i] = 0; }
}
for(i = 0; i < 3; i++){
if(arg0[i] > 255.0f){ arg0[i] = 255.0f; }
if(arg0[i] < 0.0f) { arg0[i] = 0.0f; }
}
arg0[0] = ((arg0[0] + arg0[1] + arg0[2]) * (f32) (0xFF - sp78)) / 765.0f + sp78;
arg0[0] = ((arg0[0] + arg0[1] + arg0[2]) * (255 - sp78)) / 765 + sp78;
arg0[1] = arg0[0];
arg0[2] = arg0[0];
}
#endif
void func_8029A47C(s32 arg0[3]){
arg0[0] = (s32)(D_8037C6F0.unk4[0] + 0.5);

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/code_C9E70.h"
extern void func_8030DBFC(u32, f32, f32, f32);
extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32);
@@ -45,8 +46,6 @@ ActorInfo D_80367310 = {MARKER_217_BEE_SWARM, ACTOR_34D_BEE_SWARM, ASSET_49E_SPR
0, 0, 1.0f, 0
};
/* .bss */
extern s32 D_8037DCBC;
/* .code */

View File

@@ -39,6 +39,7 @@ ActorInfo D_80368620 = {
/* .bss */
ActorMarker *D_8037E620;
f32 D_8037E624;
f32 D_8037E628;
s32 D_8037E62C;
s32 D_8037E630;
@@ -292,7 +293,6 @@ void chsnacker_update(Actor *this) {
this->depth_mode = (255.0 == local->unk4) ? MODEL_RENDER_DEPTH_FULL : MODEL_RENDER_DEPTH_COMPARE;
}
extern f32 D_8037E624;
void func_802E1790(void){
D_8037E624 = 0.0f;
D_8037E628 = 1.0f;

View File

@@ -9,7 +9,6 @@ typedef struct map_savestate_s{
/* .bss */
s32 D_8037E650[0x9A];
u8 pad_8037E8A8[0x18];
/* public functions */
void func_802E3BD0(s32 frame_buffer_indx);

View File

@@ -117,9 +117,6 @@ struct {
s32 unk44;
} D_80381FA0;
u8 D_80381FE8[0x50];
/* .code */
void func_80301F10(Cube *cube, Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_80308F0C(cube);
@@ -252,6 +249,7 @@ void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s3
sp44 -= D_80381FA0.stride[0];
}
}
u8 D_80381FE8[0x50];
void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s32 arg5[3]) {
s32 sp54;
@@ -541,6 +539,7 @@ Cube *func_8030364C(void){
return D_80381FA0.unk40;
}
s32 D_803820A8[3];
Cube *func_80303658(void){
return D_80381FA0.unk3C;
}
@@ -637,6 +636,11 @@ BKCollisionTri * func_80303960(f32 volume_p1[3], f32 volume_p2[3], f32 radius, f
return var_s5;
}
s32 D_803820B8[0x20]; //ActorProp *, (maybe Prop *)
u8 pad_80382138[4];
s32 D_8038213C;
extern Cube *D_80382144;
//BKCollisionTri *
BKCollisionTri * func_80303AF0(f32 position[3], f32 radius, f32 arg2[3], u32 arg3) {
s32 cube_indx[3];
@@ -664,7 +668,6 @@ BKCollisionTri * func_80303AF0(f32 position[3], f32 radius, f32 arg2[3], u32 arg
return var_s5;
}
s32 D_803820B8[0x20]; //ActorProp *, (maybe Prop *)
void func_80303C54(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *arg4, s32 *arg5) {
ActorProp *phi_s0;
@@ -676,7 +679,7 @@ void func_80303C54(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *arg
phi_s0 = func_803322F0(cube, marker, arg2, arg3, arg4);
if (phi_s0 != NULL) {
if (phi_s0->unk8_0 && phi_s0->marker->unk58 != NULL) {
if (phi_s0->marker->unk58(phi_s0->marker, marker) == 0) {
if (phi_s0->marker->unk58(phi_s0->marker, marker) == 0) {
phi_s0 = NULL;
}
}
@@ -688,7 +691,10 @@ void func_80303C54(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *arg
};
}
s32 D_8038213C;
Cube *D_80382144;
s32 D_80382148;
s16 D_80382150[0x48];
u32 D_803821E0[0x5B];
void func_80303D78(ActorMarker *arg0, f32 arg1, UNK_TYPE(s32) arg2) {
s32 sp6C[3];
s32 sp60[3];
@@ -727,17 +733,19 @@ void func_80303F6C(s32 indx, s32 arg1){
ActorProp *func_80303F7C(ActorMarker *arg0, f32 arg1, s32 arg2, s32 arg3) {
s32 temp_v1;
s32 phi_a0;
static s32 D_80382148;
// This matches without a pointer by using a function static, but
// triggers tricky bss reordering.
s32* D_80382148_ptr = &D_80382148;
if (arg3 == 0) {
func_80303D78(arg0, arg1, arg2);
D_80382148 = 0;
*D_80382148_ptr = 0;
return 0;
}
else{
temp_v1 = D_803820B8[D_80382148];
temp_v1 = D_803820B8[*D_80382148_ptr];
if (temp_v1 != 0) {
D_80382148++;
(*D_80382148_ptr)++;
}
return temp_v1;
}
@@ -2042,10 +2050,8 @@ u32 func_80307EA8(s32 arg0, s32 arg1[3], s32 *arg2, s32 *arg3) {
u32 var_s4;
NodeProp *temp_a0;
Cube *temp_v0;
static s32 D_803820A8[3];
static s32 D_803820B4;
var_s4 = 0;
if (arg0 == 0) {
D_803820A8[0] = (s32) D_80381FA0.min[0];
@@ -2154,11 +2160,9 @@ bool func_803082D8(Cube *arg0, s32 *arg1, bool arg2, bool arg3) {
return var_a0;
}
Cube *D_80382144;
s32 func_803083B0(s32 arg0) {
s32 var_v0;
Cube *var_s0;
static u8 a;
static s32 D_80382140;
if (arg0 == -1) {
@@ -2323,9 +2327,6 @@ bool func_803088C8(s32 arg0) {
return (D_8036ABAC[i] == -1) ? FALSE : TRUE;
}
/* .bss */ //must be defined AFTER func_80303F7C for local static alignment
s16 D_80382150[0x48];
/* .code */
void func_8030895C(s32 arg0){
D_80382150[D_8036ABD4] = arg0;
@@ -2416,9 +2417,6 @@ void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
func_8032F464(0);
}
/* .bss */
u32 D_803821E0[0x5B];
/* .code */
void func_80308EC8(void){
s32 i;

View File

@@ -5,8 +5,9 @@
extern ALBank *music_get_sound_bank(void);
extern u8 D_D846C0;
extern u8 D_D954B0;
extern u8 soundfont1ctl_ROM_START[];
extern u8 soundfont1ctl_ROM_END[];
extern u8 soundfont1tbl_ROM_START[];
struct {
s32 unk0; //sound state cnt
@@ -25,12 +26,12 @@ void sfxInstruments_init(void){
ALBankFile * bnkf;
size = &D_D954B0 - &D_D846C0;
size = soundfont1ctl_ROM_END - soundfont1ctl_ROM_START;
bnkf = (ALBankFile *)malloc(size);
osWritebackDCache(bnkf, size);
osPiStartDma(func_802405D0(), 0, 0, &D_D846C0, bnkf, size, func_802405C4());
osPiStartDma(func_802405D0(), 0, 0, (u32)soundfont1ctl_ROM_START, bnkf, size, func_802405C4());
osRecvMesg(func_802405C4(), NULL, 1);
alBnkfNew(bnkf, &D_D954B0);
alBnkfNew(bnkf, soundfont1tbl_ROM_START);
bnk = bnkf->bankArray[0];
inst = bnk->instArray[0];
D_803835F0.unk0 = inst->soundCount;

View File

@@ -437,7 +437,7 @@ void assetCache_init(void){
assetCacheAssetIdList = (s16 *)malloc(150*sizeof(s16));
assetCacheLength = 0;
assetSectionRomHeader = (AssetROMHead *)malloc(sizeof(AssetROMHead));
D_80383CC8 = (u32) &D_5E90;
D_80383CC8 = (u32)assets_ROM_START;
func_802405F0(assetSectionRomHeader, D_80383CC8, sizeof(AssetROMHead));
assetSectionRomMetaList = (AssetFileMeta *)malloc(assetSectionRomHeader->count*sizeof(AssetFileMeta));
func_802405F0(assetSectionRomMetaList, D_80383CC8 + sizeof(AssetROMHead),assetSectionRomHeader->count*sizeof(AssetFileMeta));

View File

@@ -14,9 +14,7 @@ extern f32 func_80323FDC(struct56s *, f32, f32, s32 *);
extern f32 func_803240E0(struct56s *, f32, f32, s32 *);
extern void func_8032417C(struct56s *, f32, f32[3], f32[3]);
extern void func_80328FF0(Actor *, f32);
extern void func_8032DC70(s32);
typedef struct {
f32 unk0;
@@ -153,6 +151,7 @@ typedef struct {
u16 pad8_12:13;
}Struct_glspline_803411B0;
s32 func_80341BC8(struct56s *arg0, SplineList * arg1);
/* .data */
@@ -260,239 +259,268 @@ f32 glspline_catmull_rom_interpolate(f32 x, s32 knotCount, f32 *knotList) {
return (((((sp24[2] * x) + sp24[1]) * x) + sp24[0]) * x) + (1.0*knotList[1]);
}
#ifndef NONMATCHING
void func_80340BE4(f32 arg0, s32 arg1, s32 arg2, s32 arg3, f32 * arg4, f32 arg5[3]);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340BE4.s")
#else
void func_80340BE4(f32 x, s32 length, s32 stride, s32 width, f32 *arg4, f32 *dst){
s32 spD0;
void func_80340BE4(f32 x, s32 length, s32 stride, s32 width, f32 *arg4, f32 dst[3]){
s32 padding;
s32 max_interval;
s32 i;
s32 var_a3;
s32 a3;
f32 temp_f2;
f32 f3;
f32 f1;
f32 f2;
f32 *t0;
f32 sp94[3][3];
max_interval = length - 1;
if (length < 4) {
/* not enough points in spline to perform catmull-rom interpolation*/
ml_vec3f_copy(sp94[0], arg4);
ml_vec3f_copy(sp94[1], arg4);
ml_vec3f_copy(sp94[2], arg4 + stride);
ml_vec3f_copy(sp94[2], &arg4[stride]);
if (length - 1 == 1) {
ml_vec3f_copy(sp94[3], arg4 + stride);
ml_vec3f_copy(sp94[3], &arg4[stride]);
} else {
ml_vec3f_copy(sp94[3], arg4 + 2*stride);
ml_vec3f_copy(sp94[3], &arg4[stride*2]);
}
func_80340BE4(x, 4, 3, 3, sp94, dst);
func_80340BE4(x, 4, 3, 3, (f32 *) sp94, dst);
return;
}
temp_f2 = func_80340700(x, 0.0f, 1.0f) * max_interval;
var_a3 = (s32)temp_f2;
var_a3 = ((length - 1) < var_a3) ? (length - 1) : var_a3;
x = temp_f2 - (f32) var_a3;
if (0 == var_a3) {
/* desired point in interval[0,1], duplicate P0 to left */
arg4 = arg4 + 0;
for(var_a3 = var_a3; var_a3 < width; var_a3++){
f3 = -0.5*arg4[var_a3] + 1.5*arg4[var_a3] + -1.5*arg4[stride + var_a3] + 0.5*arg4[2*stride + var_a3];
f1 = 1.0*arg4[var_a3] + -2.5*arg4[var_a3] + 2.0*arg4[stride + var_a3] + -0.5*arg4[2*stride + var_a3];
f2 = -0.5*arg4[var_a3] + 0.0*arg4[var_a3] + 0.5*arg4[stride + var_a3] + 0.0*arg4[2*stride + var_a3];
dst[var_a3] = ((((f3 * x) + f1)* x + f2) * x) + (1.0*arg4[var_a3]);
}
return;
a3 = temp_f2;
if (a3 > (length - 1)) {
a3 = (length - 1);
}
spD0 = var_a3 - 1;
if (length == (var_a3 + 1)) {
arg4 = arg4 + spD0*stride;
for(var_a3 = 0; var_a3 < width; var_a3++){
/* desired point in interval[n, inf], linearly interpret */
dst[var_a3] = arg4[var_a3];
}
} else if (length == (spD0 + 2)) {
/* desired point in interval[n-1, n], duplicate Pn to right */
for(var_a3 = 0; var_a3 < width; var_a3++){
f3 = -0.5*arg4[spD0*stride + var_a3] + 1.5*arg4[(spD0 + 1)* stride + var_a3] + -1.5*arg4[(spD0 + 2)* stride + var_a3] + 0.5*arg4[(spD0 + 2)* stride + var_a3];
f1 = 1.0*arg4[spD0*stride + var_a3] + -2.5*arg4[(spD0 + 1)* stride + var_a3] + 2.0*arg4[(spD0 + 2)* stride + var_a3] + -0.5*arg4[(spD0 + 2)* stride + var_a3];
f2 = -0.5*arg4[spD0*stride + var_a3] + 0.0*arg4[(spD0 + 1)* stride + var_a3] + 0.5*arg4[(spD0 + 2)* stride + var_a3] + 0.0*arg4[(spD0 + 2)* stride + var_a3];
dst[var_a3] = ((((f3 * x) + f1)* x + f2) * x) + (1.0*arg4[((spD0 + 1) * stride) + var_a3]);
x = temp_f2 - a3;
if (a3 == 0) {
/* desired point in interval[0,1], duplicate P0 to left */
t0 = arg4;
t0 += (stride * 2);
for (; a3 < width; a3++) {
f3 = -0.5*arg4[a3] + 1.5*arg4[a3] + -1.5*arg4[stride + a3] + 0.5*t0[a3];
f1 = 1.0*arg4[a3] + -2.5*arg4[a3] + 2.0*arg4[stride + a3] + -0.5*t0[a3];
if (1);
f2 = -0.5*arg4[a3] + 0.0*arg4[a3] + 0.5*arg4[stride + a3] + 0.0*t0[a3];
dst[a3] = (1.0*arg4[a3]) + (((f3 * x + f1) * x + f2) * x);
}
} else {
/* normal conditions */
for(var_a3 = 0; var_a3 < width; var_a3++){
f3 = -0.5*arg4[spD0*stride + var_a3] + 1.5*arg4[(spD0 + 1)*stride + var_a3] + -1.5*arg4[(spD0 + 2)* stride + var_a3] + 0.5*arg4[(spD0 + 3)* stride + var_a3];
f1 = 1.0*arg4[spD0*stride + var_a3] + -2.5*arg4[(spD0 + 1)*stride + var_a3] + 2.0*arg4[(spD0 + 2)* stride + var_a3] + -0.5*arg4[(spD0 + 3)* stride + var_a3];
f2 = -0.5*arg4[spD0*stride + var_a3] + 0.0*arg4[(spD0 + 1)*stride + var_a3] + 0.5*arg4[(spD0 + 2)* stride + var_a3] + 0.0*arg4[(spD0 + 3)* stride + var_a3];
// var_f8 =
dst[var_a3] = ((((f3 * x) + f1)* x + f2) * x) + (1.0*arg4[(spD0 + 1)*stride + var_a3]);
a3--;
if (a3 == length - 2) {
arg4 += stride * (length - 1);
for (a3 = 0; a3 < width; a3++) {
/* desired point in interval[n, inf], linearly interpret */
dst[a3] = arg4[a3];
}
} else if (a3 == length - 3) {
/* desired point in interval[n-1, n], duplicate Pn to right */
arg4 += a3 * stride;
t0 = arg4;
t0 += (stride * 2);
for (a3 = 0; a3 < width; a3++) {
f3 = -0.5*arg4[a3] + 1.5*arg4[stride + a3] + -1.5*t0[a3] + 0.5*t0[a3];
f1 = 1.0*arg4[a3] + -2.5*arg4[stride + a3] + 2.0*t0[a3] + -0.5*t0[a3];
f2 = -0.5*arg4[a3] + 0.0*arg4[stride + a3] + 0.5*t0[a3] + 0.0*t0[a3];
dst[a3] = (1.0*arg4[stride + a3]) + (((f3 * x + f1) * x + f2) * x);
}
} else {
/* normal conditions */
arg4 += a3 * stride;
t0 = arg4;
t0 += (stride * 2);
for (a3 = 0; a3 < width; a3++) {
f3 = -0.5*arg4[a3] + 1.5*arg4[stride + a3] + -1.5*t0[a3] + 0.5*arg4[stride*3 + a3];
f1 = 1.0*arg4[a3] + -2.5*arg4[stride + a3] + 2.0*t0[a3] + -0.5*arg4[stride*3 + a3];
f2 = -0.5*arg4[a3] + 0.0*arg4[stride + a3] + 0.5*t0[a3] + 0.0*arg4[stride*3 + a3];
dst[a3] = (1.0*arg4[stride + a3]) + (((f3 * x + f1) * x + f2) * x);
}
}
}
}
#endif
void func_80341180(f32 arg0, s32 arg1, s32 arg2, f32 arg3[3], f32 arg4[3]){
func_80340BE4(arg0, arg1, arg2, arg2, arg3, arg4);
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803411B0.s")
#else
void func_803411B0(void) {
void func_803411B0(void){
s32 spE4;
s32 spE0;
s32 a0;
Struct_glspline_803411B0 *spD8;
s32 spCC[3];
s32 spC8;
s32 spC4;
s32 padding[3];
struct56s *spB4;
SplineList *spA8;
struct56s *spA4;
Union_glspline *sp80;
Struct_glspline_803411B0 *sp50;
Union_glspline *temp_s6;
Struct_glspline_803411B0 *spline;
Union_glspline *var_s0_2;
SplineList *spA8;
f32 *spA4;
Union_glspline *var_s1_2;
s32 temp_v0_2;
s32 var_a0;
s32 var_a0_3;
s32 var_a0_4;
s32 var_a0_5;
s32 var_fp;
s32 var_s0;
s32 var_s2;
s32 var_s2_2;
Union_glspline sp80;
s32 var_s5;
s32 var_s7;
s32 var_v1;
u32 var_s7;
Union_glspline *temp_s3_2;
Union_glspline *temp_v0_16;
Struct_glspline_803411B0 *temp_v0_17;
Struct_glspline_803411B0 *var_v0_4;
s16 *i_ptr;
s32 tmp;
D_80371E80 = 0;
D_80371E70 = malloc(0);
D_80371E74 = malloc(0);
D_80371E78 = 0;
D_803858A0 = (s16 *) malloc(0x80*sizeof(s16));
for(var_v1 = 0; var_v1 < 0x80; var_v1++){
D_803858A0[var_v1] = 0;
D_803858A0 = malloc(128 * sizeof(s16));
for (spE0 = 0; spE0 < 128; spE0++) {
D_803858A0[spE0] = 0;
}
spE4 = func_80307E1C(D_803858A0) + 1;
if (spE4 > 1) {
spD8 = (Struct_glspline_803411B0 *)malloc(spE4 * sizeof(Struct_glspline_803411B0));
for(var_a0 = 0; var_a0 < spE4; var_a0++){
spD8[var_a0].unk0 = -1;
spE4 = func_80307E1C() + 1;
if (spE4 <= 1) {
return;
}
spD8 = (Struct_glspline_803411B0 *) malloc(spE4 * sizeof(Struct_glspline_803411B0));
for (spE0 = 0; spE0 < spE4; spE0++) {
(spD8 + spE0)->unk0 = -1;
}
func_80307EA8(0, spCC, &spC8, &spC4);
do {
spE0 = func_80307EA8(1, spCC, &spC8, &spC4);
if (spE0 >= 0) {
(spD8+spE0)->unk0 = spC8;
(spD8+spE0)->unk8_13 = spC4;
(spD8+spE0)->unk2[0] = spCC[0];
(spD8+spE0)->unk2[1] = spCC[1];
(spD8+spE0)->unk2[2] = spCC[2];
}
} while (spE0 >= 0);
for (spE0 = 1; spE0 < spE4; spE0++) {
(spD8+spE0)->unk8_15 = 0;
func_80307EA8(0, spCC, &spC8, &spC4);
do {
temp_v0_2 = func_80307EA8(1, spCC, &spC8, &spC4);
if (temp_v0_2 >= 0) {
spD8[temp_v0_2].unk0 = (s16) spC8;
spD8[temp_v0_2].unk2[0] = (s16) spCC[0];
spD8[temp_v0_2].unk2[1] = (s16) spCC[1];
spD8[temp_v0_2].unk2[2] = (s16) spCC[2];
spD8[temp_v0_2].unk8_13 = spC4;
}
} while (temp_v0_2 >= 0);
for(spE0 = 1; spE0 < spE4; spE0++) {
spD8[spE0].unk8_15 = 0;
if ((spD8[spE0].unk0 >= spE4) || (spD8[spE0].unk0 == -1)) {
spD8[spE0].unk0 = 0;
}
if ((spD8+spE0)->unk0 >= spE4 || (spD8+spE0)->unk0 == -1) {
(spD8+spE0)->unk0 = 0;
}
}
for(spE0 = 1; spE0 < spE4; spE0++) {
if (spD8[spE0].unk0 > 0) {
spD8[spD8[spE0].unk0].unk8_15 = 1;
}
for (spE0 = 1; spE0 < spE4; spE0++) {
if ((spD8+spE0)->unk0 > 0) {
(spD8+(spD8+spE0)->unk0)->unk8_15 = 1;
}
}
for(spE0 = 1; spE0 < spE4; spE0++) {
if( (spD8[spE0].unk8_13 == 1)
&& ((spD8[spE0].unk8_15 != 0) || (spD8[spE0].unk0 <= 0))
&& ((spD8[spE0].unk8_15 != 1) || (spD8[spE0].unk0 <= 0))
&& ((spD8[spE0].unk8_15 != 1) || (spD8[spE0].unk0 != 0))
) {
func_8032DC70();
spD8[spE0].unk0 = -1;
spD8[spE0].unk8_13 = 0;
for (spE0 = 1; spE0 < spE4; spE0++) {
if ((spD8+spE0)->unk8_13 == 1
&& ((spD8+spE0)->unk8_15 != 0 || (spD8+spE0)->unk0 <= 0)
&& ((spD8+spE0)->unk8_15 != 1 || (spD8+spE0)->unk0 <= 0)
&& ((spD8+spE0)->unk8_15 != 1 || (spD8+spE0)->unk0 != 0)) {
func_8032DC70(spE0);
(spD8+spE0)->unk0 = -1;
(spD8+spE0)->unk8_13 = 0;
}
}
for (spE0 = 1; spE0 < spE4; spE0++) {
if ((spD8+spE0)->unk0 > 0 && (spD8+spE0)->unk8_15 == 0 && (spD8+spE0)->unk8_13 == 0) {
var_s5 = 1;
var_s7 = 1;
var_s0 = 0;
var_fp = 0;
for (; var_s5 < spE4; var_s5++) {
(spD8+var_s5)->unk8_14 = 0;
}
for (var_s5 = spE0; (spD8+var_s5)->unk0 != 0 && !(spD8+var_s5)->unk8_14; var_s5 = (spD8+var_s5)->unk0) {
(spD8+var_s5)->unk8_14 = 1;
tmp = (spD8+var_s5)->unk8_13 == 0 ? 1 : 0;
var_s7 += tmp;
var_s0 += ((spD8+var_s5)->unk8_13 == 0) ? 0 : 1;
}
tmp = var_s7 * 3;
spB4 = (struct56s *) malloc(8 + tmp * sizeof(f32));
spA4 = (f32 *) spB4;
spB4->unk0 = var_s7;
spB4->unk4 = 0;
spA8 = (SplineList *) malloc(4 + var_s0 * sizeof(Union_glspline));
spA8->unk0 = var_s0;
var_s1_2 = &spA8->spline[0];
a0 = spE0;
var_s2 = spA8->unk0;
for (; var_s2 != 0; a0 = (spD8+a0)->unk0) {
if (0);
if ((spD8+a0)->unk8_13 == 1) {
temp_v0_16 = func_803080C8(a0);
temp_v0_16->t1.unk8.pad_bit7 = D_80371E78;
memcpy(var_s1_2, temp_v0_16, sizeof(Union_glspline));
var_s1_2++;
var_s2--;
}
}
}
for(spE0 = 1; spE0 < spE4; spE0++) {
if (spD8[spE0].unk0 > 0) {
if (spD8[spE0].unk8_15 == 0) {
if (!spD8[spE0].unk8_13) {
var_s7 = 1;
var_s0 = 0;
var_fp = 0;
for(var_s5 = 1; var_s5 < spE4; var_s5++){
spD8[var_s5].unk8_14 = 0;
}
temp_s3_2 = spA8->unk0 - 1 + spA8->spline;
var_v0_4 = &spD8[spE0];
while ((var_v0_4->unk0 != 0) && !(var_v0_4->unk8_14)) {
var_v0_4->unk8_14 = 1;
var_s7 += (var_v0_4->unk8_13 == 0) ? 1 : 0;
var_s0 += (var_v0_4->unk8_13 == 0) ? 0 : 1;
var_v0_4 = &spD8[var_v0_4->unk0];
}
do {
var_s2 = 0;
spB4 = (struct56s *) malloc(sizeof(struct56s) + (var_s7 * 3* sizeof(f32)));
spB4->unk0 = var_s7;
spB4->unk4 = 0;
spA8 = (SplineList *)malloc(sizeof(SplineList) + var_s0*sizeof(Union_glspline));
spA8->unk0 = var_s0;
var_s1_2 = &spA8->spline[0];
var_s2 = var_s0;
for(var_a0_4 = spE0; (var_s2 != 0); var_a0_4 = spD8[var_a0_4].unk0){
if (spD8[var_a0_4].unk8_13 == 1) {
temp_v0_16 = func_803080C8();
temp_v0_16->t1.unk8.pad_bit7 = (s8) D_80371E78;
memcpy(var_s1_2, temp_v0_16, 0x14);
var_s1_2++;
var_s2--;
}
}
temp_s6 = &spA8->spline[0];
temp_s3_2 = &spA8->spline[spA8->unk0];
var_s2_2 = 0;
do {
for(var_s0_2 = temp_s6; var_s0_2 < temp_s3_2; var_s0_2++){
if ((var_s0_2 + 1)->common.unk0 < var_s0_2->common.unk0) {
memcpy(sp80, var_s0_2, sizeof(Union_glspline));
memcpy(var_s0_2, var_s0_2 + 1, sizeof(Union_glspline));
memcpy(var_s0_2 + 1, sp80, sizeof(Union_glspline));
var_s2_2++;
}
}
} while (var_s2_2 != 0);
while(var_s7 != 0){
temp_v0_17 = &spD8[spE0];
if (!(temp_v0_17->unk8_13)) {
spB4->unk8[var_fp][0] = (f32) temp_v0_17->unk2[0];
spB4->unk8[var_fp][1] = (f32) temp_v0_17->unk2[1];
spB4->unk8[var_fp][2] = (f32) temp_v0_17->unk2[2];
var_s7--;
}
}
func_80341BC8(spB4, spA8);
for (var_s0_2 = &spA8->spline[0]; var_s0_2 < temp_s3_2; var_s0_2++) {
var_s1_2 = var_s0_2 + 1;
if (var_s0_2->common.unk0 > var_s1_2->common.unk0) {
memcpy(&sp80, var_s0_2, sizeof(Union_glspline));
memcpy(var_s0_2, var_s1_2, sizeof(Union_glspline));
memcpy(var_s1_2, &sp80, sizeof(Union_glspline));
var_s2++;
}
}
} while (var_s2);
a0 = var_s7;
for (var_s5 = spE0; a0 != 0; var_s5 = (spD8 + var_s5)->unk0) {
if (!(spD8 + var_s5)->unk8_13) {
spA4[var_fp + 2] = (spD8 + var_s5)->unk2[0];
spA4[var_fp + 3] = (spD8 + var_s5)->unk2[1];
spA4[var_fp + 4] = (spD8 + var_s5)->unk2[2];
var_fp += 3;
a0--;
}
}
func_80341BC8(spB4, spA8);
}
free(spD8);
}
free(spD8);
}
#endif
//glspline_free
void func_80341A54(void) {

View File

@@ -4,7 +4,7 @@
#include "core2/code_C9E70.h"
struct FF_StorageStruct *D_8037DCB8;
extern struct FF_StorageStruct *D_8037DCB8;
void func_80350E00(void){
quizQuestionAskedBitfield_defrag();

View File

@@ -15,7 +15,7 @@ extern u8 crc_ROM_START[];
// bk_boot segment crc next word
s32 D_803727F0 = 0;
s32 core2_D_803727F4 = CORE2_CODE_CRC2;
s32 D_803727F4 = CORE2_CODE_CRC2;
s32 D_803727F8 = 0;
s32 D_803727FC = 0;

View File

@@ -14,8 +14,8 @@ enum transformation_e D_8037C2D0;
f32 D_8037C2D8[3];
f32 D_8037C2E4;
enum asset_e D_8037C2E8;
u8 D_8037C2ED;
u8 D_8037C2EC;
u8 D_8037C2ED;
struct{
f32 unk0;

View File

@@ -41,7 +41,6 @@ s32 D_8037D940;
f32 D_8037D948[3];
f32 cameraPosition[3];
f32 cameraRotation[3];
f32 D_8037D96C;
f32 D_8037D974;
f32 D_8037D978;
f32 D_8037D97C;
@@ -188,7 +187,7 @@ void func_802BCA58(void) {
player_getPosition(player_position);
ml_vec3f_diff_copy(sp34, player_position, cameraPosition);
sp4C = player_getYaw();
sp48 = ml_map_f(mlAbsF((f32) (mlNormalizeAngle(D_8037D96C - sp4C) - 180.0)), 0.0f, 180.0f, D_8037D97C, D_8037D980);
sp48 = ml_map_f(mlAbsF((f32) (mlNormalizeAngle(cameraRotation[1] - sp4C) - 180.0)), 0.0f, 180.0f, D_8037D97C, D_8037D980);
func_80256E24(D_8037D9A8, 0.0f, sp4C, 0.0f, 0.0f, ml_map_f(gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]), 300.0f, 450.0f, 0.0f, sp48));
ml_vec3f_diff_copy(sp34, D_8037D9A8, D_8037D9B8);
if (func_802BC428()) {

View File

@@ -12,7 +12,7 @@ u64 gEntryStack[ENTRY_STACK_LEN_U64];
extern u8 core1_us_v10_rzip_ROM_START[];
extern u8 core1_us_v10_rzip_ROM_END[];
extern u8 D_8002D500;
extern u8 D_8023DA20;
extern u8 core1_VRAM;
extern u32 D_803FFE00[4];
void func_80000594(u8 **, u8 **);
@@ -23,7 +23,7 @@ void func_80000450(s32 arg0){
u8 *dst;
tmp = &D_8002D500;
dst = &D_8023DA20;
dst = &core1_VRAM;
osInitialize();
osPiRawStartDma(OS_READ, core1_us_v10_rzip_ROM_START, tmp, core1_us_v10_rzip_ROM_END - core1_us_v10_rzip_ROM_START);
while(osPiGetStatus() & PI_STATUS_DMA_BUSY);

View File

@@ -189,9 +189,18 @@ f32 D_80391774[3] = {-1290.0f, 0.0f, -1290.0f};
f32 D_80391780[3] = {1290.0f, 0.0f, -1290.0f};
f32 D_8039178C[3] = {1290.0f, 0.0f, 1290.0f};
f32 D_80391798[3] = {0.0f, 0.0f, 0.0f};
f32 D_803917A4[4] = {500.0f, 650.0f, 800.0f, 950.0f};
f32 D_803917B4[4] = {3.75f, 3.0f, 2.25f, 1.5f};
s32 D_803917C4[3] = {230, 230, 230};
f32 D_803917D0[4] = {2.4f, 2.1f, 1.8f, 1.5f};
f32 D_803917E0[3] = {0.0f, 186.0f, 0.0f};
f32 D_803917EC[3] = {-827.0f, 793.0f, 1700.0f};
f32 D_803917F8[3] = {827.0f, 793.0f, -1700.0f};
f32 D_80391804[3] = {0.0f, 0.0f, 1350.0f};
/* .bss */
f32 D_80392750;
f32 D_80392758[3];
f32 D_80392768[3];
f32 D_80392778[3];
@@ -207,70 +216,10 @@ u8 __chFinalBossJinjonatorHits;
u8 D_803927C7;
u8 D_803927C8;
u8 D_803927C9;
f32 D_803927D0[4][3]; //actually f32 [0x13][3], but exploded to match .bss wrapping
//Exploded for .bss matching
u8 D_80392800;
u8 D_80392801;
u8 D_80392802;
u8 D_80392803;
u8 D_80392804;
u8 D_80392805;
u8 D_80392806;
u8 D_80392807;
u8 D_80392808;
u8 D_80392809;
u8 D_8039280A;
u8 D_8039280B;
u8 D_8039280C;
u8 D_8039280D;
u8 D_8039280E;
u8 D_8039280F;
u8 D_80392810;
u8 D_80392811;
u8 D_80392812;
u8 D_80392813;
u8 D_80392814;
u8 D_80392815;
u8 D_80392816;
u8 D_80392817;
u8 D_80392818;
u8 D_80392819;
u8 D_8039281A;
u8 D_8039281B;
u8 D_8039281C;
u8 D_8039281D;
u8 D_8039281E;
u8 D_8039281F;
u8 D_80392820;
u8 D_80392821;
u8 D_80392822;
u8 D_80392823;
u8 D_80392824;
u8 D_80392825;
u8 D_80392826;
u8 D_80392827;
u8 D_80392828;
u8 D_80392829;
u8 D_8039282A;
u8 D_8039282B;
u8 D_8039282C;
u8 D_8039282D;
u8 D_8039282E;
u8 D_8039282F;
u8 D_80392830;
u8 D_80392831;
u8 D_80392832;
u8 D_80392833;
u8 D_80392834;
u8 D_80392835;
u8 D_80392836;
u8 D_80392837;
u8 D_80392838;
u8 D_80392839;
u8 D_8039283A;
u8 D_8039283B;
f32 D_803927D0[0x13][3];
f32 D_803928B8[3];
s32 D_803928C4;
f32 D_803928C8[3];
/* .code */
Actor *chfinalboss_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
@@ -1312,10 +1261,8 @@ void chfinalboss_phase2_update(ActorMarker *marker) {
}
void __chfinalboss_spawnStatue(enum bossjinjo_e statue_id) {
static f32 D_80392750;
s32 pad24_A;
s32 pad20_A;
f32* D_80392750_ptr = &D_80392750;
Actor *sp1C;
ActorLocal_fight_180 *local;
@@ -1343,8 +1290,8 @@ void __chfinalboss_spawnStatue(enum bossjinjo_e statue_id) {
break;
case BOSSJINJO_JINJONATOR:
D_80392750 = ((local->mirror_phase5) ? 0.0f : 180.0f);
sp1C = func_8032813C(ACTOR_3A9_JINJONATOR_STATUE_BASE, D_80391798, (s32)D_80392750);
*D_80392750_ptr = ((local->mirror_phase5) ? 0.0f : 180.0f);
sp1C = func_8032813C(ACTOR_3A9_JINJONATOR_STATUE_BASE, D_80391798, (s32)*D_80392750_ptr);
break;
}
sp1C->unk60 = (statue_id == BOSSJINJO_JINJONATOR) ? 5.25f : 1.54f;
@@ -1415,63 +1362,7 @@ void chfinalboss_dropHealth(ActorMarker *marker) {
SPAWNQUEUE_ADD_1(__chfinalboss_dropHealth, marker);
}
//exploded for .bss matching
u8 D_8039283C;
u8 D_8039283D;
u8 D_8039283E;
u8 D_8039283F;
u8 fight_D_80392840;
u8 D_80392841;
u8 D_80392842;
u8 D_80392843;
u8 D_80392844;
u8 D_80392845;
u8 D_80392846;
u8 D_80392847;
u8 D_80392848;
u8 D_80392849;
u8 D_8039284A;
u8 D_8039284B;
u8 D_8039284C;
u8 D_8039284D;
u8 D_8039284E;
u8 D_8039284F;
u8 D_80392850;
u8 D_80392851;
u8 D_80392852;
u8 D_80392853;
u8 D_80392854;
u8 D_80392855;
u8 D_80392856;
u8 D_80392857;
u8 D_80392858;
u8 D_80392859;
u8 D_8039285A;
u8 D_8039285B;
u8 D_8039285C;
u8 D_8039285D;
u8 D_8039285E;
u8 D_8039285F;
u8 D_80392860;
u8 D_80392861;
u8 D_80392862;
u8 D_80392863;
u8 fight_D_80392864;
u8 D_80392865;
u8 D_80392866;
u8 D_80392867;
u8 D_80392868;
u8 D_80392869;
u8 D_8039286A;
u8 D_8039286B;
u8 D_8039286C[0x4C];
f32 D_803928B8[2];
void chfinalboss_phase3_update(ActorMarker *marker) {
static f32 D_803917A4[4] = {500.0f, 650.0f, 800.0f, 950.0f};
static f32 D_803917B4[4] = {3.75f, 3.0f, 2.25f, 1.5f};
static s32 D_803917C4[3] = {230, 230, 230};
Actor *this;
ActorLocal_fight_180 *local;
f32 sp3C;
@@ -1578,8 +1469,14 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) {
ActorLocal_fight_180 *local;
f32 sp48;
f32 sp3C[3];
s32 i;
static s32 D_803928C4;
// TODO this union is only needed to avoid making D_803928C4 a function static.
// It uses a trick to generate the same codegen as if it were a function static by taking the address to it
// and using that pointer in its place. This avoids needing to deal with bss reordering issues in this file,
// but if bss can be solved without it then this union can be removed and just replaced with `i`.
union {
s32 i;
s32 *D_803928C4_ptr;
} iter;
local = (ActorLocal_fight_180 *)&this->local;
sp48 = animctrl_getAnimTimer(this->animctrl);
@@ -1595,6 +1492,7 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) {
case 30:
if ((local->unk3 == 2) && (local->unkA == 0)) {
iter.D_803928C4_ptr = &D_803928C4;
D_803927C8 = 1;
func_80311480(randi2(0, 5) + 0x1136, 4, NULL, NULL, NULL, NULL);
if ( !fileProgressFlag_get(FILEPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) ) {
@@ -1617,8 +1515,9 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) {
func_80324E38(8.8f, 0);
break;
}
for(D_803928C4 = 1; D_803928C4 < 5; D_803928C4++){
chfinalboss_spawnStatue(D_803928C4);
for(*iter.D_803928C4_ptr = 1; *iter.D_803928C4_ptr < 5; (*iter.D_803928C4_ptr)++){
chfinalboss_spawnStatue(*iter.D_803928C4_ptr);
}
}
break;
@@ -1666,17 +1565,16 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) {
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, D_803927C0);
sfxsource_setSampleRate(this->unk44_31, 26000);
for(i = 0; i < 4; i++){
if(__chFinalBossJinjoStatueMarker[i] != NULL){
marker_despawn(__chFinalBossJinjoStatueMarker[i]);
__chFinalBossJinjoStatueMarker[i] = NULL;
for(iter.i = 0; iter.i < 4; iter.i+=1){
if(__chFinalBossJinjoStatueMarker[iter.i] != NULL){
marker_despawn(__chFinalBossJinjoStatueMarker[iter.i]);
__chFinalBossJinjoStatueMarker[iter.i] = NULL;
}
}
break;
}
}
f32 D_803928C8[3];
ActorMarker *chfinalboss_findCollidingJinjo(Actor *this, f32 arg1) {
Actor *jinjo;
@@ -1768,8 +1666,6 @@ void chfinalboss_phase4_update(ActorMarker *marker) {
if (D_803927C4 == 0) {
fight_func_80387340(this, 1.0f);
if (actor_animationIsAt(this, 0.9999f)) {
static f32 D_803917D0[4] = {2.4f, 2.1f, 1.8f, 1.5f};
local->unk3++;
chfinalboss_phase4_setState(this, 0x1F);
this->unk60 = D_803917D0[sp70];
@@ -1976,8 +1872,6 @@ void chfinalboss_phase5_update(ActorMarker *marker) {
timed_setStaticCameraToNode(4.4f, sp38 + 3 + __chFinalBossJinjonatorHits);
}
} else {
static f32 D_803917E0[3] = {0.0f, 186.0f, 0.0f};
func_802BB3DC(0, 63.0f, 0.9f);
chjinjonator_finalAttack(jinjonator_marker);
func_8030E6D4(SFX_HEAVY_THUNDERSTORM_01);
@@ -2112,10 +2006,8 @@ void chfinalboss_phase5_update(ActorMarker *marker) {
if (actor_animationIsAt(this, 0.9f)) {
ncStaticCamera_exit();
if (local->mirror_phase5 == 0) {
static f32 D_803917EC[3] = {-827.0f, 793.0f, 1700.0f};
ncStaticCamera_setPositionAndTarget(D_803917EC, this->position);
} else {
static f32 D_803917F8[3] = {827.0f, 793.0f, -1700.0f};
ncStaticCamera_setPositionAndTarget(D_803917F8, this->position);
}
func_8038FC2C(1);
@@ -2272,9 +2164,6 @@ void chfinalboss_spawnShadow(ActorMarker *marker) {
}
void chfinalboss_update(Actor *this){
static f32 D_80391804[3] = {0.0f, 0.0f, 1350.0f};
ActorLocal_fight_180 *local = (ActorLocal_fight_180 *) &this->local;
s32 i;
s32 tmp_s0;

View File

@@ -16,7 +16,7 @@ ActorAnimationInfo fight_D_803919F0[] ={
{0x265, 1e+8f},
{0x265, 1e+8f},
};
ActorInfo D_80391A10 = {
ActorInfo fight_D_80391A10 = {
MARKER_276_STONE_JINJO, ACTOR_3A1_STONE_JINJO, ASSET_545_MODEL_STONE_JINJO,
0x1, fight_D_803919F0,
chstonejinjo_update, func_80326224, actor_draw,

View File

@@ -186,7 +186,7 @@ extern Struct_lair_5ED0_0 D_80393760[FF_QNF_CNT - 1] = {
};
extern struct FF_QuestionTypeInfo FF_QuestionTypeInfoArr[5] = {
struct FF_QuestionTypeInfo FF_QuestionTypeInfoArr[5] = {
{ 0x0, 100},
{ 0x64, 118},
{ 0xDA, 51},
@@ -194,7 +194,7 @@ extern struct FF_QuestionTypeInfo FF_QuestionTypeInfoArr[5] = {
{0x12B, 6}
};
extern struct {
struct {
u8 unk0;
s16 unk2;
s16 unk4;