These functions used as map setup commands are used in other places,
too, so I can't prefix them under the same. The names should match
except I won't repeat "map" in a map setup command name.
Labelled WRAM addresses, added constants for mobile commands, fixed some
mobile lib function names, documented most of the functions for specific
commands.
The X and Y flip flags can be applied through the stack consisting of:
- Object attributes
- Animation frame attributes
- OAM Data
Each of these negate eachother.
Confused yet? The same stack is traversed to obtain the final tile ID,
with an added layer on top for the base GFX offset and the offset for
the dynamically loaded GFX requested by the object!
wBattleAnimDelay is populated with the values passed to `anim_wait`.
Having the pic animation macros be the same as the oam animation macros
isn't really turning out so well... I wonder if we should split them up
eventually.
These are used where the head or the feet of the player/enemy have to be
moved in an animation, and shouldn't overlap. These aren't actual GFX
and should be loaded with the proper commands, and they're always loaded
at the end of the VRAM area.
Furthermore, I've defined BATTLEANIM_BASE_TILE, which is the tile from
which battle animation graphics may start to load. This value was picked
to make sure at least an entire pokemon pic fits in the area before it,
even though it doesn't seem very used...
Using an underscore before macro variables avoids cluttering up the
global namespace. While this isn't much of a problem right now, it's
good practice that'll keep us from problems in the future.
Tried simplifying things a bit, although not nearly as much as I wanted.
Ideally, we'd either have one of two situations:
- A single set of calculations based on values depending on the
direction of the connection
- A bunch of "generic" calculations done before applying simple
modifiers to them in the final `if` block
Right now it's an icky mix of both and I'm not really sure what to make
of it.
It now only takes one numerical parameter, which is the offset of the
target map relative to the source map, much like in AdvancedMap. This
makes it easier to make connections and avoids having to calculate these
values by hand, and/or "mess with the values 'till it works", as many
have been doing thus far. It's just one, easy-to-understand value.
To convert from the old macro to the new macro, just take the fourth and
the fifth parameter, and calculate `<4th_param> - <5th_param>`. The
result is the value required for the new macro.