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

  • 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 to wObjectEvents
    • wObjectStructs and friends to be re-formatted to wMapObjects
    • 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.

Clone this wiki locally