Improved match for fox_ti, add custom gbi macro, some cleanup (#178)

* splits

* torch

* torch again

* headers

* merges

* format

* matches

* commit

* colpoly

* SY
This commit is contained in:
petrie911 2024-03-27 15:06:28 -05:00 committed by GitHub
parent 26a3873e16
commit 97f544c557
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 604 additions and 627 deletions

View File

@ -152,7 +152,7 @@ D_SZ_6006EB4:
{ type: SF64:OBJECT_INIT, offset: 0x6006EB4, symbol: D_SZ_6006EB4 }
D_SZ_6007558:
{type: SF64:COLPOLY, count: 316, offset: 0x6007558, symbol: D_SZ_6007558, mesh_symbol: D_SZ_6008E08 }
{type: SF64:COLPOLY, count: 316, offset: 0x6007558, symbol: D_SZ_6007558, mesh_symbol: D_SZ_OFFSET }
D_SZ_6009230:
{ type: SF64:HITBOX, offset: 0x6009230, symbol: D_SZ_6009230 }

View File

@ -98,7 +98,6 @@ extern Gfx D_6008370[];
extern Gfx D_6008770[];
extern Gfx D_6008830[];
extern Gfx D_6008AA0[];
extern Vec3s D_6008E08[];
extern Gfx D_6009250[];
extern u16* D_6009B34[];
extern u16 D_6009BB8[];
@ -391,7 +390,6 @@ extern Gfx D_6032580[];
extern Gfx D_6032BC0[];
extern Gfx D_6033000[];
extern Vec3s D_6033E08[];
extern f32 D_603486C[];
extern Gfx D_6034B90[];
extern f32 D_60359C8[];
extern f32 D_6035A14[];

View File

@ -428,8 +428,8 @@ void func_80094D20(f32, f32);
void func_80096A74(Player* player);
// fox_97F80
void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal);
s32 func_800988B4(Vec3f* vec, Plane* plane);
void func_80098860(PlaneF* plane, Vec3f* point, Vec3f* normal);
s32 func_800988B4(Vec3f* vec, PlaneF* plane);
s32 func_800998FC(Vec3f*, Vec3f*, Vec3f*, s32, Vec3f*, f32*);
// fox_A4290

View File

