From 4c70f4092a6f67ab60998d9b16a32884021751ca Mon Sep 17 00:00:00 2001 From: Forest Belton <65484+forestbelton@users.noreply.github.com> Date: Thu, 1 Jul 2021 06:00:57 -0400 Subject: [PATCH] Remove unused function --- src/collision.s | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/src/collision.s b/src/collision.s index 9057ddf..83d3e2e 100644 --- a/src/collision.s +++ b/src/collision.s @@ -2,49 +2,8 @@ INCLUDE "oam.inc" SECTION "Collision", ROMX -; Check whether a 16x16 metasprite collides with the background -; @param a The index of the first (top left) OAM entry of the sprite -; @destroy hl -; note: doesn't work atm (use srl, not sra?) -sprite16x16_bg_collides:: - ; compute oam entry address (_OAM + a * 4) - ; a is guaranteed not to overflow since l = $00 and a < 40 - ld hl, _OAM - sla a - sla a - add l - ld l, a - - ; top left (x,y) - ld a, [hl+] - sra a - sra a - sra a - ld c, [hl] - sra c - sra c - sra c - call can_move_to - ret nz - - ; other three sprites - REPT 3 - ld a, [hl+] - sra a - sra a - sra a - ld c, [hl] - sra c - sra c - sra c - call can_move_to - ret nz - ENDR - - ret - player_bg_collides:: - ; c = x/8 + ; c = x % 8 == 0 ? x/8 : x/8 + 1 ld hl, PLAYER_X ld a, [hl] ld c, a @@ -58,7 +17,7 @@ player_bg_collides:: srl c srl c - ; b = y/8 + ; b = y % 8 == 0 ? y/8 : y/8 + 1 inc hl ld a, [hl] ld b, a