mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
port-64: first changes, able to build
This commit is contained in:
1 parent
474a6df3d4
commit
63c456a233
9 files changed
+18
-21
No files matched your search
+8
-7
@@ -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
|
||||
|
||||
+3
-3
@@ -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) \
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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__
|
||||
|
||||
+1
-1
@@ -5357,7 +5357,7 @@ struct guncmd {
|
||||
u8 type;
|
||||
u8 unk01;
|
||||
u16 unk02;
|
||||
s32 unk04;
|
||||
uintptr_t unk04;
|
||||
};
|
||||
|
||||
struct pakthing {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <os_internal.h>
|
||||
#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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user