Fix issues in review

This commit is contained in:
mid-kid 2019-02-16 19:08:34 +01:00
parent 80ece33e3e
commit 7d6befa181
6 changed files with 22 additions and 18 deletions

View File

@ -25,7 +25,7 @@
const BATTLEANIMSTRUCT_16
const BATTLEANIMSTRUCT_17
BATTLEANIMSTRUCT_LENGTH EQU const_value
NUM_ANIM_OBJECTS EQUS "(wActiveAnimObjectsEnd - wActiveAnimObjects) / BATTLEANIMSTRUCT_LENGTH"
NUM_ANIM_OBJECTS EQU 10 ; see wActiveAnimObjects
; Start tile for battle animation graphics
BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
@ -818,7 +818,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
const BG_EFFECT_STRUCT_BATTLE_TURN
const BG_EFFECT_STRUCT_03
BG_EFFECT_STRUCT_LENGTH EQU const_value
NUM_BG_EFFECTS EQUS "(wActiveBGEffectsEnd - wActiveBGEffects) / BG_EFFECT_STRUCT_LENGTH"
NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects
; battle palettes
const_def

View File

@ -89,7 +89,7 @@ BattleAnimOAMUpdate:
ld hl, wBattleAnimTempOAMFlags
ld a, [wBattleAnimTempFrameOAMFlags]
xor [hl]
and $e0 ; Keep priority, x flip and y flip flags.
and PRIORITY | Y_FLIP | X_FLIP
ld [hl], a
pop af
@ -171,7 +171,7 @@ BattleAnimOAMUpdate:
or b
ld b, a
ld a, [wBattleAnimTempPalette]
and $f
and (PRIORITY | Y_FLIP | X_FLIP | OBP_NUM) ^ $ff
or b
ld [de], a
@ -203,7 +203,7 @@ InitBattleAnimBuffer:
add hl, bc
ld a, [hl]
and %10000000
and PRIORITY
ld [wBattleAnimTempOAMFlags], a
xor a
ld [wBattleAnimTempFrameOAMFlags], a

View File

@ -37,7 +37,7 @@ GetBattleAnimFrame:
push af
ld a, [hl]
push hl
and %00111111
and (Y_FLIP << 1 | X_FLIP << 1) ^ $ff
ld hl, BATTLEANIMSTRUCT_DURATION
add hl, bc
ld [hl], a
@ -55,6 +55,7 @@ GetBattleAnimFrame:
ld hl, BATTLEANIMSTRUCT_DURATION
add hl, bc
ld [hl], a
ld hl, BATTLEANIMSTRUCT_FRAME
add hl, bc
dec [hl]

View File

@ -315,8 +315,8 @@ UpdateAnimFrame:
AddOrSubtractY:
push hl
ld a, [hl]
ld hl, wCurSpriteAddSubFlags
bit 6, [hl]
ld hl, wCurSpriteOAMFlags
bit OAM_Y_FLIP, [hl]
jr z, .ok
; 8 - a
add $8
@ -330,8 +330,8 @@ AddOrSubtractY:
AddOrSubtractX:
push hl
ld a, [hl]
ld hl, wCurSpriteAddSubFlags
bit 5, [hl] ; x flip
ld hl, wCurSpriteOAMFlags
bit OAM_X_FLIP, [hl]
jr z, .ok
; 8 - a
add $8
@ -343,20 +343,20 @@ AddOrSubtractX:
ret
GetSpriteOAMAttr:
ld a, [wCurSpriteAddSubFlags]
ld a, [wCurSpriteOAMFlags]
ld b, a
ld a, [hl]
xor b
and $e0
and PRIORITY | Y_FLIP | X_FLIP
ld b, a
ld a, [hl]
and $1f
and (PRIORITY | Y_FLIP | X_FLIP) ^ $ff
or b
ret
InitSpriteAnimBuffer:
xor a
ld [wCurSpriteAddSubFlags], a
ld [wCurSpriteOAMFlags], a
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
ld a, [hli]
@ -436,7 +436,7 @@ GetSpriteAnimFrame:
push af
ld a, [hl]
push hl
and $3f
and (Y_FLIP << 1 | X_FLIP << 1) ^ $ff
ld hl, SPRITEANIMSTRUCT_DURATIONOFFSET
add hl, bc
add [hl]
@ -446,9 +446,9 @@ GetSpriteAnimFrame:
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 [wCurSpriteAddSubFlags], a
ld [wCurSpriteOAMFlags], a
pop af
ret

View File

@ -174,3 +174,6 @@ limited_interpret_data EQUS "text_dots"
link_wait_button EQUS "text_linkwaitbutton"
current_day EQUS "text_today"
text_jump EQUS "text_far"
; macros/scripts/battle_anims.asm
anim_clearsprites EQUS "anim_keepsprites"

View File

@ -263,7 +263,7 @@ wCurIcon:: db ; c3b6
wCurIconTile:: db
wSpriteAnimAddrBackup::
wSpriteAnimIDBuffer::
wCurSpriteAddSubFlags::
wCurSpriteOAMFlags::
dw
wCurAnimVTile:: db
wCurAnimXCoord:: db