Skip to content
Open
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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ WhitespaceSensitiveMacros:
DECOMP_FORCEACTIVE,
DECOMP_FORCELITERAL,
OS_ASSERT,
OS_DEBUG_ASSERT,
OS_ERROR,
EGG_ASSERT,
EGG_ASSERT_MSG,
Expand Down
9 changes: 9 additions & 0 deletions config/RSPE01_01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2028,10 +2028,16 @@ revolution/MTX/mtx.c:
revolution/MTX/mtxvec.c:
.text start:0x800E8260 end:0x800E82B4

revolution/MTX/mtxstack.c:
.text start:0x800E82B4 end:0x800E82B4

revolution/MTX/mtx44.c:
.text start:0x800E82B4 end:0x800E84D4
.sdata2 start:0x804C11E0 end:0x804C11F8

revolution/MTX/mtx44vec.c:
.text start:0x800E84D4 end:0x800E84D4

revolution/MTX/vec.c:
.text start:0x800E84D4 end:0x800E86F8
.sdata2 start:0x804C11F8 end:0x804C1208
Expand All @@ -2041,6 +2047,9 @@ revolution/MTX/quat.c:
.rodata start:0x8037C4B0 end:0x8037C4C0
.sdata2 start:0x804C1208 end:0x804C1220

revolution/MTX/psmtx.c:
.text start:0x800E8B10 end:0x800E8B10

revolution/NAND/nand.c:
.text start:0x800E8B10 end:0x800E9C00
.sdata start:0x804BD668 end:0x804BD670
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 @@ -4401,7 +4401,7 @@ PSMTXInverse = .text:0x800E790C; // type:function size:0xF8 scope:global
PSMTXInvXpose = .text:0x800E7A04; // type:function size:0xC8 scope:global
PSMTXRotRad = .text:0x800E7ACC; // type:function size:0x7C scope:global
PSMTXRotTrig = .text:0x800E7B48; // type:function size:0xB0 scope:global
__PSMTXRotAxisRadInternal = .text:0x800E7BF8; // type:function size:0xB0 scope:global
__PSMTXRotAxisRadInternal = .text:0x800E7BF8; // type:function size:0xB0 scope:local
PSMTXRotAxisRad = .text:0x800E7CA8; // type:function size:0x7C scope:global
PSMTXTrans = .text:0x800E7D24; // type:function size:0x34 scope:global
PSMTXTransApply = .text:0x800E7D58; // type:function size:0x4C scope:global
Expand Down Expand Up @@ -23284,7 +23284,7 @@ lbl_804C11C8 = .sdata2:0x804C11C8; // type:object size:0x4 align:4 data:float
lbl_804C11CC = .sdata2:0x804C11CC; // type:object size:0x4 align:4 data:float
lbl_804C11D0 = .sdata2:0x804C11D0; // type:object size:0x4 align:4 data:float
lbl_804C11D4 = .sdata2:0x804C11D4; // type:object size:0x4 align:4 data:float
lbl_804C11D8 = .sdata2:0x804C11D8; // type:object size:0x8 align:4 data:float
lbl_804C11D8 = .sdata2:0x804C11D8; // type:object size:0x4 align:4 data:float
@176 = .sdata2:0x804C11E0; // type:object size:0x4 scope:local align:4 data:float
@177 = .sdata2:0x804C11E4; // type:object size:0x4 scope:local align:4 data:float
@178 = .sdata2:0x804C11E8; // type:object size:0x4 scope:local align:4 data:float
Expand Down
5 changes: 4 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,14 @@ def MatchingFor(*versions):
Object(Matching, "revolution/MEM/mem_frameHeap.c"),
Object(Matching, "revolution/MEM/mem_allocator.c"),
Object(Matching, "revolution/MEM/mem_list.c"),
Object(NonMatching, "revolution/MTX/mtx.c"),
Object(Matching, "revolution/MTX/mtx.c"),
Object(Matching, "revolution/MTX/mtxvec.c"),
Object(Matching, "revolution/MTX/mtxstack.c"),
Object(Matching, "revolution/MTX/mtx44.c"),
Object(Matching, "revolution/MTX/mtx44vec.c"),
Object(Matching, "revolution/MTX/vec.c"),
Object(Matching, "revolution/MTX/quat.c"),
Object(Matching, "revolution/MTX/psmtx.c"),
Object(Matching, "revolution/NAND/nand.c"),
Object(Matching, "revolution/NAND/NANDOpenClose.c"),
Object(Matching, "revolution/NAND/NANDCore.c"),
Expand Down
7 changes: 2 additions & 5 deletions include/revolution/MTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
extern "C" {
#endif

#include <revolution/MTX/GeoTypes.h>
#include <revolution/MTX/mtx.h>
#include <revolution/MTX/mtx44.h>
#include <revolution/MTX/mtxtypes.h>
#include <revolution/MTX/mtxvec.h>
#include <revolution/MTX/quat.h>
#include <revolution/MTX/vec.h>
#include <revolution/MTX/mtx44ext.h>

#ifdef __cplusplus
}
Expand Down
61 changes: 61 additions & 0 deletions include/revolution/MTX/GeoTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#ifndef RVL_SDK_MTX_GEO_TYPES_H
#define RVL_SDK_MTX_GEO_TYPES_H
#include <types.h>
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
f32 x, y, z;
} Vec;
typedef Vec* VecPtr;
typedef const Vec* CVecPtr;
typedef Vec Point3d;
typedef Vec* Point3dPtr;
typedef const Vec* CPoint3dPtr;

