jep-hack/home/moves.asm
Zeta_Null 2f8a41f833 First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
2023-09-10 12:35:35 -04:00

37 lines
688 B
NASM

GetMoveAttribute::
; Return attribute a of move l in a; clobbers hl.
; Replaces the old GetMoveAttr (renamed to avoid confusion).
sub 1
push bc
ld c, a
ld a, l
jr c, .done
call GetMoveAddress
ld b, 0
add hl, bc
call GetFarByte
.done
pop bc
ret
GetMoveAddress::
; Get the far address for move a's attributes in a:hl.
; This structure will not contain the animation byte! All MOVE_* constants must be reduced by 1 when indexing.
push bc
call GetMoveIndexFromID
ld b, h
ld c, l
ld hl, Moves
ld a, BANK(Moves)
call LoadIndirectPointer
pop bc
ret
GetMoveData::
; Copy move struct a to de.
ld [de], a
inc de
call GetMoveAddress
ld bc, MOVE_LENGTH - 1
jp FarCopyBytes