Skip to content

Commit 48e8113

Browse files
committed
Final
1 parent c5221cd commit 48e8113

File tree

9 files changed

+109
-181
lines changed

9 files changed

+109
-181
lines changed

MarathonRecomp/api/Sonicteam/GE1PE/EffectBank.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace Sonicteam::GE1PE
3838
be<uint32_t> m_FieldC; //index ?
3939
xpointer<EffectBankData> m_pEffectBankA;
4040
};
41+
4142
MARATHON_ASSERT_OFFSETOF(EffectBank,m_pParticleEngine, 8);
4243
MARATHON_ASSERT_OFFSETOF(EffectBank,m_FieldC, 0xC);
4344
MARATHON_ASSERT_OFFSETOF(EffectBank, m_pEffectBankA, 0x10);

MarathonRecomp/api/Sonicteam/GE1PE/ParticleEngine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace Sonicteam::GE1PE
3131
SoX::LinkNode<Manager> m_lnManager;
3232
stdx::vector<void> m_vField6C;
3333
};
34+
3435
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_spPlugin, 4);
3536
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_mEffectIndicies, 0xC);
3637
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_mTextureIndicies, 0x18);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/RefCountObject.h>
5+
6+
namespace Sonicteam
7+
{
8+
class MainMenuExpositionTask : public SoX::RefCountObject, public SoX::Engine::Task
9+
{
10+
public:
11+
be<uint32_t> m_MSTAnimateState;
12+
};
13+
14+
MARATHON_ASSERT_OFFSETOF(MainMenuExpositionTask, m_MSTAnimateState, 0x54);
15+
}

MarathonRecomp/api/Sonicteam/MainMenuTask.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <Sonicteam/SoX/Math/Vector.h>
55
#include <Sonicteam/Player/Object.h>
66
#include <Sonicteam/ButtonWindowTask.h>
7+
#include <Sonicteam/MainMenuExpositionTask.h>
8+
#include <Sonicteam/SoX/RefSharedPointer.h>
79

810
namespace Sonicteam
911
{
@@ -39,7 +41,7 @@ namespace Sonicteam
3941
xpointer<HUDMainMenu> m_pHUDMainMenu;
4042
MARATHON_INSERT_PADDING(0x20);
4143
xpointer<ButtonWindowTask> m_pButtonWindowTask;
42-
MARATHON_INSERT_PADDING(4);
44+
SoX::RefSharedPointer<MainMenuExpositionTask> m_pMainMenuExpositionTask;
4345
be<uint32_t> m_MainMenuSelectedIndex;
4446
MARATHON_INSERT_PADDING(0x1D8);
4547
be<uint32_t> m_PressedButtons;
@@ -52,6 +54,7 @@ namespace Sonicteam
5254
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_State, 0x4C);
5355
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_pHUDMainMenu, 0x74);
5456
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_pButtonWindowTask, 0x98);
57+
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_pMainMenuExpositionTask, 0x9C);
5558
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_MainMenuSelectedIndex, 0xA0);
5659
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_PressedButtons, 0x27C);
5760
MARATHON_ASSERT_OFFSETOF(MainMenuTask, m_Field298, 0x298);

MarathonRecomp/api/Sonicteam/MainMode.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ namespace Sonicteam
1212
MARATHON_INSERT_PADDING(0x24);
1313
boost::shared_ptr<SoX::Scenery::Camera> m_spSelectCamera;
1414
xpointer<SoX::Graphics::FrameGP> m_pFrameGP;
15-
MARATHON_INSERT_PADDING(0x0C);
15+
MARATHON_INSERT_PADDING(0x4);
16+
xpointer<SoX::Engine::Task> m_pMainTask;
17+
MARATHON_INSERT_PADDING(0x4);
1618
};
1719

1820
MARATHON_ASSERT_OFFSETOF(MainMode, m_spSelectCamera, 0x74);
1921
MARATHON_ASSERT_OFFSETOF(MainMode, m_pFrameGP, 0x7C);
22+
MARATHON_ASSERT_OFFSETOF(MainMode, m_pMainTask, 0x84);
2023
MARATHON_ASSERT_SIZEOF(MainMode, 0x8C);
2124
}

