This commit is contained in:
KiritoDv 2024-04-08 20:54:05 -06:00 committed by Sonic Dreamcaster
parent 5b4a8176b8
commit 1940c26bce
7 changed files with 34 additions and 74 deletions

View File

@ -586,7 +586,8 @@ void HUD_VenomTitleCard_Draw(void) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76); RCP_SetupDL(&gMasterDisp, SETUPDL_76);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
Lib_TextureRect_IA8(&gMasterDisp, D_800D1C9C[i], D_800D1CA4[i], 19, D_800D1CB4[i], D_800D1CBC[i] - 28.0f, 1.0f, 1.0f); Lib_TextureRect_IA8(&gMasterDisp, D_800D1C9C[i], D_800D1CA4[i], 19, D_800D1CB4[i], D_800D1CBC[i] - 28.0f, 1.0f,
1.0f);
} }
} }
@ -663,9 +664,8 @@ void HUD_TitleCard_Draw(f32 x, f32 y) {
HUD_VenomTitleCard_Draw(); HUD_VenomTitleCard_Draw();
} }
Lib_TextureRect_IA8(&gMasterDisp, Lib_TextureRect_IA8(&gMasterDisp, sLevelTitleCard[j].titleCardTex, sLevelTitleCard[j].titleCardWidth, sLevelTitleCard[j].titleCardHeight, x2, y2, 1.0f,
sLevelTitleCard[levelIdx].titleCardTex, 1.0f);
sLevelTitleCard[levelIdx].titleCardWidth, sLevelTitleCard[levelIdx].titleCardHeight, x2, y2, 1.0f, 1.0f);
if ((gSavedObjectLoadIndex == 0) && (gAllRangeCheckpoint == 0) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && if ((gSavedObjectLoadIndex == 0) && (gAllRangeCheckpoint == 0) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) &&
(gCurrentLevel != LEVEL_TRAINING)) { (gCurrentLevel != LEVEL_TRAINING)) {
@ -1614,7 +1614,8 @@ void HUD_PauseScreen_Update(void) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76); RCP_SetupDL(&gMasterDisp, SETUPDL_76);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
Lib_TextureRect_IA8(&gMasterDisp, sLevelTitleCard[j].titleCardTex, sLevelTitleCard[j].titleCardWidth, sLevelTitleCard[j].titleCardHeight, x2, y2 + i, 1.0f, 1.0f); Lib_TextureRect_IA8(&gMasterDisp, sLevelTitleCard[j].titleCardTex, sLevelTitleCard[j].titleCardWidth, sLevelTitleCard[j].titleCardHeight, x2,
y2 + i, 1.0f, 1.0f);
HUD_MsgWindowBg_Draw2(x1 - 10.0f, y0 - 4.0f, 4.7f, 2.8f); HUD_MsgWindowBg_Draw2(x1 - 10.0f, y0 - 4.0f, 4.7f, 2.8f);

View File

@ -428,12 +428,10 @@ void func_radio_800BAAE8(void) {
if (mirror) { if (mirror) {
Lib_TextureRect_RGBA16_MirX(&gMasterDisp, radioPortraitTex, 44, 44, gRadioPortraitPosX, Lib_TextureRect_RGBA16_MirX(&gMasterDisp, radioPortraitTex, 44, 44, gRadioPortraitPosX,
gRadioPortraitPosY + 20.0f + sp38 + gRadioPortraitScaleY, 1.0f, gRadioPortraitPosY + 20.0f + sp38 + gRadioPortraitScaleY, 1.0f, gRadioPortraitScaleY);
gRadioPortraitScaleY);
} else { } else {
Lib_TextureRect_RGBA16(&gMasterDisp, radioPortraitTex, 44, 44, gRadioPortraitPosX, Lib_TextureRect_RGBA16(&gMasterDisp, radioPortraitTex, 44, 44, gRadioPortraitPosX,
gRadioPortraitPosY + 20.0f + sp38 + gRadioPortraitScaleY, 1.0f, gRadioPortraitPosY + 20.0f + sp38 + gRadioPortraitScaleY, 1.0f, gRadioPortraitScaleY);
gRadioPortraitScaleY);
} }
} }
} }

View File

