diff --git a/Makefile.port b/Makefile.port index b8ebadb12..747548a78 100644 --- a/Makefile.port +++ b/Makefile.port @@ -36,7 +36,7 @@ ROMID ?= ntsc-final # # Supported values: -O0, -O1, -O2, -O3, -Os, -Og -GCC_OPT_LVL = -Og +GCC_OPT_LVL = -O0 # ROM_SIZE - The desired ROM size in megabytes. # @@ -86,12 +86,8 @@ endif # Set whether the target arch is 64- or 32-bit. ifneq (,$(findstring 64,$(TARGET_PLATFORM))$(findstring armv8,$(TARGET_PLATFORM))) - # TODO: we're not 64-bit compatible yet, error out if building the actual game - ifeq (,$(findstring clean,$(MAKECMDGOALS))) - $(error 64-bit target platforms are not supported yet) - endif TARGET_64BIT = 1 -else # TODO +else TARGET_64BIT = 0 endif @@ -137,6 +133,7 @@ DEFINES := \ PAL=$(IS_PAL) \ PIRACYCHECKS=0 \ ROM_SIZE=$(ROM_SIZE) \ + PLATFORM_64BIT=1 \ _LANGUAGE_C=1 ifeq ($(DEBUG),1) @@ -152,8 +149,12 @@ G_DIR := src/generated/$(ROMID) ifneq (,$(findstring windows,$(TARGET_PLATFORM))) TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I) TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lz -lopengl32 -static-libstdc++ -ldbghelp + ifeq (1,$(TARGET_64BIT)) + TOOLCHAIN ?= x86_64-w64-mingw32- + else # on windows/mingw we need this to be built with a 32-bit compiler so it finds the correct libs - TOOLCHAIN ?= i686-w64-mingw32- + TOOLCHAIN ?= i686-w64-mingw32- + endif else # assume *nix TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I) TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lGL -lz -ldl diff --git a/include/PR/gbi.h b/include/PR/gbi.h index d8fd26bf8..e36f15ec2 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -1538,8 +1538,8 @@ typedef struct { * Generic Gfx Packet */ typedef struct { - unsigned int w0; - unsigned int w1; + uintptr_t w0; + uintptr_t w1; } Gwords; // xxxxxxxx 11223344 44555566 66666777 @@ -1663,7 +1663,7 @@ typedef union { { \ (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ _SHIFTL((l), 0, 16)), \ - (unsigned int)(s) \ + (uintptr_t)(s) \ } #define gDma2p(pkt, c, adrs, len, idx, ofs) \ diff --git a/include/PR/os_pi.h b/include/PR/os_pi.h index 0c7459784..500ec916f 100644 --- a/include/PR/os_pi.h +++ b/include/PR/os_pi.h @@ -198,7 +198,7 @@ extern u32 osPiGetStatus(void); extern s32 osPiGetDeviceType(void); extern s32 osPiWriteIo(u32, u32); extern s32 osPiReadIo(u32, u32 *); -extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32, +extern s32 osPiStartDma(OSIoMesg *, s32, s32, uintptr_t, void *, u32, OSMesgQueue *); extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32); diff --git a/port/src/libultra.c b/port/src/libultra.c index 74edd9782..708f97bd5 100644 --- a/port/src/libultra.c +++ b/port/src/libultra.c @@ -433,7 +433,7 @@ void osInvalDCache(void *a, s32 b) } -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq) +s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, u32 nbytes, OSMesgQueue *mq) { memcpy(vAddr, (const void *)devAddr, nbytes); return 0; diff --git a/port/src/main.c b/port/src/main.c index 10150f7ae..f9af8ac1e 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -129,6 +129,7 @@ int main(int argc, const char **argv) sysLogPrintf(LOG_NOTE, "rom file at %p - %p", g_RomFile, g_RomFile + g_RomFileSize); g_SndDisabled = sysArgCheck("--no-sound"); + g_SndDisabled = true; g_StageNum = sysArgGetInt("--boot-stage", STAGE_TITLE); diff --git a/src/include/gunscript.h b/src/include/gunscript.h index 224c1dd7c..b3cd21870 100644 --- a/src/include/gunscript.h +++ b/src/include/gunscript.h @@ -17,10 +17,10 @@ { GUNCMD_PLAYSOUND, 0, keyframe, sound }, #define gunscript_include(unk1, address) \ - { GUNCMD_INCLUDE, unk1, 0, (u32)address }, + { GUNCMD_INCLUDE, unk1, 0, (uintptr_t)address }, #define gunscript_random(probability, address) \ - { GUNCMD_RANDOM, 0, probability, (u32)address }, + { GUNCMD_RANDOM, 0, probability, (uintptr_t)address }, #define gunscript_repeatuntilfull(triggerkey, dontloop, gototrigger) \ { GUNCMD_REPEATUNTILFULL, 0, triggerkey, (dontloop << 16) | gototrigger }, diff --git a/src/include/platform.h b/src/include/platform.h index 30615f750..949ff31a6 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -29,11 +29,6 @@ #error "Unknown CPU arch." #endif -// TODO: remove this after 64-bit support is in place -#ifdef PLATFORM_64BIT - #error "64-bit platforms are currently not supported." -#endif - // detect endianness #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ diff --git a/src/include/types.h b/src/include/types.h index 2a0491896..41ec678d3 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -5357,7 +5357,7 @@ struct guncmd { u8 type; u8 unk01; u16 unk02; - s32 unk04; + uintptr_t unk04; }; struct pakthing { diff --git a/src/lib/ultra/io/pidma.c b/src/lib/ultra/io/pidma.c index 75d758d1b..1fc7b61d7 100644 --- a/src/lib/ultra/io/pidma.c +++ b/src/lib/ultra/io/pidma.c @@ -1,7 +1,7 @@ #include #include "piint.h" -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *dramAddr, u32 size, OSMesgQueue *mq) +s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *dramAddr, u32 size, OSMesgQueue *mq) { register s32 ret;