get dusk past compilation and into linking

This commit is contained in:
kipcode66
2026-01-15 19:24:39 -05:00
parent dd67314902
commit b1e20051ce
17 changed files with 127 additions and 5 deletions
+6 -5
View File
@@ -9,8 +9,8 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-register -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter -fPIC -Wno-error -Wno-c++11-narrowing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wno-register -fPIC -Wno-error -Wno-c++11-narrowing")
set(CMAKE_PREFIX_PATH /usr)
set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu)
set(CMAKE_LIBRARY_PATH "/usr/lib64" "/usr/lib/x86_64-linux-gnu" CACHE PATH "")
@@ -1337,8 +1337,9 @@ set(REL_FILES
)
set(DUSK_FILES
src/dusk/imgui.cpp
src/dusk/stubs.c
#src/dusk/imgui.cpp
#src/dusk/stubs.c
src/dusk/extras.c
)
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${JSYSTEM_FILES} ${REL_FILES})
@@ -1348,7 +1349,7 @@ add_library(game SHARED ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${SSYSTEM_FILES} ${J
target_compile_definitions(game PRIVATE TARGET_PC VERSION=0 NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0)
# TODO: version handling for res includes
set(DUSK_TP_VERSION GZ2E01)
target_include_directories(game PRIVATE include src assets/${DUSK_TP_VERSION} ${CMAKE_BINARY_DIR}/../${DUSK_TP_VERSION}/include src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Include)
target_include_directories(game PRIVATE include src assets/${DUSK_TP_VERSION} ${CMAKE_BINARY_DIR}/../${DUSK_TP_VERSION}/include)
target_link_libraries(game PRIVATE aurora::core aurora::gx aurora::si aurora::vi aurora::pad)
add_executable(dusk src/dusk/main.cpp)
@@ -5,6 +5,9 @@
#include <cmath>
#define m_PI_D 3.141592653589793
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
namespace JStudio {
namespace math {
+4
View File
@@ -7,4 +7,8 @@
#include "d/dolzel.pch"
#endif
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
#endif // dolzel.h
+15
View File
@@ -0,0 +1,15 @@
#ifndef _SRC_EXTRAS_H_
#define _SRC_EXTRAS_H_
#ifdef __cplusplus
extern "C" {
#endif
int strnicmp(const char* str1, const char* str2, int n);
int stricmp(const char* str1, const char* str2);
#ifdef __cplusplus
}
#endif
#endif // _SRC_EXTRAS_H_
+17
View File
@@ -0,0 +1,17 @@
#ifndef _SRC_DUSK_MATH_H_
#define _SRC_DUSK_MATH_H_
#include <cmath>
#define M_PI 3.14159265358979323846f
#define M_SQRT3 1.73205f
#define DEG_TO_RAD(degrees) (degrees * (M_PI / 180.0f))
#define RAD_TO_DEG(radians) (radians * (180.0f / M_PI))
inline float i_sinf(float x) { return sin(x); }
inline float i_cosf(float x) { return cos(x); }
inline float i_tanf(float x) { return tan(x); }
inline float i_acosf(float x) { return acos(x); }
#endif // _SRC_DUSK_MATH_H_
+3
View File
@@ -6,6 +6,9 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JSupport/JSURandomInputStream.h"
#include "JSystem/JUtility/JUTResource.h"
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
J2DPane::J2DPane() : mBounds(), mGlobalBounds(), mClipRect(), mPaneTree(this) {
mTransform = NULL;
+4
View File
@@ -6,7 +6,11 @@
#include "JSystem/J2DGraph/J2DTevs.h"
#include "JSystem/J2DGraph/J2DMaterial.h"
#ifdef __MWERKS__
#include <cmath>
#else
#include "dusk/math.h"
#endif
#include "dolphin/gx.h"
void J2DTexMtx::load(u32 mtxIdx) {
+3
View File
@@ -9,6 +9,9 @@
#include "JSystem/JAudio2/JASMutex.h"
#include "JSystem/JKernel/JKRHeap.h"
#include <cstdio>
#ifndef __MWERKS__
#include <cstdarg>
#endif
static OSMutex sMutex;
+3
View File
@@ -1,6 +1,9 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JKernel/JKRAssertHeap.h"
#ifndef __MWERKS__
#include <new>
#endif
JKRAssertHeap::JKRAssertHeap(void* data, u32 size, JKRHeap* parent, bool errorFlag)
: JKRHeap(data, size, parent, errorFlag) {}
+3
View File
@@ -5,6 +5,9 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTVideo.h"
#include <cstdio>
#ifndef __MWERKS__
#include <cstdarg>
#endif
JUTDbPrint::JUTDbPrint(JUTFont* pFont, JKRHeap* pHeap) {
mFont = pFont;
@@ -2,6 +2,7 @@
#define MSL_CMATH_H_
#include <float.h>
//#include <cmath>
#define NAN (*(float*) __float_nan)
#define HUGE_VALF (*(float*) __float_huge)
+4
View File
@@ -14,6 +14,10 @@
#include "dolphin/gf/GFLight.h"
#include "m_Do/m_Do_lib.h"
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
static BOOL daMirror_c_createHeap(fopAc_ac_c* i_this) {
return ((daMirror_c*)i_this)->createHeap();
}
+4
View File
@@ -12,6 +12,10 @@
#include "d/d_cc_d.h"
#include "d/d_cc_uty.h"
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
#if DEBUG
class daObjLv4Chan_HIO_c : public mDoHIO_entry_c {
public:
+4
View File
@@ -25,6 +25,10 @@
#include "d/actor/d_a_player.h"
#include "SSystem/SComponent/c_math.h"
#ifndef __MWERKS__
#include "dusk/math.h"
#endif
#if DEBUG
//#pragma nosyminline on
#endif
+5
View File
@@ -16,6 +16,11 @@
#include "m_Do/m_Do_graphic.h"
#include <cstdio>
#ifndef __MWERKS__
#include <string>
#include "dusk/extras.h"
#endif
dRes_info_c::dRes_info_c() {
mCount = 0;
mDMCommand = NULL;
+3
View File
@@ -11,6 +11,9 @@
#include "d/d_s_room.h"
#include "m_Do/m_Do_Reset.h"
#include <cstdio>
#ifndef __MWERKS__
#include "dusk/extras.h"
#endif
static int dScnRoom_Draw(room_of_scene_class* i_this) {
return 1;
+45
View File
@@ -0,0 +1,45 @@
#include "dusk/extras.h"
#include <ctype.h>
int stricmp(const char* str1, const char* str2) {
char a_var;
char b_var;
do {
b_var = tolower(*str1++);
a_var = tolower(*str2++);
if (b_var < a_var) {
return -1;
}
if (b_var > a_var) {
return 1;
}
} while (b_var != 0);
return 0;
}
int strnicmp(const char* str1, const char* str2, int n) {
int i;
char c1, c2;
for (i = 0; i < n; i++) {
c1 = tolower(*str1++);
c2 = tolower(*str2++);
if (c1 < c2) {
return -1;
}
if (c1 > c2) {
return 1;
}
if (c1 == '\0') {
return 0;
}
}
return 0;
}