Geekboy

Untitled

Feb 1st, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nanamiTest:
  2. ;1
  3. ;Moves the bullet in the directoin given via an angle
  4. ; the angle is gotten from a lut and the lower bits of the counter are used for the lut table loc
  5. ; t = Ftttttt
  6. ; charweapondat holds the ttl for the angle
  7. ;E=Y D=X
  8.  ;inc e \ inc d           ;modify for collision routine
  9.  ;ld ix,PBMoveANGcont     ;return address for collision routine
  10.  ;jp SmallBulletCollision ;IN: DE=XY,
  11. PBMoveANGcont:
  12. ; dec e \ dec d     ;unmodify from collision routine
  13.  push de           ;move the stack back for something...
  14. ;********************************
  15. ;If you needed to modify the counter, you will need the following code.
  16. ;AND DON'T FORGET TO PRESERVE BIT 7 OF L SINCE THAT IS THE FOCUSED FLAG.
  17.  dec sp \ pop hl   ;ENTER CODE
  18.  ; Lut pos is in L
  19.  ld a,(charweapondat)
  20.  and %01111111
  21.  cp 1
  22.  jp c,_            ; if the counter is at 0 we destroy the bullet
  23.  jp z,INCLUT       ; if lut is 1 move to the next item on it
  24.  
  25.  push hl \ inc sp
  26.  ld a,l            ; put offset into a
  27.  and %01111111     ; clear focus bit
  28.  ld hl,nanami45LUT ; load hl with LUTptr
  29.  inc a             ; do this so we are looking at the second item at the pointer
  30.  add a,l           ; add l to a to make
  31.  ld l,a            ; LUT+ofs
  32.  ld a,(hl)         ; store the angle we get into a
  33.  jp ++_
  34. _:
  35.  pop de
  36.  jp PBTDestroy
  37. INCLUT:            ; must inc lut value by 2
  38.  ld b,a
  39.  ld a,l
  40.  inc a \ inc a
  41.  Xor l
  42.  and %01111111
  43.  xor l
  44.  ld l,A        
  45.  push hl \ inc sp  ;EXIT CODE
  46.  ld hl,nanamiLUT45
Add Comment
Please, Sign In to add comment