-
Notifications
You must be signed in to change notification settings - Fork 786
Code cleanup
luckytyphlosion 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. -
Style Guide: Re-formatting code to adhere with STYLE.md (Converting labels to
.snake_case
is one that stands out) -
WRAM Cleanup:
-
Curr
->Cur
-
wMapObjects
and friends to be re-formatted towObjectEvents
-
wObjectStructs
and friends to be re-formatted towMapObjects
- Removal of struct macros which include only a partial label definition (e.g.
wNorthMapConnection:: map_connection_struct wNorth
)
-
-
Future of SECTIONs: Namely determining the purpose of them and when they should be defined.