Geekboy

Untitled

Mar 30th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. moveang:
  2.  ;jp $
  3.  
  4.  ; assumes x,y are in on teh table in the form of ss.^^^^^^ \ jp $
  5.  
  6.  pop hl             ;then advance SP so the bullet table handler can continue
  7.            ;doubling the spread
  8.  
  9.  ld c,a
  10.  ld b,$82           ;and now complete the address thinger. in BC
  11.  rlc L \ rlc L      ;From %ss.yyyyyy to %yyyyyy.ss
  12.  ld a,(bc)          ;Get %AAAaaaaa. Let's use upper 3 bits
  13.  rlca \ rlca \ rlca ;Got %aaaaaAAA
  14.  and %00000111
  15.  bit 7,c
  16.  jp z,_
  17.  neg    ;We had a positive number but we need movement in negative
  18. _:
  19.  add a,L
  20.  ;jp nc,PBTDestroy   ;Bullet went past top. Destroy it.
  21.  ;cp 240
  22.  ;jp nc,PBTDestroy    ; special case handling for top of screen shooting people
  23.  ld L,a
  24.  ld a,c
  25.  add a,64
  26.  ld c,a
  27.  ld a,(bc)          ;Getting X angle.
  28.  rlca \ rlca \ rlca ;like above
  29.  and %00000111
  30.  ld b,a
  31.  ld a,c
  32.  and %11000000
  33.  ld a,b    
  34.  ; *phew*. Almost looks like I know what I'm doing :P  
  35.  
  36.  jp po,_        
  37.  neg
  38. _:
  39.  rlc h \ rlc h
  40.  add a,h
  41.  ld h,a
  42.  and %11111100
  43.  ;jp z,PBTDestroy
  44.  
  45.  rrc h \ rrc h
  46.  rrc L \ rrc L
  47.  push hl
  48.  pop hl
  49.  jp PBTMainMoveRet ;stack unavailable
Advertisement
Add Comment
Please, Sign In to add comment