Fixed tile -> player collision by using the correct shift
authorLukas Krickl <lukas@krickl.dev>
Sat, 19 Oct 2024 05:09:58 +0000 (07:09 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 19 Oct 2024 05:09:58 +0000 (07:09 +0200)
instructions.

For future reference sra did not do it because bit 7 might be set in
normal gameplay we needed srl

src/collision.s
src/map.s

index 7afc9857b221f31e05d00ce5145ba9ddb680b3d6..63406bb43c083feaf4132923d18829a7a373ed41 100644 (file)
@@ -103,16 +103,16 @@ collision_tile_table_check:
   ;   a = 1 -> collision
 collision_tile:
   ; y pos / 16 -> tile pos
-  sra d ; / 2
-  sra d ; / 4
-  sra d ; / 8
-  sra d ; / 16
+  srl d ; / 2
+  srl d ; / 4
+  srl d ; / 8
+  srl d ; / 16
 
   ; x pos / 16 -> tile pos 
-  sra e ; / 2
-  sra e ; / 4
-  sra e ; / 8
-  sra e ; / 16
+  srl e ; / 2
+  srl e ; / 4
+  srl e ; / 8
+  srl e ; / 16
   ld a, e ; a = x pos
 
   ld e, d
index 16a6146ff140de26b09171fa6992d4bf7b0be805..5713f4b0e608558dcd7056d73372c37b2cbebf61 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -164,4 +164,4 @@ base_room_flags:
 .db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 
 .db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 
 .db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 
-.db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 
+.db RF_WALL, RF_WALL, RF_WALL, RF_WALL, 0, 0, RF_WALL, RF_WALL, RF_WALL, RF_WALL