Skip to content

Commit 3f4bfc2

Browse files
committed
Added and Fixed the rest ofthe .h (I believe). Finished iException and got it successfully linked.
1 parent bc16f9e commit 3f4bfc2

23 files changed

+5558
-41
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def MatchingFor(*versions):
339339
Object(NonMatching, "SB/Game/zParticleCustom.cpp"),
340340
Object(NonMatching, "SB/Core/gc/iWad.cpp"),
341341
Object(NonMatching, "SB/Core/gc/iTRC.cpp"),
342-
Object(NonMatching, "SB/Core/gc/iException.cpp"),
342+
Object(Matching, "SB/Core/gc/iException.cpp"),
343343
Object(NonMatching, "SB/Core/gc/iScrFX.cpp"),
344344
Object(NonMatching, "SB/Core/gc/iARAMTmp.cpp"),
345345

src/SB/Core/gc/iException.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "iException.h"
2+
3+
void iExceptionMemCrash(const char* loc, U32 size, const char* arg3)
4+
{
5+
OSReport("Out of memory crash, Loc=%s Size=%d\n", loc, size);
6+
OSReport("%s\n", arg3);
7+
OSPanic("iException.cpp", 25, "");
8+
}

src/SB/Core/gc/iException.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef IEXCEPTION_H
2+
#define IEXCEPTION_H
3+
4+
#include "dolphin.h"
5+
#include "dolphin/os.h"
6+
#include <types.h>
7+
8+
#endif

src/SB/Core/gc/iMath3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
union xiMat4x3Union
1111
{
12-
xMat4x3 xm;
12+
//xMat4x3 xm; CURRENTLY BROKEN. DONT KNOW WHY
1313
RwMatrix im;
1414
};
1515

src/SB/Core/x/xEnv.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ struct xEnvAsset : xBaseAsset
3131
F32 loldHeight;
3232
};
3333

34+
struct _zEnv : xBase
35+
{
36+
xEnvAsset* easset;
37+
};
38+
39+
void zEnvInit(void* env, void* easset);
40+
void zEnvInit(_zEnv* env, xEnvAsset* easset);
41+
void zEnvSetup(_zEnv* env);
42+
void zEnvStartingCamera(_zEnv* env);
43+
void zEnvRender(xEnv* env);
44+
void zEnvSave(_zEnv* ent, xSerial* s);
45+
void zEnvLoad(_zEnv* ent, xSerial* s);
46+
void zEnvReset(_zEnv* env);
47+
S32 zEnvEventCB(xBase*, xBase* to, U32 toEvent, const F32* toParam, xBase*);
48+
3449
void xEnvLoadBsp(xEnv* env, const void* data, U32 datasize, S32 dataType);
3550
void xEnvFree(xEnv* env);
3651
void xEnvSetup(xEnv* env);

