diff options
Diffstat (limited to 'engine/overworld/cut.asm')
-rwxr-xr-x | engine/overworld/cut.asm | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index bc7d092d..e36b8d88 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -22,8 +22,8 @@ UsedCut: jp PrintText .NothingToCutText - TX_FAR _NothingToCutText - db "@" + text_far _NothingToCutText + text_end .canCut ld [wCutTile], a @@ -37,15 +37,15 @@ UsedCut: call GBPalWhiteOutWithDelay3 call ClearSprites call RestoreScreenTilesAndReloadTilePatterns - ld a, SCREEN_HEIGHT_PIXELS - ld [hWY], a + ld a, SCREEN_HEIGHT_PX + ldh [hWY], a call Delay3 call LoadGBPal call LoadCurrentMapView call SaveScreenTilesToBuffer2 call Delay3 xor a - ld [hWY], a + ldh [hWY], a ld hl, UsedCutText call PrintText call LoadScreenTilesFromBuffer2 @@ -57,47 +57,47 @@ UsedCut: ld de, CutTreeBlockSwaps call ReplaceTreeTileBlock call RedrawMapView - callba AnimCut + farcall AnimCut ld a, $1 ld [wUpdateSpritesEnabled], a ld a, SFX_CUT call PlaySound ld a, $90 - ld [hWY], a + ldh [hWY], a call UpdateSprites jp RedrawMapView UsedCutText: - TX_FAR _UsedCutText - db "@" + text_far _UsedCutText + text_end InitCutAnimOAM: xor a ld [wWhichAnimationOffsets], a ld a, %11100100 - ld [rOBP1], a + ldh [rOBP1], a call UpdateGBCPal_OBP1 ld a, [wCutTile] cp $52 jr z, .grass ; tree - ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row - ld hl, vChars1 + $7c0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $2d ; cuttable tree sprite top row + ld hl, vChars1 tile $7c + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData - ld de, Overworld_GFX + $3d0 ; cuttable tree sprite bottom row - ld hl, vChars1 + $7e0 - lb bc, BANK(Overworld_GFX), $02 + ld de, Overworld_GFX tile $3d ; cuttable tree sprite bottom row + ld hl, vChars1 tile $7e + lb bc, BANK(Overworld_GFX), 2 call CopyVideoData jr WriteCutOrBoulderDustAnimationOAMBlock .grass - ld hl, vChars1 + $7c0 + ld hl, vChars1 tile $7c call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7d0 + ld hl, vChars1 tile $7d call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7e0 + ld hl, vChars1 tile $7e call LoadCutGrassAnimationTilePattern - ld hl, vChars1 + $7f0 + ld hl, vChars1 tile $7f call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wOAMBuffer + $93 @@ -113,8 +113,8 @@ InitCutAnimOAM: ret LoadCutGrassAnimationTilePattern: - ld de, AnimationTileset2 + $60 ; tile depicting a leaf - lb bc, BANK(AnimationTileset2), $01 + ld de, AnimationTileset2 tile 6 ; tile depicting a leaf + lb bc, BANK(AnimationTileset2), 1 jp CopyVideoData WriteCutOrBoulderDustAnimationOAMBlock: @@ -124,11 +124,11 @@ WriteCutOrBoulderDustAnimationOAMBlock: jp WriteOAMBlock CutOrBoulderDustAnimationTilesAndAttributes: - db $FC,$14,$FD,$14 - db $FE,$14,$FF,$14 + dbsprite 2, -1, 4, 4, $fd, OAM_OBP1 | %100 + dbsprite 2, -1, 4, 6, $ff, OAM_OBP1 | %100 GetCutOrBoulderDustAnimationOffsets: - ld hl, wSpriteStateData1 + 4 + ld hl, wSpritePlayerStateData1YPixels ld a, [hli] ; player's sprite screen Y position ld b, a inc hl @@ -188,7 +188,7 @@ ReplaceTreeTileBlock: ld h, [hl] ld l, a add hl, bc - ld a, [wSpritePlayerStateData1FacingDirection] ; player sprite's facing direction + ld a, [wSpritePlayerStateData1FacingDirection] and a jr z, .down cp SPRITE_FACING_UP @@ -249,16 +249,4 @@ ReplaceTreeTileBlock: ld [hl], a ret -CutTreeBlockSwaps: -; first byte = tileset block containing the cut tree -; second byte = corresponding tileset block after the cut animation happens - db $32, $6D - db $33, $6C - db $34, $6F - db $35, $4C - db $60, $6E - db $0B, $0A - db $3C, $35 - db $3F, $35 - db $3D, $36 - db $FF ; list terminator +INCLUDE "data/tilesets/cut_tree_blocks.asm" |