pret / pokeplatinum

Decompilation of Pokémon Platinum
181 stars 61 forks source link

Generate enum-based battle constants at build-time #121

Closed lhearachel closed 8 months ago

lhearachel commented 8 months ago

This makes use of a subproject that I wrote for generating constants files from a basic manifest schema. The goal here is to support having a single source of truth for such definitions that can be utilized by both the compiler and a direct assembler invocation for building data files (which we will need for battle scripts). The assembler does not support reading enum definitions out-of-the-box, so these definitions would need to either be:

  1. Duplicated, and thus separately maintained
  2. Moved to #define syntax, which is less-than-ideal for self-documentation of function signatures
  3. Generated from a separate source-of-truth
mid-kid commented 8 months ago

My only complaint is that nobody is gonna be able to find the source of truth through neither their IDE nor a simple grep. This is because you took away their prefixes in the definitions files, which I think is a questionable feature.

Either:

Or both, preferably both.

lhearachel commented 8 months ago

Or both, preferably both.

I decided both was worthwhile, too.