Linux build fixes
This commit is contained in:
parent
236ce75a28
commit
525213367c
19 changed files with 62 additions and 33 deletions
|
|
@ -16,24 +16,20 @@ if (NOT CMAKE_BUILD_TYPE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -fsanitize=address -fsanitize-address-use-after-scope -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -fsanitize=address -fsanitize-address-use-after-scope")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -fsanitize=address -fsanitize-address-use-after-scope -Wno-register")
|
||||||
set(CMAKE_PREFIX_PATH /usr)
|
set(CMAKE_PREFIX_PATH /usr)
|
||||||
set(CMAKE_LIBRARY_ARCHITECTURE i386-linux-gnu)
|
set(CMAKE_LIBRARY_ARCHITECTURE i386-linux-gnu)
|
||||||
set(CMAKE_LIBRARY_PATH "/usr/lib32" CACHE PATH "")
|
set(CMAKE_LIBRARY_PATH "/usr/lib32" "/usr/lib/i386-linux-gnu" CACHE PATH "")
|
||||||
set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX 32)
|
set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX 32)
|
||||||
endif ()
|
elseif (APPLE)
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
add_compile_options(-Wno-declaration-after-statement)
|
add_compile_options(-Wno-declaration-after-statement)
|
||||||
|
elseif (MSVC)
|
||||||
|
add_compile_options(/bigobj)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_compile_options(-fsanitize=address)
|
add_compile_options(-fsanitize=address)
|
||||||
|
|
||||||
if (MSVC)
|
|
||||||
add_compile_options(/bigobj)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(extern/musyx EXCLUDE_FROM_ALL)
|
add_subdirectory(extern/musyx EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
@ -142,10 +138,10 @@ source_group("Port" FILES ${PORT_FILES})
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
foreach (file ${DOLPHIN_FILES})
|
foreach (file ${DOLPHIN_FILES})
|
||||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-std=c89 -Dinline=")
|
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-Dinline=")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
foreach (file ${GAME_FILES})
|
foreach (file ${GAME_FILES})
|
||||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-std=c89 -Dinline=")
|
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-Dinline=")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
@ -162,7 +158,8 @@ if (MSVC)
|
||||||
endif ()
|
endif ()
|
||||||
target_link_options(dol PRIVATE "/DEF:${CMAKE_SOURCE_DIR}/dol.def")
|
target_link_options(dol PRIVATE "/DEF:${CMAKE_SOURCE_DIR}/dol.def")
|
||||||
else ()
|
else ()
|
||||||
target_compile_options(dol PRIVATE "-fvisibility=default")
|
# target_compile_options(dol PRIVATE "-fvisibility=hidden")
|
||||||
|
# target_link_options(dol PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/dol.map")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_executable(marioparty4 src/port/portmain.c)
|
add_executable(marioparty4 src/port/portmain.c)
|
||||||
|
|
@ -184,6 +181,11 @@ foreach (dir ${REL_DIRS})
|
||||||
set_target_properties(${dir} PROPERTIES LINK_FLAGS "/EXPORT:ObjectSetup")
|
set_target_properties(${dir} PROPERTIES LINK_FLAGS "/EXPORT:ObjectSetup")
|
||||||
else ()
|
else ()
|
||||||
endif ()
|
endif ()
|
||||||
|
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||||
|
target_compile_options(${dir} PRIVATE "-fvisibility=hidden")
|
||||||
|
target_link_options(${dir} PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/rel.map")
|
||||||
|
set_target_properties(${dir} PROPERTIES PREFIX "")
|
||||||
|
endif ()
|
||||||
target_link_libraries(${dir} PRIVATE dol musyx)
|
target_link_libraries(${dir} PRIVATE dol musyx)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
||||||
2
extern/aurora
vendored
2
extern/aurora
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3b56e337c08a1dd4946c226298011364c319c7a2
|
Subproject commit a18cdf3b599b482c850096994cef09ba3920851b
|
||||||
2
extern/musyx
vendored
2
extern/musyx
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit a579f4d4abbac1c67fddf0d361291320f81a7b6c
|
Subproject commit 37e8ecd4e6503e90b97ea81cd7d669357861d501
|
||||||
|
|
@ -4,7 +4,9 @@
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "dolphin/mtx.h"
|
#include "dolphin/mtx.h"
|
||||||
|
|
||||||
|
#ifndef M_PI
|
||||||
#define M_PI 3.141592653589793
|
#define M_PI 3.141592653589793
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct vec2f {
|
typedef struct vec2f {
|
||||||
float x;
|
float x;
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,6 @@ s16 BoardBooCreate(s32 arg0, Vec *arg1);
|
||||||
void BoardBooKill(void);
|
void BoardBooKill(void);
|
||||||
s32 BoardBooStealTypeSet(s32 arg0);
|
s32 BoardBooStealTypeSet(s32 arg0);
|
||||||
s32 BoardBooStealMain(void);
|
s32 BoardBooStealMain(void);
|
||||||
BOOL CheckBallCoinDone(void);
|
|
||||||
void TakeBallStar(void);
|
|
||||||
void ExecTakeBallStar(omObjData *arg0);
|
|
||||||
BOOL CheckTakeBallStarDone(void);
|
|
||||||
s32 BoardBooStealValueGet(s16 *arg0, s16 *arg1);
|
s32 BoardBooStealValueGet(s16 *arg0, s16 *arg1);
|
||||||
BOOL BoardBooStealLightCheck(void);
|
BOOL BoardBooStealLightCheck(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ s32 HuDataReadChk(s32 data_num);
|
||||||
DataReadStat *HuDataGetStatus(void *dir_ptr);
|
DataReadStat *HuDataGetStatus(void *dir_ptr);
|
||||||
void *HuDataGetDirPtr(s32 data_num);
|
void *HuDataGetDirPtr(s32 data_num);
|
||||||
DataReadStat *HuDataDirRead(s32 data_num);
|
DataReadStat *HuDataDirRead(s32 data_num);
|
||||||
DataReadStat *HuDataDirReadNum(s32 data_num, s32 num);
|
|
||||||
DataReadStat *HuDataDirSet(void *dir_ptr, s32 data_num);
|
DataReadStat *HuDataDirSet(void *dir_ptr, s32 data_num);
|
||||||
void HuDataDirReadAsyncCallBack(s32 result, DVDFileInfo* fileInfo);
|
void HuDataDirReadAsyncCallBack(s32 result, DVDFileInfo* fileInfo);
|
||||||
s32 HuDataDirReadAsync(s32 data_num);
|
s32 HuDataDirReadAsync(s32 data_num);
|
||||||
|
|
|
||||||
6
rel.map
Normal file
6
rel.map
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
global:
|
||||||
|
ObjectSetup;
|
||||||
|
local:
|
||||||
|
*;
|
||||||
|
};
|
||||||
|
|
@ -1367,7 +1367,6 @@ void C_MTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count)
|
||||||
|
|
||||||
void C_MTXROMultVecArray(const ROMtx m, const Vec *srcBase, Vec *dstBase, u32 count)
|
void C_MTXROMultVecArray(const ROMtx m, const Vec *srcBase, Vec *dstBase, u32 count)
|
||||||
{
|
{
|
||||||
u32 i;
|
|
||||||
for (u32 i = 0; i < count; ++i) {
|
for (u32 i = 0; i < count; ++i) {
|
||||||
Vec* src = &srcBase[i];
|
Vec* src = &srcBase[i];
|
||||||
Vec* dst = &dstBase[i];
|
Vec* dst = &dstBase[i];
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ void OSStopStopwatch(struct OSStopwatch *sw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long long OSCheckStopwatch(struct OSStopwatch *sw)
|
OSTime OSCheckStopwatch(OSStopwatch *sw)
|
||||||
{
|
{
|
||||||
long long currTotal;
|
long long currTotal;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,11 @@ void *HuAR_ARAMtoMRAMNum(u32 src, s32 num) {
|
||||||
|
|
||||||
block = HuARInfoGet(src);
|
block = HuARInfoGet(src);
|
||||||
if (HuDataReadChk(block->dir << 16) >= 0) {
|
if (HuDataReadChk(block->dir << 16) >= 0) {
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
size = HuARSizeGet(src);
|
size = HuARSizeGet(src);
|
||||||
dst = HuMemDirectMallocNum(HEAP_DVD, size, num);
|
dst = HuMemDirectMallocNum(HEAP_DVD, size, num);
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,8 @@ typedef struct {
|
||||||
float unk04;
|
float unk04;
|
||||||
} BallTakeCoinWork;
|
} BallTakeCoinWork;
|
||||||
|
|
||||||
|
static BOOL CheckBallCoinDone(void);
|
||||||
|
static void TakeBallStar(void);
|
||||||
static void ComSetupStealPlayer(s32 arg0);
|
static void ComSetupStealPlayer(s32 arg0);
|
||||||
static void ComSetStealPlayerInput(s32 arg0, s32 arg1);
|
static void ComSetStealPlayerInput(s32 arg0, s32 arg1);
|
||||||
static void ExecCoinSteal(void);
|
static void ExecCoinSteal(void);
|
||||||
|
|
@ -131,8 +133,10 @@ static void BallBooAttack(omObjData *arg0, BallBooWork *arg1);
|
||||||
static void BallBooFlash(omObjData *arg0, BallBooWork *arg1);
|
static void BallBooFlash(omObjData *arg0, BallBooWork *arg1);
|
||||||
static void TakeBallCoin(void);
|
static void TakeBallCoin(void);
|
||||||
static void ExecTakeBallCoin(omObjData *arg0);
|
static void ExecTakeBallCoin(omObjData *arg0);
|
||||||
|
static void ExecTakeBallStar(omObjData *arg0);
|
||||||
static void TakeBallCoinPosSet(BallTakeCoinData *arg0, Vec *arg1);
|
static void TakeBallCoinPosSet(BallTakeCoinData *arg0, Vec *arg1);
|
||||||
static void UpdatePlayerCoins(void);
|
static void UpdatePlayerCoins(void);
|
||||||
|
static BOOL CheckTakeBallStarDone(void);
|
||||||
|
|
||||||
s8 lbl_801D41E2;
|
s8 lbl_801D41E2;
|
||||||
static s8 stealTarget;
|
static s8 stealTarget;
|
||||||
|
|
|
||||||
|
|
@ -729,9 +729,11 @@ s32 BoardPlayerSizeGet(s32 idx)
|
||||||
PlayerState *player;
|
PlayerState *player;
|
||||||
|
|
||||||
player = BoardPlayerGet(idx);
|
player = BoardPlayerGet(idx);
|
||||||
|
#ifndef NON_MATCHING
|
||||||
if (!player) {
|
if (!player) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return player->size;
|
return player->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2220,9 +2222,11 @@ s32 BoardPlayerAutoSizeGet(s32 arg0)
|
||||||
PlayerState *player;
|
PlayerState *player;
|
||||||
|
|
||||||
player = BoardPlayerGet(arg0);
|
player = BoardPlayerGet(arg0);
|
||||||
|
#ifndef NON_MATCHING
|
||||||
if (!player) {
|
if (!player) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return player->auto_size;
|
return player->auto_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -685,13 +685,14 @@ static void UpdateCharAnim(s16 character, s16 arg1, s16 arg2, u8 arg3, s16 arg4,
|
||||||
|
|
||||||
static s32 PlayCharVoice(s16 character, s16 arg1, u8 arg2)
|
static s32 PlayCharVoice(s16 character, s16 arg1, u8 arg2)
|
||||||
{
|
{
|
||||||
UnkCharInstanceStruct *temp_r31;
|
UnkCharInstanceStruct *temp_r31 = &charInstance[character];
|
||||||
ModelData *temp_r29;
|
ModelData *temp_r29 = &Hu3DData[temp_r31->unk00];
|
||||||
|
|
||||||
temp_r31 = &charInstance[character];
|
|
||||||
temp_r29 = &Hu3DData[temp_r31->unk00];
|
|
||||||
if (arg2 & 1) {
|
if (arg2 & 1) {
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (temp_r31->unkAC & 8) {
|
if (temp_r31->unkAC & 8) {
|
||||||
return HuAudCharVoicePlayPos(character, arg1, &temp_r29->pos);
|
return HuAudCharVoicePlayPos(character, arg1, &temp_r29->pos);
|
||||||
|
|
@ -1973,7 +1974,11 @@ static s32 PlayStepFX(s16 character, s16 arg1, u8 arg2)
|
||||||
temp_r31 = &charInstance[character];
|
temp_r31 = &charInstance[character];
|
||||||
var_r28 = &Hu3DData[temp_r31->unk00];
|
var_r28 = &Hu3DData[temp_r31->unk00];
|
||||||
if (arg2 & 1) {
|
if (arg2 & 1) {
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (temp_r31->unkB0 == 4) {
|
if (temp_r31->unkB0 == 4) {
|
||||||
arg1 = 0x109;
|
arg1 = 0x109;
|
||||||
|
|
|
||||||
|
|
@ -1828,7 +1828,11 @@ static s32 LoadTexture(ModelData *arg0, HsfBitmap *arg1, HsfAttribute *arg2, s16
|
||||||
|
|
||||||
if (arg1 == 0) {
|
if (arg1 == 0) {
|
||||||
OSReport("Error: No Texture\n");
|
OSReport("Error: No Texture\n");
|
||||||
|
#ifdef NON_MATCHING
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
var_r27 = arg1->sizeX;
|
var_r27 = arg1->sizeX;
|
||||||
var_r26 = arg1->sizeY;
|
var_r26 = arg1->sizeY;
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ void omDestroyObjMan(void)
|
||||||
OSReport("objman>Destory ObjMan\n");
|
OSReport("objman>Destory ObjMan\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, void (*func)(omObjData *))
|
omObjData *omAddObjEx(Process *objman_process, s16 prio, u16 mdlcnt, u16 mtncnt, s16 group, omObjFunc func)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
omObjData *object;
|
omObjData *object;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
#include "game/dvd.h"
|
#include "game/dvd.h"
|
||||||
#include "game/object.h"
|
#include "game/object.h"
|
||||||
|
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define OVL_DEFINE(name, path) { path ".dll", 0 },
|
#define OVL_DEFINE(name, path) { path ".dll", 0 },
|
||||||
#else
|
#else
|
||||||
|
#define OVL_DEFINE(name, path) { path ".so", 0 },
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#define OVL_DEFINE(name, path) { "dll/" path ".rel", 0 },
|
#define OVL_DEFINE(name, path) { "dll/" path ".rel", 0 },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <dolphin.h>
|
#include <dolphin.h>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
|
|
@ -36,7 +37,7 @@ static u64 GetGCTicks()
|
||||||
struct timespec tp;
|
struct timespec tp;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &tp);
|
clock_gettime(CLOCK_MONOTONIC, &tp);
|
||||||
|
|
||||||
return u64((tp.tv_sec * 1000000000ull) + tp.tv_nsec) * GetGCTicksPerSec() / 1000000000ull;
|
return ((tp.tv_sec * 1000000000ull) + tp.tv_nsec) * OS_CORE_CLOCK / 1000000000ull;
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
LARGE_INTEGER perf;
|
LARGE_INTEGER perf;
|
||||||
QueryPerformanceCounter(&perf);
|
QueryPerformanceCounter(&perf);
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,6 @@ void HuAudFXListnerKill(void) {
|
||||||
|
|
||||||
void HuAudFXPauseAll(s32 pause) {
|
void HuAudFXPauseAll(s32 pause) {
|
||||||
// msmSePauseAll(pause, 0x64);
|
// msmSePauseAll(pause, 0x64);
|
||||||
return 12;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 HuAudFXStatusGet(int seNo) {
|
s32 HuAudFXStatusGet(int seNo) {
|
||||||
|
|
|
||||||
|
|
@ -751,6 +751,3 @@ s32 HuTHPTotalFrameGet(void)
|
||||||
void HuTHPSetVolume(s32 left, s32 right)
|
void HuTHPSetVolume(s32 left, s32 right)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove
|
|
||||||
u8 fadeStat = 0;
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue