pokecrystal-board/engine/pokegear/radio.asm

1932 lines
31 KiB
NASM
Raw Normal View History

PlayRadioShow:
; If we're already in the radio program proper, we don't need to be here.
2018-09-09 12:09:51 -07:00
ld a, [wCurRadioLine]
cp POKE_FLUTE_RADIO
jr nc, .ok
; If Team Rocket is not occupying the radio tower, we don't need to be here.
ld a, [wStatusFlags2]
2018-01-22 12:40:43 -08:00
bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
jr z, .ok
; If we're in Kanto, we don't need to be here.
call IsInJohto
and a
jr nz, .ok
; Team Rocket broadcasts on all stations.
ld a, ROCKET_RADIO
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
.ok
2018-09-09 12:09:51 -07:00
; Jump to the currently loaded station. The index to which we need to jump is in wCurRadioLine.
ld a, [wCurRadioLine]
ld e, a
ld d, 0
ld hl, RadioJumptable
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
RadioJumptable:
2018-01-10 08:30:12 -08:00
; entries correspond to constants/radio_constants.asm
dw OaksPKMNTalk1 ; $00
dw PokedexShow1 ; $01
dw BenMonMusic1 ; $02
dw LuckyNumberShow1 ; $03
dw BuenasPassword1 ; $04
dw PeoplePlaces1 ; $05
dw FernMonMusic1 ; $06
dw RocketRadio1 ; $07
dw PokeFluteRadio ; $08
2015-10-09 20:09:03 -07:00
dw UnownRadio ; $09
dw EvolutionRadio ; $0a
; OaksPKMNTalk
dw OaksPKMNTalk2 ; $0b
dw OaksPKMNTalk3 ; $0c
dw OaksPKMNTalk4 ; $0d
dw OaksPKMNTalk5 ; $0e
dw OaksPKMNTalk6 ; $0f
dw OaksPKMNTalk7 ; $10
dw OaksPKMNTalk8 ; $11
dw OaksPKMNTalk9 ; $12
2015-10-09 20:09:03 -07:00
dw PokedexShow2 ; $13
dw PokedexShow3 ; $14
dw PokedexShow4 ; $15
dw PokedexShow5 ; $16
; Ben Music
dw BenMonMusic2 ; $17
dw BenMonMusic3 ; $18
dw BenFernMusic4 ; $19
dw BenFernMusic5 ; $1a
dw BenFernMusic6 ; $1b
dw BenFernMusic7 ; $1c
dw FernMonMusic2 ; $1d
; Lucky Number Show
dw LuckyNumberShow2 ; $1e
dw LuckyNumberShow3 ; $1f
dw LuckyNumberShow4 ; $20
dw LuckyNumberShow5 ; $21
dw LuckyNumberShow6 ; $22
dw LuckyNumberShow7 ; $23
dw LuckyNumberShow8 ; $24
dw LuckyNumberShow9 ; $25
dw LuckyNumberShow10 ; $26
dw LuckyNumberShow11 ; $27
dw LuckyNumberShow12 ; $28
dw LuckyNumberShow13 ; $29
dw LuckyNumberShow14 ; $2a
dw LuckyNumberShow15 ; $2b
2015-10-09 20:09:03 -07:00
; People & Places
dw PeoplePlaces2 ; $2c
dw PeoplePlaces3 ; $2d
dw PeoplePlaces4 ; $2e
dw PeoplePlaces5 ; $2f
dw PeoplePlaces6 ; $30
dw PeoplePlaces7 ; $31
; Rocket Radio
dw RocketRadio2 ; $32
dw RocketRadio3 ; $33
dw RocketRadio4 ; $34
dw RocketRadio5 ; $35
dw RocketRadio6 ; $36
dw RocketRadio7 ; $37
dw RocketRadio8 ; $38
dw RocketRadio9 ; $39
dw RocketRadio10 ; $3a
; More Pokemon Channel stuff
dw OaksPKMNTalk10 ; $3b
dw OaksPKMNTalk11 ; $3c
dw OaksPKMNTalk12 ; $3d
dw OaksPKMNTalk13 ; $3e
dw OaksPKMNTalk14 ; $3f
; Buenas Password
dw BuenasPassword2 ; $40
dw BuenasPassword3 ; $41
dw BuenasPassword4 ; $42
dw BuenasPassword5 ; $43
dw BuenasPassword6 ; $44
dw BuenasPassword7 ; $45
dw BuenasPassword8 ; $46
dw BuenasPassword9 ; $47
dw BuenasPassword10 ; $48
dw BuenasPassword11 ; $49
dw BuenasPassword12 ; $4a
dw BuenasPassword13 ; $4b
dw BuenasPassword14 ; $4c
dw BuenasPassword15 ; $4d
dw BuenasPassword16 ; $4e
dw BuenasPassword17 ; $4f
dw BuenasPassword18 ; $50
dw BuenasPassword19 ; $51
dw BuenasPassword20 ; $52
dw BuenasPassword21 ; $53
dw RadioScroll ; $54
; More Pokemon Channel stuff
2015-10-09 20:09:03 -07:00
dw PokedexShow6 ; $55
dw PokedexShow7 ; $56
dw PokedexShow8 ; $57
PrintRadioLine:
ld [wNextRadioLine], a
ld hl, wRadioText
ld a, [wNumRadioLinesPrinted]
cp 2
jr nc, .print
inc hl
ld [hl], TX_START
inc a
ld [wNumRadioLinesPrinted], a
cp 2
jr nz, .print
bccoord 1, 16
call PlaceHLTextAtBC
jr .skip
.print
call PrintTextBoxText
.skip
2015-10-09 20:09:03 -07:00
ld a, RADIO_SCROLL
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
ld a, 100
ld [wRadioTextDelay], a
ret
ReplacePeriodsWithSpaces:
push hl
ld b, SCREEN_WIDTH * 2
2015-10-09 20:09:03 -07:00
.loop
ld a, [hl]
cp "."
jr nz, .next
ld [hl], " "
.next
inc hl
dec b
2015-10-09 20:09:03 -07:00
jr nz, .loop
pop hl
ret
RadioScroll:
ld hl, wRadioTextDelay
ld a, [hl]
and a
jr z, .proceed
dec [hl]
ret
.proceed
ld a, [wNextRadioLine]
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
ld a, [wNumRadioLinesPrinted]
cp 1
call nz, CopyBottomLineToTopLine
jp ClearBottomLine
OaksPKMNTalk1:
ld a, 5
ld [wOaksPKMNTalkSegmentCounter], a
call StartRadioStation
ld hl, OPT_IntroText1
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_2
jp NextRadioLine
OaksPKMNTalk2:
ld hl, OPT_IntroText2
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_3
jp NextRadioLine
OaksPKMNTalk3:
ld hl, OPT_IntroText3
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_4
jp NextRadioLine
OaksPKMNTalk4:
2015-10-09 20:09:03 -07:00
; Choose a random route, and a random Pokemon from that route.
2016-05-15 18:50:31 -07:00
.sample
call Random
2018-01-10 08:30:12 -08:00
and %11111
cp (OaksPKMNTalkRoutes.End - OaksPKMNTalkRoutes) / 2
2016-05-15 18:50:31 -07:00
jr nc, .sample
2015-10-09 20:09:03 -07:00
; We now have a number between 0 and 14.
ld hl, OaksPKMNTalkRoutes
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld b, [hl]
inc hl
ld c, [hl]
2015-10-09 20:09:03 -07:00
; bc now contains the chosen map's group and number indices.
push bc
2015-10-09 20:09:03 -07:00
; Search the JohtoGrassWildMons array for the chosen map.
ld hl, JohtoGrassWildMons
2015-10-09 20:09:03 -07:00
.loop
ld a, BANK(JohtoGrassWildMons)
call GetFarByte
cp -1
2015-10-09 20:09:03 -07:00
jr z, .overflow
inc hl
cp b
jr nz, .next
ld a, BANK(JohtoGrassWildMons)
call GetFarByte
cp c
jr z, .done
.next
dec hl
ld de, GRASS_WILDDATA_LENGTH
add hl, de
2015-10-09 20:09:03 -07:00
jr .loop
.done
2018-01-10 08:30:12 -08:00
; Point hl to the list of morning Pokémon., skipping percentages
rept 4
inc hl
endr
2015-10-09 20:09:03 -07:00
; Generate a number, either 0, 1, or 2, to choose a time of day.
.loop2
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_DAYTIMES
2018-01-10 08:30:12 -08:00
cp DARKNESS_F
2015-10-09 20:09:03 -07:00
jr z, .loop2
ld bc, 2 * NUM_GRASSMON
call AddNTimes
2015-10-09 20:09:03 -07:00
.loop3
; Choose one of the middle three Pokemon.
call Random
and NUM_GRASSMON
cp 2
2015-10-09 20:09:03 -07:00
jr c, .loop3
cp 5
2015-10-09 20:09:03 -07:00
jr nc, .loop3
ld e, a
ld d, 0
add hl, de
add hl, de
2015-10-09 20:09:03 -07:00
inc hl ; skip level
ld a, BANK(JohtoGrassWildMons)
call GetFarByte
2015-10-09 20:09:03 -07:00
ld [wNamedObjectIndexBuffer], a
2018-01-23 14:39:09 -08:00
ld [wCurPartySpecies], a
call GetPokemonName
2018-01-23 14:39:09 -08:00
ld hl, wStringBuffer1
2015-12-18 17:07:09 -08:00
ld de, wMonOrItemNameBuffer
2018-01-20 09:25:55 -08:00
ld bc, MON_NAME_LENGTH
call CopyBytes
2018-01-10 08:30:12 -08:00
2015-10-09 20:09:03 -07:00
; Now that we've chosen our wild Pokemon,
; let's recover the map index info and get its name.
pop bc
call GetWorldMapLocation
ld e, a
2017-12-24 09:47:30 -08:00
farcall GetLandmarkName
ld hl, OPT_OakText1
call CopyRadioTextToRAM
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_5
jp PrintRadioLine
2015-10-09 20:09:03 -07:00
.overflow
pop bc
ld a, OAKS_POKEMON_TALK
jp PrintRadioLine
2018-01-10 08:30:12 -08:00
INCLUDE "data/radio/oaks_pkmn_talk_routes.asm"
OaksPKMNTalk5:
ld hl, OPT_OakText2
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_6
jp NextRadioLine
OaksPKMNTalk6:
ld hl, OPT_OakText3
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_7
jp NextRadioLine
OPT_IntroText1:
; MARY: PROF.OAK'S
text_jump _OPT_IntroText1
db "@"
OPT_IntroText2:
; #MON TALK!
text_jump _OPT_IntroText2
db "@"
OPT_IntroText3:
; With me, MARY!
text_jump _OPT_IntroText3
db "@"
OPT_OakText1:
; OAK: @ @
text_jump _OPT_OakText1
db "@"
OPT_OakText2:
; may be seen around
text_jump _OPT_OakText2
db "@"
OPT_OakText3:
; @ .
text_jump _OPT_OakText3
db "@"
OaksPKMNTalk7:
2018-01-23 14:39:09 -08:00
ld a, [wCurPartySpecies]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, OPT_MaryText1
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_8
jp NextRadioLine
OPT_MaryText1:
; MARY: @ 's
text_jump _OPT_MaryText1
db "@"
OaksPKMNTalk8:
; 0-15 are all valid indexes into .Adverbs,
; so no need for a retry loop
call Random
maskbits NUM_OAKS_POKEMON_TALK_ADVERBS
ld e, a
ld d, 0
ld hl, .Adverbs
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_9
jp NextRadioLine
.Adverbs:
; there are NUM_OAKS_POKEMON_TALK_ADVERBS entries
2015-10-09 20:09:03 -07:00
dw .sweetadorably
dw .wigglyslickly
dw .aptlynamed
dw .undeniablykindof
dw .unbearably
dw .wowimpressively
dw .almostpoisonously
dw .sensually
dw .mischievously
dw .topically
dw .addictively
dw .looksinwater
dw .evolutionmustbe
dw .provocatively
dw .flippedout
dw .heartmeltingly
.sweetadorably
; sweet and adorably
text_jump OPT_SweetAdorably
db "@"
.wigglyslickly
; wiggly and slickly
text_jump OPT_WigglySlickly
db "@"
.aptlynamed
; aptly named and
text_jump OPT_AptlyNamed
db "@"
.undeniablykindof
; undeniably kind of
text_jump OPT_UndeniablyKindOf
db "@"
.unbearably
; so, so unbearably
text_jump OPT_Unbearably
db "@"
.wowimpressively
; wow, impressively
text_jump OPT_WowImpressively
db "@"
.almostpoisonously
; almost poisonously
text_jump OPT_AlmostPoisonously
db "@"
.sensually
; ooh, so sensually
text_jump OPT_Sensually
db "@"
.mischievously
; so mischievously
text_jump OPT_Mischievously
db "@"
.topically
; so very topically
text_jump OPT_Topically
db "@"
.addictively
; sure addictively
text_jump OPT_Addictively
db "@"
.looksinwater
; looks in water is
text_jump OPT_LooksInWater
db "@"
.evolutionmustbe
; evolution must be
text_jump OPT_EvolutionMustBe
db "@"
.provocatively
; provocatively
text_jump OPT_Provocatively
db "@"
.flippedout
; so flipped out and
text_jump OPT_FlippedOut
db "@"
.heartmeltingly
; heart-meltingly
text_jump OPT_HeartMeltingly
db "@"
OaksPKMNTalk9:
; 0-15 are all valid indexes into .Adjectives,
; so no need for a retry loop
call Random
maskbits NUM_OAKS_POKEMON_TALK_ADJECTIVES
ld e, a
ld d, 0
ld hl, .Adjectives
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wOaksPKMNTalkSegmentCounter]
dec a
ld [wOaksPKMNTalkSegmentCounter], a
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_4
jr nz, .ok
ld a, 5
ld [wOaksPKMNTalkSegmentCounter], a
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_10
.ok
jp NextRadioLine
.Adjectives:
; there are NUM_OAKS_POKEMON_TALK_ADJECTIVES entries
2015-10-09 20:09:03 -07:00
dw .cute
dw .weird
dw .pleasant
dw .boldsortof
dw .frightening
dw .suavedebonair
dw .powerful
dw .exciting
dw .groovy
dw .inspiring
dw .friendly
dw .hothothot
dw .stimulating
dw .guarded
dw .lovely
dw .speedy
.cute
; cute.
text_jump OPT_Cute
db "@"
.weird
; weird.
text_jump OPT_Weird
db "@"
.pleasant
; pleasant.
text_jump OPT_Pleasant
db "@"
.boldsortof
; bold, sort of.
text_jump OPT_BoldSortOf
db "@"
.frightening
; frightening.
text_jump OPT_Frightening
db "@"
.suavedebonair
; suave & debonair!
text_jump OPT_SuaveDebonair
db "@"
.powerful
; powerful.
text_jump OPT_Powerful
db "@"
.exciting
; exciting.
text_jump OPT_Exciting
db "@"
.groovy
; groovy!
text_jump OPT_Groovy
db "@"
.inspiring
; inspiring.
text_jump OPT_Inspiring
db "@"
.friendly
; friendly.
text_jump OPT_Friendly
db "@"
.hothothot
; hot, hot, hot!
text_jump OPT_HotHotHot
db "@"
.stimulating
; stimulating.
text_jump OPT_Stimulating
db "@"
.guarded
; guarded.
text_jump OPT_Guarded
db "@"
.lovely
; lovely.
text_jump OPT_Lovely
db "@"
.speedy
; speedy.
text_jump OPT_Speedy
db "@"
OaksPKMNTalk10:
2017-12-24 09:47:30 -08:00
farcall RadioMusicRestartPokemonChannel
ld hl, OPT_RestartText
call PrintText
call WaitBGMap
ld hl, OPT_PokemonChannelText
call PrintText
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_11
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
ld a, 100
ld [wRadioTextDelay], a
ret
OPT_PokemonChannelText:
; #MON
text_jump _OPT_PokemonChannelText
db "@"
OPT_RestartText:
db "@"
OaksPKMNTalk11:
ld hl, wRadioTextDelay
dec [hl]
ret nz
hlcoord 9, 14
2015-10-09 20:09:03 -07:00
ld de, .pokemon_string
ld a, OAKS_POKEMON_TALK_12
jp PlaceRadioString
.pokemon_string
db "#MON@"
OaksPKMNTalk12:
ld hl, wRadioTextDelay
dec [hl]
ret nz
hlcoord 1, 16
2015-10-09 20:09:03 -07:00
ld de, .pokemon_channel_string
ld a, OAKS_POKEMON_TALK_13
jp PlaceRadioString
.pokemon_channel_string
db "#MON Channel@"
OaksPKMNTalk13:
ld hl, wRadioTextDelay
dec [hl]
ret nz
hlcoord 12, 16
2015-10-09 20:09:03 -07:00
ld de, .terminator
ld a, OAKS_POKEMON_TALK_14
jp PlaceRadioString
.terminator
db "@"
OaksPKMNTalk14:
ld hl, wRadioTextDelay
dec [hl]
ret nz
2018-01-10 08:30:12 -08:00
ld de, MUSIC_POKEMON_TALK
2017-12-24 09:47:30 -08:00
callfar RadioMusicRestartDE
2015-10-09 20:09:03 -07:00
ld hl, .terminator
call PrintText
2015-10-09 20:09:03 -07:00
ld a, OAKS_POKEMON_TALK_4
ld [wNextRadioLine], a
xor a
ld [wNumRadioLinesPrinted], a
2015-10-09 20:09:03 -07:00
ld a, RADIO_SCROLL
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
2015-10-09 20:09:03 -07:00
ld a, 10
ld [wRadioTextDelay], a
ret
.terminator
db "@"
PlaceRadioString:
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
2015-10-09 20:09:03 -07:00
ld a, 100
ld [wRadioTextDelay], a
jp PlaceString
CopyBottomLineToTopLine:
hlcoord 0, 15
decoord 0, 13
ld bc, SCREEN_WIDTH * 2
jp CopyBytes
ClearBottomLine:
hlcoord 1, 15
ld bc, SCREEN_WIDTH - 2
ld a, " "
call ByteFill
hlcoord 1, 16
ld bc, SCREEN_WIDTH - 2
ld a, " "
jp ByteFill
PokedexShow_GetDexEntryBank:
push hl
push de
2018-01-23 14:39:09 -08:00
ld a, [wCurPartySpecies]
dec a
rlca
rlca
2018-01-16 14:27:50 -08:00
maskbits NUM_DEX_ENTRY_BANKS
2018-01-11 09:00:01 -08:00
ld hl, .PokedexEntryBanks
ld d, 0
ld e, a
add hl, de
ld a, [hl]
pop de
pop hl
ret
.PokedexEntryBanks:
db BANK("Pokedex Entries 001-064")
db BANK("Pokedex Entries 065-128")
db BANK("Pokedex Entries 129-192")
db BANK("Pokedex Entries 193-251")
PokedexShow1:
call StartRadioStation
2015-10-09 20:09:03 -07:00
.loop
call Random
cp NUM_POKEMON
2015-10-09 20:09:03 -07:00
jr nc, .loop
ld c, a
push bc
ld a, c
call CheckCaughtMon
pop bc
2015-10-09 20:09:03 -07:00
jr z, .loop
inc c
ld a, c
2018-01-23 14:39:09 -08:00
ld [wCurPartySpecies], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, PokedexShowText
2015-10-09 20:09:03 -07:00
ld a, POKEDEX_SHOW_2
jp NextRadioLine
PokedexShow2:
2018-01-23 14:39:09 -08:00
ld a, [wCurPartySpecies]
dec a
ld hl, PokedexDataPointerTable
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld a, BANK(PokedexDataPointerTable)
call GetFarHalfword
2015-10-09 20:09:03 -07:00
call PokedexShow_GetDexEntryBank
push af
push hl
2015-10-09 20:09:03 -07:00
call CopyDexEntryPart1
dec hl
ld [hl], "<DONE>"
ld hl, wPokedexShowPointerAddr
call CopyRadioTextToRAM
pop hl
pop af
2015-10-09 20:09:03 -07:00
call CopyDexEntryPart2
rept 4
inc hl
endr
ld a, l
ld [wPokedexShowPointerAddr], a
ld a, h
ld [wPokedexShowPointerAddr + 1], a
2015-10-09 20:09:03 -07:00
ld a, POKEDEX_SHOW_3
jp PrintRadioLine
PokedexShow3:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW_4
jp PrintRadioLine
PokedexShow4:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW_5
jp PrintRadioLine
PokedexShow5:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW_6
jp PrintRadioLine
PokedexShow6:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW_7
jp PrintRadioLine
PokedexShow7:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW_8
jp PrintRadioLine
PokedexShow8:
2015-10-09 20:09:03 -07:00
call CopyDexEntry
ld a, POKEDEX_SHOW
jp PrintRadioLine
CopyDexEntry:
ld a, [wPokedexShowPointerAddr]
ld l, a
ld a, [wPokedexShowPointerAddr + 1]
ld h, a
ld a, [wPokedexShowPointerBank]
push af
push hl
2015-10-09 20:09:03 -07:00
call CopyDexEntryPart1
dec hl
2015-10-09 20:09:03 -07:00
ld [hl], "<DONE>"
ld hl, wPokedexShowPointerAddr
call CopyRadioTextToRAM
pop hl
pop af
2015-10-09 20:09:03 -07:00
call CopyDexEntryPart2
ret
CopyDexEntryPart1:
ld de, wPokedexShowPointerBank
2015-10-09 20:09:03 -07:00
ld bc, SCREEN_WIDTH - 1
call FarCopyBytes
ld hl, wPokedexShowPointerAddr
ld [hl], TX_START
inc hl
2015-10-09 20:09:03 -07:00
ld [hl], "<LINE>"
inc hl
2015-10-09 20:09:03 -07:00
.loop
ld a, [hli]
2015-10-09 20:09:03 -07:00
cp "@"
ret z
2015-10-09 20:09:03 -07:00
cp "<NEXT>"
ret z
2015-10-09 20:09:03 -07:00
cp "<DEXEND>"
ret z
2015-10-09 20:09:03 -07:00
jr .loop
CopyDexEntryPart2:
ld d, a
2015-10-09 20:09:03 -07:00
.loop
ld a, d
call GetFarByte
inc hl
2015-10-09 20:09:03 -07:00
cp "@"
jr z, .okay
cp "<NEXT>"
jr z, .okay
cp "<DEXEND>"
jr nz, .loop
.okay
ld a, l
ld [wPokedexShowPointerAddr], a
ld a, h
ld [wPokedexShowPointerAddr + 1], a
ld a, d
ld [wPokedexShowPointerBank], a
ret
PokedexShowText:
; @ @
text_jump _PokedexShowText
db "@"
BenMonMusic1:
2015-10-09 20:09:03 -07:00
call StartPokemonMusicChannel
ld hl, BenIntroText1
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_2
jp NextRadioLine
BenMonMusic2:
ld hl, BenIntroText2
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_3
jp NextRadioLine
BenMonMusic3:
ld hl, BenIntroText3
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_4
jp NextRadioLine
FernMonMusic1:
2015-10-09 20:09:03 -07:00
call StartPokemonMusicChannel
ld hl, FernIntroText1
2015-10-09 20:09:03 -07:00
ld a, LETS_ALL_SING_2
jp NextRadioLine
FernMonMusic2:
ld hl, FernIntroMusic2
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_4
jp NextRadioLine
BenFernMusic4:
ld hl, BenFernText1
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_5
jp NextRadioLine
BenFernMusic5:
call GetWeekday
and 1
ld hl, BenFernText2A
2015-10-09 20:09:03 -07:00
jr z, .SunTueThurSun
ld hl, BenFernText2B
.SunTueThurSun:
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_6
jp NextRadioLine
BenFernMusic6:
call GetWeekday
and 1
ld hl, BenFernText3A
2015-10-09 20:09:03 -07:00
jr z, .SunTueThurSun
ld hl, BenFernText3B
.SunTueThurSun:
2015-10-09 20:09:03 -07:00
ld a, POKEMON_MUSIC_7
jp NextRadioLine
BenFernMusic7:
ret
StartPokemonMusicChannel:
call RadioTerminator
call PrintText
ld de, MUSIC_POKEMON_MARCH
call GetWeekday
and 1
2015-10-09 20:09:03 -07:00
jr z, .SunTueThurSun
ld de, MUSIC_POKEMON_LULLABY
.SunTueThurSun:
2017-12-24 09:47:30 -08:00
callfar RadioMusicRestartDE
ret
BenIntroText1:
; BEN: #MON MUSIC
text_jump _BenIntroText1
db "@"
BenIntroText2:
; CHANNEL!
text_jump _BenIntroText2
db "@"
BenIntroText3:
; It's me, DJ BEN!
text_jump _BenIntroText3
db "@"
FernIntroText1:
; FERN: #MUSIC!
text_jump _FernIntroText1
db "@"
FernIntroMusic2:
; With DJ FERN!
text_jump _FernIntroText2
db "@"
BenFernText1:
; Today's @ ,
text_jump _BenFernText1
db "@"
BenFernText2A:
; so let us jam to
text_jump _BenFernText2A
db "@"
BenFernText2B:
; so chill out to
text_jump _BenFernText2B
db "@"
BenFernText3A:
; #MON March!
text_jump _BenFernText3A
db "@"
BenFernText3B:
; #MON Lullaby!
text_jump _BenFernText3B
db "@"
LuckyNumberShow1:
call StartRadioStation
callfar CheckLuckyNumberShowFlag
jr nc, .dontreset
callfar ResetLuckyNumberShowFlag
.dontreset
ld hl, LC_Text1
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_2
jp NextRadioLine
LuckyNumberShow2:
ld hl, LC_Text2
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_3
jp NextRadioLine
LuckyNumberShow3:
ld hl, LC_Text3
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_4
jp NextRadioLine
LuckyNumberShow4:
ld hl, LC_Text4
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_5
jp NextRadioLine
LuckyNumberShow5:
ld hl, LC_Text5
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_6
jp NextRadioLine
LuckyNumberShow6:
ld hl, LC_Text6
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_7
jp NextRadioLine
LuckyNumberShow7:
ld hl, LC_Text7
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_8
jp NextRadioLine
LuckyNumberShow8:
2018-01-23 14:39:09 -08:00
ld hl, wStringBuffer1
ld de, wLuckyIDNumber
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
2015-10-09 20:09:03 -07:00
ld a, "@"
2018-01-23 14:39:09 -08:00
ld [wStringBuffer1 + 5], a
ld hl, LC_Text8
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_9
jp NextRadioLine
LuckyNumberShow9:
ld hl, LC_Text9
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_10
jp NextRadioLine
LuckyNumberShow10:
ld hl, LC_Text7
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_11
jp NextRadioLine
LuckyNumberShow11:
ld hl, LC_Text8
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_12
jp NextRadioLine
LuckyNumberShow12:
ld hl, LC_Text10
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_13
jp NextRadioLine
LuckyNumberShow13:
ld hl, LC_Text11
call Random
and a
2015-10-09 20:09:03 -07:00
ld a, LUCKY_CHANNEL
jr nz, .okay
ld a, LUCKY_NUMBER_SHOW_14
.okay
jp NextRadioLine
LuckyNumberShow14:
ld hl, LC_DragText1
2015-10-09 20:09:03 -07:00
ld a, LUCKY_NUMBER_SHOW_15
jp NextRadioLine
LuckyNumberShow15:
ld hl, LC_DragText2
2015-10-09 20:09:03 -07:00
ld a, LUCKY_CHANNEL
jp NextRadioLine
LC_Text1:
; REED: Yeehaw! How
text_jump _LC_Text1
db "@"
LC_Text2:
; y'all doin' now?
text_jump _LC_Text2
db "@"
LC_Text3:
; Whether you're up
text_jump _LC_Text3
db "@"
LC_Text4:
; or way down low,
text_jump _LC_Text4
db "@"
LC_Text5:
; don't you miss the
text_jump _LC_Text5
db "@"
LC_Text6:
; LUCKY NUMBER SHOW!
text_jump _LC_Text6
db "@"
LC_Text7:
; This week's Lucky
text_jump _LC_Text7
db "@"
LC_Text8:
; Number is @ !
text_jump _LC_Text8
db "@"
LC_Text9:
; I'll repeat that!
text_jump _LC_Text9
db "@"
LC_Text10:
; Match it and go to
text_jump _LC_Text10
db "@"
LC_Text11:
; the RADIO TOWER!
text_jump _LC_Text11
db "@"
LC_DragText1:
; …Repeating myself
text_jump _LC_DragText1
db "@"
LC_DragText2:
; gets to be a drag…
text_jump _LC_DragText2
db "@"
PeoplePlaces1:
call StartRadioStation
ld hl, PnP_Text1
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_2
jp NextRadioLine
PeoplePlaces2:
ld hl, PnP_Text2
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_3
jp NextRadioLine
PeoplePlaces3:
ld hl, PnP_Text3
call Random
2018-01-10 08:30:12 -08:00
cp 49 percent - 1
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_4 ; People
jr c, .ok
ld a, PLACES_AND_PEOPLE_6 ; Places
.ok
jp NextRadioLine
PnP_Text1:
; PLACES AND PEOPLE!
text_jump _PnP_Text1
db "@"
PnP_Text2:
; Brought to you by
text_jump _PnP_Text2
db "@"
PnP_Text3:
; me, DJ LILY!
text_jump _PnP_Text3
db "@"
2015-10-09 20:09:03 -07:00
PeoplePlaces4: ; People
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_TRAINER_CLASSES
inc a
2015-10-09 20:09:03 -07:00
cp NUM_TRAINER_CLASSES - 1
jr nc, PeoplePlaces4
push af
2018-01-10 08:30:12 -08:00
ld hl, PnP_HiddenPeople
ld a, [wStatusFlags]
2018-01-22 12:40:43 -08:00
bit STATUSFLAGS_HALL_OF_FAME_F, a
2015-10-09 20:09:03 -07:00
jr z, .ok
2018-01-10 08:30:12 -08:00
ld hl, PnP_HiddenPeople_BeatE4
ld a, [wKantoBadges]
2018-01-10 08:30:12 -08:00
cp %11111111 ; all badges
2015-10-09 20:09:03 -07:00
jr nz, .ok
2018-01-10 08:30:12 -08:00
ld hl, PnP_HiddenPeople_BeatKanto
2015-10-09 20:09:03 -07:00
.ok
pop af
ld c, a
2015-10-09 20:09:03 -07:00
ld de, 1
push bc
call IsInArray
pop bc
2015-10-09 20:09:03 -07:00
jr c, PeoplePlaces4
push bc
2017-12-24 09:47:30 -08:00
callfar GetTrainerClassName
2018-01-23 14:39:09 -08:00
ld de, wStringBuffer1
call CopyName1
pop bc
2015-10-09 20:09:03 -07:00
ld b, 1
2017-12-24 09:47:30 -08:00
callfar GetTrainerName
ld hl, PnP_Text4
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_5
jp NextRadioLine
2018-01-10 08:30:12 -08:00
INCLUDE "data/radio/pnp_hidden_people.asm"
PnP_Text4:
; @ @ @
text_jump _PnP_Text4
db "@"
PeoplePlaces5:
; 0-15 are all valid indexes into .Adjectives,
; so no need for a retry loop
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_PNP_PEOPLE_ADJECTIVES
ld e, a
ld d, 0
ld hl, .Adjectives
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
call Random
2018-01-10 08:30:12 -08:00
cp 4 percent
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE
jr c, .ok
call Random
2018-01-10 08:30:12 -08:00
cp 49 percent - 1
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_4 ; People
jr c, .ok
ld a, PLACES_AND_PEOPLE_6 ; Places
.ok
jp NextRadioLine
.Adjectives:
; there are NUM_PNP_PEOPLE_ADJECTIVES entries
2015-10-09 20:09:03 -07:00
dw PnP_cute
dw PnP_lazy
dw PnP_happy
dw PnP_noisy
dw PnP_precocious
dw PnP_bold
dw PnP_picky
dw PnP_sortofok
2016-01-06 10:01:20 -08:00
dw PnP_soso
dw PnP_great
dw PnP_mytype
dw PnP_cool
2015-10-09 20:09:03 -07:00
dw PnP_inspiring
dw PnP_weird
dw PnP_rightforme
dw PnP_odd
2016-01-06 10:01:20 -08:00
PnP_cute:
; is cute.
2016-01-06 10:01:20 -08:00
text_jump _PnP_cute
db "@"
2016-01-06 10:01:20 -08:00
PnP_lazy:
; is sort of lazy.
2016-01-06 10:01:20 -08:00
text_jump _PnP_lazy
db "@"
2016-01-06 10:01:20 -08:00
PnP_happy:
; is always happy.
2016-01-06 10:01:20 -08:00
text_jump _PnP_happy
db "@"
2016-01-06 10:01:20 -08:00
PnP_noisy:
; is quite noisy.
2016-01-06 10:01:20 -08:00
text_jump _PnP_noisy
db "@"
2016-01-06 10:01:20 -08:00
PnP_precocious:
; is precocious.
2016-01-06 10:01:20 -08:00
text_jump _PnP_precocious
db "@"
2016-01-06 10:01:20 -08:00
PnP_bold:
; is somewhat bold.
2016-01-06 10:01:20 -08:00
text_jump _PnP_bold
db "@"
2016-01-06 10:01:20 -08:00
PnP_picky:
; is too picky!
2016-01-06 10:01:20 -08:00
text_jump _PnP_picky
db "@"
2016-01-06 10:01:20 -08:00
PnP_sortofok:
; is sort of OK.
2016-01-06 10:01:20 -08:00
text_jump _PnP_sortofok
db "@"
2016-01-06 10:01:20 -08:00
PnP_soso:
; is just so-so.
2016-01-06 10:01:20 -08:00
text_jump _PnP_soso
db "@"
2016-01-06 10:01:20 -08:00
PnP_great:
; is actually great.
2016-01-06 10:01:20 -08:00
text_jump _PnP_great
db "@"
2016-01-06 10:01:20 -08:00
PnP_mytype:
; is just my type.
2016-01-06 10:01:20 -08:00
text_jump _PnP_mytype
db "@"
2016-01-06 10:01:20 -08:00
PnP_cool:
; is so cool, no?
2016-01-06 10:01:20 -08:00
text_jump _PnP_cool
db "@"
2016-01-06 10:01:20 -08:00
PnP_inspiring:
; is inspiring!
2016-01-06 10:01:20 -08:00
text_jump _PnP_inspiring
db "@"
2016-01-06 10:01:20 -08:00
PnP_weird:
; is kind of weird.
2016-01-06 10:01:20 -08:00
text_jump _PnP_weird
db "@"
2016-01-06 10:01:20 -08:00
PnP_rightforme:
; is right for me?
2016-01-06 10:01:20 -08:00
text_jump _PnP_rightforme
db "@"
2016-01-06 10:01:20 -08:00
PnP_odd:
; is definitely odd!
2016-01-06 10:01:20 -08:00
text_jump _PnP_odd
db "@"
2015-10-09 20:09:03 -07:00
PeoplePlaces6: ; Places
call Random
cp (PnP_HiddenPlaces.End - PnP_HiddenPlaces) / 2
2015-10-09 20:09:03 -07:00
jr nc, PeoplePlaces6
2018-01-10 08:30:12 -08:00
ld hl, PnP_HiddenPlaces
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld b, [hl]
inc hl
ld c, [hl]
call GetWorldMapLocation
ld e, a
2017-12-24 09:47:30 -08:00
farcall GetLandmarkName
ld hl, PnP_Text5
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_7
jp NextRadioLine
2018-01-10 08:30:12 -08:00
INCLUDE "data/radio/pnp_hidden_places.asm"
PnP_Text5:
; @ @
text_jump _PnP_Text5
db "@"
PeoplePlaces7:
; 0-15 are all valid indexes into .Adjectives,
; so no need for a retry loop
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_PNP_PLACES_ADJECTIVES
ld e, a
ld d, 0
ld hl, .Adjectives
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
call CopyRadioTextToRAM
call Random
cp 4 percent
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE
jr c, .ok
call Random
2018-01-10 08:30:12 -08:00
cp 49 percent - 1
2015-10-09 20:09:03 -07:00
ld a, PLACES_AND_PEOPLE_4 ; People
jr c, .ok
ld a, PLACES_AND_PEOPLE_6 ; Places
.ok
jp PrintRadioLine
.Adjectives:
; there are NUM_PNP_PLACES_ADJECTIVES entries
2015-10-09 20:09:03 -07:00
dw PnP_cute
dw PnP_lazy
dw PnP_happy
dw PnP_noisy
dw PnP_precocious
dw PnP_bold
dw PnP_picky
dw PnP_sortofok
2016-01-06 10:01:20 -08:00
dw PnP_soso
dw PnP_great
dw PnP_mytype
dw PnP_cool
2015-10-09 20:09:03 -07:00
dw PnP_inspiring
dw PnP_weird
dw PnP_rightforme
dw PnP_odd
RocketRadio1:
call StartRadioStation
ld hl, RocketRadioText1
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_2
jp NextRadioLine
RocketRadio2:
ld hl, RocketRadioText2
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_3
jp NextRadioLine
RocketRadio3:
ld hl, RocketRadioText3
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_4
jp NextRadioLine
RocketRadio4:
ld hl, RocketRadioText4
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_5
jp NextRadioLine
RocketRadio5:
ld hl, RocketRadioText5
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_6
jp NextRadioLine
RocketRadio6:
ld hl, RocketRadioText6
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_7
jp NextRadioLine
RocketRadio7:
ld hl, RocketRadioText7
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_8
jp NextRadioLine
RocketRadio8:
ld hl, RocketRadioText8
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_9
jp NextRadioLine
RocketRadio9:
ld hl, RocketRadioText9
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO_10
jp NextRadioLine
RocketRadio10:
ld hl, RocketRadioText10
2015-10-09 20:09:03 -07:00
ld a, ROCKET_RADIO
jp NextRadioLine
RocketRadioText1:
; … …Ahem, we are
text_jump _RocketRadioText1
db "@"
RocketRadioText2:
; TEAM ROCKET!
text_jump _RocketRadioText2
db "@"
RocketRadioText3:
; After three years
text_jump _RocketRadioText3
db "@"
RocketRadioText4:
; of preparation, we
text_jump _RocketRadioText4
db "@"
RocketRadioText5:
; have risen again
text_jump _RocketRadioText5
db "@"
RocketRadioText6:
; from the ashes!
text_jump _RocketRadioText6
db "@"
RocketRadioText7:
; GIOVANNI! @ Can you
text_jump _RocketRadioText7
db "@"
RocketRadioText8:
; hear?@ We did it!
text_jump _RocketRadioText8
db "@"
RocketRadioText9:
; @ Where is our boss?
text_jump _RocketRadioText9
db "@"
RocketRadioText10:
; @ Is he listening?
text_jump _RocketRadioText10
db "@"
PokeFluteRadio:
call StartRadioStation
2015-10-09 20:09:03 -07:00
ld a, 1
ld [wNumRadioLinesPrinted], a
ret
UnownRadio:
call StartRadioStation
2015-10-09 20:09:03 -07:00
ld a, 1
ld [wNumRadioLinesPrinted], a
ret
EvolutionRadio:
call StartRadioStation
2015-10-09 20:09:03 -07:00
ld a, 1
ld [wNumRadioLinesPrinted], a
ret
BuenasPassword1:
; Determine if we need to be here
call BuenasPasswordCheckTime
2015-10-09 20:09:03 -07:00
jp nc, .PlayPassword
ld a, [wNumRadioLinesPrinted]
and a
jp z, BuenasPassword20
jp BuenasPassword8
.PlayPassword:
call StartRadioStation
ldh a, [hBGMapMode]
push af
xor a
ldh [hBGMapMode], a
ld de, BuenasPasswordChannelName
hlcoord 2, 9
call PlaceString
pop af
ldh [hBGMapMode], a
ld hl, BuenaRadioText1
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_2
jp NextRadioLine
BuenasPassword2:
ld hl, BuenaRadioText2
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_3
jp NextRadioLine
BuenasPassword3:
call BuenasPasswordCheckTime
ld hl, BuenaRadioText3
jp c, BuenasPasswordAfterMidnight
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_4
jp NextRadioLine
BuenasPassword4:
call BuenasPasswordCheckTime
jp c, BuenasPassword8
2015-10-24 07:34:19 -07:00
ld a, [wBuenasPassword]
; If we already generated the password today, we don't need to generate a new one.
ld hl, wDailyFlags2
bit DAILYFLAGS2_BUENAS_PASSWORD_F, [hl]
jr nz, .AlreadyGotIt
; There are only 11 groups to choose from.
.greater_than_11
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_PASSWORD_CATEGORIES
cp NUM_PASSWORD_CATEGORIES
jr nc, .greater_than_11
; Store it in the high nybble of e.
swap a
ld e, a
; For each group, choose one of the three passwords.
.greater_than_three
call Random
2018-01-16 14:27:50 -08:00
maskbits NUM_PASSWORDS_PER_CATEGORY
cp NUM_PASSWORDS_PER_CATEGORY
jr nc, .greater_than_three
2015-10-24 07:34:19 -07:00
; The high nybble of wBuenasPassword will now contain the password group index, and the low nybble contains the actual password.
add e
2015-10-24 07:34:19 -07:00
ld [wBuenasPassword], a
; Set the flag so that we don't generate a new password this week.
ld hl, wDailyFlags2
set DAILYFLAGS2_BUENAS_PASSWORD_F, [hl]
.AlreadyGotIt:
ld c, a
call GetBuenasPassword
ld hl, BuenaRadioText4
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_5
jp NextRadioLine
GetBuenasPassword:
; The password indices are held in c. High nybble contains the group index, low nybble contains the word index.
; Load the password group pointer in hl.
ld a, c
swap a
and $f
2018-01-10 08:30:12 -08:00
ld hl, BuenasPasswordTable
ld d, 0
ld e, a
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
; Get the password type and store it in b.
ld a, [hli]
ld b, a
push hl
inc hl
; Get the password index.
ld a, c
and $f
ld c, a
push hl
ld hl, .StringFunctionJumpTable
ld e, b
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
pop de ; de now contains the pointer to the value of this week's password, in Blue Card Points.
call _hl_
pop hl
ld c, [hl]
ret
.StringFunctionJumpTable:
2018-01-10 08:30:12 -08:00
; entries correspond to BUENA_* constants
dw .Mon ; BUENA_MON
dw .Item ; BUENA_ITEM
dw .Move ; BUENA_MOVE
dw .RawString ; BUENA_STRING
.Mon:
call .GetTheIndex
call GetPokemonName
ret
.Item:
call .GetTheIndex
call GetItemName
ret
.Move:
call .GetTheIndex
call GetMoveName
ret
.GetTheIndex:
ld h, 0
ld l, c
add hl, de
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
ret
.RawString:
; Get the string from the table...
ld a, c
and a
jr z, .skip
.read_loop
ld a, [de]
inc de
cp "@"
jr nz, .read_loop
dec c
jr nz, .read_loop
2018-01-23 14:39:09 -08:00
; ... and copy it into wStringBuffer1.
.skip
2018-01-23 14:39:09 -08:00
ld hl, wStringBuffer1
.copy_loop
ld a, [de]
inc de
ld [hli], a
cp "@"
jr nz, .copy_loop
2018-01-23 14:39:09 -08:00
ld de, wStringBuffer1
ret
2018-01-10 08:30:12 -08:00
INCLUDE "data/radio/buenas_passwords.asm"
BuenasPassword5:
ld hl, BuenaRadioText5
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_6
jp NextRadioLine
BuenasPassword6:
ld hl, BuenaRadioText6
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_7
jp NextRadioLine
BuenasPassword7:
call BuenasPasswordCheckTime
ld hl, BuenaRadioText7
jr c, BuenasPasswordAfterMidnight
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD
jp NextRadioLine
BuenasPasswordAfterMidnight:
push hl
ld hl, wDailyFlags2
res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl]
pop hl
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_8
jp NextRadioLine
BuenasPassword8:
ld hl, wDailyFlags2
res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl]
ld hl, BuenaRadioMidnightText10
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_9
jp NextRadioLine
BuenasPassword9:
ld hl, BuenaRadioMidnightText1
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_10
jp NextRadioLine
BuenasPassword10:
ld hl, BuenaRadioMidnightText2
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_11
jp NextRadioLine
BuenasPassword11:
ld hl, BuenaRadioMidnightText3
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_12
jp NextRadioLine
BuenasPassword12:
ld hl, BuenaRadioMidnightText4
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_13
jp NextRadioLine
BuenasPassword13:
ld hl, BuenaRadioMidnightText5
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_14
jp NextRadioLine
BuenasPassword14:
ld hl, BuenaRadioMidnightText6
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_15
jp NextRadioLine
BuenasPassword15:
ld hl, BuenaRadioMidnightText7
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_16
jp NextRadioLine
BuenasPassword16:
ld hl, BuenaRadioMidnightText8
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_17
jp NextRadioLine
BuenasPassword17:
ld hl, BuenaRadioMidnightText9
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_18
jp NextRadioLine
BuenasPassword18:
ld hl, BuenaRadioMidnightText10
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_19
jp NextRadioLine
BuenasPassword19:
ld hl, BuenaRadioMidnightText10
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_20
jp NextRadioLine
BuenasPassword20:
ldh a, [hBGMapMode]
push af
2017-12-24 09:47:30 -08:00
farcall NoRadioMusic
farcall NoRadioName
pop af
ldh [hBGMapMode], a
ld hl, wDailyFlags2
res DAILYFLAGS2_BUENAS_PASSWORD_F, [hl]
ld a, BUENAS_PASSWORD
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
xor a
ld [wNumRadioLinesPrinted], a
ld hl, BuenaOffTheAirText
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_21
jp NextRadioLine
BuenasPassword21:
ld a, BUENAS_PASSWORD
2018-09-09 12:09:51 -07:00
ld [wCurRadioLine], a
xor a
ld [wNumRadioLinesPrinted], a
call BuenasPasswordCheckTime
jp nc, BuenasPassword1
ld hl, BuenaOffTheAirText
2015-10-09 20:09:03 -07:00
ld a, BUENAS_PASSWORD_21
jp NextRadioLine
BuenasPasswordCheckTime:
call UpdateTime
ldh a, [hHours]
cp NITE_HOUR
ret
BuenasPasswordChannelName:
db "BUENA'S PASSWORD@"
BuenaRadioText1:
; BUENA: BUENA here!
text_jump _BuenaRadioText1
db "@"
BuenaRadioText2:
; Today's password!
text_jump _BuenaRadioText2
db "@"
BuenaRadioText3:
; Let me think… It's
text_jump _BuenaRadioText3
db "@"
BuenaRadioText4:
; @ !
text_jump _BuenaRadioText4
db "@"
BuenaRadioText5:
; Don't forget it!
text_jump _BuenaRadioText5
db "@"
BuenaRadioText6:
; I'm in GOLDENROD's
text_jump _BuenaRadioText6
db "@"
BuenaRadioText7:
; RADIO TOWER!
text_jump _BuenaRadioText7
db "@"
BuenaRadioMidnightText1:
; BUENA: Oh my…
text_jump _BuenaRadioMidnightText1
db "@"
BuenaRadioMidnightText2:
; It's midnight! I
text_jump _BuenaRadioMidnightText2
db "@"
BuenaRadioMidnightText3:
; have to shut down!
text_jump _BuenaRadioMidnightText3
db "@"
BuenaRadioMidnightText4:
; Thanks for tuning
text_jump _BuenaRadioMidnightText4
db "@"
BuenaRadioMidnightText5:
; in to the end! But
text_jump _BuenaRadioMidnightText5
db "@"
BuenaRadioMidnightText6:
; don't stay up too
text_jump _BuenaRadioMidnightText6
db "@"
BuenaRadioMidnightText7:
; late! Presented to
text_jump _BuenaRadioMidnightText7
db "@"
BuenaRadioMidnightText8:
; you by DJ BUENA!
text_jump _BuenaRadioMidnightText8
db "@"
BuenaRadioMidnightText9:
; I'm outta here!
text_jump _BuenaRadioMidnightText9
db "@"
BuenaRadioMidnightText10:
; …
text_jump _BuenaRadioMidnightText10
db "@"
BuenaOffTheAirText:
;
text_jump _BuenaOffTheAirText
db "@"
CopyRadioTextToRAM:
ld a, [hl]
cp TX_FAR
jp z, FarCopyRadioText
ld de, wRadioText
ld bc, SCREEN_WIDTH * 2
jp CopyBytes
StartRadioStation:
ld a, [wNumRadioLinesPrinted]
and a
ret nz
call RadioTerminator
call PrintText
ld hl, RadioChannelSongs
2018-09-09 12:09:51 -07:00
ld a, [wCurRadioLine]
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
2017-12-24 09:47:30 -08:00
callfar RadioMusicRestartDE
ret
2018-01-10 08:30:12 -08:00
INCLUDE "data/radio/channel_music.asm"
NextRadioLine:
push af
call CopyRadioTextToRAM
pop af
jp PrintRadioLine