Skip to content
Draft
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
1 change: 1 addition & 0 deletions MarathonRecomp/api/Marathon.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "Sonicteam/SoX/Engine/Doc.h"
#include "Sonicteam/SoX/Engine/DocMode.h"
#include "Sonicteam/SoX/Engine/Task.h"
#include "Sonicteam/SoX/Math/Vector.h"
#include "Sonicteam/SoX/MessageReceiver.h"
#include "Sonicteam/SoX/Object.h"
#include "Sonicteam/TitleTask.h"
Expand Down
31 changes: 31 additions & 0 deletions MarathonRecomp/api/Sonicteam/SoX/Math/Vector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include "Marathon.inl"

namespace Sonicteam::SoX::Math
{
class Vector2
{
public:
be<float> X;
be<float> Y;
};

class Vector
{
public:
be<float> X;
be<float> Y;
be<float> Z;
be<float> W;
};

class Vector4
{
public:
be<float> X;
be<float> Y;
be<float> Z;
be<float> W;
};
}
22 changes: 22 additions & 0 deletions MarathonRecomp/patches/misc_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,25 @@ bool DisableHints()
{
return !Config::Hints;
}

// Change Y position in Shadow Sonicteam::Player::Object to move it closer to the glider's Y position
PPC_FUNC_IMPL(__imp__sub_8219FAE0);
PPC_FUNC(sub_8219FAE0)
{
struct OBJPlayerSpawnData
{
public:
xpointer<const char> PlayerName;
MARATHON_INSERT_PADDING(0x2C);
Sonicteam::SoX::Math::Vector4 PlayerPosition;
MARATHON_INSERT_PADDING(0xC);
};

auto pSpawnData = reinterpret_cast<OBJPlayerSpawnData*>(base + ctx.r4.u32);
if (strcmp("shadow_glider.lua", pSpawnData->PlayerName.get()) == 0 && pSpawnData->PlayerPosition.Y.get() == 5626.4f)
{
pSpawnData->PlayerPosition.Y = 5608;
}

__imp__sub_8219FAE0(ctx, base);
}
Loading