1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
AnimateBoulderDust:
ld a, $1
ld [wWhichAnimationOffsets], a ; select the boulder dust offsets
ld a, [wUpdateSpritesEnabled]
push af
ld a, $ff
ld [wUpdateSpritesEnabled], a
ld a, %11100100
ldh [rOBP1], a
call LoadSmokeTileFourTimes
farcall WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
.loop
push bc
call GetMoveBoulderDustFunctionPointer
ld bc, .returnAddress
push bc
ld c, 4
jp hl
.returnAddress
ldh a, [rOBP1]
xor %01100100
ldh [rOBP1], a
call Delay3
pop bc
dec c
jr nz, .loop
pop af
ld [wUpdateSpritesEnabled], a
jp LoadPlayerSpriteGraphics
GetMoveBoulderDustFunctionPointer:
ld a, [wSpritePlayerStateData1FacingDirection]
ld hl, MoveBoulderDustFunctionPointerTable
ld c, a
ld b, $0
add hl, bc
ld a, [hli]
ld [wCoordAdjustmentAmount], a
ld a, [hli]
ld e, a
ld a, [hli]
ld h, [hl]
ld l, a
push hl
ld hl, wOAMBuffer + $90
ld d, $0
add hl, de
ld e, l
ld d, h
pop hl
ret
boulder_dust_adjust: MACRO
db \1, \2 ; coords
dw \3 ; function
ENDM
MoveBoulderDustFunctionPointerTable:
boulder_dust_adjust -1, 0, AdjustOAMBlockYPos ; down
boulder_dust_adjust 1, 0, AdjustOAMBlockYPos ; up
boulder_dust_adjust 1, 1, AdjustOAMBlockXPos ; left
boulder_dust_adjust -1, 1, AdjustOAMBlockXPos ; right
LoadSmokeTileFourTimes::
ld hl, vChars1 tile $7c
ld c, 4
.loop
push bc
push hl
call LoadSmokeTile
pop hl
ld bc, 1 tiles
add hl, bc
pop bc
dec c
jr nz, .loop
ret
LoadSmokeTile:
ld de, SSAnneSmokePuffTile
lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10
jp CopyVideoData
SSAnneSmokePuffTile:
INCBIN "gfx/overworld/smoke.2bpp"
SSAnneSmokePuffTileEnd:
|