summaryrefslogtreecommitdiff
path: root/engine/battle/scroll_draw_trainer_pic.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2015-04-01 16:51:04 +0200
committerxCrystal <rgr.crystal@gmail.com>2015-04-01 17:05:50 +0200
commit2fe782b11a039b52fd236da28fb2f1ae10cae7db (patch)
tree580cc7bf8b0ebd617fd0ba0440618d38c355aa83 /engine/battle/scroll_draw_trainer_pic.asm
parent77d0e5ff84cc61ae625da19f184094241eddd4dc (diff)
Rename battle files and split move effects Part 4
e.asm, e_2. asm, and 14.asm
Diffstat (limited to 'engine/battle/scroll_draw_trainer_pic.asm')
-rw-r--r--engine/battle/scroll_draw_trainer_pic.asm50
1 files changed, 50 insertions, 0 deletions
diff --git a/engine/battle/scroll_draw_trainer_pic.asm b/engine/battle/scroll_draw_trainer_pic.asm
new file mode 100644
index 00000000..18df86e0
--- /dev/null
+++ b/engine/battle/scroll_draw_trainer_pic.asm
@@ -0,0 +1,50 @@
+_ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
+; Load the enemy trainer's pic and scrolls it into
+; the screen from the right.
+ xor a
+ ld [wEnemyMonSpecies2], a
+ ld b, $1
+ call GoPAL_SET
+ callab _LoadTrainerPic
+ hlCoord 19, 0
+ ld c, $0
+.scrollLoop
+ inc c
+ ld a, c
+ cp 7
+ ret z
+ ld d, $0
+ push bc
+ push hl
+.drawTrainerPicLoop
+ call DrawTrainerPicColumn
+ inc hl
+ ld a, 7
+ add d
+ ld d, a
+ dec c
+ jr nz, .drawTrainerPicLoop
+ ld c, 4
+ call DelayFrames
+ pop hl
+ pop bc
+ dec hl
+ jr .scrollLoop
+
+; write one 7-tile column of the trainer pic to the tilemap
+DrawTrainerPicColumn: ; 39707 (e:5707)
+ push hl
+ push de
+ push bc
+ ld e, 7
+.loop
+ ld [hl], d
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ inc d
+ dec e
+ jr nz, .loop
+ pop bc
+ pop de
+ pop hl
+ ret