pret / pokecrystal

Disassembly of Pokémon Crystal
https://pret.github.io/pokecrystal/
2.06k stars 770 forks source link

Maybe add comments explaining that `stat_multipliers.asm` and `stat_multipliers_2.asm` are stored in different banks #1119

Closed Grate-Oracle-Lewot closed 1 month ago

Grate-Oracle-Lewot commented 2 months ago

These two tables are identical, which is noted in their comments, but it's not explained why two identical tables are needed (it's because they're in different banks). Speaking from experience, this might lead someone to assume that one table could be deleted and the other reused, resulting in stats being modified based on garbage data. This is particularly insidious because it doesn't cause any build errors and isn't immediately obvious when playing, but in some cases it leads to infinite loops. Suffice to say that a short comment explaining the bank situation would have saved me a whole lot of trouble, and I'd like to save others that trouble.

Rangi42 commented 2 months ago

Alternatively, what if we reused the same INCLUDE for both tables, moving the StatLevelMultipliers and StatLevelMultipliers_Applied labels outside the INCLUDED file? ( @mid-kid @vulcandth @dannye thoughts?)

dannye commented 2 months ago

Big fan of that.