Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- moveang:
- ;jp $
- ; assumes x,y are in on teh table in the form of ss.^^^^^^ \ jp $
- dec sp
- dec sp
- pop hl
- ;then advance SP so the bullet table handler can continue
- ;doubling the spread
- ld c,a
- ld b,$82 ;and now complete the address thinger. in BC
- rlc L \ rlc L ;From %ss.yyyyyy to %yyyyyy.ss
- ld a,(bc) ;Get %AAAaaaaa. Let's use upper 3 bits
- rlca \ rlca \ rlca ;Got %aaaaaAAA
- and %00000111
- bit 7,c
- jp z,_
- neg ;We had a positive number but we need movement in negative
- _:
- add a,L
- ;jp nc,PBTDestroy ;Bullet went past top. Destroy it.
- ;cp 240
- ;jp nc,PBTDestroy ; special case handling for top of screen shooting people
- ld L,a
- ld a,c
- add a,-64
- ld c,a
- ld a,(bc) ;Getting X angle.
- rlca \ rlca \ rlca ;like above
- and %00000111
- ld b,a
- ld a,c
- and %11000000
- ld a,b
- ; *phew*. Almost looks like I know what I'm doing :P
- jp pe,_
- neg
- _:
- rlc h \ rlc h
- add a,h
- ld h,a
- and %11111100
- ;jp z,PBTDestroy
- rrc h \ rrc h
- rrc L \ rrc L
- ex de,hl
- ld hl,-2
- add hl,sp
- ld (hl),d
- push hl
- pop hl
- jp PSHT_MoveAndCollidePlayerBulletLoopReturn ;stack unavailable
Advertisement
Add Comment
Please, Sign In to add comment