wip: added static location for collision check inputs
authorLukas Krickl <lukas@krickl.dev>
Thu, 10 Oct 2024 17:51:26 +0000 (19:51 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 10 Oct 2024 17:51:26 +0000 (19:51 +0200)
src/collision.s
src/wram.s

index bb544289d2c41d881a797d4af42e5ef36b0b271a..d1bca5e2a202ef289ec6a662e9d3e39bf57811e1 100644 (file)
@@ -32,12 +32,31 @@ collision_player:
 collision_tile_lut:
   .rep cti, ROOM_H, 1, .db cti * ROOM_W 
 
+  ; collision-tile call 
+  ; but using static 
+  ; params in wram:
+  ;   inputs:
+  ;     ct_pty/ct_ptx: collision tile y/x
+  ;     ct_pox/ct_poy: position y/x
+collision_tile_stat:
+  ld a, [ct_pty]
+  ld b, a ; b = pty
+
+  ld a, [ct_ptx]
+  ld c, a ; c = ptx
+
+  ld a, [ct_poy]
+  ld d, a ; d = poy
+
+  ld a, [ct_poy]
+  ld e, a ; e = pox
+
   ; checks a collision ptr 
   ; with a map's meta tile
   ; if the tile has collision flag set 
   ; returns 1 otherwise 0
   ; inputs:
-  ;   [hl]: collision point (y/x) 
+  ;   b/c: collision point (y/x) 
   ;     d : y pos 
   ;     e : x pos
   ; returns:
index 86eb1085567a5cc8430d4e6dba7dcf3b99b91131..376b85fb80a9ceb06fab916a3231b0fb02248723 100644 (file)
@@ -121,3 +121,9 @@ game_over_timer: .adv 1
 .de GAME_OVER, 1
 
 game_mode: .adv 1
+
+  ; collision tile params 
+ct_pty: .adv 1
+ct_ptx: .adv 1
+ct_poy: .adv 1
+ct_pox: .adv 1