mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
portx64: changed pointers stored in u32 to uintptr_t
- adjusted hardcoded mask/hardcoded offsets used in memory operations (modelasm_c.c) - makefile: enabled x64 support and added lib dependency - title: increase alloc size - tex: adjustment to calculations involving GDL sizes
This commit is contained in:
1 parent
8c8109e8cd
commit
4dbbcbeb58
23 files changed
+117
-87
No files matched your search
+2
-6
@@ -86,12 +86,8 @@ endif
|
|||||||
|
|
||||||
# Set whether the target arch is 64- or 32-bit.
|
# Set whether the target arch is 64- or 32-bit.
|
||||||
ifneq (,$(findstring 64,$(TARGET_PLATFORM))$(findstring armv8,$(TARGET_PLATFORM)))
|
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
|
TARGET_64BIT = 1
|
||||||
else # TODO
|
else
|
||||||
TARGET_64BIT = 0
|
TARGET_64BIT = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -151,7 +147,7 @@ G_DIR := src/generated/$(ROMID)
|
|||||||
|
|
||||||
ifneq (,$(findstring windows,$(TARGET_PLATFORM)))
|
ifneq (,$(findstring windows,$(TARGET_PLATFORM)))
|
||||||
TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I)
|
TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I)
|
||||||
TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lz -lopengl32 -ldbghelp
|
TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lz -lopengl32 -ldbghelp -lws2_32
|
||||||
# on windows/mingw we need this to be built with a 32-bit compiler so it finds the correct libs
|
# 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-
|
||||||
# on GCC link libstdc++ statically
|
# on GCC link libstdc++ statically
|
||||||
|
|||||||
+33
-25
@@ -1596,7 +1596,11 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
typedef union {
|
typedef union {
|
||||||
Gwords words;
|
Gwords words;
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
u8 bytes[16];
|
||||||
|
#else
|
||||||
u8 bytes[8];
|
u8 bytes[8];
|
||||||
|
#endif
|
||||||
Gdma dma;
|
Gdma dma;
|
||||||
Gvtx vtx;
|
Gvtx vtx;
|
||||||
Gtri tri;
|
Gtri tri;
|
||||||
@@ -1619,7 +1623,11 @@ typedef union {
|
|||||||
Gloadtlut loadtlut;
|
Gloadtlut loadtlut;
|
||||||
#endif
|
#endif
|
||||||
GunkC0 unkc0;
|
GunkC0 unkc0;
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
__int128 force_structure_alignment;
|
||||||
|
#else
|
||||||
long long int force_structure_alignment;
|
long long int force_structure_alignment;
|
||||||
|
#endif
|
||||||
} Gfx;
|
} Gfx;
|
||||||
|
|
||||||
#ifdef PLATFORM_BIG_ENDIAN
|
#ifdef PLATFORM_BIG_ENDIAN
|
||||||
@@ -1642,12 +1650,12 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \
|
_g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \
|
||||||
_g->words.w1 = (unsigned int)(s); \
|
_g->words.w1 = (uintptr_t)(s); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDma0p(c, s, l) \
|
#define gsDma0p(c, s, l) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (unsigned int)(s) \
|
_SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (uintptr_t)(s) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gDma1p(pkt, c, s, l, p) \
|
#define gDma1p(pkt, c, s, l, p) \
|
||||||
@@ -1656,14 +1664,14 @@ typedef union {
|
|||||||
\
|
\
|
||||||
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
|
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
|
||||||
_SHIFTL((l), 0, 16)); \
|
_SHIFTL((l), 0, 16)); \
|
||||||
_g->words.w1 = (unsigned int)(s); \
|
_g->words.w1 = (uintptr_t)(s); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDma1p(c, s, l, p) \
|
#define gsDma1p(c, s, l, p) \
|
||||||
{ \
|
{ \
|
||||||
(_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
|
(_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
|
||||||
_SHIFTL((l), 0, 16)), \
|
_SHIFTL((l), 0, 16)), \
|
||||||
(uintptr_t)(s) \
|
(uintptr_t)(s) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gDma2p(pkt, c, adrs, len, idx, ofs) \
|
#define gDma2p(pkt, c, adrs, len, idx, ofs) \
|
||||||
@@ -1671,14 +1679,14 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
_g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
|
_g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
|
||||||
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \
|
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \
|
||||||
_g->words.w1 = (unsigned int)(adrs); \
|
_g->words.w1 = (uintptr_t)(adrs); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDma2p(c, adrs, len, idx, ofs) \
|
#define gsDma2p(c, adrs, len, idx, ofs) \
|
||||||
{ \
|
{ \
|
||||||
(_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
|
(_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
|
||||||
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \
|
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \
|
||||||
(unsigned int)(adrs) \
|
(uintptr_t)(adrs) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0)
|
#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0)
|
||||||
@@ -1727,12 +1735,12 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL((c), 24, 8); \
|
_g->words.w0 = _SHIFTL((c), 24, 8); \
|
||||||
_g->words.w1 = (unsigned int)(p0); \
|
_g->words.w1 = (uintptr_t)(p0); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsImmp1(c, p0) \
|
#define gsImmp1(c, p0) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL((c), 24, 8), (unsigned int)(p0) \
|
_SHIFTL((c), 24, 8), (uintptr_t)(p0) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gImmp2(pkt, c, p0, p1) \
|
#define gImmp2(pkt, c, p0, p1) \
|
||||||
@@ -1769,13 +1777,13 @@ typedef union {
|
|||||||
\
|
\
|
||||||
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \
|
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \
|
||||||
_SHIFTL((p1), 0, 8)); \
|
_SHIFTL((p1), 0, 8)); \
|
||||||
_g->words.w1 = (unsigned int) (dat); \
|
_g->words.w1 = (uintptr_t) (dat); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsImmp21(c, p0, p1, dat) \
|
#define gsImmp21(c, p0, p1, dat) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8), \
|
_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8), \
|
||||||
(unsigned int) (dat) \
|
(uintptr_t) (dat) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gMoveWd(pkt, index, offset, data) \
|
#define gMoveWd(pkt, index, offset, data) \
|
||||||
@@ -1918,7 +1926,7 @@ typedef union {
|
|||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \
|
_g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \
|
||||||
((0x0f & (vstart))*40); \
|
((0x0f & (vstart))*40); \
|
||||||
_g->words.w1 = (unsigned int)((0x0f & ((vend)+1))*40); \
|
_g->words.w1 = (uintptr_t)((0x0f & ((vend)+1))*40); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removed in PD
|
// Removed in PD
|
||||||
@@ -2239,12 +2247,12 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(G_SETGEOMETRYMODE, 24, 8); \
|
_g->words.w0 = _SHIFTL(G_SETGEOMETRYMODE, 24, 8); \
|
||||||
_g->words.w1 = (unsigned int)(word); \
|
_g->words.w1 = (uintptr_t)(word); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsSPSetGeometryMode(word) \
|
#define gsSPSetGeometryMode(word) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(G_SETGEOMETRYMODE, 24, 8), (unsigned int)(word) \
|
_SHIFTL(G_SETGEOMETRYMODE, 24, 8), (uintptr_t)(word) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gSPClearGeometryMode(pkt, word) \
|
#define gSPClearGeometryMode(pkt, word) \
|
||||||
@@ -2252,12 +2260,12 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8); \
|
_g->words.w0 = _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8); \
|
||||||
_g->words.w1 = (unsigned int)(word); \
|
_g->words.w1 = (uintptr_t)(word); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsSPClearGeometryMode(word) \
|
#define gsSPClearGeometryMode(word) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (unsigned int)(word) \
|
_SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (uintptr_t)(word) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gSPSetOtherMode(pkt, cmd, sft, len, data) \
|
#define gSPSetOtherMode(pkt, cmd, sft, len, data) \
|
||||||
@@ -2266,13 +2274,13 @@ typedef union {
|
|||||||
\
|
\
|
||||||
_g->words.w0 = (_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | \
|
_g->words.w0 = (_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | \
|
||||||
_SHIFTL(len, 0, 8)); \
|
_SHIFTL(len, 0, 8)); \
|
||||||
_g->words.w1 = (unsigned int)(data); \
|
_g->words.w1 = (uintptr_t)(data); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsSPSetOtherMode(cmd, sft, len, data) \
|
#define gsSPSetOtherMode(cmd, sft, len, data) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), \
|
_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), \
|
||||||
(unsigned int)(data) \
|
(uintptr_t)(data) \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2323,14 +2331,14 @@ typedef union {
|
|||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
|
_g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
|
||||||
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \
|
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \
|
||||||
_g->words.w1 = (unsigned int)(i); \
|
_g->words.w1 = (uintptr_t)(i); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsSetImage(cmd, fmt, siz, width, i) \
|
#define gsSetImage(cmd, fmt, siz, width, i) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
|
_SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
|
||||||
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \
|
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \
|
||||||
(unsigned int)(i) \
|
(uintptr_t)(i) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i)
|
#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i)
|
||||||
@@ -2356,13 +2364,13 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24); \
|
_g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24); \
|
||||||
_g->words.w1 = (unsigned int)(muxs1); \
|
_g->words.w1 = (uintptr_t)(muxs1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDPSetCombine(muxs0, muxs1) \
|
#define gsDPSetCombine(muxs0, muxs1) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \
|
_SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \
|
||||||
(unsigned int)(muxs1) \
|
(uintptr_t)(muxs1) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \
|
#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \
|
||||||
@@ -2435,12 +2443,12 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(c, 24, 8); \
|
_g->words.w0 = _SHIFTL(c, 24, 8); \
|
||||||
_g->words.w1 = (unsigned int)(d); \
|
_g->words.w1 = (uintptr_t)(d); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDPSetColor(c, d) \
|
#define gsDPSetColor(c, d) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(c, 24, 8), (unsigned int)(d) \
|
_SHIFTL(c, 24, 8), (uintptr_t)(d) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DPRGBColor(pkt, cmd, r, g, b, a) \
|
#define DPRGBColor(pkt, cmd, r, g, b, a) \
|
||||||
@@ -2521,13 +2529,13 @@ typedef union {
|
|||||||
Gfx *_g = (Gfx *)(pkt); \
|
Gfx *_g = (Gfx *)(pkt); \
|
||||||
\
|
\
|
||||||
_g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24); \
|
_g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24); \
|
||||||
_g->words.w1 = (unsigned int)(mode1); \
|
_g->words.w1 = (uintptr_t)(mode1); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define gsDPSetOtherMode(mode0, mode1) \
|
#define gsDPSetOtherMode(mode0, mode1) \
|
||||||
{ \
|
{ \
|
||||||
_SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24), \
|
_SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24), \
|
||||||
(unsigned int)(mode1) \
|
(uintptr_t)(mode1) \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+1
-1
@@ -570,7 +570,7 @@ void mainTick(void)
|
|||||||
viUpdateMode();
|
viUpdateMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
rdpCreateTask(gdlstart, gdl, 0, (s32) &msg);
|
rdpCreateTask(gdlstart, gdl, 0, (uintptr_t) &msg);
|
||||||
memaPrint();
|
memaPrint();
|
||||||
profileSetMarker(PROFILE_MAINTICK_END);
|
profileSetMarker(PROFILE_MAINTICK_END);
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-13
@@ -6489,9 +6489,9 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata->distance.visible = false;
|
rwdata->distance.visible = false;
|
||||||
node->child = rodata->distance.target;
|
node->child = rodata->distance.target;
|
||||||
ptr[0] = 0;
|
ptr[0] = 0;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr[2] = (s32)node;
|
ptr[2] = (uintptr_t)node;
|
||||||
ptr[3] = (s32)rodata->distance.target;
|
ptr[3] = (uintptr_t)rodata->distance.target;
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
len += 16;
|
len += 16;
|
||||||
break;
|
break;
|
||||||
@@ -6501,9 +6501,9 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata->toggle.visible = true;
|
rwdata->toggle.visible = true;
|
||||||
node->child = rodata->toggle.target;
|
node->child = rodata->toggle.target;
|
||||||
ptr[0] = 1;
|
ptr[0] = 1;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr[2] = (s32)node;
|
ptr[2] = (uintptr_t)node;
|
||||||
ptr[3] = (s32)rodata->toggle.target;
|
ptr[3] = (uintptr_t)rodata->toggle.target;
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
len += 16;
|
len += 16;
|
||||||
break;
|
break;
|
||||||
@@ -6512,7 +6512,7 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata->headspot.headmodeldef = NULL;
|
rwdata->headspot.headmodeldef = NULL;
|
||||||
rwdata->headspot.rwdatas = NULL;
|
rwdata->headspot.rwdatas = NULL;
|
||||||
ptr[0] = 2;
|
ptr[0] = 2;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
len += 8;
|
len += 8;
|
||||||
break;
|
break;
|
||||||
@@ -6520,7 +6520,7 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata = modelGetNodeRwData(model, node);
|
rwdata = modelGetNodeRwData(model, node);
|
||||||
rwdata->type0b.unk00 = 0;
|
rwdata->type0b.unk00 = 0;
|
||||||
ptr[0] = 3;
|
ptr[0] = 3;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
len += 8;
|
len += 8;
|
||||||
break;
|
break;
|
||||||
@@ -6528,7 +6528,7 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata = modelGetNodeRwData(model, node);
|
rwdata = modelGetNodeRwData(model, node);
|
||||||
rwdata->chrgunfire.visible = false;
|
rwdata->chrgunfire.visible = false;
|
||||||
ptr[0] = 4;
|
ptr[0] = 4;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
len += 8;
|
len += 8;
|
||||||
break;
|
break;
|
||||||
@@ -6539,10 +6539,10 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *nodearg, s32 *
|
|||||||
rwdata->dl.gdl = rodata->dl.opagdl;
|
rwdata->dl.gdl = rodata->dl.opagdl;
|
||||||
rwdata->dl.colours = (void *)ALIGN8((uintptr_t)&rodata->dl.vertices[rodata->dl.numvertices]);
|
rwdata->dl.colours = (void *)ALIGN8((uintptr_t)&rodata->dl.vertices[rodata->dl.numvertices]);
|
||||||
ptr[0] = 5;
|
ptr[0] = 5;
|
||||||
ptr[1] = (s32)rwdata;
|
ptr[1] = (uintptr_t)rwdata;
|
||||||
ptr[2] = (s32)rwdata->dl.vertices;
|
ptr[2] = (uintptr_t)rwdata->dl.vertices;
|
||||||
ptr[3] = (s32)rwdata->dl.gdl;
|
ptr[3] = (uintptr_t)rwdata->dl.gdl;
|
||||||
ptr[4] = (s32)rwdata->dl.colours;
|
ptr[4] = (uintptr_t)rwdata->dl.colours;
|
||||||
ptr += 5;
|
ptr += 5;
|
||||||
len += 20;
|
len += 20;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+15
-15
@@ -1844,7 +1844,7 @@ void setupCreateProps(s32 stagenum)
|
|||||||
truck->speedtime60 = -1;
|
truck->speedtime60 = -1;
|
||||||
truck->turnrot60 = 0;
|
truck->turnrot60 = 0;
|
||||||
truck->roty = 0;
|
truck->roty = 0;
|
||||||
truck->ailist = ailistFindById((u32)truck->ailist);
|
truck->ailist = ailistFindById((uintptr_t)truck->ailist);
|
||||||
truck->aioffset = 0;
|
truck->aioffset = 0;
|
||||||
truck->aireturnlist = -1;
|
truck->aireturnlist = -1;
|
||||||
truck->path = NULL;
|
truck->path = NULL;
|
||||||
@@ -1866,7 +1866,7 @@ void setupCreateProps(s32 stagenum)
|
|||||||
car->roty = 0;
|
car->roty = 0;
|
||||||
car->rotx = 0;
|
car->rotx = 0;
|
||||||
car->speedtime60 = -1;
|
car->speedtime60 = -1;
|
||||||
car->ailist = ailistFindById((s32)car->ailist);
|
car->ailist = ailistFindById((uintptr_t)car->ailist);
|
||||||
car->aioffset = 0;
|
car->aioffset = 0;
|
||||||
car->aireturnlist = -1;
|
car->aireturnlist = -1;
|
||||||
car->path = NULL;
|
car->path = NULL;
|
||||||
@@ -1895,7 +1895,7 @@ void setupCreateProps(s32 stagenum)
|
|||||||
chopper->gunrotx = 0;
|
chopper->gunrotx = 0;
|
||||||
chopper->barrelrot = 0;
|
chopper->barrelrot = 0;
|
||||||
chopper->barrelrotspeed = 0;
|
chopper->barrelrotspeed = 0;
|
||||||
chopper->ailist = ailistFindById((u32)chopper->ailist);
|
chopper->ailist = ailistFindById((uintptr_t)chopper->ailist);
|
||||||
chopper->aioffset = 0;
|
chopper->aioffset = 0;
|
||||||
chopper->aireturnlist = -1;
|
chopper->aireturnlist = -1;
|
||||||
chopper->path = NULL;
|
chopper->path = NULL;
|
||||||
@@ -1942,7 +1942,7 @@ void setupCreateProps(s32 stagenum)
|
|||||||
heli->yrot = 0;
|
heli->yrot = 0;
|
||||||
heli->speedtime60 = -1;
|
heli->speedtime60 = -1;
|
||||||
heli->rotoryspeedtime = -1;
|
heli->rotoryspeedtime = -1;
|
||||||
heli->ailist = ailistFindById((u32)heli->ailist);
|
heli->ailist = ailistFindById((uintptr_t)heli->ailist);
|
||||||
heli->aioffset = 0;
|
heli->aioffset = 0;
|
||||||
heli->aireturnlist = -1;
|
heli->aireturnlist = -1;
|
||||||
heli->path = NULL;
|
heli->path = NULL;
|
||||||
@@ -2131,8 +2131,8 @@ void setupCreateProps(s32 stagenum)
|
|||||||
case OBJTYPE_LINKLIFTDOOR:
|
case OBJTYPE_LINKLIFTDOOR:
|
||||||
{
|
{
|
||||||
struct linkliftdoorobj *link = (struct linkliftdoorobj *)obj;
|
struct linkliftdoorobj *link = (struct linkliftdoorobj *)obj;
|
||||||
s32 dooroffset = (s32)link->door;
|
uintptr_t dooroffset = (uintptr_t)link->door;
|
||||||
s32 liftoffset = (s32)link->lift;
|
uintptr_t liftoffset = (uintptr_t)link->lift;
|
||||||
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
||||||
struct defaultobj *lift = setupGetObjByCmdIndex(index + liftoffset);
|
struct defaultobj *lift = setupGetObjByCmdIndex(index + liftoffset);
|
||||||
|
|
||||||
@@ -2149,9 +2149,9 @@ void setupCreateProps(s32 stagenum)
|
|||||||
case OBJTYPE_SAFEITEM:
|
case OBJTYPE_SAFEITEM:
|
||||||
{
|
{
|
||||||
struct safeitemobj *link = (struct safeitemobj *)obj;
|
struct safeitemobj *link = (struct safeitemobj *)obj;
|
||||||
s32 itemoffset = (s32)link->item;
|
uintptr_t itemoffset = (uintptr_t)link->item;
|
||||||
s32 safeoffset = (s32)link->safe;
|
uintptr_t safeoffset = (uintptr_t)link->safe;
|
||||||
s32 dooroffset = (s32)link->door;
|
uintptr_t dooroffset = (uintptr_t)link->door;
|
||||||
struct defaultobj *item = setupGetObjByCmdIndex(index + itemoffset);
|
struct defaultobj *item = setupGetObjByCmdIndex(index + itemoffset);
|
||||||
struct defaultobj *safe = setupGetObjByCmdIndex(index + safeoffset);
|
struct defaultobj *safe = setupGetObjByCmdIndex(index + safeoffset);
|
||||||
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
||||||
@@ -2173,8 +2173,8 @@ void setupCreateProps(s32 stagenum)
|
|||||||
case OBJTYPE_PADLOCKEDDOOR:
|
case OBJTYPE_PADLOCKEDDOOR:
|
||||||
{
|
{
|
||||||
struct padlockeddoorobj *link = (struct padlockeddoorobj *)obj;
|
struct padlockeddoorobj *link = (struct padlockeddoorobj *)obj;
|
||||||
s32 dooroffset = (s32)link->door;
|
uintptr_t dooroffset = (uintptr_t)link->door;
|
||||||
s32 lockoffset = (s32)link->lock;
|
uintptr_t lockoffset = (uintptr_t)link->lock;
|
||||||
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
struct defaultobj *door = setupGetObjByCmdIndex(index + dooroffset);
|
||||||
struct defaultobj *lock = setupGetObjByCmdIndex(index + lockoffset);
|
struct defaultobj *lock = setupGetObjByCmdIndex(index + lockoffset);
|
||||||
|
|
||||||
@@ -2192,9 +2192,9 @@ void setupCreateProps(s32 stagenum)
|
|||||||
case OBJTYPE_CONDITIONALSCENERY:
|
case OBJTYPE_CONDITIONALSCENERY:
|
||||||
{
|
{
|
||||||
struct linksceneryobj *link = (struct linksceneryobj *)obj;
|
struct linksceneryobj *link = (struct linksceneryobj *)obj;
|
||||||
s32 triggeroffset = (s32)link->trigger;
|
uintptr_t triggeroffset = (uintptr_t)link->trigger;
|
||||||
s32 unexpoffset = (s32)link->unexp;
|
uintptr_t unexpoffset = (uintptr_t)link->unexp;
|
||||||
s32 expoffset = (s32)link->exp;
|
uintptr_t expoffset = (uintptr_t)link->exp;
|
||||||
struct defaultobj *trigger = setupGetObjByCmdIndex(index + triggeroffset);
|
struct defaultobj *trigger = setupGetObjByCmdIndex(index + triggeroffset);
|
||||||
struct defaultobj *unexp = NULL;
|
struct defaultobj *unexp = NULL;
|
||||||
struct defaultobj *exp = NULL;
|
struct defaultobj *exp = NULL;
|
||||||
@@ -2244,7 +2244,7 @@ void setupCreateProps(s32 stagenum)
|
|||||||
case OBJTYPE_BLOCKEDPATH:
|
case OBJTYPE_BLOCKEDPATH:
|
||||||
{
|
{
|
||||||
struct blockedpathobj *blockedpath = (struct blockedpathobj *)obj;
|
struct blockedpathobj *blockedpath = (struct blockedpathobj *)obj;
|
||||||
s32 objoffset = (s32)blockedpath->blocker;
|
uintptr_t objoffset = (uintptr_t)blockedpath->blocker;
|
||||||
struct defaultobj *blocker = setupGetObjByCmdIndex(index + objoffset);
|
struct defaultobj *blocker = setupGetObjByCmdIndex(index + objoffset);
|
||||||
|
|
||||||
if (blocker && blocker->prop) {
|
if (blocker && blocker->prop) {
|
||||||
|
|||||||
@@ -861,7 +861,11 @@ s32 texLoadFromGdl(Gfx *instart, s32 gdlsizeinbytes, Gfx *outstart, struct texpo
|
|||||||
ingdl = instart;
|
ingdl = instart;
|
||||||
outgdl = outstart;
|
outgdl = outstart;
|
||||||
|
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
numcmdsremaining = gdlsizeinbytes >> 4;
|
||||||
|
#else
|
||||||
numcmdsremaining = gdlsizeinbytes >> 3;
|
numcmdsremaining = gdlsizeinbytes >> 3;
|
||||||
|
#endif
|
||||||
|
|
||||||
texResetTiles();
|
texResetTiles();
|
||||||
|
|
||||||
@@ -1157,7 +1161,12 @@ s32 texLoadFromGdl(Gfx *instart, s32 gdlsizeinbytes, Gfx *outstart, struct texpo
|
|||||||
|
|
||||||
void texCopyGdls(Gfx *src, Gfx *dst, s32 count)
|
void texCopyGdls(Gfx *src, Gfx *dst, s32 count)
|
||||||
{
|
{
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
count = (count >> 4);
|
||||||
|
#else
|
||||||
count = (count >> 3);
|
count = (count >> 3);
|
||||||
|
#endif
|
||||||
|
|
||||||
src = src + (count - 1);
|
src = src + (count - 1);
|
||||||
dst = dst + (count - 1);
|
dst = dst + (count - 1);
|
||||||
|
|
||||||
|
|||||||
@@ -2269,7 +2269,7 @@ void texLoad(texnum_t *updateword, struct texpool *pool, bool unusedarg)
|
|||||||
// Copy the compressed texture to RAM
|
// Copy the compressed texture to RAM
|
||||||
dmaExec(alignedcompbuffer,
|
dmaExec(alignedcompbuffer,
|
||||||
(romptr_t) REF_SEG _texturesdataSegmentRomStart + (thisoffset & 0xfffffff8),
|
(romptr_t) REF_SEG _texturesdataSegmentRomStart + (thisoffset & 0xfffffff8),
|
||||||
((u32) (nextoffset - thisoffset) + 0x1f) >> 4 << 4);
|
((uintptr_t) (nextoffset - thisoffset) + 0x1f) >> 4 << 4);
|
||||||
compptr = (u8 *) alignedcompbuffer + (thisoffset & 7);
|
compptr = (u8 *) alignedcompbuffer + (thisoffset & 7);
|
||||||
}
|
}
|
||||||
thisoffset = 0;
|
thisoffset = 0;
|
||||||
|
|||||||
+1
-1
@@ -144,7 +144,7 @@ void texReset(void)
|
|||||||
g_BlurFbDirty = true;
|
g_BlurFbDirty = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_TexWords = mempAlloc(ALIGN16(g_TexNumConfigs * 4), MEMPOOL_STAGE);
|
g_TexWords = mempAlloc(ALIGN16(g_TexNumConfigs * sizeof(uintptr_t)), MEMPOOL_STAGE);
|
||||||
|
|
||||||
for (i = 0; i < g_TexNumConfigs; i++) {
|
for (i = 0; i < g_TexNumConfigs; i++) {
|
||||||
g_TexWords[i] = NULL;
|
g_TexWords[i] = NULL;
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ void texSelect(Gfx **gdlptr, struct textureconfig *tconfig, u32 arg2, s32 arg3,
|
|||||||
#ifdef __sgi
|
#ifdef __sgi
|
||||||
index = tconfig - g_TexWallhitConfigs;
|
index = tconfig - g_TexWallhitConfigs;
|
||||||
#else
|
#else
|
||||||
index = ((s32) tconfig - (s32) g_TexWallhitConfigs) / sizeof(struct textureconfig);
|
index = ((uintptr_t) tconfig - (uintptr_t) g_TexWallhitConfigs) / sizeof(struct textureconfig);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (index >= 0 && index < g_TexNumConfigs) {
|
if (index >= 0 && index < g_TexNumConfigs) {
|
||||||
|
|||||||
+4
-4
@@ -838,8 +838,8 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
|||||||
rwdata = modelGetNodeRwData(model, node2);
|
rwdata = modelGetNodeRwData(model, node2);
|
||||||
}
|
}
|
||||||
|
|
||||||
s1 = (Col *)ALIGN8(s5rodata->numvertices * sizeof(Vtx) + (s32)s5rodata->vertices);
|
s1 = (Col *)ALIGN8(s5rodata->numvertices * sizeof(Vtx) + (uintptr_t)s5rodata->vertices);
|
||||||
s2 = (Col *)ALIGN8(s1rodata->numvertices * (s32) sizeof(Vtx) + (s32)s1rodata->vertices);
|
s2 = (Col *)ALIGN8(s1rodata->numvertices * sizeof(Vtx) + (uintptr_t)s1rodata->vertices);
|
||||||
|
|
||||||
a3 = s5rodata->vertices;
|
a3 = s5rodata->vertices;
|
||||||
t0 = s1rodata->vertices;
|
t0 = s1rodata->vertices;
|
||||||
@@ -882,8 +882,8 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
|||||||
spfc[j].a = alpha2;
|
spfc[j].a = alpha2;
|
||||||
}
|
}
|
||||||
|
|
||||||
sp100 = (void *)ALIGN8(s5rodata->numvertices * sizeof(Vtx) + (s32)sp100);
|
sp100 = (void *)ALIGN8(s5rodata->numvertices * sizeof(Vtx) + (uintptr_t)sp100);
|
||||||
spfc = (void *)ALIGN8(s5rodata->numcolours * sizeof(u32) + (s32)spfc);
|
spfc = (void *)ALIGN8(s5rodata->numcolours * sizeof(u32) + (uintptr_t)spfc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -64,8 +64,8 @@ void vtxstoreFixRefs(void *find, void *replacement)
|
|||||||
case MODELNODETYPE_DL:
|
case MODELNODETYPE_DL:
|
||||||
rodata = &node->rodata->dl;
|
rodata = &node->rodata->dl;
|
||||||
|
|
||||||
if (model->rwdatas[rodata->rwdataindex] == (u32) find) {
|
if (model->rwdatas[rodata->rwdataindex] == (uintptr_t) find) {
|
||||||
model->rwdatas[rodata->rwdataindex] = (u32) replacement;
|
model->rwdatas[rodata->rwdataindex] = (uintptr_t) replacement;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MODELNODETYPE_DISTANCE:
|
case MODELNODETYPE_DISTANCE:
|
||||||
|
|||||||
+1
-1
@@ -250,7 +250,7 @@ extern struct seqchannel g_SeqChannels[3];
|
|||||||
extern u32 g_AudioXReasonsActive[4];
|
extern u32 g_AudioXReasonsActive[4];
|
||||||
extern s32 g_MusicXReasonMinDurations[4];
|
extern s32 g_MusicXReasonMinDurations[4];
|
||||||
extern s32 g_MusicXReasonMaxDurations[4];
|
extern s32 g_MusicXReasonMaxDurations[4];
|
||||||
extern u32 *g_LangBanks[69];
|
extern uintptr_t *g_LangBanks[69];
|
||||||
extern struct jpncharpixels *g_JpnCharCachePixels;
|
extern struct jpncharpixels *g_JpnCharCachePixels;
|
||||||
extern struct jpncacheitem *g_JpnCacheCacheItems;
|
extern struct jpncacheitem *g_JpnCacheCacheItems;
|
||||||
extern struct texture *g_Textures;
|
extern struct texture *g_Textures;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define TITLE_ALLOCSIZE 1024 * 286
|
#define TITLE_ALLOCSIZE 1024 * 332
|
||||||
|
|
||||||
extern u32 var800624d4;
|
extern u32 var800624d4;
|
||||||
extern u32 var800624d8;
|
extern u32 var800624d8;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void modelRenderNodeChrGunfire(struct modelrenderdata *renderdata, struct model
|
|||||||
void modelRender(struct modelrenderdata *renderdata, struct model *model);
|
void modelRender(struct modelrenderdata *renderdata, struct model *model);
|
||||||
bool modelTestBboxNodeForHit(struct modelrodata_bbox *bbox, Mtxf *mtx, struct coord *arg2, struct coord *arg3);
|
bool modelTestBboxNodeForHit(struct modelrodata_bbox *bbox, Mtxf *mtx, struct coord *arg2, struct coord *arg3);
|
||||||
s32 modelTestForHit(struct model *model, struct coord *arg1, struct coord *arg2, struct modelnode **startnode);
|
s32 modelTestForHit(struct model *model, struct coord *arg1, struct coord *arg2, struct modelnode **startnode);
|
||||||
void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, u32 fileramaddr);
|
void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, uintptr_t fileramaddr);
|
||||||
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 arg1, uintptr_t arg2);
|
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 arg1, uintptr_t arg2);
|
||||||
s32 modelCalculateRwDataIndexes(struct modelnode *node);
|
s32 modelCalculateRwDataIndexes(struct modelnode *node);
|
||||||
void modelAllocateRwData(struct modeldef *modeldef);
|
void modelAllocateRwData(struct modeldef *modeldef);
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void rdpInit(void);
|
void rdpInit(void);
|
||||||
void rdpCreateTask(Gfx *gdlstart, Gfx *gdlend, u32 arg2, s32 msg);
|
void rdpCreateTask(Gfx *gdlstart, Gfx *gdlend, u32 arg2, uintptr_t msg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+4
-4
@@ -2856,9 +2856,9 @@ struct cover {
|
|||||||
struct padsfileheader {
|
struct padsfileheader {
|
||||||
s32 numpads;
|
s32 numpads;
|
||||||
s32 numcovers;
|
s32 numcovers;
|
||||||
s32 waypointsoffset;
|
uintptr_t waypointsoffset;
|
||||||
s32 waygroupsoffset;
|
uintptr_t waygroupsoffset;
|
||||||
s32 coversoffset;
|
uintptr_t coversoffset;
|
||||||
u16 padoffsets[1];
|
u16 padoffsets[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5168,7 +5168,7 @@ struct shieldhit {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct bgroom {
|
struct bgroom {
|
||||||
u32 unk00;
|
uintptr_t unk00;
|
||||||
struct coord pos;
|
struct coord pos;
|
||||||
u8 br_light_min;
|
u8 br_light_min;
|
||||||
u8 br_light_max;
|
u8 br_light_max;
|
||||||
|
|||||||
+2
-2
@@ -181,8 +181,8 @@ void dmaExecHighPriority(void *memaddr, romptr_t romaddr, u32 len)
|
|||||||
*/
|
*/
|
||||||
void *dmaExecWithAutoAlign(void *memaddr, romptr_t romaddr, u32 len)
|
void *dmaExecWithAutoAlign(void *memaddr, romptr_t romaddr, u32 len)
|
||||||
{
|
{
|
||||||
u32 alignedrom = ALIGN2(romaddr);
|
uintptr_t alignedrom = ALIGN2(romaddr);
|
||||||
u32 alignedmem = ALIGN16((uintptr_t) memaddr);
|
uintptr_t alignedmem = ALIGN16((uintptr_t) memaddr);
|
||||||
u32 offset = romaddr - alignedrom; // 0 or 1
|
u32 offset = romaddr - alignedrom; // 0 or 1
|
||||||
u32 alignedlen = ALIGN16(offset + len);
|
u32 alignedlen = ALIGN16(offset + len);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -489,7 +489,7 @@ void mainInit(void)
|
|||||||
|
|
||||||
if (*(s16 *) receivedmsg == OS_SC_RETRACE_MSG) {
|
if (*(s16 *) receivedmsg == OS_SC_RETRACE_MSG) {
|
||||||
viUpdateMode();
|
viUpdateMode();
|
||||||
rdpCreateTask(var8005dcc8, var8005dcc8 + ARRAYCOUNT(var8005dcc8), 0, (s32) &scdonemsg);
|
rdpCreateTask(var8005dcc8, var8005dcc8 + ARRAYCOUNT(var8005dcc8), 0, (uintptr_t) &scdonemsg);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,7 +611,7 @@ void mainInit(void)
|
|||||||
|
|
||||||
if (*(s16 *) receivedmsg == OS_SC_RETRACE_MSG) {
|
if (*(s16 *) receivedmsg == OS_SC_RETRACE_MSG) {
|
||||||
viUpdateMode();
|
viUpdateMode();
|
||||||
rdpCreateTask(var8005dcc8, var8005dcc8 + ARRAYCOUNT(var8005dcc8), 0, (s32) &scdonemsg);
|
rdpCreateTask(var8005dcc8, var8005dcc8 + ARRAYCOUNT(var8005dcc8), 0, (uintptr_t) &scdonemsg);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1092,7 +1092,7 @@ void mainTick(void)
|
|||||||
viUpdateMode();
|
viUpdateMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
rdpCreateTask(gdlstart, gdl, 0, (s32) &msg);
|
rdpCreateTask(gdlstart, gdl, 0, (uintptr_t) &msg);
|
||||||
g_MainNumGfxTasks++;
|
g_MainNumGfxTasks++;
|
||||||
memaPrint();
|
memaPrint();
|
||||||
func0f16cf94();
|
func0f16cf94();
|
||||||
|
|||||||
+1
-1
@@ -400,7 +400,7 @@ void memaPrint(void)
|
|||||||
|
|
||||||
void *memaAlloc(u32 size)
|
void *memaAlloc(u32 size)
|
||||||
{
|
{
|
||||||
u32 addr;
|
uintptr_t addr;
|
||||||
u32 diff;
|
u32 diff;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -3853,10 +3853,10 @@ s32 modelTestForHit(struct model *model, struct coord *arg1, struct coord *arg2,
|
|||||||
if (var) \
|
if (var) \
|
||||||
var = (void *)((uintptr_t)var + diff)
|
var = (void *)((uintptr_t)var + diff)
|
||||||
|
|
||||||
void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, u32 fileramaddr)
|
void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, uintptr_t fileramaddr)
|
||||||
{
|
{
|
||||||
union modelrodata *rodata;
|
union modelrodata *rodata;
|
||||||
s32 diff = fileramaddr - vma;
|
uintptr_t diff = fileramaddr - vma;
|
||||||
|
|
||||||
while (node) {
|
while (node) {
|
||||||
u32 type = node->type & 0xff;
|
u32 type = node->type & 0xff;
|
||||||
@@ -3949,7 +3949,7 @@ void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, u32 file
|
|||||||
*/
|
*/
|
||||||
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 vma, uintptr_t fileramaddr)
|
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 vma, uintptr_t fileramaddr)
|
||||||
{
|
{
|
||||||
s32 diff = fileramaddr - vma;
|
uintptr_t diff = fileramaddr - vma;
|
||||||
s32 i;
|
s32 i;
|
||||||
s16 *partnums;
|
s16 *partnums;
|
||||||
|
|
||||||
|
|||||||
@@ -1158,6 +1158,18 @@ static u32 modelasmReadFrameData(void)
|
|||||||
* Each value is the byte offset into the rodata struct where that node type's
|
* Each value is the byte offset into the rodata struct where that node type's
|
||||||
* rwdataindex property can be found, or 0xff is there is none.
|
* rwdataindex property can be found, or 0xff is there is none.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
u8 var8005ef90[] = {
|
||||||
|
0xff, 0x08, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0xff,
|
||||||
|
0x10, 0x2a, 0xff, 0x48,
|
||||||
|
0x24, 0xff, 0xff, 0xff,
|
||||||
|
0xff, 0xff, 0x08, 0xff,
|
||||||
|
0xff, 0xff, 0xff, 0x00,
|
||||||
|
0x24, 0x00,
|
||||||
|
};
|
||||||
|
#else
|
||||||
u8 var8005ef90[] = {
|
u8 var8005ef90[] = {
|
||||||
0xff, 0x08, 0xff, 0xff,
|
0xff, 0x08, 0xff, 0xff,
|
||||||
0xff, 0xff, 0xff, 0xff,
|
0xff, 0xff, 0xff, 0xff,
|
||||||
@@ -1167,6 +1179,7 @@ u8 var8005ef90[] = {
|
|||||||
0xff, 0xff, 0xff, 0x00,
|
0xff, 0xff, 0xff, 0x00,
|
||||||
0x14, 0x00,
|
0x14, 0x00,
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static union modelrwdata *modelasmGetNodeRwData(struct model *model, struct modelnode *node, bool is_head)
|
static union modelrwdata *modelasmGetNodeRwData(struct model *model, struct modelnode *node, bool is_head)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ void rdpInit(void)
|
|||||||
g_RdpOutBufferEnd = (u16 *) ((uintptr_t) g_RdpOutBufferStart + size);
|
g_RdpOutBufferEnd = (u16 *) ((uintptr_t) g_RdpOutBufferStart + size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rdpCreateTask(Gfx *gdlstart, Gfx *gdlend, u32 arg2, s32 msg)
|
void rdpCreateTask(Gfx *gdlstart, Gfx *gdlend, u32 arg2, uintptr_t msg)
|
||||||
{
|
{
|
||||||
OSScTask *sctask;
|
OSScTask *sctask;
|
||||||
OSTask *task;
|
OSTask *task;
|
||||||
|
|||||||
@@ -220,7 +220,11 @@ void viReset(s32 stagenum)
|
|||||||
|
|
||||||
ptr = mempAlloc(fbsize * sizeof(u16) + 0x40, MEMPOOL_STAGE);
|
ptr = mempAlloc(fbsize * sizeof(u16) + 0x40, MEMPOOL_STAGE);
|
||||||
|
|
||||||
|
#ifdef PLATFORM_64BIT
|
||||||
|
ptr = (u8*)(((uintptr_t)ptr + 0x3f) & 0xffffffffffffffc0);
|
||||||
|
#else
|
||||||
ptr = (u8 *)(((uintptr_t) ptr + 0x3f) & 0xffffffc0);
|
ptr = (u8 *)(((uintptr_t) ptr + 0x3f) & 0xffffffc0);
|
||||||
|
#endif
|
||||||
|
|
||||||
g_FrameBuffers[0] = (u16 *) ptr;
|
g_FrameBuffers[0] = (u16 *) ptr;
|
||||||
g_FrameBuffers[1] = (u16 *) (fbsize + ptr);
|
g_FrameBuffers[1] = (u16 *) (fbsize + ptr);
|
||||||
|
|||||||
Reference in new issue
Block a user