typedef struct {
s16 x, y, z;
} S16Vec;
typedef S16Vec* S16VecPtr;
typedef const S16Vec* CS16VecPtr;

typedef struct {
f32 x, y;
} Vec2;
typedef Vec2* Vec2Ptr;
typedef const Vec2* CVec2Ptr;

typedef struct {
f32 x, y, z, w;
} Quaternion;
typedef Quaternion* QuaternionPtr;
typedef const Quaternion* CQuaternionPtr;
typedef Quaternion Qtrn;
typedef Quaternion* QtrnPtr;
typedef const Quaternion* CQtrnPtr;

typedef f32 Mtx[3][4];
typedef f32 (*MtxPtr)[4];
typedef const f32 (*CMtxPtr)[4];

typedef f32 ROMtx[4][3];
typedef f32 (*ROMtxPtr)[3];
typedef const f32 (*CROMtxPtr)[3];

typedef f32 Mtx44[4][4];
typedef f32 (*Mtx44Ptr)[4];
typedef const f32 (*CMtx44Ptr)[4];

typedef struct {
u32 numMtx; // at 0x0
MtxPtr stackBase; // at 0x4
MtxPtr stackPtr; // at 0x8
} MtxStack;
typedef MtxStack* MtxStackPtr;
typedef const MtxStack* CMtxStackPtr;

#ifdef __cplusplus
}
#endif
#endif
17 changes: 17 additions & 0 deletions include/revolution/MTX/internal/mtx44extAssert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef RVL_SDK_MTX44_EXT_ASSERT_H
#define RVL_SDK_MTX44_EXT_ASSERT_H

#include <revolution/MTX/internal/mtxAssert.h>

/******************************************************************************
*
* Mtx44
*
******************************************************************************/

#define Mtx_30 0x30
#define Mtx_31 0x34
#define Mtx_32 0x38
#define Mtx_33 0x3C

#endif
65 changes: 65 additions & 0 deletions include/revolution/MTX/internal/mtxAssert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef RVL_SDK_MTX_ASSERT_H
#define RVL_SDK_MTX_ASSERT_H

/******************************************************************************
*
* Mtx
*
******************************************************************************/

#define Mtx_00 0x0
#define Mtx_01 0x4
#define Mtx_02 0x8
#define Mtx_03 0xC
#define Mtx_10 0x10
#define Mtx_11 0x14
#define Mtx_12 0x18
#define Mtx_13 0x1C
#define Mtx_20 0x20
#define Mtx_21 0x24
#define Mtx_22 0x28
#define Mtx_23 0x2C

/******************************************************************************
*
* ROMtx
*
******************************************************************************/

#define ROMtx_00 0x0
#define ROMtx_01 0x4
#define ROMtx_02 0x8
#define ROMtx_10 0xC
#define ROMtx_11 0x10
#define ROMtx_12 0x14
#define ROMtx_20 0x18
#define ROMtx_21 0x1C
#define ROMtx_22 0x20
#define ROMtx_30 0x24
#define ROMtx_31 0x28
#define ROMtx_32 0x2C

/******************************************************************************
*
* General use
*
******************************************************************************/

#define DEG2RAD 0.017453292f
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we #include <math.h> and define this as (M_PI / 180.0f) does this still match?


/******************************************************************************
*
* Probably not defined here
*
******************************************************************************/

#define qr0 0
#define qr1 1
#define qr2 2
#define qr3 3
#define qr4 4
#define qr5 5
#define qr6 6
#define qr7 7

#endif
Loading
Loading