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 17:06:28 -03:00
committed by GitHub
parent 26a3873e16
commit 97f544c557
42 changed files with 604 additions and 627 deletions
+1 -1
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 }
-2
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[];
+2 -2
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
+44 -7
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);
+3 -3
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;};
+10 -5
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];
+1 -3
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 {
+64 -49
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;
+1 -1
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;
+2 -2
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);
}
+12 -12
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) {
+1 -1
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;
+1 -1
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 },
+4 -3
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;
}
}
}
+22 -56
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 {
+1 -1
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];
+1 -1
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]);
+2 -2
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;
+192 -191
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);
}
}
}
+2 -2
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;

Some files were not shown because too many files have changed in this diff Show More