Commit Graph

22 Commits

Author SHA1 Message Date
Rangi
40902ffe24 Verify data table sizes with table_width and assert_table_length macros
This was discussed in #706

It also uncovered some off-by-one issues with defining some constants.

A few structs now use rsreset/_RS to define their offset constants, as discussed in #739
2021-03-04 00:15:03 -05:00
Rangi
4a323cf591 UnusedSpriteAnimGFX was to sprite anims as AnimObjGFX is to battle anims 2020-10-30 17:41:03 -04:00
Rangi
fe1a58deea Identify wSpriteAnimDict key constants 2020-10-30 15:39:08 -04:00
Rangi
9dcdad5e60 Comment, remove, or revise many unreferenced labels 2020-10-26 20:29:58 -04:00
7Soul
2ffc5f907f
Identify battle animation functions (#771)
Identify battle animation functions
2020-10-03 21:54:02 -04:00
mid-kid
13c4a93cea Fix some constants surrounding sprite animations
Also commented the use of the field surrounding the struct
initialization functions.

SPRITEANIMSTRUCT_0C -> SPRITEANIMSTRUCT_VAR1
SPRITEANIMSTRUCT_0D -> SPRITEANIMSTRUCT_VAR2
SPRITEANIMSTRUCT_0E -> SPRITEANIMSTRUCT_VAR3
SPRITEANIMSTRUCT_0F -> SPRITEANIMSTRUCT_VAR4

BATTLEANIMSTRUCT_01 -> BATTLEANIMSTRUCT_OAMFLAGS
BATTLEANIMSTRUCT_ANON_JT_INDEX -> BATTLEANIMSTRUCT_JUMPTABLE_INDEX
BATTLEANIMSTRUCT_0F -> BATTLEANIMSTRUCT_VAR1
BATTLEANIMSTRUCT_10 -> BATTLEANIMSTRUCT_VAR2
2020-08-27 13:59:33 +02:00
Rangi
7c42452748 Standardize on $ff ^ X for bitwise negating 8-bit values 2019-02-16 13:52:19 -05:00
mid-kid
7d6befa181 Fix issues in review 2019-02-16 19:08:34 +01:00
mid-kid
7e93916c8a Add more constants for battle anim structs
Any access of the wram arrays for battle anim objects and background
effects use appropriate macros and constants, now.
2019-02-16 01:43:12 +01:00
mid-kid
ee86b36766 wNumActiveBattleAnims → wLastAnimObjectIndex
This variable never decrements, it only increments to give each battle
animation a different, and incremental "index".
2019-02-15 17:21:51 +01:00
mid-kid
4154f191e0 Anotate more of the battle anim subsystem
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`.
2019-02-15 03:01:59 +01:00
mid-kid
bfedd89308 BATTLEANIMSTRUCT_0B -> BATTLEANIMSTRUCT_PARAM
This structure member is used for storing the parameter passed to
`anim_obj`.
2019-02-06 08:12:52 +01:00
mid-kid
41f39211ca Identified another user of wBattleAnimTemp
QueueBattleAnimation loads an object using these wram addresses. Usually
populated by the anim_obj command, but in a couple of cases also
manually.
2018-11-22 12:32:24 +01:00
mid-kid
2746288030 Define ANIM_GFX for PLAYER and ENEMY
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...
2018-11-21 23:44:31 +01:00
Rangi
eb1e3636bb Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
2018-08-25 14:28:22 -04:00
Rangi
5693cc49cf Single newline at the end of files 2018-06-25 12:07:35 -04:00
Rangi
67d1364c7a Fix triple newlines left over from removing address comments 2018-06-24 23:22:50 -04:00
mid-kid
1d9a68dbdd Remove all address comments 2018-06-24 16:13:22 +02:00
mid-kid
81fff9bb80 Fix file permissions
I have no idea why this was a thing (do people store this repo on FAT32
flash drives or something?), but quite a bit of files had a permission
of 755. This isn't really a problem, but it's inconsistent and weird.
2018-04-01 17:05:10 +02:00
luckytyphlosion
a1951cefc0 Prefix wram labels with w, part 2. 2018-01-23 17:39:09 -05:00
luckytyphlosion
f2ae74079f Prefix wram labels with w, part 1.
Handle edge cases first.
2018-01-23 16:45:34 -05:00
Remy Oukaour
417937cffc Resolve #461 2018-01-10 13:47:57 -05:00