projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b17c083
)
wip: map tile flag lookup
author
Lukas Krickl
<lukas@krickl.dev>
Fri, 11 Oct 2024 11:13:48 +0000
(13:13 +0200)
committer
Lukas Krickl
<lukas@krickl.dev>
Fri, 11 Oct 2024 11:13:48 +0000
(13:13 +0200)
src/collision.s
patch
|
blob
|
history
diff --git
a/src/collision.s
b/src/collision.s
index d1bca5e2a202ef289ec6a662e9d3e39bf57811e1..2b9e5d709e798f5316d5bb15cc3f552c39e93ab9 100644
(file)
--- a/
src/collision.s
+++ b/
src/collision.s
@@
-75,9
+75,19
@@
collision_tile:
sra e ; / 4
sra e ; / 8
sra e ; / 16
+ ld a, e ; a = x pos
+
+ ld e, d
+ ld d, 0 ; de = y position now
; -> now convert position to
; map flag index using a simple lut
; for y position + x
+ ld hl, collision_tile_lut
+ add hl, de ; hl + y offset
+ ; hl = row ptr
+ ld e, a ; e = x pos
+ ld a, [hl] ; a = map flags row offset
+ add a, e ; row + x = position of tile in map
ret