Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"${workspaceFolder}/include/inline",
"${workspaceFolder}/src/dolphin/include",
"${workspaceFolder}/src/dolphin/src",
"${workspaceFolder}/src/bink/include",
"${workspaceFolder}/src/bink/src",
"${workspaceFolder}/include/rwsdk",
"${workspaceFolder}/src/SB/Core/gc",
"${workspaceFolder}/src/SB/Core/x",
Expand Down
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,18 @@
"gxget.h": "c",
"gxverify.h": "c",
"card.h": "c",
"__start.h": "c"
"__start.h": "c",
"binkread.h": "c",
"ngcrad3d.h": "c",
"osalarm.h": "c",
"ostime.h": "c",
"bink.h": "c",
"binkngc.h": "c",
"radbase.h": "c",
"oscontext.h": "c",
"radcb.h": "c",
"popmal.h": "c",
"osalloc.h": "c"
},
// Disable C/C++ IntelliSense, use clangd instead
"C_Cpp.intelliSenseEngine": "default",
Expand Down
9 changes: 5 additions & 4 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@
"-i src/PowerPC_EABI_Support/include",
"-i src/dolphin/include",
"-i src/dolphin/src",
"-i src/bink/include",
"-i src/bink/src",
"-i src",
f"-i build/{config.version}/include",
f"-DBUILD_VERSION={version_num}",
Expand Down Expand Up @@ -272,7 +274,7 @@

# Bink was compiled with ProDG
cflags_bink = [
"-O3",
"-O2",
"-mcpu=750",
"-fno-exceptions",
"-Wno-inline",
Expand Down Expand Up @@ -317,7 +319,6 @@
'-pragma "cpp_extensions on"',
"-inline off",
"-gccinc",
"-i include/bink",
"-i include/inline",
"-i include/rwsdk",
"-i src/SB/Core/gc",
Expand Down Expand Up @@ -440,9 +441,9 @@ def MatchingFor(*versions):
Object(NonMatching, "SB/Core/x/xMath3.cpp"),
Object(NonMatching, "SB/Core/x/xMemMgr.cpp"),
Object(NonMatching, "SB/Core/x/xModel.cpp"),
Object(NonMatching, "SB/Core/x/xMorph.cpp"),
Object(Matching, "SB/Core/x/xMorph.cpp"),
Object(Equivalent, "SB/Core/x/xMovePoint.cpp"),
Object(NonMatching, "SB/Core/x/xordarray.cpp"),
Object(Matching, "SB/Core/x/xordarray.cpp"),
Object(NonMatching, "SB/Core/x/xPad.cpp"),
Object(NonMatching, "SB/Core/x/xPar.cpp"),
Object(NonMatching, "SB/Core/x/xParCmd.cpp"),
Expand Down
82 changes: 0 additions & 82 deletions include/bink/bink.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ typedef wchar_t wint_t;

#define UINT32_MAX 0xffffffff

#endif // !TYPES_H
#endif // !TYPES_H
23 changes: 11 additions & 12 deletions src/SB/Core/gc/iFMV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

#include "zGlobals.h"

#include <types.h>
#include <dolphin.h>
// #include <dolphin.h>

// FIXME: These should be in a RW header somewhere
extern GXRenderModeObj* _RwDlRenderMode;
Expand Down Expand Up @@ -97,7 +96,7 @@ void Decompress_frame(HBINK bnk, HRAD3DIMAGE rad_image, long flags)
mask = mask >> 0x1f;
mask = mask & 0x80000000;
mask |= Bink_surface_type[result.unk_8];
result.unk_0 = BinkCopyToBuffer(bnk, pixels, result.unk_c, bnk->unk_4, NULL, NULL, mask);
result.unk_0 = BinkCopyToBuffer(bnk, pixels, result.unk_c, bnk->Height, NULL, NULL, mask);
Unlock_RAD_3D_image(rad_image);
}
}
Expand Down Expand Up @@ -168,8 +167,8 @@ static void Show_frame()
RwCameraClear(cam, &color, rwCAMERACLEARIMAGE);

RwCameraBeginUpdate(cam);
Width_scale = 640 / Bink->unk_0;
Height_scale = 480 / Bink->unk_4;
Width_scale = 640 / Bink->Width;
Height_scale = 480 / Bink->Height;
xDrawLine2D_LocaliFMVVersion(0.0f, 0.0f, 0.0f, 0.0f);
DrawFrame(0.0f, 0.0f, Width_scale, Height_scale);
RwCameraEndUpdate(cam);
Expand All @@ -190,7 +189,7 @@ static void aramfree(void* mem)
ARFree(&vol);
}

