pokegold icon indicating copy to clipboard operation
pokegold copied to clipboard

Identify more bit flags

Open Rangi42 opened this issue 4 months ago • 0 comments

Pretty self-explanatory; a similar effort to some of the recent pokered commits.

Some things to note:

  • I did this in pokegold, not pokecrystal, so the unidentified mobile stuff wouldn't be a distraction. This will need porting to there once it's approved.
  • There are many bit/res/set 7s left, because of a convention to set the high bit of jumptable indexes to mean "exit the jumptable". I may add a generic EXIT_JUMPTABLE_F constant in a separate PR.
  • I edited the shift_const macro to automatically define \1 (bit mask) and \1_F (0-7 bit flag) constants. This does make it harder to grep for NAME_F definitions, but otherwise we'd have a lot of redundant definition lines.
  • We don't have a perfect convention of naming flag constants with _F or not. I usually went for local consistency, i.e. imitate nearby constant names.
  • A few of these are surprising/weird, like how GetMovementPermissions in home/map.asm sets the RIGHT bit in all four directional cases. I may have made mistakes there, but AFAICT that's what the bit means.

Rangi42 avatar Oct 09 '24 16:10 Rangi42