summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/bank03.asm6
-rw-r--r--src/engine/home.asm23
2 files changed, 17 insertions, 12 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index aac9c1b..744a3ef 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -677,7 +677,7 @@ Func_c58b: ; c58b (3:458b)
ld b, a
ld a, [wPlayerYCoord]
ld c, a
- call GetFloorObjectFromPos
+ call GetPermissionOfMapPosition
and $10
push af
ld c, SPRITE_ANIM_FIELD_0F
@@ -776,7 +776,7 @@ AttemptScriptedMovement: ; c619 (3:4619)
ld a, c
cp $1f
jr nc, .quit_movement
- call GetFloorObjectFromPos
+ call GetPermissionOfMapPosition
and $40 | $80 ; the two impassable objects found in the floor map
jr nz, .quit_movement
ld a, b
@@ -943,7 +943,7 @@ Func_c71e: ; c71e (3:471e)
ld a, $ff
ld [wd3b6], a
call Func_c653
- call GetFloorObjectFromPos
+ call GetPermissionOfMapPosition
and $40
jr z, .asm_c73d
farcall Func_1c72e
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