KDLPro

Category Display Implementation

Oct 20th, 2021 (edited)
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. GetMoveCategoryIcon:
  2.     call GetMoveType
  3.  
  4.     ld de, PhysicalIconGFX
  5.     lb bc, PAL_BATTLE_OB_RED, 2
  6.     and a
  7.     jr z, .done
  8.     ld de, SpecialIconGFX
  9.     ld b, PAL_BATTLE_OB_GREEN
  10.     cp 1
  11.     jr z, .done
  12.     ld de, StatusIconGFX
  13.     ld b, PAL_BATTLE_OB_BLUE
  14.    
  15. .done
  16.     push bc
  17.     ld b, BANK(CategoryImages) ; c = 4
  18.     ld hl, vTiles0
  19.     call Request2bpp
  20.     pop bc
  21.     ld hl, wVirtualOAMSprite00
  22.     ld de, .CategoryImagesOAMData
  23. .loop
  24.     ld a, [de]
  25.     inc de
  26.     ld [hli], a
  27.     ld a, [de]
  28.     inc de
  29.     ld [hli], a
  30.     dec c
  31.     ld a, c
  32.     ld [hli], a
  33.     ld a, b
  34.     ld [hli], a
  35.     jr nz, .loop
  36.     ret
  37.  
  38. .CategoryImagesOAMData
  39. ; positions are backwards since
  40. ; we load them in reverse order
  41.     db $58, $44 ; y/x - right
  42.     db $58, $3c ; y/x - left
Add Comment
Please, Sign In to add comment