@ -12,12 +12,49 @@
#define RGBA16_GRN(color16) (((color16) >> 6) & 0x1F)
#define RGBA16_BLU(color16) (((color16) >> 1) & 0x1F)
// used for convenience while decopming. You should find/replace them with the full macros before PRing
#define GDL(dl) gSPDisplayList(gMasterDisp++, dl) // 06000000 dl
#define GPC(r, g, b, a) gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, r, g, b, a) // FA000000 RRGGBBAA
#define GEC(r, g, b, a) gDPSetEnvColor(gMasterDisp++, r, g, b, a) // FB000000 RRGGBBAA
#define GSGM_BACK() gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK) // B7000000 00002000, most common geometry mode changed
#define GCGM_BACK() gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK) // B6000000 00002000
#define gDPSetupTile(pkt, fmt, siz, width, height, dw, dh, \
cms, cmt, masks, maskt, shifts, shiftt) \
{ \
gDPTileSync(pkt); \
gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, 0,\
G_TX_RENDERTILE, 0, cmt, maskt, shiftt, cms, masks, shifts); \
gDPSetTileSize(pkt, G_TX_RENDERTILE, dw, dh, \
((width)-1) << G_TEXTURE_IMAGE_FRAC, \
((height)-1) << G_TEXTURE_IMAGE_FRAC) \
}
#define gsDPSetupTile(fmt, siz, width, height, dw, dh, \
cms, cmt, masks, maskt, shifts, shiftt) \
gsDPTileSync(), \
gsDPSetTile(fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, 0, \
G_TX_RENDERTILE, 0, cmt, maskt, shiftt, cms, masks, shifts), \
gsDPSetTileSize(G_TX_RENDERTILE, dw, dh, \
((width)-1) << G_TEXTURE_IMAGE_FRAC, \
((height)-1) << G_TEXTURE_IMAGE_FRAC),
#define gDPLoadTileTexture(pkt, timg, fmt, siz, width, height) \
{ \
gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \
gDPTileSync(pkt); \
gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, \
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); \
gDPLoadSync(pkt); \
gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \
(((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \
CALC_DXT(width, siz##_BYTES)); \
}
#define gsDPLoadTileTexture(timg, fmt, siz, width, height) \
gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \
gsDPTileSync(), \
gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \
0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, \
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), \
gsDPLoadSync(), \
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \
(((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \
CALC_DXT(width, siz##_BYTES)),
#define gSPSetOtherModeHi(pkt, settings) gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_BLENDMASK, 24, settings)
#define gsSPSetOtherModeHi(settings) gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_BLENDMASK, 24, settings)
@ -76,7 +113,7 @@ s32 Animation_GetLimbIndex(Limb* limb, Limb** skeleton);
void Animation_DrawLimb(s32 mode, Limb* limb, Limb* *skeleton, Vec3f* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* data);
void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* data, Matrix* transform);
s16 Animation_GetFrameData(Animation *animationSegmemt, s32 frame, Vec3f *frameTable);
s16 Animation_GetFrameCount(Animation *animationSegment);
s32 Animation_GetFrameCount(Animation *animationSegment);
void Animation_FindBoundingBox(Gfx* dList, s32 len, Vec3f *min, Vec3f *max, s32 *vtxFound, s32 *vtxCount, Vtx* *vtxList);
void Animation_GetDListBoundingBox(Gfx *dList, s32 len, Vec3f *min, Vec3f *max);
void Animation_GetSkeletonBoundingBox(Limb** skeletonSegment, Animation *animationSegment, s32 frame, Vec3f *min, Vec3f* max);

View File

@ -1,12 +1,12 @@
#ifndef PREVENT_CONTEXT_REORDERING_H
#define PREVENT_CONTEXT_REORDERING_H
// extern int Dummyhalf;
extern int Dummyhalf;
// struct Dummy0 {int x;};
// struct Dummy1 {int x;};
// struct Dummy2 {int x;};
struct Dummy3 {int x;};
struct Dummy4 {int x;};
// struct Dummy3 {int x;};
// struct Dummy4 {int x;};
struct Dummy5 {int x;};
struct Dummy6 {int x;};
struct Dummy7 {int x;};

View File

@ -9,6 +9,12 @@ typedef struct {
/* 0x8 */ f32 z;
} Vec3f; // size = 0xC
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6;
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f rot;
@ -21,13 +27,12 @@ typedef struct {
typedef struct {
/* 0x0 */ Vec3f normal;
/* 0xC */ f32 dist;
} Plane; // size = 0x10
} PlaneF; // size = 0x10
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6;
/* 0x0 */ Vec3s normal;
/* 0x8 */ s32 dist;
} PlaneI; // size = 0xC
typedef union {
float m[4][4];

View File

@ -21,9 +21,7 @@ typedef struct {
typedef struct {
/* 0x00 */ Triangle tri;
/* 0x06 */ s16 unk_06;
/* 0x08 */ Vec3s normal;
/* 0x10 */ s32 dist;
/* 0x08 */ PlaneI plane;
} CollisionPoly; // size = 0x14
typedef struct {

View File

@ -31,49 +31,6 @@ static char devstr17[] = "Banknumber %d\n";
static char devstr18[] = "Bank Offset %x %d %d\n";
static char devstr19[] = "PEP Touch %x \n";
static char D_800C50E8[] = "FastCopy";
static char D_800C50F4[] = "FastCopy";
static char devstr22[] = "Error: Cannot DMA Media [%d]\n";
static char devstr23[] = "Warning: size not align 16 %x (%s)\n";
static char devstr24[] = "Load Bank BG, Type %d , ID %d\n";
static char devstr25[] = "get auto\n";
static char devstr26[] = "get s-auto %x\n";
static char devstr27[] = "Clear Workarea %x -%x size %x \n";
static char devstr28[] = "AudioHeap is %x\n";
static char devstr29[] = "Heap reset.Synth Change %x \n";
static char devstr30[] = "Heap %x %x %x\n";
static char devstr31[] = "Main Heap Initialize.\n";
static char devstr32[] = "%d :WaveA %d WaveB %d Inst %d,Perc %d\n";
static char devstr33[] = "---------- Init Completed. ------------\n";
static char devstr34[] = " Syndrv :[%6d]\n";
static char devstr35[] = " Seqdrv :[%6d]\n";
static char devstr36[] = " audiodata :[%6d]\n";
static char devstr37[] = "---------------------------------------\n";
static char devstr38[] = "Entry--- %d %d\n";
static char devstr39[] = "---Block LPS here\n";
static char devstr40[] = "===Block LPS end\n";
static char D_800C52F4[] = "SLOWCOPY";
static char devstr42[] = "Req: Src %x Dest %x Len %x,media %d,retcode %d\n";
static char devstr43[] = "Remain Size %d\n";
static char devstr44[] = "---Block BG here\n";
static char devstr45[] = "===Block BG end\n";
static char devstr46[] = "Retcode %x\n";
static char devstr47[] = "Other Type: Not Write ID.\n";
static char devstr48[] = "BGLOAD:Error: dma length 0\n";
static char D_800C53AC[] = "BGCOPY";
static char devstr50[] = "Error: Already wavetable is touched %x.\n";
static char devstr51[] = "Touch Warning: Length zero %x\n";
static char devstr52[] = "It's busy now!!!!! %d\n";
static char devstr53[] = "BG LOAD BUFFER is OVER.\n";
static char devstr54[] = "Warning: Length zero %x\n";
static char devstr55[] = "Wave Load %d \n";
static char devstr56[] = "Total Bg Wave Load %d \n";
static char devstr57[] = "Receive %d\n";
static char devstr58[] = "============Error: Magic is Broken after loading.\n";
static char devstr59[] = "Remain DMA: %d\n";
static char devstr60[] = "N start %d\n";
static char devstr61[] = "============Error: Magic is Broken: %x\n";
static char devstr62[] = "Error: No Handle.\n";
static char devstr63[] = "Success: %x\n";
AudioSlowLoadBuffer gSlowLoads;
@ -652,6 +609,8 @@ void AudioLoad_RelocateFont(s32 fontId, u32 fontBaseAddr, void* relocData) {
gSoundFontList[fontId].instruments = (u32) &fontDataPtrs[1];
}
static char D_800C50F4[] = "FastCopy";
void AudioLoad_SyncDma(u32 devAddr, u8* ramAddr, u32 size, s32 medium) {
size = ALIGN16(size);
osInvalDCache(ramAddr, size);
@ -678,6 +637,12 @@ void AudioLoad_SyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMediu
func_8000FC8C(func_8000FC7C(unkMediumParam, &addr), addr, ramAddr, size);
}
static char devstr22[] = "Error: Cannot DMA Media [%d]\n";
static char devstr23[] = "Warning: size not align 16 %x (%s)\n";
static char devstr24[] = "Load Bank BG, Type %d , ID %d\n";
static char devstr25[] = "get auto\n";
static char devstr26[] = "get s-auto %x\n";
s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, u32 devAddr, void* ramAddr, u32 size,
OSMesgQueue* retQueue, s32 medium, const char* dmaType) {
OSPiHandle* handle;
@ -817,6 +782,18 @@ void AudioLoad_ProcessLoads(s32 resetStatus) {
AudioLoad_ProcessAsyncLoads(resetStatus);
}
static char devstr27[] = "Clear Workarea %x -%x size %x \n";
static char devstr28[] = "AudioHeap is %x\n";
static char devstr29[] = "Heap reset.Synth Change %x \n";
static char devstr30[] = "Heap %x %x %x\n";
static char devstr31[] = "Main Heap Initialize.\n";
static char devstr32[] = "%d :WaveA %d WaveB %d Inst %d,Perc %d\n";
static char devstr33[] = "---------- Init Completed. ------------\n";
static char devstr34[] = " Syndrv :[%6d]\n";
static char devstr35[] = " Seqdrv :[%6d]\n";
static char devstr36[] = " audiodata :[%6d]\n";
static char devstr37[] = "---------------------------------------\n";
void AudioLoad_Init(void) {
s32 pad[14];
s32 i;
@ -903,6 +880,9 @@ void AudioLoad_Init(void) {
func_800168BC();
}
static char devstr38[] = "Entry--- %d %d\n";
static char devstr39[] = "---Block LPS here\n";
static char devstr40[] = "===Block LPS end\n";
s32 AudioLoad_SlowLoadSample(s32 fontId, u8 instId, s8* status) {
Sample* sample;
AudioSlowLoad* slowLoad;
@ -1022,6 +1002,14 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) {
}
}
static char D_800C52F4[] = "SLOWCOPY";
static char devstr42[] = "Req: Src %x Dest %x Len %x,media %d,retcode %d\n";
static char devstr43[] = "Remain Size %d\n";
static char devstr44[] = "---Block BG here\n";
static char devstr45[] = "===Block BG end\n";
static char devstr46[] = "Retcode %x\n";
static char devstr47[] = "Other Type: Not Write ID.\n";
void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size) {
osInvalDCache(slowLoad->curRamAddr, size);
osCreateMesgQueue(&slowLoad->msgQueue, &slowLoad->msg, 1);
@ -1173,6 +1161,9 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
}
}
static char devstr48[] = "BGLOAD:Error: dma length 0\n";
static char D_800C53AC[] = "BGCOPY";
void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size) {
size = ALIGN16(size);
osInvalDCache(asyncLoad->curRamAddr, size);
@ -1189,13 +1180,17 @@ void AudioLoad_AsyncDmaUnkMedium(u32 devAddr, u8* ramAddr, u32 size, s32 unkMedi
func_8000FC8C(func_8000FC7C(unkMediumParam, &addr), addr, ramAddr, size);
}
static char devstr50[] = "Error: Already wavetable is touched %x.\n";
static char devstr51[] = "Touch Warning: Length zero %x\n";
void AudioLoad_RelocateSample(TunedSample* tSample, u32 fontDataAddr, SampleBankRelocInfo* relocInfo) {
void* reloc;
Sample* sample;
// "Error: Already wavetable is touched %x.\n";
if ((u32) tSample->sample <= 0x80000000) {
sample = tSample->sample = reloc = (u32) tSample->sample + fontDataAddr;
// arg0->sample = temp_v1;
// "Touch Warning: Length zero %x\n";
if ((sample->size != 0) && (sample->isRelocated != 1)) {
sample->loop = reloc = (u32) sample->loop + fontDataAddr;
sample->book = reloc = (u32) sample->book + fontDataAddr;
@ -1220,6 +1215,12 @@ void AudioLoad_RelocateSample(TunedSample* tSample, u32 fontDataAddr, SampleBank
}
}
static char devstr52[] = "It's busy now!!!!! %d\n";
static char devstr53[] = "BG LOAD BUFFER is OVER.\n";
static char devstr54[] = "Warning: Length zero %x\n";
static char devstr55[] = "Wave Load %d \n";
static char devstr56[] = "Total Bg Wave Load %d \n";
#ifdef NON_MATCHING
// gPreloadSampleStackTop ends up in the wrong register near the end. https://decomp.me/scratch/tGyym
s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, SampleBankRelocInfo* relocData, s32 isAsync) {
@ -1243,7 +1244,7 @@ s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, Sample
for (i = 0; i < gNumUsedSamples; i++) {
size += ALIGN16(gUsedSamples[i]->size);
}
if (size && size) {}
// if(size && size) {}
for (i = 0; i < gNumUsedSamples; i++) {
if (gPreloadSampleStackTop == 120) {
break;
@ -1297,13 +1298,11 @@ s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, Sample
break;
}
}
gNumUsedSamples = 0;
if ((gPreloadSampleStackTop != 0) && (inProgress == 0)) {
if ((gPreloadSampleStackTop != 0) && !inProgress) {
sample = gPreloadSampleStack[gPreloadSampleStackTop - 1].sample;
if (1) {}
// if (1) {}
nChunks = (sample->size / 0x1000) + 1;
AudioLoad_StartAsyncLoad(sample->sampleAddr, gPreloadSampleStack[gPreloadSampleStackTop - 1].ramAddr,
sample->size, sample->medium, nChunks, &gPreloadSampleQueue,
gPreloadSampleStack[gPreloadSampleStackTop - 1].encodedInfo);
@ -1313,6 +1312,16 @@ s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, Sample
#pragma GLOBAL_ASM("asm/us/nonmatchings/main/audio_load/AudioLoad_RelocateFontAndPreloadSamples.s")
#endif
// static char devstr55[] = "Wave Load %d \n";
// static char devstr56[] = "Total Bg Wave Load %d \n";
// static char devstr57[] = "Receive %d\n";
static char devstr57[] = "Receive %d\n";
static char devstr58[] = "============Error: Magic is Broken after loading.\n";
static char devstr59[] = "Remain DMA: %d\n";
static char devstr60[] = "N start %d\n";
static char devstr61[] = "============Error: Magic is Broken: %x\n";
s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
Sample* sample;
u32 preloadIndex;
@ -1330,6 +1339,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
if (osRecvMesg(&gPreloadSampleQueue, (OSMesg) &preloadIndex, 0) == -1) {
return false;
}
// "Receive %d\n"
preloadIndex >>= 0x18;
if (gPreloadSampleStack[preloadIndex].isFree == 0) {
@ -1339,6 +1349,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
sample->sampleAddr = gPreloadSampleStack[preloadIndex].ramAddr;
sample->medium = MEDIUM_RAM;
}
// "============Error: Magic is Broken after loading.\n"
gPreloadSampleStack[preloadIndex].isFree = 1;
}
while (true) {
@ -1356,6 +1367,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
nChunks = (size >> 0xC) + 1;
key = sampleAddr + size + sample->medium;
if (key != gPreloadSampleStack[gPreloadSampleStackTop - 1].endAndMediumKey) {
// "============Error: Magic is Broken: %x\n";
gPreloadSampleStack[gPreloadSampleStackTop - 1].isFree = 1;
gPreloadSampleStackTop--;
} else {
@ -1384,6 +1396,9 @@ s32 AudioLoad_AddToSampleSet(Sample* sample, s32 numSamples, Sample** sampleSet)
return numSamples;
}
static char devstr62[] = "Error: No Handle.\n";
static char devstr63[] = "Success: %x\n";
s32 AudioLoad_GetSamplesForFont(s32 fontId, Sample** sampleSet) {
s32 i;
Drum* drum;

View File

@ -637,7 +637,7 @@ void func_80014748(SequenceLayer* layer) {
}
} else {
cmd = 0;
if (!(layer->continuousNotes)) {
if (!layer->continuousNotes) {
cmd = 1;
} else if ((layer->note == NULL) || ((u8) layer->unk_3 == 0)) {
cmd = 1;

View File

@ -1920,7 +1920,7 @@ void func_800319AC(Actor* this) {
spD0 = 360.0f - spD0;
}
if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) {
if (!((gGameFrameCount + 0xF) & 0x1F) && (gCurrentLevel != LEVEL_VENOM_2)) {
if ((((gGameFrameCount + 15) % 32) == 0) && (gCurrentLevel != LEVEL_VENOM_2)) {
this->timer_0CA[0] = 0;
}
} else {
@ -2176,7 +2176,7 @@ void func_80035448(Actor* actor) {
Matrix_RotateZ(gGfxMatrix, M_DTOR * sp38, 1);
Matrix_SetGfxMtx(&gMasterDisp);
}
if (!(actor->timer_0C6 & 1)) {
if ((actor->timer_0C6 % 2) == 0) {
RCP_SetupDL(&gMasterDisp, 0x1D);
gSPFogPosition(gMasterDisp++, gFogNear, 1005);
}

View File

@ -27,7 +27,7 @@ f32 __pos_z;
#define TRINORM_Z(A, B, C) ((B##_x - A##_x) * (C##_y - B##_y) - (B##_y - A##_y) * (C##_x - B##_x))
// Calculate the directed plane that contains the ordered triangle tri, given as an array of Vec3s
void func_80097380(Plane* plane, Vec3s** tri) {
void func_80097380(PlaneF* plane, Vec3s** tri) {
Vec3s a;
Vec3s b;
Vec3s c;
@ -65,7 +65,7 @@ void func_80097380(Plane* plane, Vec3s** tri) {
// Calculate the directed plane that contains the ordered triangle tri, given as an array of Vec3s. Duplicate of
// previous
void func_80097558(Plane* plane, Vec3s** tri) {
void func_80097558(PlaneF* plane, Vec3s** tri) {
Vec3s a;
Vec3s b;
Vec3s c;
@ -339,8 +339,8 @@ bool func_800985CC(Vec3f* vec, Vtx_tn* tri) {
return true;
}
// Plane from normal and point
void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal) {
// PlaneF from normal and point
void func_80098860(PlaneF* plane, Vec3f* point, Vec3f* normal) {
plane->normal.x = normal->x;
plane->normal.y = normal->y;
plane->normal.z = normal->z;
@ -348,17 +348,17 @@ void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal) {
}
// y dist to closest point on plane
s32 func_800988B4(Vec3f* vec, Plane* plane) {
s32 func_800988B4(Vec3f* vec, PlaneF* plane) {
return (-plane->normal.x * vec->x - plane->normal.z * vec->z - plane->dist) / plane->normal.y;
}
// z dist to closest point on plane
s32 func_800988F8(Vec3f* vec, Plane* plane) {
s32 func_800988F8(Vec3f* vec, PlaneF* plane) {
return (-plane->normal.x * vec->x - plane->normal.y * vec->y - plane->dist) / plane->normal.z;
}
// x dist to closest point on plane
s32 func_8009893C(Vec3f* vec, Plane* plane) {
s32 func_8009893C(Vec3f* vec, PlaneF* plane) {
return (-plane->normal.y * vec->y - plane->normal.z * vec->z - plane->dist) / plane->normal.x;
}
@ -481,7 +481,7 @@ bool func_80099254(Vec3f* objPos, Vec3f* colliderPos, Vec3f* objVel, CollisionHe
Vec3f objRel;
s32 pad11C;
s32 pad118;
Plane polyPlane;
PlaneF polyPlane;
f32 tempf;
s32 didHit = false;
s32 swapBuff;
@ -568,10 +568,10 @@ bool func_80099254(Vec3f* objPos, Vec3f* colliderPos, Vec3f* objVel, CollisionHe
// check if bounding boxes of the object's movement and the collision polygon overlap
if ((objMinX < polyMaxX) && (objMaxX > polyMinX) && (objMinY < polyMaxY) && (objMaxY > polyMinY) &&
(objMinZ < polyMaxZ) && (objMaxZ > polyMinZ)) {
polyPlane.normal.x = colPoly->normal.x;
polyPlane.normal.y = colPoly->normal.y;
polyPlane.normal.z = colPoly->normal.z;
polyPlane.dist = colPoly->dist;
polyPlane.normal.x = colPoly->plane.normal.x;
polyPlane.normal.y = colPoly->plane.normal.y;
polyPlane.normal.z = colPoly->plane.normal.z;
polyPlane.dist = colPoly->plane.dist;
// check if object is on the "back" side of the polygon
if ((DOT_XYZ(&polyPlane.normal, &objRel) + polyPlane.dist) <= 0.0f) {

View File

@ -11,7 +11,7 @@ bool func_800A3690(Vec3f* objPos, Vec3f* colliderPos, s32 colId, Vec3f* hitDataO
bool func_800A36FC(Vec3f* objPos, Vec3f* colliderPos, CollisionHeader2* colHeader, Vec3f* hitDataOut) {
Vec3f objRelPos;
Plane triPlane;
PlaneF triPlane;
bool above;
s32 i;
s32 j;

View File

@ -93,7 +93,7 @@ CollisionHeader D_800D2B38[10] = {
{ 1386.0f, 1033.0f, 1833.0f },
316,
D_SZ_6007558,
D_6008E08, //! TODO: replace with D_SZ_6008E08 after factory fix
D_SZ_6008E08,
},
{
{ -671.0f, 0.0f, -671.0f },

View File

@ -979,7 +979,10 @@ void func_80038140(PlayerShot* shot) {
if (temp_v0 != 0) {
if (shot->obj.id == PLAYERSHOT_4) {
Object_Kill(&shot->obj, shot->sfxSource);
} else if (!((boss->obj.id == OBJ_BOSS_316) && (shot->playerNum != 0))) {
} else {
if ((boss->obj.id == OBJ_BOSS_316) && (shot->playerNum != 0)) {
break;
}
boss->dmgType = DMG_BEAM;
if (shot->obj.id == PLAYERSHOT_3) {
boss->dmgType = DMG_BOMB;
@ -1014,8 +1017,6 @@ void func_80038140(PlayerShot* shot) {
boss->fwork[48] = shot->obj.pos.y;
boss->fwork[49] = shot->obj.pos.z;
}
} else {
return;
}
}
}

View File

@ -876,42 +876,22 @@ void func_80040CE4(void) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_601B6C0));
temp_s0 = fabsf(Math_ModF(2.0f * (D_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize(gMasterDisp++, G_TX_RENDERTILE, temp_fv0, temp_s0, 124, 124);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
switch (D_80161A88) {
case 0:
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_601B6C0);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gBgColor = 0x845;
gDPLoadTileTexture(gMasterDisp++, D_601B6C0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
gBgColor = 0x845; // 8, 8, 32
break;
case 1:
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_6028260);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gBgColor = 0x845;
gDPLoadTileTexture(gMasterDisp++, D_6028260, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
gBgColor = 0x845; // 8, 8, 32
break;
case 2:
RCP_SetupDL_45(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_6028A60);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gBgColor = 0x190F;
gDPLoadTileTexture(gMasterDisp++, D_6028A60, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
gBgColor = 0x190F; // 24, 32, 56
break;
}
Matrix_Push(&gGfxMatrix);
@ -926,7 +906,7 @@ void func_80040CE4(void) {
gSPDisplayList(gMasterDisp++, D_601B640);
} else {
D_80161A88 = 0;
gBgColor = 0x845;
gBgColor = 0x845; // 8, 8, 32
for (i = 0; i < 4; i++) {
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, D_800C9E64[i], 0.0f, D_800C9E74[i], 1);
@ -958,10 +938,8 @@ void func_80040CE4(void) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sp1C4);
temp_s0 = fabsf(Math_ModF(2.0f * (D_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize(gMasterDisp++, G_TX_RENDERTILE, temp_fv0, temp_s0, 124, 124);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, 1);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1);
@ -1007,27 +985,22 @@ void func_80040CE4(void) {
break;
case LEVEL_AQUAS:
RCP_SetupDL(&gMasterDisp, 0x14);
sp1C0 = D_AQ_600AB10;
gSPFogPosition(gMasterDisp++, gFogNear, gFogFar);
if ((D_8015F964 == 0) && ((D_80177AC8 == 0) || (D_80177AC8 == 2))) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68));
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68));
temp_s0 = fabsf(Math_ModF(2.0f * (D_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize(gMasterDisp++, G_TX_RENDERTILE, temp_fv0, temp_s0, 124, 124);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, 1);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1);
Matrix_SetGfxMtx(&gMasterDisp);
sp1C0 = D_AQ_600AB10;
gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix);
Matrix_Push(&gGfxMatrix);
@ -1038,20 +1011,13 @@ void func_80040CE4(void) {
Matrix_Pop(&gGfxMatrix);
}
if ((D_8015F964 != 0) || (D_80177AC8 == 0)) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0));
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32,
32);
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0));
temp_s0 = fabsf(Math_ModF(2.0f * (D_80177CE8 * 0.2133333f), 128.0f));
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].unk_0AC) * 0.32f, 128.0f);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize(gMasterDisp++, G_TX_RENDERTILE, temp_fv0, temp_s0, 124, 124);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
if (D_80177AC8 != 0) {
RCP_SetupDL(&gMasterDisp, 0x2F);
} else {

View File

@ -243,7 +243,7 @@ LaserStrength gLaserStrength[4];
s32 D_80161AB8;
UNK_TYPE F_80161AC0[4];
UNK_TYPE F_80161AD0[4];
UNK_TYPE F_80161AEC[4];
UNK_TYPE F_80161AE0[4];
UNK_TYPE F_80161AF0[4];
UNK_TYPE P_800D31A4 = 0;
Object_80 gObjects80[50];

View File

@ -802,7 +802,7 @@ void func_8004A888(Effect* effect) {
void func_8004AA84(void) {
s32 i;
if (!(gGameFrameCount & 7) && (gLevelType == LEVEL_CORNERIA)) {
if (!(gGameFrameCount & 7) && (gLevelType == LEVELTYPE_PLANET)) {
for (i = 0; i < ARRAY_COUNT(gEffects); i++) {
if (gEffects[i].obj.status == OBJ_FREE) {
func_8004A888(&gEffects[i]);

View File

@ -2538,7 +2538,7 @@ void func_800696F8(Object_80* obj80) {
if ((obj80->obj.id == OBJ_80_6) || (obj80->obj.id == OBJ_80_7)) {
var_fa0 = 1000.0f;
}
temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f);
temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f;
if ((fabsf(gPlayer[0].unk_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) {
temp_fv0 = 0.0f;
}
@ -2558,7 +2558,7 @@ void func_80069858(Object_4C* obj4C) {
(obj4C->obj.id == OBJ_80_8)) {
var_fa0 = 1000.0f;
}
temp_fv0 = ((var_fa0 > temp_fv0) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f);
temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f;
temp_fv0 -= gPlayer[0].camEye.z;
if ((obj4C->info.unk_10 - temp_fv0) < (obj4C->obj.pos.z + D_80177D20)) {
obj4C->obj.status = OBJ_FREE;

View File

@ -2009,211 +2009,212 @@ void func_800701E0(Actor* actor) {
f32 var_fv1;
f32 temp_fv1;
if (!func_800700A4(actor)) {
if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 0x43) && (actor->unk_0D2 == 0)) {
actor->unk_0D0 = 0;
if (func_800700A4(actor)) {
return;
}
if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 0x43) && (actor->unk_0D2 == 0)) {
actor->unk_0D0 = 0;
}
if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 83) && (actor->timer_0C2 >= 2)) {
actor->unk_0D0 = 0;
}
if ((actor->unk_0D0 != 0) && (((actor->unk_0B4 == 64) && (actor->unk_0D2 == 2)) || (actor->unk_0B4 != 64))) {
if (actor->iwork[12] >= 4) {
actor->damage = 0;
}
if ((actor->unk_0D0 != 0) && (actor->unk_0B4 == 83) && (actor->timer_0C2 >= 2)) {
actor->unk_0D0 = 0;
if ((actor->iwork[12] > 0) && (actor->iwork[12] < 4)) {
gTeamShields[actor->iwork[12]] -= actor->damage;
} else if ((actor->unk_0B4 == 83) && ((actor->damage == 30) || (actor->damage == 31))) {
actor->health = 0;
} else {
actor->health -= actor->damage;
}
if ((actor->unk_0D0 != 0) && (((actor->unk_0B4 == 64) && (actor->unk_0D2 == 2)) || (actor->unk_0B4 != 64))) {
if (actor->iwork[12] >= 4) {
actor->damage = 0;
if (actor->health <= 0) {
if (actor->unk_0B4 == 106) {
BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3);
if (1) {}
gHitCount += 4;
D_80177850 = 15;
}
if ((actor->iwork[12] > 0) && (actor->iwork[12] < 4)) {
gTeamShields[actor->iwork[12]] -= actor->damage;
} else if ((actor->unk_0B4 == 83) && ((actor->damage == 30) || (actor->damage == 31))) {
actor->health = 0;
} else {
actor->health -= actor->damage;
}
if (actor->health <= 0) {
if (actor->unk_0B4 == 106) {
BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3);
if (1) {}
gHitCount += 4;
D_80177850 = 15;
}
if (actor->unk_0B4 != 83) {
if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) {
AUDIO_PLAY_SFX(0x29018036, actor->sfxSource, 4);
} else {
AUDIO_PLAY_SFX(0x2903700B, actor->sfxSource, 4);
}
actor->obj.status = OBJ_DYING;
var_fv1 = 0.7f;
if (gLevelType == LEVELTYPE_SPACE) {
var_fv1 = 0.3f;
}
if (((Rand_ZeroOne() < var_fv1) || (actor->iwork[12] != 0)) && (actor->info.unk_14 == 0) &&
(actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0xE) && (actor->unk_0B4 != 0x3D) &&
((s32) actor->damage < 0x1F) && (actor->unk_0B4 != 0x3E) && (actor->unk_0B4 != 0x40) &&
(actor->unk_0B4 != 0x48) && (actor->unk_0B4 != 0x44)) {
func_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f);
actor->unk_0D0 = 0;
}
actor->timer_0C2 = 10;
actor->timer_0BE = 0;
actor->unk_046 = 0xFF;
actor->unk_048 = 900;
actor->unk_0C9 = 1;
if (gLevelType == LEVELTYPE_PLANET) {
actor->timer_04C = RAND_INT(2.9f);
if (actor->unk_0B4 == 2) {
actor->timer_04C = 1;
if (actor->obj.pos.x < actor->unk_0D8.x) {
func_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z);
actor->fwork[17] = 777.0f;
} else {
func_800A69F8(0, actor->obj.pos.x - 20.0f, actor->obj.pos.y, actor->obj.pos.z);
actor->fwork[18] = 777.0f;
}
}
actor->timer_0BC = 300;
if (gLevelMode != LEVELMODE_ALL_RANGE) {
actor->vel.x *= 0.5f;
actor->vel.y = RAND_FLOAT(5.0f);
if (actor->vel.z < 0.0f) {
actor->vel.z = actor->vel.z;
} else {
actor->vel.z = actor->vel.z * 0.3f;
}
if (((actor->obj.pos.z + D_80177D20) > -3000.0f) && (actor->vel.z > 0.0f)) {
actor->vel.z = RAND_FLOAT(-10.0f);
}
}
if (actor->unk_0B4 == 90) {
actor->timer_04C = 999;
}
} else {
switch (actor->unk_0B4) {
case 13:
func_800654E4(&actor->obj);
break;
case 61:
func_i2_8018CCF8(actor);
break;
case 27:
actor->obj.pos.y -= actor->vel.y;
actor->obj.status = OBJ_ACTIVE;
func_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f,
actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f);
actor->unk_0D0 = 0;
actor->timer_0C2 = 10000;
actor->info.unk_1C = 0.0f;
gHitCount += actor->info.bonus;
D_80177850 = 0xF;
break;
default:
actor->timer_0BC = 35;
actor->timer_04C = 2;
actor->vel.y = RAND_FLOAT_CENTERED(20.0f);
actor->vel.x = RAND_FLOAT_CENTERED(20.0f);
actor->vel.z = 0.0f;
break;
}
}
}
if (actor->unk_0B4 == 0x52) {
AUDIO_PLAY_SFX(0x11000055, actor->sfxSource, 0);
actor->unk_0D0 = 1;
func_8007C688(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 0x3C);
}
} else {
actor->timer_0C6 = 20;
if (actor->unk_0B4 != 83) {
if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) {
AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4);
} else if (actor->health < 20) {
AUDIO_PLAY_SFX(0x2943500F, actor->sfxSource, 4);
AUDIO_PLAY_SFX(0x29018036, actor->sfxSource, 4);
} else {
AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4);
AUDIO_PLAY_SFX(0x2903700B, actor->sfxSource, 4);
}
if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x3D) && (actor->unk_0B4 != 0x53)) {
func_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 1.5f);
}
if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) &&
(actor->unk_0B4 != 0x15) && (actor->unk_0B4 != 0x17)) {
actor->fwork[13] = 20.0f;
if (actor->obj.pos.x < actor->unk_0D8.x) {
actor->fwork[13] *= -1.0f;
}
}
if (actor->unk_0D4 == 1) {
switch (actor->iwork[12]) {
case 1:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20210, RCID_FALCO);
} else {
func_8006A7B0(gMsg_ID_20060, RCID_FALCO);
}
break;
case 3:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20200, RCID_PEPPY);
} else {
func_8006A7B0(gMsg_ID_20070, RCID_PEPPY);
}
break;
case 2:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20190, RCID_SLIPPY);
} else {
func_8006A7B0(gMsg_ID_20080, RCID_SLIPPY);
}
break;
case 4:
func_8006A7B0(gMsg_ID_20084, RCID_KATT);
break;
case 5:
func_8006A7B0(gMsg_ID_20085, RCID_BILL);
break;
}
}
actor->unk_0D0 = 0;
}
}
if ((actor->iwork[12] == 0) && (actor->iwork[13] == 0) && (actor->info.unk_16 != 2) &&
(gLevelType == LEVELTYPE_SPACE)) {
sp3C.x = actor->vel.x;
sp3C.y = actor->vel.y;
sp3C.z = actor->vel.z;
if ((func_8006351C(actor->index, &actor->obj.pos, &sp3C, 0) != 0) ||
(actor->obj.pos.y < (gGroundLevel + 20.0f))) {
actor->obj.status = OBJ_DYING;
actor->obj.pos.z -= actor->vel.z;
actor->unk_0D0 = 1;
if (actor->unk_0B4 == 13) {
actor->obj.id = OBJ_ACTOR_182;
func_800654E4(&actor->obj);
var_fv1 = 0.7f;
if (gLevelType == LEVELTYPE_SPACE) {
var_fv1 = 0.3f;
}
if (actor->unk_0B4 == 61) {
func_i2_8018CCF8(actor);
if (((Rand_ZeroOne() < var_fv1) || (actor->iwork[12] != 0)) && (actor->info.unk_14 == 0) &&
(actor->unk_0B4 != 13) && (actor->unk_0B4 != 14) && (actor->unk_0B4 != 61) &&
(actor->damage <= 30) && (actor->unk_0B4 != 62) && (actor->unk_0B4 != 64) &&
(actor->unk_0B4 != 72) && (actor->unk_0B4 != 68)) {
func_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f);
actor->unk_0D0 = 0;
}
actor->timer_0C2 = 10;
actor->timer_0BE = 0;
actor->unk_046 = 0xFF;
actor->unk_048 = 900;
actor->unk_0C9 = 1;
if (gLevelType == LEVELTYPE_PLANET) {
actor->timer_04C = RAND_INT(2.9f);
if (actor->unk_0B4 == 2) {
actor->timer_04C = 1;
if (actor->obj.pos.x < actor->unk_0D8.x) {
func_800A69F8(1, actor->obj.pos.x + 20.0f, actor->obj.pos.y, actor->obj.pos.z);
actor->fwork[17] = 777.0f;
} else {
func_800A69F8(0, actor->obj.pos.x - 20.0f, actor->obj.pos.y, actor->obj.pos.z);
actor->fwork[18] = 777.0f;
}
}
actor->timer_0BC = 300;
if (gLevelMode != LEVELMODE_ALL_RANGE) {
actor->vel.x *= 0.5f;
actor->vel.y = RAND_FLOAT(5.0f);
if (actor->vel.z < 0.0f) {
actor->vel.z = actor->vel.z;
} else {
actor->vel.z = actor->vel.z * 0.3f;
}
if (((actor->obj.pos.z + D_80177D20) > -3000.0f) && (actor->vel.z > 0.0f)) {
actor->vel.z = RAND_FLOAT(-10.0f);
}
}
if (actor->unk_0B4 == 90) {
actor->timer_04C = 999;
}
} else {
switch (actor->unk_0B4) {
case 13:
func_800654E4(&actor->obj);
break;
case 61:
func_i2_8018CCF8(actor);
break;
case 27:
actor->obj.pos.y -= actor->vel.y;
actor->obj.status = OBJ_ACTIVE;
func_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f,
actor->obj.pos.z - actor->vel.z, actor->scale * 5.0f);
actor->unk_0D0 = 0;
actor->timer_0C2 = 10000;
actor->info.unk_1C = 0.0f;
gHitCount += actor->info.bonus;
D_80177850 = 0xF;
break;
default:
actor->timer_0BC = 35;
actor->timer_04C = 2;
actor->vel.y = RAND_FLOAT_CENTERED(20.0f);
actor->vel.x = RAND_FLOAT_CENTERED(20.0f);
actor->vel.z = 0.0f;
break;
}
}
}
if (actor->unk_0B4 == 0x52) {
AUDIO_PLAY_SFX(0x11000055, actor->sfxSource, 0);
actor->unk_0D0 = 1;
func_8007C688(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 0x3C);
}
} else {
actor->timer_0C6 = 20;
if ((actor->unk_0B4 == 6) && (gCurrentLevel == LEVEL_SOLAR)) {
AUDIO_PLAY_SFX(0x29033037, actor->sfxSource, 4);
} else if (actor->health < 20) {
AUDIO_PLAY_SFX(0x2943500F, actor->sfxSource, 4);
} else {
AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4);
}
if ((actor->unk_0B4 != 0xD) && (actor->unk_0B4 != 0x3D) && (actor->unk_0B4 != 0x53)) {
func_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 1.5f);
}
if (((gLevelMode == LEVELMODE_ALL_RANGE) || (gLevelMode == LEVELMODE_UNK_2)) && (actor->unk_0B4 != 0x15) &&
(actor->unk_0B4 != 0x17)) {
actor->fwork[13] = 20.0f;
if (actor->obj.pos.x < actor->unk_0D8.x) {
actor->fwork[13] *= -1.0f;
}
}
if (actor->unk_0D4 == 1) {
switch (actor->iwork[12]) {
case 1:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20210, RCID_FALCO);
} else {
func_8006A7B0(gMsg_ID_20060, RCID_FALCO);
}
break;
case 3:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20200, RCID_PEPPY);
} else {
func_8006A7B0(gMsg_ID_20070, RCID_PEPPY);
}
break;
case 2:
if (actor->unk_0D0 == 3) {
func_8006A7B0(gMsg_ID_20190, RCID_SLIPPY);
} else {
func_8006A7B0(gMsg_ID_20080, RCID_SLIPPY);
}
break;
case 4:
func_8006A7B0(gMsg_ID_20084, RCID_KATT);
break;
case 5:
func_8006A7B0(gMsg_ID_20085, RCID_BILL);
break;
}
}
actor->unk_0D0 = 0;
}
}
if ((actor->iwork[12] == 0) && (actor->iwork[13] == 0) && (actor->info.unk_16 != 2) &&
(gLevelType == LEVELTYPE_SPACE)) {
sp3C.x = actor->vel.x;
sp3C.y = actor->vel.y;
sp3C.z = actor->vel.z;
if ((func_8006351C(actor->index, &actor->obj.pos, &sp3C, 0) != 0) ||
(actor->obj.pos.y < (gGroundLevel + 20.0f))) {
actor->obj.status = OBJ_DYING;
actor->obj.pos.z -= actor->vel.z;
actor->unk_0D0 = 1;
if (actor->unk_0B4 == 13) {
actor->obj.id = OBJ_ACTOR_182;
func_800654E4(&actor->obj);
}
if (actor->unk_0B4 == 61) {
func_i2_8018CCF8(actor);
}
}
}

View File

@ -1,4 +1,4 @@
// #include "prevent_bss_reordering.h"
#include "prevent_bss_reordering.h"
#include "global.h"
#include "sf64dma.h"
#include "assets/ast_logo.h"
@ -102,7 +102,7 @@ void Game_SetGameState(void) {
gFillScreenColor = gBgColor = 0;
D_80177D20 = 0.0f;
if ((gCurrentLevel == LEVEL_VENOM_2) && (D_8017827C == 2)) {
gFillScreenColor = gBgColor = 0xFFFF;
gFillScreenColor = gBgColor = 0xFFFF; // 248, 248, 248
D_80178348 = D_80178350 = D_80178354 = 255;
} else {
D_80178348 = D_80178350 = D_80178354 = 0;

View File

@ -4476,12 +4476,10 @@ void func_800922F4(Actor* actor) {
actor->obj.pos.z + RAND_FLOAT_CENTERED(10.0f), 2.2f);
}
if (!((temp >> 2) & gGameFrameCount)) {
if (Rand_ZeroOne() < 0.5f) {
func_8007C120(actor->obj.pos.x + RAND_FLOAT_CENTERED(30.0f), actor->obj.pos.y + RAND_FLOAT(10.0f),
actor->obj.pos.z + RAND_FLOAT_CENTERED(30.0f), actor->vel.x, actor->vel.y, actor->vel.z,
actor->scale * 0.07f, 3);
}
if (!(gGameFrameCount & (temp >> 2)) && (Rand_ZeroOne() < 0.5f)) {
func_8007C120(actor->obj.pos.x + RAND_FLOAT_CENTERED(30.0f), actor->obj.pos.y + RAND_FLOAT(10.0f),
actor->obj.pos.z + RAND_FLOAT_CENTERED(30.0f), actor->vel.x, actor->vel.y, actor->vel.z,
actor->scale * 0.07f, 3);
}
}
}

View File

@ -1,4 +1,4 @@
#include "prevent_bss_reordering2.h"
// #include "prevent_bss_reordering2.h"
#include "global.h"
#include "assets.h"
#include "fox_map.h"
@ -205,7 +205,7 @@ void func_800A46A0(Player* player) {
func_8007D10C(player->pos.x + RAND_FLOAT_CENTERED(10.0f), player->pos.y + sp40 + RAND_FLOAT(10.0f),
player->unk_138 + RAND_FLOAT_CENTERED(10.0f), 2.2f);
}
if (!((var_v1 >> 2) & gGameFrameCount) && (Rand_ZeroOne() < 0.5f)) {
if (!(gGameFrameCount & (var_v1 >> 2)) && (Rand_ZeroOne() < 0.5f)) {
func_8007C484(player->pos.x + RAND_FLOAT_CENTERED(30.0f), player->pos.y + sp40 + RAND_FLOAT(10.0f),
player->unk_138 + RAND_FLOAT_CENTERED(30.0f), player->vel.x, player->vel.y, player->vel.z,
0.04f + RAND_FLOAT(0.03f), player->num + 1);
@ -213,7 +213,7 @@ void func_800A46A0(Player* player) {
player->timer_224 = 2;
}
}
} else if (!((var_v1 >> 2) & gGameFrameCount) && (Rand_ZeroOne() < 0.5f) && (player->timer_224 == 0)) {
} else if (!(gGameFrameCount & (var_v1 >> 2)) && (Rand_ZeroOne() < 0.5f) && (player->timer_224 == 0)) {
player->timer_224 = 2;
}
}
@ -3371,8 +3371,8 @@ void func_800AE4A4(Player* player) {
if (player->pos.y < (gGroundLevel + 70.0f)) {
var_fv1 = 0.8f;
}
if (!(((gInputHold->button & R_TRIG) && (gInputHold->button & Z_TRIG)) ||
(!(gInputHold->button & R_TRIG) && !(gInputHold->button & Z_TRIG)))) {
if (!((gInputHold->button & R_TRIG) && (gInputHold->button & Z_TRIG)) &&
!(!(gInputHold->button & R_TRIG) && !(gInputHold->button & Z_TRIG))) {
var_fv1 = 0.1f;
}
var_fv0 = 4.0f;
@ -3591,8 +3591,8 @@ void func_800AF07C(Player* player) {
var_fv1 = 0.8f;
}
if (!(((gInputHold->button & R_TRIG) && (gInputHold->button & Z_TRIG)) ||
((!(gInputHold->button & R_TRIG)) && (!(gInputHold->button & Z_TRIG))))) {
if (!((gInputHold->button & R_TRIG) && (gInputHold->button & Z_TRIG)) &&
!(!(gInputHold->button & R_TRIG) && !(gInputHold->button & Z_TRIG))) {
var_fv1 = 0.1f;
}

View File

@ -277,7 +277,7 @@ s16 Animation_GetFrameData(Animation* animationSegmemt, s32 frame, Vec3f* frameT
return var4 + 1;
}
s16 Animation_GetFrameCount(Animation* animationSegment) {
s32 Animation_GetFrameCount(Animation* animationSegment) {
Animation* animation = SEGMENTED_TO_VIRTUAL(animationSegment);
return animation->frameCount;

View File

@ -1420,19 +1420,19 @@ bool func_800C15D8(void) {
D_80161A10 = 1.5f;
switch (gVersusStage) {
case VS_STAGE_CORNERIA:
gBgColor = 0x8FBD;
gBgColor = 0x8FBD; // 136, 240, 240
break;
case VS_STAGE_KATINA:
gBgColor = 0xADA7;
gBgColor = 0xADA7; // 168, 176, 152
break;
case VS_STAGE_SECTOR_Z:
gBgColor = 0x0001;
gBgColor = 0x0001; // 0, 0, 0
break;
default:
gBgColor = 0x8FBD;
gBgColor = 0x8FBD; // 136, 240, 240
break;
}
ret = true;

View File

@ -9,6 +9,7 @@ Vtx D_Vtx_800D94A0[] = {
};
Gfx D_Gfx_800D94D0[] = {
// used in fox_ti for the triangular light rays before firing his lazor
gsSPVertex(D_Vtx_800D94A0, 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
@ -26,6 +27,7 @@ Vtx D_Vtx_800D94E8[] = {
};
Gfx D_Gfx_800D95E8[] = {
// unused
gsSPVertex(D_Vtx_800D94E8, 16, 0), gsSP1Triangle(2, 1, 0, 0), gsSP1Triangle(3, 2, 0, 0),
gsSP1Triangle(6, 5, 4, 0), gsSP1Triangle(7, 6, 4, 0), gsSP1Triangle(5, 2, 3, 0),
gsSP1Triangle(4, 5, 3, 0), gsSP1Triangle(1, 6, 7, 0), gsSP1Triangle(0, 1, 7, 0),
@ -40,6 +42,7 @@ Vtx D_Vtx_800D9658[] = {
};
Gfx D_Gfx_800D9688[] = {
// used fox_fade for unused spinning fade
gsSPVertex(D_Vtx_800D9658, 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
@ -52,16 +55,19 @@ Vtx D_Vtx_800D96A0[] = {
};
Gfx D_Gfx_800D96D0[] = {
// unused
gsSPVertex(D_Vtx_800D96A0, 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
};
Vec3s D_Unk_800D96E8[] = {
// unused
{ -100, 100, -100 }, { -100, 100, 100 }, { 100, 100, 100 }, { 100, 100, -100 },
{ -100, -100, -100 }, { -100, -100, 100 }, { 100, -100, 100 }, { 100, -100, -100 },
};
u16 D_Unk_800D9718[][3] = {
Triangle D_Unk_800D9718[] = {
// unused
{ 0, 1, 2 }, { 0, 2, 3 }, { 5, 4, 7 }, { 5, 7, 6 }, { 1, 5, 6 }, { 1, 6, 2 },
{ 3, 7, 4 }, { 3, 4, 0 }, { 2, 6, 7 }, { 2, 7, 3 }, { 0, 4, 5 }, { 0, 5, 1 },
};
@ -78,6 +84,7 @@ Vtx D_Vtx_800D9760[] = {
};
Gfx D_Gfx_800D9860[] = {
// unused
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD),
@ -119,6 +126,7 @@ Vtx D_Vtx_800D9950[] = {
};
Gfx D_Gfx_800D9990[] = {
// unused
gsDPSetPrimColor(0, 0, 0xFF, 0xFF, 0xFF, 0xFF),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD,
@ -138,6 +146,7 @@ Gfx D_Gfx_800D9990[] = {
// u16 D_Tex_800D99F8[32][32]; ?
u16 D_Tex_800D99F8[1024] = {
// used in fox_hud
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
@ -292,6 +301,7 @@ u16 D_Tex_800DA1F8[1024] = {
};
Gfx D_Gfx_800DA9F8[] = {
// unused
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD),
@ -316,6 +326,7 @@ Vtx D_Vtx_800DAA58[] = {
};
Gfx D_Gfx_800DAA98[] = {
// unused
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD),
@ -339,6 +350,7 @@ Vtx D_Vtx_800DAAF8[] = {
};
Gfx D_Gfx_800DAB28[] = {
// unused
gsSPVertex(D_Vtx_800DAAF8, 3, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSPEndDisplayList(),
@ -352,6 +364,7 @@ Vtx D_Vtx_800DAB40[] = {
};
Gfx D_Gfx_800DAB80[] = {
// unused
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD),
@ -376,6 +389,7 @@ Vtx D_Vtx_800DABE0[] = {
};
Gfx D_Gfx_800DAC20[] = {
// used in fox_edisplay
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_CLAMP, 3, G_TX_NOLOD),
@ -398,6 +412,7 @@ Vtx D_Vtx_800DAC80[] = {
};
Gfx D_Gfx_800DACA0[] = {
// unused
gsSPVertex(D_Vtx_800DAC80, 2, 0),
gsSPLine3D(0, 1, 0),
gsSPEndDisplayList(),
@ -405,6 +420,7 @@ Gfx D_Gfx_800DACA0[] = {
// u16 D_Unk_800DACB8[32][32]; ?
u16 D_Unk_800DACB8[] = {
// used in fox_tank for landmaster wheels
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
@ -483,6 +499,7 @@ u16 D_Unk_800DACB8[] = {
// u8 D_Unk_800DB4B8[32][32] ?
u8 D_Unk_800DB4B8[] = {
// used in fox_ma
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0B, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x0F, 0x14, 0x15, 0x0C, 0x00, 0x00, 0x00,
@ -540,6 +557,7 @@ u8 D_Unk_800DB4B8[] = {
};
u16 D_Unk_800DB8B8[] = {
// unused
0x08D1, 0x3219, 0x7425, 0xADB1, 0xDF3B, 0xD6F9, 0xD739, 0xC675, 0x8CEB, 0x4ADF, 0x2197, 0x1113, 0x1955, 0x429F,
0x9531, 0xE77F, 0xBE35, 0x8429, 0x94AB, 0xCE79, 0x7429, 0x5321, 0x321B, 0x5B65, 0x0843, 0xAD73, 0xB637, 0x84AD,
0x3A5D, 0x6C29, 0xADF7, 0x7BE5, 0x0001, 0xCEFB, 0x8CEF, 0x29D9, 0x2195, 0x3A5B, 0x429D, 0x5B63, 0xDF3D, 0xA5B3,
@ -556,6 +574,7 @@ u16 D_Unk_800DB8B8[] = {
};
u16 D_Tex_800DBA20[0x40] = {
// used in fox_msg
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000,
0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF,
@ -564,6 +583,7 @@ u16 D_Tex_800DBA20[0x40] = {
};
Gfx D_Gfx_800DBAA0[] = {
// used in fox_game
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),

View File

@ -1,27 +1,6 @@
#include "sys.h"
#include "sf64audio_provisional.h"
typedef struct {
struct {
/* 0x00 */ volatile u8 enabled : 1;
/* 0x00 */ u8 needsInit : 1;
/* 0x00 */ u8 finished : 1; // ?
/* 0x00 */ u8 unused : 1;
/* 0x00 */ u8 stereoStrongRight : 1;
/* 0x00 */ u8 stereoStrongLeft : 1;
/* 0x00 */ u8 stereoHeadsetEffects : 1;
/* 0x00 */ u8 usesHeadsetPanEffects : 1; // ?
} bitField0;
struct {
/* 0x01 */ u8 reverbIndex : 3;
/* 0x01 */ u8 bookOffset : 2;
/* 0x01 */ u8 isSyntheticWave : 1;
/* 0x01 */ u8 hasTwoParts : 1;
/* 0x01 */ u8 useHaasEffect : 1;
} bitField1;
/* 0x02 */ u8 pad2[0xE];
} NoteUnkStruct; // size = 0x10
f32 gBendPitchOneOctaveFrequencies[] = {
0.5f, 0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f, 0.522315f,
0.525174f, 0.528048f, 0.530938f, 0.533843f, 0.536765f, 0.539702f, 0.542656f, 0.545626f, 0.548612f, 0.551614f,

View File

@ -1534,7 +1534,7 @@ void func_ending_8018B860(void) {
D_80177A48[0] = gCsCamAtX;
D_80177A10[0] = 0;
D_ending_8019858C = 0;
gBgColor = 0x4AE5;
gBgColor = 0x4AE5; // 72, 88, 144
D_80178410 = 0;
}
@ -1571,7 +1571,7 @@ void func_ending_8018BAD0(void) {
D_80177A10[0] = 1;
D_ending_8019858C = 0;
gBgColor = 0x4AE5;
gBgColor = 0x4AE5; // 72, 88, 144
D_80178410 = 0;
}

View File

@ -449,12 +449,8 @@ void func_ending_8018EDB8(u32 arg0, AssetInfo* asset) {
gDPLoadTextureBlock(gMasterDisp++, D_END_700EA38, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, (((32 * G_IM_SIZ_16b_LINE_BYTES) + 7) >> 3), 0, 0, 0,
G_TX_WRAP, 5, 0, G_TX_WRAP, 5, 0);
gDPSetTileSize(gMasterDisp++, 0, arg0 * 14, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, arg0 * 14, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gSPDisplayList(gMasterDisp++, D_END_700E9E0);
}

View File

@ -3042,7 +3042,7 @@ void func_i1_80191160(Player* player) {
gActors[2].obj.pos.y += 3.0f;
}
gBgColor = 0x845;
gBgColor = 0x845; // 8, 8, 32
switch (player->unk_1D0) {
case 0:

View File

@ -1065,7 +1065,7 @@ void func_i1_80193D64(s32 limbIndex, Vec3f* rot, void* thisx) {
RCP_SetupDL(&gMasterDisp, 0x1D);
}
#ifdef NON_EQUIVALENT
#ifdef NON_MATCHING
// Lots of problems with loop at 2082. Seems related to spE8. https://decomp.me/scratch/gOy2L
void func_i1_80194398(Boss* boss) {
s32 is0;
@ -2332,7 +2332,7 @@ void func_i1_80198414(void) {
D_801778F0[i] = gSavedTeamShields[i];
gSavedTeamShields[i] = gTeamShields[i];
}
gBgColor = 0xFFFF;
gBgColor = 0xFFFF; // 248, 248, 248
gNextGameState = GSTATE_PLAY;
gNextLevel = LEVEL_VENOM_2;
D_80161A2E = 2;

View File

@ -806,14 +806,14 @@ void func_i2_8018978C(Boss* boss) {
}
}
if (!(gGameFrameCount & 56)) {
if (!(gGameFrameCount & 0x38)) {
boss->fwork[3] = D_i2_80195534[gGameFrameCount & 7];
boss->fwork[4] = D_i2_80195534[gGameFrameCount & 7];
boss->fwork[5] = D_i2_80195534[gGameFrameCount & 7];
boss->fwork[6] = D_i2_80195534[gGameFrameCount & 7];
}
if (!((gGameFrameCount + 20) & 56)) {
if (!((gGameFrameCount + 20) & 0x38)) {
boss->fwork[7] = D_i2_80195534[(gGameFrameCount + 20) & 7];
boss->fwork[8] = D_i2_80195534[(gGameFrameCount + 20) & 7];
}

View File

@ -1174,7 +1174,7 @@ s32 func_i2_80192AF0(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* arg4)
*arg1 = NULL;
}
if (!((s32) boss->timer_05C & 1)) {
if (!(boss->timer_05C & 1)) {
RCP_SetupDL(&gMasterDisp, 0x1D);
} else {
RCP_SetupDL(&gMasterDisp, 0x1B);

View File

@ -1,5 +1,5 @@
#include "prevent_bss_reordering.h"
// #include "prevent_bss_reordering2.h"
#include "prevent_bss_reordering2.h"
#include "global.h"
#include "assets.h"
@ -466,7 +466,7 @@ s32 func_i4_8018CCE8(Actor* actor) {
temp_fs0 = fabsf(x - actor->obj.pos.x);
temp_fv0 = fabsf(z - actor->obj.pos.z);
if ((!(var_fv1 < temp_fs0)) && (!(var_fa0 < temp_fv0))) {
if (!((var_fv1 < temp_fs0) || (var_fa0 < temp_fv0))) {
var_fv1 = temp_fs0;
var_fa0 = temp_fv0;
var_v0 = i + 1;
@ -2173,21 +2173,9 @@ void func_i4_80192264(void) {
if ((spD0.z < 3000.0f) && (spD0.z > -13000.0f) && (fabsf(spD0.x) < (fabsf(spD0.z * 0.7f) + 3000.0f)) &&
(fabsf(spD0.y) < (fabsf(spD0.z * 0.5f) + 2000.0f))) {
if (rnd < 0.3f) {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_6008BB8);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPLoadTileTexture(gMasterDisp++, D_6008BB8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
} else {
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_600AD80);
gDPTileSync(gMasterDisp++);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterDisp++);
gDPLoadBlock(gMasterDisp++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPLoadTileTexture(gMasterDisp++, D_600AD80, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
}
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_600BEC0)

View File

@ -370,17 +370,9 @@ void func_i5_801B58AC(Gfx** dList, f32 arg1) {
spC4 = D_i5_801C5C14;
if (D_i5_801C5C14 & 2) {
gDPTileSync((*dList)++);
gDPSetTile((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 5,
G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize((*dList)++, G_TX_RENDERTILE, 0, 0, 124, 124);
gDPSetTextureImage((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_6001BA8); // Ground Texture?
gDPTileSync((*dList)++);
gDPSetTile((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync((*dList)++);
gDPLoadBlock((*dList)++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPSetupTile((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTileTexture((*dList)++, D_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
gSPMatrix((*dList)++, &gIdentityMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, 0);
Matrix_ToMtx(gGfxMtx);
@ -569,16 +561,9 @@ void func_i5_801B68A8(Gfx** dlist, s32 arg1, s32 arg2) {
s32 var_a1;
s32 var;
gDPTileSync((*dlist)++);
gDPSetTile((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, G_TX_RENDERTILE, 0, G_TX_MIRROR | G_TX_WRAP, 5,
G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
gDPSetTileSize((*dlist)++, G_TX_RENDERTILE, 0, 0, 124, 124);
gDPSetTextureImage((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_6001BA8); // Ground Texture?
gDPTileSync((*dlist)++);
gDPSetTile((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync((*dlist)++);
gDPLoadBlock((*dlist)++, G_TX_LOADTILE, 0, 0, 1023, 256);
gDPSetupTile((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTileTexture((*dlist)++, D_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32);
Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, 0);
Matrix_ToMtx(gGfxMtx);
gSPMatrix((*dlist)++, gGfxMtx++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -604,7 +589,7 @@ bool func_i5_801B6AEC(f32 arg0, f32 arg1, f32 arg2) {
}
}
s32 func_i5_801B6B40(f32 arg0, f32 arg1, Vec3f* arg2, Plane* arg3) {
s32 func_i5_801B6B40(f32 arg0, f32 arg1, Vec3f* arg2, PlaneF* arg3) {
f32 x1;
f32 y1;
f32 z1;
@ -694,7 +679,7 @@ s32 func_i5_801B6E20(f32 arg0, f32 arg1, f32* arg2, f32* arg3, f32* arg4) {
f32 var_fs0_2;
f32 var_fs1;
f32 var_fs2;
Plane sp84;
PlaneF sp84;
f32 temp;
f32 temp_fs2;
s32 pad[4];

View File

@ -3535,42 +3535,43 @@ void func_i5_801A6984(Actor* actor) {
f32 sp80;
var_s3 = 0;
if (!((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f)) {
test.x = actor->obj.pos.x - D_i5_801BE368[4];
test.y = actor->obj.pos.y - D_i5_801BE368[5];
test.z = actor->obj.pos.z - D_i5_801BE368[6];
temp_fs3 = VEC3F_MAG(&test);
Math_Atan2F(test.x, test.z);
Math_Atan2F(test.y, sqrtf(SQ(test.x) + SQ(test.z)));
var_s4 = (s32) (temp_fs3 / 40.0f);
if (var_s4 == 0) {
var_s4 = 1;
}
spA8 = (180.0f / var_s4) + 1.0f;
var_fs5 = actor->obj.pos.x;
spA0 = actor->obj.pos.y;
sp9C = actor->obj.pos.z;
sp88 = (D_i5_801BE368[4] - actor->obj.pos.x) / var_s4;
sp84 = (D_i5_801BE368[5] - actor->obj.pos.y) / var_s4;
sp80 = (D_i5_801BE368[6] - actor->obj.pos.z) / var_s4;
for (i = 0; i < var_s4; i++) {
if (D_i5_801BE320[1] == 0) {
Math_SmoothStepToF(&D_i5_801BE368[7], 0.0f, 0.01f, 0.05f, 0.01f);
} else {
Math_SmoothStepToF(&D_i5_801BE368[7], 100.0f, 0.01f, 0.01f, 0.01f);
}
temp = SIN_DEG(i * spA8) * (-(D_i5_801BE368[7] * 3.0f) * (1.0f - ((f32) i / var_s4)));
temp_fs2_2 = actor->obj.pos.x + (sp88 * i);
temp_fs3_2 = actor->obj.pos.y + (sp84 * i) + temp;
temp_fs4 = actor->obj.pos.z + (sp80 * i);
func_i5_801A68F8(actor, var_s3++, var_fs5, spA0, sp9C, temp_fs2_2, temp_fs3_2, temp_fs4);
var_fs5 = temp_fs2_2;
spA0 = temp_fs3_2;
sp9C = temp_fs4;
}
func_i5_80199D88(D_6012C98, 4, 8);
if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) {
return;
}
test.x = actor->obj.pos.x - D_i5_801BE368[4];
test.y = actor->obj.pos.y - D_i5_801BE368[5];
test.z = actor->obj.pos.z - D_i5_801BE368[6];
temp_fs3 = VEC3F_MAG(&test);
Math_Atan2F(test.x, test.z);
Math_Atan2F(test.y, sqrtf(SQ(test.x) + SQ(test.z)));
var_s4 = (s32) (temp_fs3 / 40.0f);
if (var_s4 == 0) {
var_s4 = 1;
}
spA8 = (180.0f / var_s4) + 1.0f;
var_fs5 = actor->obj.pos.x;
spA0 = actor->obj.pos.y;
sp9C = actor->obj.pos.z;
sp88 = (D_i5_801BE368[4] - actor->obj.pos.x) / var_s4;
sp84 = (D_i5_801BE368[5] - actor->obj.pos.y) / var_s4;
sp80 = (D_i5_801BE368[6] - actor->obj.pos.z) / var_s4;
for (i = 0; i < var_s4; i++) {
if (D_i5_801BE320[1] == 0) {
Math_SmoothStepToF(&D_i5_801BE368[7], 0.0f, 0.01f, 0.05f, 0.01f);
} else {
Math_SmoothStepToF(&D_i5_801BE368[7], 100.0f, 0.01f, 0.01f, 0.01f);
}
temp = SIN_DEG(i * spA8) * (-(D_i5_801BE368[7] * 3.0f) * (1.0f - ((f32) i / var_s4)));
temp_fs2_2 = actor->obj.pos.x + (sp88 * i);
temp_fs3_2 = actor->obj.pos.y + (sp84 * i) + temp;
temp_fs4 = actor->obj.pos.z + (sp80 * i);
func_i5_801A68F8(actor, var_s3++, var_fs5, spA0, sp9C, temp_fs2_2, temp_fs3_2, temp_fs4);
var_fs5 = temp_fs2_2;
spA0 = temp_fs3_2;
sp9C = temp_fs4;
}
func_i5_80199D88(D_6012C98, 4, 8);
}
void func_i5_801A6C78(Actor* actor) {

View File

@ -473,7 +473,6 @@ void func_i5_8018A544(Actor* actor) {
f32 sp4C;
f32 sp48;
f32 sp44;
s32 var_v0;
actor->unk_0C9 = 1;
@ -561,13 +560,9 @@ void func_i5_8018A544(Actor* actor) {
temp_fv1 = actor->scale * 314.0f;
if (actor->vel.x != 0.0f) {
var_v0 = SIGN_OF(actor->vel.x);
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * (f32) var_v0;
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * SIGN_OF(actor->vel.x);
} else {
var_v0 = SIGN_OF(actor->vel.z);
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * (f32) var_v0;
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * SIGN_OF(actor->vel.z);
}
actor->obj.rot.y = Math_RadToDeg(Math_Atan2F(actor->vel.x, actor->vel.z));
@ -922,7 +917,7 @@ void func_i5_8018B96C(Actor* actor) {
}
void func_i5_8018B9D0(Actor* actor) {
s32 var_v1;
f32 var_fa0;
f32 sp50;
f32 sp4C;
f32 sp48;
@ -930,13 +925,10 @@ void func_i5_8018B9D0(Actor* actor) {
f32 sp40;
f32 sp3C;
f32 temp_fa1;
f32 var_fa0;
// FAKE
var_v1 = actor->state;
actor->unk_0C9 = 1;
switch (var_v1) {
switch (actor->state) {
case 0:
sp44 = gPlayer[0].pos.x - actor->obj.pos.x;
sp40 = gPlayer[0].pos.y - actor->obj.pos.y;
@ -949,19 +941,17 @@ void func_i5_8018B9D0(Actor* actor) {
if (actor->timer_0BE == 0) {
temp_fa1 = SQ(sp44) + SQ(sp40) + SQ(sp3C);
if (temp_fa1 < 27639.062f) {
if (temp_fa1 < SQ(166.25f)) {
actor->timer_0BE = 8;
} else {
if (temp_fa1 < 360000.0f) {
actor->timer_0BE = 0;
if (actor->timer_0BC == 0) {
AUDIO_PLAY_SFX(0x19000029, actor->sfxSource, 4);
actor->iwork[0] = 1 - actor->iwork[0];
actor->timer_0BC = 5;
}
} else {
actor->iwork[0] = 0;
} else if (temp_fa1 < SQ(600.0f)) {
actor->timer_0BE = 0;
if (actor->timer_0BC == 0) {
AUDIO_PLAY_SFX(0x19000029, actor->sfxSource, 4);
actor->iwork[0] = 1 - actor->iwork[0];
actor->timer_0BC = 5;
}
} else {
actor->iwork[0] = 0;
}
}
@ -996,8 +986,7 @@ void func_i5_8018B9D0(Actor* actor) {
}
if (fabsf(actor->vel.x) > 130.0f) {
var_v1 = (actor->vel.x > 0.0f) ? 1 : (actor->vel.x == 0.0f) ? 0 : -1;
var_fa0 = var_v1 * 130.0f;
var_fa0 = SIGN_OF(actor->vel.x) * 130.0f;
} else {
var_fa0 = actor->vel.x;
}
@ -1005,8 +994,7 @@ void func_i5_8018B9D0(Actor* actor) {
actor->obj.rot.z = (-var_fa0 / 130.0f) * 90.0f;
if (fabsf(actor->vel.z) > 130.0f) {
var_v1 = (actor->vel.z > 0.0f) ? 1 : (actor->vel.z == 0.0f) ? 0 : -1;
var_fa0 = var_v1 * 130.0f;
var_fa0 = SIGN_OF(actor->vel.z) * 130.0f;
} else {
var_fa0 = actor->vel.z;
}
@ -1274,6 +1262,7 @@ void func_i5_8018C8A8(Actor* actor) {
f32 x;
f32 y;
f32 z;
s32 pad;
actor->iwork[7]++;
sp88 = gPlayer[0].unk_138 - actor->obj.pos.z;
@ -1614,9 +1603,12 @@ void func_i5_8018C8A8(Actor* actor) {
actorPtr->fwork[2] =
((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (4.0f + RAND_FLOAT(3.0f));
} else {
actorPtr->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (Rand_ZeroOne() + 0.5f);
actorPtr->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (Rand_ZeroOne() + 0.5f);
actorPtr->fwork[2] = ((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (Rand_ZeroOne() + 0.5f);
actorPtr->fwork[0] =
((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (RAND_FLOAT(1.0f) + 0.5f);
actorPtr->fwork[1] =
((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (RAND_FLOAT(1.0f) + 0.5f);
actorPtr->fwork[2] =
((Rand_ZeroOne() < 0.5f) ? -1.0f : 1.0f) * (RAND_FLOAT(1.0f) + 0.5f);
}
actorPtr->gravity = 0.8f;
}
@ -1946,7 +1938,7 @@ void func_i5_8018E5F8(Actor* actor) {
}
} else {
temp_v0_3->obj.pos.x = sp5C;
temp_v0_3->obj.pos.y = (f32) (sp70 + 5.0f);
temp_v0_3->obj.pos.y = sp70 + 5.0f;
temp_v0_3->obj.pos.z = sp54;
temp_v0_3->timer_50 = 2;
}
@ -2614,35 +2606,31 @@ void func_i5_8019081C(s32 limbIndex, Vec3f* rot, void* data) {
}
#ifdef NON_MATCHING
// float regalloc
// https://decomp.me/scratch/cEhIC
// float regalloc starting with the spherical angle calculation
// https://decomp.me/scratch/9ewO1
bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) {
Vec3f spCC;
f32 spC8;
f32 spC4;
f32 spC0;
f32 spBC;
Vec3f spC0;
// f32 spBC;
// f32 padB8;
Vec3f padB4; // Vec3f? Seems kind of wasteful
s32 i;
s32 temp_v1;
s32 padAC[1];
f32 temp;
u32 spA8;
Boss* boss = (Boss*) data;
s32 spA8;
s32 temp_v1;
s32 spA0;
f32 sp9C;
s32 ret;
Vec3f sp8C;
s32 sp88;
Vec3f sp7C;
f32 sp78;
f32 sp74;
f32 sp70;
Vec3f sp70;
s32 sp6C;
f32 sp68;
s32 pad64;
f32 sp60;
f32 sp5C;
// f32 pad64;
// f32 sp60;
Vec3f sp5C; // Vec3f?
s32 sp58;
ret = false;
@ -2671,9 +2659,8 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
if (D_i5_801BBEF4[2] != 0.0f) {
rot->z += D_i5_801BBEF4[2];
if (D_i5_801BBEF4[3] != 0.0f) {
rot->z += (__sinf((D_i5_801BBEF4[3] / D_i5_801BBEF4[5]) * 360.0f * M_DTOR) *
D_i5_801BBEF4[3]) /
6.0f;
rot->z += __sinf((D_i5_801BBEF4[3] / D_i5_801BBEF4[5]) * 360.0f * M_DTOR) *
D_i5_801BBEF4[3] / 6.0f;
}
}
break;
@ -2707,16 +2694,16 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
spA0 = (temp_v1 != -1) && (D_i5_801BD668[temp_v1] != 0);
if (spA0 != 0) {
spA8 = (u32) D_i5_801B7960[temp_v1][0];
sp9C = ((__sinf(D_i5_801BD6B0[temp_v1] * M_DTOR) * (f32) D_i5_801BD668[temp_v1]) /
(f32) D_i5_801B7960[temp_v1][1]) *
spA8 = D_i5_801B7960[temp_v1][0];
sp9C = ((__sinf(D_i5_801BD6B0[temp_v1] * M_DTOR) * D_i5_801BD668[temp_v1]) /
D_i5_801B7960[temp_v1][1]) *
D_i5_801B7960[temp_v1][2];
switch (spA8) {
case 0:
break;
case 1:
spC0 = 0.0f;
spC8 = spC4 = sp9C;
spC0.x = 0.0f;
spC0.z = spC0.y = sp9C;
break;
case 2:
if (sp88 == 0) {
@ -2728,7 +2715,7 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
rot->y += sp9C;
break;
case 4:
spBC = sp9C;
padB4.z = sp9C;
break;
}
}
@ -2749,19 +2736,24 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1);
Matrix_GetYRPAngles(gCalcMatrix, &sp8C);
Matrix_MultVec3f(gCalcMatrix, &D_800C9F2C, &sp7C);
if ((limbIndex == 0x47) && (boss->fwork[0x2E] != 0.0f)) {
sp70 = (gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x)) * boss->fwork[0x2E];
sp74 = (gPlayer[0].pos.y + 50.0f) - (boss->obj.pos.y + sp7C.y);
sp78 = (gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z)) * boss->fwork[0x2E];
sp60 = Math_Atan2F(sp70, sp78) * M_RTOD;
sp5C = -Math_Atan2F(sp74, sqrtf(SQ(sp70) + SQ(sp78))) * M_RTOD;
sp70.x = (gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x)) * boss->fwork[0x2E];
sp70.y = (gPlayer[0].pos.y + 50.0f) - (boss->obj.pos.y + sp7C.y);
sp70.z = (gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z)) * boss->fwork[0x2E];
sp5C.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD;
sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(sp70.z))) * M_RTOD;
} else {
sp70 = gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x);
sp74 = (gPlayer[0].pos.y + 30.0f) - (boss->obj.pos.y + sp7C.y);
sp78 = gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z);
sp60 = Math_Atan2F(sp70, sp78) * M_RTOD;
sp5C = -Math_Atan2F(sp74, sqrtf(SQ(sp70) + SQ(sp78))) * M_RTOD;
sp70.x = gPlayer[0].pos.x - (boss->obj.pos.x + sp7C.x);
sp70.y = (gPlayer[0].pos.y + 30.0f) - (boss->obj.pos.y + sp7C.y);
sp70.z = gPlayer[0].unk_138 - (boss->obj.pos.z + sp7C.z);
sp5C.y = Math_Atan2F(sp70.x, sp70.z) * M_RTOD;
sp5C.x = -Math_Atan2F(sp70.y, sqrtf(SQ(sp70.x) + SQ(sp70.z))) * M_RTOD;
}
Matrix_Pop(&gCalcMatrix);
Matrix_RotateZ(gCalcMatrix, -(spCC.z * M_DTOR), 1);
Matrix_RotateX(gCalcMatrix, -(spCC.x * M_DTOR), 1);
@ -2770,13 +2762,15 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
case 0x37:
if (D_i5_801BBEF0[15] == 1) {
D_i5_801BBEF4[20] = 0.0f;
D_i5_801BBEF4[21] = sp60 - 90.0f;
D_i5_801BBEF4[22] = -sp5C;
D_i5_801BBEF4[21] = sp5C.y - 90.0f;
D_i5_801BBEF4[22] = -sp5C.x;
D_i5_801BBEF0[15] = 0;
}
D_i5_801BBEF4[29] = 0.0f;
D_i5_801BBEF4[30] = sp60 - 90.0f;
D_i5_801BBEF4[31] = -sp5C;
D_i5_801BBEF4[30] = sp5C.y - 90.0f;
D_i5_801BBEF4[31] = -sp5C.x;
sp8C.x = 0.0f;
Math_SmoothStepToAngle(&sp8C.y, D_i5_801BBEF4[21], boss->fwork[0x28], 360.0f, 0.01f);
Math_SmoothStepToAngle(&sp8C.z, D_i5_801BBEF4[22], boss->fwork[0x28], 360.0f, 0.01f);
@ -2784,13 +2778,13 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
case 0x3D:
if (D_i5_801BBEF0[14] == 1) {
D_i5_801BBEF4[17] = 0.0f;
D_i5_801BBEF4[18] = sp60 - 90.0f;
D_i5_801BBEF4[19] = -sp5C;
D_i5_801BBEF4[18] = sp5C.y - 90.0f;
D_i5_801BBEF4[19] = -sp5C.x;
D_i5_801BBEF0[14] = 0;
}
D_i5_801BBEF4[26] = 0.0f;
D_i5_801BBEF4[27] = sp60 - 90.0f;
D_i5_801BBEF4[28] = -sp5C;
D_i5_801BBEF4[27] = sp5C.y - 90.0f;
D_i5_801BBEF4[28] = -sp5C.x;
sp8C.x = 0.0f;
Math_SmoothStepToAngle(&sp8C.y, D_i5_801BBEF4[18], boss->fwork[39], 360.0f, 0.01f);
Math_SmoothStepToAngle(&sp8C.z, D_i5_801BBEF4[19], boss->fwork[39], 360.0f, 0.01f);
@ -2798,12 +2792,12 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
case 0x47:
if (D_i5_801BBEF0[13] == 1) {
D_i5_801BBEF4[14] = 0.0f;
D_i5_801BBEF4[15] = sp60 + 90.0f;
D_i5_801BBEF4[16] = sp5C + 180.0f;
D_i5_801BBEF4[15] = sp5C.y + 90.0f;
D_i5_801BBEF4[16] = sp5C.x + 180.0f;
D_i5_801BBEF0[13] = 0;
}
D_i5_801BBEF4[24] = sp60 + 90.0f;
D_i5_801BBEF4[25] = sp5C + 180.0f;
D_i5_801BBEF4[24] = sp5C.y + 90.0f;
D_i5_801BBEF4[25] = sp5C.x + 180.0f;
while (D_i5_801BBEF4[24] >= 270.0f) {
D_i5_801BBEF4[24] -= 360.0f;
}
@ -2845,12 +2839,12 @@ bool func_i5_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void*
switch (spA8) {
case 1:
Matrix_Push(&gCalcMatrix);
Matrix_Translate(gCalcMatrix, spC0, spC4, spC8, 1);
Matrix_Translate(gCalcMatrix, spC0.x, spC0.y, spC0.z, 1);
break;
case 4:
Matrix_Push(&gCalcMatrix);
Matrix_Translate(gCalcMatrix, 40.0f, 0.0f, 0.0f, 1);
Matrix_RotateZ(gCalcMatrix, spBC * M_DTOR, 1);
Matrix_RotateZ(gCalcMatrix, padB4.z * M_DTOR, 1);
Matrix_Translate(gCalcMatrix, -40.0f, 0.0f, 0.0f, 1);
break;
}
@ -3295,7 +3289,7 @@ void func_i5_80192118(Boss* boss) {
}
break;
}
D_i5_801BBEF4[51] = (f32) (SIN_DEG((((f32) (boss->swork[38] & 0x7F) * 360.0f) / 128)) * 40.0f);
D_i5_801BBEF4[51] = SIN_DEG((((boss->swork[38] & 0x7F) * 360.0f) / 128)) * 40.0f;
switch (D_i5_801BBEF0[28]) {
case 0:
@ -3494,7 +3488,6 @@ void func_i5_80192118(Boss* boss) {
}
void func_i5_80193B30(Boss* boss) {
if (boss->state == boss->swork[1]) {
if (boss->swork[1] != 11) {
boss->swork[1] = 11;
@ -3622,20 +3615,20 @@ const s16 D_i5_801BAB5C[8] = {
};
#ifdef NON_MATCHING
// lui/addiu issues with D_i5_801BBEF4 in case 11
// https://decomp.me/scratch/a1SSR
// Regalloc in the random ternary. Can't be a temp as it's too low on stack
// https://decomp.me/scratch/KiTNa
void func_i5_80193DF0(Boss* boss) {
Vec3f spD4;
Vec3f spC8;
s32 i;
s32 j;
Actor* actor;
Effect* effect;
s32 var_v1;
s32 spB8;
s32 i;
s32 j;
f32 temp_f;
Effect* effect;
s32 pad;
Actor* actor;
s32 spA4;
s32 pad2;
f32 sp9C;
@ -3701,6 +3694,7 @@ void func_i5_80193DF0(Boss* boss) {
Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D0C, &spC8);
Matrix_Pop(&gCalcMatrix);
actor->vel.x = spC8.x;
// pad2 = ((Rand_ZeroOne() < 0.5f) ? -1 : 1);
actor->vel.y = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (15.0f + RAND_FLOAT(2.0f));
actor->vel.z = spC8.z;
actor->gravity = 2.5f;
@ -3740,7 +3734,7 @@ void func_i5_80193DF0(Boss* boss) {
}
}
for (i = 0; i < 34; i++) {
for (i = 0; i < ARRAY_COUNT(D_i5_801BD668); i++) {
if (D_i5_801BD668[i] > 0) {
D_i5_801BD6B0[i] += D_i5_801B7960[i][3];
D_i5_801BD668[i]--;
@ -3784,12 +3778,14 @@ void func_i5_80193DF0(Boss* boss) {
}
if (D_i5_801BBEF0[6] != 0) {
for (i = 0; i < ARRAY_COUNTU(D_i5_801BBF00); i++) {
for (j = 0; j < 14; j++) {
for (j = 0; j < ARRAY_COUNT(D_i5_801B8160); j++) {
if (D_i5_801B7770[i][0] == D_i5_801B8160[j]) {
break;
}
}
if (j == 14) {
if (boss->unk_04C) {}
if (j == ARRAY_COUNT(D_i5_801B8160)) {
D_i5_801BBF00[i].unk_20 = RAND_FLOAT(5.0f) - 2.5f;
}
}
@ -3827,16 +3823,16 @@ void func_i5_80193DF0(Boss* boss) {
D_i5_801BBEF4[10] = 2.0f;
}
}
var_v1 = 0;
pad = 0;
for (i = 0; i < 4; i++) {
if (boss->swork[9 + i] <= 0) {
var_v1++;
pad++;
}
}
if ((var_v1 == 3) && (D_i5_801BBEF0[8] == 0)) {
if ((pad == 3) && (D_i5_801BBEF0[8] == 0)) {
D_i5_801BBF00[39].unk_26 |= 0x10 | 0x1;
}
if (var_v1 == 4) {
if (pad == 4) {
D_i5_801BBEF0[41] = 0;
boss->swork[28] = 1;
boss->swork[27] = 80;
@ -3859,7 +3855,7 @@ void func_i5_80193DF0(Boss* boss) {
D_i5_801BBEF0[1] = 20;
}
}
gBossHealthBar = (s32) (((f32) boss->swork[21] * 255.0f) / 100.0f);
gBossHealthBar = (s32) ((boss->swork[21] * 255.0f) / 100.0f);
boss->swork[22] = 20;
D_i5_801BBEF0[6] = 20;
@ -3891,17 +3887,17 @@ void func_i5_80193DF0(Boss* boss) {
boss->swork[boss->dmgPart + 9] = 0;
D_i5_801BBEF0[6] = 40;
D_i5_801BBEF4[10] = 2.0f;
var_v1 = 0;
pad = 0;
for (i = 0; i < 4; i++) {
if (boss->swork[9 + i] <= 0) {
var_v1++;
pad++;
}
}
if ((var_v1 == 3) && (D_i5_801BBEF0[8] == 0)) {
if ((pad == 3) && (D_i5_801BBEF0[8] == 0)) {
D_i5_801BBF00[39].unk_26 |= 0x11;
}
if (var_v1 == 4) {
if (pad == 4) {
D_i5_801BBEF0[41] = 0;
boss->swork[28] = 1;
boss->swork[27] = 80;
@ -3927,7 +3923,7 @@ void func_i5_80193DF0(Boss* boss) {
D_i5_801BBEF0[1] = 20;
}
}
gBossHealthBar = (s32) (((f32) boss->swork[21] * 255.0f) / 100.0f);
gBossHealthBar = (s32) ((boss->swork[21] * 255.0f) / 100.0f);
boss->swork[22] = 20;
D_i5_801BBEF0[6] = 20;
D_i5_801BBEF4[10] = 4.0f;
@ -3945,7 +3941,6 @@ void func_i5_80193DF0(Boss* boss) {
}
switch (boss->swork[28]) {
case 1:
if (boss->swork[27] == 0) {
boss->swork[28]++;
@ -4030,9 +4025,9 @@ void func_i5_80193DF0(Boss* boss) {
for (i = 0; i < 33; i++) {
actor = D_i5_801B8198[i].actor;
if (actor != NULL) {
j = D_i5_801B8198[i].unk_00;
actor->obj.pos.x = boss->obj.pos.x + (D_i5_801BBF00[j].unk_00.pos.x * 2.0f);
actor->obj.pos.y = boss->obj.pos.y + D_i5_801BBF00[j].unk_00.pos.y;
pad2 = D_i5_801B8198[i].unk_00;
actor->obj.pos.x = boss->obj.pos.x + (D_i5_801BBF00[pad2].unk_00.pos.x * 2.0f);
actor->obj.pos.y = boss->obj.pos.y + D_i5_801BBF00[pad2].unk_00.pos.y;
}
}
boss->swork[28]++;
@ -4044,8 +4039,8 @@ void func_i5_80193DF0(Boss* boss) {
actor = D_i5_801B8198[i].actor;
if (actor != NULL) {
if (D_i5_801B8198[i].unk_0C == 0) {
j = D_i5_801B8198[i].unk_00;
Matrix_MultVec3f(gCalcMatrix, &D_i5_801BBF00[j].unk_00.pos, &spC8);
pad2 = D_i5_801B8198[i].unk_00;
Matrix_MultVec3f(gCalcMatrix, &D_i5_801BBF00[pad2].unk_00.pos, &spC8);
sp9C =
fabsf(Math_SmoothStepToF(&actor->obj.pos.x, boss->obj.pos.x + spC8.x, 1.0f, 40.0f, 0.01f));
sp9C +=
@ -4113,8 +4108,8 @@ void func_i5_80193DF0(Boss* boss) {
Animation_GetFrameData(&D_TI_A009990, boss->unk_04C >> 1, D_i5_801BC978);
break;
}
switch (boss->swork[34]) {
pad2 = boss->swork[34];
switch (pad2) {
case 0:
break;
case 1:
@ -4215,9 +4210,9 @@ void func_i5_80193DF0(Boss* boss) {
spB8 = 1;
}
break;
case 7:
if (boss->swork[9] > 0) {
case 7: {
if (boss->swork[9] > 0) {
for (i = 0; i < 9; i++) {
if (boss->unk_04C == D_i5_801B8138[i]) {
sp90.x = boss->obj.pos.x + boss->fwork[23];
@ -4231,7 +4226,6 @@ void func_i5_80193DF0(Boss* boss) {
}
}
if ((boss->swork[10] > 0) && ((D_i5_801BBEF0[41] == 2) || (D_i5_801BBEF0[8] != 0))) {
for (i = 0; i < 9; i++) {
if (boss->unk_04C == D_i5_801B814C[i]) {
sp90.x = boss->obj.pos.x + boss->fwork[29];
@ -4270,7 +4264,7 @@ void func_i5_80193DF0(Boss* boss) {
boss->fwork[37] = 0.0f;
spB8 = 1;
}
break;
} break;
case 8:
if ((boss->unk_04C == 0) && (boss->swork[11] <= 0)) {
boss->unk_04C = 62;
@ -4415,7 +4409,6 @@ void func_i5_80193DF0(Boss* boss) {
D_80178354 = 255;
D_80178340 = (D_i5_801BBEF0[26] * 255.0f) / 3.0f;
}
if ((boss->unk_04C >= 54) && (boss->unk_04C < 120)) {
boss->fwork[46] += 0.04f;
if (boss->fwork[46] > 1.0f) {
@ -4488,7 +4481,7 @@ void func_i5_80193DF0(Boss* boss) {
case 12:
boss->swork[33] = 1;
if ((boss->unk_04C >= 38) && (boss->unk_04C < 141)) {
boss->fwork[1] = ((f32) (boss->unk_04C - 38) * 360.0f) / 102.0f;
boss->fwork[1] = ((boss->unk_04C - 38) * 360.0f) / 102.0f;
}
Math_SmoothStepToAngle(&boss->fwork[49], boss->fwork[1], 0.5f, 180.0f, 0.0f);
Math_SmoothStepToF(&boss->fwork[0], 0.5f, 1.0f, 0.02f, 0.0f);
@ -4534,8 +4527,8 @@ void func_i5_80193DF0(Boss* boss) {
}
break;
}
switch (boss->swork[34]) {
pad2 = boss->swork[34];
switch (pad2) {
case 0:
break;
case 1:
@ -4543,7 +4536,7 @@ void func_i5_80193DF0(Boss* boss) {
if (Animation_GetFrameCount(&D_TI2_70096EC) * 2 <= boss->fwork[48]) {
boss->fwork[48] -= Animation_GetFrameCount(&D_TI2_70096EC) * 2;
} else if (boss->fwork[48] < 0.0f) {
boss->fwork[48] += Animation_GetFrameCount(&D_TI2_70096EC) * 2 - 1.0f;
boss->fwork[48] = boss->fwork[48] + (Animation_GetFrameCount(&D_TI2_70096EC) * 2 - 1.0f);
}
break;
case 2:
@ -4572,18 +4565,18 @@ void func_i5_80193DF0(Boss* boss) {
D_i5_801BBEF0[44]++;
}
D_i5_801BBEF0[42] = 0;
switch (boss->swork[1]) {
pad2 = boss->swork[1];
switch (pad2) {
case 7:
if (boss->swork[37] & 2) {
var_v1 = 0;
pad = 0;
for (i = 0; i < 4; i++) {
if (boss->swork[9 + i] <= 0) {
var_v1++;
pad++;
}
}
if ((var_v1 != 4) && gTeamShields[3] > 0) {
if ((pad != 4) && gTeamShields[3] > 0) {
Radio_PlayMessage(gMsg_ID_4095, RCID_PEPPY);
}
boss->swork[37] &= ~2;
@ -4610,14 +4603,14 @@ void func_i5_80193DF0(Boss* boss) {
for (i = 0; i < 4; i++) {
if (boss->swork[9 + i] == 0) {
j = boss->swork[17 + i];
if (boss->swork[13 + i] == D_i5_801BAB0C[i][j]) {
var_v1 = boss->swork[17 + i];
if (boss->swork[13 + i] == D_i5_801BAB0C[i][var_v1]) {
do {
D_i5_801BBF00[D_i5_801BAABC[i][j]].unk_26 = 3;
D_i5_801BBF00[D_i5_801BAABC[i][var_v1]].unk_26 = 3;
boss->swork[17 + i]++;
j++;
} while (D_i5_801BAB0C[i][j] == 0);
if (D_i5_801BAB0C[i][j] == -1) {
var_v1++;
} while (D_i5_801BAB0C[i][var_v1] == 0);
if (D_i5_801BAB0C[i][var_v1] == -1) {
boss->swork[9 + i] = -1;
} else {
boss->swork[13 + i] = 0;
@ -5015,7 +5008,7 @@ void func_i5_801982A8(Boss* boss) {
Matrix_Translate(gGfxMatrix, boss->fwork[17], boss->fwork[18], boss->fwork[19] + 50.0f, 1);
RCP_SetupDL_14();
for (i = 0; i < 3; i++) {
sp120 = (boss->fwork[43] + (f32) i) / 3.0f;
sp120 = (boss->fwork[43] + i) / 3.0f;
temp_fs2 = boss->fwork[45] * sp120;
temp_fv0 = 1.0f - sp120;
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) (temp_fv0 * 255.0f),
@ -5036,7 +5029,7 @@ void func_i5_801982A8(Boss* boss) {
if (D_i5_801BBEF0[7] != 0) {
Matrix_Push(&gGfxMatrix);
sp120 = (f32) D_i5_801BBEF0[7] * 16.0f;
sp120 = D_i5_801BBEF0[7] * 16.0f;
RCP_SetupDL(&gMasterDisp, 0x40);
Matrix_RotateX(gGfxMatrix, 1.5707964f, 1);
Matrix_Push(&gGfxMatrix);
@ -5046,7 +5039,7 @@ void func_i5_801982A8(Boss* boss) {
gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0);
Matrix_Pop(&gGfxMatrix);
if (D_i5_801BBEF0[7] > 0) {
sp120 = (f32) (D_i5_801BBEF0[7] - 1) * 24.0f;
sp120 = (D_i5_801BBEF0[7] - 1) * 24.0f;
Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, 1);
Matrix_SetGfxMtx(&gMasterDisp);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 120, 255, 220, D_i5_801BBEF0[7] * 50);
@ -5077,8 +5070,7 @@ void func_i5_801982A8(Boss* boss) {
Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1);
Matrix_SetGfxMtx(&gMasterDisp);
RCP_SetupDL(&gMasterDisp, 0x31);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255,
(s32) ((f32) (D_i5_801BBEF0[17] * 89.0f) / 3.0f));
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) ((D_i5_801BBEF0[17] * 89.0f) / 3.0f));
gDPSetEnvColor(gMasterDisp++, 0, 128, 60, 0);
gSPDisplayList(gMasterDisp++, D_TI2_7005300);
Matrix_Pop(&gGfxMatrix);
@ -5183,18 +5175,14 @@ void func_i5_801990DC(Boss* boss) {
actor->vel.z = -30.0f;
actor->gravity = 0.1f;
} else {
actor->fwork[0] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[1] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
Matrix_Push(&gCalcMatrix);
Matrix_RotateY(gCalcMatrix, RAND_FLOAT(360.0f) * M_DTOR, 0);
Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8E44, &sp60);
Matrix_Pop(&gCalcMatrix);
actor->vel.x = sp60.x;
actor->vel.y = ((f32) ((D_i5_801BBF00[i].unk_00.pos.y > 250.0f) ? 1
: (D_i5_801BBF00[i].unk_00.pos.y == 250.0f) ? 0
: -1) -
RAND_FLOAT(0.5f)) +
0.5f;
actor->vel.y = SIGN_OF(D_i5_801BBF00[i].unk_00.pos.y - 250.0f) - RAND_FLOAT(0.5f) + 0.5f;
actor->vel.z = (boss->vel.z * 0.5f) + sp60.z;
actor->gravity = 0.1f;
}
@ -5211,8 +5199,8 @@ void func_i5_801990DC(Boss* boss) {
case 100:
actor = func_800A3608(OBJ_ACTOR_189);
if (actor != NULL) {
actor->fwork[0] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (Rand_ZeroOne() + 1.0f);
actor->fwork[1] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (Rand_ZeroOne() + 1.0f);
actor->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(1.0f) + 1.0f);
actor->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(1.0f) + 1.0f);
actor->state = 40;
actor->unk_046 = 25;
actor->unk_048 = 0;
@ -5231,8 +5219,8 @@ void func_i5_801990DC(Boss* boss) {
case 120:
actor = func_800A3608(OBJ_ACTOR_189);
if (actor != NULL) {
actor->fwork[0] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[1] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f);
actor->state = 40;
actor->unk_046 = 2;
actor->unk_048 = 1;
@ -5252,8 +5240,8 @@ void func_i5_801990DC(Boss* boss) {
case 140:
actor = func_800A3608(OBJ_ACTOR_189);
if (actor != NULL) {
actor->fwork[0] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (Rand_ZeroOne() + 1.0f);
actor->fwork[1] = (f32) ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (Rand_ZeroOne() + 1.0f);
actor->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(1.0f) + 1.0f);
actor->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(1.0f) + 1.0f);
actor->state = 40;
actor->unk_046 = 2;
actor->unk_048 = 1;

View File

@ -78,7 +78,7 @@ void func_i5_8018769C(Player* player) {
player->unk_1D0 = 1;
gFogFar = 1006;
gPlayer[0].unk_19C = 0;
gBgColor = 0x78C1;
gBgColor = 0x78C1; // 120, 24, 0
case 1:
D_80177A48[0] = 0.01f;
@ -147,7 +147,7 @@ void func_i5_8018769C(Player* player) {
gPlayer[0].unk_19C = 1;
gBgColor = 0x2089;
gBgColor = 0x2089; // 32, 16, 32
player->unk_16C = 0.5f;
player->unk_170 = 0.5f;

View File

@ -1018,7 +1018,7 @@ void func_i6_80189B70(Boss* boss) {
gFogBlue = 0;
gFogNear = 996;
gFogFar = 1007;
gBgColor = 0x4081;
gBgColor = 0x4081; // 64, 16, 0
D_80161A44 = 30000.0f;
gGroundLevel = -50.0f;
gPlayer[0].pos.x = -25995.0f;

View File

@ -5436,8 +5436,8 @@ void func_menu_801A9A8C(void) {
void func_menu_801A9DE8(void) {
s32 mask;
if (!((D_menu_801CD978 != 0) || (D_menu_801CD944 == 3) || (D_menu_801CD944 == 6) ||
((D_menu_801CD944 == 7) && (D_menu_801CD948 == 2)))) {
if ((D_menu_801CD978 == 0) &&
!((D_menu_801CD944 == 3) || (D_menu_801CD944 == 6) || ((D_menu_801CD944 == 7) && (D_menu_801CD948 == 2)))) {
return;
}

View File

@ -6,7 +6,7 @@
#include "mods.h"
#include "global.h"
#include "prevent_bss_reordering.h"
// #include "prevent_bss_reordering.h"
#include "fox_option.h"
extern s32 D_menu_801B81A8[][3];

@ -1 +1 @@
Subproject commit aa22c0803efa346b7886e8c2d44a04eddb020b3c
Subproject commit db11318e5cbf915cf483395672b8409d2564dd98

View File

@ -6,6 +6,7 @@ compiler_type = "ido"
"G_.*" = "int"
"M_.*" = "float"
"ARRAY_COUNT" = "int"
"ARRAY_COUNTU" = "int"
"[AB]_BUTTON" = "int"
"START_BUTTON" = "int"
"[LRZ]_TRIG" = "int"