Geekboy

Untitled

May 23rd, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Bullet move/collide routines and all shared routines that associates with it
  2.  
  3. PBTMainMove: ;name used here for compatibility with that which calls this.
  4. PSHT_MoveAndCollidePlayerBullet:
  5.  ld hl,PSHT_MoveAndCollideCharacterBulletTable
  6.  call PSHT_SelectRoutine
  7.  ld hl,psht_bitmap
  8.  ld e,(hl)
  9.  ld bc,$4008
  10.  ld (itemp2),sp
  11.  ld sp,$8D00
  12. PSHT_MoveAndCollidePlayerBulletLoopStart:
  13.  rrc e    ;used to check which bullets are empty. Hint: 0=empty.
  14.  exx
  15.  pop bc
  16.  pop de
  17.  jr nc,PSHT_MoveAndCollidePlayerBulletLoopReturn
  18.  ld hl,(itemp3)
  19.  bit 1,b
  20.  jr nz,_
  21.  ld hl,(itemp4)
  22. _:
  23.  jp (hl)
  24. PSHT_MoveAndCollidePlayerBulletLoopReturn:
  25.  exx
  26.  dec c
  27.  jr nz,_
  28.  ld c,8  ;snap back to 8 bits in a byte
  29.  inc hl  ;and increment to next byte in the bitmap table
  30.  ld e,(hl)
  31. _:
  32.  djnz PSHT_MoveAndCollidePlayerBulletLoopStart
  33.  ld sp,(itemp2)
  34.  ret
Advertisement
Add Comment
Please, Sign In to add comment