First compilation, we just need more stupid assets

This commit is contained in:
KiritoDv
2024-03-24 02:01:28 -06:00
parent 126a55aa0e
commit 641a43cbf9
113 changed files with 3537 additions and 10111 deletions
+4 -2
View File
@@ -2272,10 +2272,12 @@ void ActorAllRange_Draw(Actor* actor) {
break;
}
} else if (gCurrentLevel == LEVEL_SECTOR_Z) {
gSPDisplayList(gMasterDisp++, D_SZ_6004FE0) Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1);
gSPDisplayList(gMasterDisp++, D_SZ_6004FE0);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1);
func_edisplay_8005B1E8(actor, 2);
} else if (gCurrentLevel == LEVEL_BOLSE) {
gSPDisplayList(gMasterDisp++, D_BO_6008770) Matrix_Push(&gGfxMatrix);
gSPDisplayList(gMasterDisp++, D_BO_6008770);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1);
func_edisplay_8005B1E8(actor, 2);
Matrix_Pop(&gGfxMatrix);
+17 -18
View File
@@ -27,22 +27,21 @@ OverlayInit sCurrentOverlay = {
};
void Overlay_LoadSegment(void* vRomAddress, void* dest, ptrdiff_t size) {
s32 i;
for (i = 0; gDmaTable[i].pRom.end != NULL; i++) {
if (gDmaTable[i].vRomAddress == vRomAddress) {
if (gDmaTable[i].compFlag == 0) {
Lib_DmaRead(gDmaTable[i].pRom.start, dest, size);
} else {
Lib_FillScreen(true);
sFillTimer = 3;
D_game_80161A39 = true;
Lib_DmaRead(gDmaTable[i].pRom.start, gFrameBuffers, SEGMENT_SIZE(gDmaTable[i].pRom));
Mio0_Decompress(gFrameBuffers, dest);
}
break;
}
}
// s32 i;
// for (i = 0; gDmaTable[i].pRom.end != NULL; i++) {
// if (gDmaTable[i].vRomAddress == vRomAddress) {
// if (gDmaTable[i].compFlag == 0) {
// Lib_DmaRead(gDmaTable[i].pRom.start, dest, size);
// } else {
// Lib_FillScreen(true);
// sFillTimer = 3;
// D_80161A39 = true;
// Lib_DmaRead(gDmaTable[i].pRom.start, gFrameBuffers, SEGMENT_SIZE(gDmaTable[i].pRom));
// Mio0_Decompress(gFrameBuffers, dest);
// }
// break;
// }
// }
}
u8 Overlay_Init(OverlayInit* ovlInit) {
@@ -196,6 +195,6 @@ u8 Overlay_Load(u8 ovlSetup, u8 ovlStage) {
}
void Overlay_InitDma(void) {
Lib_DmaRead(SEGMENT_ROM_START(dma_table), SEGMENT_VRAM_START(dma_table), SEGMENT_ROM_SIZE(dma_table));
Overlay_LoadSegment(SEGMENT_ROM_START(ast_radio), SEGMENT_VRAM_START(ast_radio), SEGMENT_ROM_SIZE(ast_radio));
// Lib_DmaRead(SEGMENT_ROM_START(dma_table), SEGMENT_VRAM_START(dma_table), SEGMENT_ROM_SIZE(dma_table));
// Overlay_LoadSegment(SEGMENT_ROM_START(ast_radio), SEGMENT_VRAM_START(ast_radio), SEGMENT_ROM_SIZE(ast_radio));
}
+2 -7
View File
@@ -4,12 +4,7 @@
{ NULL, NULL }
#define OVERLAY_OFFSETS(file) \
{ \
{ SEGMENT_ROM_START(file), SEGMENT_ROM_END(file) }, { SEGMENT_BSS_START(file), SEGMENT_BSS_END(file) }, \
{ SEGMENT_TEXT_START(file), SEGMENT_TEXT_END(file) }, { \
SEGMENT_DATA_START(file), SEGMENT_RODATA_END(file) \
} \
}
NO_OVERLAY
#define NO_OVERLAY \
{ \
@@ -19,7 +14,7 @@
}
#define ROM_SEGMENT(file) \
{ SEGMENT_ROM_START(file), SEGMENT_ROM_END(file) }
NO_SEGMENT
OverlayInit sNoOvl_Logo[1] = {
{ NO_OVERLAY,
+6 -6
View File
@@ -39,26 +39,26 @@ u16 Save_Checksum(Save* arg0) {
}
s32 Save_Write(void) {
void* sp1C;
OSMesg sp1C;
gSaveFile.save.checksum = Save_Checksum(&gSaveFile.save);
gSaveFile.backup = gSaveFile.save;
gSaveIOBuffer = gSaveFile;
osSendMesg(&gSerialThreadMsgQueue, (OSMesg) SI_WRITE_SAVE, OS_MESG_PRI_NORMAL);
osSendMesg(&gSerialThreadMsgQueue, OS_MESG_32(SI_WRITE_SAVE), OS_MESG_PRI_NORMAL);
osRecvMesg(&gSaveMsgQueue, &sp1C, OS_MESG_BLOCK);
if (sp1C != (OSMesg) SI_SAVE_SUCCESS) {
if (sp1C.data32 != SI_SAVE_SUCCESS) {
return -1;
}
return 0;
}
s32 Save_Read(void) {
void* sp24;
OSMesg* sp24;
s32 i;
osSendMesg(&gSerialThreadMsgQueue, (OSMesg) SI_READ_SAVE, OS_MESG_PRI_NORMAL);
osSendMesg(&gSerialThreadMsgQueue, OS_MESG_32(SI_READ_SAVE), OS_MESG_PRI_NORMAL);
osRecvMesg(&gSaveMsgQueue, &sp24, OS_MESG_BLOCK);
if ((s32) sp24 != SI_SAVE_SUCCESS) {
if (sp24->data32 != SI_SAVE_SUCCESS) {
return -1;
}
+40
View File
@@ -0,0 +1,40 @@
#include <libultraship.h>
#include <math.h>
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far,
float scale) {
float yscale;
int row;
int col;
guMtxIdentF(mf);
fovy *= GU_PI / 180.0;
yscale = cosf(fovy / 2) / sinf(fovy / 2);
mf[0][0] = yscale / aspect;
mf[1][1] = yscale;
mf[2][2] = (near + far) / (near - far);
mf[2][3] = -1;
mf[3][2] = 2 * near * far / (near - far);
mf[3][3] = 0.0f;
for (row = 0; row < 4; row++) {
for (col = 0; col < 4; col++) {
mf[row][col] *= scale;
}
}
if (perspNorm != NULL) {
if (near + far <= 2.0) {
*perspNorm = 65535;
} else {
*perspNorm = (double) (1 << 17) / (near + far);
if (*perspNorm <= 0) {
*perspNorm = 1;
}
}
}
}
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far,
float scale) {
float mat[4][4];
guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale);
guMtxF2L(mat, m);
}
+73
View File
@@ -0,0 +1,73 @@
#include <libultraship.h>
void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp,
float yUp, float zUp) {
float len;
float xLook;
float yLook;
float zLook;
float xRight;
float yRight;
float zRight;
guMtxIdentF(mf);
xLook = xAt - xEye;
yLook = yAt - yEye;
zLook = zAt - zEye;
/* Negate because positive Z is behind us: */
len = -1.0 / guSqrtf(xLook * xLook + yLook * yLook + zLook * zLook);
xLook *= len;
yLook *= len;
zLook *= len;
/* Right = Up x Look */
xRight = yUp * zLook - zUp * yLook;
yRight = zUp * xLook - xUp * zLook;
zRight = xUp * yLook - yUp * xLook;
len = 1.0 / guSqrtf(xRight * xRight + yRight * yRight + zRight * zRight);
xRight *= len;
yRight *= len;
zRight *= len;
/* Up = Look x Right */
xUp = yLook * zRight - zLook * yRight;
yUp = zLook * xRight - xLook * zRight;
zUp = xLook * yRight - yLook * xRight;
len = 1.0 / guSqrtf(xUp * xUp + yUp * yUp + zUp * zUp);
xUp *= len;
yUp *= len;
zUp *= len;
mf[0][0] = xRight;
mf[1][0] = yRight;
mf[2][0] = zRight;
mf[3][0] = -(xEye * xRight + yEye * yRight + zEye * zRight);
mf[0][1] = xUp;
mf[1][1] = yUp;
mf[2][1] = zUp;
mf[3][1] = -(xEye * xUp + yEye * yUp + zEye * zUp);
mf[0][2] = xLook;
mf[1][2] = yLook;
mf[2][2] = zLook;
mf[3][2] = -(xEye * xLook + yEye * yLook + zEye * zLook);
mf[0][3] = 0;
mf[1][3] = 0;
mf[2][3] = 0;
mf[3][3] = 1;
}
void guLookAt(Mtx* m, float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp, float yUp,
float zUp) {
float mf[4][4];
guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp);
guMtxF2L(mf, m);
}