Files
perfect_dark/src/game/langinit.c
T
fgsfds d6854c412c port: allow building with pal-final and jpn-final
this will produce a separate executable that will load pd.pal-final.z64 or pd.jpn-final.z64, respectively

japanese characters are broken in jpn and pal crashes when you try to select language, so no autobuilds yet
2023-09-04 21:06:10 +02:00

45 lines
1.2 KiB
C

#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "lib/memp.h"
#include "data.h"
#include "types.h"
u16 *g_FrameBuffers[NUM_FRAMEBUFFERS];
#ifndef PLATFORM_N64
#if VERSION >= VERSION_JPN_FINAL
u32 var8009d010pf[4];
s32 g_JpnMaxCacheItems;
#elif VERSION >= VERSION_PAL_BETA
u32 var8009d010pf[4];
#endif
#endif
void langInit(void)
{
s32 i;
#if VERSION >= VERSION_JPN_FINAL
g_JpnMaxCacheItems = IS4MB() ? 124 : 174;
g_JpnCharCachePixels = mempAlloc(MAX_JPN_CACHE_ITEMS() * (sizeof(struct jpncharpixels) * 8), MEMPOOL_PERMANENT);
g_JpnCacheCacheItems = mempAlloc(ALIGN16(MAX_JPN_CACHE_ITEMS() * sizeof(struct jpncacheitem)), MEMPOOL_PERMANENT);
for (i = 0; i < MAX_JPN_CACHE_ITEMS(); i++) {
g_JpnCacheCacheItems[i].ttl = 0;
g_JpnCacheCacheItems[i].codepoint = -1;
}
#else
if (g_Jpn) {
g_JpnCharCachePixels = mempAlloc(MAX_JPN_CACHE_ITEMS() * (sizeof(struct jpncharpixels) * 8), MEMPOOL_PERMANENT);
g_JpnCacheCacheItems = mempAlloc(ALIGN16(MAX_JPN_CACHE_ITEMS() * sizeof(struct jpncacheitem)), MEMPOOL_PERMANENT);
for (i = 0; i < MAX_JPN_CACHE_ITEMS(); i++) {
g_JpnCacheCacheItems[i].ttl = 0;
g_JpnCacheCacheItems[i].codepoint = -1;
}
}
#endif
}