Skip to content

Commit 45b3132

Browse files
SamuraiOndo0x5abe
andcommitted
Lots of various work
Co-Authored-By: Sebastián Meljem <95201472+0x5abe@users.noreply.github.com>
1 parent 5e01053 commit 45b3132

Some content is hidden

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

85 files changed

+2783
-248
lines changed

config/GLLE78/ldscript.tpl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,23 @@ SECTIONS
77
{
88
GROUP:
99
{
10-
$SECTIONS
10+
.init ALIGN(0x20):{}
11+
extab ALIGN(0x20):{}
12+
extabindex ALIGN(0x20):{}
13+
.text ALIGN(0x20):{}
14+
.ctors ALIGN(0x20):{}
15+
.dtors ALIGN(0x20):{}
16+
.rodata ALIGN(0x40):{}
17+
.data ALIGN(0x20):{}
18+
.bss ALIGN(0x4000):{}
19+
.sdata ALIGN(0x20):{}
20+
.sbss ALIGN(0x20):{}
21+
.sdata2 ALIGN(0x20):{}
22+
.sbss2 ALIGN(0x20):{}
1123
.stack ALIGN(0x20):{}
1224
} > text
1325

14-
_stack_end = ($LAST_SECTION_SYMBOL + SIZEOF($LAST_SECTION_NAME)+ 0x7) & ~0x7;
26+
_stack_end = _f_sbss2 + (SIZEOF(.sbss2)+ 0x7) & ~0x7;
1527
_stack_addr = (_stack_end + $STACKSIZE + 0x7) & ~0x7;
1628
_db_stack_addr = (_stack_addr + 0x10000);
1729
_db_stack_end = _stack_addr;
@@ -22,4 +34,4 @@ SECTIONS
2234
FORCEACTIVE
2335
{
2436
$FORCEACTIVE
25-
}
37+
}

