Geekboy

Untitled

Mar 11th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. moveang:
  2.  ;jp $
  3.  pop hl             ;then advance SP so the bullet table handler can continue
  4.            ;doubling the spread
  5.  
  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.  ld b,a
  28.  ld a,c
  29.  and %11000000
  30.  ld a,b    
  31.  ; *phew*. Almost looks like I know what I'm doing :P  
  32.  jp po,_        
  33.  neg
  34. _:
  35.  rlc h \ rlc h
  36.  add a,h
  37.  ld h,a
  38.  and %11111100
  39.  ;jp z,PBTDestroy
  40.  
  41.  rrc h \ rrc h
  42.  rrc L \ rrc L
  43.  push hl
  44.  pop hl
  45.  jp PBTMainMoveRet ;stack unavailable
Advertisement
Add Comment
Please, Sign In to add comment