summaryrefslogtreecommitdiff
path: root/Code-cleanup.md
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2018-07-17 16:47:28 -0400
committerRangi <35663410+Rangi42@users.noreply.github.com>2018-07-17 16:47:28 -0400
commitccf446c875815da7d9e4a40ea3bd43d87c2e52d6 (patch)
treeeadf5fbe5f3bb4295bb41a557b506dfdb691c32f /Code-cleanup.md
parentf55a98cab5a4de03f638c67807ba35d868ebf52c (diff)
Created Code cleanup (markdown)
Diffstat (limited to 'Code-cleanup.md')
-rw-r--r--Code-cleanup.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/Code-cleanup.md b/Code-cleanup.md
new file mode 100644
index 0000000..b2a4a60
--- /dev/null
+++ b/Code-cleanup.md
@@ -0,0 +1,12 @@
+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)
+ - Jumptable indexes (look for raw values being loaded into `[wJumptableIndex]`)
+
+- Text label styles in [data/text/](../tree/master/data/text/) should be consistent, not a mixture of `Text_*`, `*Text`, and `BattleText_*`. Likewise for the [engine/](../tree/master/engine/) labels that just `text_jump` to one of them.