Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/hidden_objects/bookshelves.asm
1271 views
1
; prints text for bookshelves in buildings without sign events
2
PrintBookshelfText::
3
ld a, [wSpritePlayerStateData1FacingDirection]
4
cp SPRITE_FACING_UP
5
jr nz, .noMatch
6
; facing up
7
ld a, [wCurMapTileset]
8
ld b, a
9
lda_coord 8, 7
10
ld c, a
11
ld hl, BookshelfTileIDs
12
.loop
13
ld a, [hli]
14
cp $ff
15
jr z, .noMatch
16
cp b
17
jr nz, .nextBookshelfEntry1
18
ld a, [hli]
19
cp c
20
jr nz, .nextBookshelfEntry2
21
ld a, [hl]
22
push af
23
call EnableAutoTextBoxDrawing
24
pop af
25
call PrintPredefTextID
26
xor a
27
ldh [hInteractedWithBookshelf], a
28
ret
29
.nextBookshelfEntry1
30
inc hl
31
.nextBookshelfEntry2
32
inc hl
33
jr .loop
34
.noMatch
35
ld a, $ff
36
ldh [hInteractedWithBookshelf], a
37
farjp PrintCardKeyText
38
39
INCLUDE "data/tilesets/bookshelf_tile_ids.asm"
40
41