-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does the rsizetable (RESTBL) work? #15
Comments
The values is the RESTBL are the smallest working heap allocation sizes for a file. For us, it is usually an estimation based off the file size, but with a bit extra room to be safe until we better know how to estimate/calculate them. I usually take the ratio of the original (decompressed) file size and the original RESTBL value, and use that to scale the new file size. If the game still does not load, I'll increment it until it does load. |
So i can do bytes of decompressed and + with compressed file? And then the total bytes ? Sorry i dont understand completly :-/ |
No, you'd take the original decompressed file size (from the game ROM) and compare it with the RESTBL entry. Then apply that ratio to the modified file size (also decompressed) to get the new RESTBL estimated entry size. If the game still crashes, increment the RESTBL entry value by an arbitrary amount. |
Thank you! |
I am confused to why this still does not work, my brain might be too tired for me to understand this.. here is what i tried: Try 1 (size): 43445080 - Modified Decompressed Size Try 2 (size on disk instead): 43446272 - Modified Decompressed Size on disk Try 3: Modified size on disk - Original Size in resource file: 251260 Im lost :( |
First off, your ratio calculation is wrong. You get the ratio from the difference, we don't care to much about the difference itself. We need to find "by what was the original file size multiplied to get the resource size?" Or, written in an expression: file_size * x = resource_size
resource_size / files_size = x If we plug in your numbers we get: 43697532 * x = 43697792
43697792 / 43697532 = x
x = 1.00000595 So the ratio you want is actually So then we take the modified file size and multiply it by the ratio to get an approximate answer based on the original difference. (Notice this is the same as the original equation, just with our new variables) modified_file_size * ratio = resource_size // always round up from zero to be safe
43445080 * 1.00000595 = 43445339 And finally comes the most important part:
Because this is still just a rough estimation without any real structure, we need to add a bit of extra room to account for stuff we don't understand. For this I usually start by just moving a digit somewhere in the middle of the number up one (e.g. After that it's just testing and changing until it works. Also note: Never use the file size on disk, it's just the file size with windows meta data included. |
Thanks this made alot more sense to me and i got it working. Now i just got to figure out how to remove the textboxes without the game crashing upon load.. My goal is to remove the text boxes that contain the nintendo buttons in the background of the current active UI button :) |
Hello I have a question. 11428804 * 1.0000357 = 11429212 But I'm confused about the arbitrary amount since the middle of my number is empty: |
There is no real method to it, you just pick a digit somewhere and change it's value, then test in-game if it works. |
Do I have to test every number from the beginning to the end, or from the end to the beginning, always just by one up or just increase the value of the middle number in the 3 at the end, can you make a couple examples, in the reply please, and why it doesn't work if I just max out to 99999999 like it did work in botw RESTBL? |
It doesn't really work like that, you are just trying to get the smallest number that doesn't cause the game to crash. The reason using 999... "works" is because it's enough memory for the file to fit into, however you'll overload the memory heap very quickly because the file doesn't need that much, so you waste a bunch of space. |
When i open a table file and i have one that i have edited, how do i set the size correctly?
Like it isnt bytes is it? Is it a CRC32 value?
Sry that i have to ask
The text was updated successfully, but these errors were encountered: