Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InitLut:
- ;Moves a bullet based on a LUT
- ;Pre read decriment start by checking counter accomplished by checking state of what it was before hand
- ; Counter of 1 means next LUT entry
- ; Count of 0 means return to player via arctan
- ld ix,(pTemp1) ; current LUT address. yay static adressing
- ld hl,-4 ; ld hl with the start of the bullet table enntry
- add hl,sp ;
- ld
- ld a,(ix)
- and %01111111 ; put angle into USER
- ld (hl),a
- inc hl ; point hl to flags
- ld a,(ix+1) ;
- add a,a ;shifts over and clears the lower bits via magic
- add a,a ; curtosy of calc84maniac
- ld b,a
- ld a,(hl) ; put flags in a
- or b ; merge into a
- ld (hl),a ; put back into flags
- LutHandlerStart
- ;Flow
- ;Decrement timer
- ;Check for z or c
- ;If z move to next
- ;if c move to follow player
- ;else increment based on type
- ; assume nothing is loaded as we may jump back here. later.
- ld hl,-3
- add hl,sp
- ld a,(hl) ; ld a with flags
- ld b,a save in b
- rla \ rla
- dec a ; shift dec
- add a.a \ add a,a ; shift back
- or b
- jr C,FollowPlayer
- jr z,IncLut
- ld (hl),a ; save back into flags
Advertisement
Add Comment
Please, Sign In to add comment