pokered/engine/movie/title2.asm

121 lines
1.7 KiB
NASM
Raw Normal View History

2016-06-12 00:24:04 +00:00
TitleScroll_WaitBall:
2014-05-22 22:13:20 +00:00
; Wait around for the TitleBall animation to play out.
; hi: speed
; lo: duration
db $05, $05, 0
2016-06-12 00:24:04 +00:00
TitleScroll_In:
2014-05-22 22:13:20 +00:00
; Scroll a TitleMon in from the right.
; hi: speed
; lo: duration
db $a2, $94, $84, $63, $52, $31, $11, 0
2016-06-12 00:24:04 +00:00
TitleScroll_Out:
2014-05-22 22:13:20 +00:00
; Scroll a TitleMon out to the left.
; hi: speed
; lo: duration
db $12, $22, $32, $42, $52, $62, $83, $93, 0
2016-06-12 00:24:04 +00:00
TitleScroll:
2014-05-22 22:13:20 +00:00
ld a, d
ld bc, TitleScroll_In
ld d, $88
ld e, 0 ; don't animate titleball
and a
jr nz, .ok
ld bc, TitleScroll_Out
ld d, $00
ld e, 0 ; don't animate titleball
.ok
2016-06-12 00:24:04 +00:00
_TitleScroll:
2014-05-22 22:13:20 +00:00
ld a, [bc]
and a
ret z
inc bc
push bc
ld b, a
and $f
ld c, a
ld a, b
and $f0
swap a
ld b, a
.loop
ld h, d
ld l, $48
call .ScrollBetween
ld h, $00
ld l, $88
call .ScrollBetween
ld a, d
add b
ld d, a
call GetTitleBallY
dec c
jr nz, .loop
pop bc
jr _TitleScroll
2016-06-12 04:30:05 +00:00
.ScrollBetween:
2014-05-22 22:13:20 +00:00
.wait
ldh a, [rLY] ; rLY
2014-05-22 22:13:20 +00:00
cp l
jr nz, .wait
ld a, h
ldh [rSCX], a
2014-05-22 22:13:20 +00:00
.wait2
ldh a, [rLY] ; rLY
2014-05-22 22:13:20 +00:00
cp h
jr z, .wait2
ret
2016-06-12 00:24:04 +00:00
TitleBallYTable:
2014-05-22 22:13:20 +00:00
; OBJ y-positions for the Poke Ball held by Red in the title screen.
; This is really two 0-terminated lists. Initiated with an index of 1.
db 0, $71, $6f, $6e, $6d, $6c, $6d, $6e, $6f, $71, $74, 0
2016-06-12 00:24:04 +00:00
TitleScreenAnimateBallIfStarterOut:
2014-05-22 22:13:20 +00:00
; Animate the TitleBall if a starter just got scrolled out.
2015-07-17 07:16:27 +00:00
ld a, [wTitleMonSpecies]
2014-05-22 22:13:20 +00:00
cp STARTER1
jr z, .ok
cp STARTER2
jr z, .ok
cp STARTER3
ret nz
.ok
ld e, 1 ; animate titleball
ld bc, TitleScroll_WaitBall
ld d, 0
jp _TitleScroll
2016-06-12 00:24:04 +00:00
GetTitleBallY:
2014-05-22 22:13:20 +00:00
; Get position e from TitleBallYTable
push de
push hl
xor a
ld d, a
ld hl, TitleBallYTable
add hl, de
ld a, [hl]
pop hl
pop de
and a
ret z
2022-07-09 21:18:18 +00:00
ld [wShadowOAMSprite10YCoord], a
2014-05-22 22:13:20 +00:00
inc e
ret