configure.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def MatchingFor(*versions):
748748
Object(NonMatching, "Engine/HFog_Z.cpp"),
749749
Object(Matching, "Engine/AnimationMaterial_Z.cpp"),
750750
Object(Matching, "Engine/AnimationMorph_Z.cpp"),
751-
Object(NonMatching, "Engine/Manipulator_Z.cpp"),
751+
Object(Matching, "Engine/Manipulator_Z.cpp"),
752752
Object(Matching, "Engine/Parameters_Z.cpp"),
753753
Object(NonMatching, "Engine/MovieManipulator_Z.cpp"),
754754
Object(NonMatching, "Engine/Language_Z.cpp"),
@@ -770,7 +770,7 @@ def MatchingFor(*versions):
770770
Object(NonMatching, "Engine/Pack_Z.cpp"),
771771
Object(NonMatching, "Engine/Occluder_Z.cpp"),
772772
Object(NonMatching, "Engine/SurfaceCollisionTools_Z.cpp"),
773-
Object(NonMatching, "Engine/BaseObject_Z.cpp"),
773+
Object(Matching, "Engine/BaseObject_Z.cpp"),
774774
Object(NonMatching, "Engine/EmiterCollision_Z.cpp"),
775775
Object(NonMatching, "Engine/KeyframerFloat_Z.cpp"),
776776
Object(NonMatching, "Engine/GraphVertex_Z.cpp"),
@@ -821,7 +821,7 @@ def MatchingFor(*versions):
821821
Object(NonMatching, "Engine/GraphLoad_Z.cpp"),
822822
Object(NonMatching, "Engine/CameraEngine_Z.cpp"),
823823
Object(NonMatching, "Engine/ObjectsMoveColl_Z.cpp"),
824-
Object(NonMatching, "Engine/ABC_AgentReserve.cpp"),
824+
Object(Matching, "Engine/ABC_AgentReserve.cpp"),
825825
Object(NonMatching, "Engine/HFogDraw_Z.cpp"),
826826
Object(Matching, "Engine/Name_Z.cpp"),
827827
Object(NonMatching, "Engine/LodCollisionMovingSphere_Z.cpp"),
@@ -871,7 +871,7 @@ def MatchingFor(*versions):
871871
Object(NonMatching, "Engine/ObjectMoveCollVol_Z.cpp"),
872872
Object(NonMatching, "Engine/Camera_Z.cpp"),
873873
Object(NonMatching, "Engine/FlareDraw_Z.cpp"),
874-
Object(NonMatching, "Engine/ResourceObject_Z.cpp"),
874+
Object(Matching, "Engine/ResourceObject_Z.cpp"),
875875
Object(NonMatching, "Engine/BigFileManager_Z.cpp"),
876876
Object(NonMatching, "Engine/SkinCollisionMovingSphere_Z.cpp"),
877877
Object(NonMatching, "Engine/AStar_Z.cpp"),
@@ -896,15 +896,15 @@ def MatchingFor(*versions):
896896
Object(NonMatching, "Engine/DynamicAnim1_Z.cpp"),
897897
Object(NonMatching, "Engine/RtcAgent_Z.cpp"),
898898
Object(NonMatching, "Engine/OccluderCollision_Z.cpp"),
899-
Object(NonMatching, "Engine/File_Z.cpp"),
899+
Object(NonMatching, "Engine/File_Z.cpp", extra_cflags=["-O4,s","-inline off"]),
900900
Object(NonMatching, "Engine/SkinLoad_Z.cpp"),
901901
Object(NonMatching, "Engine/MaterialAnim_Z.cpp"),
902902
Object(NonMatching, "Engine/Flare_Z.cpp"),
903903
Object(NonMatching, "Engine/VehiculeMove_Z.cpp"),
904904
Object(NonMatching, "Engine/RotShapeDraw_Z.cpp"),
905905
Object(NonMatching, "Engine/Bitmap_Z.cpp", extra_cflags=["-O4,s"]),
906906
Object(NonMatching, "Engine/AnimatedAgent_Z.cpp"),
907-
Object(NonMatching, "Engine/ABC_ScriptManager.cpp"),
907+
Object(Matching, "Engine/ABC_ScriptManager.cpp"),
908908
Object(NonMatching, "Engine/LodCollisions_Z.cpp"),
909909
Object(NonMatching, "Engine/SurfaceDraw_Z.cpp"),
910910
Object(NonMatching, "Engine/Error_Z.cpp"),
@@ -957,7 +957,7 @@ def MatchingFor(*versions):
957957
Object(NonMatching, "Engine/OccludedSeadHandle_Z.cpp"),
958958
Object(NonMatching, "Engine/CameraEngineZone_Z.cpp"),
959959
Object(NonMatching, "Engine/ObjectCollisionTools_Z.cpp"),
960-
Object(NonMatching, "Engine/ABC_AgentMessage.cpp"),
960+
Object(Matching, "Engine/ABC_AgentMessage.cpp"),
961961
Object(NonMatching, "Engine/Fonts_Z.cpp"),
962962
Object(NonMatching, "Engine/PlayParticles_Z.cpp"),
963963
Object(NonMatching, "Engine/NetManager_Z.cpp"),
@@ -997,7 +997,7 @@ def MatchingFor(*versions):
997997
Object(NonMatching, "Engine/Menu2DLoadAscii_Z.cpp"),
998998
Object(NonMatching, "Engine/NetDataSet_Z.cpp"),
999999
Object(NonMatching, "Engine/Mesh_Z.cpp"),
1000-
Object(NonMatching, "Engine/CameraDraw_Z.cpp"),
1000+
Object(Matching, "Engine/CameraDraw_Z.cpp"),
10011001
Object(NonMatching, "Engine/Spline_Z.cpp"),
10021002
Object(NonMatching, "Engine/ConsoleMessage_Z.cpp"),
10031003
Object(NonMatching, "Engine/Skel_Z.cpp"),
@@ -1049,7 +1049,7 @@ def MatchingFor(*versions):
10491049
Object(NonMatching, "LibGC/LodGCDraw_Z.cpp"),
10501050
Object(NonMatching, "LibGC/ParticlesGCDraw_Z.cpp"),
10511051
Object(NonMatching, "LibGC/GCFrustrum_Z.cpp"),
1052-
Object(NonMatching, "LibGC/GCStreamManager_Z.cpp"),
1052+
Object(Matching, "LibGC/GCStreamManager_Z.cpp"),
10531053
Object(NonMatching, "LibGC/GCSoundManager_Z.cpp"),
10541054
Object(NonMatching, "LibGC/MeshGC_Z.cpp"),
10551055
Object(NonMatching, "LibGC/SurfaceGCDraw_Z.cpp"),

