; inputs:
; hl: ptr to y/x position
; de: collision point table
+ ; ct_mask: bit mask for flag to check
; returns:
; a = 0 -> no collision
; a = 1 -> collision
; inputs:
; d : y pos
; e : x pos
+ ; ct_mask: bit mask for flag to check (tile & mask)
; returns:
; a = 0 -> no collision
; a = 1 -> collision
ld a, [hl] ; a = map flags row offset
add a, e ; row + x = position of tile in map
+ ld d, 0
+ ld e, a ; de = tile offset
+ ld hl, curr_room_flags ; hl = flags for currently loaded room
+ add hl, de ; hl + de
+ ld a, [hl] ; load flags
+ ld d, a
+ ld a, [ct_mask]
+ and a, d
+
ret