portx64: fixes #4 - jpn/pal versions crashing on startup

This commit is contained in:
Raf committed 2024-08-12 18:56:49 +08:00
1 parent 077cc67b79
commit 5841fb9afa
4 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -377,7 +377,7 @@ s32 langGetFileId(s32 bank)
void langLoad(s32 bank)
{
#if VERSION >= VERSION_PAL_BETA
s32 len = fileGetInflatedSize(langGetFileId(bank), LOADTYPE_LANG);
s32 len = fileGetInflatedSize(langGetFileId(bank), FT_LANG);
if ((uintptr_t)g_LangBuffer + len + g_LangBufferSize - (uintptr_t)g_LangBufferPos >= 0) {
s32 len2 = (uintptr_t)g_LangBuffer + g_LangBufferSize - (uintptr_t)g_LangBufferPos;
+5
View File
@@ -6,6 +6,7 @@
#include "lib/memp.h"
#include "data.h"
#include "types.h"
#include "platform.h"
extern u8 *g_LangBuffer;
extern s32 g_LangBufferSize;
@@ -45,6 +46,10 @@ void langReset(s32 stagenum)
}
}
#ifdef PLATFORM_64BIT
size *= 2;
#endif
g_LangBuffer = mempAlloc(ALIGN16(size), MEMPOOL_STAGE);
g_LangBufferSize = size;
+2 -2
View File
@@ -69,10 +69,10 @@ u32 align16(u32 arg0)
return arg0;
}
u32 align32(u32 arg0)
uintptr_t align32(uintptr_t arg0)
{
if (arg0 & 0x1f) {
arg0 = (arg0 & 0xffffffe0) + 0x20;
arg0 = (arg0 & ((intptr_t)~0x1f)) + 0x20;
}
return arg0;
+1 -1
View File
@@ -7,7 +7,7 @@
void func0f176d70(s32 arg0);
u32 align4(u32 arg0);
u32 align16(u32 arg0);
u32 align32(u32 arg0);
uintptr_t align32(uintptr_t arg0);
void utilsInit(void);
void func0f1770ac(struct coord *a, struct coord *b, struct coord *out);
bool func0f177164(struct coord *arg0, struct coord *arg1, u32 line, char *file);