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
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ jobs:
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Determine which .cpp files changed (PR: vs base branch; push: vs prev commit)
- name: Changed .cpp files
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
base="${{ github.event.pull_request.base.sha }}"
else
base="${{ github.event.before }}"
fi
if [ -z "$base" ] \
|| [ "$base" = "0000000000000000000000000000000000000000" ] \
|| ! git rev-parse -q --verify "$base^{commit}" >/dev/null 2>&1; then
base="$(git rev-parse -q --verify HEAD~1 || true)"
fi
if [ -n "$base" ]; then
git diff --name-only --diff-filter=d "$base" HEAD -- '*.cpp' \
> changed_cpp.txt
else
: > changed_cpp.txt
fi
echo "Changed .cpp files:"; cat changed_cpp.txt

# Normalize file mod times
- name: Restore timestamps
run: |
Expand Down Expand Up @@ -67,3 +88,22 @@ jobs:
with:
name: ${{ matrix.version }}_report
path: build/${{ matrix.version }}/report.json

# Validate map symbol presence/order/linkage for each changed .cpp
- name: Validate symbol order
run: |
if [ ! -s changed_cpp.txt ]; then
echo "No changed .cpp files; nothing to validate."
exit 0
fi
NM="$(command -v powerpc-eabi-nm || true)"
if [ -z "$NM" ]; then
NM="$(find /binutils -name powerpc-eabi-nm -type f 2>/dev/null | head -1)"
fi
if [ -z "$NM" ] || [ ! -x "$NM" ]; then
echo "::error:: powerpc-eabi-nm not found; cannot run symbol-order check."
exit 1
fi
export NM
echo "Using nm: $NM"
python tools/check-changed-symbol-order.py $(cat changed_cpp.txt)
48 changes: 24 additions & 24 deletions src/Enemy/riccohook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
#include <JSystem/JMath.hpp>
#include <M3DUtil/InfectiousStrings.hpp>

// @non-matching -- the issue seems to stem from the JDrama TNameRefGen
// search/push_back calls.
THookTake::THookTake(TRiccoHook* owner, const char* name)
: TTakeActor(name)
, mOwner(owner)
{
initHitActor(0x400000BB, 1, -0x80000000,
mOwner->getSaveLoadParam()->mSLHitRadius.get(),
mOwner->getSaveLoadParam()->mSLHitHeight.get(),
mOwner->getSaveLoadParam()->mSLHitRadius.get(),
mOwner->getSaveLoadParam()->mSLHitHeight.get());

JDrama::TNameRefGen::search<TIdxGroupObj>("オブジェクトグループ")
->getChildren()
.push_back(this);
}

MtxPtr THookTake::getTakingMtx() { return nullptr; }

f32 THookTake::getRadiusAtY(f32 y) const
Expand Down Expand Up @@ -42,21 +59,14 @@ void THookTake::perform(u32 cue, JDrama::TGraphics* graphics)
}
}

// @non-matching -- the issue seems to stem from the JDrama TNameRefGen
// search/push_back calls.
THookTake::THookTake(TRiccoHook* owner, const char* name)
: TTakeActor(name)
, mOwner(owner)
THookParams::THookParams(const char* path)
: TSpineEnemyParams(path)
, PARAM_INIT(mSLHitHeight, 900.0f)
, PARAM_INIT(mSLHitRadius, 120.0f)
, PARAM_INIT(mSLHangRadius, 30.0f)
, PARAM_INIT(mSLMoveSpeed, 4.0f)
{
initHitActor(0x400000BB, 1, -0x80000000,
mOwner->getSaveLoadParam()->mSLHitRadius.get(),
mOwner->getSaveLoadParam()->mSLHitHeight.get(),
mOwner->getSaveLoadParam()->mSLHitRadius.get(),
mOwner->getSaveLoadParam()->mSLHitHeight.get());

JDrama::TNameRefGen::search<TIdxGroupObj>("オブジェクトグループ")
->getChildren()
.push_back(this);
TParams::load(mPrmPath);
}

TRiccoHook::TRiccoHook(const char* name)
Expand Down Expand Up @@ -96,16 +106,6 @@ void TRiccoHook::perform(u32 cue, JDrama::TGraphics* graphics)
}
}

THookParams::THookParams(const char* path)
: TSpineEnemyParams(path)
, PARAM_INIT(mSLHitHeight, 900.0f)
, PARAM_INIT(mSLHitRadius, 120.0f)
, PARAM_INIT(mSLHangRadius, 30.0f)
, PARAM_INIT(mSLMoveSpeed, 4.0f)
{
TParams::load(mPrmPath);
}

TRiccoHookManager::TRiccoHookManager(const char* name)
: TEnemyManager(name)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Enemy/spline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ TSplinePath::TSplinePath(int param_1)
mXs[i] = mYs[i] = mZs[i] = i;
}

// BUG: UNUSED symbol size tells us they even forgot to delete the arrays -_-
TSplinePath::~TSplinePath() { }

void TSplinePath::makeTable(f32* parametrization, f32* coords, f32* param_3)
{
param_3[0] = 0.0f;
Expand Down
48 changes: 24 additions & 24 deletions src/MSound/MSModBgm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ JAISound* MSModBgm::modBgm(u8 param_1, u8 param_2)
return sound;
}

void MSModBgm::loop()
{
switch (unk0) {
case true:
unk4 += 1;
break;

case false:
default:
unk4 = 0;
return;
}
unk0 = 0;
}

void MSModBgm::changeTempo(u8 param_1, u8 param_2)
{
JAISound* sound = MSBgm::getHandle(param_2);
Expand Down Expand Up @@ -77,21 +92,6 @@ void MSModBgm::changeTempo(u8 param_1, u8 param_2)
}
}

