Skip to content
Merged
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
11 changes: 7 additions & 4 deletions config/RSPE01_01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ nw4r/ef/drawstrategy/ef_drawsmoothstripestrategy.cpp:
.sbss start:0x804BEA58 end:0x804BEA60
.sdata2 start:0x804BFE68 end:0x804BFEA8

nw4r/nw4r_8002F700.o:
.text start:0x8002F700 end:0x8002F75C
nw4r/ef/ef_res_emitter_ac.cpp:
.text start:0x8002F700 end:0x8002F730

nw4r/ef/ef_res_animcurve_ac.cpp:
.text start:0x8002F730 end:0x8002F75C

nw4r/math/math_arithmetic.cpp:
.text start:0x8002F75C end:0x8002F898
Expand Down Expand Up @@ -1189,7 +1192,7 @@ egg/gfx/eggDrawHelper.cpp:
.bss start:0x8040AA50 end:0x8040AA60
.sbss start:0x804BEC88 end:0x804BEC90

egg/gfx/egg_800A1DB0.o:
egg/gfx/eggProjection.cpp:
.text start:0x800A1DB0 end:0x800A1DE4

egg/prim/eggAssert.cpp:
Expand All @@ -1198,7 +1201,7 @@ egg/prim/eggAssert.cpp:
.text start:0x800A1DE4 end:0x800A204C
.rodata start:0x8037A1E0 end:0x8037A230

