mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
portx64: pd-extract,preprocess: renamed "_x64" functions, removed now unused preprocess functions, increased snd heap size (x86)
This commit is contained in:
1 parent
9e34f80a2c
commit
8b1e81f32a
15 files changed
+27
-1355
No files matched your search
@@ -22,3 +22,4 @@ src/assets/*/textures/*.bin
|
||||
src/generated
|
||||
tools/mkrom/mkrom
|
||||
/.vs
|
||||
CppProperties.json
|
||||
@@ -28,13 +28,4 @@ u8 *preprocessSetupFile(u8 *data, u32 size, u32 *outSize);
|
||||
u8 *preprocessModelFile(u8 *data, u32 size, u32 *outSize);
|
||||
u8 *preprocessGunFile(u8 *data, u32 size, u32 *outSize);
|
||||
|
||||
// these are in pdextract
|
||||
u8 *preprocessFont_x64(u8*, u32, u32*);
|
||||
u8 *preprocessALBankFile_x64(u8*, u32, u32*);
|
||||
u8 *preprocessModelFile_x64(u8*, u32, u32*);
|
||||
u8 *preprocessTilesFile_x64(u8*, u32, u32*);
|
||||
u8 *preprocessSetupFile_x64(u8*, u32, u32*);
|
||||
u8 *preprocessPadsFile_x64(u8*, u32, u32*);
|
||||
u8 *preprocessLangFile_x64(u8*, u32, u32*);
|
||||
|
||||
#endif
|
||||
@@ -416,7 +416,7 @@ static int convert_audio_bankfile(u8 *dst, u8 *src)
|
||||
return dstpos;
|
||||
}
|
||||
|
||||
u8 *preprocessALBankFile_x64(u8 *src, u32 size, u32 *outSize)
|
||||
u8 *preprocessALBankFile(u8 *src, u32 size, u32 *outSize)
|
||||
{
|
||||
reset_markers();
|
||||
u32 dstlen = size * 3;
|
||||
|
||||
@@ -564,7 +564,6 @@ static void convert_section3_lightcounts(u8 *dst, u32 *dstpos, u8 *src, u32 *src
|
||||
*dstpos += (m_NumRooms - 1);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_64BIT
|
||||
void preprocessBgSection1(u8 *data, u32 size, u32 ofs)
|
||||
{
|
||||
u8 *dst = sysMemZeroAlloc(size);
|
||||
@@ -596,4 +595,3 @@ u32 preprocessBgRoom(u8 *data, u32 size, u32 room_ofs)
|
||||
|
||||
return newSize;
|
||||
}
|
||||
#endif
|
||||
@@ -75,7 +75,7 @@ u32 convert_lang_file(u8 *dst, u8 *src, size_t srclen)
|
||||
return ALIGN16(cur_dst_offset);
|
||||
}
|
||||
|
||||
u8 *preprocessLangFile_x64(u8 *data, u32 size, u32 *outSize) {
|
||||
u8 *preprocessLangFile(u8 *data, u32 size, u32 *outSize) {
|
||||
u32 newSizeEstimated = romdataGetEstimatedFileSize(size, FT_LANG);
|
||||
u8 *dst = sysMemZeroAlloc(newSizeEstimated);
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ static int convert_pads_file(u8 *dst, u8 *src)
|
||||
return dstpos;
|
||||
}
|
||||
|
||||
u8* preprocessPadsFile_x64(u8 *data, u32 size, u32 *outSize) {
|
||||
u8* preprocessPadsFile(u8 *data, u32 size, u32 *outSize) {
|
||||
u32 newSizeEstimated = romdataGetEstimatedFileSize(size, FT_PADS);
|
||||
u8* dst = sysMemZeroAlloc(newSizeEstimated);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ u32 convert_tiles(u8 *dst, u8 *src, size_t srclen)
|
||||
return ALIGN16(cur_dst_offset);
|
||||
}
|
||||
|
||||
u8 *preprocessTilesFile_x64(u8 *data, u32 size, u32 *outSize)
|
||||
u8 *preprocessTilesFile(u8 *data, u32 size, u32 *outSize)
|
||||
{
|
||||
u32 newSizeEstimated = romdataGetEstimatedFileSize(size, FT_TILES);
|
||||
u8 *dst = sysMemZeroAlloc(newSizeEstimated);
|
||||
|
||||
@@ -48,7 +48,7 @@ struct fontdef {
|
||||
int pal_extra_chars;
|
||||
};
|
||||
|
||||
u8* preprocessFont_x64(u8 *src, u32 srclen, u32 *outSize)
|
||||
u8 *preprocessFont(u8 *src, u32 srclen, u32 *outSize)
|
||||
{
|
||||
int num_chars = 94;
|
||||
#if VERSION == VERSION_PAL_FINAL
|
||||
|
||||
@@ -1182,7 +1182,7 @@ static int convert_setup(u8 *dst, u8 *src, u32 srclen)
|
||||
return dstpos;
|
||||
}
|
||||
|
||||
u8 *preprocessSetupFile_x64(u8 *data, u32 size, u32 *outSize) {
|
||||
u8 *preprocessSetupFile(u8 *data, u32 size, u32 *outSize) {
|
||||
u32 newSizeEstimated = romdataGetEstimatedFileSize(size, FT_SETUP);
|
||||
u8 *dst = sysMemZeroAlloc(newSizeEstimated);
|
||||
|
||||
|
||||
+2
-1301
File diff suppressed because it is too large.
Load diff
+14
-23
@@ -98,13 +98,6 @@ static struct romfile fileSlots[ROMDATA_MAX_FILES] = {
|
||||
#define ROMSEG_START(n) _ ## n ## SegmentRomStart
|
||||
#define ROMSEG_END(n) _ ## n ## SegmentRomEnd
|
||||
|
||||
// for x64 preprocess functions
|
||||
#ifdef PLATFORM_64BIT
|
||||
#define F(preprocessFunc) preprocessFunc##_x64
|
||||
#else
|
||||
#define F(preprocessFunc) preprocessFunc
|
||||
#endif
|
||||
|
||||
/* segment table for ntsc-final */
|
||||
/* size will get calculated automatically if it is 0 */
|
||||
/* if there are replacement files in the data dir, they will be loaded instead */
|
||||
@@ -122,15 +115,15 @@ static struct romfile fileSlots[ROMDATA_MAX_FILES] = {
|
||||
ROMSEG_DECL_SEG(mpstringsS, 0x7e2f20, 0x7ce720, 0x7d25b0, 0x3700, NULL ) \
|
||||
ROMSEG_DECL_SEG(mpstringsI, 0x7e6620, 0x7d1e20, 0x7d5cb0, 0x3700, NULL ) \
|
||||
ROMSEG_DECL_SEG(firingrange, 0x7e9d20, 0x7d5520, 0x7d93b0, 0x1550, NULL ) \
|
||||
ROMSEG_DECL_SEG(fonttahoma, 0x7f7860, 0x7e3060, 0x7e6ef0, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(fontnumeric, 0x7f8b20, 0x7e4320, 0x7e81b0, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicsm, 0x7f9d30, 0x7e5530, 0x7e93c0, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicxs, 0x7fbfb0, 0x7e87b0, 0x7ec640, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicmd, 0x7fdd80, 0x7eae20, 0x7eecb0, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothiclg, 0x8008e0, 0x7eee70, 0x7f2d00, 0x0, F(preprocessFont) ) \
|
||||
ROMSEG_DECL_SEG(sfxctl, 0x80a250, 0x7f87e0, 0x7fc670, 0x2fb80, F(preprocessALBankFile) ) \
|
||||
ROMSEG_DECL_SEG(fonttahoma, 0x7f7860, 0x7e3060, 0x7e6ef0, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(fontnumeric, 0x7f8b20, 0x7e4320, 0x7e81b0, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicsm, 0x7f9d30, 0x7e5530, 0x7e93c0, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicxs, 0x7fbfb0, 0x7e87b0, 0x7ec640, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothicmd, 0x7fdd80, 0x7eae20, 0x7eecb0, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(fonthandelgothiclg, 0x8008e0, 0x7eee70, 0x7f2d00, 0x0, preprocessFont ) \
|
||||
ROMSEG_DECL_SEG(sfxctl, 0x80a250, 0x7f87e0, 0x7fc670, 0x2fb80, preprocessALBankFile ) \
|
||||
ROMSEG_DECL_SEG(sfxtbl, 0x839dd0, 0x828360, 0x82c1f0, 0x4c2160, NULL ) \
|
||||
ROMSEG_DECL_SEG(seqctl, 0xcfbf30, 0xcea4c0, 0xcee350, 0xa060, F(preprocessALBankFile) ) \
|
||||
ROMSEG_DECL_SEG(seqctl, 0xcfbf30, 0xcea4c0, 0xcee350, 0xa060, preprocessALBankFile ) \
|
||||
ROMSEG_DECL_SEG(seqtbl, 0xd05f90, 0xcf4520, 0xcf83b0, 0x17c070, NULL ) \
|
||||
ROMSEG_DECL_SEG(sequences, 0xe82000, 0xe70590, 0xe74420, 0x563a0, preprocessSequences ) \
|
||||
ROMSEG_DECL_SEG(texturesdata, 0x1d65f40, 0x1d5ca20, 0x1d61f90, 0x0, NULL ) \
|
||||
@@ -171,16 +164,14 @@ static struct romfile romSegs[] = {
|
||||
static preprocessfunc filePreprocFuncs[] = {
|
||||
/* LOADTYPE_NONE */ NULL,
|
||||
/* LOADTYPE_BG */ NULL, // loaded in parts
|
||||
/* LOADTYPE_TILES */ F(preprocessTilesFile),
|
||||
/* LOADTYPE_LANG */ F(preprocessLangFile),
|
||||
/* LOADTYPE_SETUP */ F(preprocessSetupFile),
|
||||
/* LOADTYPE_PADS */ F(preprocessPadsFile),
|
||||
/* LOADTYPE_MODEL */ F(preprocessModelFile),
|
||||
/* LOADTYPE_GUN */ F(preprocessModelFile),
|
||||
/* LOADTYPE_TILES */ preprocessTilesFile,
|
||||
/* LOADTYPE_LANG */ preprocessLangFile,
|
||||
/* LOADTYPE_SETUP */ preprocessSetupFile,
|
||||
/* LOADTYPE_PADS */ preprocessPadsFile,
|
||||
/* LOADTYPE_MODEL */ preprocessModelFile,
|
||||
/* LOADTYPE_GUN */ preprocessGunFile,
|
||||
};
|
||||
|
||||
#undef F
|
||||
|
||||
static inline void romdataWrongRomError(const char *fmt, ...)
|
||||
{
|
||||
char reason[1024];
|
||||
|
||||
@@ -2003,11 +2003,6 @@ void bgBuildTables(s32 stagenum)
|
||||
numlightsptr++;
|
||||
}
|
||||
|
||||
// in x64, lights are already pre-processed at this point (TEMP)
|
||||
#if !defined(PLATFORM_N64) && !defined(PLATFORM_64BIT)
|
||||
preprocessBgLights(g_BgLightsFileData, 0);
|
||||
#endif
|
||||
|
||||
// Free the section 3 allocation
|
||||
mempRealloc(section3, 0, MEMPOOL_STAGE);
|
||||
|
||||
|
||||
@@ -425,11 +425,7 @@ char *langGet(s32 textid)
|
||||
uintptr_t addr;
|
||||
|
||||
if (bank && bank[textindex]) {
|
||||
#ifdef PLATFORM_64BIT
|
||||
addr = (uintptr_t)bank + bank[textindex];
|
||||
#else
|
||||
addr = (uintptr_t)bank + PD_BE32(bank[textindex]);
|
||||
#endif
|
||||
} else {
|
||||
addr = 0;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
|
||||
#define ABS(val) ((val) > 0 ? (val) : -(val))
|
||||
#define ABSF(val) ((val) > 0.0f ? (val) : -(val))
|
||||
#define ALIGN(val, size) ((val + (size - 1)) & ~(size - 1))
|
||||
#define ALIGN2(val) (((val) | 1) ^ 0x1)
|
||||
#define ALIGN4(val) (((val) | 3) ^ 0x3)
|
||||
#define ALIGN8(val) ((((val) + 0x7) | 0x7) ^ 0x7)
|
||||
|
||||
+4
-4
@@ -1450,13 +1450,13 @@ void sndInit(void)
|
||||
#endif
|
||||
|
||||
#if VERSION >= VERSION_JPN_FINAL
|
||||
u32 heaplen = 1024 * 441;
|
||||
u32 heaplen = 1024 * 528;
|
||||
#elif VERSION >= VERSION_PAL_BETA
|
||||
u32 heaplen = 1024 * 446;
|
||||
u32 heaplen = 1024 * 533;
|
||||
#elif VERSION >= VERSION_NTSC_1_0
|
||||
u32 heaplen = 1024 * 441;
|
||||
u32 heaplen = 1024 * 528;
|
||||
#else
|
||||
u32 heaplen = 1024 * 438;
|
||||
u32 heaplen = 1024 * 525;
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_64BIT
|
||||
|
||||
Reference in new issue
Block a user