void MSModBgm::loop()
{
switch (unk0) {
case true:
unk4 += 1;
break;

case false:
default:
unk4 = 0;
return;
}
unk0 = 0;
}

f32 MSBgmXFade::scTiming[18] = {
0.052632f, 0.105263f, 0.157895f, 0.210526f, 0.26315799f, 0.315789f,
0.36842099f, 0.42105299f, 0.473684f, 0.52631599f, 0.578947f, 0.63157898f,
Expand Down Expand Up @@ -126,15 +126,6 @@ void MSBgmXFade::xFadeBgmForce(f32 param_1)
}
}

u8 MSBgmXFade::getTimingForce(f32 param_1)
{
for (u8 i = 0; i < 17; ++i)
if (param_1 >= scTiming[i] && param_1 < scTiming[i + 1])
return i;

return 0xff;
}

u8 MSBgmXFade::getTiming(f32 param_1, u32* param_2)
{
f32 f1 = unk0;
Expand All @@ -147,3 +138,12 @@ u8 MSBgmXFade::getTiming(f32 param_1, u32* param_2)

return 0xff;
}

u8 MSBgmXFade::getTimingForce(f32 param_1)
{
for (u8 i = 0; i < 17; ++i)
if (param_1 >= scTiming[i] && param_1 < scTiming[i + 1])
return i;

return 0xff;
}
5 changes: 3 additions & 2 deletions src/MSound/MSoundDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

static void dummy() { JADPrm<u8> prm(0, ""); }

MSD* MSD::get() { return 0; }

MSPrintBase::MSPrintBase() { }

MSPrintBase::MSPrintBase(u8 param1, u8 param2, u8 param3, u8 param4, u8 param5)
Expand All @@ -25,3 +23,6 @@ void MSPrintEntry::print() { }
MSPrint::MSPrint() { }

void MSPrint::print() { }

// UNUSED
MSD* MSD::get() { return 0; }
4 changes: 2 additions & 2 deletions src/MSound/MSoundScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void MSSceneSE::sortMaxTrans(Vec* param_1, u8 param_2, u8 param_3)
}
}

void MSSceneSE::calcPosPanSR(Vec* param_1, f32 param_2) { }
void MSSceneSE::calcPosVolume(Vec* param_1, f32* param_2, u8 param_3) { }

void MSSceneSE::calcPosPanLR(Vec* param_1, f32 param_2) { }

void MSSceneSE::calcPosVolume(Vec* param_1, f32* param_2, u8 param_3) { }
void MSSceneSE::calcPosPanSR(Vec* param_1, f32 param_2) { }
2 changes: 1 addition & 1 deletion src/MarioUtil/GDUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

static TGDLStatic* currentTGDLStatic;

void TGDLStaticOverFlow() { currentTGDLStatic->unk11 = 1; }
static void TGDLStaticOverFlow() { currentTGDLStatic->unk11 = 1; }

TGDLStatic::TGDLSentinel::~TGDLSentinel()
{
Expand Down
21 changes: 11 additions & 10 deletions src/MarioUtil/RumbleType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ struct RumbleTypeInfo _info[23] = {

const char* invalidStr = "Invalid RumbleType";

int RumbleType::getIndex(char* strIn)
{
for (int i = 0; i < channelNum; i++) {
if (!strcmp(strIn, _info[i].str)) {
return _info[i].unk0;
}
}
return -1;
}

// UNUSED
// Size needed: 0x54, current: 0x34
const char* RumbleType::getName(int index)
{
Expand All @@ -58,3 +49,13 @@ const char* RumbleType::getName(int index)

return _info[index].str;
}

int RumbleType::getIndex(char* strIn)
{
for (int i = 0; i < channelNum; i++) {
if (!strcmp(strIn, _info[i].str)) {
return _info[i].unk0;
}
}
return -1;
}
15 changes: 8 additions & 7 deletions src/Player/MarioCap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ void TMarioCap::createMirrorCap()
}
}

// UNUSED
void TMarioCap::addDirty() { }

void TMarioCap::perform(unsigned long param_1, JDrama::TGraphics* param_2)
{
// Unused stack space
Expand Down Expand Up @@ -227,16 +230,14 @@ void TMarioCap::perform(unsigned long param_1, JDrama::TGraphics* param_2)
}
}

void TMarioCap::mtxEffectHide()
{
unk20->flagOff(0x1);
unk24->flagOff(0x1);
}

void TMarioCap::mtxEffectShow()
{
unk20->flagOn(0x1);
unk24->flagOn(0x1);
}

void TMarioCap::addDirty() { }
void TMarioCap::mtxEffectHide()
{
unk20->flagOff(0x1);
unk24->flagOff(0x1);
}
3 changes: 3 additions & 0 deletions src/System/ProcessMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ TProcessMeter::TProcessMeter(s32 r4)
_01C = 0;
_01E = 0;
}

// UNUSED
void TProcessMeter::draw(const JUTRect&) { }
6 changes: 6 additions & 0 deletions src/System/Resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ u16 SMSGetGameVideoHeight()
return ret;
}

// UNUSED
s32 SMSGetDisplayWidthMax() { return 720; }

// UNUSED
s32 SMSGetDisplayHeightMax() { return 574; }

u16 SMSGetTitleVideoWidth() { return 660; }

u16 SMSGetTitleVideoHeight() { return SMSGetGameVideoHeight(); }
Expand Down
3 changes: 3 additions & 0 deletions src/System/StageUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ static u8 exShineTable[] = {

// clang-format on

// UNUSED
bool SMS_isExMap(u8 stage) { return stage > 0x14 && stage < 0x35; }

bool SMS_isExMap()
{
return (gpApplication.mCurrArea.unk0 > 0x14
Expand Down
Loading
Loading