mirror of
https://github.com/thornAvery/jep-hack.git
synced 2025-09-17 02:30:50 +12:00
37 lines
688 B
NASM
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
|