-
Notifications
You must be signed in to change notification settings - Fork 806
Code cleanup
Rangi edited this page Jul 17, 2018
·
27 revisions
These are all general issues with the pokecrystal code. Keep an eye out for opportunities to refactor them.
-
Meaningless temporary labels:
UnknownText_*
,UnknownScript_*
,Unknown_*
, andFunction_*
-
Hard-coded "magic numbers": Most of the time, raw numbers should not exist because there are more meaningful replacements. Examples:
-
BANK(Label)
(mostly finished for WRAM labels, but still a problem with mobile code) -
SomeLabelEnd - SomeLabel
(some structs and sub-structs still have hard-coded sizes like this) -
(SomeGFXLabel.End - SomeGFXLabel) / LEN_2BPP_TILE
(pokered and pokegold-spaceworld already do this) -
SOME_BIT_F
bit flags, and1 << SOME_BIT_F
masks (various hex and binary literals indicate an opportunity for this) (you can often use themaskbits
macro forand $MASK
) - Jumptable indexes (look for raw values being loaded into
[wJumptableIndex]
)
-
-
Text label styles in data/text/ should be consistent, not a mixture of
Text_*
,*Text
, andBattleText_*
. Likewise for the engine/ labels that justtext_jump
to one of them.