portx64: romdata: proper estimated size for setup files, renamed getEstimatedFileSize function

This commit is contained in:
Raf committed 2024-08-08 20:54:59 +08:00
1 parent b44dbb16b5
commit 4d60c93beb
5 files changed
+7 -6

No files matched your search

+1
View File
@@ -23,3 +23,4 @@ src/generated
tools/mkrom/mkrom
/.vs
CppProperties.json
.idea
+1 -1
View File
@@ -30,6 +30,6 @@ s32 romdataFileGetNumForName(const char *name);
u8 *romdataSegGetData(const char *segName);
u8 *romdataSegGetDataEnd(const char *segName);
u32 romdataSegGetSize(const char *segName);
u32 romdataGetEstimatedFileSize(u32 size, FileType filetype);
u32 romdataFileGetEstimatedSize(u32 size, FileType filetype);
#endif
+3 -3
View File
@@ -537,18 +537,18 @@ u32 romdataSegGetSize(const char *segName)
return romdataGetSeg(segName)->size;
}
u32 romdataGetEstimatedFileSize(u32 size, FileType filetype)
u32 romdataFileGetEstimatedSize(u32 size, FileType filetype)
{
#ifdef PLATFORM_64BIT
switch (filetype) {
case FT_BG: return (u32)(size * 1.1);
case FT_TILES: return (u32)(size * 1.1);
case FT_LANG: return (u32)(size * 1.3);
case FT_SETUP: return (u32)(size * 3.3);
case FT_SETUP: return (u32)(size * 1.5);
case FT_PADS: return (u32)(size * 1.7);
case FT_MODEL: return (u32)(size * 1.7);
default:
sysLogPrintf(LOG_WARNING, "wrong file type in romdataGetEstimatedFileSize: %d", filetype);
sysLogPrintf(LOG_WARNING, "wrong file type in romdataFileGetEstimatedSize: %d", filetype);
}
#endif
return size;
+1 -1
View File
@@ -1511,7 +1511,7 @@ void bgReset(s32 stagenum)
var8007fc54 -= 0xc;
#ifdef PLATFORM_64BIT
inflatedsize = romdataGetEstimatedFileSize(inflatedsize, FT_BG);
inflatedsize = romdataFileGetEstimatedSize(inflatedsize, FT_BG);
#endif
inflatedsize = ALIGN16(inflatedsize);
+1 -1
View File
@@ -4283,7 +4283,7 @@ u32 fileGetInflatedSize(s32 filenum, FileType filetype)
}
if (rzipIs1173(ptr)) {
return romdataGetEstimatedFileSize((ptr[2] << 16) | (ptr[3] << 8) | ptr[4], filetype);
return romdataFileGetEstimatedSize((ptr[2] << 16) | (ptr[3] << 8) | ptr[4], filetype);
}
#if VERSION < VERSION_NTSC_1_0