A new function has been implemented in FEBuilderGBA.
The problem with FEBuilderGBA is fragments of ROM.
If you are doing data repotting many times, you will end up with a lot of shredded areas, squeezing the capacity of the ROM.
This is a problem if you make very big remodeling.
REBUILD is a feature that automatically solves this problem.
For example, it is like defragmentation.
The algorithm is as follows.
Write the all data of the area known by FEBuilderGBA to the file.
Imports that data to unmodified ROM.
Create a cleaned-up ROM.
In other words, it may be easier to understand if you think that you are automatically generating something like Buildfile from the existing ROM.
However, since the data to be generated is assumed to be read by the machine, the readability is lower than that of the buildfile.
Even data structures that FEBuilderGBA does not know will keep track of LDR references and will work.
FE 8 works most correctly.
FE 7, FE 6, there are still many unknown data structures, so it is highly likely to fail.
Moreover, it does not correspond to the code which is executed complicated from the middle as follows.
If you write in EA it is a patch like the following.
jmpToHack (my_program + $50)
In other words, it is a code that is jumping relative to BL with respect to the relative address above the specified pointer.
There are rare such codes, but in FE 8 J, the old two patches were written in this writing style.
If this code is in the address 0x01000000 which is the target of the rebuild, the rebuild fails.
There are newly rewritten versions of FE 8 J's old two patches, so please use it when using rebuild.
When rebuilding, you may share existing BIN data and reduce its size.
For example, it is a waste of capacity to add the same violin instrument data even though the violin instrument data is in the ROM.
In REBUILD, if you have such a data structure, it will be shared automatically. (The log shows SHARE!)
Improve compression efficiency
It seems that it has about 2 MB - 11 MB compression effect.
This is because remodeling made in the past did not share musical instrument data.
zyouou no ken
The old zalhman's song editor could not share instruments.
Currently, I expanded version and FEBuilderGBA will automatically share instruments.
Therefore, it is better not to expect much for 10 MB capacity reduction.
I think that it is about 2-5 MB.
Although there are slight modifications to the modification made by Buildfile, there are times when there is compression effect.
However, the effect is small, so you do not have to worry.
Normally you do not need to use REBUILD.
It is good to consider when the ROM capacity is near the limit of 32 MB.
Do not abuse it if you use it unnecessarily because it will cause a bug.
When you rebuild ROM.GBA, a file called ROM.R.GBA is created.
ROM.R.GBA is the rebuilt ROM.
After rebuilding, please be sure to perform a clear test.
If something goes wrong, it is dangerous, please discard the rebuilt ROM.
It is because it is very difficult to repair broken ROM as a result of rebuilding.
Therefore, a full test on whether to adopt the rebuild result is absolutely necessary.