summaryrefslogtreecommitdiff
path: root/engine/hidden_object_functions3.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2014-09-14 11:29:18 -0700
committerYamaArashi <shadow962@live.com>2014-09-14 11:29:18 -0700
commit2ed65d9c3e3ba60939ebe2928ffddc06a90b1876 (patch)
tree0efc4cb1b79494d119524b120d27c8c5b74a6a05 /engine/hidden_object_functions3.asm
parent0c916aea3353ed1bf2750be403b0da9ea0b922d4 (diff)
Commented/labelled misc functions
Diffstat (limited to 'engine/hidden_object_functions3.asm')
-rwxr-xr-xengine/hidden_object_functions3.asm27
1 files changed, 14 insertions, 13 deletions
diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm
index 09d9ebcc..d3d83f08 100755
--- a/engine/hidden_object_functions3.asm
+++ b/engine/hidden_object_functions3.asm
@@ -1,22 +1,23 @@
; prints text for bookshelves in buildings without sign events
PrintBookshelfText: ; fb50 (3:7b50)
- ld a, [wSpriteStateData1 + 9]
- cp $4
- jr nz, .asm_fb7f
- ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
+ ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ cp SPRITE_FACING_UP
+ jr nz, .noMatch
+; facing up
+ ld a, [W_CURMAPTILESET]
ld b, a
aCoord 8, 7
ld c, a
- ld hl, BookshelfTileIDs ; $7b8b
-.asm_fb62
+ ld hl, BookshelfTileIDs
+.loop
ld a, [hli]
cp $ff
- jr z, .asm_fb7f
+ jr z, .noMatch
cp b
- jr nz, .asm_fb7b
+ jr nz, .nextBookshelfEntry1
ld a, [hli]
cp c
- jr nz, .asm_fb7c
+ jr nz, .nextBookshelfEntry2
ld a, [hl]
push af
call EnableAutoTextBoxDrawing
@@ -25,12 +26,12 @@ PrintBookshelfText: ; fb50 (3:7b50)
xor a
ld [$ffdb], a
ret
-.asm_fb7b
+.nextBookshelfEntry1
inc hl
-.asm_fb7c
+.nextBookshelfEntry2
inc hl
- jr .asm_fb62
-.asm_fb7f
+ jr .loop
+.noMatch
ld a, $ff
ld [$ffdb], a
ld b, BANK(PrintCardKeyText)