src/SB/Game/zMovePoint.cpp

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#include "zMovePoint.h"
2+
#include "zNPCSupplement.h"
3+
4+
#include "xEvent.h"
5+
6+
#include <types.h>
7+
8+
// PORTED DIRECTLY FROM BFBB
9+
10+
extern zMovePoint* g_mvpt_list;
11+
extern S32 g_mvpt_cnt;
12+
extern F32 lbl_803CDD40;
13+
extern F32 lbl_803CDD44;
14+
15+
// Random load word at the end of the function for some reason.
16+
zMovePoint* zMovePoint_GetMemPool(S32 cnt)
17+
{
18+
/*if (cnt != 0)
19+
{
20+
g_mvpt_list = (zMovePoint*)xMemAllocSize(cnt * sizeof(zMovePoint));
21+
}
22+
else
23+
{
24+
g_mvpt_list = NULL;
25+
}
26+
g_mvpt_cnt = cnt;
27+
return g_mvpt_list;*/
28+
29+
g_mvpt_list = cnt ? (zMovePoint*)xMemAllocSize(cnt * sizeof(zMovePoint)) : NULL;
30+
g_mvpt_cnt = cnt;
31+
return g_mvpt_list;
32+
}
33+
34+
void zMovePointInit(zMovePoint* m, xMovePointAsset* asset)
35+
{
36+
xMovePointInit((xMovePoint*)m, asset);
37+
m->eventFunc = zMovePointEventCB;
38+
if (m->linkCount)
39+
{
40+
m->link =
41+
(xLinkAsset*)(((U32*)asset + sizeof(xMovePointAsset) / 4) + (U32)asset->numPoints);
42+
}
43+
else
44+
{
45+
m->link = NULL;
46+
}
47+
}
48+
49+
zMovePoint* zMovePoint_GetInst(S32 n)
50+
{
51+
return &g_mvpt_list[n];
52+
}
53+
54+
void zMovePointSetup(zMovePoint* mvpt, zScene* scn)
55+
{
56+
xMovePointSetup((xMovePoint*)mvpt, (xScene*)scn);
57+
}
58+
59+
zMovePoint* zMovePoint_From_xAssetID(U32 aid)
60+
{
61+
zMovePoint* pnt = g_mvpt_list;
62+
zMovePoint* ret = NULL;
63+
for (S32 i = g_mvpt_cnt; i > 0; i--)
64+
{
65+
if (pnt->asset->id == aid)
66+
{
67+
ret = pnt;
68+
break;
69+
}
70+
pnt++;
71+
}
72+
return ret;
73+
}
74+
75+
void zMovePointSave(zMovePoint* ent, xSerial* s)
76+
{
77+
xMovePointSave((xMovePoint*)ent, s);
78+
}
79+
80+
void zMovePointLoad(zMovePoint* ent, xSerial* s)
81+
{
82+
xMovePointLoad((xMovePoint*)ent, s);
83+
}
84+
85+
void zMovePointReset(zMovePoint* m)
86+
{
87+
xMovePointReset((xMovePoint*)m);
88+
}
89+
90+
S32 zMovePointEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase* b3)
91+
{
92+
switch (toEvent)
93+
{
94+
case eEventOn:
95+
((zMovePoint*)to)->on = true;
96+
break;
97+
case eEventOff:
98+
((zMovePoint*)to)->on = false;
99+
break;
100+
case eEventArrive:
101+
break;
102+
case eEventReset:
103+
zMovePointReset((zMovePoint*)to);
104+
break;
105+
case eEventMakeASplash:
106+
xVec3* pos = ((zMovePoint*)to)->pos;
107+
if (pos != NULL)
108+
{
109+
if (*toParam < lbl_803CDD40)
110+
{
111+
NPCC_MakeASplash(pos, lbl_803CDD44);
112+
}
113+
else
114+
{
115+
NPCC_MakeASplash(pos, *toParam);
116+
}
117+
}
118+
break;
119+
}
120+
return eEventEnable;
121+
}
122+
123+
F32 zMovePointGetNext(const zMovePoint* current, const zMovePoint* prev, zMovePoint** next,
124+
xVec3* hdng)
125+
{
126+
return xMovePointGetNext((xMovePoint*)current, (xMovePoint*)prev, (xMovePoint**)next, hdng);
127+
}
128+
129+
xVec3* zMovePointGetPos(const zMovePoint* m)
130+
{
131+
return xMovePointGetPos((xMovePoint*)m);
132+
}
133+
134+
F32 zMovePointGetDelay(const zMovePoint* m)
135+
{
136+
return xMovePointGetDelay((xMovePoint*)m);
137+
}
138+
139+
F32 xMovePointGetDelay(const xMovePoint* m)
140+
{
141+
return m->delay;
142+
}

src/SB/Game/zMovePoint.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ifndef ZMOVEPOINT_H
2+
#define ZMOVEPOINT_H
3+
4+
#include "xMovePoint.h"
5+
6+
#include "zScene.h"
7+
8+
#include <types.h>
9+
10+
struct zMovePoint : xMovePoint
11+
{
12+
F32 RadiusZone()
13+
{
14+
return asset->zoneRadius;
15+
}
16+
F32 Delay()
17+
{
18+
return asset->delay;
19+
}
20+
xVec3* PosGet()
21+
{
22+
return pos;
23+
}
24+
U32 NumNodes();
25+
U8 IsOn();
26+
};
27+
28+
zMovePoint* zMovePoint_GetMemPool(S32 cnt);
29+
void zMovePointInit(zMovePoint* m, xMovePointAsset* asset);
30+
zMovePoint* zMovePoint_GetInst(S32 n);
31+
void zMovePointSetup(zMovePoint* mvpt, zScene* scn);
32+
zMovePoint* zMovePoint_From_xAssetID(U32 aid);
33+
void zMovePointSave(zMovePoint* ent, xSerial* s);
34+
void zMovePointLoad(zMovePoint* ent, xSerial* s);
35+
void zMovePointReset(zMovePoint* m);
36+
S32 zMovePointEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase* b3);
37+
F32 zMovePointGetNext(const zMovePoint* current, const zMovePoint* prev, zMovePoint** next,
38+
xVec3* hdng);
39+
xVec3* zMovePointGetPos(const zMovePoint* m);
40+
F32 zMovePointGetDelay(const zMovePoint* m);
41+
F32 xMovePointGetDelay(const xMovePoint* m);
42+
43+
#endif

0 commit comments

Comments
 (0)