Skip to content

Commit

Permalink
Merge branch 'map_cnx_obj_retent'
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandth committed Aug 30, 2024
2 parents d1030cb + c4c5150 commit c63fd3f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions engine/events/field_moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ ShakeHeadbuttTree:
add hl, bc
ld [hl], FIELDMOVE_TREE

ldh a, [hUsedOAMIndex]
; a = (NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH - a
cpl
add NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH + 1
push af
ld l, a
ld h, HIGH(wShadowOAM)
ld bc, SPRITEOAMSTRUCT_LENGTH * 4
ldh a, [hUsedOAMIndex]
; a = (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH - a
cpl
add (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH + 1
ld e, a
ld d, HIGH(wShadowOAM)
call CopyBytes

pop af
ld [wCurSpriteOAMAddr], a
farcall DoNextFrameForAllSprites_OW
call HideHeadbuttTree
Expand All @@ -66,9 +78,9 @@ ShakeHeadbuttTree:
dec [hl]

ldh a, [hUsedOAMIndex]
; a = (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH - a
; a = (NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH - a
cpl
add (NUM_SPRITE_OAM_STRUCTS - 4) * SPRITEOAMSTRUCT_LENGTH + 1
add NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH + 1

ld [wCurSpriteOAMAddr], a
farcall DoNextFrameForAllSprites_OW
Expand Down

0 comments on commit c63fd3f

Please sign in to comment.