src/Engine/ABC_AgentMessage.cpp

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#include "ABC_Agent.h"
2+
#include "ABC_ScriptManager.h"
3+
#include "Program_Z.h"
4+
5+
ABC_Message* ABC_Agent::GetNewMessage() {
6+
return gData.ScriptMgr->GetNewMessage();
7+
}
8+
9+
void ABC_Agent::ReleaseMessageList() {
10+
gData.ScriptMgr->ReleaseMessages(m_MessageListHead);
11+
m_MessageListHead = NULL;
12+
m_MessageListTail = NULL;
13+
}
14+
15+
void ABC_Agent::SwapMessageList() {
16+
m_MessageListHead = m_BufferMessageListHead;
17+
m_MessageListTail = m_BufferMessageListTail;
18+
m_BufferMessageListHead = NULL;
19+
m_BufferMessageListTail = NULL;
20+
}
21+
22+
void ABC_Agent::RemoveMessageFromList(ABC_Message* i_PrevMsg, ABC_Message* i_Msg) {
23+
if (i_PrevMsg) {
24+
i_PrevMsg->m_Next = i_Msg->m_Next;
25+
}
26+
else {
27+
m_MessageListHead = i_Msg->m_Next;
28+
}
29+
if (i_Msg->m_Next == NULL) {
30+
m_MessageListTail = i_PrevMsg;
31+
}
32+
gData.ScriptMgr->ReleaseMessage(i_Msg);
33+
}
34+
35+
void ABC_Agent::RemoveMessageFromBufferList(ABC_Message* i_PrevMsg, ABC_Message* i_Msg) {
36+
if (i_PrevMsg) {
37+
i_PrevMsg->m_Next = i_Msg->m_Next;
38+
}
39+
else {
40+
m_BufferMessageListHead = i_Msg->m_Next;
41+
}
42+
if (i_Msg->m_Next == NULL) {
43+
m_BufferMessageListTail = i_PrevMsg;
44+
}
45+
gData.ScriptMgr->ReleaseMessage(i_Msg);
46+
}
47+
48+
Bool ABC_Agent::FlushMessage(abc_message i_Msg) {
49+
ABC_Message* l_Msg = m_MessageListHead;
50+
ABC_Message* l_Prev = NULL;
51+
while (l_Msg) {
52+
if (i_Msg == l_Msg->m_Id) {
53+
RemoveMessageFromList(l_Prev, l_Msg);
54+
return TRUE;
55+
}
56+
l_Prev = l_Msg;
57+
l_Msg = l_Msg->m_Next;
58+
}
59+
l_Msg = m_BufferMessageListHead;
60+
l_Prev = NULL;
61+
while (l_Msg) {
62+
if (i_Msg == l_Msg->m_Id) {
63+
RemoveMessageFromBufferList(l_Prev, l_Msg);
64+
return TRUE;
65+
}
66+
l_Prev = l_Msg;
67+
l_Msg = l_Msg->m_Next;
68+
}
69+
return FALSE;
70+
}
71+
72+
Bool ABC_Agent::FlushEveryMessage(abc_message i_Msg, ABC_Agent* i_Sender) {
73+
ABC_Message* l_Msg = m_MessageListHead;
74+
ABC_Message* l_Prev = NULL;
75+
Bool l_Flushed = FALSE;
76+
while (l_Msg) {
77+
if (i_Msg == l_Msg->m_Id) {
78+
if (i_Sender && i_Sender != l_Msg->m_Sender) {
79+
l_Prev = l_Msg;
80+
l_Msg = l_Msg->m_Next;
81+
continue;
82+
}
83+
l_Flushed = TRUE;
84+
RemoveMessageFromList(l_Prev, l_Msg);
85+
if (!l_Prev) {
86+
l_Msg = m_MessageListHead;
87+
}
88+
else {
89+
l_Msg = l_Prev->m_Next;
90+
}
91+
}
92+
else {
93+
l_Prev = l_Msg;
94+
l_Msg = l_Msg->m_Next;
95+
}
96+
}
97+
l_Msg = m_BufferMessageListHead;
98+
l_Prev = NULL;
99+
while (l_Msg) {
100+
if (i_Msg == l_Msg->m_Id) {
101+
if (i_Sender && i_Sender != l_Msg->m_Sender) {
102+
l_Prev = l_Msg;
103+
l_Msg = l_Msg->m_Next;
104+
continue;
105+
}
106+
l_Flushed = TRUE;
107+
RemoveMessageFromBufferList(l_Prev, l_Msg);
108+
if (!l_Prev) {
109+
l_Msg = m_BufferMessageListHead;
110+
}
111+
else {
112+
l_Msg = l_Prev->m_Next;
113+
}
114+
}
115+
else {
116+
l_Prev = l_Msg;
117+
l_Msg = l_Msg->m_Next;
118+
}
119+
}
120+
return l_Flushed;
121+
}
122+
123+
Bool ABC_Agent::FlushAllMessages(Bool i_FlushTimedMessages) {
124+
ABC_Message* l_Msg = m_MessageListHead;
125+
ABC_Message* l_NextMsg;
126+
Bool result = (NULL != m_MessageListHead) || (NULL != m_BufferMessageListHead);
127+
while (l_Msg) {
128+
l_NextMsg = l_Msg->m_Next;
129+
gData.ScriptMgr->ReleaseMessage(l_Msg);
130+
l_Msg = l_NextMsg;
131+
}
132+
m_MessageListHead = NULL;
133+
m_MessageListTail = NULL;
134+
l_Msg = m_BufferMessageListHead;
135+
while (l_Msg) {
136+
l_NextMsg = l_Msg->m_Next;
137+
gData.ScriptMgr->ReleaseMessage(l_Msg);
138+
l_Msg = l_NextMsg;
139+
}
140+
m_BufferMessageListHead = NULL;
141+
m_BufferMessageListTail = NULL;
142+
if (i_FlushTimedMessages && gData.ScriptMgr) {
143+
gData.ScriptMgr->FlushTimedMessagesTo(this);
144+
}
145+
return result;
146+
}

