Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Various code improvements for the Lufia 2 Ancient Cave world. Most of the separate commits should be self-explanatory (such as making use of #1649 and #1923).
The one that could probably do with some further explanation is the change to the basepatch:
At some point, the code needs to calculate how many individual bits are set in a certain byte. The fastest way to determine this involves having precalculated the result for all the 256 possible register values and using that as a lookup table. Therefore, I originally inserted such a table into the ROM. As it turns out, however, this exact 256 byte table is already present somewhere in the unpatched ROM, so we can just use that instead.
How was this tested?
Running a few games with Iris treasure hunt goals (which use the code that was changed in the basepatch) and various enemizer options turned on (which use most of the
random
).