Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LutHandlerStart:
- ; hl,-3
- ; %ccccccff c = Count F = flags
- ;The Flow
- ;first Decrement timer
- ;Check for z or c
- ;If Count = 2 move to next
- ;if Count = 1 move to follow player
- ;If count = HCF
- ;Else increment based on LUT parameters
- ;assume nothing is loaded as we may jump back here. later. can be removed if needed tho
- ld hl,-3
- add hl,sp
- ld a,(hl) ; ld a with flags
- ld b,a ; save in b
- and %00000011 ; clear count for later
- ld d,a ; save for later
- ld a,b ; restore
- and %11111100 ; clear for math
- rrca \ rrca ;div4 / move count to front of byte
- ld e,a ; save Count
- dec a ; shift dec
- add a,a \ add a,a ; shift back
- or d ; merge back
- ld (hl),a ; save back into flagsk with new values
- ld a,e ; Restore count
- cp 2 ; check values
- jp c,FollowP ; if 1 move to followP
- jr z,IncLut ; if 2 move to next position on lut
Advertisement
Add Comment
Please, Sign In to add comment