pokered/engine/overworld/ssanne.asm

93 lines
1.6 KiB
NASM
Raw Normal View History

AnimateBoulderDust: ; 79f54 (1e:5f54)
2014-05-22 22:13:20 +00:00
ld a, $1
ld [wWhichAnimationOffsets], a ; select the boulder dust offsets
2014-09-13 07:50:56 +00:00
ld a, [wUpdateSpritesEnabled]
2014-05-22 22:13:20 +00:00
push af
ld a, $ff
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
ld a, %11100100
ld [rOBP1], a
2014-05-22 22:13:20 +00:00
call LoadSmokeTileFourTimes
callba WriteCutTreeBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
.loop
2014-05-22 22:13:20 +00:00
push bc
call GetMoveBoulderDustFunctionPointer
ld bc, .returnAddress
2014-05-22 22:13:20 +00:00
push bc
ld c, $4
jp [hl]
.returnAddress
ld a, [rOBP1]
xor %01100100
ld [rOBP1], a
2014-05-22 22:13:20 +00:00
call Delay3
pop bc
dec c
jr nz, .loop
2014-05-22 22:13:20 +00:00
pop af
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a
2014-05-22 22:13:20 +00:00
jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92)
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
ld hl, MoveBoulderDustFunctionPointerTable
2014-05-22 22:13:20 +00:00
ld c, a
ld b, $0
add hl, bc
ld a, [hli]
ld [wd08a], a
2014-05-22 22:13:20 +00:00
ld a, [hli]
ld e, a
ld a, [hli]
ld h, [hl]
ld l, a
push hl
ld hl, wOAMBuffer + $90
2014-05-22 22:13:20 +00:00
ld d, $0
add hl, de
ld e, l
ld d, h
pop hl
ret
MoveBoulderDustFunctionPointerTable: ; 79fb0 (1e:5fb0)
; facing down
2014-05-22 22:13:20 +00:00
db $FF,$00
dw AdjustOAMBlockYPos
2014-05-22 22:13:20 +00:00
; facing up
2014-05-22 22:13:20 +00:00
db $01,$00
dw AdjustOAMBlockYPos
2014-05-22 22:13:20 +00:00
; facing left
2014-05-22 22:13:20 +00:00
db $01,$01
dw AdjustOAMBlockXPos
2014-05-22 22:13:20 +00:00
; facing right
2014-05-22 22:13:20 +00:00
db $FF,$01
dw AdjustOAMBlockXPos
2014-05-22 22:13:20 +00:00
LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0)
2014-05-29 08:31:46 +00:00
ld hl, vChars1 + $7c0
2014-05-22 22:13:20 +00:00
ld c, $4
.loop
push bc
push hl
call LoadSmokeTile
pop hl
ld bc, $10
add hl, bc
pop bc
dec c
jr nz, .loop
ret
LoadSmokeTile: ; 79fd4 (1e:5fd4)
ld de, SSAnneSmokePuffTile
2014-05-22 22:13:20 +00:00
ld bc, (BANK(SSAnneSmokePuffTile) << 8) + $01
jp CopyVideoData
SSAnneSmokePuffTile: ; 79fdd (1e:5fdd)
INCBIN "gfx/ss_anne_smoke_puff.2bpp"