From 2ed65d9c3e3ba60939ebe2928ffddc06a90b1876 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 14 Sep 2014 11:29:18 -0700 Subject: Commented/labelled misc functions --- engine/hidden_object_functions3.asm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'engine/hidden_object_functions3.asm') 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) -- cgit v1.2.3