@ -88,72 +88,39 @@ void func_versus_800BC88C(f32 xPos, f32 yPos, f32 scale) {
} }
void func_versus_800BC8D8(f32 xPos, f32 yPos, f32 scale) { void func_versus_800BC8D8(f32 xPos, f32 yPos, f32 scale) {
s32 i; Lib_TextureRect_CI8(&gMasterDisp, D_versus_300A470, D_versus_300B218, 152, 23, xPos, yPos, scale, scale);
for (i = 0; i < 2; i++) {
Lib_TextureRect_CI8(&gMasterDisp, D_versus_300A470 + (152 * 8 * i), D_versus_300B218, 152, 8, xPos,
yPos + (8 * i * scale), scale, scale);
}
Lib_TextureRect_CI8(&gMasterDisp, D_versus_300A470 + (152 * 8 * i), D_versus_300B218, 152, 7, xPos,
yPos + (8 * i * scale), scale, scale);
} }
void func_versus_800BC9DC(f32 xPos, f32 yPos, f32 scale, s32 yScale) { void func_versus_800BC9DC(f32 xPos, f32 yPos, f32 scale, s32 yScale) {
u16* D_800D4AA4[] = { D_versus_3008DE0, D_versus_30098C0, D_versus_300A390 }; u16* D_800D4AA4[] = { D_versus_3008DE0, D_versus_30098C0, D_versus_300A390 };
u8* D_800D4ABC[] = { D_versus_30087A0, D_versus_3008EC0, D_versus_3009990 }; u8* D_800D4ABC[] = { D_versus_30087A0, D_versus_3008EC0, D_versus_3009990 };
s32 D_800D4AB0[] = { 40, 64, 64 }; s32 D_800D4AB0[] = { 40, 64, 64 };
s32 i;
for (i = 0; i < 5; i++) { Lib_TextureRect_CI8(&gMasterDisp, D_800D4ABC[yScale], D_800D4AA4[yScale], D_800D4AB0[yScale], 40, xPos, yPos, scale,
Lib_TextureRect_CI8(&gMasterDisp, D_800D4ABC[yScale] + (D_800D4AB0[yScale] * 8 * i), D_800D4AA4[yScale], scale);
D_800D4AB0[yScale], 8, xPos, yPos + (8 * i * scale), scale, scale);
}
} }
void func_versus_800BCB44(f32 xPos, f32 yPos, f32 scale) { void func_versus_800BCB44(f32 xPos, f32 yPos, f32 scale) {
s32 i; Lib_TextureRect_CI8(&gMasterDisp, D_versus_3006C60, D_versus_3007500, 96, 23, xPos, yPos, scale, scale);
for (i = 0; i < 2; i++) {
Lib_TextureRect_CI8(&gMasterDisp, D_versus_3006C60 + (96 * 8 * i), D_versus_3007500, 96, 8, xPos,
yPos + (8 * i * scale), scale, scale);
}
Lib_TextureRect_CI8(&gMasterDisp, D_versus_3006C60 + (96 * 8 * i), D_versus_3007500, 96, 7, xPos,
yPos + (8 * i * scale), scale, scale);
} }
void func_versus_800BCC48(f32 xPos, f32 yPos, f32 xScale, f32 yScale, s32 arg4) { void func_versus_800BCC48(f32 xPos, f32 yPos, f32 xScale, f32 yScale, s32 arg4) {
u16* D_800D4AC8[] = { D_versus_3006A68, D_versus_3008598, D_versus_300C458, D_versus_3005E38 }; u16* D_800D4AC8[] = { D_versus_3006A68, D_versus_3008598, D_versus_300C458, D_versus_3005E38 };
u8* D_800D4AD8[] = { D_versus_3006040, D_versus_30076C0, D_versus_300B3F0, D_versus_3004F60 }; u8* D_800D4AD8[] = { D_versus_3006040, D_versus_30076C0, D_versus_300B3F0, D_versus_3004F60 };
s32 D_800D4AE8[] = { 104, 152, 168, 152 }; s32 D_800D4AE8[] = { 104, 152, 168, 152 };
s32 i;
for (i = 0; i < 3; i++) { Lib_TextureRect_CI8(&gMasterDisp, D_800D4AD8[arg4], D_800D4AC8[arg4], D_800D4AE8[arg4], 25, xPos, yPos, xScale,
Lib_TextureRect_CI8(&gMasterDisp, D_800D4AD8[arg4] + (D_800D4AE8[arg4] * 8 * i), D_800D4AC8[arg4], yScale);
D_800D4AE8[arg4], 8, xPos, yPos + (8 * i * yScale), xScale, yScale);
}
Lib_TextureRect_CI8(&gMasterDisp, D_800D4AD8[arg4] + (D_800D4AE8[arg4] * 8 * i), D_800D4AC8[arg4], D_800D4AE8[arg4],
1, xPos, yPos + (8 * i * yScale), xScale, yScale);
} }
void func_versus_800BCE24(f32 xPos, f32 yPos, f32 xScale, f32 yScale) { void func_versus_800BCE24(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
s32 i; Lib_TextureRect_CI8(&gMasterDisp, D_versus_3001420, D_versus_3003E20, 256, 42, xPos, yPos, xScale, yScale);
for (i = 0; i < 6; i++) {
Lib_TextureRect_CI8(&gMasterDisp, D_versus_3001420 + (256 * 7 * i), D_versus_3003E20, 256, 7, xPos,
yPos + (7 * i * yScale), xScale, yScale);
}
} }
void func_versus_800BCEF8(f32 xPos, f32 yPos, f32 scale) { void func_versus_800BCEF8(f32 xPos, f32 yPos, f32 scale) {
s32 i; s32 i;
for (i = 0; i < 12; i++) { Lib_TextureRect_CI8(&gMasterDisp, D_versus_3004010, D_versus_3004D58, 136, 25, xPos, yPos, scale, scale);
Lib_TextureRect_CI8(&gMasterDisp, D_versus_3004010 + (136 * 2 * i), D_versus_3004D58, 136, 2, xPos,
yPos + (2 * i * scale), scale, scale);
}
Lib_TextureRect_CI8(&gMasterDisp, D_versus_3004010 + (136 * 2 * i), D_versus_3004D58, 136, 1, xPos,
yPos + (2 * i * scale), scale, scale);
} }
void func_versus_800BCFFC(f32 xPos, f32 yPos, f32 xScale, f32 yScale) { void func_versus_800BCFFC(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
@ -203,12 +170,8 @@ void func_versus_800BD350(f32 xPos, f32 yPos) {
void func_versus_800BD3A8(f32 xPos, f32 yPos) { void func_versus_800BD3A8(f32 xPos, f32 yPos) {
s32 i; s32 i;
for (i = 0; i < 8; i++) { Lib_TextureRect_CI4(&gMasterDisp, aVsHandicapFrameTex + ((80 * 8 * i) / 2), aVsHandicapFrameTLUT, 80, 71, xPos, yPos, 1.0f,
Lib_TextureRect_CI4(&gMasterDisp, aVsHandicapFrameTex + ((80 * 8 * i) / 2), aVsHandicapFrameTLUT, 80, 8, xPos, 1.0f);
yPos + (i * 8), 1.0f, 1.0f);
}
Lib_TextureRect_CI4(&gMasterDisp, aVsHandicapFrameTex + ((80 * 8 * i) / 2), aVsHandicapFrameTLUT, 80, 7, xPos,
yPos + (i * 8), 1.0f, 1.0f);
} }
void func_versus_800BD4D4(f32 xPos, f32 yPos, s32 arg2) { void func_versus_800BD4D4(f32 xPos, f32 yPos, s32 arg2) {

View File

@ -2,8 +2,7 @@
#include <math.h> #include <math.h>
#include "libc/math.h" #include "libc/math.h"
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, void guPerspectiveF(float mf[4][4], u16* perspNorm, float fovy, float aspect, float near, float far, float scale) {
float scale) {
float yscale; float yscale;
int row; int row;
int col; int col;
@ -33,8 +32,7 @@ void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, fl
} }
} }
void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, float far, void guPerspective(Mtx* m, u16* perspNorm, float fovy, float aspect, float near, float far, float scale) {
float scale) {
float mat[4][4]; float mat[4][4];
guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale); guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale);
guMtxF2L(mat, m); guMtxF2L(mat, m);

View File

@ -35,14 +35,14 @@ void guMtxL2F(float mf[4][4], Mtx* m) {
u32* m1; u32* m1;
u32* m2; u32* m2;
s32 stmp1, stmp2; s32 stmp1, stmp2;
m1 = (u32*)&m->m[0][0]; m1 = (u32*) &m->m[0][0];
m2 = (u32*)&m->m[2][0]; m2 = (u32*) &m->m[2][0];
for (r = 0; r < 4; r++) { for (r = 0; r < 4; r++) {
for (c = 0; c < 2; c++) { for (c = 0; c < 2; c++) {
tmp1 = (*m1 & 0xffff0000) | ((*m2 >> 0x10) & 0xffff); tmp1 = (*m1 & 0xffff0000) | ((*m2 >> 0x10) & 0xffff);
tmp2 = ((*m1++ << 0x10) & 0xffff0000) | (*m2++ & 0xffff); tmp2 = ((*m1++ << 0x10) & 0xffff0000) | (*m2++ & 0xffff);
stmp1 = *(s32*)&tmp1; stmp1 = *(s32*) &tmp1;
stmp2 = *(s32*)&tmp2; stmp2 = *(s32*) &tmp2;
mf[r][c * 2 + 0] = stmp1 / 65536.0f; mf[r][c * 2 + 0] = stmp1 / 65536.0f;
mf[r][c * 2 + 1] = stmp2 / 65536.0f; mf[r][c * 2 + 1] = stmp2 / 65536.0f;
} }
@ -68,4 +68,4 @@ void guMtxIdent(Mtx* m) {
guMtxIdentF(mf); guMtxIdentF(mf);
guMtxF2L(mf, m); guMtxF2L(mf, m);
} }

View File

@ -247,7 +247,7 @@ void Graphics_ThreadEntry(void* arg0) {
// } // }
} }
void Graphics_ThreadUpdate(){ void Graphics_ThreadUpdate() {
if (GfxDebuggerIsDebugging()) { if (GfxDebuggerIsDebugging()) {
Graphics_PushFrame(gGfxPool->masterDL); Graphics_PushFrame(gGfxPool->masterDL);
@ -279,7 +279,7 @@ void Graphics_ThreadUpdate(){
osRecvMesg(&gGfxTaskMsgQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&gGfxTaskMsgQueue, NULL, OS_MESG_BLOCK);
Graphics_SetTask(); Graphics_SetTask();
if(GfxDebuggerIsDebuggingRequested()) { if (GfxDebuggerIsDebuggingRequested()) {
GfxDebuggerDebugDisplayList(gGfxPool->masterDL); GfxDebuggerDebugDisplayList(gGfxPool->masterDL);
} }
@ -289,7 +289,6 @@ void Graphics_ThreadUpdate(){
osViSwapBuffer(&gFrameBuffers[(gSysFrameCount - 1) % 3]); osViSwapBuffer(&gFrameBuffers[(gSysFrameCount - 1) % 3]);
} }
// LTODO: FAULT_CRASH // LTODO: FAULT_CRASH
// func_80007FE4(&gFrameBuffers[(gSysFrameCount - 1) % 3], SCREEN_WIDTH, 16); // func_80007FE4(&gFrameBuffers[(gSysFrameCount - 1) % 3], SCREEN_WIDTH, 16);
@ -450,7 +449,6 @@ void Main_ThreadEntry(void* arg0) {
// LTODO: Implement timers // LTODO: Implement timers
// Timer_ThreadEntry(NULL); // Timer_ThreadEntry(NULL);
// N64 Stuff should not be needed // N64 Stuff should not be needed
// Main_InitMesgQueues(); // Main_InitMesgQueues();
// while (true) { // while (true) {
@ -485,20 +483,22 @@ void Idle_ThreadEntry(void* arg0) {
// Main_SetVIMode(); // Main_SetVIMode();
// Lib_FillScreen(1); // Lib_FillScreen(1);
// osCreatePiManager(OS_PRIORITY_PIMGR, &gPiMgrCmdQueue, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff)); // osCreatePiManager(OS_PRIORITY_PIMGR, &gPiMgrCmdQueue, sPiMgrCmdBuff, ARRAY_COUNT(sPiMgrCmdBuff));
// osCreateThread(&gMainThread, THREAD_ID_MAIN, &Main_ThreadEntry, arg0, sMainThreadStack + sizeof(sMainThreadStack), // osCreateThread(&gMainThread, THREAD_ID_MAIN, &Main_ThreadEntry, arg0, sMainThreadStack +
// sizeof(sMainThreadStack),
// 100); // 100);
// osStartThread(&gMainThread); // osStartThread(&gMainThread);
// Fault_Init(); // Fault_Init();
// osSetThreadPri(NULL, OS_PRIORITY_IDLE); // osSetThreadPri(NULL, OS_PRIORITY_IDLE);
// loop_1: // loop_1:
// goto loop_1; // goto loop_1;
} }
void bootproc(void) { void bootproc(void) {
// RdRam_CheckIPL3(); // RdRam_CheckIPL3();
// osInitialize(); // osInitialize();
Main_Initialize(); Main_Initialize();
// osCreateThread(&sIdleThread, THREAD_ID_IDLE, &Idle_ThreadEntry, NULL, sIdleThreadStack + sizeof(sIdleThreadStack), // osCreateThread(&sIdleThread, THREAD_ID_IDLE, &Idle_ThreadEntry, NULL, sIdleThreadStack +
// sizeof(sIdleThreadStack),
// 255); // 255);
// osStartThread(&sIdleThread); // osStartThread(&sIdleThread);
} }

View File

@ -1,6 +1,6 @@
#include "sys.h" #include "sys.h"
#define qs1616(e) ((s32)((e)*0x00010000)) #define qs1616(e) ((s32) ((e) * 0x00010000))
#define IPART(x) ((qs1616(x) >> 16) & 0xFFFF) #define IPART(x) ((qs1616(x) >> 16) & 0xFFFF)
#define FPART(x) (qs1616(x) & 0xFFFF) #define FPART(x) (qs1616(x) & 0xFFFF)