Geekboy

Untitled

May 22nd, 2013
87
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.  dec sp
  6.  dec sp
  7.  pop hl
  8.  ;then advance SP so the bullet table handler can continue
  9.            ;doubling the spread
  10.  
  11.  ld c,a
  12.  ld b,$82           ;and now complete the address thinger. in BC
  13.  rlc L \ rlc L      ;From %ss.yyyyyy to %yyyyyy.ss
  14.  ld a,(bc)          ;Get %AAAaaaaa. Let's use upper 3 bits
  15.  rlca \ rlca \ rlca ;Got %aaaaaAAA
  16.  and %00000111
  17.  bit 7,c
  18.  jp z,_
  19.  neg    ;We had a positive number but we need movement in negative
  20. _:
  21.  add a,L
  22.  ;jp nc,PBTDestroy   ;Bullet went past top. Destroy it.
  23.  ;cp 240
  24.  ;jp nc,PBTDestroy    ; special case handling for top of screen shooting people
  25.  ld L,a
  26.  ld a,c
  27.  add a,-64
  28.  ld c,a
  29.  ld a,(bc)          ;Getting X angle.
  30.  rlca \ rlca \ rlca ;like above
  31.  and %00000111
  32.  ld b,a
  33.  ld a,c
  34.  and %11000000
  35.  ld a,b    
  36.  ; *phew*. Almost looks like I know what I'm doing :P  
  37.  jp pe,_
  38.  
  39.  neg
  40. _:
  41.  rlc h \ rlc h
  42.  add a,h
  43.  ld h,a
  44.  and %11111100
  45.  ;jp z,PBTDestroy
  46.  
  47.  rrc h \ rrc h
  48.  rrc L \ rrc L
  49.  ex de,hl
  50.  ld hl,-2
  51.  add hl,sp
  52.  ld (hl),d
  53.  push hl
  54.  pop hl
  55.  jp PSHT_MoveAndCollidePlayerBulletLoopReturn ;stack unavailable
Advertisement
Add Comment
Please, Sign In to add comment