diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 425801e8e..13adacc8e 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -113,3 +113,6 @@ BATTLETOWER_NROFPKMNS EQU 3 BATTLETOWER_TRAINERDATALENGTH EQU $24 BATTLETOWER_NROFTRAINERS EQU 7 +NUM_WILDMONS_PER_AREA_TIME_OF_DAY EQU 7 +WILDMON_GRASS_STRUCTURE_LENGTH EQU 2 + 3 * (1 + 2 * NUM_WILDMONS_PER_AREA_TIME_OF_DAY) + diff --git a/constants/radio_constants.asm b/constants/radio_constants.asm index 76b48b1e7..46341c305 100644 --- a/constants/radio_constants.asm +++ b/constants/radio_constants.asm @@ -1,15 +1,92 @@ const_def - const OAKS_POKEMON_TALK - const POKEDEX_SHOW - const POKEMON_MUSIC - const LUCKY_CHANNEL - const BUENAS_PASSWORD - const PLACES_AND_PEOPLE - const LETS_ALL_SING - const ROCKET_RADIO - const POKE_FLUTE_RADIO - const UNOWN_RADIO - const EVOLUTION_RADIO + const OAKS_POKEMON_TALK ; $00 + const POKEDEX_SHOW ; $01 + const POKEMON_MUSIC ; $02 + const LUCKY_CHANNEL ; $03 + const BUENAS_PASSWORD ; $04 + const PLACES_AND_PEOPLE ; $05 + const LETS_ALL_SING ; $06 + const ROCKET_RADIO ; $07 + const POKE_FLUTE_RADIO ; $08 + const UNOWN_RADIO ; $09 + const EVOLUTION_RADIO ; $0a + const OAKS_POKEMON_TALK_2 ; $0b + const OAKS_POKEMON_TALK_3 ; $0c + const OAKS_POKEMON_TALK_4 ; $0d + const OAKS_POKEMON_TALK_5 ; $0e + const OAKS_POKEMON_TALK_6 ; $0f + const OAKS_POKEMON_TALK_7 ; $10 + const OAKS_POKEMON_TALK_8 ; $11 + const OAKS_POKEMON_TALK_9 ; $12 + const POKEDEX_SHOW_2 ; $13 + const POKEDEX_SHOW_3 ; $14 + const POKEDEX_SHOW_4 ; $15 + const POKEDEX_SHOW_5 ; $16 + const POKEMON_MUSIC_2 ; $17 + const POKEMON_MUSIC_3 ; $18 + const POKEMON_MUSIC_4 ; $19 + const POKEMON_MUSIC_5 ; $1a + const POKEMON_MUSIC_6 ; $1b + const POKEMON_MUSIC_7 ; $1c + const LETS_ALL_SING_2 ; $1d + const LUCKY_NUMBER_SHOW_2 ; $1e + const LUCKY_NUMBER_SHOW_3 ; $1f + const LUCKY_NUMBER_SHOW_4 ; $20 + const LUCKY_NUMBER_SHOW_5 ; $21 + const LUCKY_NUMBER_SHOW_6 ; $22 + const LUCKY_NUMBER_SHOW_7 ; $23 + const LUCKY_NUMBER_SHOW_8 ; $24 + const LUCKY_NUMBER_SHOW_9 ; $25 + const LUCKY_NUMBER_SHOW_10 ; $26 + const LUCKY_NUMBER_SHOW_11 ; $27 + const LUCKY_NUMBER_SHOW_12 ; $28 + const LUCKY_NUMBER_SHOW_13 ; $29 + const LUCKY_NUMBER_SHOW_14 ; $2a + const LUCKY_NUMBER_SHOW_15 ; $2b + const PLACES_AND_PEOPLE_2 ; $2c + const PLACES_AND_PEOPLE_3 ; $2d + const PLACES_AND_PEOPLE_4 ; $2e + const PLACES_AND_PEOPLE_5 ; $2f + const PLACES_AND_PEOPLE_6 ; $30 + const PLACES_AND_PEOPLE_7 ; $31 + const ROCKET_RADIO_2 ; $32 + const ROCKET_RADIO_3 ; $33 + const ROCKET_RADIO_4 ; $34 + const ROCKET_RADIO_5 ; $35 + const ROCKET_RADIO_6 ; $36 + const ROCKET_RADIO_7 ; $37 + const ROCKET_RADIO_8 ; $38 + const ROCKET_RADIO_9 ; $39 + const ROCKET_RADIO_10 ; $3a + const OAKS_POKEMON_TALK_10 ; $3b + const OAKS_POKEMON_TALK_11 ; $3c + const OAKS_POKEMON_TALK_12 ; $3d + const OAKS_POKEMON_TALK_13 ; $3e + const OAKS_POKEMON_TALK_14 ; $3f + const BUENAS_PASSWORD_2 ; $40 + const BUENAS_PASSWORD_3 ; $41 + const BUENAS_PASSWORD_4 ; $42 + const BUENAS_PASSWORD_5 ; $43 + const BUENAS_PASSWORD_6 ; $44 + const BUENAS_PASSWORD_7 ; $45 + const BUENAS_PASSWORD_8 ; $46 + const BUENAS_PASSWORD_9 ; $47 + const BUENAS_PASSWORD_10 ; $48 + const BUENAS_PASSWORD_11 ; $49 + const BUENAS_PASSWORD_12 ; $4a + const BUENAS_PASSWORD_13 ; $4b + const BUENAS_PASSWORD_14 ; $4c + const BUENAS_PASSWORD_15 ; $4d + const BUENAS_PASSWORD_16 ; $4e + const BUENAS_PASSWORD_17 ; $4f + const BUENAS_PASSWORD_18 ; $50 + const BUENAS_PASSWORD_19 ; $51 + const BUENAS_PASSWORD_20 ; $52 + const BUENAS_PASSWORD_21 ; $53 + const RADIO_SCROLL ; $54 + const POKEDEX_SHOW_6 ; $55 + const POKEDEX_SHOW_7 ; $56 + const POKEDEX_SHOW_8 ; $57 const_def const BUENA_MON diff --git a/engine/radio.asm b/engine/radio.asm index 3503ecc13..8e96239de 100644 --- a/engine/radio.asm +++ b/engine/radio.asm @@ -38,8 +38,8 @@ RadioJumptable: ; b863a (2e:463a) dw FernMonMusic1 ; $06 dw RocketRadio1 ; $07 dw PokeFluteRadio ; $08 - dw EvolutionRadio ; $09 - dw UnownRadio ; $0a + dw UnownRadio ; $09 + dw EvolutionRadio ; $0a ; OaksPkmnTalk dw OaksPkmnTalk2 ; $0b dw OaksPkmnTalk3 ; $0c @@ -49,10 +49,10 @@ RadioJumptable: ; b863a (2e:463a) dw OaksPkmnTalk7 ; $10 dw OaksPkmnTalk8 ; $11 dw OaksPkmnTalk9 ; $12 - dw OaksPkmnTalk10 ; $13 - dw OaksPkmnTalk11 ; $14 - dw OaksPkmnTalk12 ; $15 - dw OaksPkmnTalk13 ; $16 + dw PokedexShow2 ; $13 + dw PokedexShow3 ; $14 + dw PokedexShow4 ; $15 + dw PokedexShow5 ; $16 ; Ben Music dw BenMonMusic2 ; $17 dw BenMonMusic3 ; $18 @@ -76,12 +76,13 @@ RadioJumptable: ; b863a (2e:463a) dw LuckyNumberShow13 ; $29 dw LuckyNumberShow14 ; $2a dw LuckyNumberShow15 ; $2b - dw LuckyNumberShow16 ; $2c - dw LuckyNumberShow17 ; $2d - dw LuckyNumberShow18 ; $2e - dw LuckyNumberShow19 ; $2f - dw LuckyNumberShow20 ; $30 - dw LuckyNumberShow21 ; $31 +; 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 @@ -93,11 +94,11 @@ RadioJumptable: ; b863a (2e:463a) dw RocketRadio9 ; $39 dw RocketRadio10 ; $3a ; More Pokemon Channel stuff - dw OaksPkmnTalk14 ; $3b - dw OaksPkmnTalk15 ; $3c - dw OaksPkmnTalk16 ; $3d - dw OaksPkmnTalk17 ; $3e - dw OaksPkmnTalk18 ; $3f + dw OaksPkmnTalk10 ; $3b + dw OaksPkmnTalk11 ; $3c + dw OaksPkmnTalk12 ; $3d + dw OaksPkmnTalk13 ; $3e + dw OaksPkmnTalk14 ; $3f ; Buenas Password dw BuenasPassword2 ; $40 dw BuenasPassword3 ; $41 @@ -121,9 +122,9 @@ RadioJumptable: ; b863a (2e:463a) dw BuenasPassword21 ; $53 dw RadioScroll ; $54 ; More Pokemon Channel stuff - dw OaksPkmnTalk19 ; $55 - dw OaksPkmnTalk20 ; $56 - dw OaksPkmnTalk21 ; $57 + dw PokedexShow6 ; $55 + dw PokedexShow7 ; $56 + dw PokedexShow8 ; $57 PrintRadioLine: ; b86ea (2e:46ea) @@ -144,7 +145,7 @@ PrintRadioLine: ; b86ea (2e:46ea) .print call PrintTextBoxText .skip - ld a, $54 + ld a, RADIO_SCROLL ld [wd002], a ld a, $64 ld [wd004], a @@ -154,7 +155,7 @@ PrintRadioLine: ; b86ea (2e:46ea) Functionb8718: ; b8718 push hl ld b, SCREEN_WIDTH * 2 -.greater_than_10 +.loop ld a, [hl] cp "." jr nz, .next @@ -163,7 +164,7 @@ Functionb8718: ; b8718 .next inc hl dec b - jr nz, .greater_than_10 + jr nz, .loop pop hl ret ; b8728 @@ -188,26 +189,27 @@ OaksPkmnTalk1: ; b8742 (2e:4742) ld [wd006], a call StartRadioStation ld hl, UnknownText_0xb8820 - ld a, $b + ld a, OAKS_POKEMON_TALK_2 jp NextRadioLine OaksPkmnTalk2: ; b8752 (2e:4752) ld hl, UnknownText_0xb8825 - ld a, $c + ld a, OAKS_POKEMON_TALK_3 jp NextRadioLine OaksPkmnTalk3: ; b875a (2e:475a) ld hl, UnknownText_0xb882a - ld a, $d + ld a, OAKS_POKEMON_TALK_4 jp NextRadioLine OaksPkmnTalk4: ; b8762 (2e:4762) -; Choose a random root, and a random Pokemon from that route. +; Choose a random route, and a random Pokemon from that route. call Random and $1f cp $f jr nc, OaksPkmnTalk4 - ld hl, Unknown_b87f2 + ; We now have a number between 0 and 14. + ld hl, .routes ld c, a ld b, 0 rept 2 @@ -216,14 +218,16 @@ endr ld b, [hl] inc hl ld c, [hl] + ; bc now contains the chosen map's group and number indices. push bc + ; Search the JohtoGrassWildMons array for the chosen map. ld hl, JohtoGrassWildMons -.greater_than_10 +.loop ld a, BANK(JohtoGrassWildMons) call GetFarByte cp -1 - jr z, .done2 + jr z, .overflow inc hl cp b jr nz, .next @@ -233,62 +237,64 @@ endr jr z, .done .next dec hl - ld de, $2f + ld de, WILDMON_GRASS_STRUCTURE_LENGTH add hl, de - jr .greater_than_10 + jr .loop .done rept 4 inc hl endr - -.both_bits_set + ; Generate a number, either 0, 1, or 2, to choose a time of day. +.loop2 call Random and 3 cp 3 - jr z, .both_bits_set + jr z, .loop2 - ld bc, $e + ld bc, 2 * NUM_WILDMONS_PER_AREA_TIME_OF_DAY call AddNTimes -.greater_than_102 +.loop3 + ; Choose one of the middle three Pokemon. call Random - and 7 + and NUM_WILDMONS_PER_AREA_TIME_OF_DAY cp 2 - jr c, .greater_than_102 + jr c, .loop3 cp 5 - jr nc, .greater_than_102 + jr nc, .loop3 ld e, a ld d, 0 rept 2 add hl, de endr - inc hl + inc hl ; skip level ld a, BANK(JohtoGrassWildMons) call GetFarByte - ld [wd265], a + ld [wNamedObjectIndexBuffer], a ld [CurPartySpecies], a call GetPokemonName ld hl, StringBuffer1 ld de, wd050 - ld bc, $b + ld bc, PKMN_NAME_LENGTH call CopyBytes - + ; 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 callba GetLandmarkName ld hl, UnknownText_0xb882f call CopyRadioTextToRAM - ld a, $e + ld a, OAKS_POKEMON_TALK_5 jp PrintRadioLine -.done2 +.overflow pop bc ld a, $0 jp PrintRadioLine ; b87f2 (2e:47f2) -Unknown_b87f2: ; b87f2 +.routes: ; b87f2 map ROUTE_29 map ROUTE_46 map ROUTE_30 @@ -308,12 +314,12 @@ Unknown_b87f2: ; b87f2 OaksPkmnTalk5: ; b8810 (2e:4810) ld hl, UnknownText_0xb8834 - ld a, $f + ld a, OAKS_POKEMON_TALK_6 jp NextRadioLine OaksPkmnTalk6: ; b8818 (2e:4818) ld hl, UnknownText_0xb8839 - ld a, $10 + ld a, OAKS_POKEMON_TALK_7 jp NextRadioLine ; b8820 (2e:4820) @@ -358,7 +364,7 @@ OaksPkmnTalk7: ; b883e (2e:483e) ld [wd265], a call GetPokemonName ld hl, UnknownText_0xb884f - ld a, $11 + ld a, OAKS_POKEMON_TALK_8 jp NextRadioLine ; b884f (2e:484f) @@ -373,127 +379,127 @@ OaksPkmnTalk8: ; b8854 (2e:4854) and $f ld e, a ld d, 0 - ld hl, Unknown_b8869 + ld hl, .descriptors rept 2 add hl, de endr ld a, [hli] ld h, [hl] ld l, a - ld a, $12 + ld a, OAKS_POKEMON_TALK_9 jp NextRadioLine ; b8869 (2e:4869) -Unknown_b8869: ; b8869 - dw UnknownText_0xb8889 - dw UnknownText_0xb888e - dw UnknownText_0xb8893 - dw UnknownText_0xb8898 - dw UnknownText_0xb889d - dw UnknownText_0xb88a2 - dw UnknownText_0xb88a7 - dw UnknownText_0xb88ac - dw UnknownText_0xb88b1 - dw UnknownText_0xb88b6 - dw UnknownText_0xb88bb - dw UnknownText_0xb88c0 - dw UnknownText_0xb88c5 - dw UnknownText_0xb88ca - dw UnknownText_0xb88cf - dw UnknownText_0xb88d4 +.descriptors: ; b8869 + 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 ; b8889 -UnknownText_0xb8889: ; 0xb8889 +.sweetadorably: ; 0xb8889 ; sweet and adorably text_jump UnknownText_0x1bc885 db "@" ; 0xb888e -UnknownText_0xb888e: ; 0xb888e +.wigglyslickly: ; 0xb888e ; wiggly and slickly text_jump UnknownText_0x1bc89a db "@" ; 0xb8893 -UnknownText_0xb8893: ; 0xb8893 +.aptlynamed: ; 0xb8893 ; aptly named and text_jump UnknownText_0x1bc8af db "@" ; 0xb8898 -UnknownText_0xb8898: ; 0xb8898 +.undeniablykindof: ; 0xb8898 ; undeniably kind of text_jump UnknownText_0x1bc8c1 db "@" ; 0xb889d -UnknownText_0xb889d: ; 0xb889d +.unbearably: ; 0xb889d ; so, so unbearably text_jump UnknownText_0x1bc8d6 db "@" ; 0xb88a2 -UnknownText_0xb88a2: ; 0xb88a2 +.wowimpressively: ; 0xb88a2 ; wow, impressively text_jump UnknownText_0x1bc8ea db "@" ; 0xb88a7 -UnknownText_0xb88a7: ; 0xb88a7 +.almostpoisonously: ; 0xb88a7 ; almost poisonously text_jump UnknownText_0x1bc8fe db "@" ; 0xb88ac -UnknownText_0xb88ac: ; 0xb88ac +.sensually: ; 0xb88ac ; ooh, so sensually text_jump UnknownText_0x1bc913 db "@" ; 0xb88b1 -UnknownText_0xb88b1: ; 0xb88b1 +.mischievously: ; 0xb88b1 ; so mischievously text_jump UnknownText_0x1bc927 db "@" ; 0xb88b6 -UnknownText_0xb88b6: ; 0xb88b6 +.topically: ; 0xb88b6 ; so very topically text_jump UnknownText_0x1bc93a db "@" ; 0xb88bb -UnknownText_0xb88bb: ; 0xb88bb +.addictively: ; 0xb88bb ; sure addictively text_jump UnknownText_0x1bc94e db "@" ; 0xb88c0 -UnknownText_0xb88c0: ; 0xb88c0 +.looksinwater: ; 0xb88c0 ; looks in water is text_jump UnknownText_0x1bc961 db "@" ; 0xb88c5 -UnknownText_0xb88c5: ; 0xb88c5 +.evolutionmustbe: ; 0xb88c5 ; evolution must be text_jump UnknownText_0x1bc975 db "@" ; 0xb88ca -UnknownText_0xb88ca: ; 0xb88ca +.provocatively: ; 0xb88ca ; provocatively text_jump UnknownText_0x1bc989 db "@" ; 0xb88cf -UnknownText_0xb88cf: ; 0xb88cf +.flippedout: ; 0xb88cf ; so flipped out and text_jump UnknownText_0x1bc999 db "@" ; 0xb88d4 -UnknownText_0xb88d4: ; 0xb88d4 +.heartmeltingly: ; 0xb88d4 ; heart-meltingly text_jump UnknownText_0x1bc9ae db "@" @@ -504,7 +510,7 @@ OaksPkmnTalk9: ; b88d9 (2e:48d9) and $f ld e, a ld d, 0 - ld hl, Unknown_b88fe + ld hl, .descriptors rept 2 add hl, de endr @@ -514,138 +520,138 @@ endr ld a, [wd006] dec a ld [wd006], a - ld a, $d - jr nz, .nope + ld a, OAKS_POKEMON_TALK_4 + jr nz, .ok ld a, $5 ld [wd006], a - ld a, $3b -.nope + ld a, OAKS_POKEMON_TALK_10 +.ok jp NextRadioLine ; b88fe (2e:48fe) -Unknown_b88fe: ; b88fe - dw UnknownText_0xb891e - dw UnknownText_0xb8923 - dw UnknownText_0xb8928 - dw UnknownText_0xb892d - dw UnknownText_0xb8932 - dw UnknownText_0xb8937 - dw UnknownText_0xb893c - dw UnknownText_0xb8941 - dw UnknownText_0xb8946 - dw UnknownText_0xb894b - dw UnknownText_0xb8950 - dw UnknownText_0xb8955 - dw UnknownText_0xb895a - dw UnknownText_0xb895f - dw UnknownText_0xb8964 - dw UnknownText_0xb8969 +.descriptors: ; b88fe + 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 ; b891e -UnknownText_0xb891e: ; 0xb891e +.cute: ; 0xb891e ; cute. text_jump UnknownText_0x1bc9c0 db "@" ; 0xb8923 -UnknownText_0xb8923: ; 0xb8923 +.weird: ; 0xb8923 ; weird. text_jump UnknownText_0x1bc9c8 db "@" ; 0xb8928 -UnknownText_0xb8928: ; 0xb8928 +.pleasant: ; 0xb8928 ; pleasant. text_jump UnknownText_0x1bc9d1 db "@" ; 0xb892d -UnknownText_0xb892d: ; 0xb892d +.boldsortof: ; 0xb892d ; bold, sort of. text_jump UnknownText_0x1bc9dd db "@" ; 0xb8932 -UnknownText_0xb8932: ; 0xb8932 +.frightening: ; 0xb8932 ; frightening. text_jump UnknownText_0x1bc9ee db "@" ; 0xb8937 -UnknownText_0xb8937: ; 0xb8937 +.suavedebonair: ; 0xb8937 ; suave & debonair! text_jump UnknownText_0x1bc9fd db "@" ; 0xb893c -UnknownText_0xb893c: ; 0xb893c +.powerful: ; 0xb893c ; powerful. text_jump UnknownText_0x1bca11 db "@" ; 0xb8941 -UnknownText_0xb8941: ; 0xb8941 +.exciting: ; 0xb8941 ; exciting. text_jump UnknownText_0x1bca1d db "@" ; 0xb8946 -UnknownText_0xb8946: ; 0xb8946 +.groovy: ; 0xb8946 ; groovy! text_jump UnknownText_0x1bca29 db "@" ; 0xb894b -UnknownText_0xb894b: ; 0xb894b +.inspiring: ; 0xb894b ; inspiring. text_jump UnknownText_0x1bca33 db "@" ; 0xb8950 -UnknownText_0xb8950: ; 0xb8950 +.friendly: ; 0xb8950 ; friendly. text_jump UnknownText_0x1bca40 db "@" ; 0xb8955 -UnknownText_0xb8955: ; 0xb8955 +.hothothot: ; 0xb8955 ; hot, hot, hot! text_jump UnknownText_0x1bca4c db "@" ; 0xb895a -UnknownText_0xb895a: ; 0xb895a +.stimulating: ; 0xb895a ; stimulating. text_jump UnknownText_0x1bca5d db "@" ; 0xb895f -UnknownText_0xb895f: ; 0xb895f +.guarded: ; 0xb895f ; guarded. text_jump UnknownText_0x1bca6c db "@" ; 0xb8964 -UnknownText_0xb8964: ; 0xb8964 +.lovely: ; 0xb8964 ; lovely. text_jump UnknownText_0x1bca77 db "@" ; 0xb8969 -UnknownText_0xb8969: ; 0xb8969 +.speedy: ; 0xb8969 ; speedy. text_jump UnknownText_0x1bca81 db "@" ; 0xb896e -OaksPkmnTalk14: ; b896e (2e:496e) - callba Function91868 +OaksPkmnTalk10: ; b896e (2e:496e) + callba RadioMusicRestartPokemonChannel ld hl, UnknownText_0xb8993 call PrintText call WaitBGMap ld hl, UnknownText_0xb898e call PrintText - ld a, $3c + ld a, OAKS_POKEMON_TALK_11 ld [wd002], a ld a, $64 ld [wd004], a @@ -662,74 +668,74 @@ UnknownText_0xb8993: ; 0xb8993 db "@" ; 0xb8994 -OaksPkmnTalk15: ; b8994 (2e:4994) +OaksPkmnTalk11: ; b8994 (2e:4994) ld hl, wd004 dec [hl] ret nz hlcoord 9, 14 - ld de, String_b89a4 - ld a, $3d - jp Functionb8a00 + ld de, .pokemon_string + ld a, OAKS_POKEMON_TALK_12 + jp PlaceRadioString ; b89a4 (2e:49a4) -String_b89a4: +.pokemon_string: db "#MON@" ; b89a9 -OaksPkmnTalk16: ; b89a9 (2e:49a9) +OaksPkmnTalk12: ; b89a9 (2e:49a9) ld hl, wd004 dec [hl] ret nz hlcoord 1, 16 - ld de, String_b89b9 - ld a, $3e - jp Functionb8a00 + ld de, .pokemon_channel_string + ld a, OAKS_POKEMON_TALK_13 + jp PlaceRadioString ; b89b9 (2e:49b9) -String_b89b9: +.pokemon_channel_string: db "#MON Channel@" ; b89c6 -OaksPkmnTalk17: ; b89c6 (2e:49c6) +OaksPkmnTalk13: ; b89c6 (2e:49c6) ld hl, wd004 dec [hl] ret nz hlcoord 12, 16 - ld de, String_b89d6 - ld a, $3f - jp Functionb8a00 + ld de, .terminator + ld a, OAKS_POKEMON_TALK_14 + jp PlaceRadioString ; b89d6 (2e:49d6) -String_b89d6: +.terminator: db "@" ; b89d7 -OaksPkmnTalk18: ; b89d7 (2e:49d7) +OaksPkmnTalk14: ; b89d7 (2e:49d7) ld hl, wd004 dec [hl] ret nz ld de, $1d - callab RadioMusicNone - ld hl, UnknownText_0xb89ff + callab RadioMusicRestartDE + ld hl, .terminator call PrintText - ld a, $d + ld a, OAKS_POKEMON_TALK_4 ld [wd003], a xor a ld [wd005], a - ld a, $54 + ld a, RADIO_SCROLL ld [wd002], a - ld a, $a + ld a, 10 ld [wd004], a ret ; b89ff (2e:49ff) -UnknownText_0xb89ff: ; 0xb89ff +.terminator: ; 0xb89ff db "@" ; 0xb8a00 -Functionb8a00: ; b8a00 (2e:4a00) +PlaceRadioString: ; b8a00 (2e:4a00) ld [wd002], a - ld a, $64 + ld a, 100 ld [wd004], a jp PlaceString @@ -749,7 +755,7 @@ ClearBottomLine: ; b8a17 (2e:4a17) ld a, " " jp ByteFill -Functionb8a2d: ; b8a2d (2e:4a2d) +PokedexShow_GetDexEntryBank: ; b8a2d (2e:4a2d) push hl push de ld a, [CurPartySpecies] @@ -776,26 +782,26 @@ Functionb8a2d: ; b8a2d (2e:4a2d) PokedexShow1: ; b8a46 (2e:4a46) call StartRadioStation -.asm_b8a49 +.loop call Random cp CELEBI - jr nc, .asm_b8a49 + jr nc, .loop ld c, a push bc ld a, c call CheckCaughtMon pop bc - jr z, .asm_b8a49 + jr z, .loop inc c ld a, c ld [CurPartySpecies], a ld [wd265], a call GetPokemonName ld hl, UnknownText_0xb8b30 - ld a, $13 + ld a, POKEDEX_SHOW_2 jp NextRadioLine -OaksPkmnTalk10: ; b8a6c (2e:4a6c) +PokedexShow2: ; b8a6c (2e:4a6c) ld a, [CurPartySpecies] dec a ld hl, PokedexDataPointerTable @@ -806,17 +812,17 @@ rept 2 endr ld a, BANK(PokedexDataPointerTable) call GetFarHalfword - call Functionb8a2d + call PokedexShow_GetDexEntryBank push af push hl - call Functionb8af3 + call CopyDexEntryPart1 dec hl ld [hl], $57 ld hl, wd26b call CopyRadioTextToRAM pop hl pop af - call Functionb8b11 + call CopyDexEntryPart2 rept 4 inc hl endr @@ -824,40 +830,40 @@ endr ld [wd26b], a ld a, h ld [wd26c], a - ld a, $14 + ld a, POKEDEX_SHOW_3 jp PrintRadioLine -OaksPkmnTalk11: ; b8aa4 (2e:4aa4) - call Functionb8ad4 - ld a, $15 +PokedexShow3: ; b8aa4 (2e:4aa4) + call CopyDexEntry + ld a, POKEDEX_SHOW_4 jp PrintRadioLine -OaksPkmnTalk12: ; b8aac (2e:4aac) - call Functionb8ad4 - ld a, $16 +PokedexShow4: ; b8aac (2e:4aac) + call CopyDexEntry + ld a, POKEDEX_SHOW_5 jp PrintRadioLine -OaksPkmnTalk13: ; b8ab4 (2e:4ab4) - call Functionb8ad4 - ld a, $55 +PokedexShow5: ; b8ab4 (2e:4ab4) + call CopyDexEntry + ld a, POKEDEX_SHOW_6 jp PrintRadioLine -OaksPkmnTalk19: ; b8abc (2e:4abc) - call Functionb8ad4 - ld a, $56 +PokedexShow6: ; b8abc (2e:4abc) + call CopyDexEntry + ld a, POKEDEX_SHOW_7 jp PrintRadioLine -OaksPkmnTalk20: ; b8ac4 (2e:4ac4) - call Functionb8ad4 - ld a, $57 +PokedexShow7: ; b8ac4 (2e:4ac4) + call CopyDexEntry + ld a, POKEDEX_SHOW_8 jp PrintRadioLine -OaksPkmnTalk21: ; b8acc (2e:4acc) - call Functionb8ad4 - ld a, $1 +PokedexShow8: ; b8acc (2e:4acc) + call CopyDexEntry + ld a, POKEDEX_SHOW jp PrintRadioLine -Functionb8ad4: ; b8ad4 (2e:4ad4) +CopyDexEntry: ; b8ad4 (2e:4ad4) ld a, [wd26b] ld l, a ld a, [wd26c] @@ -865,48 +871,48 @@ Functionb8ad4: ; b8ad4 (2e:4ad4) ld a, [wd26d] push af push hl - call Functionb8af3 + call CopyDexEntryPart1 dec hl - ld [hl], $57 + ld [hl], "" ld hl, wd26b call CopyRadioTextToRAM pop hl pop af - call Functionb8b11 + call CopyDexEntryPart2 ret -Functionb8af3: ; b8af3 (2e:4af3) +CopyDexEntryPart1: ; b8af3 (2e:4af3) ld de, wd26d - ld bc, $13 + ld bc, SCREEN_WIDTH - 1 call FarCopyBytes ld hl, wd26b - ld [hl], $0 + ld [hl], "" inc hl - ld [hl], $4f + ld [hl], "" inc hl -.asm_b8b05 +.loop ld a, [hli] - cp $50 + cp "@" ret z - cp $4e + cp "" ret z - cp $5f + cp "" ret z - jr .asm_b8b05 + jr .loop -Functionb8b11: ; b8b11 (2e:4b11) +CopyDexEntryPart2: ; b8b11 (2e:4b11) ld d, a -.asm_b8b12 +.loop ld a, d call GetFarByte inc hl - cp $50 - jr z, .asm_b8b23 - cp $4e - jr z, .asm_b8b23 - cp $5f - jr nz, .asm_b8b12 -.asm_b8b23 + cp "@" + jr z, .okay + cp "" + jr z, .okay + cp "" + jr nz, .loop +.okay ld a, l ld [wd26b], a ld a, h @@ -923,70 +929,70 @@ UnknownText_0xb8b30: ; 0xb8b30 ; 0xb8b35 BenMonMusic1: ; b8b35 (2e:4b35) - call Functionb8b90 + call StartPokemonMusicChannel ld hl, UnknownText_0xb8baa - ld a, $17 + ld a, POKEMON_MUSIC_2 jp NextRadioLine BenMonMusic2: ; b8b40 (2e:4b40) ld hl, UnknownText_0xb8baf - ld a, $18 + ld a, POKEMON_MUSIC_3 jp NextRadioLine BenMonMusic3: ; b8b48 (2e:4b48) ld hl, UnknownText_0xb8bb4 - ld a, $19 + ld a, POKEMON_MUSIC_4 jp NextRadioLine FernMonMusic1: ; b8b50 (2e:4b50) - call Functionb8b90 + call StartPokemonMusicChannel ld hl, UnknownText_0xb8bb9 - ld a, $1d + ld a, LETS_ALL_SING_2 jp NextRadioLine FernMonMusic2: ; b8b5b (2e:4b5b) ld hl, UnknownText_0xb8bbe - ld a, $19 + ld a, POKEMON_MUSIC_4 jp NextRadioLine BenFernMusic4: ; b8b63 (2e:4b63) ld hl, UnknownText_0xb8bc3 - ld a, $1a + ld a, POKEMON_MUSIC_5 jp NextRadioLine BenFernMusic5: ; b8b6b (2e:4b6b) call GetWeekday and 1 ld hl, UnknownText_0xb8bc8 - jr z, .asm_b8b78 + jr z, .SunTueThurSun ld hl, UnknownText_0xb8bcd -.asm_b8b78 - ld a, $1b +.SunTueThurSun + ld a, POKEMON_MUSIC_6 jp NextRadioLine BenFernMusic6: ; b8b7d (2e:4b7d) call GetWeekday and 1 ld hl, UnknownText_0xb8bd2 - jr z, .asm_b8b8a + jr z, .SunTueThurSun ld hl, UnknownText_0xb8bd7 -.asm_b8b8a - ld a, $1c +.SunTueThurSun + ld a, POKEMON_MUSIC_7 jp NextRadioLine BenFernMusic7: ; b8b8f (2e:4b8f) ret -Functionb8b90: ; b8b90 (2e:4b90) +StartPokemonMusicChannel: ; b8b90 (2e:4b90) call RadioTerminator call PrintText ld de, MUSIC_POKEMON_MARCH call GetWeekday and 1 - jr z, .done + jr z, .SunTueThurSun ld de, MUSIC_POKEMON_LULLABY -.done - callab RadioMusicNone +.SunTueThurSun + callab RadioMusicRestartDE ret ; b8baa (2e:4baa) @@ -1057,37 +1063,37 @@ LuckyNumberShow1: ; b8bdc (2e:4bdc) callab Functionc422 .asm_b8bed ld hl, UnknownText_0xb8c7e - ld a, $1e + ld a, LUCKY_NUMBER_SHOW_2 jp NextRadioLine LuckyNumberShow2: ; b8bf5 (2e:4bf5) ld hl, UnknownText_0xb8c83 - ld a, $1f + ld a, LUCKY_NUMBER_SHOW_3 jp NextRadioLine LuckyNumberShow3: ; b8bfd (2e:4bfd) ld hl, UnknownText_0xb8c88 - ld a, $20 + ld a, LUCKY_NUMBER_SHOW_4 jp NextRadioLine LuckyNumberShow4: ; b8c05 (2e:4c05) ld hl, UnknownText_0xb8c8d - ld a, $21 + ld a, LUCKY_NUMBER_SHOW_5 jp NextRadioLine LuckyNumberShow5: ; b8c0d (2e:4c0d) ld hl, UnknownText_0xb8c92 - ld a, $22 + ld a, LUCKY_NUMBER_SHOW_6 jp NextRadioLine LuckyNumberShow6: ; b8c15 (2e:4c15) ld hl, UnknownText_0xb8c97 - ld a, $23 + ld a, LUCKY_NUMBER_SHOW_7 jp NextRadioLine LuckyNumberShow7: ; b8c1d (2e:4c1d) ld hl, UnknownText_0xb8c9c - ld a, $24 + ld a, LUCKY_NUMBER_SHOW_8 jp NextRadioLine LuckyNumberShow8: ; b8c25 (2e:4c25) @@ -1095,50 +1101,50 @@ LuckyNumberShow8: ; b8c25 (2e:4c25) ld de, wdc9f ld bc, $8205 call PrintNum - ld a, $50 + ld a, "@" ld [StringBuffer1 + 5], a ld hl, UnknownText_0xb8ca1 - ld a, $25 + ld a, LUCKY_NUMBER_SHOW_9 jp NextRadioLine LuckyNumberShow9: ; b8c3e (2e:4c3e) ld hl, UnknownText_0xb8ca6 - ld a, $26 + ld a, LUCKY_NUMBER_SHOW_10 jp NextRadioLine LuckyNumberShow10: ; b8c46 (2e:4c46) ld hl, UnknownText_0xb8c9c - ld a, $27 + ld a, LUCKY_NUMBER_SHOW_11 jp NextRadioLine LuckyNumberShow11: ; b8c4e (2e:4c4e) ld hl, UnknownText_0xb8ca1 - ld a, $28 + ld a, LUCKY_NUMBER_SHOW_12 jp NextRadioLine LuckyNumberShow12: ; b8c56 (2e:4c56) ld hl, UnknownText_0xb8cab - ld a, $29 + ld a, LUCKY_NUMBER_SHOW_13 jp NextRadioLine LuckyNumberShow13: ; b8c5e (2e:4c5e) ld hl, UnknownText_0xb8cb0 call Random and a - ld a, $3 - jr nz, .asm_b8c6b - ld a, $2a -.asm_b8c6b + ld a, LUCKY_CHANNEL + jr nz, .okay + ld a, LUCKY_NUMBER_SHOW_14 +.okay jp NextRadioLine LuckyNumberShow14: ; b8c6e (2e:4c6e) ld hl, UnknownText_0xb8cb5 - ld a, $2b + ld a, LUCKY_NUMBER_SHOW_15 jp NextRadioLine LuckyNumberShow15: ; b8c76 (2e:4c76) ld hl, UnknownText_0xb8cba - ld a, $3 + ld a, LUCKY_CHANNEL jp NextRadioLine ; b8c7e (2e:4c7e) @@ -1223,22 +1229,22 @@ UnknownText_0xb8cba: ; 0xb8cba PeoplePlaces1: ; b8cbf (2e:4cbf) call StartRadioStation ld hl, UnknownText_0xb8ce3 - ld a, $2c + ld a, PLACES_AND_PEOPLE_2 jp NextRadioLine -LuckyNumberShow16: ; b8cca (2e:4cca) +PeoplePlaces2: ; b8cca (2e:4cca) ld hl, UnknownText_0xb8ce8 - ld a, $2d + ld a, PLACES_AND_PEOPLE_3 jp NextRadioLine -LuckyNumberShow17: ; b8cd2 (2e:4cd2) +PeoplePlaces3: ; b8cd2 (2e:4cd2) ld hl, UnknownText_0xb8ced call Random - cp $7b - ld a, $2e - jr c, .asm_b8ce0 - ld a, $30 -.asm_b8ce0 + cp $7b ; 48 percent + ld a, PLACES_AND_PEOPLE_4 ; People + jr c, .ok + ld a, PLACES_AND_PEOPLE_6 ; Places +.ok jp NextRadioLine ; b8ce3 (2e:4ce3) @@ -1260,46 +1266,46 @@ UnknownText_0xb8ced: ; 0xb8ced db "@" ; 0xb8cf2 -LuckyNumberShow18: ; b8cf2 (2e:4cf2) +PeoplePlaces4: ; People call Random - and " " + and $7f inc a - cp $43 - jr nc, LuckyNumberShow18 + cp NUM_TRAINER_CLASSES - 1 + jr nc, PeoplePlaces4 push af - ld hl, Unknown_b8d3e + ld hl, .E4Names ld a, [StatusFlags] bit 6, a - jr z, .NotMet - ld hl, Unknown_b8d43 + jr z, .ok + ld hl, .KantoLeaderNames ld a, [KantoBadges] cp %11111111 - jr nz, .NotMet - ld hl, Unknown_b8d4b -.NotMet + jr nz, .ok + ld hl, .MiscNames +.ok pop af ld c, a - ld de, $1 + ld de, 1 push bc call IsInArray pop bc - jr c, LuckyNumberShow18 + jr c, PeoplePlaces4 push bc callab GetTrainerClassName ld de, StringBuffer1 call CopyName1 pop bc - ld b, $1 + ld b, 1 callab GetTrainerName ld hl, UnknownText_0xb8d51 - ld a, $2f + ld a, PLACES_AND_PEOPLE_5 jp NextRadioLine ; b8d3e (2e:4d3e) -Unknown_b8d3e: db $0b, $0d, $0e, $0f, $10 -Unknown_b8d43: db $11, $12, $13, $15, $1a, $23, $2e, $40 -Unknown_b8d4b: db $09, $0a, $0c, $2a, $3f - db $ff +.E4Names: db WILL, BRUNO, KAREN, KOGA, CHAMPION ; $0b, $0d, $0e, $0f, $10 +.KantoLeaderNames: db BROCK, MISTY, LT_SURGE, ERIKA, JANINE, SABRINA, BLAINE, BLUE ; $11, $12, $13, $15, $1a, $23, $2e, $40 +.MiscNames: db RIVAL1, POKEMON_PROF, CAL, RIVAL2, RED ; $09, $0a, $0c, $2a, $3f + db -1 ; b8d51 UnknownText_0xb8d51: ; 0xb8d51 @@ -1308,12 +1314,12 @@ UnknownText_0xb8d51: ; 0xb8d51 db "@" ; 0xb8d56 -LuckyNumberShow19: ; b8d56 (2e:4d56) +PeoplePlaces5: ; b8d56 (2e:4d56) call Random and $f ld e, a ld d, 0 - ld hl, Unknown_b8d7d + ld hl, .Descriptors rept 2 add hl, de endr @@ -1321,138 +1327,138 @@ endr ld h, [hl] ld l, a call Random - cp $a - ld a, $5 - jr c, .asm_b8d7a + cp $a ; 6.25 percent + ld a, PLACES_AND_PEOPLE + jr c, .ok call Random - cp $7b - ld a, $2e - jr c, .asm_b8d7a - ld a, $30 -.asm_b8d7a + cp $7b ; 48 percent + ld a, PLACES_AND_PEOPLE_4 ; People + jr c, .ok + ld a, PLACES_AND_PEOPLE_6 ; Places +.ok jp NextRadioLine ; b8d7d (2e:4d7d) -Unknown_b8d7d: ; b8d7d - dw UnknownText_0xb8d9d - dw UnknownText_0xb8da2 - dw UnknownText_0xb8da7 - dw UnknownText_0xb8dac - dw UnknownText_0xb8db1 - dw UnknownText_0xb8db6 - dw UnknownText_0xb8dbb - dw UnknownText_0xb8dc0 - dw UnknownText_0xb8dc5 - dw UnknownText_0xb8dca - dw UnknownText_0xb8dcf - dw UnknownText_0xb8dd4 - dw UnknownText_0xb8dd9 - dw UnknownText_0xb8dde - dw UnknownText_0xb8de3 - dw UnknownText_0xb8de8 +.Descriptors: ; b8d7d + dw PnP_cute + dw PnP_lazy + dw PnP_happy + dw PnP_noisy + dw PnP_precocious + dw PnP_bold + dw PnP_picky + dw PnP_sortofok + dw PnP_justsoso + dw PnP_actuallygreat + dw PnP_justmytype + dw PnP_socool + dw PnP_inspiring + dw PnP_weird + dw PnP_rightforme + dw PnP_odd ; b8d9d -UnknownText_0xb8d9d: ; 0xb8d9d +PnP_cute: ; 0xb8d9d ; is cute. text_jump UnknownText_0x1bcc80 db "@" ; 0xb8da2 -UnknownText_0xb8da2: ; 0xb8da2 +PnP_lazy: ; 0xb8da2 ; is sort of lazy. text_jump UnknownText_0x1bcc8b db "@" ; 0xb8da7 -UnknownText_0xb8da7: ; 0xb8da7 +PnP_happy: ; 0xb8da7 ; is always happy. text_jump UnknownText_0x1bcc9e db "@" ; 0xb8dac -UnknownText_0xb8dac: ; 0xb8dac +PnP_noisy: ; 0xb8dac ; is quite noisy. text_jump UnknownText_0x1bccb1 db "@" ; 0xb8db1 -UnknownText_0xb8db1: ; 0xb8db1 +PnP_precocious: ; 0xb8db1 ; is precocious. text_jump UnknownText_0x1bccc3 db "@" ; 0xb8db6 -UnknownText_0xb8db6: ; 0xb8db6 +PnP_bold: ; 0xb8db6 ; is somewhat bold. text_jump UnknownText_0x1bccd4 db "@" ; 0xb8dbb -UnknownText_0xb8dbb: ; 0xb8dbb +PnP_picky: ; 0xb8dbb ; is too picky! text_jump UnknownText_0x1bcce8 db "@" ; 0xb8dc0 -UnknownText_0xb8dc0: ; 0xb8dc0 +PnP_sortofok: ; 0xb8dc0 ; is sort of OK. text_jump UnknownText_0x1bccf8 db "@" ; 0xb8dc5 -UnknownText_0xb8dc5: ; 0xb8dc5 +PnP_justsoso: ; 0xb8dc5 ; is just so-so. text_jump UnknownText_0x1bcd09 db "@" ; 0xb8dca -UnknownText_0xb8dca: ; 0xb8dca +PnP_actuallygreat: ; 0xb8dca ; is actually great. text_jump UnknownText_0x1bcd1a db "@" ; 0xb8dcf -UnknownText_0xb8dcf: ; 0xb8dcf +PnP_justmytype: ; 0xb8dcf ; is just my type. text_jump UnknownText_0x1bcd2f db "@" ; 0xb8dd4 -UnknownText_0xb8dd4: ; 0xb8dd4 +PnP_socool: ; 0xb8dd4 ; is so cool, no? text_jump UnknownText_0x1bcd42 db "@" ; 0xb8dd9 -UnknownText_0xb8dd9: ; 0xb8dd9 +PnP_inspiring: ; 0xb8dd9 ; is inspiring! text_jump UnknownText_0x1bcd54 db "@" ; 0xb8dde -UnknownText_0xb8dde: ; 0xb8dde +PnP_weird: ; 0xb8dde ; is kind of weird. text_jump UnknownText_0x1bcd64 db "@" ; 0xb8de3 -UnknownText_0xb8de3: ; 0xb8de3 +PnP_rightforme: ; 0xb8de3 ; is right for me? text_jump UnknownText_0x1bcd78 db "@" ; 0xb8de8 -UnknownText_0xb8de8: ; 0xb8de8 +PnP_odd: ; 0xb8de8 ; is definitely odd! text_jump UnknownText_0x1bcd8b db "@" ; 0xb8ded -LuckyNumberShow20: ; b8ded (2e:4ded) +PeoplePlaces6: ; Places call Random - cp $9 - jr nc, LuckyNumberShow20 - ld hl, Unknown_b8e11 + cp 9 + jr nc, PeoplePlaces6 + ld hl, .Maps ld c, a ld b, 0 rept 2 @@ -1465,11 +1471,11 @@ endr ld e, a callba GetLandmarkName ld hl, UnknownText_0xb8e23 - ld a, $31 + ld a, PLACES_AND_PEOPLE_7 jp NextRadioLine ; b8e11 (2e:4e11) -Unknown_b8e11: ; b8e11 +.Maps: ; b8e11 map PALLET_TOWN map ROUTE_22 map PEWTER_CITY @@ -1487,12 +1493,12 @@ UnknownText_0xb8e23: ; 0xb8e23 db "@" ; 0xb8e28 -LuckyNumberShow21: ; b8e28 (2e:4e28) +PeoplePlaces7: ; b8e28 (2e:4e28) call Random and $f ld e, a ld d, 0 - ld hl, Unknown_b8e52 + ld hl, .descriptors rept 2 add hl, de endr @@ -1501,86 +1507,86 @@ endr ld l, a call CopyRadioTextToRAM call Random - cp $a - ld a, $5 - jr c, .asm_b8e4f + cp $a ; 6.25 percent + ld a, PLACES_AND_PEOPLE + jr c, .ok call Random - cp $7b - ld a, $2e - jr c, .asm_b8e4f - ld a, $30 -.asm_b8e4f + cp $7b ; 48 percent + ld a, PLACES_AND_PEOPLE_4 ; People + jr c, .ok + ld a, PLACES_AND_PEOPLE_6 ; Places +.ok jp PrintRadioLine ; b8e52 (2e:4e52) -Unknown_b8e52: ; b8e52 - dw UnknownText_0xb8d9d - dw UnknownText_0xb8da2 - dw UnknownText_0xb8da7 - dw UnknownText_0xb8dac - dw UnknownText_0xb8db1 - dw UnknownText_0xb8db6 - dw UnknownText_0xb8dbb - dw UnknownText_0xb8dc0 - dw UnknownText_0xb8dc5 - dw UnknownText_0xb8dca - dw UnknownText_0xb8dcf - dw UnknownText_0xb8dd4 - dw UnknownText_0xb8dd9 - dw UnknownText_0xb8dde - dw UnknownText_0xb8de3 - dw UnknownText_0xb8de8 +.descriptors: ; b8e52 + dw PnP_cute + dw PnP_lazy + dw PnP_happy + dw PnP_noisy + dw PnP_precocious + dw PnP_bold + dw PnP_picky + dw PnP_sortofok + dw PnP_justsoso + dw PnP_actuallygreat + dw PnP_justmytype + dw PnP_socool + dw PnP_inspiring + dw PnP_weird + dw PnP_rightforme + dw PnP_odd ; b8e72 RocketRadio1: ; b8e72 (2e:4e72) call StartRadioStation ld hl, UnknownText_0xb8ec5 - ld a, $32 + ld a, ROCKET_RADIO_2 jp NextRadioLine RocketRadio2: ; b8e7d (2e:4e7d) ld hl, UnknownText_0xb8eca - ld a, $33 + ld a, ROCKET_RADIO_3 jp NextRadioLine RocketRadio3: ; b8e85 (2e:4e85) ld hl, UnknownText_0xb8ecf - ld a, $34 + ld a, ROCKET_RADIO_4 jp NextRadioLine RocketRadio4: ; b8e8d (2e:4e8d) ld hl, UnknownText_0xb8ed4 - ld a, $35 + ld a, ROCKET_RADIO_5 jp NextRadioLine RocketRadio5: ; b8e95 (2e:4e95) ld hl, UnknownText_0xb8ed9 - ld a, $36 + ld a, ROCKET_RADIO_6 jp NextRadioLine RocketRadio6: ; b8e9d (2e:4e9d) ld hl, UnknownText_0xb8ede - ld a, $37 + ld a, ROCKET_RADIO_7 jp NextRadioLine RocketRadio7: ; b8ea5 (2e:4ea5) ld hl, UnknownText_0xb8ee3 - ld a, $38 + ld a, ROCKET_RADIO_8 jp NextRadioLine RocketRadio8: ; b8ead (2e:4ead) ld hl, UnknownText_0xb8ee8 - ld a, $39 + ld a, ROCKET_RADIO_9 jp NextRadioLine RocketRadio9: ; b8eb5 (2e:4eb5) ld hl, UnknownText_0xb8eed - ld a, $3a + ld a, ROCKET_RADIO_10 jp NextRadioLine RocketRadio10: ; b8ebd (2e:4ebd) ld hl, UnknownText_0xb8ef2 - ld a, $7 + ld a, ROCKET_RADIO jp NextRadioLine ; b8ec5 (2e:4ec5) @@ -1646,32 +1652,32 @@ UnknownText_0xb8ef2: ; 0xb8ef2 PokeFluteRadio: ; b8ef7 (2e:4ef7) call StartRadioStation - ld a, $1 + ld a, 1 ld [wd005], a ret -EvolutionRadio: ; b8f00 (2e:4f00) +UnownRadio: ; b8f00 (2e:4f00) call StartRadioStation - ld a, $1 + ld a, 1 ld [wd005], a ret -UnownRadio: ; b8f09 (2e:4f09) +EvolutionRadio: ; b8f09 (2e:4f09) call StartRadioStation - ld a, $1 + ld a, 1 ld [wd005], a ret BuenasPassword1: ; b8f12 (2e:4f12) ; Determine if we need to be here call BuenasPasswordCheckMidnight - jp nc, Functionb8f22 + jp nc, .PlayPassword ld a, [wd005] and a jp z, BuenasPassword20 jp BuenasPassword8 -Functionb8f22: ; b8f22 (2e:4f22) +.PlayPassword: ; b8f22 (2e:4f22) call StartRadioStation ld a, [hBGMapMode] ; $ff00+$d4 push af @@ -1683,19 +1689,19 @@ Functionb8f22: ; b8f22 (2e:4f22) pop af ld [hBGMapMode], a ; $ff00+$d4 ld hl, UnknownText_0xb9182 - ld a, $40 + ld a, BUENAS_PASSWORD_2 jp NextRadioLine BuenasPassword2: ; b8f3f (2e:4f3f) ld hl, UnknownText_0xb9187 - ld a, $41 + ld a, BUENAS_PASSWORD_3 jp NextRadioLine BuenasPassword3: ; b8f47 (2e:4f47) call BuenasPasswordCheckMidnight ld hl, UnknownText_0xb918c jp c, BuenasPasswordAfterMidnight - ld a, $42 + ld a, BUENAS_PASSWORD_4 jp NextRadioLine BuenasPassword4: ; b8f55 (2e:4f55) @@ -1731,7 +1737,7 @@ BuenasPassword4: ; b8f55 (2e:4f55) ld c, a call GetBuenasPassword ld hl, UnknownText_0xb9191 - ld a, $43 + ld a, BUENAS_PASSWORD_5 jp NextRadioLine GetBuenasPassword: ; b8f8f @@ -1859,19 +1865,19 @@ PasswordTable: ; b8ff9 BuenasPassword5: ; b909c (2e:509c) ld hl, UnknownText_0xb9196 - ld a, $44 + ld a, BUENAS_PASSWORD_6 jp NextRadioLine BuenasPassword6: ; b90a4 (2e:50a4) ld hl, UnknownText_0xb919b - ld a, $45 + ld a, BUENAS_PASSWORD_7 jp NextRadioLine BuenasPassword7: ; b90ac (2e:50ac) call BuenasPasswordCheckMidnight ld hl, UnknownText_0xb91a0 jr c, BuenasPasswordAfterMidnight - ld a, $4 + ld a, BUENAS_PASSWORD jp NextRadioLine BuenasPasswordAfterMidnight: ; b90b9 (2e:50b9) @@ -1879,69 +1885,69 @@ BuenasPasswordAfterMidnight: ; b90b9 (2e:50b9) ld hl, WeeklyFlags res 7, [hl] pop hl - ld a, $46 + ld a, BUENAS_PASSWORD_8 jp NextRadioLine BuenasPassword8: ; b90c5 (2e:50c5) ld hl, WeeklyFlags res 7, [hl] ld hl, UnknownText_0xb91d2 - ld a, $47 + ld a, BUENAS_PASSWORD_9 jp NextRadioLine BuenasPassword9: ; b90d2 (2e:50d2) ld hl, UnknownText_0xb91a5 - ld a, $48 + ld a, BUENAS_PASSWORD_10 jp NextRadioLine BuenasPassword10: ; b90da (2e:50da) ld hl, UnknownText_0xb91aa - ld a, $49 + ld a, BUENAS_PASSWORD_11 jp NextRadioLine BuenasPassword11: ; b90e2 (2e:50e2) ld hl, UnknownText_0xb91af - ld a, $4a + ld a, BUENAS_PASSWORD_12 jp NextRadioLine BuenasPassword12: ; b90ea (2e:50ea) ld hl, UnknownText_0xb91b4 - ld a, $4b + ld a, BUENAS_PASSWORD_13 jp NextRadioLine BuenasPassword13: ; b90f2 (2e:50f2) ld hl, UnknownText_0xb91b9 - ld a, $4c + ld a, BUENAS_PASSWORD_14 jp NextRadioLine BuenasPassword14: ; b90fa (2e:50fa) ld hl, UnknownText_0xb91be - ld a, $4d + ld a, BUENAS_PASSWORD_15 jp NextRadioLine BuenasPassword15: ; b9102 (2e:5102) ld hl, UnknownText_0xb91c3 - ld a, $4e + ld a, BUENAS_PASSWORD_16 jp NextRadioLine BuenasPassword16: ; b910a (2e:510a) ld hl, UnknownText_0xb91c8 - ld a, $4f + ld a, BUENAS_PASSWORD_17 jp NextRadioLine BuenasPassword17: ; b9112 (2e:5112) ld hl, UnknownText_0xb91cd - ld a, $50 + ld a, BUENAS_PASSWORD_18 jp NextRadioLine BuenasPassword18: ; b911a (2e:511a) ld hl, UnknownText_0xb91d2 - ld a, $51 + ld a, BUENAS_PASSWORD_19 jp NextRadioLine BuenasPassword19: ; b9122 (2e:5122) ld hl, UnknownText_0xb91d2 - ld a, $52 + ld a, BUENAS_PASSWORD_20 jp NextRadioLine BuenasPassword20: ; b912a (2e:512a) @@ -1958,7 +1964,7 @@ BuenasPassword20: ; b912a (2e:512a) xor a ld [wd005], a ld hl, UnknownText_0xb91d7 - ld a, $53 + ld a, BUENAS_PASSWORD_21 jp NextRadioLine BuenasPassword21: ; b9152 (2e:5152) @@ -1969,7 +1975,7 @@ BuenasPassword21: ; b9152 (2e:5152) call BuenasPasswordCheckMidnight jp nc, BuenasPassword1 ld hl, UnknownText_0xb91d7 - ld a, $53 + ld a, BUENAS_PASSWORD_21 jp NextRadioLine BuenasPasswordCheckMidnight: ; b9169 (2e:5169) @@ -2115,7 +2121,7 @@ endr ld e, [hl] inc hl ld d, [hl] - callab RadioMusicNone + callab RadioMusicRestartDE ret ; b920b (2e:520b) diff --git a/engine/radio2.asm b/engine/radio2.asm new file mode 100644 index 000000000..b843315d4 --- /dev/null +++ b/engine/radio2.asm @@ -0,0 +1,404 @@ +_UpdateRadioStation: ; 9163e (24:563e) + jr UpdateRadioStation + +Function91640: ; 91640 (24:5640) + push bc + call .TuningKnob + pop bc + ld a, [wRadioTuningKnob] + ld hl, $6 + add hl, bc + ld [hl], a + ret + +.TuningKnob: ; 9164e (24:564e) + ld hl, hJoyLast + ld a, [hl] + and D_DOWN + jr nz, .down + ld a, [hl] + and D_UP + jr nz, .up + ret + +.down + ld hl, wRadioTuningKnob + ld a, [hl] + and a + ret z +rept 2 + dec [hl] +endr + jr .update + +.up + ld hl, wRadioTuningKnob + ld a, [hl] + cp 80 + ret nc +rept 2 + inc [hl] +endr + +.update + +UpdateRadioStation: ; 9166f (24:566f) + ld hl, wRadioTuningKnob + ld d, [hl] + ld hl, RadioChannels +.loop + ld a, [hli] + cp -1 + jr z, .nostation + cp d + jr z, .foundstation +rept 2 + inc hl +endr + jr .loop + +.nostation + call NoRadioStation + ret + +.foundstation + ld a, [hli] + ld h, [hl] + ld l, a + ld de, .returnafterstation + push de + jp [hl] +.returnafterstation + ld a, [wc6d9] + and a + ret z + xor a + ld [hBGMapMode], a + hlcoord 2, 9 + call PlaceString + ld a, $1 + ld [hBGMapMode], a + ret +; 916a1 (24:56a1) + +Function916a1: ; 916a1 + ld [wc6d9], a + ld a, [hli] + ld [wc6da], a + ld a, [hli] + ld [wc6db], a + ret +; 916ad + + +RadioChannels: +; frequencies and the shows that play on them. +; frequency value given here = 4 × ingame_frequency − 2 + dbw 16, .PkmnTalkAndPokedexShow + dbw 28, .PokemonMusic + dbw 32, .LuckyChannel + dbw 40, .BuenasPassword + dbw 52, .RuinsOfAlphRadio + dbw 64, .PlacesAndPeople + dbw 72, .LetsAllSing + dbw 78, .PokeFluteRadio + dbw 80, .EvolutionRadio + db $ff + +.PkmnTalkAndPokedexShow +; Pokédex Show in the morning +; Oak's Pokémon Talk in the afternoon and evening + call .InJohto + jr nc, .NoSignal + ld a, [TimeOfDay] + and a + jp z, LoadStation_PokedexShow + jp LoadStation_OaksPokemonTalk + +.PokemonMusic + call .InJohto + jr nc, .NoSignal + jp LoadStation_PokemonMusic + +.LuckyChannel + call .InJohto + jr nc, .NoSignal + jp LoadStation_LuckyChannel + +.BuenasPassword + call .InJohto + jr nc, .NoSignal + jp LoadStation_BuenasPassword + +.RuinsOfAlphRadio + ld a, [wc6d8] + cp RUINS_OF_ALPH + jr nz, .NoSignal + jp LoadStation_UnownRadio + +.PlacesAndPeople + call .InJohto + jr c, .NoSignal + ld a, [wPokegearFlags] + bit 3, a + jr z, .NoSignal + jp LoadStation_PlacesAndPeople + +.LetsAllSing + call .InJohto + jr c, .NoSignal + ld a, [wPokegearFlags] + bit 3, a + jr z, .NoSignal + jp LoadStation_LetsAllSing + +.PokeFluteRadio + call .InJohto + jr c, .NoSignal + ld a, [wPokegearFlags] + bit 3, a + jr z, .NoSignal + jp LoadStation_PokeFluteRadio + +.EvolutionRadio +; This station airs in the Lake of Rage area when Rocket are still in Mahogany. + + ld a, [StatusFlags] + bit 4, a + jr z, .NoSignal + + ld a, [wc6d8] + cp MAHOGANY_TOWN + jr z, .ok + cp ROUTE_43 + jr z, .ok + cp LAKE_OF_RAGE + jr nz, .NoSignal +.ok + jp LoadStation_EvolutionRadio + +.NoSignal + call NoRadioStation + ret + +.InJohto +; if in Johto or on the S.S. Aqua, set carry +; otherwise clear carry + ld a, [wc6d8] + cp FAST_SHIP + jr z, .johto + cp KANTO_LANDMARK + jr c, .johto +.kanto + and a + ret +.johto + scf + ret + + + +LoadStation_OaksPokemonTalk: ; 91753 (24:5753) + xor a ; OAKS_POKEMON_TALK + ld [wd002], a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, OaksPkmnTalkName + ret + +LoadStation_PokedexShow: ; 91766 (24:5766) + ld a, POKEDEX_SHOW + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, PokedexShowName + ret + +LoadStation_PokemonMusic: ; 9177b (24:577b) + ld a, POKEMON_MUSIC + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, PokemonMusicName + ret + +LoadStation_LuckyChannel: ; 91790 (24:5790) + ld a, LUCKY_CHANNEL + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, LuckyChannelName + ret + +LoadStation_BuenasPassword: ; 917a5 (24:57a5) + ld a, BUENAS_PASSWORD + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, NotBuenasPasswordName + ld a, [StatusFlags2] + bit 0, a + ret z + ld de, BuenasPasswordName + ret +; 917c3 (24:57c3) + +BuenasPasswordName: db "BUENA'S PASSWORD@" +NotBuenasPasswordName: db "@" + +LoadStation_UnownRadio: ; 917d5 (24:57d5) + ld a, UNOWN_RADIO + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, UnknownStationName + ret + +LoadStation_PlacesAndPeople: ; 917ea (24:57ea) + ld a, PLACES_AND_PEOPLE + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, PlacesAndPeopleName + ret + +LoadStation_LetsAllSing: ; 917ff (24:57ff) + ld a, LETS_ALL_SING + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, LetsAllSingName + ret +; 91814 (24:5814) + +LoadStation_RocketRadio: ; 91814 + ld a, ROCKET_RADIO + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, LetsAllSingName + ret +; 91829 + +LoadStation_PokeFluteRadio: ; 91829 (24:5829) + ld a, POKE_FLUTE_RADIO + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, PokeFluteStationName + ret + +LoadStation_EvolutionRadio: ; 9183e (24:583e) + ld a, EVOLUTION_RADIO + ld [wd002], a + xor a + ld [wd005], a + ld a, BANK(PlayRadioShow) + ld hl, PlayRadioShow + call Radio_BackUpFarCallParams + ld de, UnknownStationName + ret +; 91853 (24:5853) + +LoadStation_Dummy: ; 91853 + ret + +RadioMusicRestartDE: ; 91854 (24:5854) + push de + ld a, e + ld [wc6dc], a + ld de, MUSIC_NONE + call PlayMusic + pop de + ld a, e + ld [wMapMusic], a + call PlayMusic + ret + +RadioMusicRestartPokemonChannel: ; 91868 (24:5868) + push de + ld a, $fe + ld [wc6dc], a + ld de, MUSIC_NONE + call PlayMusic + pop de + ld de, MUSIC_POKEMON_CHANNEL + call PlayMusic + ret + +Radio_BackUpFarCallParams: ; 9187c (24:587c) + ld [wc6d9], a + ld a, l + ld [wc6da], a + ld a, h + ld [wc6db], a + ret + +NoRadioStation: ; 91888 (24:5888) + call NoRadioMusic + call NoRadioName + xor a + ld [wc6d9], a + ld [wc6da], a + ld [wc6db], a + ld a, $1 + ld [hBGMapMode], a ; $ff00+$d4 + ret + +NoRadioMusic: ; 9189d (24:589d) + ld de, MUSIC_NONE + call PlayMusic + ld a, $ff + ld [wc6dc], a + ret + +NoRadioName: ; 918a9 (24:58a9) + xor a + ld [hBGMapMode], a ; $ff00+$d4 + hlcoord 1, 8 + ld bc, $312 + call ClearBox + hlcoord 0, 12 + ld bc, $412 + call TextBox + ret +; 918bf + +OaksPkmnTalkName: db "OAK's Talk@" +PokedexShowName: db "#DEX Show@" +PokemonMusicName: db "#MON Music@" +LuckyChannelName: db "Lucky Channel@" +UnknownStationName: db "?????@" +PlacesAndPeopleName: db "Places & People@" +LetsAllSingName: db "Let's All Sing!@" +PokeFluteStationName: db "# FLUTE@" +; 9191c diff --git a/home/text.asm b/home/text.asm index fdbafec22..1ddc72ea5 100644 --- a/home/text.asm +++ b/home/text.asm @@ -273,7 +273,7 @@ endm dict $24, PlacePOKE dict $25, NextChar dict2 $1f, " " - dict $5f, Char5F + dict "", PlaceDexEnd dict "", PlaceMoveTargetsName dict "", PlaceMoveUsersName dict "", PlaceEnemysName @@ -590,7 +590,7 @@ ContText:: ; 1345 ; 1356 -Char5F:: ; 1356 +PlaceDexEnd:: ; 1356 ; Legacy: ends a Pokédex entry (Red). ; Dex entries are now regular strings. ld [hl], "." diff --git a/hram.asm b/hram.asm index 92b8c53fe..6d87614f6 100644 --- a/hram.asm +++ b/hram.asm @@ -26,6 +26,7 @@ hJoypadSum EQU $ffa5 hJoyReleased EQU $ffa6 hJoyPressed EQU $ffa7 hJoyDown EQU $ffa8 +hJoyLast EQU $ffa9 hConnectionStripLength EQU $ffaf hConnectedMapWidth EQU $ffb0 diff --git a/macros/charmap.asm b/macros/charmap.asm index 48ef2cad3..bdee88a1b 100644 --- a/macros/charmap.asm +++ b/macros/charmap.asm @@ -301,3 +301,5 @@ charmap "", $5d charmap "", $5e charmap "<......>", $56 + charmap "", $00 + charmap "", $5f diff --git a/main.asm b/main.asm index 556ad5271..6b7700fef 100644 --- a/main.asm +++ b/main.asm @@ -9768,10 +9768,10 @@ MenuData2_0xe477: ; 0xe477 ; 0xe47f Strings_e47f: ; e47f - db "WITHDRAW ", $e1, $e2, "@" - db "DEPOSIT ", $e1, $e2, "@" + db "WITHDRAW @" + db "DEPOSIT @" db "CHANGE BOX@" - db "MOVE ", $e1, $e2, " W/O MAIL@" + db "MOVE W/O MAIL@" db "SEE YA!@" Jumptable_e4ba: ; e4ba (3:64ba) @@ -47515,22 +47515,22 @@ PartyMenuStrings: ; 0x504d2 ChooseAMonString: ; 0x504e4 db "Choose a #MON.@" UseOnWhichPKMNString: ; 0x504f3 - db "Use on which ", $e1, $e2, "?@" + db "Use on which ?@" WhichPKMNString: ; 0x50504 - db "Which ", $e1, $e2, "?@" + db "Which ?@" TeachWhichPKMNString: ; 0x5050e - db "Teach which ", $e1, $e2, "?@" + db "Teach which ?@" MoveToWhereString: ; 0x5051e db "Move to where?@" ChooseAFemalePKMNString: ; 0x5052d ; UNUSED - db "Choose a ♀", $e1, $e2, ".@" + db "Choose a ♀.@" ChooseAMalePKMNString: ; 0x5053b ; UNUSED - db "Choose a ♂", $e1, $e2, ".@" + db "Choose a ♂.@" ToWhichPKMNString: ; 0x50549 - db "To which ", $e1, $e2, "?@" + db "To which ?@" YouHaveNoPKMNString: ; 0x50556 - db "You have no ", $e1, $e2, "!@" + db "You have no !@" Function50566: ; 50566 @@ -66891,20 +66891,15 @@ Unknown_8e6a5: ; 8e6a5 Unknown_8e706: ; 8e706 - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $80, $01, Unknown_8e72a - dbbw $10, $37, Unknown_8e72a - dbbw $10, $11, Unknown_8e72a - dbbw $10, $39, Unknown_8e72a - dbbw $10, $24, Unknown_8e72a - dbbw $10, $21, Unknown_8e72a - -Unknown_8e72a: -; 8e72a - - + dbbw $80, $01, Function8e72a + dbbw $80, $01, Function8e72a + dbbw $80, $01, Function8e72a + dbbw $80, $01, Function8e72a + dbbw $10, $37, Function8e72a + dbbw $10, $11, Function8e72a + dbbw $10, $39, Function8e72a + dbbw $10, $24, Function8e72a + dbbw $10, $21, Function8e72a Function8e72a: ; 8e72a add $10 @@ -69886,7 +69881,7 @@ Function910f9: ; 910f9 (24:50f9) ld hl, $3 add hl, bc ld [hl], $8 - call Function9163e + call _UpdateRadioStation ld hl, wcf63 inc [hl] ret @@ -70541,410 +70536,7 @@ ClockTilemapRLE: ; 915db INCBIN "gfx/unknown/0915db.tilemap.rle" ; 9163e -Function9163e: ; 9163e (24:563e) - jr UpdateRadioStation - -Function91640: ; 91640 (24:5640) - push bc - call Function9164e - pop bc - ld a, [wd958] - ld hl, $6 - add hl, bc - ld [hl], a - ret - -Function9164e: ; 9164e (24:564e) - ld hl, $ffa9 - ld a, [hl] - and D_DOWN - jr nz, .down - ld a, [hl] - and D_UP - jr nz, .up - ret - -.down - ld hl, wd958 - ld a, [hl] - and a - ret z -rept 2 - dec [hl] -endr - jr .update - -.up - ld hl, wd958 - ld a, [hl] - cp 80 - ret nc -rept 2 - inc [hl] -endr - -.update - -UpdateRadioStation: ; 9166f (24:566f) - ld hl, wd958 - ld d, [hl] - ld hl, RadioChannels -.asm_91676 - ld a, [hli] - cp $ff - jr z, .asm_91682 - cp d - jr z, .asm_91686 -rept 2 - inc hl -endr - jr .asm_91676 - -.asm_91682 - call NoRadioStation - ret - -.asm_91686 - ld a, [hli] - ld h, [hl] - ld l, a - ld de, .asm_9168e - push de - jp [hl] -.asm_9168e - ld a, [wc6d9] - and a - ret z - xor a - ld [hBGMapMode], a - hlcoord 2, 9 - call PlaceString - ld a, $1 - ld [hBGMapMode], a - ret -; 916a1 (24:56a1) - -Function916a1: ; 916a1 - ld [wc6d9], a - ld a, [hli] - ld [wc6da], a - ld a, [hli] - ld [wc6db], a - ret -; 916ad - - -RadioChannels: -; frequencies and the shows that play on them. -; frequency value given here = 4 × ingame_frequency − 2 - dbw 16, .PkmnTalkAndPokedexShow - dbw 28, .PokemonMusic - dbw 32, .LuckyChannel - dbw 40, .BuenasPassword - dbw 52, .RuinsOfAlphRadio - dbw 64, .PlacesAndPeople - dbw 72, .LetsAllSing - dbw 78, .PokeFluteRadio - dbw 80, .EvolutionRadio - db $ff - -.PkmnTalkAndPokedexShow -; Pokédex Show in the morning -; Oak's Pokémon Talk in the afternoon and evening - call .InJohto - jr nc, .NoSignal - ld a, [TimeOfDay] - and a - jp z, Function91766 - jp Function91753 - -.PokemonMusic - call .InJohto - jr nc, .NoSignal - jp Function9177b - -.LuckyChannel - call .InJohto - jr nc, .NoSignal - jp Function91790 - -.BuenasPassword - call .InJohto - jr nc, .NoSignal - jp Function917a5 - -.RuinsOfAlphRadio - ld a, [wc6d8] - cp RUINS_OF_ALPH - jr nz, .NoSignal - jp Function917d5 - -.PlacesAndPeople - call .InJohto - jr c, .NoSignal - ld a, [wPokegearFlags] - bit 3, a - jr z, .NoSignal - jp Function917ea - -.LetsAllSing - call .InJohto - jr c, .NoSignal - ld a, [wPokegearFlags] - bit 3, a - jr z, .NoSignal - jp Function917ff - -.PokeFluteRadio - call .InJohto - jr c, .NoSignal - ld a, [wPokegearFlags] - bit 3, a - jr z, .NoSignal - jp Function91829 - -.EvolutionRadio -; This station airs in the Lake of Rage area when Rocket are still in Mahogany. - - ld a, [StatusFlags] - bit 4, a - jr z, .NoSignal - - ld a, [wc6d8] - cp MAHOGANY_TOWN - jr z, .ok - cp ROUTE_43 - jr z, .ok - cp LAKE_OF_RAGE - jr nz, .NoSignal -.ok - jp Function9183e - -.NoSignal - call NoRadioStation - ret - -.InJohto -; if in Johto or on the S.S. Aqua, set carry -; otherwise clear carry - ld a, [wc6d8] - cp FAST_SHIP - jr z, .johto - cp KANTO_LANDMARK - jr c, .johto -.kanto - and a - ret -.johto - scf - ret - - - -Function91753: ; 91753 (24:5753) - xor a ; OAKS_POKEMON_TALK - ld [wd002], a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, OaksPkmnTalkName - ret - -Function91766: ; 91766 (24:5766) - ld a, POKEDEX_SHOW - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, PokedexShowName - ret - -Function9177b: ; 9177b (24:577b) - ld a, POKEMON_MUSIC - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, PokemonMusicName - ret - -Function91790: ; 91790 (24:5790) - ld a, LUCKY_CHANNEL - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, LuckyChannelName - ret - -Function917a5: ; 917a5 (24:57a5) - ld a, BUENAS_PASSWORD - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, NotBuenasPasswordName - ld a, [StatusFlags2] - bit 0, a - ret z - ld de, BuenasPasswordName - ret -; 917c3 (24:57c3) - -BuenasPasswordName: db "BUENA'S PASSWORD@" -NotBuenasPasswordName: db "@" - -Function917d5: ; 917d5 (24:57d5) - ld a, UNOWN_RADIO - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, UnknownStationName - ret - -Function917ea: ; 917ea (24:57ea) - ld a, PLACES_AND_PEOPLE - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, PlacesAndPeopleName - ret - -Function917ff: ; 917ff (24:57ff) - ld a, LETS_ALL_SING - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, LetsAllSingName - ret -; 91814 (24:5814) - -Function91814: ; 91814 - ld a, ROCKET_RADIO - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, LetsAllSingName - ret -; 91829 - -Function91829: ; 91829 (24:5829) - ld a, POKE_FLUTE_RADIO - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, PokeFluteStationName - ret - -Function9183e: ; 9183e (24:583e) - ld a, EVOLUTION_RADIO - ld [wd002], a - xor a - ld [wd005], a - ld a, BANK(PlayRadioShow) - ld hl, PlayRadioShow - call Function9187c - ld de, UnknownStationName - ret -; 91853 (24:5853) - -Function91853: ; 91853 - ret - -RadioMusicNone: ; 91854 (24:5854) - push de - ld a, e - ld [wc6dc], a - ld de, MUSIC_NONE - call PlayMusic - pop de - ld a, e - ld [wMapMusic], a - call PlayMusic - ret - -Function91868: ; 91868 (24:5868) - push de - ld a, $fe - ld [wc6dc], a - ld de, MUSIC_NONE - call PlayMusic - pop de - ld de, MUSIC_POKEMON_CHANNEL - call PlayMusic - ret - -Function9187c: ; 9187c (24:587c) - ld [wc6d9], a - ld a, l - ld [wc6da], a - ld a, h - ld [wc6db], a - ret - -NoRadioStation: ; 91888 (24:5888) - call NoRadioMusic - call NoRadioName - xor a - ld [wc6d9], a - ld [wc6da], a - ld [wc6db], a - ld a, $1 - ld [hBGMapMode], a ; $ff00+$d4 - ret - -NoRadioMusic: ; 9189d (24:589d) - ld de, MUSIC_NONE - call PlayMusic - ld a, $ff - ld [wc6dc], a - ret - -NoRadioName: ; 918a9 (24:58a9) - xor a - ld [hBGMapMode], a ; $ff00+$d4 - hlcoord 1, 8 - ld bc, $312 - call ClearBox - hlcoord 0, 12 - ld bc, $412 - call TextBox - ret -; 918bf - -OaksPkmnTalkName: db "OAK's ", $e1, $e2, " Talk@" -PokedexShowName: db "#DEX Show@" -PokemonMusicName: db "#MON Music@" -LuckyChannelName: db "Lucky Channel@" -UnknownStationName: db "?????@" -PlacesAndPeopleName: db "Places & People@" -LetsAllSingName: db "Let's All Sing!@" -PokeFluteStationName: db "# FLUTE@" -; 9191c +INCLUDE "engine/radio2.asm" Function9191c: ; 9191c ld hl, Options @@ -71181,14 +70773,14 @@ endr .StationPointers: ; 91ab9 dw Function91acb - dw Function91753 - dw Function91766 - dw Function9177b - dw Function91790 - dw Function917d5 - dw Function917ea - dw Function917ff - dw Function91814 + dw LoadStation_OaksPokemonTalk + dw LoadStation_PokedexShow + dw LoadStation_PokemonMusic + dw LoadStation_LuckyChannel + dw LoadStation_UnownRadio + dw LoadStation_PlacesAndPeople + dw LoadStation_LetsAllSing + dw LoadStation_RocketRadio ; 91acb Function91acb: ; 91acb @@ -71198,11 +70790,11 @@ Function91acb: ; 91acb call UpdateTime ld a, [TimeOfDay] and a - jp z, Function91766 - jp Function91753 + jp z, LoadStation_PokedexShow + jp LoadStation_OaksPokemonTalk .kanto - jp Function917ea + jp LoadStation_PlacesAndPeople ; 91ae1 Function91ae1: ; 91ae1 @@ -74428,11 +74020,14 @@ SECTION "bank2E", ROMX, BANK[$2E] ReturnFromMapSetupScript:: ; b8000 xor a ld [hBGMapMode], a - callba Functionb800a + ; For some reson, GameFreak chose to use a callba here instead of just falling through. + ; No other function in the game references the function at 2E:400A, here labeled + ; ReturnFromMapSetupScript.inefficientcallba. + callba .inefficientcallba ; this is a waste of 6 ROM bytes and 2 stack bytes ret ; b800a -Functionb800a: ; b800a +.inefficientcallba: ; b800a ld a, [MapGroup] ld b, a ld a, [MapNumber] @@ -74447,7 +74042,7 @@ Functionb800a: ; b800a jr nz, .asm_b8029 .asm_b8024 - ld a, $ff + ld a, -1 ld [wc2d9], a .asm_b8029 @@ -79976,7 +79571,7 @@ Functione23e9: ; e23e9 (38:63e9) call ClearSprites call Functione2d30 call Functione2a8e - ld de, String_e34dd + ld de, PCString_ChooseaPKMN call Functione2a6e ld a, $5 ld [wcb2d], a @@ -80041,7 +79636,7 @@ Functione245d: ; e245d (38:645d) ld [CurPartySpecies], a ld a, $17 call Functione33d0 - ld de, String_e34ea + ld de, PCString_WhatsUp call Functione2a6e ld a, $1 ld [wcfa9], a @@ -80088,7 +79683,7 @@ BillsPCDepositFuncDeposit: ; e24a9 (38:64a9) ld [wcb2a], a ret .asm_e24c1 - ld de, String_e34ea + ld de, PCString_WhatsUp call Functione2a6e ret @@ -80110,7 +79705,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) jr c, BillsPCDepositFuncCancel ld a, [wcfa9] push af - ld de, String_e34f4 + ld de, PCString_ReleasePKMN call Functione2a6e call Function1d6e lb bc, 14, 11 @@ -80136,7 +79731,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) pop af ret .asm_e252c - ld de, String_e34ea + ld de, PCString_WhatsUp call Functione2a6e pop af ld [wcfa9], a @@ -80220,15 +79815,15 @@ Functione2583: ; e2583 (38:6583) Functione25c8: ; e25c8 (38:65c8) ld a, [wcf63] - ld hl, Jumptable_e25d2 + ld hl, .jumptable call Functione33df jp [hl] -Jumptable_e25d2: ; e25d2 (38:65d2) +.jumptable: ; e25d2 (38:65d2) dw Functione25dc dw Functione2612 dw Functione2655 - dw Functione2675 + dw BillsPC_Withdraw dw Functione2992 @@ -80240,7 +79835,7 @@ Functione25dc: ; e25dc (38:65dc) call ClearSprites call Functione2d30 call Functione2a8e - ld de, String_e34dd + ld de, PCString_ChooseaPKMN call Functione2a6e ld a, $5 ld [wcb2d], a @@ -80306,26 +79901,26 @@ Functione2655: ; e2655 (38:6655) ld [CurPartySpecies], a ld a, $17 call Functione33d0 - ld de, String_e34ea + ld de, PCString_WhatsUp call Functione2a6e ld a, $1 ld [wcfa9], a call Functione298d ret -Functione2675: ; e2675 (38:6675) - ld hl, BillsPCWithdrawMenuDataHeader +BillsPC_Withdraw: ; e2675 (38:6675) + ld hl, .MenuDataHeader call CopyMenuDataHeader ld a, [wcfa9] call Function1d4b call InterpretMenu2 - jp c, BillsPCWithdrawFuncCancel + jp c, .cancel ld a, [wcfa9] dec a and 3 ld e, a ld d, 0 - ld hl, BillsPCWithdrawJumptable + ld hl, .jumptable rept 2 add hl, de endr @@ -80334,30 +79929,30 @@ endr ld l, a jp [hl] -BillsPCWithdrawJumptable: ; e2699 (38:6699) #mark - dw BillsPCWithdrawFuncWithdraw ; Withdraw - dw BillsPCWithdrawFuncStats ; Stats - dw BillsPCWithdrawFuncRelease ; Release - dw BillsPCWithdrawFuncCancel ; Cancel +.jumptable: ; e2699 (38:6699) #mark + dw .withdraw ; Withdraw + dw .stats ; Stats + dw .release ; Release + dw .cancel ; Cancel -BillsPCWithdrawFuncWithdraw: ; e26a1 (38:66a1) +.withdraw: ; e26a1 (38:66a1) call Functione2f18 - jp c, BillsPCWithdrawFuncCancel - call Functione30fa - jr c, .asm_e26b9 + jp c, .cancel + call TryWithdrawPokemon + jr c, .FailedWithdraw ld a, $0 ld [wcf63], a xor a ld [wcb2b], a ld [wcb2a], a ret -.asm_e26b9 - ld de, String_e34ea +.FailedWithdraw + ld de, PCString_WhatsUp call Functione2a6e ret -BillsPCWithdrawFuncStats: ; e26c0 (38:66c0) +.stats: ; e26c0 (38:66c0) call Function1d6e call Functione2f7e call ExitMenu @@ -80368,12 +79963,12 @@ BillsPCWithdrawFuncStats: ; e26c0 (38:66c0) call Functione33d0 ret -BillsPCWithdrawFuncRelease: ; e26d8 (38:66d8) +.release: ; e26d8 (38:66d8) ld a, [wcfa9] push af call Functione2f5f - jr c, .asm_e2720 - ld de, String_e34f4 + jr c, .FailedRelease + ld de, PCString_ReleasePKMN call Functione2a6e call Function1d6e lb bc, 14, 11 @@ -80382,7 +79977,7 @@ BillsPCWithdrawFuncRelease: ; e26d8 (38:66d8) dec a call ExitMenu and a - jr nz, .asm_e2720 + jr nz, .FailedRelease ld a, [wcb2b] ld hl, wcb2a add [hl] @@ -80398,28 +79993,28 @@ BillsPCWithdrawFuncRelease: ; e26d8 (38:66d8) ld [wcb2a], a pop af ret -.asm_e2720 - ld de, String_e34ea +.FailedRelease + ld de, PCString_WhatsUp call Functione2a6e pop af ld [wcfa9], a ret -BillsPCWithdrawFuncCancel: ; e272b (38:672b) +.cancel: ; e272b (38:672b) ld a, $0 ld [wcf63], a ret ; e2731 (38:6731) -BillsPCWithdrawMenuDataHeader: ; 0xe2731 +.MenuDataHeader: ; 0xe2731 db $40 ; flags db 04, 09 ; start coords db 13, 19 ; end coords - dw BillsPCWithdrawMenuData + dw .MenuData db 1 ; default option ; 0xe2739 -BillsPCWithdrawMenuData: ; 0xe2739 +.MenuData: ; 0xe2739 db $80 ; flags db 4 ; items db "WITHDRAW@" @@ -80491,7 +80086,7 @@ Functione27ba: ; e27ba ld [hBGMapMode], a call ClearSprites call Functione2d30 - ld de, String_e34dd + ld de, PCString_ChooseaPKMN call Functione2a6e ld a, $5 ld [wcb2d], a @@ -80567,7 +80162,7 @@ Functione283d: ; e283d ld [CurPartySpecies], a ld a, $17 call Functione33d0 - ld de, String_e34ea + ld de, PCString_WhatsUp call Functione2a6e ld a, $1 ld [wcfa9], a @@ -80655,7 +80250,7 @@ Functione28df: ; e28df xor a ld [hBGMapMode], a call Functione2d30 - ld de, String_e3500 + ld de, PCString_MoveToWhere call Functione2a6e ld a, $5 ld [wcb2d], a @@ -80967,7 +80562,7 @@ Functione2a8e: ; e2a8e (38:6a8e) ; e2abd (38:6abd) String_e2abd: - db "PARTY ", $e1, $e2, "@" + db "PARTY @" ; e2ac6 PCMonInfo: ; e2ac6 (38:6ac6) @@ -81594,7 +81189,7 @@ Functione2ee5: ; e2ee5 ret .asm_e2f02 - ld de, String_e3521 + ld de, PCString_TheresNoRoom call Functione2a6e ld de, SFX_WRONG call WaitPlaySFX @@ -81608,31 +81203,31 @@ Functione2ee5: ; e2ee5 Functione2f18: ; e2f18 (38:6f18) ld a, [wcb2e] and a - jr nz, .asm_e2f3d + jr nz, .Okay ld a, [wcb2c] cp $3 - jr c, .asm_e2f49 + jr c, .ItsYourLastPokemon ld a, [wcb2b] ld hl, wcb2a add [hl] ld [CurPartyMon], a callba Functione538 - jr c, .asm_e2f44 + jr c, .AllOthersFainted ld a, [wcb32] and a - jr nz, .asm_e2f3f -.asm_e2f3d + jr nz, .HasMail +.Okay and a ret -.asm_e2f3f - ld de, String_e3544 - jr .asm_e2f4c -.asm_e2f44 - ld de, String_e3531 - jr .asm_e2f4c -.asm_e2f49 - ld de, String_e350f -.asm_e2f4c +.HasMail + ld de, PCString_RemoveMail + jr .NotOkay +.AllOthersFainted + ld de, PCString_NoMoreUsablePKMN + jr .NotOkay +.ItsYourLastPokemon + ld de, PCString_ItsYourLastPKMN +.NotOkay call Functione2a6e ld de, SFX_WRONG call WaitPlaySFX @@ -81649,7 +81244,7 @@ Functione2f5f: ; e2f5f (38:6f5f) and a ret .asm_e2f68 - ld de, String_e3597 + ld de, PCString_NoReleasingEGGS call Functione2a6e ld de, SFX_WRONG call WaitPlaySFX @@ -81799,7 +81394,7 @@ Functione307c: ; e307c (38:707c) call TextBox call WaitBGMap hlcoord 1, 16 - ld de, String_e3563 + ld de, PCString_Stored call PlaceString ld l, c ld h, b @@ -81812,7 +81407,7 @@ Functione307c: ; e307c (38:707c) and a ret .asm_e30e4 - ld de, String_e3575 + ld de, PCString_BoxFull call Functione2a6e ld de, SFX_WRONG call WaitPlaySFX @@ -81822,7 +81417,7 @@ Functione307c: ; e307c (38:707c) scf ret -Functione30fa: ; e30fa (38:70fa) +TryWithdrawPokemon: ; e30fa (38:70fa) ld a, [wcb2b] ld hl, wcb2a add [hl] @@ -81836,7 +81431,7 @@ Functione30fa: ; e30fa (38:70fa) xor a ld [wd10b], a predef Functiondb3f - jr c, .asm_e316a + jr c, .PartyFull ld a, $1 ld [wd10b], a callba Functione039 @@ -81853,7 +81448,7 @@ Functione30fa: ; e30fa (38:70fa) call TextBox call WaitBGMap hlcoord 1, 16 - ld de, String_e356b + ld de, PCString_Got call PlaceString ld l, c ld h, b @@ -81865,8 +81460,8 @@ Functione30fa: ; e30fa (38:70fa) call DelayFrames and a ret -.asm_e316a - ld de, String_e3586 +.PartyFull + ld de, PCString_PartyFull call Functione2a6e ld de, SFX_WRONG call WaitPlaySFX @@ -81900,7 +81495,7 @@ Functione3180: ; e3180 (38:7180) ld [wd265], a call GetPokemonName hlcoord 1, 16 - ld de, String_e3551 + ld de, PCString_ReleasedPKMN call PlaceString ld c, 80 call DelayFrames @@ -81908,7 +81503,7 @@ Functione3180: ; e3180 (38:7180) ld bc, $112 call TextBox hlcoord 1, 16 - ld de, String_e355e + ld de, PCString_Bye call PlaceString ld l, c ld h, b @@ -82234,22 +81829,22 @@ PCSelectLZ: INCBIN "gfx/pc.2bpp.lz" PCMailGFX: INCBIN "gfx/pc_mail.2bpp" ; e34dd -String_e34dd: db "Choose a ", $e1, $e2, ".@" -String_e34ea: db "What's up?@" -String_e34f4: db "Release ", $e1, $e2, "?@" -String_e3500: db "Move to where?@" -String_e350f: db "It's your last ", $e1, $e2, "!@" -String_e3521: db "There's no room!@" -String_e3531: db "No more usable ", $e1, $e2, "!@" -String_e3544: db "Remove MAIL.@" -String_e3551: db "Released ", $e1, $e2, ".@" -String_e355e: db "Bye,@" -String_e3563: db "Stored @" -String_e356b: db "Got @" -String_e3570: db "Non.@" -String_e3575: db "The BOX is full.@" -String_e3586: db "The party's full!@" -String_e3597: db "No releasing EGGS!@" +PCString_ChooseaPKMN: db "Choose a .@" +PCString_WhatsUp: db "What's up?@" +PCString_ReleasePKMN: db "Release ?@" +PCString_MoveToWhere: db "Move to where?@" +PCString_ItsYourLastPKMN: db "It's your last !@" +PCString_TheresNoRoom: db "There's no room!@" +PCString_NoMoreUsablePKMN: db "No more usable !@" +PCString_RemoveMail: db "Remove MAIL.@" +PCString_ReleasedPKMN: db "Released .@" +PCString_Bye: db "Bye,@" +PCString_Stored: db "Stored @" +PCString_Got: db "Got @" +PCString_Non: db "Non.@" +PCString_BoxFull: db "The BOX is full.@" +PCString_PartyFull: db "The party's full!@" +PCString_NoReleasingEGGS: db "No releasing EGGS!@" ; e35aa Functione35aa: ; e35aa (38:75aa) diff --git a/wram.asm b/wram.asm index 88343cd1a..4913ddbe1 100644 --- a/wram.asm +++ b/wram.asm @@ -2150,7 +2150,7 @@ PCItemsEnd:: ds 1 wPokegearFlags:: ds 1 -wd958:: ds 1 +wRadioTuningKnob:: ds 1 wd959:: ds 2 WhichRegisteredItem:: ; d95b ds 1