MarathonRecomp/api/Sonicteam/SoX/Graphics/Surface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ namespace Sonicteam::SoX::Graphics
1616
be<uint32_t> m_Width;
1717
be<uint32_t> m_Height;
1818
MARATHON_INSERT_PADDING(4);
19-
xpointer<GuestSurface> m_pGuestSurface; //backbuffer. and any
19+
xpointer<GuestSurface> m_pSurface; //backbuffer. and any
2020
xpointer<Texture> m_spTexture; //RefSharedPointer but st didnt use seems their auto type for it (why they did this manually)
21-
xpointer<GuestTexture> m_pGuestTexture;
21+
xpointer<GuestTexture> m_pTexture;
2222
MARATHON_INSERT_PADDING(0xC);
2323
};
2424
}

MarathonRecomp/api/Sonicteam/SoX/MessageReceiver.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ namespace Sonicteam::SoX
2525
{
2626
return GuestToHostFunction<bool>(m_pVftable->fpProcessMessage, this, pMessage);
2727
}
28+
29+
/*
30+
template <typename T = IMessage>
31+
bool ProcessMessage(T& pMessage)
32+
{
33+
auto pIMessage = g_userHeap.AllocPhysical<T>();
34+
*pIMessage = pMessage;
35+
bool result = GuestToHostFunction<bool>(m_pVftable->fpProcessMessage, this, pIMessage);
36+
pMessage = *pIMessage;
37+
return result;
38+
}
39+
*/
2840
};
2941

3042
MARATHON_ASSERT_OFFSETOF(MessageReceiver, m_pVftable, 0x00);

MarathonRecomp/app.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PPC_FUNC(sub_8262A568)
6464
InitPatches();
6565
}
6666

67-
std::array<const char*, 46> _pause_ignore_task_ =
67+
std::array<const char*, 46> g_PauseModeTaskList =
6868
{
6969
"root",
7070
"TL_Debug",
@@ -174,19 +174,18 @@ void UpateSpecificTasksPause(Sonicteam::SoX::Engine::Task* ttask)
174174
{
175175
for (auto& task : *ttask)
176176
{
177-
std::string taskName = (&task)->GetName();
178-
printf("task %p - %s \n", &task, (&task)->GetName());
177+
const char* taskName = (&task)->GetName();
179178

180179
if ((task.m_Flag1 & 4) == 0)
181180
{
182181

183-
auto shouldIgnore = std::find_if(_pause_ignore_task_.begin(), _pause_ignore_task_.end(),
184-
[&taskName](const char* task)
182+
auto shouldIgnore = std::find_if(g_PauseModeTaskList.begin(), g_PauseModeTaskList.end(),
183+
[taskName](const char* task)
185184
{
186-
return strcmp(task ? task : "", taskName.c_str()) == 0;
185+
return strcmp(task ? task : "", taskName) == 0;
187186
});
188187

189-
if (shouldIgnore != _pause_ignore_task_.end())
188+
if (shouldIgnore != g_PauseModeTaskList.end())
190189
{
191190
(&task)->Update(0.0);
192191
}
@@ -236,12 +235,11 @@ PPC_FUNC(sub_825EA610)
236235
__imp__sub_825EA610(ctx, base);
237236

238237

239-
//Always These Tasks in pause mode
238+
//Always Do Specic Tasks during pause, to not
240239
if (pDocState->m_PauseFlags.get() != 0)
241240
{
242241

243242
GuestToHostFunction<void>(sub_825D49E0, &pDocState->m_CriticalSection1);
244-
printf("Traverse Main\n");
245243
UpateSpecificTasksPause(pDocState->m_pRootTask.get());
246244
GuestToHostFunction<void>(sub_82580920, &pDocState->m_CriticalSection1);
247245
}

0 commit comments

Comments
 (0)