Geekboy

Untitled

Feb 3rd, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. moveang:
  2.  pop hl             ;then advance SP so the bullet table handler can continue
  3.  and %01111111
  4.  add a,a            ;doubling the spread
  5. ; add a,192-16        ;get true angle spread
  6.  ld c,a
  7.  ld b,$82           ;and now complete the address thinger. in BC
  8.  rlc L \ rlc L      ;From %ss.yyyyyy to %yyyyyy.ss
  9.  ld a,(bc)          ;Get %AAAaaaaa. Let's use upper 3 bits
  10.  rlca \ rlca \ rlca ;Got %aaaaaAAA
  11.  and %00000111
  12.  bit 7,c
  13.  jp z,_
  14.  neg    ;We had a positive number but we need movement in negative
  15. _:
  16.  add a,L
  17.  ;jp nc,PBTDestroy   ;Bullet went past top. Destroy it.
  18.  ;cp 240
  19.  ;jp nc,PBTDestroy    ; special case handling for top of screen shooting people
  20.  ld L,a
  21.  ld a,c
  22.  add a,64
  23.  ld c,a
  24.  ld a,(bc)          ;Getting X angle.
  25.  rlca \ rlca \ rlca ;like above
  26.  and %00000111
  27.  bit 7,c            ;zero-crossing?
  28.  jr z,_             ;jump if not negative.
  29.  neg
  30. _:
  31.  rlc h \ rlc h
  32.  add a,h
  33.  ld h,a
  34.  and %11111100
  35.  jp z,PBTDestroy
  36.  
  37.  rrc h \ rrc h
  38.  rrc L \ rrc L
  39.  push hl
  40.  pop hl
  41.  jp PBTMainMoveRet ;stack unavailable
Advertisement
Add Comment
Please, Sign In to add comment