pokered/engine/hidden_object_functions3.asm

154 lines
2.8 KiB
NASM
Raw Normal View History

2014-05-22 22:13:20 +00:00
; prints text for bookshelves in buildings without sign events
2016-06-12 00:24:04 +00:00
PrintBookshelfText:
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
2015-08-31 02:38:41 +00:00
ld a, [wCurMapTileset]
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
2015-07-19 18:56:13 +00:00
jpba PrintCardKeyText
2014-05-22 22:13:20 +00:00
; format: db tileset id, bookshelf tile id, text id
2016-06-12 00:24:04 +00:00
BookshelfTileIDs:
db PLATEAU, $30
2016-06-12 07:51:59 +00:00
db_tx_pre IndigoPlateauStatues
db HOUSE, $3D
2016-06-12 07:51:59 +00:00
db_tx_pre TownMapText
db HOUSE, $1E
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db MANSION, $32
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db REDS_HOUSE_1, $32
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db LAB, $28
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db LOBBY, $16
2016-06-12 07:51:59 +00:00
db_tx_pre ElevatorText
db GYM, $1D
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db DOJO, $1D
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db GATE, $22
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
db MART, $54
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db MART, $55
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db POKECENTER, $54
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db POKECENTER, $55
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db LOBBY, $50
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db LOBBY, $52
2016-06-12 07:51:59 +00:00
db_tx_pre PokemonStuffText
db SHIP, $36
2016-06-12 07:51:59 +00:00
db_tx_pre BookOrSculptureText
2014-05-22 22:13:20 +00:00
db $FF
2016-06-12 00:24:04 +00:00
IndigoPlateauStatues:
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-22 22:13:20 +00:00
ld hl, IndigoPlateauStatuesText1
call PrintText
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
2014-05-22 22:13:20 +00:00
bit 0, a
ld hl, IndigoPlateauStatuesText2
2016-06-12 04:30:05 +00:00
jr nz, .ok
2014-05-22 22:13:20 +00:00
ld hl, IndigoPlateauStatuesText3
2016-06-12 04:30:05 +00:00
.ok
2014-05-22 22:13:20 +00:00
call PrintText
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
IndigoPlateauStatuesText1:
2014-05-22 22:13:20 +00:00
TX_FAR _IndigoPlateauStatuesText1
db "@"
2016-06-12 00:24:04 +00:00
IndigoPlateauStatuesText2:
2014-05-22 22:13:20 +00:00
TX_FAR _IndigoPlateauStatuesText2
db "@"
2016-06-12 00:24:04 +00:00
IndigoPlateauStatuesText3:
2014-05-22 22:13:20 +00:00
TX_FAR _IndigoPlateauStatuesText3
db "@"
2016-06-12 00:24:04 +00:00
BookOrSculptureText:
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-22 22:13:20 +00:00
ld hl, PokemonBooksText
2015-08-31 02:38:41 +00:00
ld a, [wCurMapTileset]
2014-05-22 22:13:20 +00:00
cp MANSION ; Celadon Mansion tileset
2016-06-12 04:30:05 +00:00
jr nz, .ok
aCoord 8, 6
2014-05-22 22:13:20 +00:00
cp $38
2016-06-12 04:30:05 +00:00
jr nz, .ok
2014-05-22 22:13:20 +00:00
ld hl, DiglettSculptureText
2016-06-12 04:30:05 +00:00
.ok
2014-05-22 22:13:20 +00:00
call PrintText
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
PokemonBooksText:
2014-05-22 22:13:20 +00:00
TX_FAR _PokemonBooksText
db "@"
2016-06-12 00:24:04 +00:00
DiglettSculptureText:
2014-05-22 22:13:20 +00:00
TX_FAR _DiglettSculptureText
db "@"
2016-06-12 00:24:04 +00:00
ElevatorText:
2014-05-22 22:13:20 +00:00
TX_FAR _ElevatorText
db "@"
2016-06-12 00:24:04 +00:00
TownMapText:
2014-05-22 22:13:20 +00:00
TX_FAR _TownMapText
2016-07-18 06:17:03 +00:00
TX_BLINK
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
2016-06-12 00:24:04 +00:00
PokemonStuffText:
2014-05-22 22:13:20 +00:00
TX_FAR _PokemonStuffText
db "@"