print_type.asm 716 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ; [wd0b5] = pokemon ID
  2. ; hl = dest addr
  3. PrintMonType:
  4. call GetPredefRegisters
  5. push hl
  6. call GetMonHeader
  7. pop hl
  8. push hl
  9. ld a, [wMonHType1]
  10. call PrintType
  11. ld a, [wMonHType1]
  12. ld b, a
  13. ld a, [wMonHType2]
  14. cp b
  15. pop hl
  16. jr z, EraseType2Text
  17. ld bc, SCREEN_WIDTH * 2
  18. add hl, bc
  19. ; a = type
  20. ; hl = dest addr
  21. PrintType:
  22. push hl
  23. jr PrintType_
  24. ; erase "TYPE2/" if the mon only has 1 type
  25. EraseType2Text:
  26. ld a, " "
  27. ld bc, $13
  28. add hl, bc
  29. ld bc, $6
  30. jp FillMemory
  31. PrintMoveType:
  32. call GetPredefRegisters
  33. push hl
  34. ld a, [wPlayerMoveType]
  35. ; fall through
  36. PrintType_:
  37. add a
  38. ld hl, TypeNames
  39. ld e, a
  40. ld d, $0
  41. add hl, de
  42. ld a, [hli]
  43. ld e, a
  44. ld d, [hl]
  45. pop hl
  46. jp PlaceString
  47. INCLUDE "text/type_names.asm"