Skip to content

Commit c7e6c23

Browse files
author
ReimousTH
committed
MyPE & Particles & Spanverse API
More Api Manual Lua Reset
1 parent 900a838 commit c7e6c23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1887
-16
lines changed

MarathonRecomp/api/Marathon.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "Sonicteam/GameImp.h"
4242
#include "Sonicteam/GameMode.h"
4343
#include "Sonicteam/Globals.h"
44+
#include "Sonicteam/MyPE/CManageParticle.h"
4445
#include "Sonicteam/HUDButtonWindow.h"
4546
#include "Sonicteam/HUDCALLBACK.h"
4647
#include "Sonicteam/HUDLimitTime.h"
@@ -86,6 +87,7 @@
8687
#include "Sonicteam/ObjectVehicle.h"
8788
#include "Sonicteam/ObjectVehicleBike.h"
8889
#include "Sonicteam/Particles/Particle.h"
90+
#include "Sonicteam/Particles/ParticleManager.h"
8991
#include "Sonicteam/Particles/ParticleRef.h"
9092
#include "Sonicteam/PauseAdapter.h"
9193
#include "Sonicteam/PauseTask.h"
@@ -157,6 +159,7 @@
157159
#include "Sonicteam/SoX/Engine/Doc.h"
158160
#include "Sonicteam/SoX/Engine/DocMode.h"
159161
#include "Sonicteam/SoX/Engine/Task.h"
162+
#include "Sonicteam/SoX/Engine/RenderProcess.h"
160163
#include "Sonicteam/SoX/Graphics/Device.h"
161164
#include "Sonicteam/SoX/Graphics/Frame.h"
162165
#include "Sonicteam/SoX/Graphics/FrameGP.h"
@@ -212,6 +215,7 @@
212215
#include "Sonicteam/TextBookMgr.h"
213216
#include "Sonicteam/TextCard.h"
214217
#include "Sonicteam/TextEntity.h"
218+
#include "Sonicteam/LuaSystem.h"
215219
#include "Sonicteam/TextFontPicture.h"
216220
#include "Sonicteam/TextFontPictureMgr.h"
217221
#include "Sonicteam/TitleTask.h"
@@ -244,3 +248,4 @@
244248
#include "stdx/string.h"
245249
#include "stdx/vector.h"
246250
#include "stdx/wstring.h"
251+

MarathonRecomp/api/Sonicteam/DocMarathonImp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
#include <Sonicteam/SoX/Engine/Doc.h>
66
#include <Sonicteam/SoX/Input/Manager.h>
77
#include <Sonicteam/MyGraphicsDevice.h>
8+
#include <Sonicteam/SFXAgent.h>
89
#include <Sonicteam/RaderMapManager.h>
910
#include <Sonicteam/RenderTargetContainer.h>
11+
#include <Sonicteam/Particles/ParticleManager.h>
1012
#include <stdx/vector.h>
1113

