Geekboy

Untitled

Apr 9th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. InitLut:
  2. ;Moves a bullet based on a LUT
  3. ;Pre read decriment start by checking counter accomplished by checking state of what it was before hand
  4. ; Counter of 1 means next LUT entry
  5. ; Count of 0 means return to player via arctan
  6.  ld ix,(pTemp1)    ; current LUT address. yay static adressing
  7.  ld hl,-4          ; ld hl with the start of the bullet table enntry
  8.  add hl,sp         ;
  9.  ld
  10.  ld a,(ix)
  11.  and %01111111     ; put angle into USER
  12.  ld (hl),a
  13.  inc hl            ; point hl to flags
  14.  ld a,(ix+1)       ;
  15.  add a,a           ;shifts over and clears the lower bits via magic
  16.  add a,a           ; curtosy of calc84maniac
  17.  ld b,a
  18.  ld a,(hl)         ; put flags in a
  19.  or b              ; merge into a
  20.  ld (hl),a         ; put back into flags
  21. LutHandlerStart
  22. ;Flow
  23. ;Decrement timer
  24. ;Check for z or c
  25. ;If z move to next
  26. ;if c move to follow player
  27. ;else increment based on type
  28. ; assume nothing is loaded as we may jump back here. later.
  29.  ld hl,-3
  30.  add hl,sp
  31.  ld a,(hl)  ; ld a with flags
  32.  ld b,a save in b
  33.  rla \ rla
  34.  dec a             ; shift dec
  35.  add a.a \ add a,a ; shift back
  36.  or b
  37.  jr C,FollowPlayer
  38.  jr z,IncLut
  39.  ld (hl),a         ; save back into flags
Advertisement
Add Comment
Please, Sign In to add comment