Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- overlap:
- // only size 16x16 pixel
- // l-X1,h-Y1 (sprite coordinates)
- // e-X2,d-Y2 (other sprite coordinates)
- // crash regs: A,B
- // return: A
- ld b,0
- ld a,e
- add 15
- cp l
- jr c,oo3
- inc b
- oo3:
- ld a,l
- add 16
- cp e
- jr nc,oo4
- inc b
- oo4:
- ld a,d
- add 16
- cp h
- jr nc,oo5
- inc b
- oo5:
- ld a,h
- add 15
- cp d
- jr c,oo6
- inc b
- oo6:
- ld a,b
- // overlap if A == 2
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement