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`.
This commit is contained in:
mid-kid
2019-02-15 02:56:24 +01:00
parent 469c51d086
commit 4154f191e0
6 changed files with 40 additions and 27 deletions

View File

@@ -37,16 +37,16 @@ GetBattleAnimFrame:
push af
ld a, [hl]
push hl
and $3f
and %00111111
ld hl, BATTLEANIMSTRUCT_DURATION
add hl, bc
ld [hl], a
pop hl
.okay
ld a, [hl]
and $c0
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "frame" macro
srl a
ld [wBattleAnimTempAddSubFlags], a
ld [wBattleAnimTempFrameOAMFlags], a
pop af
ret