projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0010453
)
map: wip get tile sub routine
author
Lukas Krickl
<lukas@krickl.dev>
Tue, 27 May 2025 17:57:06 +0000
(19:57 +0200)
committer
Lukas Krickl
<lukas@krickl.dev>
Tue, 27 May 2025 17:57:06 +0000
(19:57 +0200)
src/map.s
patch
|
blob
|
history
diff --git
a/src/map.s
b/src/map.s
index 58bce1e46ea0411ef4855a5d78e274894a11de50..ea237a018dd19555bc8daeade64ed60c7df829bb 100644
(file)
--- a/
src/map.s
+++ b/
src/map.s
@@
-12,8
+12,8
@@
map_init:
; inputs:
; b/c: y/x tile position
; returns:
- ; a:
tile
- ; b:
flags
+ ; a:
flags
+ ; b:
tile index
map_get_tile:
; current map
ld hl, state_cells
@@
-30,10
+30,14
@@
map_get_tile:
ld e, c
; add x offset c_size times
.rep i, c_size, 1, add hl, de
-
- ; load values
+ ; hl should now be the correct tile
+ ; load values
+ ld a, [hl+] ; tile index
+ ld b, a
+ ld a, [hl] ; tile flags
+
ret
; loads a map