static void PlayFMV(char* fname, u32 buttons, F32 time)
static void PlayFMV(char* fname, size_t buttons, F32 time)
{
GXCullMode cull_mode;
GXGetCullMode(&cull_mode);
Expand Down Expand Up @@ -242,9 +241,9 @@ static void PlayFMV(char* fname, u32 buttons, F32 time)

if (Bink != NULL)
{
if (Bink->unk_f0 != 0)
if (Bink->Width != 0)
{
for (ip = 0; ip <= Bink->unk_f0; ++ip)
for (ip = 0; ip <= Bink->Width; ++ip)
{
vol = gSnd.categoryVolFader[SND_CAT_CUTSCENE];
vol = vol * vol;
Expand All @@ -253,7 +252,7 @@ static void PlayFMV(char* fname, u32 buttons, F32 time)
}
}

Image = Open_RAD_3D_image(NULL, Bink->unk_0, Bink->unk_4, fuckingSurfaceType);
Image = Open_RAD_3D_image(NULL, Bink->Width, Bink->Height, fuckingSurfaceType);
if (Image != NULL)
{
if (frame_num != 0)
Expand All @@ -280,19 +279,19 @@ static void PlayFMV(char* fname, u32 buttons, F32 time)
}
xPadUpdate(globals.currentActivePad, 0.0f);

F32 t = (float)Bink->unk_c / (Bink->unk_14 / Bink->unk_18);
F32 t = (float)Bink->FrameNum / (Bink->FrameRate / Bink->FrameRateDiv);
if (buttons && t >= time && globals.pad0->pressed & buttons)
{
frame_num = -1;
goto superbreak;
}
} while (Bink->unk_c < Bink->unk_8 - 1);
} while (Bink->FrameNum < Bink->Frames - 1);
frame_num = -1;
}
superbreak:
if (frame_num != -1)
{
frame_num = Bink->unk_c;
frame_num = Bink->FrameNum;
}
Close_RAD_3D_image(Image);
Image = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/SB/Core/gc/iFMV.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <types.h>
#include <bink.h>
#include <rad3d.h>
#include <PowerPC_EABI_Support\MSL_C\MSL_Common\size_t.h>

#ifdef __cplusplus
Expand Down
21 changes: 19 additions & 2 deletions src/SB/Core/gc/ngcrad3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <dolphin/gx.h>
#include "iFMV.h"
#include <bink/include/rad3d.h>

static int D3D_surface_type[5];
static unsigned int Pixel_info[5];
Expand Down Expand Up @@ -30,6 +31,22 @@ static void Setup_surface_array()
Built_tables = 1;
}

// TODO:
// Defining this struct locally because i believe this isnt 100% right. Or if it is right why isnt this in the bink.h or other headers?
// inestigate this

struct RAD3DIMAGE
{
int a;
int b;
unsigned int c;
int d;
int e;
void* f;
int g;
int h;
};

void Close_RAD_3D_image(struct RAD3DIMAGE* image)
{
if (image != 0)
Expand All @@ -43,8 +60,8 @@ void Close_RAD_3D_image(struct RAD3DIMAGE* image)
}
}

int Lock_RAD_3D_image(HRAD3DIMAGE rad_image, void* out_pixel_buffer, unsigned int* out_buffer_pitch,
unsigned int* arg3)
S32 Lock_RAD_3D_image(HRAD3DIMAGE rad_image, void* out_pixel_buffer, U32* out_buffer_pitch,
U32* arg3)
{
if (rad_image == 0)
{
Expand Down
8 changes: 4 additions & 4 deletions src/SB/Core/x/xFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,10 @@ void xFXStreakUpdate(U32 id, const xVec3* a, const xVec3* b)
xFXStreak* s;
}

U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 textureID, const iColor_tag* edge_a, const iColor_tag* edge_b, S32 taper)
U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 textureID,
const iColor_tag* edge_a, const iColor_tag* edge_b, S32 taper)
{
for (U32 i = 0; i < 10; i++)
for (U32 i = 0; i < 10; i++)
{
if (sStreakList[i].flags == 0x0)
{
Expand Down Expand Up @@ -742,7 +743,7 @@ U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 texture
textureID = xStrHash("fx_streak1");
}

sStreakList[i].texturePtr = (RwTexture*) xSTFindAsset(textureID, NULL);
sStreakList[i].texturePtr = (RwTexture*)xSTFindAsset(textureID, NULL);
if (sStreakList[i].texturePtr != NULL)
{
sStreakList[i].textureRasterPtr = RwTextureGetRaster(sStreakList[i].texturePtr);
Expand All @@ -751,7 +752,6 @@ U32 xFXStreakStart(F32 frequency, F32 alphaFadeRate, F32 alphaStart, U32 texture
{
return 0;
}

}
}

Expand Down
Loading