1214
namespace Sonicteam
@@ -22,7 +24,10 @@ namespace Sonicteam
2224
bool m_VFrame;
2325
MARATHON_INSERT_PADDING(4);
2426
xpointer<RenderTargetContainer> m_pRenderTargetContainer;
25-
MARATHON_INSERT_PADDING(0x187C);
27+
xpointer<SFXAgent> m_pSFXAgent;
28+
MARATHON_INSERT_PADDING(0x2A4);
29+
xpointer<Particles::ParticleManager> m_pParticleManager;
30+
MARATHON_INSERT_PADDING(0x15D0);
2631
xpointer<RaderMapManager> m_pRaderMapManager;
2732
MARATHON_INSERT_PADDING(0x542D0);
2833
be<uint32_t> m_PlayerControllerID[4];
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/GE1PE/RefCountObject.h>
5+
#include <stdx/map.h>
6+
#include <stdx/string.h>
7+
8+
namespace Sonicteam::GE1PE
9+
{
10+
//.peb
11+
12+
class ParticleEngine;
13+
14+
//no name left for type
15+
class EffectBankData
16+
{
17+
public:
18+
be<uint32_t> m_Field0; // 0x3E - no idea
19+
stdx::string m_DataName; // player_sonic
20+
//from .peb (raw converted since they released after)
21+
xpointer<void> m_Data1;
22+
xpointer<void> m_Data2;
23+
xpointer<void> m_Data3;
24+
stdx::map<stdx::string, be<uint32_t>> m_EffectDataIndices; //barrier_g = 0x23
25+
};
26+
MARATHON_ASSERT_OFFSETOF(EffectBankData, m_EffectDataIndices, 0x2C);
27+
MARATHON_ASSERT_SIZEOF(EffectBankData, 0x38);
28+
29+
class EffectBank : public RefCountObject
30+
{
31+
public:
32+
xpointer<ParticleEngine> m_pParticleEngine;
33+
be<uint32_t> m_FieldC; //index ?
34+
xpointer<EffectBankData> m_pEffectBankA;
35+
};
36+
MARATHON_ASSERT_SIZEOF(EffectBank, 0x14);
37+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
namespace Sonicteam::GE1PE
6+
{
7+
class EmitterListener
8+
{
9+
xpointer<void> m_pVftable;
10+
};
11+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/LinkNode.h>
5+
6+
namespace Sonicteam::GE1PE
7+
{
8+
class ParticleEngine;
9+
class Particle;
10+
class Emitter;
11+
class Effect;
12+
13+
class Manager
14+
{
15+
public:
16+
struct Vftable
17+
{
18+
be<uint32_t> fpDestroy;
19+
};
20+
21+
xpointer<Vftable> m_pVftable;
22+
xpointer<ParticleEngine> m_pParticleEngine;
23+
SoX::LinkNode<Manager> m_lnManager;
24+
SoX::LinkNode<void> m_lnField14;
25+
SoX::LinkNode<Particle> m_lnParticle;
26+
SoX::LinkNode<void> m_lnField2C;
27+
SoX::LinkNode<void> m_lnField38;
28+
SoX::LinkNode<Emitter> m_lnEmitter;
29+
SoX::LinkNode<Effect> m_lnEffect;
30+
SoX::LinkNode<Effect> m_lnField5C;
31+
MARATHON_INSERT_PADDING(0x24);
32+
};
33+
MARATHON_ASSERT_OFFSETOF(Manager, m_pParticleEngine, 4);
34+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnManager, 8);
35+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField14, 0x14);
36+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnParticle, 0x20);
37+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField2C, 0x2C);
38+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField38, 0x38);
39+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnEmitter, 0x44);
40+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnEffect, 0x50);
41+
MARATHON_ASSERT_OFFSETOF(Manager, m_lnField5C, 0x5C);
42+
//size == 0x34 (but PE::MyPlugin no idea about this)
43+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/System/Singleton.h>
5+
#include <Sonicteam/System/CreateStatic.h>
6+
#include <Sonicteam/GE1PE/Plugin.h>
7+
#include <boost/smart_ptr/shared_ptr.h>
8+
#include <stdx/map.h>
9+
#include <stdx/string.h>
10+
#include <stdx/vector.h>
11+
#include <Sonicteam/SoX/LinkNode.h>
12+
13+
namespace Sonicteam::GE1PE
14+
{
15+
class EffectBank;
16+
class TextureBank;
17+
class Material;
18+
class Manager;
19+
20+
class ParticleEngine : public System::Singleton<ParticleEngine,0x82D3C4F4, System::CreateStatic<ParticleEngine,0x82642090>>
21+
{
22+
public:
23+
xpointer<void> m_pVftable;
24+
boost::shared_ptr<Plugin> m_spPlugin;
25+
stdx::map<stdx::string, be<uint32_t>> m_mEffectIndicies; // ev001 = index
26+
stdx::map<stdx::string, be<uint32_t>> m_mTextureIndicies; //vehicle_jet_grid = 0x9F;
27+
stdx::map<stdx::string, be<uint32_t>> m_MaterialIndicies; //addBN = 3; MeshTestShader ...
28+
stdx::vector<xpointer<EffectBank>> m_vpEffectBank;
29+
stdx::vector<xpointer<TextureBank>> m_vpTextureBank;
30+
stdx::vector<xpointer<TextureBank>> m_vpMaterialBank;
31+
SoX::LinkNode<Manager> m_lnManager;
32+
stdx::vector<void> m_vField6C;
33+
};
34+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpEffectBank, 0x30);
35+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpTextureBank, 0x40);
36+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vpMaterialBank, 0x50);
37+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_lnManager, 0x60);
38+
MARATHON_ASSERT_OFFSETOF(ParticleEngine, m_vField6C, 0x6C);
39+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <Sonicteam/SoX/Engine/Doc.h>
5+
6+
namespace Sonicteam::GE1PE
7+
{
8+
class Plugin
9+
{
10+
public:
11+
struct Vftable
12+
{
13+
be<uint32_t> fpDestroy;
14+
//....
15+
};
16+
17+
xpointer<Vftable> m_pVftable;
18+
xpointer<SoX::Engine::Doc> m_pDoc;
19+
};
20+
//size == 0x34 (but PE::MyPlugin no idea about this)
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
5+
namespace Sonicteam::GE1PE
6+
{
7+
class RefCountObject
8+
{
9+
public:
10+
struct Vftable
11+
{
12+
be<uint32_t> fpDestroy;
13+
};
14+
15+
xpointer<Vftable> m_pVftable;
16+
be<uint32_t> m_ReferenceCount;
17+
18+
void* Destroy(uint32_t flag = 1)
19+
{
20+
return GuestToHostFunction<void*>(m_pVftable->fpDestroy, this, flag);
21+
}
22+
23+
void Release(uint32_t flag = 1)
24+
{
25+
m_ReferenceCount = m_ReferenceCount - 1;
26+
27+
if (!m_ReferenceCount.get())
28+
Destroy(flag);
29+
}
30+
31+
inline void AddReference()
32+
{
33+
m_ReferenceCount = m_ReferenceCount + 1;
34+
}
35+
};
36+
}

MarathonRecomp/api/Sonicteam/Globals.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#pragma once
22

33
#include <Marathon.inl>
4+
#include <stdx/list.h>
5+
#include <stdx/string.h>
46

57
namespace Sonicteam
68
{
9+
class MyRenderProcess;
10+
711
enum Character : uint32_t
812
{
913
Character_Sonic,
@@ -21,10 +25,27 @@ namespace Sonicteam
2125
{
2226
static inline be<float>* ms_MainDisplayColours[9];
2327

28+
static inline stdx::list<MyRenderProcess>* ms_lMyRenderProcess;
29+
30+
static inline stdx::string* ms_CurrentRenderScript;
31+
32+
static inline const char* msg_ConstCharStringBuild; // Build
33+
34+
static inline const char* msg_ConstCharStringRenderSpanverse; // RenderSpanverse
35+
36+
2437
static void Init()
2538
{
2639
for (int i = 0; i < 9; i++)
2740
ms_MainDisplayColours[i] = (be<float>*)MmGetHostAddress(0x82036BE4 + (i * 4));
41+
42+
ms_lMyRenderProcess = (stdx::list<MyRenderProcess>*)MmGetHostAddress(0x82D3C568);
43+
44+
ms_CurrentRenderScript = (stdx::string*)MmGetHostAddress(0x82B814F8);
45+
46+
msg_ConstCharStringBuild = (const char*)MmGetHostAddress(0x82024000);
47+
48+
msg_ConstCharStringRenderSpanverse = (const char*)MmGetHostAddress(0x8204C0C8);
2849
}
2950
};
3051
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
#include <Marathon.inl>
4+
#include <api/lua/lua.h>
5+
6+
namespace Sonicteam
7+
{
8+
9+
class LuaNode
10+
{
11+
public:
12+
struct Vftable
13+
{
14+
be<uint32_t> fpDestroy;
15+
};
16+
xpointer<Vftable> m_pVftable;
17+
lua50::lua_State m_pLuaState;
18+
};
19+
}

0 commit comments

Comments
 (0)