summaryrefslogtreecommitdiff
path: root/src/engine/home.asm
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2018-07-17 14:24:09 +0200
committerxCrystal <rgr.crystal@gmail.com>2018-07-17 14:24:09 +0200
commiteb87f849ff7a0ec07a27035fb183234ed04ef540 (patch)
treecdbe7ea8c0430e64a89cad5e93b250f6291677c9 /src/engine/home.asm
parent80a5aa82a0ab5b786ceaf1edb2e05375fa89d7c4 (diff)
map permission functions
Diffstat (limited to 'src/engine/home.asm')
-rw-r--r--src/engine/home.asm23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/engine/home.asm b/src/engine/home.asm
index 948d810..a922861 100644
--- a/src/engine/home.asm
+++ b/src/engine/home.asm
@@ -10592,31 +10592,35 @@ Func_3917: ; 3917 (0:3917)
call DisableSRAM
ret
-GetFloorObjectFromPos: ; 3927 (0:3927)
+; return in a the permission byte corresponding to the current map's x,y coordinates at bc
+GetPermissionOfMapPosition: ; 3927 (0:3927)
push hl
- call FindFloorTileFromPos
+ call GetPermissionByteOfMapPosition
ld a, [hl]
pop hl
ret
; 0x392e
-SetFloorObjectFromPos: ; 392e (0:392e)
+; set to a the permission byte corresponding to the current map's x,y coordinates at bc
+SetPermissionOfMapPosition: ; 392e (0:392e)
push hl
push af
- call FindFloorTileFromPos
+ call GetPermissionByteOfMapPosition
pop af
ld [hl], a
pop hl
ret
; 0x3937
-UpdateFloorObjectFromPos: ; 3937 (0:3937)
+; set the permission byte corresponding to the current map's x,y coordinates at bc
+; to the value of register a anded by its current value
+UpdatePermissionOfMapPosition: ; 3937 (0:3937)
push hl
push bc
push de
cpl
ld e, a
- call FindFloorTileFromPos
+ call GetPermissionByteOfMapPosition
ld a, [hl]
and e
ld [hl], a
@@ -10626,8 +10630,9 @@ UpdateFloorObjectFromPos: ; 3937 (0:3937)
ret
; 0x3946
-; puts a floor tile in hl given coords in bc (x,y. measured in tiles)
-FindFloorTileFromPos: ; 3946 (0:3946)
+; returns in hl the address within wPermissionMap that corresponds to
+; the current map's x,y coordinates at bc
+GetPermissionByteOfMapPosition: ; 3946 (0:3946)
push bc
srl b
srl c
@@ -10637,7 +10642,7 @@ FindFloorTileFromPos: ; 3946 (0:3946)
or b
ld c, a
ld b, $0
- ld hl, wFloorObjectMap
+ ld hl, wPermissionMap
add hl, bc
pop bc
ret