From 6a27eb73567ca47630e2540ea8c1a5983f329686 Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Sat, 5 Apr 2025 14:17:27 +0200 Subject: [PATCH] Add more files --- CMakeLists.txt | 7 ++++ src/dolphin/mtx/mtx.c | 2 +- src/game/main.c | 38 +++++++++---------- src/game/printfunc.c | 9 ----- src/game/wipe.c | 2 + src/port/dvd.c | 5 +++ src/port/stubs.c | 86 +++++++++++++++++++++++++++++++++++++++++-- 7 files changed, 117 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48a3ecab..6b0ff80c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,12 +40,17 @@ set(DOLPHIN_FILES set(GAME_FILES src/game/card.c + src/game/ClusterExec.c + src/game/data.c + src/game/EnvelopeExec.c src/game/fault.c src/game/flag.c src/game/font.c src/game/frand.c src/game/hsfanim.c src/game/hsfdraw.c + src/game/hsfex.c + src/game/hsfload.c src/game/hsfman.c src/game/hsfmotion.c src/game/gamework.c @@ -53,12 +58,14 @@ set(GAME_FILES src/game/malloc.c src/game/memory.c src/game/init.c + src/game/ShapeExec.c src/game/sprman.c src/game/sprput.c src/game/pad.c src/game/perf.c src/game/printfunc.c src/game/process.c + src/game/wipe.c ) set(PORT_FILES diff --git a/src/dolphin/mtx/mtx.c b/src/dolphin/mtx/mtx.c index 0408ee6a..0d661294 100644 --- a/src/dolphin/mtx/mtx.c +++ b/src/dolphin/mtx/mtx.c @@ -1345,7 +1345,7 @@ void C_MTXMultVecSR(const Mtx mtx, const Vec* in, Vec* out) { float x = in->x; float y = in->y; float z = in->z; - + out->x = mtx[0][0] * x + mtx[0][1] * y + mtx[0][2] * z; out->y = mtx[1][0] * x + mtx[1][1] * y + mtx[1][2] * z; out->z = mtx[2][0] * x + mtx[2][1] * y + mtx[2][2] * z; diff --git a/src/game/main.c b/src/game/main.c index 039fcd55..47dbb915 100644 --- a/src/game/main.c +++ b/src/game/main.c @@ -113,13 +113,13 @@ void main(void) GWInit(); pfInit(); GlobalCounter = 0; - // HuSprInit(); - // Hu3DInit(); - // HuDataInit(); + HuSprInit(); + Hu3DInit(); + HuDataInit(); HuPerfInit(); - // HuPerfCreate("USR0", 0xFF, 0xFF, 0xFF, 0xFF); - // HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF); - // WipeInit(RenderMode); + HuPerfCreate("USR0", 0xFF, 0xFF, 0xFF, 0xFF); + HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF); + WipeInit(RenderMode); for (i = 0; i < 4; i++) { GWPlayerCfg[i].character = -1; @@ -147,17 +147,17 @@ void main(void) break; } #endif - /*retrace = VIGetRetraceCount(); + retrace = VIGetRetraceCount(); if (HuSoftResetButtonCheck() != 0 || HuDvdErrWait != 0) { continue; - }*/ + } HuPerfZero(); HuPerfBegin(2); #ifdef TARGET_PC aurora_begin_frame(); #endif - // HuSysBeforeRender(); + HuSysBeforeRender(); GXSetGPMetric(GX_PERF0_CLIP_VTX, GX_PERF1_VERTICES); GXClearGPMetric(); GXSetVCacheMetric(GX_VC_ALL); @@ -171,29 +171,29 @@ void main(void) pfClsScr(); HuPrcCall(1); - /* MGSeqMain(); - HuPerfBegin(1); - Hu3DExec(); - HuDvdErrorWatch(); - WipeExecAlways(); - HuPerfEnd(0); + MGSeqMain(); + HuPerfBegin(1); + Hu3DExec(); + HuDvdErrorWatch(); + WipeExecAlways(); + HuPerfEnd(0); - pfDrawFonts(); - HuPerfEnd(1);*/ + pfDrawFonts(); + HuPerfEnd(1); #ifdef TARGET_PC imgui_main(&auroraInfo); aurora_end_frame(); #endif - /*msmMusFdoutEnd(); + msmMusFdoutEnd(); HuSysDoneRender(retrace); GXReadGPMetric(&met0, &met1); GXReadVCacheMetric(&vcheck, &vmiss, &vstall); GXReadPixMetric(&top_pixels_in, &top_pixels_out, &bot_pixels_in, &bot_pixels_out, &clr_pixels_in, &total_copy_clks); GXReadMemMetric(&cp_req, &tc_req, &cpu_rd_req, &cpu_wr_req, &dsp_req, &io_req, &vi_req, &pe_req, &rf_req, &fi_req); HuPerfEnd(2); - GlobalCounter++;*/ + GlobalCounter++; #ifdef TARGET_PC frame_limiter(); diff --git a/src/game/printfunc.c b/src/game/printfunc.c index daeb0513..7211f4e5 100644 --- a/src/game/printfunc.c +++ b/src/game/printfunc.c @@ -176,13 +176,10 @@ void pfDrawFonts(void) GXSetNumTevStages(1); GXSetNumTexGens(0); GXBegin(GX_QUADS, GX_VTXFMT0, 4); -#ifdef __MWERKS__ - // TODO PC GXPosition2s16(x, y); GXPosition2s16(x + w, y); GXPosition2s16(x + w, y + h); GXPosition2s16(x, y + h); -#endif GXEnd(); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); @@ -236,8 +233,6 @@ void pfDrawFonts(void) default: texcoord_x = (c % 16) / 16.0f; texcoord_y = ((c / 16) / 16.0f) + (1 / 128.0f); -#ifdef __MWERKS__ - // TODO PC if (shadow_color < 0) { GXBegin(GX_QUADS, GX_VTXFMT0, 4); GXPosition3s16(x, y, 0); @@ -282,7 +277,6 @@ void pfDrawFonts(void) GXTexCoord2f32(texcoord_x, texcoord_y + (1 / 16.0f)); GXEnd(); } -#endif x += char_w; if (x > HU_FB_WIDTH) { x = 0; @@ -330,8 +324,6 @@ static void WireDraw(void) MTXIdentity(modelview); GXLoadPosMtxImm(modelview, GX_PNMTX0); GXBegin(GX_LINES, 0, 8); -#ifdef __MWERKS__ - // TODO PC GXPosition2f32(SAFETY_W, SAFETY_H); GXColor3u8(255, 0, 0); GXPosition2f32(SAFETY_W, HU_DISP_HEIGHT - SAFETY_H); @@ -348,6 +340,5 @@ static void WireDraw(void) GXColor3u8(255, 0, 0); GXPosition2f32(SAFETY_W, HU_DISP_HEIGHT - SAFETY_H); GXColor3u8(255, 0, 0); -#endif GXEnd(); } diff --git a/src/game/wipe.c b/src/game/wipe.c index aa7c1d9a..2445cc5c 100644 --- a/src/game/wipe.c +++ b/src/game/wipe.c @@ -111,9 +111,11 @@ void WipeExecAlways(void) void WipeCreate(s16 mode, s16 type, s16 duration) { WipeState *wipe; +#ifdef __MWERKS__ // TODO PC if(_CheckFlag(FLAG_ID_MAKE(1, 11)) && boardTutorialF) { return; } +#endif wipe = &wipeData; if(wipe->stat) { return; diff --git a/src/port/dvd.c b/src/port/dvd.c index 9cef74d4..f1b67228 100644 --- a/src/port/dvd.c +++ b/src/port/dvd.c @@ -160,3 +160,8 @@ s32 DVDGetDriveStatus(void) // puts("DVDGetDriveStatus is a stub"); return 0; } + +void HuDvdErrorWatch(void) +{ + +} diff --git a/src/port/stubs.c b/src/port/stubs.c index a76721a5..fb01acc1 100644 --- a/src/port/stubs.c +++ b/src/port/stubs.c @@ -531,7 +531,7 @@ void GXSetGPMetric(GXPerf0 perf0, GXPerf1 perf1) puts("GXSetGPMetric is a stub"); } -void GXReadGPMetric(u32* cnt0, u32* cnt1) +void GXReadGPMetric(u32 *cnt0, u32 *cnt1) { puts("GXReadGPMetric is a stub"); } @@ -557,7 +557,7 @@ void GXClearVCacheMetric(void) puts("GXClearVCacheMetric is a stub"); } -void GXReadPixMetric(u32* top_pixels_in, u32* top_pixels_out, u32* bot_pixels_in, u32* bot_pixels_out, u32* clr_pixels_in, u32* copy_clks) +void GXReadPixMetric(u32 *top_pixels_in, u32 *top_pixels_out, u32 *bot_pixels_in, u32 *bot_pixels_out, u32 *clr_pixels_in, u32 *copy_clks) { puts("GXReadPixMetric is a stub"); } @@ -572,7 +572,7 @@ void GXSetVCacheMetric(GXVCachePerf attr) puts("GXSetVCacheMetric is a stub"); } -void GXReadVCacheMetric(u32* check, u32* miss, u32* stall) +void GXReadVCacheMetric(u32 *check, u32 *miss, u32 *stall) { puts("GXReadVCacheMetric is a stub"); } @@ -600,6 +600,71 @@ void GXColor3u8(u8 r, u8 g, u8 b) GXColor4u8(r, g, b, 255); } +void GXNormal1x16(u16 index) +{ + puts("GXNormal1x16 is a stub"); +} + +void GXColor1x16(u16 index) +{ + puts("GXColor1x16 is a stub"); +} + +void GXTexCoord1x16(u16 index) +{ + puts("GXTexCoord1x16 is a stub"); +} + +void GXUnknownu16(const u16 x) +{ + puts("GXUnknownu16 is a stub"); +} + +void GXNormal3s16(s16 x, s16 y, s16 z) +{ + puts("GXNormal3s16 is a stub"); +} + +void GXPosition2u16(const u16 x, const u16 y) +{ + puts("GXPosition2u16 is a stub"); +} + +void GXPosition2f32(const f32 x, const f32 y) +{ + puts("GXPosition2f32 is a stub"); +} + +void GXPosition2s16(const s16 x, const s16 y) +{ + puts("GXPosition2s16 is a stub"); +} + +void GXColor1x8(u8 index) { + puts("GXColor1x8 is a stub"); +} + +void GXWaitDrawDone(void) +{ + puts("GXWaitDrawDone is a stub"); +} + +void GXSetTevIndTile(GXTevStageID tev_stage, GXIndTexStageID ind_stage, u16 tilesize_s, u16 tilesize_t, u16 tilespacing_s, u16 tilespacing_t, + GXIndTexFormat format, GXIndTexMtxID matrix_sel, GXIndTexBiasSel bias_sel, GXIndTexAlphaSel alpha_sel) +{ + puts("GXSetTevIndTile is a stub"); +} + +void GXSetTexCoordScaleManually(GXTexCoordID coord, u8 enable, u16 ss, u16 ts) +{ + puts("GXSetTexCoordScaleManually is a stub"); +} + +void GXResetWriteGatherPipe(void) +{ + puts("GXResetWriteGatherPipe is a stub"); +} + // Hudson void HuDvdErrDispInit(GXRenderModeObj *rmode, void *xfb1, void *xfb2) { } @@ -611,3 +676,18 @@ void msmSysRegularProc(void) { puts("msmSysRegularProc is a stub"); } + +void msmMusFdoutEnd(void) +{ + puts("msmMusFdoutEnd is a stub"); +} + +s32 HuSoftResetButtonCheck(void) +{ + puts("HuSoftResetButtonCheck is a stub"); +} + +void MGSeqMain(void) +{ + puts("MGSeqMain is a stub"); +}