egg/egg_800A204C.o:
egg/geom/eggPlane.cpp:
extab start:0x80006508 end:0x80006510
extabindex start:0x80006C5C end:0x80006C68
.text start:0x800A204C end:0x800A2118
Expand Down
4 changes: 2 additions & 2 deletions config/RSPE01_01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ CalcAhead_Particle_Stripe__Q34nw4r2ef24DrawSmoothStripeStrategyFPQ34nw4r4math4VE
CalcAhead_ParticleBoth_Stripe__Q34nw4r2ef24DrawSmoothStripeStrategyFPQ34nw4r4math4VEC3PQ44nw4r2ef24DrawSmoothStripeStrategy18AheadContextStripePQ34nw4r2ef8Particle = .text:0x8002EE64; // type:function size:0x2DC scope:global
CalcAhead_ParticleBoth_Ring__Q34nw4r2ef24DrawSmoothStripeStrategyFPQ34nw4r4math4VEC3PQ44nw4r2ef24DrawSmoothStripeStrategy18AheadContextStripePQ34nw4r2ef8Particle = .text:0x8002F140; // type:function size:0x32C scope:global
CalcAhead_ParticleBoth_Origin__Q34nw4r2ef24DrawSmoothStripeStrategyFPQ34nw4r4math4VEC3PQ44nw4r2ef24DrawSmoothStripeStrategy18AheadContextStripePQ34nw4r2ef8Particle = .text:0x8002F46C; // type:function size:0x294 scope:global
fn_8002F700 = .text:0x8002F700; // type:function size:0x30
fn_8002F730 = .text:0x8002F730; // type:function size:0x2C
GetPtclTrack__Q34nw4r2ef10ResEmitterFUs = .text:0x8002F700; // type:function size:0x30
SetStop__Q34nw4r2ef12ResAnimCurveFb = .text:0x8002F730; // type:function size:0x2C
FExp__Q34nw4r4math6detailFf = .text:0x8002F75C; // type:function size:0x8C scope:global
FLog__Q34nw4r4math6detailFf = .text:0x8002F7E8; // type:function size:0x8C scope:global
FrSqrt__Q24nw4r4mathFf = .text:0x8002F874; // type:function size:0x24 scope:global
Expand Down
4 changes: 4 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ def MatchingFor(*versions):
Object(Matching, "nw4r/ef/drawstrategy/ef_drawpointstrategy.cpp"),
Object(NonMatching, "nw4r/ef/drawstrategy/ef_drawstripestrategy.cpp"),
Object(NonMatching, "nw4r/ef/drawstrategy/ef_drawsmoothstripestrategy.cpp"),
Object(Matching, "nw4r/ef/ef_res_emitter_ac.cpp"),
Object(Matching, "nw4r/ef/ef_res_animcurve_ac.cpp"),
]
},
{
Expand Down Expand Up @@ -731,7 +733,9 @@ def MatchingFor(*versions):
Object(Matching, "egg/gfxe/eggGXUtility.cpp"),
Object(Matching, "egg/gfxe/eggIDrawGX.cpp"),
Object(NonMatching, "egg/gfx/eggDrawHelper.cpp"),
Object(NonMatching, "egg/gfx/eggProjection.cpp"),
Object(Matching, "egg/prim/eggAssert.cpp", extra_cflags=["-Cpp_exceptions on"]),
Object(NonMatching, "egg/geom/eggPlane.cpp", extra_cflags=["-Cpp_exceptions on"]),
Object(Matching, "egg/math/eggMath.cpp", extra_cflags=["-Cpp_exceptions on"]),
Object(Matching, "egg/math/eggMatrix.cpp", extra_cflags=["-Cpp_exceptions on"]),
Object(Matching, "egg/math/eggQuat.cpp", extra_cflags=["-Cpp_exceptions on"]),
Expand Down
6 changes: 6 additions & 0 deletions include/egg/geom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef EGG_PUBLIC_GEOM_H
#define EGG_PUBLIC_GEOM_H

#include <egg/geom/eggPlane.h>

#endif
26 changes: 26 additions & 0 deletions include/egg/geom/eggPlane.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef EGG_GEOM_PLANE_H
#define EGG_GEOM_PLANE_H
#include <egg/types_egg.h>

#include <egg/math.h>

namespace EGG {

class Plane3f {
public:
Plane3f() {}
Plane3f(const Vector3f& rNormal) : normal(rNormal), depth(0.0f) {}
Plane3f(const Vector3f& rNormal, f32 depth)
: normal(rNormal), depth(depth) {}
~Plane3f() {}

Vector3f project(const Vector3f& rVec);

private:
Vector3f normal; // at 0x0
f32 depth; // at 0x10
};

} // namespace EGG

#endif
4 changes: 2 additions & 2 deletions include/egg/math/eggVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ class Vector3f : public nw4r::math::VEC3 {
}

f32& operator()(int i) {
return reinterpret_cast<f32*>(&x)[i];
return (&x)[i];
}
const f32 operator()(int i) const {
return reinterpret_cast<const f32*>(&x)[i];
return (&x)[i];
}

void set(f32 fx, f32 fy, f32 fz) {
Expand Down
15 changes: 15 additions & 0 deletions include/nw4r/ef/ef_res_animcurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ struct AnimCurveNameTable {
class ResAnimCurve {
private:
u8* mAnimCurveData; // at 0x0

public:
explicit ResAnimCurve(u8* pData = NULL) : mAnimCurveData(pData) {}
ResAnimCurve(const ResAnimCurve& rOther)
: mAnimCurveData(rOther.mAnimCurveData) {}

bool IsValid() const {
return mAnimCurveData != NULL;
}

AnimCurveHeader* ptr() {
return reinterpret_cast<AnimCurveHeader*>(mAnimCurveData);
}

void SetStop(bool stop);
};

} // namespace ef
Expand Down
3 changes: 3 additions & 0 deletions include/nw4r/ef/ef_res_emitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define NW4R_EF_RES_EMITTER_H
#include <nw4r/types_nw4r.h>

#include <nw4r/ef/ef_res_animcurve.h>
#include <nw4r/ef/ef_types.h>
#include <nw4r/ef/emform/ef_emform.h>
#include <nw4r/math.h>
Expand Down Expand Up @@ -397,6 +398,8 @@ class ResEmitter {
EmitterResource* ptr() {
return mData;
}

ResAnimCurve GetPtclTrack(u16 idx);
};

} // namespace ef
Expand Down
18 changes: 18 additions & 0 deletions src/egg/geom/eggPlane.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <egg/geom.h>

namespace EGG {

DECOMP_FORCEACTIVE(eggPlane_cpp, Vector3f::multScalar);

Vector3f Plane3f::project(const Vector3f& rVec) {
f32 s = normal.dot(rVec) - depth;
Vector3f work(rVec);

// TODO(kiwi) how is multScalar being called?
Vector3f n(normal * s);
work -= n;

return work;
}

} // namespace EGG
17 changes: 17 additions & 0 deletions src/nw4r/ef/ef_res_animcurve_ac.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <nw4r/ef.h>

namespace nw4r {
namespace ef {

void ResAnimCurve::SetStop(bool stop) {
AnimCurveHeader* pHeader = ptr();

if (stop) {
pHeader->processFlag |= AnimCurveHeader::PROC_FLAG_STOP;
} else {
pHeader->processFlag &= ~AnimCurveHeader::PROC_FLAG_STOP;
}
}

} // namespace ef
} // namespace nw4r
11 changes: 11 additions & 0 deletions src/nw4r/ef/ef_res_emitter_ac.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <nw4r/ef.h>

namespace nw4r {
namespace ef {

ResAnimCurve ResEmitter::GetPtclTrack(u16 idx) {
return ResAnimCurve(ptr()->GetPtclTrack(idx));
}

} // namespace ef
} // namespace nw4r
19 changes: 12 additions & 7 deletions src/revolution/NWC24/NWC24Ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ static BOOL NWC24iIsRequestPending = FALSE;
// Forward declarations
static s32 CallbackAsyncIpc(s32 result, void* pArg);

NWC24Err NWC24iOpenResourceManager(const char* /* pUser */, const char* pName,
NWC24Err NWC24iOpenResourceManager(const char* pUser, const char* pName,
s32* pFd, IPCOpenMode mode) {
#pragma unused(pUser)

s32 result;

if (pFd == NULL) {
Expand All @@ -32,23 +34,26 @@ NWC24Err NWC24iOpenResourceManager(const char* /* pUser */, const char* pName,
return NWC24_OK;
}

NWC24Err NWC24iCloseResourceManager(const char* /* pUser */, s32 fd) {
NWC24Err NWC24iCloseResourceManager(const char* pUser, s32 fd) {
#pragma unused(pUser)

return IOS_Close(fd) < 0 ? NWC24_ERR_INTERNAL_IPC : NWC24_OK;
}

NWC24Err NWC24iIoctlResourceManager(const char* /* pUser */, s32 fd, s32 type,
NWC24Err NWC24iIoctlResourceManager(const char* pUser, s32 fd, s32 type,
void* pIn, s32 inSize, void* pOut,
s32 outSize) {
#pragma unused(pUser)

return IOS_Ioctl(fd, type, pIn, inSize, pOut, outSize) < 0
? NWC24_ERR_INTERNAL_IPC
: NWC24_OK;
}

NWC24Err NWC24iIoctlResourceManagerAsync(const char* /* pUser */, s32 fd,
s32 type, void* pIn, s32 inSize,
void* pOut, s32 outSize,
void* pCallbackArg) {
NWC24Err NWC24iIoctlResourceManagerAsync(const char* pUser, s32 fd, s32 type,
void* pIn, s32 inSize, void* pOut,
s32 outSize, void* pCallbackArg) {
#pragma unused(pUser)

if (IOS_IoctlAsync(fd, type, pIn, inSize, pOut, outSize, CallbackAsyncIpc,
pCallbackArg) < 0) {
Expand Down
5 changes: 4 additions & 1 deletion src/revolution/NWC24/NWC24Schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ static void UnlockCounters(void) {
OSUnlockMutex(&nwc24ScdCounterMutex);
}

static NWC24Err CheckCallingStatus(const char* /* pUser */, BOOL /* block */) {
static NWC24Err CheckCallingStatus(const char* pUser, BOOL block) {
#pragma unused(pUser)
#pragma unused(block)

if (OSGetCurrentThread() == NULL) {
return NWC24_ERR_FATAL;
}
Expand Down
4 changes: 3 additions & 1 deletion src/revolution/NWC24/NWC24Time.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ static NWC24Err GetRTC(u32* pRTC) {
return NWC24_OK;
}

static NWC24Err CheckCallingStatus(const char* /* pUser */) {
static NWC24Err CheckCallingStatus(const char* pUser) {
#pragma unused(pUser)

if (OSGetCurrentThread() == NULL) {
return NWC24_ERR_FATAL;
}
Expand Down
Loading