Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/battle/scroll_draw_trainer_pic.asm
1271 views
1
_ScrollTrainerPicAfterBattle:
2
; Load the enemy trainer's pic and scrolls it into
3
; the screen from the right.
4
xor a
5
ld [wEnemyMonSpecies2], a
6
ld b, SET_PAL_BATTLE
7
call RunPaletteCommand
8
callfar _LoadTrainerPic
9
hlcoord 19, 0
10
ld c, $0
11
.scrollLoop
12
inc c
13
ld a, c
14
cp 7
15
ret z
16
ld d, $0
17
push bc
18
push hl
19
.drawTrainerPicLoop
20
call DrawTrainerPicColumn
21
inc hl
22
ld a, 7
23
add d
24
ld d, a
25
dec c
26
jr nz, .drawTrainerPicLoop
27
ld c, 4
28
call DelayFrames
29
pop hl
30
pop bc
31
dec hl
32
jr .scrollLoop
33
34
; write one 7-tile column of the trainer pic to the tilemap
35
DrawTrainerPicColumn:
36
push hl
37
push de
38
push bc
39
ld e, 7
40
.loop
41
ld [hl], d
42
ld bc, SCREEN_WIDTH
43
add hl, bc
44
inc d
45
dec e
46
jr nz, .loop
47
pop bc
48
pop de
49
pop hl
50
ret
51
52