-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathcut2.asm
89 lines (87 loc) · 1.55 KB
/
cut2.asm
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
88
89
AnimCut:
ld a, [wCutTile]
cp $52
jr z, .grass
ld c, $8
.cutTreeLoop
push bc
ld hl, wShadowOAMSprite36XCoord
ld a, 1
ld [wCoordAdjustmentAmount], a
ld c, 2
call AdjustOAMBlockXPos2
ld hl, wShadowOAMSprite38XCoord
ld a, -1
ld [wCoordAdjustmentAmount], a
ld c, 2
call AdjustOAMBlockXPos2
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
call DelayFrame
pop bc
dec c
jr nz, .cutTreeLoop
ret
.grass
ld c, 2
.cutGrassLoop
push bc
ld c, $8
call AnimCutGrass_UpdateOAMEntries
call AnimCutGrass_SwapOAMEntries
ld c, $8
call AnimCutGrass_UpdateOAMEntries
call AnimCutGrass_SwapOAMEntries
ld hl, wShadowOAMSprite36YCoord
ld a, 2
ld [wCoordAdjustmentAmount], a
ld c, 4
call AdjustOAMBlockYPos2
pop bc
dec c
jr nz, .cutGrassLoop
ret
AnimCutGrass_UpdateOAMEntries:
push bc
ld hl, wShadowOAMSprite36XCoord
ld a, 1
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wShadowOAMSprite37XCoord
ld a, 2
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wShadowOAMSprite38XCoord
ld a, -2
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wShadowOAMSprite39XCoord
ld a, -1
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
call DelayFrame
pop bc
dec c
jr nz, AnimCutGrass_UpdateOAMEntries
ret
AnimCutGrass_SwapOAMEntries:
ld hl, wShadowOAMSprite36
ld de, wBuffer
ld bc, $8
call CopyData
ld hl, wShadowOAMSprite38
ld de, wShadowOAMSprite36
ld bc, $8
call CopyData
ld hl, wBuffer
ld de, wShadowOAMSprite38
ld bc, $8
jp CopyData