pokered/engine/hidden_object_functions3.asm

156 lines
3.4 KiB
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
; prints text for bookshelves in buildings without sign events
PrintBookshelfText: ; fb50 (3:7b50)
2014-09-14 18:29:18 +00:00
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .noMatch
; facing up
ld a, [W_CURMAPTILESET]
2014-05-22 22:13:20 +00:00
ld b, a
aCoord 8, 7
2014-05-22 22:13:20 +00:00
ld c, a
2014-09-14 18:29:18 +00:00
ld hl, BookshelfTileIDs
.loop
2014-05-22 22:13:20 +00:00
ld a, [hli]
cp $ff
2014-09-14 18:29:18 +00:00
jr z, .noMatch
2014-05-22 22:13:20 +00:00
cp b
2014-09-14 18:29:18 +00:00
jr nz, .nextBookshelfEntry1
2014-05-22 22:13:20 +00:00
ld a, [hli]
cp c
2014-09-14 18:29:18 +00:00
jr nz, .nextBookshelfEntry2
2014-05-22 22:13:20 +00:00
ld a, [hl]
push af
call EnableAutoTextBoxDrawing
pop af
call PrintPredefTextID
xor a
ld [$ffdb], a
ret
2014-09-14 18:29:18 +00:00
.nextBookshelfEntry1
2014-05-22 22:13:20 +00:00
inc hl
2014-09-14 18:29:18 +00:00
.nextBookshelfEntry2
2014-05-22 22:13:20 +00:00
inc hl
2014-09-14 18:29:18 +00:00
jr .loop
.noMatch
2014-05-22 22:13:20 +00:00
ld a, $ff
ld [$ffdb], a
ld b, BANK(PrintCardKeyText)
ld hl, PrintCardKeyText
jp Bankswitch
; format: db tileset id, bookshelf tile id, text id
BookshelfTileIDs: ; fb8b (3:7b8b)
db PLATEAU, $30
db (IndigoPlateauStatues_id - TextPredefs) / 2 + 1
db HOUSE, $3D
db (TownMapText_id - TextPredefs) / 2 + 1
db HOUSE, $1E
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db MANSION, $32
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db REDS_HOUSE_1, $32
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db LAB, $28
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db LOBBY, $16
db (ElevatorText_id - TextPredefs) / 2 + 1
db GYM, $1D
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db DOJO, $1D
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db GATE, $22
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
db MART, $54
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db MART, $55
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db POKECENTER, $54
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db POKECENTER, $55
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db LOBBY, $50
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db LOBBY, $52
db (PokemonStuffText_id - TextPredefs) / 2 + 1
db SHIP, $36
db (BookOrSculptureText_id - TextPredefs) / 2 + 1
2014-05-22 22:13:20 +00:00
db $FF
IndigoPlateauStatues: ; fbbf (3:7bbf)
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-22 22:13:20 +00:00
ld hl, IndigoPlateauStatuesText1
call PrintText
ld a, [W_XCOORD]
bit 0, a
ld hl, IndigoPlateauStatuesText2
jr nz, .asm_fbd3
ld hl, IndigoPlateauStatuesText3
.asm_fbd3
call PrintText
jp TextScriptEnd
IndigoPlateauStatuesText1: ; fbd9 (3:7bd9)
TX_FAR _IndigoPlateauStatuesText1
db "@"
IndigoPlateauStatuesText2: ; fbde (3:7bde)
TX_FAR _IndigoPlateauStatuesText2
db "@"
IndigoPlateauStatuesText3: ; fbe3 (3:7be3)
TX_FAR _IndigoPlateauStatuesText3
db "@"
BookOrSculptureText: ; fbe8 (3:7be8)
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-22 22:13:20 +00:00
ld hl, PokemonBooksText
ld a, [W_CURMAPTILESET]
cp MANSION ; Celadon Mansion tileset
jr nz, .asm_fbfd
aCoord 8, 6
2014-05-22 22:13:20 +00:00
cp $38
jr nz, .asm_fbfd
ld hl, DiglettSculptureText
.asm_fbfd
call PrintText
jp TextScriptEnd
PokemonBooksText: ; fc03 (3:7c03)
TX_FAR _PokemonBooksText
db "@"
DiglettSculptureText: ; fc08 (3:7c08)
TX_FAR _DiglettSculptureText
db "@"
ElevatorText: ; fc0d (3:7c0d)
TX_FAR _ElevatorText
db "@"
TownMapText: ; fc12 (3:7c12)
TX_FAR _TownMapText
db $06
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-22 22:13:20 +00:00
ld a, $1
2014-09-13 07:50:56 +00:00
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wd730
2014-05-22 22:13:20 +00:00
set 6, [hl]
call GBPalWhiteOutWithDelay3
xor a
2014-09-23 22:02:03 +00:00
ld [hWY], a
2014-05-22 22:13:20 +00:00
inc a
ld [H_AUTOBGTRANSFERENABLED], a
call LoadFontTilePatterns
callba DisplayTownMap
ld hl, wd730
2014-05-22 22:13:20 +00:00
res 6, [hl]
ld de, TextScriptEnd
push de
ld a, [H_LOADEDROMBANK]
push af
jp CloseTextDisplay
PokemonStuffText: ; fc45 (3:7c45)
TX_FAR _PokemonStuffText
db "@"