Skip to content

Commit

Permalink
Fix debug mode build
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Oct 19, 2024
1 parent 55ad93a commit da6648d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
if args.debug:
# Or -sym dwarf-2 for Wii compilers
cflags_base.extend(["-sym on", "-DDEBUG=1"])
cflags_base.extend(['-pragma "dont_inline on"'])
else:
cflags_base.append("-DNDEBUG=1")
if args.warn == "all":
Expand Down
22 changes: 19 additions & 3 deletions include/dolphin/mtx/mtx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MTX_H
#define MTX_H

#include "dolphin/mtx/mtx44.h"
#include "dolphin/mtx/mtx44.h" // IWYU pragma: export
#include "dolphin/mtx/quat.h"
#include "dolphin/types.h"

Expand Down Expand Up @@ -45,7 +45,8 @@ inline void C_MTXRotAxisRad(Mtx m, const Vec* axis, f32 rad) {

/* When compiling in debug mode, use C implementations */
#ifdef DEBUG
#define MTXIdentity C_MTXIdentity
// TODO: Add debug rom C implementations
/* #define MTXIdentity C_MTXIdentity
#define MTXCopy C_MTXCopy
#define MTXConcat C_MTXConcat
#define MTXInverse C_MTXInverse
Expand All @@ -56,7 +57,22 @@ inline void C_MTXRotAxisRad(Mtx m, const Vec* axis, f32 rad) {
#define MTXTransApply C_MTXTransApply
#define MTXScale C_MTXScale
#define MTXScaleApply C_MTXScaleApply
#define MTXQuat C_MTXQuat
#define MTXQuat C_MTXQuat */

// Temporary until the C implementations are done
#define MTXIdentity PSMTXIdentity
#define MTXCopy PSMTXCopy
#define MTXConcat PSMTXConcat
#define MTXInverse PSMTXInverse
#define MTXRotRad PSMTXRotRad
#define MTXRotTrig PSMTXRotTrig
#define MTXRotAxisRad PSMTXRotAxisRad
#define MTXTrans PSMTXTrans
#define MTXTransApply PSMTXTransApply
#define MTXScale PSMTXScale
#define MTXScaleApply PSMTXScaleApply
#define MTXQuat PSMTXQuat

#else
#define MTXIdentity PSMTXIdentity
#define MTXCopy PSMTXCopy
Expand Down
12 changes: 10 additions & 2 deletions include/dolphin/mtx/mtxvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 coun

/* When compiling in debug mode, use C implementations */
#ifdef DEBUG
#define MTXMultVec C_MTXMultVec
// TODO: Add debug rom C implementations
/* #define MTXMultVec C_MTXMultVec
#define MTXMultVecSR C_MTXMultVecSR
#define MTXMultVecArray C_MTXMultVecArray
#define MTXMultVecArraySR C_MTXMultVecArraySR
#define MTXMultVecArraySR C_MTXMultVecArraySR */

// Temporary until the C implementations are done
#define MTXMultVec PSMTXMultVec
#define MTXMultVecSR PSMTXMultVecSR
#define MTXMultVecArray PSMTXMultVecArray
#define MTXMultVecArraySR PSMTXMultVecArraySR

#else
#define MTXMultVec PSMTXMultVec
#define MTXMultVecSR PSMTXMultVecSR
Expand Down
7 changes: 6 additions & 1 deletion include/dolphin/mtx/quat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ void C_QUATSlerp(const Quaternion* p, const Quaternion* q, Quaternion* r, f32 t)

/* When compiling in debug mode, use C implementations */
#ifdef DEBUG
#define QUATMultiply C_QUATMultiply
// TODO: Add debug rom C implementations
/* #define QUATMultiply C_QUATMultiply */

// Temporary until the C implementations are done
#define QUATMultiply PSQUATMultiply

#else
#define QUATMultiply PSQUATMultiply
#endif
Expand Down

0 comments on commit da6648d

Please sign in to comment.