fix compilation

This commit is contained in:
Random06457 2022-06-04 16:59:41 +09:00 committed by KiritoDev
parent 51e58b9e13
commit 72fcd19a9e
7 changed files with 37 additions and 29 deletions

View File

@ -45,7 +45,7 @@ endif
# CXXFLAGS += -DTEXTURE_DEBUG
LDFLAGS := -lm -ldl -lpng \
-L../external -L../libultraship -lz -lbz2 -pthread -lpulse -lultraship -lstorm -lSDL2 -lGLEW -lGL -lX11
-L../StormLib/build -L../libultraship -lz -lbz2 -pthread -lpulse -lultraship -lstorm -lSDL2 -lGLEW -lGL -lX11
# Use LLD if available. Set LLD=0 to not use it
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)

View File

@ -461,8 +461,8 @@ char* OldMain(char* infilename)
else
{
char comprType[5] = {
CommChunk.compressionTypeH >> 8, CommChunk.compressionTypeH & 0xFF,
CommChunk.compressionTypeL >> 8, CommChunk.compressionTypeL & 0xFF, 0};
static_cast<char>(CommChunk.compressionTypeH >> 8), static_cast<char>(CommChunk.compressionTypeH & 0xFF),
static_cast<char>(CommChunk.compressionTypeL >> 8), static_cast<char>(CommChunk.compressionTypeL & 0xFF), 0};
fail_parse("file is of the wrong compression type [got %s (%08x)]", &comprType,
cType);
}
@ -603,8 +603,8 @@ char* OldMain(char* infilename)
{
s32 startPos = aloops[0].start, endPos = aloops[0].end;
const char* markerNames[2] = {"start", "end"};
Marker markers[2] = {{1, startPos >> 16, startPos & 0xffff},
{2, endPos >> 16, endPos & 0xffff}};
Marker markers[2] = {{1, static_cast<u16>(startPos >> 16), static_cast<u16>(startPos & 0xffff)},
{2, static_cast<u16>(endPos >> 16), static_cast<u16>(endPos & 0xffff)}};
write_header(ofile, "MARK", 2 + 2 * sizeof(Marker) + 1 + 5 + 1 + 3);
s16 numMarkers = bswap16(2);
fwrite(&numMarkers, sizeof(s16), 1, ofile);

View File

@ -18,8 +18,11 @@ WARN := -Wall -Wextra -Werror \
-Wno-narrowing \
-Wno-missing-field-initializers
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32
CWARN :=
CXXWARN := -Wno-deprecated-enum-enum-conversion
CXXFLAGS := $(WARN) $(CXXWARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0
CFLAGS := $(WARN) $(CWARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0
CPPFLAGS := -MMD
ifneq ($(DEBUG),0)
@ -40,10 +43,10 @@ endif
SRC_DIRS := $(shell find -type d -not -path "*build*")
CXX_FILES := \
$(shell find libultraship/Factories -name *.cpp) \
$(shell find libultraship/Lib/Fast3D -name *.cpp) \
$(shell find libultraship -maxdepth 1 -name *.cpp) \
$(shell find libultraship/Lib/ImGui -maxdepth 1 -name *.cpp) \
$(shell find libultraship/Factories -name "*.cpp") \
$(shell find libultraship/Lib/Fast3D -name *.cpp") \
$(shell find libultraship -maxdepth 1 -name "*.cpp") \
$(shell find libultraship/Lib/ImGui -maxdepth 1 -name "*.cpp") \
libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \
libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \
libultraship/Lib/StrHash64.cpp \
@ -53,7 +56,7 @@ C_FILES := \
libultraship/mixer.c \
libultraship/Lib/stb/stb_impl.c
FMT_FILES := $(shell find libultraship/ -type f \( -name *.cpp -o -name *.h \) -a -not -path "libultraship/Lib/*")
FMT_FILES := $(shell find libultraship/ -type f \( -name "*.cpp" -o -name "*.h" \) -a -not -path "libultraship/Lib/*")
O_FILES := \
$(CXX_FILES:%.cpp=build/%.o) \
@ -69,6 +72,7 @@ INC_DIRS := $(addprefix -I, \
libultraship/Lib/spdlog \
libultraship/Lib/spdlog/include \
libultraship \
../StormLib/src \
)
# create build directories

View File

@ -5,6 +5,7 @@
#include <stdint.h>
#include <unordered_map>
#include <list>
#include <cstddef>
#include "U64/PR/ultra64/types.h"

View File

@ -30,9 +30,9 @@ namespace Ship
Array = 0x4F415252, // OARR
Text = 0x4F545854, // OTXT
Blob = 0x4F424C42, // OBLB
Audio = 'OAUD',
AudioSample = 'OSMP',
AudioSoundFont = 'OSFT',
Audio = 0x4F415544, // OAUD
AudioSample = 0x4F534D50, // OSMP
AudioSoundFont = 0x4F534654, // OSFT
};
enum class DataType

View File

@ -16,11 +16,11 @@ LTO ?= 0
WARN := \
-Wno-return-type \
-funsigned-char \
-m32 -mhard-float -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv \
-mhard-float -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv \
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -no-pie -nostdlib -march=i386 -msse2 -mfpmath=sse
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -no-pie -nostdlib -march=i386 -msse2 -mfpmath=sse
LDFLAGS := -m32
CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -no-pie -nostdlib -msse2 -mfpmath=sse
CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -no-pie -nostdlib -msse2 -mfpmath=sse
LDFLAGS :=
CPPFLAGS := -MMD
ifneq ($(DEBUG),0)
@ -54,7 +54,7 @@ INC_DIRS := $(addprefix -I, \
)
LDDIRS := $(addprefix -L, \
../external \
../StormLib/build \
../libultraship/ \
)
@ -87,14 +87,14 @@ TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \
CXX_FILES := \
$(shell find soh -type f -name *.cpp)
$(shell find soh -type f -name "*.cpp")
C_FILES := \
$(shell find soh -type f -name *.c) \
$(shell find src/boot -type f -name *.c) \
$(shell find src/buffers -type f -name *.c) \
$(shell find src/code -type f -name *.c) \
$(shell find src/overlays -type f -name *.c) \
$(shell find soh -type f -name "*.c") \
$(shell find src/boot -type f -name "*.c") \
$(shell find src/buffers -type f -name "*.c") \
$(shell find src/code -type f -name "*.c") \
$(shell find src/overlays -type f -name "*.c") \
src/libultra/gu/coss.c \
src/libultra/gu/guLookAt.c \
src/libultra/gu/guLookAtHilite.c \
@ -125,6 +125,8 @@ setup:
$(MAKE) mpq
mpq:
cmake -B ../StormLib/build -S ../StormLib
cmake --build ../StormLib/build
$(MAKE) -C ../libultraship
$(MAKE) -C ../OTRExporter/OTRExporter
$(MAKE) -C ../ZAPDTR
@ -137,6 +139,7 @@ distclean: clean
$(MAKE) clean -C ../libultraship
$(MAKE) clean -C ../OTRExporter/OTRExporter
$(MAKE) clean -C ../ZAPDTR
rm -rf ../StormLib/build
clean:
rm -rf build $(TARGET)

View File

@ -51,9 +51,9 @@ s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, uintptr_t devAddr
OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType);
void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue);
AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, uintptr_t devAddr, uintptr_t ramAddr,
ptrdiff_t size, s32 medium,
size_t size, s32 medium,
s32 nChunks, OSMesgQueue* retQueue, s32 retMsg);
AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, uintptr_t ramAddr, size_t size, s32 medium, s32 nChunks,
AudioAsyncLoad* AudioLoad_StartAsyncLoad(uintptr_t devAddr, uintptr_t ramAddr, size_t size, s32 medium, s32 nChunks,
OSMesgQueue* retQueue, s32 retMsg);
void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, size_t size);
void AudioLoad_AsyncDmaUnkMedium(uintptr_t devAddr, uintptr_t ramAddr, size_t size, s16 arg3);
@ -1638,7 +1638,7 @@ void AudioLoad_InitAsyncLoads(void) {
}
}
AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, u32 devAddr, uintptr_t ramAddr, size_t size,
AudioAsyncLoad* AudioLoad_StartAsyncLoadUnkMedium(s32 unkMediumParam, uintptr_t devAddr, uintptr_t ramAddr, size_t size,
s32 medium,
s32 nChunks, OSMesgQueue* retQueue, s32 retMsg) {
AudioAsyncLoad* asyncLoad;