src/Engine/ABC_AgentReserve.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "ABC_Agent.h"
2+
#include "ABC_ScriptManager.h"
3+
#include "Program_Z.h"
4+
5+
ABC_Behavior* ABC_Agent::GetNewBehavior() {
6+
return gData.ScriptMgr->GetNewBehavior();
7+
}
8+
9+
void ABC_Agent::ReleaseBehaviors() {
10+
gData.ScriptMgr->ReleaseBehaviors(m_BehaviorListHead);
11+
m_BehaviorListHead = NULL;
12+
}
13+
14+
ABC_CategoryHolder* ABC_Agent::GetNewCategoryHolder() {
15+
return gData.ScriptMgr->GetNewCategoryHolder();
16+
}
17+
18+
void ABC_Agent::ReleaseCategoryHolders(ABC_CategoryHolder* i_CategoryHolder) {
19+
gData.ScriptMgr->ReleaseCategoryHolders(i_CategoryHolder);
20+
}
21+
22+
ABC_BehaviorHolder* ABC_Agent::GetNewBehaviorHolder() {
23+
return gData.ScriptMgr->GetNewBehaviorHolder();
24+
}

src/Engine/ABC_Behavior.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "Memory_Z.h"
33
#include "Program_Z.h"
44
#include "ABC_ScriptManager.h"
5-
Extern_Z "C" void memcpy(void* dst, const void* src, int n);
65

76
ABC_Behavior::ABC_Behavior() {
87
m_LocalDataSize = 0;

0 commit comments

Comments
 (0)