summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-09-15 15:13:10 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-09-15 15:13:10 -0400
commit1876c4ffc43d8333e9deb30c7fc50933452e0074 (patch)
tree272c28c63f5c56afbcdbf74c5e058a8526ea0765
parentd899da01e938ffa2f9b68cfb9d21618f9c58225c (diff)
bash
-rw-r--r--Code-cleanup.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/Code-cleanup.md b/Code-cleanup.md
index 1e294ac..c9ec832 100644
--- a/Code-cleanup.md
+++ b/Code-cleanup.md
@@ -29,7 +29,9 @@ Most of the time, raw numbers should not exist because there are more meaningful
- `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.
- Bit flags: Use `SOME_BIT_F` constants instead of hard-coding bits 0-7 for the `bit`/`res`/`set` instructions. Find opportunities with:
- grep -rE --include='*.asm' --exclude-dir=mobile '^\s(bit|res|set) [0-7],'
+```bash
+grep -rE --include='*.asm' --exclude-dir=mobile '^\s(bit|res|set) [0-7],'
+```
- Bit masks: Use `1 << SOME_BIT_F` masks and the `maskbits` macro.
- Jumptable indexes: Look for raw values being loaded into `[wJumptableIndex]`.