ResourceSizeTable.product.rsizetable: Difference between revisions

no edit summary
imported>Leoetlino
(Created page with "{{Resloc|path=System/Resource/ResourceSizeTable.product.rsizetable}} '''ResourceSizeTable.product.rsizetable''' is the file where the resource size table is stored. == St...")
 
imported>Leoetlino
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Resloc|path=System/Resource/ResourceSizeTable.product.rsizetable}}
<onlyinclude>{{Resloc|path=System/Resource/ResourceSizeTable.product.rsizetable}}
'''ResourceSizeTable.product.rsizetable''' is the file where the [[resource size table]] is stored.
'''ResourceSizeTable.product.rsizetable''' is the file where the [[resource size table]] is stored.</onlyinclude>


== Structure ==
== Structure ==
Line 8: Line 8:
<syntaxhighlight lang="c++">
<syntaxhighlight lang="c++">
struct RstbHeader {
struct RstbHeader {
   u32 magic;           // 'RSTB'
   char magic[4];       // 'RSTB'
   u32 crc32TableSize;  // number of entries - can be 0 to indicate there is no crc32 table
   u32 crc32TableSize;  // number of entries - can be 0 to indicate there is no crc32 table
   u32 nameTableSize;  // number of entries - can be 0 to indicate there is no name table
   u32 nameTableSize;  // number of entries - can be 0 to indicate there is no name table
Line 29: Line 29:
This is a mapping of resource paths (strings) to resource sizes. This table is optional and is used whenever there would be conflicts in the crc32 table. Only usable if there is a RSTB header.
This is a mapping of resource paths (strings) to resource sizes. This table is optional and is used whenever there would be conflicts in the crc32 table. Only usable if there is a RSTB header.


<syntaxhighlight lang="c++"> 
<syntaxhighlight lang="c++">
struct RstbCrc32NameEntry {
struct RstbCrc32NameEntry {
   char name[128];
   char name[128];
Line 56: Line 56:
* VfxResourceMgr, when loading Effect/%s.esetlist files: must not be zero.
* VfxResourceMgr, when loading Effect/%s.esetlist files: must not be zero.
* bfres loading code at 0x7100FE3978 (v1.5.0): unclear, but must not be zero. It appears to check whether the file size listed in the RSTB is larger than the heap size.
* bfres loading code at 0x7100FE3978 (v1.5.0): unclear, but must not be zero. It appears to check whether the file size listed in the RSTB is larger than the heap size.
* res::ResourceMgrTask::getHeapSizeForResLoad (0x710120BDE0 in v1.5.0): called during resource load.<syntaxhighlight lang="c++">
* res::ResourceMgrTask::getHeapSizeForResLoad (0x710120BDE0 in v1.5.0): called during resource load.
<source lang="c++">
constant = 0x128 + 0x40;
constant = 0x128 + 0x40;
if (auto* entry_factory = dynamic_cast<res::EntryFactoryBase*>(factory))
if (auto* entry_factory = dynamic_cast<res::EntryFactoryBase*>(factory))
Line 68: Line 69:
else
else
   out->readHeapSize = (unsigned int)(float)(loadDataAlignment + totalSize + sizeof(void*));
   out->readHeapSize = (unsigned int)(float)(loadDataAlignment + totalSize + sizeof(void*));
</syntaxhighlight>
</source>
* 0x7100FE1630 (v1.5.0): unclear. If the file is loaded by the resource memory or loading thread, or if the file size listed in the RSTB is larger than a TempResourceLoader field, the game prints: "Texture archive size: %u MB" (translated from Japanese).
* 0x7100FE1630 (v1.5.0): unclear. If the file is loaded by the resource memory or loading thread, or if the file size listed in the RSTB is larger than a TempResourceLoader field, the game prints: "Texture archive size: %u MB" (translated from Japanese).
== Editing ==
The resource size table must be edited when making game files larger than they originally were, in order to avoid crashes.
=== Tools ===
{{tool table|category=Tools (RSTB)}}


[[Category:Content (BotW)]]
[[Category:Content (BotW)]]
[[Category:Content (BotW, product)]]
[[Category:File formats]]
[[Category:File formats]]
Anonymous user