diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-09-15 15:13:10 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-09-15 15:13:10 -0400 |
commit | 1876c4ffc43d8333e9deb30c7fc50933452e0074 (patch) | |
tree | 272c28c63f5c56afbcdbf74c5e058a8526ea0765 | |
parent | d899da01e938ffa2f9b68cfb9d21618f9c58225c (diff) |
bash
-rw-r--r-- | Code-cleanup.md | 4 |
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]`. |