Skip to content
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_*, and Function_*

  • 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, and 1 << SOME_BIT_F masks (various hex and binary literals indicate an opportunity for this) (you can often use the maskbits macro for and $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, and BattleText_*. Likewise for the engine/ labels that just text_jump to one of them.

Clone this wiki locally