scroll_draw_trainer_pic.asm 719 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. callab _LoadTrainerPic
  9. coord hl, 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. ; write one 7-tile column of the trainer pic to the tilemap
  34. DrawTrainerPicColumn:
  35. push hl
  36. push de
  37. push bc
  38. ld e, 7
  39. .loop
  40. ld [hl], d
  41. ld bc, SCREEN_WIDTH
  42. add hl, bc
  43. inc d
  44. dec e
  45. jr nz, .loop
  46. pop bc
  47. pop de
  48. pop hl
  49. ret