2020-07-03 17:23:51 +00:00
|
|
|
; prints text for bookshelves in buildings without sign events
|
|
|
|
PrintBookshelfText::
|
2020-07-05 21:29:11 +00:00
|
|
|
ld a, [wSpritePlayerStateData1FacingDirection]
|
2020-07-03 17:23:51 +00:00
|
|
|
cp SPRITE_FACING_UP
|
|
|
|
jr nz, .noMatch
|
|
|
|
; facing up
|
|
|
|
ld a, [wCurMapTileset]
|
|
|
|
ld b, a
|
2020-07-07 15:30:10 +00:00
|
|
|
lda_coord 8, 7
|
2020-07-03 17:23:51 +00:00
|
|
|
ld c, a
|
|
|
|
ld hl, BookshelfTileIDs
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp $ff
|
|
|
|
jr z, .noMatch
|
|
|
|
cp b
|
|
|
|
jr nz, .nextBookshelfEntry1
|
|
|
|
ld a, [hli]
|
|
|
|
cp c
|
|
|
|
jr nz, .nextBookshelfEntry2
|
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
call EnableAutoTextBoxDrawing
|
|
|
|
pop af
|
|
|
|
call PrintPredefTextID
|
|
|
|
xor a
|
2023-11-20 22:23:22 +00:00
|
|
|
ldh [hInteractedWithBookshelf], a
|
2020-07-03 17:23:51 +00:00
|
|
|
ret
|
|
|
|
.nextBookshelfEntry1
|
|
|
|
inc hl
|
|
|
|
.nextBookshelfEntry2
|
|
|
|
inc hl
|
|
|
|
jr .loop
|
|
|
|
.noMatch
|
|
|
|
ld a, $ff
|
2023-11-20 22:23:22 +00:00
|
|
|
ldh [hInteractedWithBookshelf], a
|
2020-07-07 01:18:22 +00:00
|
|
|
farjp PrintCardKeyText
|
2020-07-03 17:23:51 +00:00
|
|
|
|
|
|
|
INCLUDE "data/tilesets/bookshelf_tile_ids.asm"
|