Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/movie/title2.asm
1271 views
1
TitleScroll_WaitBall:
2
; Wait around for the TitleBall animation to play out.
3
; hi: speed
4
; lo: duration
5
db $05, $05, 0
6
7
TitleScroll_In:
8
; Scroll a TitleMon in from the right.
9
; hi: speed
10
; lo: duration
11
db $a2, $94, $84, $63, $52, $31, $11, 0
12
13
TitleScroll_Out:
14
; Scroll a TitleMon out to the left.
15
; hi: speed
16
; lo: duration
17
db $12, $22, $32, $42, $52, $62, $83, $93, 0
18
19
TitleScroll:
20
ld a, d
21
22
ld bc, TitleScroll_In
23
ld d, $88
24
ld e, 0 ; don't animate titleball
25
26
and a
27
jr nz, .ok
28
29
ld bc, TitleScroll_Out
30
ld d, $00
31
ld e, 0 ; don't animate titleball
32
.ok
33
34
_TitleScroll:
35
ld a, [bc]
36
and a
37
ret z
38
39
inc bc
40
push bc
41
42
ld b, a
43
and $f
44
ld c, a
45
ld a, b
46
and $f0
47
swap a
48
ld b, a
49
50
.loop
51
ld h, d
52
ld l, $48
53
call .ScrollBetween
54
55
ld h, $00
56
ld l, $88
57
call .ScrollBetween
58
59
ld a, d
60
add b
61
ld d, a
62
63
call GetTitleBallY
64
dec c
65
jr nz, .loop
66
67
pop bc
68
jr _TitleScroll
69
70
.ScrollBetween:
71
.wait
72
ldh a, [rLY] ; rLY
73
cp l
74
jr nz, .wait
75
76
ld a, h
77
ldh [rSCX], a
78
79
.wait2
80
ldh a, [rLY] ; rLY
81
cp h
82
jr z, .wait2
83
ret
84
85
TitleBallYTable:
86
; OBJ y-positions for the Poke Ball held by Red in the title screen.
87
; This is really two 0-terminated lists. Initiated with an index of 1.
88
db 0, $71, $6f, $6e, $6d, $6c, $6d, $6e, $6f, $71, $74, 0
89
90
TitleScreenAnimateBallIfStarterOut:
91
; Animate the TitleBall if a starter just got scrolled out.
92
ld a, [wTitleMonSpecies]
93
cp STARTER1
94
jr z, .ok
95
cp STARTER2
96
jr z, .ok
97
cp STARTER3
98
ret nz
99
.ok
100
ld e, 1 ; animate titleball
101
ld bc, TitleScroll_WaitBall
102
ld d, 0
103
jp _TitleScroll
104
105
GetTitleBallY:
106
; Get position e from TitleBallYTable
107
push de
108
push hl
109
xor a
110
ld d, a
111
ld hl, TitleBallYTable
112
add hl, de
113
ld a, [hl]
114
pop hl
115
pop de
116
and a
117
ret z
118
ld [wShadowOAMSprite10YCoord], a
119
inc e
120
ret
121
122