summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rwxr-xr-x.travis/webhook.sh2
-rw-r--r--INSTALL.md36
-rw-r--r--Makefile69
-rw-r--r--README.md17
-rw-r--r--audio.asm120
-rw-r--r--audio/alternate_tempo.asm8
-rw-r--r--audio/engine_1.asm333
-rw-r--r--audio/engine_2.asm1743
-rw-r--r--audio/engine_3.asm1571
-rw-r--r--audio/engine_4.asm191
-rw-r--r--audio/headers/musicheaders3.asm4
-rw-r--r--audio/headers/musicheaders4.asm11
-rw-r--r--audio/headers/sfxheaders4.asm212
-rw-r--r--audio/music/dungeon1.asm2
-rw-r--r--audio/music/meetjessiejames.asm308
-rw-r--r--audio/music/printer.asm316
-rw-r--r--audio/music/surfingpikachu.asm690
-rw-r--r--audio/music/yellowintro.asm484
-rw-r--r--audio/music/yellowunusedsong.asm326
-rw-r--r--audio/pikachu_cries.asm172
-rw-r--r--audio/pikachu_cries/pikachu_cry_1.wavbin0 -> 18668 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_10.wavbin0 -> 65580 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_11.wavbin0 -> 14636 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_12.wavbin0 -> 27692 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_13.wavbin0 -> 39980 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_14.wavbin0 -> 50412 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_15.wavbin0 -> 42028 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_16.wavbin0 -> 42220 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_17.wavbin0 -> 17196 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_18.wavbin0 -> 30828 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_19.wavbin0 -> 45484 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_2.wavbin0 -> 13868 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_20.wavbin0 -> 65580 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_21.wavbin0 -> 65548 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_22.wavbin0 -> 51500 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_23.wavbin0 -> 30444 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_24.wavbin0 -> 57708 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_25.wavbin0 -> 29164 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_26.wavbin0 -> 27884 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_27.wavbin0 -> 23276 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_28.wavbin0 -> 37484 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_29.wavbin0 -> 24940 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_3.wavbin0 -> 20652 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_30.wavbin0 -> 9644 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_31.wavbin0 -> 15404 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_32.wavbin0 -> 11372 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_33.wavbin0 -> 26028 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_34.wavbin0 -> 43116 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_35.wavbin0 -> 37228 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_36.wavbin0 -> 57132 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_37.wavbin0 -> 28652 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_38.wavbin0 -> 25452 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_39.wavbin0 -> 35948 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_4.wavbin0 -> 32748 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_40.wavbin0 -> 30892 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_41.wavbin0 -> 49388 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_42.wavbin0 -> 44076 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_5.wavbin0 -> 33324 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_6.wavbin0 -> 37036 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_7.wavbin0 -> 28012 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_8.wavbin0 -> 34412 bytes
-rw-r--r--audio/pikachu_cries/pikachu_cry_9.wavbin0 -> 27180 bytes
-rw-r--r--audio/play_battle_music.asm4
-rw-r--r--audio/pokedex_rating_sfx.asm4
-rw-r--r--audio/sfx/battle_27.asm8
-rw-r--r--audio/sfx/battle_36.asm6
-rw-r--r--audio/sfx/cry00_4.asm21
-rw-r--r--audio/sfx/cry01_4.asm24
-rw-r--r--audio/sfx/cry02_4.asm17
-rw-r--r--audio/sfx/cry03_4.asm30
-rw-r--r--audio/sfx/cry04_4.asm32
-rw-r--r--audio/sfx/cry05_4.asm19
-rw-r--r--audio/sfx/cry06_4.asm22
-rw-r--r--audio/sfx/cry07_4.asm21
-rw-r--r--audio/sfx/cry08_4.asm23
-rw-r--r--audio/sfx/cry09_4.asm35
-rw-r--r--audio/sfx/cry0a_4.asm35
-rw-r--r--audio/sfx/cry0b_4.asm37
-rw-r--r--audio/sfx/cry0c_4.asm29
-rw-r--r--audio/sfx/cry0d_4.asm40
-rw-r--r--audio/sfx/cry0e_4.asm23
-rw-r--r--audio/sfx/cry0f_4.asm29
-rw-r--r--audio/sfx/cry10_4.asm31
-rw-r--r--audio/sfx/cry11_4.asm34
-rw-r--r--audio/sfx/cry12_4.asm24
-rw-r--r--audio/sfx/cry13_4.asm30
-rw-r--r--audio/sfx/cry14_4.asm21
-rw-r--r--audio/sfx/cry15_4.asm30
-rw-r--r--audio/sfx/cry16_4.asm21
-rw-r--r--audio/sfx/cry17_4.asm24
-rw-r--r--audio/sfx/cry18_4.asm34
-rw-r--r--audio/sfx/cry19_4.asm18
-rw-r--r--audio/sfx/cry1a_4.asm30
-rw-r--r--audio/sfx/cry1b_4.asm26
-rw-r--r--audio/sfx/cry1c_4.asm31
-rw-r--r--audio/sfx/cry1d_4.asm29
-rw-r--r--audio/sfx/cry1e_4.asm38
-rw-r--r--audio/sfx/cry1f_4.asm24
-rw-r--r--audio/sfx/cry20_4.asm24
-rw-r--r--audio/sfx/cry21_4.asm27
-rw-r--r--audio/sfx/cry22_4.asm24
-rw-r--r--audio/sfx/cry23_4.asm25
-rw-r--r--audio/sfx/cry24_4.asm33
-rw-r--r--audio/sfx/cry25_4.asm26
-rw-r--r--audio/sfx/get_item1_4.asm47
-rw-r--r--audio/sfx/get_item1_4_2.asm47
-rw-r--r--audio/sfx/get_item2_4.asm69
-rw-r--r--audio/sfx/get_item2_4_2.asm69
-rw-r--r--audio/sfx/heal_ailment_4.asm9
-rw-r--r--audio/sfx/heal_hp_4.asm7
-rw-r--r--audio/sfx/noise_instrument01_4.asm3
-rw-r--r--audio/sfx/noise_instrument02_4.asm3
-rw-r--r--audio/sfx/noise_instrument03_4.asm3
-rw-r--r--audio/sfx/noise_instrument04_4.asm3
-rw-r--r--audio/sfx/noise_instrument05_4.asm8
-rw-r--r--audio/sfx/noise_instrument06_4.asm3
-rw-r--r--audio/sfx/noise_instrument07_4.asm4
-rw-r--r--audio/sfx/noise_instrument08_4.asm3
-rw-r--r--audio/sfx/noise_instrument09_4.asm3
-rw-r--r--audio/sfx/noise_instrument10_4.asm3
-rw-r--r--audio/sfx/noise_instrument11_4.asm3
-rw-r--r--audio/sfx/noise_instrument12_4.asm3
-rw-r--r--audio/sfx/noise_instrument13_4.asm3
-rw-r--r--audio/sfx/noise_instrument14_4.asm3
-rw-r--r--audio/sfx/noise_instrument15_4.asm4
-rw-r--r--audio/sfx/noise_instrument16_4.asm4
-rw-r--r--audio/sfx/noise_instrument17_4.asm3
-rw-r--r--audio/sfx/noise_instrument18_4.asm3
-rw-r--r--audio/sfx/noise_instrument19_4.asm3
-rw-r--r--audio/sfx/press_ab_4.asm7
-rw-r--r--audio/sfx/save_3.asm17
-rw-r--r--audio/sfx/shooting_star.asm2
-rw-r--r--audio/sfx/start_menu_4.asm4
-rw-r--r--audio/sfx/surfing_crash.asm5
-rw-r--r--audio/sfx/surfing_flip.asm8
-rw-r--r--audio/sfx/surfing_jump.asm9
-rw-r--r--audio/sfx/surfing_land.asm5
-rw-r--r--audio/sfx/swap_2.asm11
-rw-r--r--audio/sfx/tink_4.asm8
-rw-r--r--audio/sfx/unknown_802cc.asm5
-rw-r--r--audio/sfx/unused_cry_4.asm32
-rw-r--r--audio/wave_instruments.asm1
-rw-r--r--constants.asm2
-rw-r--r--constants/battle_constants.asm2
-rw-r--r--constants/credits_constants.asm150
-rw-r--r--constants/event_constants.asm37
-rw-r--r--constants/gfx_constants.asm5
-rw-r--r--constants/hide_show_constants.asm446
-rw-r--r--constants/icon_constants.asm1
-rw-r--r--constants/item_constants.asm3
-rw-r--r--constants/map_constants.asm3
-rw-r--r--constants/move_effect_constants.asm2
-rw-r--r--constants/music_constants.asm22
-rw-r--r--constants/oam_constants.asm1
-rw-r--r--constants/palette_constants.asm5
-rw-r--r--constants/pikachu_emotion_constants.asm229
-rw-r--r--constants/pokemon_constants.asm11
-rw-r--r--constants/script_constants.asm5
-rw-r--r--constants/sprite_anim_constants.asm17
-rw-r--r--constants/sprite_constants.asm40
-rw-r--r--constants/text_constants.asm1
-rw-r--r--constants/tileset_constants.asm1
-rw-r--r--data/battle_anims/special_effects.asm2
-rw-r--r--data/cgb/bg_map_attributes.asm506
-rw-r--r--data/credits/credits_mons.asm4
-rw-r--r--data/credits/credits_order.asm61
-rw-r--r--data/credits/credits_text.asm343
-rw-r--r--data/events/bench_guys.asm27
-rw-r--r--data/events/hidden_item_coords.asm73
-rw-r--r--data/events/hidden_objects.asm798
-rw-r--r--data/events/prize_mon_levels.asm23
-rw-r--r--data/events/prizes.asm41
-rw-r--r--data/events/trades.asm20
-rw-r--r--data/icon_pointers.asm2
-rw-r--r--data/items/marts.asm6
-rw-r--r--data/maps/bit_5_maps.asm30
-rw-r--r--data/maps/headers/CeruleanMelaniesHouse.asm3
-rw-r--r--data/maps/headers/CeruleanTradeHouse.asm3
-rw-r--r--data/maps/headers/SummerBeachHouse.asm3
-rw-r--r--data/maps/hide_show_data.asm38
-rw-r--r--data/maps/map_header_banks.asm3
-rw-r--r--data/maps/map_header_pointers.asm3
-rw-r--r--data/maps/objects/BluesHouse.asm2
-rw-r--r--data/maps/objects/CeladonPokecenter.asm3
-rw-r--r--data/maps/objects/CeruleanCave1F.asm7
-rw-r--r--data/maps/objects/CeruleanCave2F.asm7
-rw-r--r--data/maps/objects/CeruleanCaveB1F.asm6
-rw-r--r--data/maps/objects/CeruleanCity.asm10
-rw-r--r--data/maps/objects/CeruleanMelaniesHouse.asm16
-rw-r--r--data/maps/objects/CeruleanPokecenter.asm3
-rw-r--r--data/maps/objects/CeruleanTradeHouse.asm14
-rw-r--r--data/maps/objects/CinnabarGym.asm2
-rw-r--r--data/maps/objects/CinnabarPokecenter.asm1
-rw-r--r--data/maps/objects/CopycatsHouse1F.asm2
-rw-r--r--data/maps/objects/FuchsiaCity.asm2
-rw-r--r--data/maps/objects/FuchsiaGym.asm2
-rw-r--r--data/maps/objects/FuchsiaPokecenter.asm3
-rw-r--r--data/maps/objects/GameCorner.asm4
-rw-r--r--data/maps/objects/IndigoPlateauLobby.asm1
-rw-r--r--data/maps/objects/LavenderPokecenter.asm3
-rw-r--r--data/maps/objects/MtMoonB2F.asm13
-rw-r--r--data/maps/objects/MtMoonPokecenter.asm1
-rw-r--r--data/maps/objects/OaksLab.asm18
-rw-r--r--data/maps/objects/PalletTown.asm2
-rw-r--r--data/maps/objects/PewterPokecenter.asm4
-rw-r--r--data/maps/objects/PokemonFanClub.asm4
-rw-r--r--data/maps/objects/PokemonTower7F.asm7
-rw-r--r--data/maps/objects/RedsHouse2F.asm6
-rw-r--r--data/maps/objects/RockTunnelPokecenter.asm3
-rw-r--r--data/maps/objects/RocketHideoutB4F.asm4
-rw-r--r--data/maps/objects/Route11.asm4
-rw-r--r--data/maps/objects/Route12.asm2
-rw-r--r--data/maps/objects/Route15.asm4
-rw-r--r--data/maps/objects/Route16.asm8
-rw-r--r--data/maps/objects/Route18.asm4
-rw-r--r--data/maps/objects/Route18Gate2F.asm2
-rw-r--r--data/maps/objects/Route19.asm9
-rw-r--r--data/maps/objects/Route2.asm1
-rw-r--r--data/maps/objects/Route22Gate.asm2
-rw-r--r--data/maps/objects/Route24.asm1
-rw-r--r--data/maps/objects/Route5.asm2
-rw-r--r--data/maps/objects/Route6.asm4
-rw-r--r--data/maps/objects/Route7.asm4
-rw-r--r--data/maps/objects/Route7Gate.asm2
-rw-r--r--data/maps/objects/Route8.asm4
-rw-r--r--data/maps/objects/Route8Gate.asm4
-rw-r--r--data/maps/objects/Route9.asm2
-rw-r--r--data/maps/objects/SSAnne1FRooms.asm2
-rw-r--r--data/maps/objects/SaffronCity.asm1
-rw-r--r--data/maps/objects/SaffronGym.asm2
-rw-r--r--data/maps/objects/SaffronPokecenter.asm1
-rw-r--r--data/maps/objects/SeafoamIslands1F.asm4
-rw-r--r--data/maps/objects/SilphCo11F.asm3
-rw-r--r--data/maps/objects/SummerBeachHouse.asm18
-rw-r--r--data/maps/objects/VermilionCity.asm17
-rw-r--r--data/maps/objects/VermilionPokecenter.asm1
-rw-r--r--data/maps/objects/VermilionTradeHouse.asm2
-rw-r--r--data/maps/objects/ViridianCity.asm13
-rw-r--r--data/maps/objects/ViridianForest.asm24
-rw-r--r--data/maps/objects/ViridianForestSouthGate.asm2
-rw-r--r--data/maps/objects/ViridianPokecenter.asm3
-rw-r--r--data/maps/objects/ViridianSchoolHouse.asm1
-rw-r--r--data/maps/songs.asm3
-rw-r--r--data/maps/sprite_sets.asm26
-rw-r--r--data/maps/town_map_entries.asm1
-rw-r--r--data/moves/animations.asm5
-rw-r--r--data/moves/grammar.asm2
-rw-r--r--data/moves/tmhm_moves.asm2
-rw-r--r--data/pikachu/pikachu_emotions.asm266
-rw-r--r--data/pikachu/pikachu_pic_animation.asm403
-rw-r--r--data/pikachu/pikachu_pic_objects.asm308
-rw-r--r--data/pikachu/pikachu_pic_tilemaps.asm254
-rw-r--r--data/player_names.asm20
-rw-r--r--data/player_names_list.asm18
-rw-r--r--data/pokemon/base_stats.asm3
-rw-r--r--data/pokemon/base_stats/alakazam.asm2
-rw-r--r--data/pokemon/base_stats/butterfree.asm2
-rw-r--r--data/pokemon/base_stats/chansey.asm2
-rw-r--r--data/pokemon/base_stats/charizard.asm2
-rw-r--r--data/pokemon/base_stats/cubone.asm2
-rw-r--r--data/pokemon/base_stats/diglett.asm2
-rw-r--r--data/pokemon/base_stats/dragonair.asm2
-rw-r--r--data/pokemon/base_stats/dragonite.asm2
-rw-r--r--data/pokemon/base_stats/dugtrio.asm3
-rw-r--r--data/pokemon/base_stats/eevee.asm2
-rw-r--r--data/pokemon/base_stats/flareon.asm2
-rw-r--r--data/pokemon/base_stats/gyarados.asm2
-rw-r--r--data/pokemon/base_stats/jolteon.asm2
-rw-r--r--data/pokemon/base_stats/kabutops.asm2
-rw-r--r--data/pokemon/base_stats/kadabra.asm2
-rw-r--r--data/pokemon/base_stats/marowak.asm2
-rw-r--r--data/pokemon/base_stats/mew.asm5
-rw-r--r--data/pokemon/base_stats/mewtwo.asm11
-rw-r--r--data/pokemon/base_stats/primeape.asm2
-rw-r--r--data/pokemon/base_stats/tangela.asm2
-rw-r--r--data/pokemon/base_stats/vaporeon.asm2
-rw-r--r--data/pokemon/base_stats/venomoth.asm4
-rw-r--r--data/pokemon/base_stats/venonat.asm2
-rw-r--r--data/pokemon/dex_entries.asm1426
-rw-r--r--data/pokemon/dex_text.asm2113
-rw-r--r--data/pokemon/evos_moves.asm157
-rw-r--r--data/pokemon/menu_icons.asm4
-rw-r--r--data/pokemon/mew.asm15
-rw-r--r--data/pokemon/title_mons.asm38
-rw-r--r--data/pokemon/unknown_list.asm36
-rw-r--r--data/sgb/sgb_border.asm137
-rw-r--r--data/sgb/sgb_packets.asm115
-rw-r--r--data/sgb/sgb_palettes.asm134
-rw-r--r--data/sprite_anims/intro_frames.asm70
-rw-r--r--data/sprite_anims/intro_oam.asm165
-rw-r--r--data/sprite_anims/surfing_pikachu_frames.asm200
-rw-r--r--data/sprite_anims/surfing_pikachu_oam.asm182
-rw-r--r--data/sprites/facings.asm175
-rw-r--r--data/sprites/sprites.asm16
-rw-r--r--data/text/text_1.asm5
-rw-r--r--data/text/text_2.asm588
-rw-r--r--data/text/text_3.asm721
-rw-r--r--data/text/text_4.asm229
-rw-r--r--data/text/text_5.asm313
-rw-r--r--data/text/text_6.asm237
-rw-r--r--data/text/text_7.asm306
-rw-r--r--data/text/text_8.asm118
-rw-r--r--data/text/text_9.asm442
-rw-r--r--data/text_predef_pointers.asm112
-rw-r--r--data/tilesets/collision_tile_ids.asm3
-rw-r--r--data/tilesets/door_tile_ids.asm4
-rw-r--r--data/tilesets/tileset_headers.asm1
-rw-r--r--data/tilesets/warp_tile_ids.asm4
-rw-r--r--data/trainers/move_choices.asm8
-rw-r--r--data/trainers/parties.asm123
-rw-r--r--data/trainers/special_moves.asm183
-rw-r--r--data/wild/grass_water.asm8
-rw-r--r--data/wild/maps/CeruleanCave1F.asm23
-rw-r--r--data/wild/maps/CeruleanCave2F.asm18
-rw-r--r--data/wild/maps/CeruleanCaveB1F.asm23
-rw-r--r--data/wild/maps/MtMoon1F.asm8
-rw-r--r--data/wild/maps/MtMoonB1F.asm12
-rw-r--r--data/wild/maps/MtMoonB2F.asm14
-rw-r--r--data/wild/maps/PokemonMansion1F.asm32
-rw-r--r--data/wild/maps/PokemonMansion2F.asm34
-rw-r--r--data/wild/maps/PokemonMansion3F.asm30
-rw-r--r--data/wild/maps/PokemonMansionB1F.asm32
-rw-r--r--data/wild/maps/PokemonTower3F.asm6
-rw-r--r--data/wild/maps/PokemonTower4F.asm6
-rw-r--r--data/wild/maps/PokemonTower5F.asm16
-rw-r--r--data/wild/maps/PokemonTower6F.asm12
-rw-r--r--data/wild/maps/PokemonTower7F.asm18
-rw-r--r--data/wild/maps/PowerPlant.asm26
-rw-r--r--data/wild/maps/RockTunnel1F.asm16
-rw-r--r--data/wild/maps/RockTunnelB1F.asm18
-rw-r--r--data/wild/maps/Route1.asm10
-rw-r--r--data/wild/maps/Route10.asm31
-rw-r--r--data/wild/maps/Route11.asm29
-rw-r--r--data/wild/maps/Route12.asm46
-rw-r--r--data/wild/maps/Route13.asm48
-rw-r--r--data/wild/maps/Route14.asm26
-rw-r--r--data/wild/maps/Route15.asm26
-rw-r--r--data/wild/maps/Route16.asm14
-rw-r--r--data/wild/maps/Route17.asm16
-rw-r--r--data/wild/maps/Route18.asm14
-rw-r--r--data/wild/maps/Route19.asm (renamed from data/wild/maps/SeaRoutes.asm)2
-rw-r--r--data/wild/maps/Route2.asm21
-rw-r--r--data/wild/maps/Route20.asm16
-rw-r--r--data/wild/maps/Route21.asm20
-rw-r--r--data/wild/maps/Route22.asm27
-rw-r--r--data/wild/maps/Route23.asm30
-rw-r--r--data/wild/maps/Route24.asm25
-rw-r--r--data/wild/maps/Route25.asm28
-rw-r--r--data/wild/maps/Route3.asm18
-rw-r--r--data/wild/maps/Route4.asm23
-rw-r--r--data/wild/maps/Route5.asm30
-rw-r--r--data/wild/maps/Route6.asm42
-rw-r--r--data/wild/maps/Route7.asm31
-rw-r--r--data/wild/maps/Route8.asm31
-rw-r--r--data/wild/maps/Route9.asm29
-rw-r--r--data/wild/maps/SafariZoneCenter.asm31
-rw-r--r--data/wild/maps/SafariZoneEast.asm34
-rw-r--r--data/wild/maps/SafariZoneNorth.asm31
-rw-r--r--data/wild/maps/SafariZoneWest.asm29
-rw-r--r--data/wild/maps/SeafoamIslands1F.asm31
-rw-r--r--data/wild/maps/SeafoamIslandsB1F.asm34
-rw-r--r--data/wild/maps/SeafoamIslandsB2F.asm33
-rw-r--r--data/wild/maps/SeafoamIslandsB3F.asm41
-rw-r--r--data/wild/maps/SeafoamIslandsB4F.asm45
-rw-r--r--data/wild/maps/VictoryRoad1F.asm16
-rw-r--r--data/wild/maps/VictoryRoad2F.asm20
-rw-r--r--data/wild/maps/VictoryRoad3F.asm16
-rw-r--r--data/wild/maps/ViridianForest.asm26
-rw-r--r--data/wild/super_rod.asm132
-rw-r--r--docs/bugs_and_glitches.md63
-rw-r--r--engine/battle/animations.asm252
-rw-r--r--engine/battle/battle_transitions.asm4
-rw-r--r--engine/battle/common_text.asm16
-rw-r--r--engine/battle/core.asm549
-rw-r--r--engine/battle/draw_hud_pokeball_gfx.asm10
-rw-r--r--engine/battle/effects.asm59
-rw-r--r--engine/battle/end_of_battle.asm4
-rw-r--r--engine/battle/experience.asm22
-rw-r--r--engine/battle/ghost_marowak_anim.asm5
-rw-r--r--engine/battle/init_battle.asm283
-rw-r--r--engine/battle/link_battle_versus_text.asm3
-rw-r--r--engine/battle/misc.asm19
-rw-r--r--engine/battle/move_effects/transform.asm9
-rw-r--r--engine/battle/pikachu_entrance_anim.asm47
-rw-r--r--engine/battle/read_trainer_party.asm101
-rw-r--r--engine/battle/scale_sprites.asm7
-rw-r--r--engine/battle/trainer_ai.asm27
-rw-r--r--engine/battle/wild_encounters.asm7
-rw-r--r--engine/debug/debug_menu.asm1581
-rw-r--r--engine/debug/debug_party.asm130
-rw-r--r--engine/events/black_out.asm2
-rw-r--r--engine/events/card_key.asm8
-rw-r--r--engine/events/diploma.asm103
-rw-r--r--engine/events/diploma2.asm171
-rw-r--r--engine/events/elevator.asm6
-rw-r--r--engine/events/evolve_trade.asm44
-rw-r--r--engine/events/give_pokemon.asm5
-rw-r--r--engine/events/hidden_items.asm17
-rw-r--r--engine/events/hidden_objects/bills_house_pc.asm7
-rw-r--r--engine/events/hidden_objects/cinnabar_gym_quiz.asm56
-rw-r--r--engine/events/hidden_objects/fanclub_pictures.asm23
-rw-r--r--engine/events/hidden_objects/museum_fossils.asm29
-rw-r--r--engine/events/hidden_objects/museum_fossils2.asm28
-rw-r--r--engine/events/hidden_objects/oaks_lab_email.asm3
-rw-r--r--engine/events/hidden_objects/route_15_binoculars.asm5
-rw-r--r--engine/events/hidden_objects/safari_game.asm3
-rw-r--r--engine/events/hidden_objects/school_blackboard.asm3
-rw-r--r--engine/events/hidden_objects/vermilion_gym_trash.asm77
-rw-r--r--engine/events/hidden_objects/vermilion_gym_trash2.asm108
-rw-r--r--engine/events/in_game_trades.asm58
-rw-r--r--engine/events/pikachu_happiness.asm118
-rw-r--r--engine/events/poison.asm41
-rw-r--r--engine/events/pokecenter.asm101
-rw-r--r--engine/events/pokecenter_chansey.asm11
-rw-r--r--engine/events/pokedex_rating.asm102
-rw-r--r--engine/events/prize_menu.asm9
-rw-r--r--engine/events/try_pikachu_movement.asm27
-rw-r--r--engine/events/vending_machine.asm3
-rw-r--r--engine/gfx/animated_objects.asm394
-rw-r--r--engine/gfx/bg_map_attributes.asm217
-rw-r--r--engine/gfx/hp_bar.asm6
-rw-r--r--engine/gfx/mon_icons.asm20
-rw-r--r--engine/gfx/palettes.asm561
-rw-r--r--engine/gfx/screen_effects.asm10
-rw-r--r--engine/gfx/sprite_oam.asm163
-rw-r--r--engine/items/inventory.asm5
-rw-r--r--engine/items/item_effects.asm516
-rw-r--r--engine/items/super_rod.asm41
-rw-r--r--engine/items/tms.asm6
-rw-r--r--engine/items/town_map.asm23
-rw-r--r--engine/joypad.asm36
-rw-r--r--engine/link/cable_club.asm51
-rw-r--r--engine/link/cable_club_npc.asm59
-rw-r--r--engine/link/print_waiting_text.asm3
-rw-r--r--engine/menus/display_text_id_init.asm9
-rw-r--r--engine/menus/draw_start_menu.asm8
-rw-r--r--engine/menus/league_pc.asm5
-rw-r--r--engine/menus/link_menu.asm910
-rw-r--r--engine/menus/main_menu.asm451
-rw-r--r--engine/menus/naming_screen.asm30
-rw-r--r--engine/menus/options.asm443
-rw-r--r--engine/menus/party_menu.asm14
-rw-r--r--engine/menus/players_pc.asm7
-rw-r--r--engine/menus/pokedex.asm354
-rw-r--r--engine/menus/save.asm162
-rw-r--r--engine/menus/start_sub_menus.asm38
-rw-r--r--engine/menus/text_box.asm36
-rw-r--r--engine/menus/unused_input.asm129
-rw-r--r--engine/minigame/surfing_pikachu.asm2863
-rw-r--r--engine/movie/credits.asm282
-rw-r--r--engine/movie/evolution.asm8
-rw-r--r--engine/movie/hall_of_fame.asm37
-rw-r--r--engine/movie/intro.asm355
-rw-r--r--engine/movie/intro_yellow.asm1085
-rw-r--r--engine/movie/oak_speech/clear_save.asm4
-rw-r--r--engine/movie/oak_speech/init_player_data.asm5
-rw-r--r--engine/movie/oak_speech/oak_speech.asm45
-rw-r--r--engine/movie/oak_speech/oak_speech2.asm6
-rw-r--r--engine/movie/splash.asm52
-rw-r--r--engine/movie/title.asm459
-rw-r--r--engine/movie/title_rb.asm (renamed from engine/movie/title2.asm)10
-rw-r--r--engine/movie/title_yellow.asm109
-rw-r--r--engine/movie/trade.asm28
-rw-r--r--engine/overworld/advance_player_sprite.asm244
-rw-r--r--engine/overworld/auto_movement.asm52
-rw-r--r--engine/overworld/cut.asm5
-rw-r--r--engine/overworld/cut2.asm2
-rw-r--r--engine/overworld/dungeon_warps.asm15
-rw-r--r--engine/overworld/dust_smoke.asm2
-rw-r--r--engine/overworld/elevator.asm6
-rw-r--r--engine/overworld/emotion_bubbles.asm24
-rw-r--r--engine/overworld/healing_machine.asm25
-rw-r--r--engine/overworld/hidden_objects.asm34
-rw-r--r--engine/overworld/ledges.asm16
-rw-r--r--engine/overworld/map_sprites.asm596
-rw-r--r--engine/overworld/missable_objects.asm11
-rw-r--r--engine/overworld/movement.asm385
-rw-r--r--engine/overworld/npc_movement_2.asm24
-rw-r--r--engine/overworld/pathfinding.asm8
-rw-r--r--engine/overworld/player_animations.asm26
-rw-r--r--engine/overworld/player_state.asm29
-rw-r--r--engine/overworld/push_boulder.asm2
-rw-r--r--engine/overworld/specific_script_flags.asm25
-rw-r--r--engine/overworld/sprite_collisions.asm46
-rw-r--r--engine/overworld/tilesets.asm21
-rw-r--r--engine/overworld/turn_sprite.asm25
-rw-r--r--engine/overworld/unused_load_missable_object_data.asm46
-rw-r--r--engine/pikachu/pikachu_emotions.asm477
-rw-r--r--engine/pikachu/pikachu_follow.asm1578
-rw-r--r--engine/pikachu/pikachu_movement.asm1048
-rw-r--r--engine/pikachu/pikachu_pcm.asm154
-rw-r--r--engine/pikachu/pikachu_pic_animation.asm852
-rw-r--r--engine/pikachu/pikachu_status.asm258
-rw-r--r--engine/pikachu/respawn_overworld_pikachu.asm6
-rw-r--r--engine/pokemon/add_mon.asm6
-rw-r--r--engine/pokemon/bills_pc.asm82
-rw-r--r--engine/pokemon/evos_moves.asm186
-rw-r--r--engine/pokemon/learn_move.asm30
-rw-r--r--engine/pokemon/load_mon_data.asm21
-rw-r--r--engine/pokemon/status_screen.asm26
-rw-r--r--engine/printer/printer.asm986
-rw-r--r--engine/printer/printer2.asm973
-rw-r--r--engine/printer/serial.asm632
-rw-r--r--engine/slots/slot_machine.asm21
-rw-r--r--garbage/bank20.binbin0 -> 3399 bytes
-rw-r--r--garbage/bank30.binbin0 -> 16384 bytes
-rw-r--r--gfx/battle/prof.oakb.pngbin0 -> 224 bytes
-rw-r--r--gfx/blocksets/beach_house.bstbin0 -> 320 bytes
-rw-r--r--gfx/blocksets/gym.bstbin1856 -> 1856 bytes
-rw-r--r--gfx/blocksets/pokecenter.bstbin592 -> 640 bytes
-rw-r--r--gfx/emotes/bolt.pngbin0 -> 126 bytes
-rw-r--r--gfx/emotes/fish.pngbin0 -> 123 bytes
-rw-r--r--gfx/emotes/heart.pngbin0 -> 133 bytes
-rw-r--r--gfx/emotes/question.pngbin124 -> 126 bytes
-rw-r--r--gfx/emotes/skull.pngbin0 -> 127 bytes
-rw-r--r--gfx/emotes/zzz.pngbin0 -> 123 bytes
-rw-r--r--gfx/font.asm4
-rw-r--r--gfx/intro/blue_jigglypuff_1.pngbin366 -> 0 bytes
-rw-r--r--gfx/intro/blue_jigglypuff_2.pngbin360 -> 0 bytes
-rw-r--r--gfx/intro/blue_jigglypuff_3.pngbin416 -> 0 bytes
-rw-r--r--gfx/intro/clouds.pngbin0 -> 310 bytes
-rw-r--r--gfx/intro/gengar.pngbin1089 -> 0 bytes
-rw-r--r--gfx/intro/red_nidorino_1.pngbin462 -> 0 bytes
-rw-r--r--gfx/intro/red_nidorino_2.pngbin449 -> 0 bytes
-rw-r--r--gfx/intro/red_nidorino_3.pngbin495 -> 0 bytes
-rw-r--r--gfx/intro/unknown_f9b6e.mapbin0 -> 120 bytes
-rw-r--r--gfx/intro/unknown_f9be6.map1
-rw-r--r--gfx/intro/unknown_f9bf2.map1
-rw-r--r--gfx/intro/yellow_intro_1.pngbin0 -> 826 bytes
-rw-r--r--gfx/intro/yellow_intro_2.pngbin0 -> 1977 bytes
-rw-r--r--gfx/overworld/pikachu_ball.pngbin0 -> 92 bytes
-rw-r--r--gfx/overworld/shadow.pngbin77 -> 84 bytes
-rw-r--r--gfx/pics.asm13
-rw-r--r--gfx/pikachu.asm128
-rw-r--r--gfx/pikachu/unknown_e4000.pngbin0 -> 313 bytes
-rw-r--r--gfx/pikachu/unknown_e40cc.pngbin0 -> 129 bytes
-rw-r--r--gfx/pikachu/unknown_e411c.pngbin0 -> 296 bytes
-rw-r--r--gfx/pikachu/unknown_e41d2.pngbin0 -> 227 bytes
-rw-r--r--gfx/pikachu/unknown_e4272.pngbin0 -> 283 bytes
-rw-r--r--gfx/pikachu/unknown_e4323.pngbin0 -> 127 bytes
-rw-r--r--gfx/pikachu/unknown_e4383.pngbin0 -> 305 bytes
-rw-r--r--gfx/pikachu/unknown_e444b.pngbin0 -> 348 bytes
-rw-r--r--gfx/pikachu/unknown_e458b.pngbin0 -> 285 bytes
-rw-r--r--gfx/pikachu/unknown_e463b.pngbin0 -> 113 bytes
-rw-r--r--gfx/pikachu/unknown_e467b.pngbin0 -> 292 bytes
-rw-r--r--gfx/pikachu/unknown_e472e.pngbin0 -> 122 bytes
-rw-r--r--gfx/pikachu/unknown_e476e.pngbin0 -> 329 bytes
-rw-r--r--gfx/pikachu/unknown_e4841.pngbin0 -> 297 bytes
-rw-r--r--gfx/pikachu/unknown_e49d1.pngbin0 -> 308 bytes
-rw-r--r--gfx/pikachu/unknown_e4a99.pngbin0 -> 243 bytes
-rw-r--r--gfx/pikachu/unknown_e4b39.pngbin0 -> 279 bytes
-rw-r--r--gfx/pikachu/unknown_e4bde.pngbin0 -> 152 bytes
-rw-r--r--gfx/pikachu/unknown_e4c3e.pngbin0 -> 256 bytes
-rw-r--r--gfx/pikachu/unknown_e4ce0.pngbin0 -> 302 bytes
-rw-r--r--gfx/pikachu/unknown_e4e70.pngbin0 -> 304 bytes
-rw-r--r--gfx/pikachu/unknown_e5000.pngbin0 -> 285 bytes
-rw-r--r--gfx/pikachu/unknown_e50af.pngbin0 -> 279 bytes
-rw-r--r--gfx/pikachu/unknown_e523f.pngbin0 -> 299 bytes
-rw-r--r--gfx/pikachu/unknown_e52fe.pngbin0 -> 294 bytes
-rw-r--r--gfx/pikachu/unknown_e548e.pngbin0 -> 293 bytes
-rw-r--r--gfx/pikachu/unknown_e5541.pngbin0 -> 292 bytes
-rw-r--r--gfx/pikachu/unknown_e56d1.pngbin0 -> 317 bytes
-rw-r--r--gfx/pikachu/unknown_e5794.pngbin0 -> 333 bytes
-rw-r--r--gfx/pikachu/unknown_e5924.pngbin0 -> 316 bytes
-rw-r--r--gfx/pikachu/unknown_e59ed.pngbin0 -> 308 bytes
-rw-r--r--gfx/pikachu/unknown_e5b7d.pngbin0 -> 325 bytes
-rw-r--r--gfx/pikachu/unknown_e5c4d.pngbin0 -> 321 bytes
-rw-r--r--gfx/pikachu/unknown_e5ddd.pngbin0 -> 286 bytes
-rw-r--r--gfx/pikachu/unknown_e5e90.pngbin0 -> 281 bytes
-rw-r--r--gfx/pikachu/unknown_e6020.pngbin0 -> 283 bytes
-rw-r--r--gfx/pikachu/unknown_e61b0.pngbin0 -> 300 bytes
-rw-r--r--gfx/pikachu/unknown_e6340.pngbin0 -> 303 bytes
-rw-r--r--gfx/pikachu/unknown_e63f7.pngbin0 -> 313 bytes
-rw-r--r--gfx/pikachu/unknown_e6587.pngbin0 -> 287 bytes
-rw-r--r--gfx/pikachu/unknown_e6646.pngbin0 -> 340 bytes
-rw-r--r--gfx/pikachu/unknown_e67d6.pngbin0 -> 177 bytes
-rw-r--r--gfx/pikachu/unknown_e682f.pngbin0 -> 259 bytes
-rw-r--r--gfx/pikachu/unknown_e69bf.pngbin0 -> 317 bytes
-rw-r--r--gfx/pikachu/unknown_e6b4f.pngbin0 -> 281 bytes
-rw-r--r--gfx/pikachu/unknown_e6cdf.pngbin0 -> 254 bytes
-rw-r--r--gfx/pikachu/unknown_e6e6f.pngbin0 -> 226 bytes
-rw-r--r--gfx/pikachu/unknown_e6fff.pngbin0 -> 235 bytes
-rw-r--r--gfx/pikachu/unknown_e718f.pngbin0 -> 288 bytes
-rw-r--r--gfx/pikachu/unknown_e731f.pngbin0 -> 285 bytes
-rw-r--r--gfx/pikachu/unknown_e74af.pngbin0 -> 239 bytes
-rw-r--r--gfx/pikachu/unknown_e763f.pngbin0 -> 259 bytes
-rw-r--r--gfx/pikachu/unknown_e77cf.pngbin0 -> 251 bytes
-rw-r--r--gfx/pikachu/unknown_e7863.pngbin0 -> 297 bytes
-rw-r--r--gfx/pikachu/unknown_e79f3.pngbin0 -> 347 bytes
-rw-r--r--gfx/pikachu/unknown_e7b83.pngbin0 -> 259 bytes
-rw-r--r--gfx/pikachu/unknown_e7d13.pngbin0 -> 281 bytes
-rw-r--r--gfx/pikachu/unknown_f0abf.pngbin0 -> 270 bytes
-rw-r--r--gfx/pikachu/unknown_f0b64.pngbin0 -> 314 bytes
-rw-r--r--gfx/pikachu/unknown_f0cf4.pngbin0 -> 243 bytes
-rw-r--r--gfx/pikachu/unknown_f0d82.pngbin0 -> 230 bytes
-rw-r--r--gfx/player/red.pngbin410 -> 414 bytes
-rw-r--r--gfx/pokemon/front/abra.pngbin390 -> 394 bytes
-rw-r--r--gfx/pokemon/front/aerodactyl.pngbin583 -> 566 bytes
-rw-r--r--gfx/pokemon/front/alakazam.pngbin688 -> 652 bytes
-rw-r--r--gfx/pokemon/front/arbok.pngbin728 -> 596 bytes
-rw-r--r--gfx/pokemon/front/arcanine.pngbin722 -> 657 bytes
-rw-r--r--gfx/pokemon/front/articuno.pngbin705 -> 706 bytes
-rw-r--r--gfx/pokemon/front/beedrill.pngbin666 -> 665 bytes
-rw-r--r--gfx/pokemon/front/bellsprout.pngbin313 -> 333 bytes
-rw-r--r--gfx/pokemon/front/blastoise.pngbin685 -> 673 bytes
-rw-r--r--gfx/pokemon/front/bulbasaur.pngbin362 -> 356 bytes
-rw-r--r--gfx/pokemon/front/butterfree.pngbin628 -> 600 bytes
-rw-r--r--gfx/pokemon/front/caterpie.pngbin243 -> 346 bytes
-rw-r--r--gfx/pokemon/front/chansey.pngbin496 -> 417 bytes
-rw-r--r--gfx/pokemon/front/charizard.pngbin676 -> 733 bytes
-rw-r--r--gfx/pokemon/front/charmander.pngbin394 -> 391 bytes
-rw-r--r--gfx/pokemon/front/charmeleon.pngbin461 -> 502 bytes
-rw-r--r--gfx/pokemon/front/clefable.pngbin425 -> 491 bytes
-rw-r--r--gfx/pokemon/front/clefairy.pngbin375 -> 349 bytes
-rw-r--r--gfx/pokemon/front/cloyster.pngbin690 -> 657 bytes
-rw-r--r--gfx/pokemon/front/cubone.pngbin360 -> 411 bytes
-rw-r--r--gfx/pokemon/front/dewgong.pngbin460 -> 562 bytes
-rw-r--r--gfx/pokemon/front/diglett.pngbin314 -> 259 bytes
-rw-r--r--gfx/pokemon/front/ditto.pngbin275 -> 261 bytes
-rw-r--r--gfx/pokemon/front/dodrio.pngbin592 -> 594 bytes
-rw-r--r--gfx/pokemon/front/doduo.pngbin348 -> 452 bytes
-rw-r--r--gfx/pokemon/front/dragonair.pngbin459 -> 443 bytes
-rw-r--r--gfx/pokemon/front/dragonite.pngbin638 -> 676 bytes
-rw-r--r--gfx/pokemon/front/dratini.pngbin357 -> 351 bytes
-rw-r--r--gfx/pokemon/front/drowzee.pngbin499 -> 481 bytes
-rw-r--r--gfx/pokemon/front/dugtrio.pngbin565 -> 497 bytes
-rw-r--r--gfx/pokemon/front/eevee.pngbin374 -> 407 bytes
-rw-r--r--gfx/pokemon/front/ekans.pngbin376 -> 383 bytes
-rw-r--r--gfx/pokemon/front/electabuzz.pngbin515 -> 570 bytes
-rw-r--r--gfx/pokemon/front/electrode.pngbin323 -> 659 bytes
-rw-r--r--gfx/pokemon/front/exeggcute.pngbin664 -> 615 bytes
-rw-r--r--gfx/pokemon/front/exeggutor.pngbin713 -> 597 bytes
-rw-r--r--gfx/pokemon/front/farfetchd.pngbin614 -> 548 bytes
-rw-r--r--gfx/pokemon/front/fearow.pngbin564 -> 655 bytes
-rw-r--r--gfx/pokemon/front/flareon.pngbin515 -> 479 bytes
-rw-r--r--gfx/pokemon/front/gastly.pngbin668 -> 342 bytes
-rw-r--r--gfx/pokemon/front/gengar.pngbin447 -> 446 bytes
-rw-r--r--gfx/pokemon/front/geodude.pngbin321 -> 403 bytes
-rw-r--r--gfx/pokemon/front/gloom.pngbin429 -> 416 bytes
-rw-r--r--gfx/pokemon/front/golbat.pngbin691 -> 550 bytes
-rw-r--r--gfx/pokemon/front/goldeen.pngbin415 -> 496 bytes
-rw-r--r--gfx/pokemon/front/golduck.pngbin596 -> 612 bytes
-rw-r--r--gfx/pokemon/front/golem.pngbin519 -> 545 bytes
-rw-r--r--gfx/pokemon/front/graveler.pngbin568 -> 553 bytes
-rw-r--r--gfx/pokemon/front/grimer.pngbin441 -> 410 bytes
-rw-r--r--gfx/pokemon/front/growlithe.pngbin388 -> 425 bytes
-rw-r--r--gfx/pokemon/front/gyarados.pngbin759 -> 741 bytes
-rw-r--r--gfx/pokemon/front/haunter.pngbin555 -> 476 bytes
-rw-r--r--gfx/pokemon/front/hitmonchan.pngbin538 -> 440 bytes
-rw-r--r--gfx/pokemon/front/hitmonlee.pngbin587 -> 567 bytes
-rw-r--r--gfx/pokemon/front/horsea.pngbin291 -> 364 bytes
-rw-r--r--gfx/pokemon/front/hypno.pngbin638 -> 583 bytes
-rw-r--r--gfx/pokemon/front/ivysaur.pngbin431 -> 543 bytes
-rw-r--r--gfx/pokemon/front/jigglypuff.pngbin348 -> 349 bytes
-rw-r--r--gfx/pokemon/front/jolteon.pngbin514 -> 573 bytes
-rw-r--r--gfx/pokemon/front/jynx.pngbin578 -> 569 bytes
-rw-r--r--gfx/pokemon/front/kabuto.pngbin326 -> 306 bytes
-rw-r--r--gfx/pokemon/front/kabutops.pngbin560 -> 555 bytes
-rw-r--r--gfx/pokemon/front/kadabra.pngbin523 -> 558 bytes
-rw-r--r--gfx/pokemon/front/kakuna.pngbin316 -> 319 bytes
-rw-r--r--gfx/pokemon/front/kangaskhan.pngbin673 -> 732 bytes
-rw-r--r--gfx/pokemon/front/kingler.pngbin616 -> 640 bytes
-rw-r--r--gfx/pokemon/front/koffing.pngbin599 -> 428 bytes
-rw-r--r--gfx/pokemon/front/krabby.pngbin436 -> 357 bytes
-rw-r--r--gfx/pokemon/front/lapras.pngbin574 -> 597 bytes
-rw-r--r--gfx/pokemon/front/lickitung.pngbin514 -> 600 bytes
-rw-r--r--gfx/pokemon/front/machamp.pngbin653 -> 679 bytes
-rw-r--r--gfx/pokemon/front/machoke.pngbin633 -> 550 bytes
-rw-r--r--gfx/pokemon/front/machop.pngbin381 -> 383 bytes
-rw-r--r--gfx/pokemon/front/magikarp.pngbin533 -> 501 bytes
-rw-r--r--gfx/pokemon/front/magmar.pngbin496 -> 576 bytes
-rw-r--r--gfx/pokemon/front/magnemite.pngbin215 -> 322 bytes
-rw-r--r--gfx/pokemon/front/magneton.pngbin552 -> 518 bytes
-rw-r--r--gfx/pokemon/front/mankey.pngbin395 -> 480 bytes
-rw-r--r--gfx/pokemon/front/marowak.pngbin501 -> 508 bytes
-rw-r--r--gfx/pokemon/front/meowth.pngbin383 -> 403 bytes
-rw-r--r--gfx/pokemon/front/metapod.pngbin259 -> 295 bytes
-rw-r--r--gfx/pokemon/front/mew.pngbin365 -> 395 bytes
-rw-r--r--gfx/pokemon/front/mewtwo.pngbin652 -> 614 bytes
-rw-r--r--gfx/pokemon/front/moltres.pngbin747 -> 609 bytes
-rw-r--r--gfx/pokemon/front/mr.mime.pngbin475 -> 554 bytes
-rw-r--r--gfx/pokemon/front/muk.pngbin685 -> 498 bytes
-rw-r--r--gfx/pokemon/front/nidoking.pngbin752 -> 686 bytes
-rw-r--r--gfx/pokemon/front/nidoqueen.pngbin652 -> 676 bytes
-rw-r--r--gfx/pokemon/front/nidoranf.pngbin264 -> 355 bytes
-rw-r--r--gfx/pokemon/front/nidoranm.pngbin353 -> 367 bytes
-rw-r--r--gfx/pokemon/front/nidorina.pngbin438 -> 532 bytes
-rw-r--r--gfx/pokemon/front/nidorino.pngbin517 -> 491 bytes
-rw-r--r--gfx/pokemon/front/ninetales.pngbin658 -> 690 bytes
-rw-r--r--gfx/pokemon/front/oddish.pngbin267 -> 346 bytes
-rw-r--r--gfx/pokemon/front/omanyte.pngbin331 -> 332 bytes
-rw-r--r--gfx/pokemon/front/omastar.pngbin585 -> 511 bytes
-rw-r--r--gfx/pokemon/front/onix.pngbin558 -> 522 bytes
-rw-r--r--gfx/pokemon/front/paras.pngbin307 -> 362 bytes
-rw-r--r--gfx/pokemon/front/parasect.pngbin598 -> 525 bytes
-rw-r--r--gfx/pokemon/front/persian.pngbin619 -> 558 bytes
-rw-r--r--gfx/pokemon/front/pidgeot.pngbin581 -> 704 bytes
-rw-r--r--gfx/pokemon/front/pidgeotto.pngbin487 -> 482 bytes
-rw-r--r--gfx/pokemon/front/pidgey.pngbin303 -> 344 bytes
-rw-r--r--gfx/pokemon/front/pikachu.pngbin396 -> 357 bytes
-rw-r--r--gfx/pokemon/front/pinsir.pngbin617 -> 678 bytes
-rw-r--r--gfx/pokemon/front/poliwag.pngbin318 -> 346 bytes
-rw-r--r--gfx/pokemon/front/poliwhirl.pngbin478 -> 479 bytes
-rw-r--r--gfx/pokemon/front/poliwrath.pngbin513 -> 603 bytes
-rw-r--r--gfx/pokemon/front/ponyta.pngbin503 -> 524 bytes
-rw-r--r--gfx/pokemon/front/porygon.pngbin496 -> 387 bytes
-rw-r--r--gfx/pokemon/front/primeape.pngbin607 -> 614 bytes
-rw-r--r--gfx/pokemon/front/psyduck.pngbin423 -> 388 bytes
-rw-r--r--gfx/pokemon/front/raichu.pngbin595 -> 616 bytes
-rw-r--r--gfx/pokemon/front/rapidash.pngbin710 -> 681 bytes
-rw-r--r--gfx/pokemon/front/raticate.pngbin539 -> 579 bytes
-rw-r--r--gfx/pokemon/front/rattata.pngbin325 -> 351 bytes
-rw-r--r--gfx/pokemon/front/rhydon.pngbin657 -> 681 bytes
-rw-r--r--gfx/pokemon/front/rhyhorn.pngbin661 -> 566 bytes
-rw-r--r--gfx/pokemon/front/sandshrew.pngbin407 -> 397 bytes
-rw-r--r--gfx/pokemon/front/sandslash.pngbin556 -> 560 bytes
-rw-r--r--gfx/pokemon/front/scyther.pngbin690 -> 653 bytes
-rw-r--r--gfx/pokemon/front/seadra.pngbin482 -> 500 bytes
-rw-r--r--gfx/pokemon/front/seaking.pngbin627 -> 657 bytes
-rw-r--r--gfx/pokemon/front/seel.pngbin490 -> 452 bytes
-rw-r--r--gfx/pokemon/front/shellder.pngbin396 -> 309 bytes
-rw-r--r--gfx/pokemon/front/slowbro.pngbin765 -> 623 bytes
-rw-r--r--gfx/pokemon/front/slowpoke.pngbin428 -> 313 bytes
-rw-r--r--gfx/pokemon/front/snorlax.pngbin610 -> 512 bytes
-rw-r--r--gfx/pokemon/front/spearow.pngbin337 -> 325 bytes
-rw-r--r--gfx/pokemon/front/squirtle.pngbin318 -> 370 bytes
-rw-r--r--gfx/pokemon/front/starmie.pngbin537 -> 505 bytes
-rw-r--r--gfx/pokemon/front/staryu.pngbin401 -> 339 bytes
-rw-r--r--gfx/pokemon/front/tangela.pngbin532 -> 459 bytes
-rw-r--r--gfx/pokemon/front/tauros.pngbin622 -> 579 bytes
-rw-r--r--gfx/pokemon/front/tentacool.pngbin364 -> 384 bytes
-rw-r--r--gfx/pokemon/front/tentacruel.pngbin483 -> 549 bytes
-rw-r--r--gfx/pokemon/front/vaporeon.pngbin492 -> 530 bytes
-rw-r--r--gfx/pokemon/front/venomoth.pngbin597 -> 599 bytes
-rw-r--r--gfx/pokemon/front/venonat.pngbin390 -> 377 bytes
-rw-r--r--gfx/pokemon/front/venusaur.pngbin658 -> 661 bytes
-rw-r--r--gfx/pokemon/front/victreebel.pngbin603 -> 617 bytes
-rw-r--r--gfx/pokemon/front/vileplume.pngbin473 -> 425 bytes
-rw-r--r--gfx/pokemon/front/voltorb.pngbin245 -> 281 bytes
-rw-r--r--gfx/pokemon/front/vulpix.pngbin501 -> 453 bytes
-rw-r--r--gfx/pokemon/front/wartortle.pngbin451 -> 515 bytes
-rw-r--r--gfx/pokemon/front/weedle.pngbin286 -> 298 bytes
-rw-r--r--gfx/pokemon/front/weepinbell.pngbin436 -> 389 bytes
-rw-r--r--gfx/pokemon/front/weezing.pngbin709 -> 484 bytes
-rw-r--r--gfx/pokemon/front/wigglytuff.pngbin513 -> 526 bytes
-rw-r--r--gfx/pokemon/front/zapdos.pngbin621 -> 601 bytes
-rw-r--r--gfx/pokemon/front/zubat.pngbin389 -> 349 bytes
-rw-r--r--gfx/pokemon/front_rg/abra.pngbin465 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/aerodactyl.pngbin625 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/alakazam.pngbin707 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/arbok.pngbin665 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/arcanine.pngbin702 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/articuno.pngbin655 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/beedrill.pngbin657 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/bellsprout.pngbin288 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/blastoise.pngbin659 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/bulbasaur.pngbin333 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/butterfree.pngbin729 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/caterpie.pngbin242 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/chansey.pngbin486 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/charizard.pngbin726 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/charmander.pngbin381 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/charmeleon.pngbin509 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/clefable.pngbin444 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/clefairy.pngbin333 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/cloyster.pngbin739 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/cubone.pngbin398 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dewgong.pngbin472 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/diglett.pngbin226 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/ditto.pngbin252 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dodrio.pngbin673 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/doduo.pngbin373 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dragonair.pngbin506 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dragonite.pngbin693 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dratini.pngbin347 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/drowzee.pngbin480 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/dugtrio.pngbin523 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/eevee.pngbin347 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/ekans.pngbin323 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/electabuzz.pngbin598 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/electrode.pngbin350 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/exeggcute.pngbin658 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/exeggutor.pngbin728 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/farfetchd.pngbin531 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/fearow.pngbin699 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/flareon.pngbin571 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/fossilaerodactyl.pngbin549 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/fossilkabutops.pngbin489 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/gastly.pngbin652 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/gengar.pngbin456 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/geodude.pngbin281 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/gloom.pngbin476 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/golbat.pngbin598 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/goldeen.pngbin472 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/golduck.pngbin619 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/golem.pngbin565 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/graveler.pngbin562 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/grimer.pngbin387 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/growlithe.pngbin367 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/gyarados.pngbin732 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/haunter.pngbin558 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/hitmonchan.pngbin488 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/hitmonlee.pngbin555 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/horsea.pngbin286 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/hypno.pngbin657 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/ivysaur.pngbin433 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/jigglypuff.pngbin317 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/jolteon.pngbin543 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/jynx.pngbin561 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kabuto.pngbin267 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kabutops.pngbin496 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kadabra.pngbin615 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kakuna.pngbin308 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kangaskhan.pngbin662 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/kingler.pngbin659 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/koffing.pngbin584 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/krabby.pngbin415 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/lapras.pngbin600 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/lickitung.pngbin604 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/machamp.pngbin725 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/machoke.pngbin658 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/machop.pngbin383 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/magikarp.pngbin499 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/magmar.pngbin573 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/magnemite.pngbin217 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/magneton.pngbin567 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/mankey.pngbin401 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/marowak.pngbin532 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/meowth.pngbin341 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/metapod.pngbin264 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/mew.pngbin366 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/mewtwo.pngbin583 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/moltres.pngbin836 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/mr.mime.pngbin554 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/muk.pngbin593 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidoking.pngbin735 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidoqueen.pngbin662 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidoranf.pngbin313 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidoranm.pngbin340 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidorina.pngbin502 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/nidorino.pngbin519 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/ninetales.pngbin701 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/oddish.pngbin355 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/omanyte.pngbin327 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/omastar.pngbin591 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/onix.pngbin606 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/paras.pngbin339 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/parasect.pngbin610 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/persian.pngbin568 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/pidgeot.pngbin722 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/pidgeotto.pngbin577 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/pidgey.pngbin318 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/pikachu.pngbin399 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/pinsir.pngbin632 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/poliwag.pngbin319 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/poliwhirl.pngbin414 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/poliwrath.pngbin551 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/ponyta.pngbin543 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/porygon.pngbin402 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/primeape.pngbin645 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/psyduck.pngbin393 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/raichu.pngbin613 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/rapidash.pngbin652 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/raticate.pngbin479 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/rattata.pngbin304 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/rhydon.pngbin722 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/rhyhorn.pngbin679 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/sandshrew.pngbin355 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/sandslash.pngbin592 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/scyther.pngbin704 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/seadra.pngbin504 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/seaking.pngbin717 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/seel.pngbin452 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/shellder.pngbin313 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/slowbro.pngbin740 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/slowpoke.pngbin375 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/snorlax.pngbin453 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/spearow.pngbin342 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/squirtle.pngbin319 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/starmie.pngbin571 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/staryu.pngbin425 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/tangela.pngbin573 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/tauros.pngbin610 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/tentacool.pngbin363 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/tentacruel.pngbin539 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/vaporeon.pngbin618 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/venomoth.pngbin663 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/venonat.pngbin374 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/venusaur.pngbin756 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/victreebel.pngbin567 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/vileplume.pngbin575 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/voltorb.pngbin238 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/vulpix.pngbin418 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/wartortle.pngbin485 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/weedle.pngbin266 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/weepinbell.pngbin461 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/weezing.pngbin636 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/wigglytuff.pngbin518 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/zapdos.pngbin645 -> 0 bytes
-rw-r--r--gfx/pokemon/front_rg/zubat.pngbin366 -> 0 bytes
-rw-r--r--gfx/printer/01.pngbin0 -> 92 bytes
-rw-r--r--gfx/printer/hp.pngbin0 -> 82 bytes
-rw-r--r--gfx/printer/lv.pngbin0 -> 78 bytes
-rw-r--r--gfx/sgb/blue_border.pngbin1117 -> 0 bytes
-rw-r--r--gfx/sgb/blue_border.tilemapbin1792 -> 0 bytes
-rw-r--r--gfx/sgb/border.pngbin0 -> 781 bytes
-rw-r--r--gfx/sgb/border.tilemapbin0 -> 1792 bytes
-rw-r--r--gfx/sgb/green_border.pngbin1051 -> 0 bytes
-rw-r--r--gfx/sgb/green_border.tilemapbin1792 -> 0 bytes
-rw-r--r--gfx/sgb/red_border.pngbin1048 -> 0 bytes
-rw-r--r--gfx/sgb/red_border.tilemapbin1792 -> 0 bytes
-rw-r--r--gfx/slots/blue_slots_1.pngbin469 -> 0 bytes
-rw-r--r--gfx/slots/blue_slots_2.pngbin314 -> 0 bytes
-rw-r--r--gfx/slots/green_slots_1.pngbin461 -> 0 bytes
-rw-r--r--gfx/slots/green_slots_2.pngbin308 -> 0 bytes
-rw-r--r--gfx/slots/red_slots_1.pngbin470 -> 0 bytes
-rw-r--r--gfx/slots/red_slots_2.pngbin346 -> 0 bytes
-rw-r--r--gfx/slots/slots_1.pngbin0 -> 478 bytes
-rw-r--r--gfx/slots/slots_2.pngbin0 -> 379 bytes
-rw-r--r--gfx/splash/copyright.pngbin220 -> 219 bytes
-rw-r--r--gfx/sprites.asm16
-rw-r--r--gfx/sprites/bike_shop_clerk.pngbin213 -> 209 bytes
-rw-r--r--gfx/sprites/bulbasaur.pngbin0 -> 547 bytes
-rw-r--r--gfx/sprites/chansey.pngbin0 -> 544 bytes
-rw-r--r--gfx/sprites/clefairy.pngbin0 -> 554 bytes
-rw-r--r--gfx/sprites/daisy.pngbin276 -> 277 bytes
-rw-r--r--gfx/sprites/james.pngbin0 -> 711 bytes
-rw-r--r--gfx/sprites/jessie.pngbin0 -> 888 bytes
-rw-r--r--gfx/sprites/jigglypuff.pngbin0 -> 467 bytes
-rw-r--r--gfx/sprites/middle_aged_woman.pngbin289 -> 264 bytes
-rw-r--r--gfx/sprites/nurse.pngbin233 -> 272 bytes
-rw-r--r--gfx/sprites/oddish.pngbin0 -> 421 bytes
-rw-r--r--gfx/sprites/officer_jenny.pngbin0 -> 859 bytes
-rw-r--r--gfx/sprites/pikachu.pngbin0 -> 847 bytes
-rw-r--r--gfx/sprites/question_mark.pngbin0 -> 221 bytes
-rw-r--r--gfx/sprites/sandshrew.pngbin0 -> 625 bytes
-rw-r--r--gfx/sprites/surfing_pikachu.pngbin0 -> 1092 bytes
-rw-r--r--gfx/surfing_pikachu.asm3
-rw-r--r--gfx/surfing_pikachu/surfing_pikachu_1a.pngbin0 -> 638 bytes
-rw-r--r--gfx/surfing_pikachu/surfing_pikachu_1b.pngbin0 -> 2002 bytes
-rw-r--r--gfx/surfing_pikachu/surfing_pikachu_1c.pngbin0 -> 1318 bytes
-rw-r--r--gfx/surfing_pikachu/surfing_pikachu_2.pngbin0 -> 816 bytes
-rw-r--r--gfx/surfing_pikachu/surfing_pikachu_3.pngbin0 -> 2783 bytes
-rw-r--r--gfx/surfing_pikachu/unknown_f8946.map1
-rw-r--r--gfx/surfing_pikachu/unknown_f90bc.mapbin0 -> 240 bytes
-rw-r--r--gfx/surfing_pikachu/unknown_f91ac.map1
-rw-r--r--gfx/surfing_pikachu/unknown_f91bb.map2
-rw-r--r--gfx/surfing_pikachu/unknown_f91c8.map1
-rw-r--r--gfx/tilesets.asm8
-rw-r--r--gfx/tilesets/beach_house.pngbin0 -> 566 bytes
-rw-r--r--gfx/tilesets/overworld.pngbin1309 -> 1304 bytes
-rw-r--r--gfx/tilesets/tilesets_rg/flower.pngbin108 -> 0 bytes
-rw-r--r--gfx/tilesets/tilesets_rg/forest.pngbin1416 -> 0 bytes
-rw-r--r--gfx/tilesets/tilesets_rg/overworld.pngbin1288 -> 0 bytes
-rw-r--r--gfx/title/nine.pngbin0 -> 86 bytes
-rw-r--r--gfx/title/pika_bubble.tilemap1
-rw-r--r--gfx/title/pikachu.tilemapbin0 -> 108 bytes
-rw-r--r--gfx/title/pikachu_bg.pngbin0 -> 528 bytes
-rw-r--r--gfx/title/pikachu_ob.pngbin0 -> 144 bytes
-rw-r--r--gfx/title/pokemon_logo.pngbin926 -> 1253 bytes
-rw-r--r--gfx/title/pokemon_logo.tilemap2
-rw-r--r--gfx/title/pokemon_logo_corner.pngbin0 -> 97 bytes
-rw-r--r--gfx/title/pokemon_logo_japan.pngbin0 -> 1991 bytes
-rw-r--r--gfx/title/red_version.pngbin126 -> 0 bytes
-rw-r--r--gfx/trainer_card/badges.pngbin924 -> 919 bytes
-rw-r--r--gfx/trainers/brock.pngbin394 -> 371 bytes
-rw-r--r--gfx/trainers/erika.pngbin433 -> 434 bytes
-rw-r--r--gfx/trainers/jessiejames.pngbin0 -> 641 bytes
-rw-r--r--gfx/trainers/misty.pngbin381 -> 406 bytes
-rw-r--r--gfx/trainers/rival1.pngbin423 -> 378 bytes
-rw-r--r--gfx/trainers/rival2.pngbin497 -> 445 bytes
-rw-r--r--gfx/trainers/rival3.pngbin482 -> 418 bytes
-rw-r--r--gfx/version.asm7
-rw-r--r--gfx/yellow_intro.asm4
-rw-r--r--home.asm13
-rw-r--r--home/audio.asm171
-rw-r--r--home/bankswitch.asm24
-rw-r--r--home/bankswitch2.asm39
-rw-r--r--home/cgb_palettes.asm85
-rw-r--r--home/copy.asm70
-rw-r--r--home/copy2.asm137
-rw-r--r--home/delay.asm1
-rw-r--r--home/fade.asm9
-rw-r--r--home/fade_audio.asm4
-rw-r--r--home/header.asm2
-rw-r--r--home/hidden_objects.asm22
-rw-r--r--home/init.asm7
-rw-r--r--home/item_price.asm9
-rw-r--r--home/joypad.asm42
-rw-r--r--home/joypad2.asm7
-rw-r--r--home/lcdc.asm20
-rw-r--r--home/list_menu.asm15
-rw-r--r--home/load_font.asm4
-rw-r--r--home/map_objects.asm76
-rw-r--r--home/names2.asm6
-rw-r--r--home/npc_movement.asm10
-rw-r--r--home/overworld.asm1237
-rw-r--r--home/palettes.asm9
-rw-r--r--home/pics.asm16
-rw-r--r--home/pikachu.asm116
-rw-r--r--home/pikachu_cries.asm46
-rw-r--r--home/play_time.asm (renamed from engine/play_time.asm)18
-rw-r--r--home/pokemon.asm73
-rw-r--r--home/predef.asm6
-rw-r--r--home/print_num.asm11
-rw-r--r--home/printer.asm34
-rw-r--r--home/reload_sprites.asm2
-rw-r--r--home/reload_tiles.asm12
-rw-r--r--home/reset_player_sprite.asm3
-rw-r--r--home/serial.asm11
-rw-r--r--home/start.asm4
-rw-r--r--home/start_menu.asm6
-rw-r--r--home/text.asm15
-rw-r--r--home/text_script.asm41
-rw-r--r--home/tilemap.asm20
-rw-r--r--home/trainers.asm14
-rw-r--r--home/trainers2.asm19
-rw-r--r--home/uncompress.asm13
-rw-r--r--home/update_sprites.asm12
-rw-r--r--home/vblank.asm39
-rw-r--r--home/vcopy.asm66
-rw-r--r--home/window.asm10
-rw-r--r--home/yes_no.asm2
-rw-r--r--hram.asm20
-rw-r--r--layout.link103
-rw-r--r--macros.asm1
-rw-r--r--macros/data.asm9
-rw-r--r--macros/farcall.asm47
-rw-r--r--macros/scripts/events.asm61
-rw-r--r--macros/scripts/gfx_anims.asm37
-rw-r--r--macros/scripts/text.asm6
-rw-r--r--macros/wram.asm20
-rw-r--r--main.asm216
-rw-r--r--maps.asm56
-rw-r--r--maps/CeladonGym.blk2
-rw-r--r--maps/CeladonHotel.blk2
-rw-r--r--maps/CeladonPokecenter.blk2
-rw-r--r--maps/CeruleanCave1F.blk5
-rw-r--r--maps/CeruleanCave2F.blk10
-rw-r--r--maps/CeruleanCaveB1F.blk3
-rw-r--r--maps/CeruleanMart.blk2
-rw-r--r--maps/CeruleanPokecenter.blk2
-rw-r--r--maps/CinnabarMart.blk2
-rw-r--r--maps/CinnabarPokecenter.blk2
-rw-r--r--maps/FuchsiaMart.blk2
-rw-r--r--maps/FuchsiaPokecenter.blk2
-rw-r--r--maps/GameCorner.blk2
-rw-r--r--maps/LavenderMart.blk2
-rw-r--r--maps/LavenderPokecenter.blk2
-rw-r--r--maps/MtMoonPokecenter.blk2
-rw-r--r--maps/PewterMart.blk2
-rw-r--r--maps/PewterPokecenter.blk2
-rw-r--r--maps/RockTunnelPokecenter.blk2
-rw-r--r--maps/Route19.blk2
-rw-r--r--maps/Route4.blk2
-rw-r--r--maps/SaffronMart.blk2
-rw-r--r--maps/SaffronPokecenter.blk2
-rw-r--r--maps/SummerBeachHouse.blk1
-rw-r--r--maps/UnusedPokecenterCopy.blk2
-rw-r--r--maps/VermilionMart.blk2
-rw-r--r--maps/VermilionPokecenter.blk2
-rw-r--r--maps/ViridianMart.blk2
-rw-r--r--maps/ViridianPokecenter.blk2
-rw-r--r--maps/green/CeruleanCave1F.blk3
-rw-r--r--maps/green/CeruleanCave2F.blk1
-rw-r--r--maps/green/CeruleanCaveB1F.blk1
-rw-r--r--rgbdscheck.asm2
-rw-r--r--roms.sha15
-rw-r--r--scripts/BikeShop.asm11
-rw-r--r--scripts/BillsHouse.asm251
-rw-r--r--scripts/BillsHouse2.asm158
-rw-r--r--scripts/BluesHouse.asm7
-rw-r--r--scripts/CeladonCity.asm14
-rw-r--r--scripts/CeladonCity2.asm8
-rw-r--r--scripts/CeladonDiner.asm37
-rw-r--r--scripts/CeladonDiner2.asm38
-rw-r--r--scripts/CeladonMansion1F.asm29
-rw-r--r--scripts/CeladonMansion1F_2.asm78
-rw-r--r--scripts/CeladonMansion3F.asm132
-rw-r--r--scripts/CeladonMansion3F_2.asm35
-rw-r--r--scripts/CeladonMansionRoof.asm3
-rw-r--r--scripts/CeladonMansionRoofHouse.asm3
-rw-r--r--scripts/CeladonMart1F.asm3
-rw-r--r--scripts/CeladonMart3F.asm35
-rw-r--r--scripts/CeladonMart3F_2.asm36
-rw-r--r--scripts/CeladonMart5F.asm3
-rw-r--r--scripts/CeladonMartRoof.asm12
-rw-r--r--scripts/CeladonPokecenter.asm6
-rw-r--r--scripts/CeruleanCave1F.asm1
-rw-r--r--scripts/CeruleanCave2F.asm1
-rw-r--r--scripts/CeruleanCaveB1F.asm2
-rw-r--r--scripts/CeruleanCity.asm25
-rw-r--r--scripts/CeruleanGym.asm2
-rw-r--r--scripts/CeruleanMelaniesHouse.asm106
-rw-r--r--scripts/CeruleanPokecenter.asm6
-rw-r--r--scripts/CeruleanTradeHouse.asm17
-rw-r--r--scripts/ChampionsRoom.asm16
-rw-r--r--scripts/CinnabarGym.asm184
-rw-r--r--scripts/CinnabarGym3.asm64
-rw-r--r--scripts/CinnabarGym_2.asm18
-rw-r--r--scripts/CinnabarPokecenter.asm6
-rw-r--r--scripts/Daycare.asm29
-rw-r--r--scripts/FuchsiaMart.asm3
-rw-r--r--scripts/FuchsiaPokecenter.asm6
-rw-r--r--scripts/GameCorner.asm14
-rw-r--r--scripts/GameCorner2.asm12
-rw-r--r--scripts/IndigoPlateauLobby.asm6
-rw-r--r--scripts/LancesRoom.asm2
-rw-r--r--scripts/LavenderPokecenter.asm6
-rw-r--r--scripts/MtMoon1F.asm19
-rw-r--r--scripts/MtMoonB2F.asm482
-rw-r--r--scripts/MtMoonB2F_2.asm28
-rw-r--r--scripts/MtMoonPokecenter.asm68
-rw-r--r--scripts/MtMoonPokecenter2.asm66
-rw-r--r--scripts/Museum1F.asm196
-rw-r--r--scripts/Museum1F2.asm209
-rw-r--r--scripts/Museum2F.asm34
-rw-r--r--scripts/OaksLab.asm864
-rw-r--r--scripts/OaksLab2.asm28
-rw-r--r--scripts/PalletTown.asm159
-rw-r--r--scripts/PewterCity.asm16
-rw-r--r--scripts/PewterGym.asm16
-rw-r--r--scripts/PewterNidoranHouse.asm3
-rw-r--r--scripts/PewterPokecenter.asm81
-rw-r--r--scripts/PewterPokecenter2.asm79
-rw-r--r--scripts/PokemonFanClub.asm201
-rw-r--r--scripts/PokemonTower1F.asm3
-rw-r--r--scripts/PokemonTower2F.asm24
-rw-r--r--scripts/PokemonTower2F_2.asm12
-rw-r--r--scripts/PokemonTower7F.asm442
-rw-r--r--scripts/RedsHouse1F.asm60
-rw-r--r--scripts/RedsHouse1F2.asm57
-rw-r--r--scripts/RedsHouse2F.asm19
-rw-r--r--scripts/RockTunnelPokecenter.asm6
-rw-r--r--scripts/RocketHideoutB4F.asm402
-rw-r--r--scripts/Route1.asm47
-rw-r--r--scripts/Route11Gate2F.asm2
-rw-r--r--scripts/Route19.asm30
-rw-r--r--scripts/Route1_2.asm53
-rw-r--r--scripts/Route22.asm133
-rw-r--r--scripts/Route22Gate.asm5
-rw-r--r--scripts/Route22_2.asm50
-rw-r--r--scripts/Route24.asm59
-rw-r--r--scripts/Route25.asm22
-rw-r--r--scripts/Route6.asm6
-rw-r--r--scripts/Route7.asm3
-rw-r--r--scripts/Route8Gate.asm2
-rw-r--r--scripts/Route9.asm18
-rw-r--r--scripts/SSAnne2F.asm23
-rw-r--r--scripts/SSAnne2FRooms.asm33
-rw-r--r--scripts/SSAnne2FRooms_2.asm35
-rw-r--r--scripts/SSAnneCaptainsRoom.asm10
-rw-r--r--scripts/SafariZoneGate.asm104
-rw-r--r--scripts/SafariZoneGate2.asm251
-rw-r--r--scripts/SaffronPokecenter.asm6
-rw-r--r--scripts/SeafoamIslandsB4F.asm3
-rw-r--r--scripts/SilphCo11F.asm496
-rw-r--r--scripts/SilphCo11F_2.asm76
-rw-r--r--scripts/SilphCo7F.asm24
-rw-r--r--scripts/SummerBeachHouse.asm196
-rw-r--r--scripts/SummerBeachHouse2.asm33
-rw-r--r--scripts/VermilionCity.asm69
-rw-r--r--scripts/VermilionCity2.asm111
-rw-r--r--scripts/VermilionDock.asm6
-rw-r--r--scripts/VermilionPokecenter.asm6
-rw-r--r--scripts/VermilionTradeHouse.asm7
-rw-r--r--scripts/VictoryRoad1F.asm3
-rw-r--r--scripts/VictoryRoad2F.asm3
-rw-r--r--scripts/VictoryRoad3F.asm3
-rw-r--r--scripts/ViridianCity.asm430
-rw-r--r--scripts/ViridianCity2.asm215
-rw-r--r--scripts/ViridianForest.asm86
-rw-r--r--scripts/ViridianForest2.asm53
-rw-r--r--scripts/ViridianForestSouthGate.asm3
-rw-r--r--scripts/ViridianMart.asm16
-rw-r--r--scripts/ViridianPokecenter.asm6
-rw-r--r--scripts/ViridianSchoolHouse.asm14
-rw-r--r--scripts/ViridianSchoolHouse2.asm17
-rw-r--r--text.asm83
-rw-r--r--text/AgathasRoom.asm2
-rw-r--r--text/BikeShop.asm2
-rw-r--r--text/BillsHouse.asm5
-rw-r--r--text/BluesHouse.asm8
-rw-r--r--text/CeladonCity.asm44
-rw-r--r--text/CeladonMansion1F.asm58
-rw-r--r--text/CeladonMansion3F.asm51
-rw-r--r--text/CeladonMart3F.asm56
-rw-r--r--text/CeladonMart4F.asm8
-rw-r--r--text/CeladonMartRoof.asm5
-rw-r--r--text/CeruleanBadgeHouse.asm33
-rw-r--r--text/CeruleanBadgeHouse_2.asm28
-rw-r--r--text/CeruleanCity.asm34
-rw-r--r--text/CeruleanGym.asm30
-rw-r--r--text/CeruleanMelaniesHouse.asm46
-rw-r--r--text/CeruleanTradeHouse.asm9
-rw-r--r--text/CinnabarGym.asm43
-rw-r--r--text/CinnabarIsland.asm2
-rw-r--r--text/CopycatsHouse1F.asm4
-rw-r--r--text/Daycare.asm35
-rw-r--r--text/Daycare_2.asm34
-rw-r--r--text/FightingDojo.asm4
-rw-r--r--text/FuchsiaCity.asm2
-rw-r--r--text/FuchsiaGym.asm195
-rw-r--r--text/FuchsiaGym_2.asm194
-rw-r--r--text/GameCorner.asm5
-rw-r--r--text/GameCorner_2.asm4
-rw-r--r--text/HallOfFame.asm2
-rw-r--r--text/LancesRoom.asm2
-rw-r--r--text/MtMoon1F.asm2
-rw-r--r--text/MtMoonB2F.asm41
-rw-r--r--text/MtMoonPokecenter.asm8
-rw-r--r--text/Museum1F.asm2
-rw-r--r--text/Museum2F.asm14
-rw-r--r--text/NameRatersHouse.asm2
-rw-r--r--text/OaksLab.asm343
-rw-r--r--text/PalletTown.asm18
-rw-r--r--text/PewterGym.asm168
-rw-r--r--text/PewterGym_2.asm146
-rw-r--r--text/PewterMart.asm2
-rw-r--r--text/PewterPokecenter.asm13
-rw-r--r--text/PokemonFanClub.asm75
-rw-r--r--text/PokemonTower7F.asm79
-rw-r--r--text/RedsHouse1F.asm13
-rw-r--r--text/RockTunnelB1F.asm21
-rw-r--r--text/RockTunnelB1F_2.asm20
-rw-r--r--text/RocketHideoutB4F.asm57
-rw-r--r--text/Route10.asm2
-rw-r--r--text/Route11.asm29
-rw-r--r--text/Route11_2.asm28
-rw-r--r--text/Route12.asm2
-rw-r--r--text/Route12Gate2F.asm2
-rw-r--r--text/Route14.asm2
-rw-r--r--text/Route16.asm2
-rw-r--r--text/Route17.asm2
-rw-r--r--text/Route22.asm72
-rw-r--r--text/Route24.asm120
-rw-r--r--text/Route24_2.asm90
-rw-r--r--text/Route25.asm4
-rw-r--r--text/Route3.asm4
-rw-r--r--text/Route6.asm31
-rw-r--r--text/Route8.asm2
-rw-r--r--text/Route9.asm41
-rw-r--r--text/Route9_2.asm21
-rw-r--r--text/SSAnne2FRooms.asm54
-rw-r--r--text/SSAnneCaptainsRoom.asm4
-rw-r--r--text/SSAnneKitchen.asm2
-rw-r--r--text/SafariZoneGate.asm92
-rw-r--r--text/SaffronGates.asm4
-rw-r--r--text/SaffronGym.asm3
-rw-r--r--text/SilphCo10F.asm28
-rw-r--r--text/SilphCo11F.asm24
-rw-r--r--text/SilphCo2F.asm2
-rw-r--r--text/SilphCo5F.asm58
-rw-r--r--text/SilphCo5F_2.asm55
-rw-r--r--text/SilphCo7F.asm4
-rw-r--r--text/SummerBeachHouse.asm107
-rw-r--r--text/VermilionCity.asm54
-rw-r--r--text/VermilionGym.asm176
-rw-r--r--text/VermilionGym_2.asm145
-rw-r--r--text/ViridianCity.asm84
-rw-r--r--text/ViridianForest.asm36
-rw-r--r--text/ViridianForestSouthGate.asm11
-rw-r--r--text/ViridianGym.asm4
-rw-r--r--text/ViridianMart.asm10
-rw-r--r--text/ViridianSchoolHouse.asm7
-rw-r--r--text/pokedex_ratings.asm117
-rw-r--r--tools/.gitignore1
-rw-r--r--tools/Makefile2
-rw-r--r--tools/pcm.c160
-rw-r--r--tools/pokemontools/pcm.py156
-rwxr-xr-xtools/unnamed.py6
-rw-r--r--wram.asm290
1273 files changed, 43558 insertions, 17954 deletions
diff --git a/.gitignore b/.gitignore
index 8643ec14..80e4aad8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,9 @@
*.2bpp
*.pic
+# compiled audio
+*.pcm
+
# compiled roms
*.gbc
*.gb
diff --git a/.travis/webhook.sh b/.travis/webhook.sh
index e50f3c29..c19a321b 100755
--- a/.travis/webhook.sh
+++ b/.travis/webhook.sh
@@ -4,7 +4,7 @@ set -e
root="$(readlink -e "$(dirname "$0")/..")"
# Report unnamed symbols
-content="$("$root/tools/unnamed.py" -r "$root" "$root/pokered.sym" | head)"
+content="$("$root/tools/unnamed.py" -r "$root" "$root/pokeyellow.sym" | head)"
curl -H 'Content-Type: application/json' -X POST "$POKERED_DISCORD_WEBHOOK_URL" -d@- << EOF
{
diff --git a/INSTALL.md b/INSTALL.md
index 02ac7125..b156c156 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,6 +1,6 @@
# Instructions
-These instructions explain how to set up the tools required to build **pokered**, including [**rgbds**](https://github.com/gbdev/rgbds), which assembles the source files into a ROM.
+These instructions explain how to set up the tools required to build **pokeyellow**, including [**rgbds**](https://github.com/gbdev/rgbds), which assembles the source files into a ROM.
If you run into trouble, ask for help on IRC or Discord (see [README.md](README.md)).
@@ -15,9 +15,9 @@ Update WSL's software before continuing. If you chose Debian, Ubuntu, or another
apt-get update && apt-get upgrade
```
-WSL has its own file system that's not accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to install pokered within Windows. You'll have to change the **current working directory** every time you open WSL.
+WSL has its own file system that's not accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to install pokeyellow within Windows. You'll have to change the **current working directory** every time you open WSL.
-For example, if you want to store pokered in **C:\Users\\*\<user>*\Desktop**, enter this command:
+For example, if you want to store pokeyellow in **C:\Users\\*\<user>*\Desktop**, enter this command:
```bash
cd /mnt/c/Users/<user>/Desktop
@@ -48,9 +48,9 @@ Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install/
Now open the **Cygwin terminal** and enter the following commands.
-Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\<user>***. If you don't want to store pokered there, you'll have to change the **current working directory** every time you open Cygwin.
+Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\<user>***. If you don't want to store pokeyellow there, you'll have to change the **current working directory** every time you open Cygwin.
-For example, if you want to store pokered in **C:\Users\\*\<user>*\Desktop**:
+For example, if you want to store pokeyellow in **C:\Users\\*\<user>*\Desktop**:
```bash
cd /cygdrive/c/Users/<user>/Desktop
@@ -58,7 +58,7 @@ cd /cygdrive/c/Users/<user>/Desktop
(The Windows `C:\` drive is called `/cygdrive/c/` in Cygwin. Replace *\<user>* in the example path with your username.)
-Now you're ready to [build **pokered**](#build-pokered).
+Now you're ready to [build **pokeyellow**](#build-pokeyellow).
## macOS
@@ -69,7 +69,7 @@ Open **Terminal** and prepare to enter commands.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.5.1**.
-Now you're ready to [build **pokered**](#build-pokered).
+Now you're ready to [build **pokeyellow**](#build-pokeyellow).
## Linux
@@ -78,7 +78,7 @@ Open **Terminal** and enter the following commands, depending on which distro yo
### Debian or Ubuntu
-To install the software required for **pokered**:
+To install the software required for **pokeyellow**:
```bash
sudo apt-get install make gcc git
@@ -88,7 +88,7 @@ Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source)
### OpenSUSE
-To install the software required for **pokered**:
+To install the software required for **pokeyellow**:
```bash
sudo zypper install make gcc git
@@ -98,7 +98,7 @@ Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source)
### Arch Linux
-To install the software required for **pokered**:
+To install the software required for **pokeyellow**:
```bash
sudo pacman -S make gcc git
@@ -110,7 +110,7 @@ If you want to compile and install **rgbds** yourself instead, then follow the [
### Termux
-To install the software required for **pokered**:
+To install the software required for **pokeyellow**:
```bash
sudo apt install make clang git sed
@@ -135,19 +135,19 @@ If your distro is not listed here, try to find the required software in its repo
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.5.1** from source.
-Now you're ready to [build **pokered**](#build-pokered).
+Now you're ready to [build **pokeyellow**](#build-pokeyellow).
-## Build pokered
+## Build pokeyellow
-To download the **pokered** source files:
+To download the **pokeyellow** source files:
```bash
-git clone https://github.com/pret/pokered
-cd pokered
+git clone https://github.com/pret/pokeyellow
+cd pokeyellow
```
-To build **pokered.gbc** and **pokeblue.gbc**:
+To build **pokeyellow.gbc**:
```bash
make
@@ -155,7 +155,7 @@ make
### Build with a local rgbds version
-If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.5.1 globally. Instead, you can put its files in a directory within pokered, such as `pokered/rgbds-0.5.1/`. Then specify it when you run `make`:
+If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.5.1 globally. Instead, you can put its files in a directory within pokeyellow, such as `pokeyellow/rgbds-0.5.1/`. Then specify it when you run `make`:
```bash
make RGBDS=rgbds-0.5.1/
diff --git a/Makefile b/Makefile
index 6d432ec9..a5a6af77 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-roms := pokered.gbc pokeblue.gbc pokeblue_debug.gbc
+roms := pokeyellow.gbc pokeyellow_debug.gbc
rom_obj := \
audio.o \
@@ -8,12 +8,12 @@ maps.o \
text.o \
wram.o \
gfx/pics.o \
+gfx/pikachu.o \
gfx/sprites.o \
gfx/tilesets.o
-pokered_obj := $(rom_obj:.o=_red.o)
-pokeblue_obj := $(rom_obj:.o=_blue.o)
-pokeblue_debug_obj := $(rom_obj:.o=_blue_debug.o)
+pokeyellow_obj := $(rom_obj)
+pokeyellow_debug_obj := $(rom_obj:.o=_debug.o)
### Build tools
@@ -37,18 +37,18 @@ RGBLINK ?= $(RGBDS)rgblink
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
-.PHONY: all red blue blue_debug clean tidy compare tools
+.PHONY: all yellow yellow_debug clean tidy compare tools
all: $(roms)
-red: pokered.gbc
-blue: pokeblue.gbc
-blue_debug: pokeblue_debug.gbc
+yellow: pokeyellow.gbc
+yellow_debug: pokeyellow_debug.gbc
clean: tidy
find gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -delete
+ find audio/pikachu_cries \( -iname '*.pcm' \) -delete
tidy:
- rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(pokeblue_debug_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o
+ rm -f $(roms) $(pokeyellow_obj) $(pokeyellow_debug_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o
$(MAKE) clean -C tools/
compare: $(roms)
@@ -64,9 +64,7 @@ ifeq ($(DEBUG),1)
RGBASMFLAGS += -E
endif
-$(pokered_obj): RGBASMFLAGS += -D _RED
-$(pokeblue_obj): RGBASMFLAGS += -D _BLUE
-$(pokeblue_debug_obj): RGBASMFLAGS += -D _BLUE -D _DEBUG
+$(pokeyellow_debug_obj): RGBASMFLAGS += -D _DEBUG
rgbdscheck.o: rgbdscheck.asm
$(RGBASM) -o $@ $<
@@ -85,10 +83,9 @@ ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS)))
$(info $(shell $(MAKE) -C tools))
-# Dependencies for objects (drop _red and _blue from asm file basenames)
-$(foreach obj, $(pokered_obj), $(eval $(call DEP,$(obj),$(obj:_red.o=.asm))))
-$(foreach obj, $(pokeblue_obj), $(eval $(call DEP,$(obj),$(obj:_blue.o=.asm))))
-$(foreach obj, $(pokeblue_debug_obj), $(eval $(call DEP,$(obj),$(obj:_blue_debug.o=.asm))))
+# Dependencies for objects
+$(foreach obj, $(pokeyellow_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm))))
+$(foreach obj, $(pokeyellow_debug_obj), $(eval $(call DEP,$(obj),$(obj:_debug.o=.asm))))
endif
@@ -96,17 +93,14 @@ endif
%.asm: ;
-pokered_pad = 0x00
-pokeblue_pad = 0x00
-pokeblue_debug_pad = 0xff
+pokeyellow_pad = 0x00
+pokeyellow_debug_pad = 0xff
-pokered_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON RED"
-pokeblue_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE"
-pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE"
+opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELLOW"
%.gbc: $$(%_obj) layout.link
- $(RGBLINK) -p $($*_pad) -d -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
- $(RGBFIX) -p $($*_pad) $($*_opt) $@
+ $(RGBLINK) -p $($*_pad) -w -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
+ $(RGBFIX) -p $($*_pad) $(opts) $@
### Misc file-specific graphics rules
@@ -114,25 +108,22 @@ pokeblue_debug_opt = -jsv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE"
gfx/battle/attack_anim_1.2bpp: tools/gfx += --trim-whitespace
gfx/battle/attack_anim_2.2bpp: tools/gfx += --trim-whitespace
-gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += -h
-gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += -h
-gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += -h
-gfx/intro/red_nidorino_1.2bpp: rgbgfx += -h
-gfx/intro/red_nidorino_2.2bpp: rgbgfx += -h
-gfx/intro/red_nidorino_3.2bpp: rgbgfx += -h
-gfx/intro/gengar.2bpp: rgbgfx += -h
-gfx/intro/gengar.2bpp: tools/gfx += --remove-duplicates --preserve=0x19,0x76
-
gfx/credits/the_end.2bpp: tools/gfx += --interleave --png=$<
-gfx/slots/red_slots_1.2bpp: tools/gfx += --trim-whitespace
-gfx/slots/blue_slots_1.2bpp: tools/gfx += --trim-whitespace
+gfx/slots/slots_1.2bpp: tools/gfx += --trim-whitespace
gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
gfx/tilesets/reds_house.2bpp: tools/gfx += --preserve=0x48
+gfx/title/pokemon_logo.2bpp: tools/gfx += --trim-whitespace
+
gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates
+gfx/sgb/border.2bpp: tools/gfx += --trim-whitespace
+
+gfx/surfing_pikachu/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace
+gfx/surfing_pikachu/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace
+
### Catch-all graphics rules
@@ -150,3 +141,11 @@ gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates
%.pic: %.2bpp
tools/pkmncompress $< $@
+
+
+### Catch-all audio rules
+
+%.wav: ;
+
+%.pcm: %.wav
+ tools/pcm $< $@
diff --git a/README.md b/README.md
index 78fab5ca..36f3da24 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,11 @@
-# Pokémon Red and Blue [![Build Status][travis-badge]][travis]
+# Pokémon Yellow [![Build Status][travis-badge]][travis]
-This is a disassembly of Pokémon Red and Blue.
+This is a disassembly of Pokémon Yellow.
It builds the following ROMs:
-- Pokemon Red (UE) [S][!].gb `sha1: ea9bcae617fdf159b045185467ae58b2e4a48b9a`
-- Pokemon Blue (UE) [S][!].gb `sha1: d7037c83e1ae5b39bde3c30787637ba1d4c48ce2`
-- BLUEMONS.GB (debug build) `sha1: 5b1456177671b79b263c614ea0e7cc9ac542e9c4`
+- Pokemon Yellow (UE) [C][!].gbc `sha1: cc7d03262ebfaf2f06772c1a480c7d9d5f4a38e1`
+- YELLMONS.GB (debug build) `sha1: d44e96eddfbdad633cbe4e6e64915e9e198974b0`
To set up the repository, see [**INSTALL.md**](INSTALL.md).
@@ -18,7 +17,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
Other disassembly projects:
-- [**Pokémon Yellow**][pokeyellow]
+- [**Pokémon Red/Blue**][pokered]
- [**Pokémon Gold/Silver**][pokegold]
- [**Pokémon Crystal**][pokecrystal]
- [**Pokémon Pinball**][pokepinball]
@@ -27,7 +26,7 @@ Other disassembly projects:
- [**Pokémon FireRed**][pokefirered]
- [**Pokémon Emerald**][pokeemerald]
-[pokeyellow]: https://github.com/pret/pokeyellow
+[pokered]: https://github.com/pret/pokered
[pokegold]: https://github.com/pret/pokegold
[pokecrystal]: https://github.com/pret/pokecrystal
[pokepinball]: https://github.com/pret/pokepinball
@@ -37,5 +36,5 @@ Other disassembly projects:
[pokeemerald]: https://github.com/pret/pokeemerald
[discord]: https://discord.gg/d5dubZ3
[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret
-[travis]: https://travis-ci.org/pret/pokered
-[travis-badge]: https://travis-ci.org/pret/pokered.svg?branch=master
+[travis]: https://travis-ci.org/pret/pokeyellow
+[travis-badge]: https://travis-ci.org/pret/pokeyellow.svg?branch=master
diff --git a/audio.asm b/audio.asm
index 35b0d872..a3a32c12 100644
--- a/audio.asm
+++ b/audio.asm
@@ -10,6 +10,9 @@ INCLUDE "audio/headers/sfxheaders2.asm"
SECTION "Sound Effect Headers 3", ROMX
INCLUDE "audio/headers/sfxheaders3.asm"
+SECTION "Sound Effect Headers 4", ROMX
+INCLUDE "audio/headers/sfxheaders4.asm"
+
SECTION "Music Headers 1", ROMX
INCLUDE "audio/headers/musicheaders1.asm"
@@ -20,6 +23,9 @@ INCLUDE "audio/headers/musicheaders2.asm"
SECTION "Music Headers 3", ROMX
INCLUDE "audio/headers/musicheaders3.asm"
+SECTION "Music Headers 4", ROMX
+INCLUDE "audio/headers/musicheaders4.asm"
+
SECTION "Sound Effects 1", ROMX
@@ -43,9 +49,6 @@ INCLUDE "audio/sfx/noise_instrument17_1.asm"
INCLUDE "audio/sfx/noise_instrument18_1.asm"
INCLUDE "audio/sfx/noise_instrument19_1.asm"
-Audio1_WavePointers:
-INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/start_menu_1.asm"
INCLUDE "audio/sfx/pokeflute.asm"
INCLUDE "audio/sfx/cut_1.asm"
@@ -143,9 +146,6 @@ INCLUDE "audio/sfx/noise_instrument17_2.asm"
INCLUDE "audio/sfx/noise_instrument18_2.asm"
INCLUDE "audio/sfx/noise_instrument19_2.asm"
-Audio2_WavePointers:
-INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/press_ab_2.asm"
INCLUDE "audio/sfx/start_menu_2.asm"
INCLUDE "audio/sfx/tink_2.asm"
@@ -157,6 +157,7 @@ INCLUDE "audio/sfx/ball_poof.asm"
INCLUDE "audio/sfx/faint_thud.asm"
INCLUDE "audio/sfx/run.asm"
INCLUDE "audio/sfx/dex_page_added.asm"
+INCLUDE "audio/sfx/swap_2.asm" ; added in yellow
INCLUDE "audio/sfx/pokeflute_ch7.asm"
INCLUDE "audio/sfx/peck.asm"
INCLUDE "audio/sfx/faint_fall.asm"
@@ -269,9 +270,6 @@ INCLUDE "audio/sfx/noise_instrument17_3.asm"
INCLUDE "audio/sfx/noise_instrument18_3.asm"
INCLUDE "audio/sfx/noise_instrument19_3.asm"
-Audio3_WavePointers:
-INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/start_menu_3.asm"
INCLUDE "audio/sfx/cut_3.asm"
INCLUDE "audio/sfx/go_inside_3.asm"
@@ -355,6 +353,84 @@ INCLUDE "audio/sfx/cry21_3.asm"
INCLUDE "audio/sfx/cry22_3.asm"
+SECTION "Sound Effects 4", ROMX
+
+INCLUDE "audio/sfx/noise_instrument01_4.asm"
+INCLUDE "audio/sfx/noise_instrument02_4.asm"
+INCLUDE "audio/sfx/noise_instrument03_4.asm"
+INCLUDE "audio/sfx/noise_instrument04_4.asm"
+INCLUDE "audio/sfx/noise_instrument05_4.asm"
+INCLUDE "audio/sfx/noise_instrument06_4.asm"
+INCLUDE "audio/sfx/noise_instrument07_4.asm"
+INCLUDE "audio/sfx/noise_instrument08_4.asm"
+INCLUDE "audio/sfx/noise_instrument09_4.asm"
+INCLUDE "audio/sfx/noise_instrument10_4.asm"
+INCLUDE "audio/sfx/noise_instrument11_4.asm"
+INCLUDE "audio/sfx/noise_instrument12_4.asm"
+INCLUDE "audio/sfx/noise_instrument13_4.asm"
+INCLUDE "audio/sfx/noise_instrument14_4.asm"
+INCLUDE "audio/sfx/noise_instrument15_4.asm"
+INCLUDE "audio/sfx/noise_instrument16_4.asm"
+INCLUDE "audio/sfx/noise_instrument17_4.asm"
+INCLUDE "audio/sfx/noise_instrument18_4.asm"
+INCLUDE "audio/sfx/noise_instrument19_4.asm"
+
+INCLUDE "audio/sfx/press_ab_4.asm"
+INCLUDE "audio/sfx/start_menu_4.asm"
+INCLUDE "audio/sfx/heal_ailment_4.asm"
+INCLUDE "audio/sfx/heal_hp_4.asm"
+INCLUDE "audio/sfx/tink_4.asm"
+INCLUDE "audio/sfx/surfing_jump.asm"
+INCLUDE "audio/sfx/surfing_flip.asm"
+INCLUDE "audio/sfx/unknown_802cc.asm"
+INCLUDE "audio/sfx/surfing_land.asm"
+INCLUDE "audio/sfx/surfing_crash.asm"
+INCLUDE "audio/sfx/get_item2_4_2.asm"
+INCLUDE "audio/sfx/unused_cry_4.asm"
+INCLUDE "audio/sfx/cry09_4.asm"
+INCLUDE "audio/sfx/cry23_4.asm"
+INCLUDE "audio/sfx/cry24_4.asm"
+INCLUDE "audio/sfx/cry11_4.asm"
+INCLUDE "audio/sfx/cry25_4.asm"
+INCLUDE "audio/sfx/cry03_4.asm"
+INCLUDE "audio/sfx/cry0f_4.asm"
+INCLUDE "audio/sfx/cry10_4.asm"
+INCLUDE "audio/sfx/cry00_4.asm"
+INCLUDE "audio/sfx/cry0e_4.asm"
+INCLUDE "audio/sfx/cry06_4.asm"
+INCLUDE "audio/sfx/cry07_4.asm"
+INCLUDE "audio/sfx/cry05_4.asm"
+INCLUDE "audio/sfx/cry0b_4.asm"
+INCLUDE "audio/sfx/cry0c_4.asm"
+INCLUDE "audio/sfx/cry02_4.asm"
+INCLUDE "audio/sfx/cry0d_4.asm"
+INCLUDE "audio/sfx/cry01_4.asm"
+INCLUDE "audio/sfx/cry0a_4.asm"
+INCLUDE "audio/sfx/cry08_4.asm"
+INCLUDE "audio/sfx/cry04_4.asm"
+INCLUDE "audio/sfx/cry19_4.asm"
+INCLUDE "audio/sfx/cry16_4.asm"
+INCLUDE "audio/sfx/cry1b_4.asm"
+INCLUDE "audio/sfx/cry12_4.asm"
+INCLUDE "audio/sfx/cry13_4.asm"
+INCLUDE "audio/sfx/cry14_4.asm"
+INCLUDE "audio/sfx/cry1e_4.asm"
+INCLUDE "audio/sfx/cry15_4.asm"
+INCLUDE "audio/sfx/cry17_4.asm"
+INCLUDE "audio/sfx/cry1c_4.asm"
+INCLUDE "audio/sfx/cry1a_4.asm"
+INCLUDE "audio/sfx/cry1d_4.asm"
+INCLUDE "audio/sfx/cry18_4.asm"
+INCLUDE "audio/sfx/cry1f_4.asm"
+INCLUDE "audio/sfx/cry20_4.asm"
+INCLUDE "audio/sfx/cry21_4.asm"
+INCLUDE "audio/sfx/cry22_4.asm"
+INCLUDE "audio/music/printer.asm"
+INCLUDE "audio/sfx/get_item1_4.asm"
+INCLUDE "audio/sfx/get_item1_4_2.asm"
+INCLUDE "audio/sfx/get_item2_4.asm"
+
+
SECTION "Audio Engine 1", ROMX
INCLUDE "audio/play_battle_music.asm"
@@ -370,7 +446,6 @@ INCLUDE "audio/low_health_alarm.asm"
SECTION "Audio Engine 2", ROMX
INCLUDE "audio/engine_2.asm"
-INCLUDE "audio/poke_flute.asm"
SECTION "Audio Engine 3", ROMX
@@ -379,8 +454,16 @@ INCLUDE "audio/pokedex_rating_sfx.asm"
INCLUDE "audio/engine_3.asm"
+SECTION "Audio Engine 4", ROMX
+
+INCLUDE "gfx/surfing_pikachu.asm"
+INCLUDE "audio/engine_4.asm"
+
+
SECTION "Music 1", ROMX
+Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
+
INCLUDE "audio/music/pkmnhealed.asm"
INCLUDE "audio/music/routes1.asm"
INCLUDE "audio/music/routes2.asm"
@@ -410,7 +493,6 @@ INCLUDE "audio/music/pokecenter.asm"
SECTION "Music 2", ROMX
-INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm"
INCLUDE "audio/sfx/unused_fanfare.asm"
INCLUDE "audio/music/gymleaderbattle.asm"
INCLUDE "audio/music/trainerbattle.asm"
@@ -448,3 +530,19 @@ INCLUDE "audio/music/surfing.asm"
INCLUDE "audio/music/jigglypuffsong.asm"
INCLUDE "audio/music/halloffame.asm"
INCLUDE "audio/music/credits.asm"
+INCLUDE "audio/music/yellowintro.asm"
+
+
+SECTION "Music 4", ROMX
+
+INCLUDE "audio/music/surfingpikachu.asm"
+INCLUDE "audio/music/yellowunusedsong.asm"
+INCLUDE "audio/music/meetjessiejames.asm"
+
+IF !DEF(_DEBUG)
+ INCBIN "garbage/bank20.bin"
+ENDC
+
+
+; Pikachu cries are in different banks
+INCLUDE "audio/pikachu_cries.asm"
diff --git a/audio/alternate_tempo.asm b/audio/alternate_tempo.asm
index 6c2cdc49..eb47d62d 100644
--- a/audio/alternate_tempo.asm
+++ b/audio/alternate_tempo.asm
@@ -22,17 +22,19 @@ Music_RivalAlternateTempo::
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
- ld hl, wChannelCommandPointers
ld de, Music_MeetRival_branch_b119
- jp Audio1_OverwriteChannelPointer
+ jr FinishAlternateRivalMusic
; applies both the alternate start and alternate tempo
Music_RivalAlternateStartAndTempo::
call Music_RivalAlternateStart
- ld hl, wChannelCommandPointers
ld de, Music_MeetRival_branch_b19b
+FinishAlternateRivalMusic:
+ ld hl, wChannelCommandPointers
jp Audio1_OverwriteChannelPointer
+ ret ; unused
+
; an alternate tempo for Cities1 which is used for the Hall of Fame room
Music_Cities1AlternateTempo::
ld a, 10
diff --git a/audio/engine_1.asm b/audio/engine_1.asm
index f9b4166a..df3281cb 100644
--- a/audio/engine_1.asm
+++ b/audio/engine_1.asm
@@ -1,4 +1,4 @@
-; The first of three duplicated sound engines.
+; The first of four partially duplicated sound engines.
Audio1_UpdateMusic::
ld c, Ch1
@@ -157,6 +157,15 @@ Audio1_PlayNextNote:
add hl, bc
res BIT_PITCH_SLIDE_ON, [hl]
res BIT_PITCH_SLIDE_DECREASING, [hl]
+ ld a, c
+ cp $4
+ jr nz, .asm_918c
+ ld a, [wLowHealthAlarm]
+ bit 7, a
+ jr z, .asm_918c
+ call Audio1_EnableChannelOutput
+ ret
+.asm_918c
call Audio1_sound_ret
ret
@@ -515,7 +524,8 @@ Audio1_unknownmusic0xef:
jr nz, Audio1_duty_cycle_pattern
call Audio1_GetNextMusicByte
push bc
- call Audio1_PlaySound
+ ld b, a
+ call DetermineAudioFunction
pop bc
ld a, [wDisableChannelOutputWhenSfxEnds]
and a
@@ -681,8 +691,8 @@ Audio1_note:
ld a, [wDisableChannelOutputWhenSfxEnds]
and a
jr nz, .skipDnote
- ld a, d
- call Audio1_PlaySound
+ ld b, d
+ call DetermineAudioFunction
.skipDnote
pop bc
pop de
@@ -842,7 +852,7 @@ Audio1_note_pitch:
Audio1_EnableChannelOutput:
ld b, 0
- ld hl, Audio1_HWChannelEnableMasks
+ call Audio1_9972
add hl, bc
ldh a, [rNR51]
or [hl] ; set this channel's bits
@@ -862,7 +872,7 @@ Audio1_EnableChannelOutput:
; If this is the SFX noise channel or a music channel whose corresponding
; SFX channel is off, apply stereo panning.
ld a, [wStereoPanning]
- ld hl, Audio1_HWChannelEnableMasks
+ call Audio1_9972
add hl, bc
and [hl]
ld d, a
@@ -950,12 +960,31 @@ Audio1_ApplyWavePatternAndFrequency:
ld [hl], e ; store frequency low byte
inc hl
ld [hl], d ; store frequency high byte
+ ld a, c
+ cp $4
+ jr c, .asm_9642
call Audio1_ApplyFrequencyModifier
+.asm_9642
+ ret
+.asm_9643
+ ld a, c
+ cp $4
+ ret nz
+ ld a, [wLowHealthAlarm]
+ bit 7, a
+ ret z
+ xor a
+ ld [wFrequencyModifier], a
+ ld a, $80
+ ld [wTempoModifier], a
ret
Audio1_SetSfxTempo:
call Audio1_IsCry
+ jr c, .isCry
+ call Audio1_96c3
jr nc, .notCry
+.isCry
ld d, 0
ld a, [wTempoModifier]
add $80
@@ -965,18 +994,20 @@ Audio1_SetSfxTempo:
ld [wSfxTempo + 1], a
ld a, d
ld [wSfxTempo], a
- jr .done
+ ret
.notCry
xor a
ld [wSfxTempo + 1], a
- ld a, $1
+ inc a
ld [wSfxTempo], a
-.done
ret
Audio1_ApplyFrequencyModifier:
call Audio1_IsCry
- jr nc, .done
+ jr c, .isCry
+ call Audio1_96c3
+ ret nc
+.isCry
; if playing a cry, add the cry's frequency modifier
ld a, [wFrequencyModifier]
add e
@@ -1010,8 +1041,7 @@ Audio1_GoBackOneCommandIfCry:
scf
ret
.done
- scf
- ccf
+ and a
ret
Audio1_IsCry:
@@ -1032,6 +1062,26 @@ Audio1_IsCry:
scf
ret
+Audio1_96c3:
+ ld a, [wAudioROMBank]
+ cp BANK("Audio Engine 2")
+ jr nz, .asm_96dc
+ ld a, [wChannelSoundIDs + Ch8]
+ ld b, a
+ ld a, [wChannelSoundIDs + Ch5]
+ or b
+ cp $9d
+ jr c, .asm_96dc
+ cp $ea
+ jr z, .asm_96de
+ jr c, .asm_96de
+.asm_96dc
+ and a
+ ret
+.asm_96de
+ scf
+ ret
+
Audio1_ApplyPitchSlide:
ld hl, wChannelFlags1
add hl, bc
@@ -1254,21 +1304,7 @@ Audio1_ApplyDutyCyclePattern:
ret
Audio1_GetNextMusicByte:
- ld d, 0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- ld a, [hli]
- ld e, a
- ld a, [hld]
- ld d, a
- ld a, [de] ; get next music command
- inc de
- ld [hl], e ; store address of next command
- inc hl
- ld [hl], d
+ call GetNextMusicByte
ret
Audio1_GetRegisterPointer:
@@ -1330,6 +1366,7 @@ Audio1_CalculateFrequency:
Audio1_PlaySound::
ld [wSoundID], a
+ ld a, [wSoundID]
cp SFX_STOP_ALL_MUSIC
jp z, .stopAllAudio
cp MAX_SFX_ID_1
@@ -1340,76 +1377,7 @@ Audio1_PlaySound::
jp nc, .playSfx
.playMusic
- xor a
- ld [wUnusedC000], a
- ld [wDisableChannelOutputWhenSfxEnds], a
- ld [wMusicTempo + 1], a
- ld [wMusicWaveInstrument], a
- ld [wSfxWaveInstrument], a
- ld d, NUM_CHANNELS
- ld hl, wChannelReturnAddresses
- call .FillMem
- ld hl, wChannelCommandPointers
- call .FillMem
- ld d, NUM_MUSIC_CHANS
- ld hl, wChannelSoundIDs
- call .FillMem
- ld hl, wChannelFlags1
- call .FillMem
- ld hl, wChannelDutyCycles
- call .FillMem
- ld hl, wChannelDutyCyclePatterns
- call .FillMem
- ld hl, wChannelVibratoDelayCounters
- call .FillMem
- ld hl, wChannelVibratoExtents
- call .FillMem
- ld hl, wChannelVibratoRates
- call .FillMem
- ld hl, wChannelFrequencyLowBytes
- call .FillMem
- ld hl, wChannelVibratoDelayCounterReloadValues
- call .FillMem
- ld hl, wChannelFlags2
- call .FillMem
- ld hl, wChannelPitchSlideLengthModifiers
- call .FillMem
- ld hl, wChannelPitchSlideFrequencySteps
- call .FillMem
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- call .FillMem
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- call .FillMem
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- call .FillMem
- ld a, $1
- ld hl, wChannelLoopCounters
- call .FillMem
- ld hl, wChannelNoteDelayCounters
- call .FillMem
- ld hl, wChannelNoteSpeeds
- call .FillMem
- ld [wMusicTempo], a
- ld a, $ff
- ld [wStereoPanning], a
- xor a
- ldh [rNR50], a
- ld a, $8
- ldh [rNR10], a
- ld a, 0
- ldh [rNR51], a
- xor a
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
- ld a, $77
- ldh [rNR50], a
+ call InitMusicVariables
jp .playSoundCommon
.playSfx
@@ -1471,92 +1439,7 @@ Audio1_PlaySound::
jr c, .playChannel
ret
.playChannel
- xor a
- push de
- ld h, d
- ld l, e
- add hl, hl
- ld d, h
- ld e, l
- ld hl, wChannelReturnAddresses
- add hl, de
- ld [hli], a
- ld [hl], a
- ld hl, wChannelCommandPointers
- add hl, de
- ld [hli], a
- ld [hl], a
- pop de
- ld hl, wChannelSoundIDs
- add hl, de
- ld [hl], a
- ld hl, wChannelFlags1
- add hl, de
- ld [hl], a
- ld hl, wChannelDutyCycles
- add hl, de
- ld [hl], a
- ld hl, wChannelDutyCyclePatterns
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoDelayCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoExtents
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoRates
- add hl, de
- ld [hl], a
- ld hl, wChannelFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelFlags2
- add hl, de
- ld [hl], a
- ld a, $1
- ld hl, wChannelLoopCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelNoteDelayCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelNoteSpeeds
- add hl, de
- ld [hl], a
- ld a, e
- cp Ch5
- jr nz, .skipSweepDisable
- ld a, $8
- ldh [rNR10], a ; sweep off
-.skipSweepDisable
+ call InitSFXVariables
ld a, c
and a
jp z, .playSoundCommon
@@ -1564,51 +1447,7 @@ Audio1_PlaySound::
jp .sfxChannelLoop
.stopAllAudio
- ld a, $80
- ldh [rNR52], a ; sound hardware on
- ldh [rNR30], a ; wave playback on
- xor a
- ldh [rNR51], a ; no sound output
- ldh [rNR32], a ; mute channel 3 (wave channel)
- ld a, $8
- ldh [rNR10], a ; sweep off
- ldh [rNR12], a ; mute channel 1 (pulse channel 1)
- ldh [rNR22], a ; mute channel 2 (pulse channel 2)
- ldh [rNR42], a ; mute channel 4 (noise channel)
- ld a, $40
- ldh [rNR14], a ; counter mode
- ldh [rNR24], a
- ldh [rNR44], a
- ld a, $77
- ldh [rNR50], a ; full volume
- xor a
- ld [wUnusedC000], a
- ld [wDisableChannelOutputWhenSfxEnds], a
- ld [wMuteAudioAndPauseMusic], a
- ld [wMusicTempo + 1], a
- ld [wSfxTempo + 1], a
- ld [wMusicWaveInstrument], a
- ld [wSfxWaveInstrument], a
- ld d, $a0
- ld hl, wChannelCommandPointers
- call .FillMem
- ld a, $1
- ld d, $18
- ld hl, wChannelNoteDelayCounters
- call .FillMem
- ld [wMusicTempo], a
- ld [wSfxTempo], a
- ld a, $ff
- ld [wStereoPanning], a
- ret
-
-; fills d bytes at hl with a
-.FillMem
- ld b, d
-.loop
- ld [hli], a
- dec b
- jr nz, .loop
+ call StopAllAudio
ret
.playSoundCommon
@@ -1644,16 +1483,11 @@ Audio1_PlaySound::
inc hl
jr .commandPointerLoop
.next
+ push af
push hl
push bc
- push af
ld b, 0
ld c, a
- ld hl, wChannelSoundIDs
- add hl, bc
- ld a, [wSoundID]
- ld [hl], a
- pop af
cp Ch4
jr c, .skipSettingFlag
ld hl, wChannelFlags1
@@ -1668,6 +1502,17 @@ Audio1_PlaySound::
ld a, [de]
ld [hli], a
inc de
+ pop af
+ push hl
+ push bc
+ ld b, 0
+ ld c, a
+ ld hl, wChannelSoundIDs
+ add hl, bc
+ ld a, [wSoundID]
+ ld [hl], a
+ pop bc
+ pop hl
inc c
dec b
ld a, b
@@ -1718,9 +1563,29 @@ Audio1_HWChannelDisableMasks:
db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 0-3
db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 4-7
+Audio1_9972:
+ push af
+ push bc
+ ld a, [wOptions]
+ and %110000 ; channel options
+ srl a
+ ld c, a
+ ld b, 0
+ ld hl, Audio1_HWChannelEnableMasks
+ add hl, bc
+ pop bc
+ pop af
+ ret
+
Audio1_HWChannelEnableMasks:
db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 0-3
db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 4-7
+ db $01,$20,$44,$88
+ db $11,$22,$44,$88
+ db $01,$20,$04,$80
+ db $01,$20,$04,$80
+ db $01,$02,$40,$80
+ db $01,$02,$40,$80
Audio1_Pitches:
INCLUDE "audio/notes.asm"
diff --git a/audio/engine_2.asm b/audio/engine_2.asm
index 51a5d7c4..800a2246 100644
--- a/audio/engine_2.asm
+++ b/audio/engine_2.asm
@@ -1,1408 +1,202 @@
-; The second of three duplicated sound engines.
+; The second of four partially duplicated sound engines.
; This copy has a few differences relating to battle sound effects
; and the low health alarm that plays in battle
-Audio2_UpdateMusic::
- ld c, Ch1
-.loop
- ld b, 0
- ld hl, wChannelSoundIDs
- add hl, bc
- ld a, [hl]
- and a
- jr z, .nextChannel
- ld a, c
- cp Ch5
- jr nc, .applyAffects ; if sfx channel
- ld a, [wMuteAudioAndPauseMusic]
- and a
- jr z, .applyAffects
- bit 7, a
- jr nz, .nextChannel
- set 7, a
- ld [wMuteAudioAndPauseMusic], a
- xor a ; disable all channels' output
- ldh [rNR51], a
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
- jr .nextChannel
-.applyAffects
- call Audio2_ApplyMusicAffects
-.nextChannel
- ld a, c
- inc c ; inc channel number
- cp Ch8
- jr nz, .loop
- ret
+Audio2_PlaySound::
+ ld [wSoundID], a
+ ld a, [wSoundID]
+ cp SFX_STOP_ALL_MUSIC
+ jp z, .stopAllAudio
+ cp MAX_SFX_ID_2
+ jp z, .playSfx
+ jp c, .playSfx
+ cp $fe
+ jr z, .playMusic
+ jp nc, .playSfx
-; this routine checks flags for music effects currently applied
-; to the channel and calls certain functions based on flags.
-Audio2_ApplyMusicAffects:
- ld b, $0
- ld hl, wChannelNoteDelayCounters ; delay until next note
- add hl, bc
+.playMusic
+ call InitMusicVariables
+ jp .playSoundCommon
+
+.playSfx
+ ld l, a
+ ld e, a
+ ld h, 0
+ ld d, h
+ add hl, hl
+ add hl, de
+ ld de, SFX_Headers_2
+ add hl, de
+ ld a, h
+ ld [wSfxHeaderPointer], a
+ ld a, l
+ ld [wSfxHeaderPointer + 1], a
ld a, [hl]
- cp 1 ; if the delay is 1, play next note
- jp z, Audio2_PlayNextNote
- dec a ; otherwise, decrease the delay timer
- ld [hl], a
+ and $c0
+ rlca
+ rlca
+ ld c, a
+.sfxChannelLoop
+ ld d, c
ld a, c
- cp Ch5
- jr nc, .startChecks ; if a sfx channel
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
- and a
- jr z, .startChecks
- ret
-.startChecks
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_ROTATE_DUTY_CYCLE, [hl]
- jr z, .checkForExecuteMusic
- call Audio2_ApplyDutyCyclePattern
-.checkForExecuteMusic
- ld b, 0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, .checkForPitchSlide
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_NOISE_OR_SFX, [hl]
- jr nz, .skipPitchSlideVibrato
-.checkForPitchSlide
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_ON, [hl]
- jr z, .checkVibratoDelay
- jp Audio2_ApplyPitchSlide
-.checkVibratoDelay
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld a, [hl]
- and a ; check if delay is over
- jr z, .checkForVibrato
- dec [hl] ; otherwise, dec delay
-.skipPitchSlideVibrato
- ret
-.checkForVibrato
- ld hl, wChannelVibratoExtents
- add hl, bc
- ld a, [hl]
- and a
- jr nz, .vibrato
- ret ; no vibrato
-.vibrato
- ld d, a
- ld hl, wChannelVibratoRates
+ add a
+ add c
+ ld c, a
+ ld b, $0
+ ld a, [wSfxHeaderPointer]
+ ld h, a
+ ld a, [wSfxHeaderPointer + 1]
+ ld l, a
add hl, bc
+ ld c, d
ld a, [hl]
and $f
- and a
- jr z, .applyVibrato
- dec [hl] ; decrement counter
- ret
-.applyVibrato
+ ld e, a ; software channel ID
+ ld d, 0
+ ld hl, wChannelSoundIDs
+ add hl, de
ld a, [hl]
- swap [hl]
- or [hl]
- ld [hl], a ; reload the counter
- ld hl, wChannelFrequencyLowBytes
- add hl, bc
- ld e, [hl] ; get note pitch
- ld hl, wChannelFlags1
- add hl, bc
-; This is the only code that sets/resets the vibrato direction bit, so it
-; continuously alternates which path it takes.
- bit BIT_VIBRATO_DIRECTION, [hl]
- jr z, .unset
- res BIT_VIBRATO_DIRECTION, [hl]
- ld a, d
- and $f
- ld d, a
+ and a
+ jr z, .playChannel
ld a, e
- sub d
- jr nc, .noCarry
- ld a, 0
-.noCarry
- jr .done
-.unset
- set BIT_VIBRATO_DIRECTION, [hl]
- ld a, d
- and $f0
- swap a
- add e
- jr nc, .done
- ld a, $ff
-.done
- ld d, a
- ld b, REG_FREQUENCY_LO
- call Audio2_GetRegisterPointer
- ld [hl], d
+ cp Ch8
+ jr nz, .notNoiseChannel
+ ld a, [wSoundID]
+ cp NOISE_INSTRUMENTS_END
+ jr nc, .notNoiseInstrument
ret
-
-; this routine executes all music commands that take up no time,
-; like tempo changes, duty cycle changes etc. and doesn't return
-; until the first note is reached
-Audio2_PlayNextNote:
-; reload the vibrato delay counter
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, bc
+.notNoiseInstrument
ld a, [hl]
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld [hl], a
-
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_ON, [hl]
- res BIT_PITCH_SLIDE_DECREASING, [hl]
- ; --- this section is only present in this copy of the sound engine
- ld a, c
- cp Ch5
- jr nz, .beginChecks
- ld a, [wLowHealthAlarm] ; low health alarm enabled?
- bit 7, a
- ret nz
-.beginChecks
- ; ---
- call Audio2_sound_ret
+ cp NOISE_INSTRUMENTS_END
+ jr z, .playChannel
+ jr c, .playChannel
+.notNoiseChannel
+ ld a, [wSoundID]
+ cp [hl]
+ jr z, .playChannel
+ jr c, .playChannel
ret
-
-Audio2_sound_ret:
- call Audio2_GetNextMusicByte
- ld d, a
- cp sound_ret_cmd
- jp nz, Audio2_sound_call
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_SOUND_CALL, [hl]
- jr nz, .returnFromCall
+.playChannel
+ call InitSFXVariables
ld a, c
- cp Ch4
- jr nc, .noiseOrSfxChannel
- jr .disableChannelOutput
-.noiseOrSfxChannel
- res BIT_NOISE_OR_SFX, [hl]
- ld hl, wChannelFlags2
- add hl, bc
- res BIT_EXECUTE_MUSIC, [hl]
- cp Ch7
- jr nz, .skipSfxChannel3
-; restart hardware channel 3 (wave channel) output
- ld a, $0
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
-.skipSfxChannel3
- jr nz, .dontDisable
- ld a, [wDisableChannelOutputWhenSfxEnds]
and a
- jr z, .dontDisable
- xor a
- ld [wDisableChannelOutputWhenSfxEnds], a
- jr .disableChannelOutput
-.dontDisable
- jr .afterDisable
-.returnFromCall
- res 1, [hl]
- ld d, $0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- push hl ; store current channel address
- ld hl, wChannelReturnAddresses
- add hl, de
- ld e, l
- ld d, h
- pop hl
- ld a, [de]
- ld [hli], a
- inc de
- ld a, [de]
- ld [hl], a ; loads channel address to return to
- jp Audio2_sound_ret
-.disableChannelOutput
- ld hl, Audio2_HWChannelDisableMasks
- add hl, bc
- ldh a, [rNR51]
- and [hl]
- ldh [rNR51], a
-.afterDisable
- ld a, [wChannelSoundIDs + Ch5]
- cp CRY_SFX_START
- jr nc, .maybeCry
- jr .skipCry
-.maybeCry
- ld a, [wChannelSoundIDs + Ch5]
- cp CRY_SFX_END
- jr z, .skipCry
- jr c, .cry
- jr .skipCry
-.cry
- ld a, c
- cp Ch5
- jr z, .skipRewind
- call Audio2_GoBackOneCommandIfCry
- ret c
-.skipRewind
- ld a, [wSavedVolume]
- ldh [rNR50], a
- xor a
- ld [wSavedVolume], a
-.skipCry
- ld hl, wChannelSoundIDs
- add hl, bc
- ld [hl], b
+ jp z, .playSoundCommon
+ dec c
+ jp .sfxChannelLoop
+
+.stopAllAudio
+ call StopAllAudio
ret
-Audio2_sound_call:
- cp sound_call_cmd
- jp nz, Audio2_sound_loop
- call Audio2_GetNextMusicByte
- push af
- call Audio2_GetNextMusicByte
- ld d, a
- pop af
- ld e, a
- push de ; store pointer
- ld d, $0
- ld a, c
- add a
+.playSoundCommon
+ ld a, [wSoundID]
+ ld l, a
ld e, a
- ld hl, wChannelCommandPointers
+ ld h, 0
+ ld d, h
+ add hl, hl
add hl, de
- push hl
- ld hl, wChannelReturnAddresses
+ ld de, SFX_Headers_2
add hl, de
ld e, l
ld d, h
- pop hl
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hld]
- ld [de], a ; copy current channel address
- pop de
- ld [hl], e
- inc hl
- ld [hl], d ; overwrite current address with pointer
- ld b, $0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_SOUND_CALL, [hl] ; set the call flag
- jp Audio2_sound_ret
-
-Audio2_sound_loop:
- cp sound_loop_cmd
- jp nz, Audio2_note_type
- call Audio2_GetNextMusicByte
- ld e, a
- and a
- jr z, .infiniteLoop
- ld b, 0
- ld hl, wChannelLoopCounters
- add hl, bc
- ld a, [hl]
- cp e
- jr nz, .loopAgain
- ld a, $1 ; if no more loops to make,
- ld [hl], a
- call Audio2_GetNextMusicByte ; skip pointer
- call Audio2_GetNextMusicByte
- jp Audio2_sound_ret
-.loopAgain ; inc loop count
- inc a
- ld [hl], a
- ; fall through
-.infiniteLoop ; overwrite current address with pointer
- call Audio2_GetNextMusicByte
- push af
- call Audio2_GetNextMusicByte
- ld b, a
- ld d, $0
- ld a, c
- add a
- ld e, a
ld hl, wChannelCommandPointers
- add hl, de
- pop af
- ld [hli], a
- ld [hl], b
- jp Audio2_sound_ret
-
-Audio2_note_type:
- and $f0
- cp note_type_cmd
- jp nz, Audio2_toggle_perfect_pitch
- ld a, d
- and $f
- ld b, $0
- ld hl, wChannelNoteSpeeds
- add hl, bc
- ld [hl], a ; store low nibble as speed
- ld a, c
- cp Ch4
- jr z, .noiseChannel ; noise channel has 0 params
- call Audio2_GetNextMusicByte
- ld d, a
- ld a, c
- cp Ch3
- jr z, .musicChannel3
- cp Ch7
- jr nz, .skipChannel3
- ld hl, wSfxWaveInstrument
- jr .channel3
-.musicChannel3
- ld hl, wMusicWaveInstrument
-.channel3
- ld a, d
- and $f
- ld [hl], a ; store low nibble of param as wave instrument
- ld a, d
- and $30
- sla a
- ld d, a
- ; fall through
-
- ; if channel 3, store high nibble as volume
- ; else, store volume (high nibble) and fade (low nibble)
-.skipChannel3
- ld b, 0
- ld hl, wChannelVolumes
- add hl, bc
- ld [hl], d
-.noiseChannel
- jp Audio2_sound_ret
-
-Audio2_toggle_perfect_pitch:
- ld a, d
- cp toggle_perfect_pitch_cmd
- jr nz, Audio2_vibrato
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- ld a, [hl]
- xor $1
- ld [hl], a ; flip bit 0 of wChannelFlags1
- jp Audio2_sound_ret
-
-Audio2_vibrato:
- cp vibrato_cmd
- jr nz, Audio2_pitch_slide
- call Audio2_GetNextMusicByte
- ld b, 0
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld [hl], a ; store delay
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, bc
- ld [hl], a ; store delay
- call Audio2_GetNextMusicByte
- ld d, a
-
-; The high nybble of the command byte is the extent of the vibrato.
-; Let n be the extent.
-; The upper nybble of the channel's byte in the wChannelVibratoExtents
-; array will store the extent above the note: (n / 2) + (n % 2).
-; The lower nybble will store the extent below the note: (n / 2).
-; These two values add to the total extent, n.
- and $f0
- swap a
- ld b, 0
- ld hl, wChannelVibratoExtents
- add hl, bc
- srl a
- ld e, a
- adc b
- swap a
- or e
- ld [hl], a
-
-; The low nybble of the command byte is the rate of the vibrato.
-; The high and low nybbles of the channel's byte in the wChannelVibratoRates
-; array are both initialised to this value because the high nybble is the
-; counter reload value and the low nybble is the counter itself, which should
-; start at its value upon reload.
- ld a, d
- and $f
- ld d, a
- ld hl, wChannelVibratoRates
- add hl, bc
- swap a
- or d
- ld [hl], a
-
- jp Audio2_sound_ret
-
-Audio2_pitch_slide:
- cp pitch_slide_cmd
- jr nz, Audio2_duty_cycle
- call Audio2_GetNextMusicByte
- ld b, 0
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
- ld [hl], a
- call Audio2_GetNextMusicByte
- ld d, a
- and $f0
- swap a
- ld b, a
- ld a, d
- and $f
- call Audio2_CalculateFrequency
- ld b, 0
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_PITCH_SLIDE_ON, [hl]
- call Audio2_GetNextMusicByte
- ld d, a
- jp Audio2_note_length
-
-Audio2_duty_cycle:
- cp duty_cycle_cmd
- jr nz, Audio2_tempo
- call Audio2_GetNextMusicByte
- rrca
- rrca
- and $c0
- ld b, 0
- ld hl, wChannelDutyCycles
- add hl, bc
- ld [hl], a ; store duty cycle
- jp Audio2_sound_ret
-
-Audio2_tempo:
- cp tempo_cmd
- jr nz, Audio2_stereo_panning
- ld a, c
- cp Ch5
- jr nc, .sfxChannel
- call Audio2_GetNextMusicByte
- ld [wMusicTempo], a ; store first param
- call Audio2_GetNextMusicByte
- ld [wMusicTempo + 1], a ; store second param
- xor a
- ld [wChannelNoteDelayCountersFractionalPart], a ; clear RAM
- ld [wChannelNoteDelayCountersFractionalPart + 1], a
- ld [wChannelNoteDelayCountersFractionalPart + 2], a
- ld [wChannelNoteDelayCountersFractionalPart + 3], a
- jr .musicChannelDone
-.sfxChannel
- call Audio2_GetNextMusicByte
- ld [wSfxTempo], a ; store first param
- call Audio2_GetNextMusicByte
- ld [wSfxTempo + 1], a ; store second param
- xor a
- ld [wChannelNoteDelayCountersFractionalPart + 4], a ; clear RAM
- ld [wChannelNoteDelayCountersFractionalPart + 5], a
- ld [wChannelNoteDelayCountersFractionalPart + 6], a
- ld [wChannelNoteDelayCountersFractionalPart + 7], a
-.musicChannelDone
- jp Audio2_sound_ret
-
-Audio2_stereo_panning:
- cp stereo_panning_cmd
- jr nz, Audio2_unknownmusic0xef
- call Audio2_GetNextMusicByte
- ld [wStereoPanning], a ; store panning
- jp Audio2_sound_ret
-
-; this appears to never be used
-Audio2_unknownmusic0xef:
- cp unknownmusic0xef_cmd
- jr nz, Audio2_duty_cycle_pattern
- call Audio2_GetNextMusicByte
- push bc
- call Audio2_PlaySound
- pop bc
- ld a, [wDisableChannelOutputWhenSfxEnds]
- and a
- jr nz, .skip
- ld a, [wChannelSoundIDs + Ch8]
- ld [wDisableChannelOutputWhenSfxEnds], a
- xor a
- ld [wChannelSoundIDs + Ch8], a
-.skip
- jp Audio2_sound_ret
-
-Audio2_duty_cycle_pattern:
- cp duty_cycle_pattern_cmd
- jr nz, Audio2_volume
- call Audio2_GetNextMusicByte
- ld b, 0
- ld hl, wChannelDutyCyclePatterns
- add hl, bc
- ld [hl], a ; store full pattern
- and %11000000
- ld hl, wChannelDutyCycles
- add hl, bc
- ld [hl], a ; store first duty cycle
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_ROTATE_DUTY_CYCLE, [hl]
- jp Audio2_sound_ret
-
-Audio2_volume:
- cp volume_cmd
- jr nz, Audio2_execute_music
- call Audio2_GetNextMusicByte
- ldh [rNR50], a ; store volume
- jp Audio2_sound_ret
-
-Audio2_execute_music:
- cp execute_music_cmd
- jr nz, Audio2_octave
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- set BIT_EXECUTE_MUSIC, [hl]
- jp Audio2_sound_ret
-
-Audio2_octave:
- and $f0
- cp octave_cmd
- jr nz, Audio2_sfx_note
- ld hl, wChannelOctaves
- ld b, 0
- add hl, bc
- ld a, d
- and $f
- ld [hl], a ; store low nibble as octave
- jp Audio2_sound_ret
-
-; sfx_note is either square_note or noise_note depending on the channel
-Audio2_sfx_note:
- cp sfx_note_cmd
- jr nz, Audio2_pitch_sweep
- ld a, c
- cp Ch4 ; is this a noise or sfx channel?
- jr c, Audio2_pitch_sweep ; no
- ld b, 0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl] ; is execute_music being used?
- jr nz, Audio2_pitch_sweep ; yes
- call Audio2_note_length
-
-; This code seems to do the same thing as what Audio2_ApplyDutyCycleAndSoundLength
-; does below.
- ld d, a
- ld b, 0
- ld hl, wChannelDutyCycles
- add hl, bc
- ld a, [hl]
- or d
- ld d, a
- ld b, REG_DUTY_SOUND_LEN
- call Audio2_GetRegisterPointer
- ld [hl], d
-
- call Audio2_GetNextMusicByte
- ld d, a
- ld b, REG_VOLUME_ENVELOPE
- call Audio2_GetRegisterPointer
- ld [hl], d
- call Audio2_GetNextMusicByte
- ld e, a
- ld a, c
- cp Ch8
- ld a, 0
- jr z, .skip
-; Channels 1 through 3 have 2 registers that control frequency, but the noise
-; channel a single register (the polynomial counter) that controls frequency,
-; so this command has one less byte on the noise channel.
- push de
- call Audio2_GetNextMusicByte
- pop de
-.skip
- ld d, a
- push de
- call Audio2_ApplyDutyCycleAndSoundLength
- call Audio2_EnableChannelOutput
- pop de
- call Audio2_ApplyWavePatternAndFrequency
- ret
-
-Audio2_pitch_sweep:
- ld a, c
- cp Ch5
- jr c, Audio2_note ; if not a sfx
- ld a, d
- cp pitch_sweep_cmd
- jr nz, Audio2_note
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio2_note ; no
- call Audio2_GetNextMusicByte
- ldh [rNR10], a
- jp Audio2_sound_ret
-
-Audio2_note:
- ld a, c
- cp Ch4
- jr nz, Audio2_note_length ; if not noise channel
- ld a, d
- and $f0
- cp drum_note_cmd
- jr z, .drum_note
- jr nc, Audio2_note_length
-
- ; this executes when on the noise channel and
- ; the command id is less than drum_note_cmd ($b0)
- ; in this case, the upper nybble is used as the noise instrument ($1-$a)
- ; and the lower nybble is the length minus 1 (0-15)
- ; however, this doesn't work for instrument #2 because the command id
- ; is captured by the noise_note command (command id $2x)
- ; this essentially acts like a drum_note command that is only 1 byte
- ; instead of 2 and can only be used with instruments 1 and 3 through 10
- ; this is unused by the game
- swap a
+ ld a, [de] ; get channel number
ld b, a
- ld a, d
- and $f
- ld d, a
+ rlca
+ rlca
+ and $3
+ ld c, a
ld a, b
- push de
- push bc
- jr .playDnote
-
-.drum_note
- ld a, d
and $f
+ ld b, c
+ inc b
+ inc de
+ ld c, 0
+.commandPointerLoop
+ cp c
+ jr z, .next
+ inc c
+ inc hl
+ inc hl
+ jr .commandPointerLoop
+.next
push af
+ push hl
push bc
- call Audio2_GetNextMusicByte ; get drum_note instrument
-.playDnote
- ld d, a
- ld a, [wDisableChannelOutputWhenSfxEnds]
- and a
- jr nz, .skipDnote
- ld a, d
- call Audio2_PlaySound
-.skipDnote
- pop bc
- pop de
-
-Audio2_note_length:
- ld a, d
- push af
- and $f
- inc a
- ld b, 0
- ld e, a ; store note length (in 16ths)
- ld d, b
- ld hl, wChannelNoteSpeeds
- add hl, bc
- ld a, [hl]
- ld l, b
- call Audio2_MultiplyAdd
- ld a, c
- cp Ch5
- jr nc, .sfxChannel
- ld a, [wMusicTempo]
- ld d, a
- ld a, [wMusicTempo + 1]
- ld e, a
- jr .skip
-.sfxChannel
- ld d, $1
- ld e, $0
- cp Ch8
- jr z, .skip ; if noise channel
- call Audio2_SetSfxTempo
- ld a, [wSfxTempo]
- ld d, a
- ld a, [wSfxTempo + 1]
- ld e, a
-.skip
- ld a, l ; a = note_length * note_speed
ld b, 0
- ld hl, wChannelNoteDelayCountersFractionalPart
- add hl, bc
- ld l, [hl]
- call Audio2_MultiplyAdd
- ld e, l
- ld d, h ; de = note_delay_frac_part + (note_length * note_speed * tempo)
- ld hl, wChannelNoteDelayCountersFractionalPart
- add hl, bc
- ld [hl], e
- ld a, d
- ld hl, wChannelNoteDelayCounters
- add hl, bc
- ld [hl], a
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio2_note_pitch
+ ld c, a
+ cp Ch4
+ jr c, .skipSettingFlag
ld hl, wChannelFlags1
add hl, bc
- bit BIT_NOISE_OR_SFX, [hl]
- jr z, Audio2_note_pitch
+ set BIT_NOISE_OR_SFX, [hl]
+.skipSettingFlag
+ pop bc
pop hl
- ret
-
-Audio2_note_pitch:
+ ld a, [de] ; get channel pointer
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ inc de
pop af
- and $f0
- cp rest_cmd
- jr nz, .notRest
- ld a, c
- cp Ch5
- jr nc, .next
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
- and a
- jr nz, .done
- ; fall through
-.next
- ld a, c
- cp Ch3
- jr z, .channel3
- cp Ch7
- jr nz, .notChannel3
-.channel3
+ push hl
+ push bc
ld b, 0
- ld hl, Audio2_HWChannelDisableMasks
+ ld c, a
+ ld hl, wChannelSoundIDs
add hl, bc
- ldh a, [rNR51]
- and [hl]
- ldh [rNR51], a ; disable hardware channel 3's output
- jr .done
-.notChannel3
- ld b, REG_VOLUME_ENVELOPE
- call Audio2_GetRegisterPointer
- ld a, $8 ; fade in sound
- ld [hli], a
- inc hl
- ld a, $80 ; restart sound
+ ld a, [wSoundID]
ld [hl], a
-.done
- ret
-.notRest
- swap a
- ld b, 0
- ld hl, wChannelOctaves
- add hl, bc
- ld b, [hl]
- call Audio2_CalculateFrequency
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_ON, [hl]
- jr z, .skipPitchSlide
- call Audio2_InitPitchSlideVars
-.skipPitchSlide
- push de
- ld a, c
- cp Ch5
- jr nc, .sfxChannel ; if sfx channel
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- ld d, 0
- ld e, a
- add hl, de
- ld a, [hl]
- and a
- jr nz, .noSfx
- jr .sfxChannel
-.noSfx
- pop de
- ret
-.sfxChannel
- ld b, 0
- ld hl, wChannelVolumes
- add hl, bc
- ld d, [hl]
- ld b, REG_VOLUME_ENVELOPE
- call Audio2_GetRegisterPointer
- ld [hl], d
- call Audio2_ApplyDutyCycleAndSoundLength
- call Audio2_EnableChannelOutput
- pop de
- ld b, $0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
- jr z, .skipFrequencyInc
- inc e ; if yes, increment the frequency by 1
- jr nc, .skipFrequencyInc
- inc d
-.skipFrequencyInc
- ld hl, wChannelFrequencyLowBytes
- add hl, bc
- ld [hl], e
- call Audio2_ApplyWavePatternAndFrequency
- ret
-
-Audio2_EnableChannelOutput:
- ld b, 0
- ld hl, Audio2_HWChannelEnableMasks
- add hl, bc
- ldh a, [rNR51]
- or [hl] ; set this channel's bits
- ld d, a
- ld a, c
- cp Ch8
- jr z, .noiseChannelOrNoSfx
- cp Ch5
- jr nc, .skip ; if sfx channel
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
+ pop bc
+ pop hl
+ inc c
+ dec b
+ ld a, b
and a
- jr nz, .skip
-.noiseChannelOrNoSfx
-; If this is the SFX noise channel or a music channel whose corresponding
-; SFX channel is off, apply stereo panning.
- ld a, [wStereoPanning]
- ld hl, Audio2_HWChannelEnableMasks
- add hl, bc
- and [hl]
- ld d, a
- ldh a, [rNR51]
- ld hl, Audio2_HWChannelDisableMasks
- add hl, bc
- and [hl] ; reset this channel's output bits
- or d ; set this channel's output bits that enabled in [wStereoPanning]
- ld d, a
-.skip
- ld a, d
- ldh [rNR51], a
- ret
-
-Audio2_ApplyDutyCycleAndSoundLength:
- ld b, 0
- ld hl, wChannelNoteDelayCounters ; use the note delay as sound length
- add hl, bc
- ld d, [hl]
- ld a, c
- cp Ch3
- jr z, .skipDuty ; if music channel 3
- cp Ch7
- jr z, .skipDuty ; if sfx channel 3
-; include duty cycle (except on channel 3 which doesn't have it)
- ld a, d
- and $3f
- ld d, a
- ld hl, wChannelDutyCycles
- add hl, bc
- ld a, [hl]
- or d
- ld d, a
-.skipDuty
- ld b, REG_DUTY_SOUND_LEN
- call Audio2_GetRegisterPointer
- ld [hl], d
- ret
-
-Audio2_ApplyWavePatternAndFrequency:
- ld a, c
- cp Ch3
- jr z, .channel3
- cp Ch7
- jr nz, .notChannel3
- ; fall through
-.channel3
- push de
- ld de, wMusicWaveInstrument
- cp Ch3
- jr z, .next
- ld de, wSfxWaveInstrument
-.next
- ld a, [de]
- add a
- ld d, 0
- ld e, a
- ld hl, Audio2_WavePointers
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld hl, rWave_0
- ld b, $f
- ld a, $0 ; stop hardware channel 3
- ldh [rNR30], a
-.loop
ld a, [de]
inc de
- ld [hli], a
- ld a, b
- dec b
- and a
- jr nz, .loop
- ld a, $80 ; start hardware channel 3
- ldh [rNR30], a
- pop de
-.notChannel3
- ld a, d
- or $80 ; use counter mode (i.e. disable output when the counter reaches 0)
- and $c7 ; zero the unused bits in the register
- ld d, a
- ld b, REG_FREQUENCY_LO
- call Audio2_GetRegisterPointer
- ld [hl], e ; store frequency low byte
- inc hl
- ld [hl], d ; store frequency high byte
- ; --- this section is only present in this copy of the sound engine
- ld a, c
- cp Ch5
- jr c, .musicChannel
- call Audio2_ApplyFrequencyModifier
-.musicChannel
- ; ---
- ret
-
-; --- this section is only present in this copy of the sound engine
-; unused
-Audio2_ResetCryModifiers:
- ld a, c
- cp Ch5
- jr nz, .skip
- ld a, [wLowHealthAlarm]
- bit 7, a
- jr z, .skip
- xor a
- ld [wFrequencyModifier], a
- ld a, $80
- ld [wTempoModifier], a
-.skip
- ret
-; ---
-
-Audio2_SetSfxTempo:
- call Audio2_IsCry
- jr c, .skipCryCheck
- call Audio2_IsBattleSFX
- jr nc, .notCry
-.skipCryCheck
- ld d, 0
- ld a, [wTempoModifier]
- add $80
- jr nc, .next
- inc d
-.next
- ld [wSfxTempo + 1], a
- ld a, d
- ld [wSfxTempo], a
- jr .done
-.notCry
- xor a
- ld [wSfxTempo + 1], a
- ld a, $1
- ld [wSfxTempo], a
-.done
- ret
-
-Audio2_ApplyFrequencyModifier:
- call Audio2_IsCry
- jr c, .skipCryCheck
- call Audio2_IsBattleSFX
- jr nc, .done
-.skipCryCheck
-; if playing a cry, add the cry's frequency modifier
- ld a, [wFrequencyModifier]
- add e
- jr nc, .noCarry
- inc d
-.noCarry
- dec hl
- ld e, a
- ld [hl], e
- inc hl
- ld [hl], d
-.done
- ret
-
-Audio2_GoBackOneCommandIfCry:
- call Audio2_IsCry
- jr nc, .done
- ld hl, wChannelCommandPointers
- ld e, c
- ld d, 0
- sla e
- rl d
- add hl, de
- ld a, [hl]
- sub 1
- ld [hl], a
- inc hl
- ld a, [hl]
- sbc 0
- ld [hl], a
- scf
- ret
-.done
- scf
- ccf
- ret
-
-Audio2_IsCry:
-; Returns whether the currently playing audio is a cry in carry.
- ld a, [wChannelSoundIDs + Ch5]
+ jr nz, .commandPointerLoop
+ ld a, [wSoundID]
cp CRY_SFX_START
- jr nc, .next
- jr .no
-.next
+ jr nc, .maybeCry
+ jr .done
+.maybeCry
+ ld a, [wSoundID]
cp CRY_SFX_END
- jr z, .no
- jr c, .yes
-.no
- scf
- ccf
- ret
-.yes
- scf
- ret
-
-; --- this section is only present in this copy of the sound engine
-Audio2_IsBattleSFX:
-; Returns whether the currently playing audio is a cry in carry.
- ld a, [wChannelSoundIDs + Ch8]
- ld b, a
- ld a, [wChannelSoundIDs + Ch5]
- or b
- cp BATTLE_SFX_START
- jr nc, .next
- jr .no
-.next
- cp BATTLE_SFX_END
- jr z, .no
- jr c, .yes
-.no
- scf
- ccf
- ret
-.yes
- scf
- ret
-; ---
-
-Audio2_ApplyPitchSlide:
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_DECREASING, [hl]
- jp nz, .frequencyDecreasing
-; frequency increasing
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld e, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld l, [hl]
- ld h, b
- add hl, de
- ld d, h
- ld e, l
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, bc
- push hl
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld a, [hl]
- pop hl
- add [hl]
- ld [hl], a
- ld a, 0
- adc e
- ld e, a
- ld a, 0
- adc d
- ld d, a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, [hl]
- cp d
- jp c, .reachedTargetFrequency
- jr nz, .applyUpdatedFrequency
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- cp e
- jp c, .reachedTargetFrequency
- jr .applyUpdatedFrequency
-.frequencyDecreasing
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld e, [hl]
- sub e
- ld e, a
- ld a, d
- sbc b
- ld d, a
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld a, [hl]
- add a
- ld [hl], a
- ld a, e
- sbc b
- ld e, a
- ld a, d
- sbc b
- ld d, a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, d
- cp [hl]
- jr c, .reachedTargetFrequency
- jr nz, .applyUpdatedFrequency
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, e
- cp [hl]
- jr c, .reachedTargetFrequency
-.applyUpdatedFrequency
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld b, REG_FREQUENCY_LO
- call Audio2_GetRegisterPointer
- ld a, e
+ jr z, .done
+ jr c, .cry
+ jr .done
+.cry
+ ld hl, wChannelSoundIDs + Ch5
+ ld [hli], a
+ ld [hli], a
ld [hli], a
- ld [hl], d
- ret
-.reachedTargetFrequency
-; Turn off pitch slide when the target frequency has been reached.
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_ON, [hl]
- res BIT_PITCH_SLIDE_DECREASING, [hl]
- ret
-
-Audio2_InitPitchSlideVars:
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld hl, wChannelNoteDelayCounters
- add hl, bc
- ld a, [hl]
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
- sub [hl]
- jr nc, .next
- ld a, 1
-.next
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, e
- sub [hl]
- ld e, a
- ld a, d
- sbc b
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- sub [hl]
- jr c, .targetFrequencyGreater
- ld d, a
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_PITCH_SLIDE_DECREASING, [hl]
- jr .next2
-.targetFrequencyGreater
-; If the target frequency is greater, subtract the current frequency from
-; the target frequency to get the absolute difference.
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld e, [hl]
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- sub e
- ld e, a
-
-; Bug. Instead of borrowing from the high byte of the target frequency as it
-; should, it borrows from the high byte of the current frequency instead.
-; This means that the result will be 0x200 greater than it should be if the
-; low byte of the current frequency is greater than the low byte of the
-; target frequency.
- ld a, d
- sbc b
- ld d, a
-
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, [hl]
- sub d
- ld d, a
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_DECREASING, [hl]
-
-.next2
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
-.divideLoop
- inc b
- ld a, e
- sub [hl]
- ld e, a
- jr nc, .divideLoop
- ld a, d
- and a
- jr z, .doneDividing
- dec a
- ld d, a
- jr .divideLoop
-.doneDividing
- ld a, e ; a = remainder - dividend
- add [hl]
- ld d, b ; d = quotient + 1
- ld b, 0
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld [hl], d ; store quotient + 1
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld [hl], a ; store remainder - dividend
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, bc
- ld [hl], a ; store remainder - dividend
- ret
-
-Audio2_ApplyDutyCyclePattern:
- ld b, 0
- ld hl, wChannelDutyCyclePatterns
- add hl, bc
- ld a, [hl]
- rlca
- rlca
- ld [hl], a
- and $c0
- ld d, a
- ld b, REG_DUTY_SOUND_LEN
- call Audio2_GetRegisterPointer
- ld a, [hl]
- and $3f
- or d
ld [hl], a
- ret
-
-Audio2_GetNextMusicByte:
- ld d, 0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- ld a, [hli]
- ld e, a
- ld a, [hld]
- ld d, a
- ld a, [de] ; get next music command
- inc de
- ld [hl], e ; store address of next command
+ ld hl, wChannelCommandPointers + Ch7 * 2 ; sfx wave channel pointer
+ ld de, Audio2_CryRet
+ ld [hl], e
inc hl
- ld [hl], d
- ret
-
-Audio2_GetRegisterPointer:
-; hl = address of hardware sound register b for software channel c
- ld a, c
- ld hl, Audio2_HWChannelBaseAddresses
- add l
- jr nc, .noCarry
- inc h
-.noCarry
- ld l, a
- ld a, [hl]
- add b
- ld l, a
- ld h, $ff
- ret
-
-Audio2_MultiplyAdd:
-; hl = l + (a * de)
- ld h, 0
-.loop
- srl a
- jr nc, .skipAdd
- add hl, de
-.skipAdd
- sla e
- rl d
+ ld [hl], d ; overwrite pointer to point to sound_ret
+ ld a, [wSavedVolume]
and a
- jr z, .done
- jr .loop
+ jr nz, .done
+ ldh a, [rNR50]
+ ld [wSavedVolume], a
+ ld a, $77
+ ldh [rNR50], a
.done
ret
-Audio2_CalculateFrequency:
-; return the frequency for note a, octave b in de
- ld h, 0
- ld l, a
- add hl, hl
- ld d, h
- ld e, l
- ld hl, Audio2_Pitches
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld a, b
-.loop
- cp 7
- jr z, .done
- sra d
- rr e
- inc a
- jr .loop
-.done
- ld a, 8
- add d
- ld d, a
- ret
+Audio2_CryRet:
+ sound_ret
-Audio2_PlaySound::
- ld [wSoundID], a
- cp SFX_STOP_ALL_MUSIC
- jp z, .stopAllAudio
- cp MAX_SFX_ID_2
- jp z, .playSfx
- jp c, .playSfx
- cp $fe
- jr z, .playMusic
- jp nc, .playSfx
+INCLUDE "audio/poke_flute.asm"
-.playMusic
+INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm"
+
+Audio2_InitMusicVariables::
xor a
ld [wUnusedC000], a
ld [wDisableChannelOutputWhenSfxEnds], a
@@ -1411,53 +205,53 @@ Audio2_PlaySound::
ld [wSfxWaveInstrument], a
ld d, NUM_CHANNELS
ld hl, wChannelReturnAddresses
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelCommandPointers
- call .FillMem
+ call Audio2_FillMem
ld d, NUM_MUSIC_CHANS
ld hl, wChannelSoundIDs
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelFlags1
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelDutyCycles
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelDutyCyclePatterns
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelVibratoDelayCounters
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelVibratoExtents
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelVibratoRates
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelFrequencyLowBytes
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelVibratoDelayCounterReloadValues
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelFlags2
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideLengthModifiers
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideFrequencySteps
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- call .FillMem
+ call Audio2_FillMem
ld a, $1
ld hl, wChannelLoopCounters
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelNoteDelayCounters
- call .FillMem
+ call Audio2_FillMem
ld hl, wChannelNoteSpeeds
- call .FillMem
+ call Audio2_FillMem
ld [wMusicTempo], a
ld a, $ff
ld [wStereoPanning], a
@@ -1473,67 +267,9 @@ Audio2_PlaySound::
ldh [rNR30], a
ld a, $77
ldh [rNR50], a
- jp .playSoundCommon
-
-.playSfx
- ld l, a
- ld e, a
- ld h, 0
- ld d, h
- add hl, hl
- add hl, de
- ld de, SFX_Headers_2
- add hl, de
- ld a, h
- ld [wSfxHeaderPointer], a
- ld a, l
- ld [wSfxHeaderPointer + 1], a
- ld a, [hl]
- and $c0
- rlca
- rlca
- ld c, a
-.sfxChannelLoop
- ld d, c
- ld a, c
- add a
- add c
- ld c, a
- ld b, 0
- ld a, [wSfxHeaderPointer]
- ld h, a
- ld a, [wSfxHeaderPointer + 1]
- ld l, a
- add hl, bc
- ld c, d
- ld a, [hl]
- and $f
- ld e, a ; software channel ID
- ld d, 0
- ld hl, wChannelSoundIDs
- add hl, de
- ld a, [hl]
- and a
- jr z, .playChannel
- ld a, e
- cp Ch8
- jr nz, .notNoiseChannel
- ld a, [wSoundID]
- cp NOISE_INSTRUMENTS_END
- jr nc, .notNoiseInstrument
- ret
-.notNoiseInstrument
- ld a, [hl]
- cp NOISE_INSTRUMENTS_END
- jr z, .playChannel
- jr c, .playChannel
-.notNoiseChannel
- ld a, [wSoundID]
- cp [hl]
- jr z, .playChannel
- jr c, .playChannel
ret
-.playChannel
+
+Audio2_InitSFXVariables::
xor a
push de
ld h, d
@@ -1616,17 +352,12 @@ Audio2_PlaySound::
ld [hl], a
ld a, e
cp Ch5
- jr nz, .skipSweepDisable
+ ret nz
ld a, $8
ldh [rNR10], a ; sweep off
-.skipSweepDisable
- ld a, c
- and a
- jp z, .playSoundCommon
- dec c
- jp .sfxChannelLoop
+ ret
-.stopAllAudio
+Audio2_StopAllAudio::
ld a, $80
ldh [rNR52], a ; sound hardware on
ldh [rNR30], a ; wave playback on
@@ -1652,13 +383,13 @@ Audio2_PlaySound::
ld [wSfxTempo + 1], a
ld [wMusicWaveInstrument], a
ld [wSfxWaveInstrument], a
- ld d, $a0
+ ld d, $b0
ld hl, wChannelCommandPointers
- call .FillMem
+ call Audio2_FillMem
ld a, $1
ld d, $18
ld hl, wChannelNoteDelayCounters
- call .FillMem
+ call Audio2_FillMem
ld [wMusicTempo], a
ld [wSfxTempo], a
ld a, $ff
@@ -1666,124 +397,10 @@ Audio2_PlaySound::
ret
; fills d bytes at hl with a
-.FillMem
+Audio2_FillMem:
ld b, d
.loop
ld [hli], a
dec b
jr nz, .loop
ret
-
-.playSoundCommon
- ld a, [wSoundID]
- ld l, a
- ld e, a
- ld h, 0
- ld d, h
- add hl, hl
- add hl, de
- ld de, SFX_Headers_2
- add hl, de
- ld e, l
- ld d, h
- ld hl, wChannelCommandPointers
- ld a, [de] ; get channel number
- ld b, a
- rlca
- rlca
- and $3
- ld c, a
- ld a, b
- and $f
- ld b, c
- inc b
- inc de
- ld c, 0
-.commandPointerLoop
- cp c
- jr z, .next
- inc c
- inc hl
- inc hl
- jr .commandPointerLoop
-.next
- push hl
- push bc
- push af
- ld b, 0
- ld c, a
- ld hl, wChannelSoundIDs
- add hl, bc
- ld a, [wSoundID]
- ld [hl], a
- pop af
- cp Ch4
- jr c, .skipSettingFlag
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_NOISE_OR_SFX, [hl]
-.skipSettingFlag
- pop bc
- pop hl
- ld a, [de] ; get channel pointer
- ld [hli], a
- inc de
- ld a, [de]
- ld [hli], a
- inc de
- inc c
- dec b
- ld a, b
- and a
- ld a, [de]
- inc de
- jr nz, .commandPointerLoop
- ld a, [wSoundID]
- cp CRY_SFX_START
- jr nc, .maybeCry
- jr .done
-.maybeCry
- ld a, [wSoundID]
- cp CRY_SFX_END
- jr z, .done
- jr c, .cry
- jr .done
-.cry
- ld hl, wChannelSoundIDs + Ch5
- ld [hli], a
- ld [hli], a
- ld [hli], a
- ld [hl], a
- ld hl, wChannelCommandPointers + Ch7 * 2 ; sfx wave channel pointer
- ld de, Audio2_CryRet
- ld [hl], e
- inc hl
- ld [hl], d ; overwrite pointer to point to sound_ret
- ld a, [wSavedVolume]
- and a
- jr nz, .done
- ldh a, [rNR50]
- ld [wSavedVolume], a
- ld a, $77
- ldh [rNR50], a ; full volume
-.done
- ret
-
-Audio2_CryRet:
- sound_ret
-
-Audio2_HWChannelBaseAddresses:
-; the low bytes of each HW channel's base address
- db HW_CH1_BASE, HW_CH2_BASE, HW_CH3_BASE, HW_CH4_BASE ; channels 0-3
- db HW_CH1_BASE, HW_CH2_BASE, HW_CH3_BASE, HW_CH4_BASE ; channels 4-7
-
-Audio2_HWChannelDisableMasks:
- db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 0-3
- db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 4-7
-
-Audio2_HWChannelEnableMasks:
- db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 0-3
- db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 4-7
-
-Audio2_Pitches:
-INCLUDE "audio/notes.asm"
diff --git a/audio/engine_3.asm b/audio/engine_3.asm
index 57618486..06698ca5 100644
--- a/audio/engine_3.asm
+++ b/audio/engine_3.asm
@@ -1,1415 +1,19 @@
-; The third of three duplicated sound engines.
-
-Audio3_UpdateMusic::
- ld c, Ch1
-.loop
- ld b, 0
- ld hl, wChannelSoundIDs
- add hl, bc
- ld a, [hl]
- and a
- jr z, .nextChannel
- ld a, c
- cp Ch5
- jr nc, .applyAffects ; if sfx channel
- ld a, [wMuteAudioAndPauseMusic]
- and a
- jr z, .applyAffects
- bit 7, a
- jr nz, .nextChannel
- set 7, a
- ld [wMuteAudioAndPauseMusic], a
- xor a ; disable all channels' output
- ldh [rNR51], a
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
- jr .nextChannel
-.applyAffects
- call Audio3_ApplyMusicAffects
-.nextChannel
- ld a, c
- inc c ; inc channel number
- cp Ch8
- jr nz, .loop
- ret
-
-; this routine checks flags for music effects currently applied
-; to the channel and calls certain functions based on flags.
-Audio3_ApplyMusicAffects:
- ld b, $0
- ld hl, wChannelNoteDelayCounters ; delay until next note
- add hl, bc
- ld a, [hl]
- cp 1 ; if the delay is 1, play next note
- jp z, Audio3_PlayNextNote
- dec a ; otherwise, decrease the delay timer
- ld [hl], a
- ld a, c
- cp Ch5
- jr nc, .startChecks ; if a sfx channel
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
- and a
- jr z, .startChecks
- ret
-.startChecks
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_ROTATE_DUTY_CYCLE, [hl]
- jr z, .checkForExecuteMusic
- call Audio3_ApplyDutyCyclePattern
-.checkForExecuteMusic
- ld b, 0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, .checkForPitchSlide
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_NOISE_OR_SFX, [hl]
- jr nz, .skipPitchSlideVibrato
-.checkForPitchSlide
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_ON, [hl]
- jr z, .checkVibratoDelay
- jp Audio3_ApplyPitchSlide
-.checkVibratoDelay
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld a, [hl]
- and a ; check if delay is over
- jr z, .checkForVibrato
- dec [hl] ; otherwise, dec delay
-.skipPitchSlideVibrato
- ret
-.checkForVibrato
- ld hl, wChannelVibratoExtents
- add hl, bc
- ld a, [hl]
- and a
- jr nz, .vibrato
- ret ; no vibrato
-.vibrato
- ld d, a
- ld hl, wChannelVibratoRates
- add hl, bc
- ld a, [hl]
- and $f
- and a
- jr z, .applyVibrato
- dec [hl] ; decrement counter
- ret
-.applyVibrato
- ld a, [hl]
- swap [hl]
- or [hl]
- ld [hl], a ; reload the counter
- ld hl, wChannelFrequencyLowBytes
- add hl, bc
- ld e, [hl] ; get note pitch
- ld hl, wChannelFlags1
- add hl, bc
-; This is the only code that sets/resets the vibrato direction bit, so it
-; continuously alternates which path it takes.
- bit BIT_VIBRATO_DIRECTION, [hl]
- jr z, .unset
- res BIT_VIBRATO_DIRECTION, [hl]
- ld a, d
- and $f
- ld d, a
- ld a, e
- sub d
- jr nc, .noCarry
- ld a, 0
-.noCarry
- jr .done
-.unset
- set BIT_VIBRATO_DIRECTION, [hl]
- ld a, d
- and $f0
- swap a
- add e
- jr nc, .done
- ld a, $ff
-.done
- ld d, a
- ld b, REG_FREQUENCY_LO
- call Audio3_GetRegisterPointer
- ld [hl], d
- ret
-
-; this routine executes all music commands that take up no time,
-; like tempo changes, duty cycle changes etc. and doesn't return
-; until the first note is reached
-Audio3_PlayNextNote:
-; reload the vibrato delay counter
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, bc
- ld a, [hl]
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld [hl], a
-
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_ON, [hl]
- res BIT_PITCH_SLIDE_DECREASING, [hl]
- call Audio3_sound_ret
- ret
-
-Audio3_sound_ret:
- call Audio3_GetNextMusicByte
- ld d, a
- cp sound_ret_cmd
- jp nz, Audio3_sound_call
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_SOUND_CALL, [hl]
- jr nz, .returnFromCall
- ld a, c
- cp Ch4
- jr nc, .noiseOrSfxChannel
- jr .disableChannelOutput
-.noiseOrSfxChannel
- res BIT_NOISE_OR_SFX, [hl]
- ld hl, wChannelFlags2
- add hl, bc
- res BIT_EXECUTE_MUSIC, [hl]
- cp Ch7
- jr nz, .skipSfxChannel3
-; restart hardware channel 3 (wave channel) output
- ld a, $0
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
-.skipSfxChannel3
- jr nz, .dontDisable
- ld a, [wDisableChannelOutputWhenSfxEnds]
- and a
- jr z, .dontDisable
- xor a
- ld [wDisableChannelOutputWhenSfxEnds], a
- jr .disableChannelOutput
-.dontDisable
- jr .afterDisable
-.returnFromCall
- res 1, [hl]
- ld d, $0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- push hl ; store current channel address
- ld hl, wChannelReturnAddresses
- add hl, de
- ld e, l
- ld d, h
- pop hl
- ld a, [de]
- ld [hli], a
- inc de
- ld a, [de]
- ld [hl], a ; loads channel address to return to
- jp Audio3_sound_ret
-.disableChannelOutput
- ld hl, Audio3_HWChannelDisableMasks
- add hl, bc
- ldh a, [rNR51]
- and [hl]
- ldh [rNR51], a
-.afterDisable
- ld a, [wChannelSoundIDs + Ch5]
- cp CRY_SFX_START
- jr nc, .maybeCry
- jr .skipCry
-.maybeCry
- ld a, [wChannelSoundIDs + Ch5]
- cp CRY_SFX_END
- jr z, .skipCry
- jr c, .cry
- jr .skipCry
-.cry
- ld a, c
- cp Ch5
- jr z, .skipRewind
- call Audio3_GoBackOneCommandIfCry
- ret c
-.skipRewind
- ld a, [wSavedVolume]
- ldh [rNR50], a
- xor a
- ld [wSavedVolume], a
-.skipCry
- ld hl, wChannelSoundIDs
- add hl, bc
- ld [hl], b
- ret
-
-Audio3_sound_call:
- cp sound_call_cmd
- jp nz, Audio3_sound_loop
- call Audio3_GetNextMusicByte
- push af
- call Audio3_GetNextMusicByte
- ld d, a
- pop af
- ld e, a
- push de ; store pointer
- ld d, $0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- push hl
- ld hl, wChannelReturnAddresses
- add hl, de
- ld e, l
- ld d, h
- pop hl
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hld]
- ld [de], a ; copy current channel address
- pop de
- ld [hl], e
- inc hl
- ld [hl], d ; overwrite current address with pointer
- ld b, $0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_SOUND_CALL, [hl] ; set the call flag
- jp Audio3_sound_ret
-
-Audio3_sound_loop:
- cp sound_loop_cmd
- jp nz, Audio3_note_type
- call Audio3_GetNextMusicByte
- ld e, a
- and a
- jr z, .infiniteLoop
- ld b, 0
- ld hl, wChannelLoopCounters
- add hl, bc
- ld a, [hl]
- cp e
- jr nz, .loopAgain
- ld a, $1 ; if no more loops to make,
- ld [hl], a
- call Audio3_GetNextMusicByte ; skip pointer
- call Audio3_GetNextMusicByte
- jp Audio3_sound_ret
-.loopAgain ; inc loop count
- inc a
- ld [hl], a
- ; fall through
-.infiniteLoop ; overwrite current address with pointer
- call Audio3_GetNextMusicByte
- push af
- call Audio3_GetNextMusicByte
- ld b, a
- ld d, $0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- pop af
- ld [hli], a
- ld [hl], b
- jp Audio3_sound_ret
-
-Audio3_note_type:
- and $f0
- cp note_type_cmd
- jp nz, Audio3_toggle_perfect_pitch
- ld a, d
- and $f
- ld b, $0
- ld hl, wChannelNoteSpeeds
- add hl, bc
- ld [hl], a ; store low nibble as speed
- ld a, c
- cp Ch4
- jr z, .noiseChannel ; noise channel has 0 params
- call Audio3_GetNextMusicByte
- ld d, a
- ld a, c
- cp Ch3
- jr z, .musicChannel3
- cp Ch7
- jr nz, .skipChannel3
- ld hl, wSfxWaveInstrument
- jr .channel3
-.musicChannel3
- ld hl, wMusicWaveInstrument
-.channel3
- ld a, d
- and $f
- ld [hl], a ; store low nibble of param as wave instrument
- ld a, d
- and $30
- sla a
- ld d, a
- ; fall through
-
- ; if channel 3, store high nibble as volume
- ; else, store volume (high nibble) and fade (low nibble)
-.skipChannel3
- ld b, 0
- ld hl, wChannelVolumes
- add hl, bc
- ld [hl], d
-.noiseChannel
- jp Audio3_sound_ret
-
-Audio3_toggle_perfect_pitch:
- ld a, d
- cp toggle_perfect_pitch_cmd
- jr nz, Audio3_vibrato
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- ld a, [hl]
- xor $1
- ld [hl], a ; flip bit 0 of wChannelFlags1
- jp Audio3_sound_ret
-
-Audio3_vibrato:
- cp vibrato_cmd
- jr nz, Audio3_pitch_slide
- call Audio3_GetNextMusicByte
- ld b, 0
- ld hl, wChannelVibratoDelayCounters
- add hl, bc
- ld [hl], a ; store delay
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, bc
- ld [hl], a ; store delay
- call Audio3_GetNextMusicByte
- ld d, a
-
-; The high nybble of the command byte is the extent of the vibrato.
-; Let n be the extent.
-; The upper nybble of the channel's byte in the wChannelVibratoExtents
-; array will store the extent above the note: (n / 2) + (n % 2).
-; The lower nybble will store the extent below the note: (n / 2).
-; These two values add to the total extent, n.
- and $f0
- swap a
- ld b, 0
- ld hl, wChannelVibratoExtents
- add hl, bc
- srl a
- ld e, a
- adc b
- swap a
- or e
- ld [hl], a
-
-; The low nybble of the command byte is the rate of the vibrato.
-; The high and low nybbles of the channel's byte in the wChannelVibratoRates
-; array are both initialised to this value because the high nybble is the
-; counter reload value and the low nybble is the counter itself, which should
-; start at its value upon reload.
- ld a, d
- and $f
- ld d, a
- ld hl, wChannelVibratoRates
- add hl, bc
- swap a
- or d
- ld [hl], a
-
- jp Audio3_sound_ret
-
-Audio3_pitch_slide:
- cp pitch_slide_cmd
- jr nz, Audio3_duty_cycle
- call Audio3_GetNextMusicByte
- ld b, 0
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
- ld [hl], a
- call Audio3_GetNextMusicByte
- ld d, a
- and $f0
- swap a
- ld b, a
- ld a, d
- and $f
- call Audio3_CalculateFrequency
- ld b, 0
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_PITCH_SLIDE_ON, [hl]
- call Audio3_GetNextMusicByte
- ld d, a
- jp Audio3_note_length
-
-Audio3_duty_cycle:
- cp duty_cycle_cmd
- jr nz, Audio3_tempo
- call Audio3_GetNextMusicByte
- rrca
- rrca
- and $c0
- ld b, 0
- ld hl, wChannelDutyCycles
- add hl, bc
- ld [hl], a ; store duty cycle
- jp Audio3_sound_ret
-
-Audio3_tempo:
- cp tempo_cmd
- jr nz, Audio3_stereo_panning
- ld a, c
- cp Ch5
- jr nc, .sfxChannel
- call Audio3_GetNextMusicByte
- ld [wMusicTempo], a ; store first param
- call Audio3_GetNextMusicByte
- ld [wMusicTempo + 1], a ; store second param
- xor a
- ld [wChannelNoteDelayCountersFractionalPart], a ; clear RAM
- ld [wChannelNoteDelayCountersFractionalPart + 1], a
- ld [wChannelNoteDelayCountersFractionalPart + 2], a
- ld [wChannelNoteDelayCountersFractionalPart + 3], a
- jr .musicChannelDone
-.sfxChannel
- call Audio3_GetNextMusicByte
- ld [wSfxTempo], a ; store first param
- call Audio3_GetNextMusicByte
- ld [wSfxTempo + 1], a ; store second param
- xor a
- ld [wChannelNoteDelayCountersFractionalPart + 4], a ; clear RAM
- ld [wChannelNoteDelayCountersFractionalPart + 5], a
- ld [wChannelNoteDelayCountersFractionalPart + 6], a
- ld [wChannelNoteDelayCountersFractionalPart + 7], a
-.musicChannelDone
- jp Audio3_sound_ret
-
-Audio3_stereo_panning:
- cp stereo_panning_cmd
- jr nz, Audio3_unknownmusic0xef
- call Audio3_GetNextMusicByte
- ld [wStereoPanning], a ; store panning
- jp Audio3_sound_ret
-
-; this appears to never be used
-Audio3_unknownmusic0xef:
- cp unknownmusic0xef_cmd
- jr nz, Audio3_duty_cycle_pattern
- call Audio3_GetNextMusicByte
- push bc
- call Audio3_PlaySound
- pop bc
- ld a, [wDisableChannelOutputWhenSfxEnds]
- and a
- jr nz, .skip
- ld a, [wChannelSoundIDs + Ch8]
- ld [wDisableChannelOutputWhenSfxEnds], a
- xor a
- ld [wChannelSoundIDs + Ch8], a
-.skip
- jp Audio3_sound_ret
-
-Audio3_duty_cycle_pattern:
- cp duty_cycle_pattern_cmd
- jr nz, Audio3_volume
- call Audio3_GetNextMusicByte
- ld b, 0
- ld hl, wChannelDutyCyclePatterns
- add hl, bc
- ld [hl], a ; store full pattern
- and %11000000
- ld hl, wChannelDutyCycles
- add hl, bc
- ld [hl], a ; store first duty cycle
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_ROTATE_DUTY_CYCLE, [hl]
- jp Audio3_sound_ret
-
-Audio3_volume:
- cp volume_cmd
- jr nz, Audio3_execute_music
- call Audio3_GetNextMusicByte
- ldh [rNR50], a ; store volume
- jp Audio3_sound_ret
-
-Audio3_execute_music:
- cp execute_music_cmd
- jr nz, Audio3_octave
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- set BIT_EXECUTE_MUSIC, [hl]
- jp Audio3_sound_ret
-
-Audio3_octave:
- and $f0
- cp octave_cmd
- jr nz, Audio3_sfx_note
- ld hl, wChannelOctaves
- ld b, 0
- add hl, bc
- ld a, d
- and $f
- ld [hl], a ; store low nibble as octave
- jp Audio3_sound_ret
-
-; sfx_note is either square_note or noise_note depending on the channel
-Audio3_sfx_note:
- cp sfx_note_cmd
- jr nz, Audio3_pitch_sweep
- ld a, c
- cp Ch4 ; is this a noise or sfx channel?
- jr c, Audio3_pitch_sweep ; no
- ld b, 0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl] ; is execute_music being used?
- jr nz, Audio3_pitch_sweep ; yes
- call Audio3_note_length
-
-; This code seems to do the same thing as what Audio3_ApplyDutyCycleAndSoundLength
-; does below.
- ld d, a
- ld b, 0
- ld hl, wChannelDutyCycles
- add hl, bc
- ld a, [hl]
- or d
- ld d, a
- ld b, REG_DUTY_SOUND_LEN
- call Audio3_GetRegisterPointer
- ld [hl], d
-
- call Audio3_GetNextMusicByte
- ld d, a
- ld b, REG_VOLUME_ENVELOPE
- call Audio3_GetRegisterPointer
- ld [hl], d
- call Audio3_GetNextMusicByte
- ld e, a
- ld a, c
- cp Ch8
- ld a, 0
- jr z, .skip
-; Channels 1 through 3 have 2 registers that control frequency, but the noise
-; channel a single register (the polynomial counter) that controls frequency,
-; so this command has one less byte on the noise channel.
- push de
- call Audio3_GetNextMusicByte
- pop de
-.skip
- ld d, a
- push de
- call Audio3_ApplyDutyCycleAndSoundLength
- call Audio3_EnableChannelOutput
- pop de
- call Audio3_ApplyWavePatternAndFrequency
- ret
-
-Audio3_pitch_sweep:
- ld a, c
- cp Ch5
- jr c, Audio3_note ; if not a sfx
- ld a, d
- cp pitch_sweep_cmd
- jr nz, Audio3_note
- ld b, $0
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio3_note ; no
- call Audio3_GetNextMusicByte
- ldh [rNR10], a
- jp Audio3_sound_ret
-
-Audio3_note:
- ld a, c
- cp Ch4
- jr nz, Audio3_note_length ; if not noise channel
- ld a, d
- and $f0
- cp drum_note_cmd
- jr z, .drum_note
- jr nc, Audio3_note_length
-
- ; this executes when on the noise channel and
- ; the command id is less than drum_note_cmd ($b0)
- ; in this case, the upper nybble is used as the noise instrument ($1-$a)
- ; and the lower nybble is the length minus 1 (0-15)
- ; however, this doesn't work for instrument #2 because the command id
- ; is captured by the noise_note command (command id $2x)
- ; this essentially acts like a drum_note command that is only 1 byte
- ; instead of 2 and can only be used with instruments 1 and 3 through 10
- ; this is unused by the game
- swap a
- ld b, a
- ld a, d
- and $f
- ld d, a
- ld a, b
- push de
- push bc
- jr .playDnote
-
-.drum_note
- ld a, d
- and $f
- push af
- push bc
- call Audio3_GetNextMusicByte ; get drum_note instrument
-.playDnote
- ld d, a
- ld a, [wDisableChannelOutputWhenSfxEnds]
- and a
- jr nz, .skipDnote
- ld a, d
- call Audio3_PlaySound
-.skipDnote
- pop bc
- pop de
-
-Audio3_note_length:
- ld a, d
- push af
- and $f
- inc a
- ld b, 0
- ld e, a ; store note length (in 16ths)
- ld d, b
- ld hl, wChannelNoteSpeeds
- add hl, bc
- ld a, [hl]
- ld l, b
- call Audio3_MultiplyAdd
- ld a, c
- cp Ch5
- jr nc, .sfxChannel
- ld a, [wMusicTempo]
- ld d, a
- ld a, [wMusicTempo + 1]
- ld e, a
- jr .skip
-.sfxChannel
- ld d, $1
- ld e, $0
- cp Ch8
- jr z, .skip ; if noise channel
- call Audio3_SetSfxTempo
- ld a, [wSfxTempo]
- ld d, a
- ld a, [wSfxTempo + 1]
- ld e, a
-.skip
- ld a, l ; a = note_length * note_speed
- ld b, 0
- ld hl, wChannelNoteDelayCountersFractionalPart
- add hl, bc
- ld l, [hl]
- call Audio3_MultiplyAdd
- ld e, l
- ld d, h ; de = note_delay_frac_part + (note_length * note_speed * tempo)
- ld hl, wChannelNoteDelayCountersFractionalPart
- add hl, bc
- ld [hl], e
- ld a, d
- ld hl, wChannelNoteDelayCounters
- add hl, bc
- ld [hl], a
- ld hl, wChannelFlags2
- add hl, bc
- bit BIT_EXECUTE_MUSIC, [hl]
- jr nz, Audio3_note_pitch
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_NOISE_OR_SFX, [hl]
- jr z, Audio3_note_pitch
- pop hl
- ret
-
-Audio3_note_pitch:
- pop af
- and $f0
- cp rest_cmd
- jr nz, .notRest
- ld a, c
- cp Ch5
- jr nc, .next
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
- and a
- jr nz, .done
- ; fall through
-.next
- ld a, c
- cp Ch3
- jr z, .channel3
- cp Ch7
- jr nz, .notChannel3
-.channel3
- ld b, 0
- ld hl, Audio3_HWChannelDisableMasks
- add hl, bc
- ldh a, [rNR51]
- and [hl]
- ldh [rNR51], a ; disable hardware channel 3's output
- jr .done
-.notChannel3
- ld b, REG_VOLUME_ENVELOPE
- call Audio3_GetRegisterPointer
- ld a, $8 ; fade in sound
- ld [hli], a
- inc hl
- ld a, $80 ; restart sound
- ld [hl], a
-.done
- ret
-.notRest
- swap a
- ld b, 0
- ld hl, wChannelOctaves
- add hl, bc
- ld b, [hl]
- call Audio3_CalculateFrequency
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_ON, [hl]
- jr z, .skipPitchSlide
- call Audio3_InitPitchSlideVars
-.skipPitchSlide
- push de
- ld a, c
- cp Ch5
- jr nc, .sfxChannel ; if sfx channel
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- ld d, 0
- ld e, a
- add hl, de
- ld a, [hl]
- and a
- jr nz, .noSfx
- jr .sfxChannel
-.noSfx
- pop de
- ret
-.sfxChannel
- ld b, 0
- ld hl, wChannelVolumes
- add hl, bc
- ld d, [hl]
- ld b, REG_VOLUME_ENVELOPE
- call Audio3_GetRegisterPointer
- ld [hl], d
- call Audio3_ApplyDutyCycleAndSoundLength
- call Audio3_EnableChannelOutput
- pop de
- ld b, $0
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
- jr z, .skipFrequencyInc
- inc e ; if yes, increment the frequency by 1
- jr nc, .skipFrequencyInc
- inc d
-.skipFrequencyInc
- ld hl, wChannelFrequencyLowBytes
- add hl, bc
- ld [hl], e
- call Audio3_ApplyWavePatternAndFrequency
- ret
-
-Audio3_EnableChannelOutput:
- ld b, 0
- ld hl, Audio3_HWChannelEnableMasks
- add hl, bc
- ldh a, [rNR51]
- or [hl] ; set this channel's bits
- ld d, a
- ld a, c
- cp Ch8
- jr z, .noiseChannelOrNoSfx
- cp Ch5
- jr nc, .skip ; if sfx channel
-; If this isn't an SFX channel, try the corresponding SFX channel.
- ld hl, wChannelSoundIDs + Ch5
- add hl, bc
- ld a, [hl]
- and a
- jr nz, .skip
-.noiseChannelOrNoSfx
-; If this is the SFX noise channel or a music channel whose corresponding
-; SFX channel is off, apply stereo panning.
- ld a, [wStereoPanning]
- ld hl, Audio3_HWChannelEnableMasks
- add hl, bc
- and [hl]
- ld d, a
- ldh a, [rNR51]
- ld hl, Audio3_HWChannelDisableMasks
- add hl, bc
- and [hl] ; reset this channel's output bits
- or d ; set this channel's output bits that enabled in [wStereoPanning]
- ld d, a
-.skip
- ld a, d
- ldh [rNR51], a
- ret
-
-Audio3_ApplyDutyCycleAndSoundLength:
- ld b, 0
- ld hl, wChannelNoteDelayCounters ; use the note delay as sound length
- add hl, bc
- ld d, [hl]
- ld a, c
- cp Ch3
- jr z, .skipDuty ; if music channel 3
- cp Ch7
- jr z, .skipDuty ; if sfx channel 3
-; include duty cycle (except on channel 3 which doesn't have it)
- ld a, d
- and $3f
- ld d, a
- ld hl, wChannelDutyCycles
- add hl, bc
- ld a, [hl]
- or d
- ld d, a
-.skipDuty
- ld b, REG_DUTY_SOUND_LEN
- call Audio3_GetRegisterPointer
- ld [hl], d
- ret
-
-Audio3_ApplyWavePatternAndFrequency:
- ld a, c
- cp Ch3
- jr z, .channel3
- cp Ch7
- jr nz, .notChannel3
- ; fall through
-.channel3
- push de
- ld de, wMusicWaveInstrument
- cp Ch3
- jr z, .next
- ld de, wSfxWaveInstrument
-.next
- ld a, [de]
- add a
- ld d, 0
- ld e, a
- ld hl, Audio3_WavePointers
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld hl, rWave_0
- ld b, $f
- ld a, $0 ; stop hardware channel 3
- ldh [rNR30], a
-.loop
- ld a, [de]
- inc de
- ld [hli], a
- ld a, b
- dec b
- and a
- jr nz, .loop
- ld a, $80 ; start hardware channel 3
- ldh [rNR30], a
- pop de
-.notChannel3
- ld a, d
- or $80 ; use counter mode (i.e. disable output when the counter reaches 0)
- and $c7 ; zero the unused bits in the register
- ld d, a
- ld b, REG_FREQUENCY_LO
- call Audio3_GetRegisterPointer
- ld [hl], e ; store frequency low byte
- inc hl
- ld [hl], d ; store frequency high byte
- call Audio3_ApplyFrequencyModifier
- ret
-
-Audio3_SetSfxTempo:
- call Audio3_IsCry
- jr nc, .notCry
- ld d, 0
- ld a, [wTempoModifier]
- add $80
- jr nc, .next
- inc d
-.next
- ld [wSfxTempo + 1], a
- ld a, d
- ld [wSfxTempo], a
- jr .done
-.notCry
- xor a
- ld [wSfxTempo + 1], a
- ld a, $1
- ld [wSfxTempo], a
-.done
- ret
-
-Audio3_ApplyFrequencyModifier:
- call Audio3_IsCry
- jr nc, .done
-; if playing a cry, add the cry's frequency modifier
- ld a, [wFrequencyModifier]
- add e
- jr nc, .noCarry
- inc d
-.noCarry
- dec hl
- ld e, a
- ld [hl], e
- inc hl
- ld [hl], d
-.done
- ret
-
-Audio3_GoBackOneCommandIfCry:
- call Audio3_IsCry
- jr nc, .done
- ld hl, wChannelCommandPointers
- ld e, c
- ld d, 0
- sla e
- rl d
- add hl, de
- ld a, [hl]
- sub 1
- ld [hl], a
- inc hl
- ld a, [hl]
- sbc 0
- ld [hl], a
- scf
- ret
-.done
- scf
- ccf
- ret
-
-Audio3_IsCry:
-; Returns whether the currently playing audio is a cry in carry.
- ld a, [wChannelSoundIDs + Ch5]
- cp CRY_SFX_START
- jr nc, .next
- jr .no
-.next
- cp CRY_SFX_END
- jr z, .no
- jr c, .yes
-.no
- scf
- ccf
- ret
-.yes
- scf
- ret
-
-Audio3_ApplyPitchSlide:
- ld hl, wChannelFlags1
- add hl, bc
- bit BIT_PITCH_SLIDE_DECREASING, [hl]
- jp nz, .frequencyDecreasing
-; frequency increasing
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld e, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld l, [hl]
- ld h, b
- add hl, de
- ld d, h
- ld e, l
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, bc
- push hl
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld a, [hl]
- pop hl
- add [hl]
- ld [hl], a
- ld a, 0
- adc e
- ld e, a
- ld a, 0
- adc d
- ld d, a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, [hl]
- cp d
- jp c, .reachedTargetFrequency
- jr nz, .applyUpdatedFrequency
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- cp e
- jp c, .reachedTargetFrequency
- jr .applyUpdatedFrequency
-.frequencyDecreasing
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld e, [hl]
- sub e
- ld e, a
- ld a, d
- sbc b
- ld d, a
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld a, [hl]
- add a
- ld [hl], a
- ld a, e
- sbc b
- ld e, a
- ld a, d
- sbc b
- ld d, a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, d
- cp [hl]
- jr c, .reachedTargetFrequency
- jr nz, .applyUpdatedFrequency
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, e
- cp [hl]
- jr c, .reachedTargetFrequency
-.applyUpdatedFrequency
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld b, REG_FREQUENCY_LO
- call Audio3_GetRegisterPointer
- ld a, e
- ld [hli], a
- ld [hl], d
- ret
-.reachedTargetFrequency
-; Turn off pitch slide when the target frequency has been reached.
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_ON, [hl]
- res BIT_PITCH_SLIDE_DECREASING, [hl]
- ret
-
-Audio3_InitPitchSlideVars:
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld [hl], d
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld [hl], e
- ld hl, wChannelNoteDelayCounters
- add hl, bc
- ld a, [hl]
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
- sub [hl]
- jr nc, .next
- ld a, 1
-.next
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, e
- sub [hl]
- ld e, a
- ld a, d
- sbc b
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- sub [hl]
- jr c, .targetFrequencyGreater
- ld d, a
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- set BIT_PITCH_SLIDE_DECREASING, [hl]
- jr .next2
-.targetFrequencyGreater
-; If the target frequency is greater, subtract the current frequency from
-; the target frequency to get the absolute difference.
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, bc
- ld d, [hl]
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, bc
- ld e, [hl]
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, bc
- ld a, [hl]
- sub e
- ld e, a
-
-; Bug. Instead of borrowing from the high byte of the target frequency as it
-; should, it borrows from the high byte of the current frequency instead.
-; This means that the result will be 0x200 greater than it should be if the
-; low byte of the current frequency is greater than the low byte of the
-; target frequency.
- ld a, d
- sbc b
- ld d, a
-
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, bc
- ld a, [hl]
- sub d
- ld d, a
- ld b, 0
- ld hl, wChannelFlags1
- add hl, bc
- res BIT_PITCH_SLIDE_DECREASING, [hl]
-
-.next2
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, bc
-.divideLoop
- inc b
- ld a, e
- sub [hl]
- ld e, a
- jr nc, .divideLoop
- ld a, d
- and a
- jr z, .doneDividing
- dec a
- ld d, a
- jr .divideLoop
-.doneDividing
- ld a, e ; a = remainder - dividend
- add [hl]
- ld d, b ; d = quotient + 1
- ld b, 0
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, bc
- ld [hl], d ; store quotient + 1
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, bc
- ld [hl], a ; store remainder - dividend
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, bc
- ld [hl], a ; store remainder - dividend
- ret
-
-Audio3_ApplyDutyCyclePattern:
- ld b, 0
- ld hl, wChannelDutyCyclePatterns
- add hl, bc
- ld a, [hl]
- rlca
- rlca
- ld [hl], a
- and $c0
- ld d, a
- ld b, REG_DUTY_SOUND_LEN
- call Audio3_GetRegisterPointer
- ld a, [hl]
- and $3f
- or d
- ld [hl], a
- ret
-
-Audio3_GetNextMusicByte:
- ld d, 0
- ld a, c
- add a
- ld e, a
- ld hl, wChannelCommandPointers
- add hl, de
- ld a, [hli]
- ld e, a
- ld a, [hld]
- ld d, a
- ld a, [de] ; get next music command
- inc de
- ld [hl], e ; store address of next command
- inc hl
- ld [hl], d
- ret
-
-Audio3_GetRegisterPointer:
-; hl = address of hardware sound register b for software channel c
- ld a, c
- ld hl, Audio3_HWChannelBaseAddresses
- add l
- jr nc, .noCarry
- inc h
-.noCarry
- ld l, a
- ld a, [hl]
- add b
- ld l, a
- ld h, $ff
- ret
-
-Audio3_MultiplyAdd:
-; hl = l + (a * de)
- ld h, 0
-.loop
- srl a
- jr nc, .skipAdd
- add hl, de
-.skipAdd
- sla e
- rl d
- and a
- jr z, .done
- jr .loop
-.done
- ret
-
-Audio3_CalculateFrequency:
-; return the frequency for note a, octave b in de
- ld h, 0
- ld l, a
- add hl, hl
- ld d, h
- ld e, l
- ld hl, Audio3_Pitches
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld a, b
-.loop
- cp 7
- jr z, .done
- sra d
- rr e
- inc a
- jr .loop
-.done
- ld a, 8
- add d
- ld d, a
- ret
+; The third of four partially duplicated sound engines.
Audio3_PlaySound::
ld [wSoundID], a
+ ld a, [wSoundID]
cp SFX_STOP_ALL_MUSIC
jp z, .stopAllAudio
cp MAX_SFX_ID_3
jp z, .playSfx
jp c, .playSfx
- cp $fe
+ cp $fd
jr z, .playMusic
jp nc, .playSfx
.playMusic
- xor a
- ld [wUnusedC000], a
- ld [wDisableChannelOutputWhenSfxEnds], a
- ld [wMusicTempo + 1], a
- ld [wMusicWaveInstrument], a
- ld [wSfxWaveInstrument], a
- ld d, NUM_CHANNELS
- ld hl, wChannelReturnAddresses
- call .FillMem
- ld hl, wChannelCommandPointers
- call .FillMem
- ld d, NUM_MUSIC_CHANS
- ld hl, wChannelSoundIDs
- call .FillMem
- ld hl, wChannelFlags1
- call .FillMem
- ld hl, wChannelDutyCycles
- call .FillMem
- ld hl, wChannelDutyCyclePatterns
- call .FillMem
- ld hl, wChannelVibratoDelayCounters
- call .FillMem
- ld hl, wChannelVibratoExtents
- call .FillMem
- ld hl, wChannelVibratoRates
- call .FillMem
- ld hl, wChannelFrequencyLowBytes
- call .FillMem
- ld hl, wChannelVibratoDelayCounterReloadValues
- call .FillMem
- ld hl, wChannelFlags2
- call .FillMem
- ld hl, wChannelPitchSlideLengthModifiers
- call .FillMem
- ld hl, wChannelPitchSlideFrequencySteps
- call .FillMem
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- call .FillMem
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- call .FillMem
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- call .FillMem
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- call .FillMem
- ld a, $1
- ld hl, wChannelLoopCounters
- call .FillMem
- ld hl, wChannelNoteDelayCounters
- call .FillMem
- ld hl, wChannelNoteSpeeds
- call .FillMem
- ld [wMusicTempo], a
- ld a, $ff
- ld [wStereoPanning], a
- xor a
- ldh [rNR50], a
- ld a, $8
- ldh [rNR10], a
- ld a, 0
- ldh [rNR51], a
- xor a
- ldh [rNR30], a
- ld a, $80
- ldh [rNR30], a
- ld a, $77
- ldh [rNR50], a
+ call InitMusicVariables
jp .playSoundCommon
.playSfx
@@ -1471,92 +75,7 @@ Audio3_PlaySound::
jr c, .playChannel
ret
.playChannel
- xor a
- push de
- ld h, d
- ld l, e
- add hl, hl
- ld d, h
- ld e, l
- ld hl, wChannelReturnAddresses
- add hl, de
- ld [hli], a
- ld [hl], a
- ld hl, wChannelCommandPointers
- add hl, de
- ld [hli], a
- ld [hl], a
- pop de
- ld hl, wChannelSoundIDs
- add hl, de
- ld [hl], a
- ld hl, wChannelFlags1
- add hl, de
- ld [hl], a
- ld hl, wChannelDutyCycles
- add hl, de
- ld [hl], a
- ld hl, wChannelDutyCyclePatterns
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoDelayCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoExtents
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoRates
- add hl, de
- ld [hl], a
- ld hl, wChannelFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelVibratoDelayCounterReloadValues
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideLengthModifiers
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideFrequencySteps
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideFrequencyStepsFractionalPart
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyFractionalPart
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyHighBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideCurrentFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyHighBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelPitchSlideTargetFrequencyLowBytes
- add hl, de
- ld [hl], a
- ld hl, wChannelFlags2
- add hl, de
- ld [hl], a
- ld a, $1
- ld hl, wChannelLoopCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelNoteDelayCounters
- add hl, de
- ld [hl], a
- ld hl, wChannelNoteSpeeds
- add hl, de
- ld [hl], a
- ld a, e
- cp Ch5
- jr nz, .skipSweepDisable
- ld a, $8
- ldh [rNR10], a ; sweep off
-.skipSweepDisable
+ call InitSFXVariables
ld a, c
and a
jp z, .playSoundCommon
@@ -1564,51 +83,7 @@ Audio3_PlaySound::
jp .sfxChannelLoop
.stopAllAudio
- ld a, $80
- ldh [rNR52], a ; sound hardware on
- ldh [rNR30], a ; wave playback on
- xor a
- ldh [rNR51], a ; no sound output
- ldh [rNR32], a ; mute channel 3 (wave channel)
- ld a, $8
- ldh [rNR10], a ; sweep off
- ldh [rNR12], a ; mute channel 1 (pulse channel 1)
- ldh [rNR22], a ; mute channel 2 (pulse channel 2)
- ldh [rNR42], a ; mute channel 4 (noise channel)
- ld a, $40
- ldh [rNR14], a ; counter mode
- ldh [rNR24], a
- ldh [rNR44], a
- ld a, $77
- ldh [rNR50], a ; full volume
- xor a
- ld [wUnusedC000], a
- ld [wDisableChannelOutputWhenSfxEnds], a
- ld [wMuteAudioAndPauseMusic], a
- ld [wMusicTempo + 1], a
- ld [wSfxTempo + 1], a
- ld [wMusicWaveInstrument], a
- ld [wSfxWaveInstrument], a
- ld d, $a0
- ld hl, wChannelCommandPointers
- call .FillMem
- ld a, $1
- ld d, $18
- ld hl, wChannelNoteDelayCounters
- call .FillMem
- ld [wMusicTempo], a
- ld [wSfxTempo], a
- ld a, $ff
- ld [wStereoPanning], a
- ret
-
-; fills d bytes at hl with a
-.FillMem
- ld b, d
-.loop
- ld [hli], a
- dec b
- jr nz, .loop
+ call StopAllAudio
ret
.playSoundCommon
@@ -1644,16 +119,11 @@ Audio3_PlaySound::
inc hl
jr .commandPointerLoop
.next
+ push af
push hl
push bc
- push af
ld b, 0
ld c, a
- ld hl, wChannelSoundIDs
- add hl, bc
- ld a, [wSoundID]
- ld [hl], a
- pop af
cp Ch4
jr c, .skipSettingFlag
ld hl, wChannelFlags1
@@ -1668,6 +138,17 @@ Audio3_PlaySound::
ld a, [de]
ld [hli], a
inc de
+ pop af
+ push hl
+ push bc
+ ld b, 0
+ ld c, a
+ ld hl, wChannelSoundIDs
+ add hl, bc
+ ld a, [wSoundID]
+ ld [hl], a
+ pop bc
+ pop hl
inc c
dec b
ld a, b
@@ -1708,19 +189,3 @@ Audio3_PlaySound::
Audio3_CryRet:
sound_ret
-
-Audio3_HWChannelBaseAddresses:
-; the low bytes of each HW channel's base address
- db HW_CH1_BASE, HW_CH2_BASE, HW_CH3_BASE, HW_CH4_BASE ; channels 0-3
- db HW_CH1_BASE, HW_CH2_BASE, HW_CH3_BASE, HW_CH4_BASE ; channels 4-7
-
-Audio3_HWChannelDisableMasks:
- db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 0-3
- db HW_CH1_DISABLE_MASK, HW_CH2_DISABLE_MASK, HW_CH3_DISABLE_MASK, HW_CH4_DISABLE_MASK ; channels 4-7
-
-Audio3_HWChannelEnableMasks:
- db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 0-3
- db HW_CH1_ENABLE_MASK, HW_CH2_ENABLE_MASK, HW_CH3_ENABLE_MASK, HW_CH4_ENABLE_MASK ; channels 4-7
-
-Audio3_Pitches:
-INCLUDE "audio/notes.asm"
diff --git a/audio/engine_4.asm b/audio/engine_4.asm
new file mode 100644
index 00000000..b3ed422e
--- /dev/null
+++ b/audio/engine_4.asm
@@ -0,0 +1,191 @@
+; The fourth of four partially duplicated sound engines.
+
+Audio4_PlaySound::
+ ld [wSoundID], a
+ ld a, [wSoundID]
+ cp $ff
+ jp z, .stopAllAudio
+ cp MAX_SFX_ID_4
+ jp z, .playSfx
+ jp c, .playSfx
+ cp $a3
+ jr z, .playMusic
+ jp nc, .playSfx
+
+.playMusic
+ call InitMusicVariables
+ jp .playSoundCommon
+
+.playSfx
+ ld l, a
+ ld e, a
+ ld h, 0
+ ld d, h
+ add hl, hl
+ add hl, de
+ ld de, SFX_Headers_4
+ add hl, de
+ ld a, h
+ ld [wSfxHeaderPointer], a
+ ld a, l
+ ld [wSfxHeaderPointer + 1], a
+ ld a, [hl]
+ and $c0
+ rlca
+ rlca
+ ld c, a
+.sfxChannelLoop
+ ld d, c
+ ld a, c
+ add a
+ add c
+ ld c, a
+ ld b, 0
+ ld a, [wSfxHeaderPointer]
+ ld h, a
+ ld a, [wSfxHeaderPointer + 1]
+ ld l, a
+ add hl, bc
+ ld c, d
+ ld a, [hl]
+ and $f
+ ld e, a ; software channel ID
+ ld d, 0
+ ld hl, wChannelSoundIDs
+ add hl, de
+ ld a, [hl]
+ and a
+ jr z, .playChannel
+ ld a, e
+ cp Ch8
+ jr nz, .notNoiseChannel
+ ld a, [wSoundID]
+ cp NOISE_INSTRUMENTS_END
+ jr nc, .notNoiseInstrument
+ ret
+.notNoiseInstrument
+ ld a, [hl]
+ cp NOISE_INSTRUMENTS_END
+ jr z, .playChannel
+ jr c, .playChannel
+.notNoiseChannel
+ ld a, [wSoundID]
+ cp [hl]
+ jr z, .playChannel
+ jr c, .playChannel
+ ret
+.playChannel
+ call InitSFXVariables
+ ld a, c
+ and a
+ jp z, .playSoundCommon
+ dec c
+ jp .sfxChannelLoop
+
+.stopAllAudio
+ call StopAllAudio
+ ret
+
+.playSoundCommon
+ ld a, [wSoundID]
+ ld l, a
+ ld e, a
+ ld h, 0
+ ld d, h
+ add hl, hl
+ add hl, de
+ ld de, SFX_Headers_4
+ add hl, de
+ ld e, l
+ ld d, h
+ ld hl, wChannelCommandPointers
+ ld a, [de] ; get channel number
+ ld b, a
+ rlca
+ rlca
+ and $3
+ ld c, a
+ ld a, b
+ and $f
+ ld b, c
+ inc b
+ inc de
+ ld c, 0
+.commandPointerLoop
+ cp c
+ jr z, .next
+ inc c
+ inc hl
+ inc hl
+ jr .commandPointerLoop
+.next
+ push af
+ push hl
+ push bc
+ ld b, 0
+ ld c, a
+ cp Ch4
+ jr c, .skipSettingFlag
+ ld hl, wChannelFlags1
+ add hl, bc
+ set BIT_NOISE_OR_SFX, [hl]
+.skipSettingFlag
+ pop bc
+ pop hl
+ ld a, [de] ; get channel pointer
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ inc de
+ pop af
+ push hl
+ push bc
+ ld b, 0
+ ld c, a
+ ld hl, wChannelSoundIDs
+ add hl, bc
+ ld a, [wSoundID]
+ ld [hl], a
+ pop bc
+ pop hl
+ inc c
+ dec b
+ ld a, b
+ and a
+ ld a, [de]
+ inc de
+ jr nz, .commandPointerLoop
+ ld a, [wSoundID]
+ cp CRY_SFX_START
+ jr nc, .maybeCry
+ jr .done
+.maybeCry
+ ld a, [wSoundID]
+ cp CRY_SFX_END
+ jr z, .done
+ jr c, .cry
+ jr .done
+.cry
+ ld hl, wChannelSoundIDs + Ch5
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld hl, wChannelCommandPointers + Ch7 * 2 ; sfx wave channel pointer
+ ld de, Audio4_CryRet
+ ld [hl], e
+ inc hl
+ ld [hl], d ; overwrite pointer to point to sound_ret
+ ld a, [wSavedVolume]
+ and a
+ jr nz, .done
+ ldh a, [rNR50]
+ ld [wSavedVolume], a
+ ld a, $77
+ ldh [rNR50], a ; full volume
+.done
+ ret
+
+Audio4_CryRet:
+ sound_ret
diff --git a/audio/headers/musicheaders3.asm b/audio/headers/musicheaders3.asm
index ca21b419..51c67966 100644
--- a/audio/headers/musicheaders3.asm
+++ b/audio/headers/musicheaders3.asm
@@ -22,8 +22,8 @@ Music_Surfing::
Music_GameCorner::
audio_header Music_GameCorner, Ch1, Ch2, Ch3
-Music_IntroBattle::
- audio_header Music_IntroBattle, Ch1, Ch2, Ch3, Ch4
+Music_YellowIntro::
+ audio_header Music_YellowIntro, Ch1, Ch2, Ch3
; Power Plant, Cerulean Cave, Rocket HQ
Music_Dungeon1::
diff --git a/audio/headers/musicheaders4.asm b/audio/headers/musicheaders4.asm
new file mode 100644
index 00000000..8c537ff9
--- /dev/null
+++ b/audio/headers/musicheaders4.asm
@@ -0,0 +1,11 @@
+Music_SurfingPikachu::
+ audio_header Music_SurfingPikachu, Ch1, Ch2, Ch3
+
+Music_MeetJessieJames::
+ audio_header Music_MeetJessieJames, Ch1, Ch2, Ch3
+
+Music_YellowUnusedSong::
+ audio_header Music_YellowUnusedSong, Ch1, Ch2, Ch3, Ch4
+
+Music_GBPrinter::
+ audio_header Music_GBPrinter, Ch3
diff --git a/audio/headers/sfxheaders4.asm b/audio/headers/sfxheaders4.asm
new file mode 100644
index 00000000..d371d3f8
--- /dev/null
+++ b/audio/headers/sfxheaders4.asm
@@ -0,0 +1,212 @@
+SFX_Headers_4::
+ db $ff, $ff, $ff ; padding
+
+SFX_Noise_Instrument01_4::
+ audio_header SFX_Noise_Instrument01_4, Ch8
+
+SFX_Noise_Instrument02_4::
+ audio_header SFX_Noise_Instrument02_4, Ch8
+
+SFX_Noise_Instrument03_4::
+ audio_header SFX_Noise_Instrument03_4, Ch8
+
+SFX_Noise_Instrument04_4::
+ audio_header SFX_Noise_Instrument04_4, Ch8
+
+SFX_Noise_Instrument05_4::
+ audio_header SFX_Noise_Instrument05_4, Ch8
+
+SFX_Noise_Instrument06_4::
+ audio_header SFX_Noise_Instrument06_4, Ch8
+
+SFX_Noise_Instrument07_4::
+ audio_header SFX_Noise_Instrument07_4, Ch8
+
+SFX_Noise_Instrument08_4::
+ audio_header SFX_Noise_Instrument08_4, Ch8
+
+SFX_Noise_Instrument09_4::
+ audio_header SFX_Noise_Instrument09_4, Ch8
+
+SFX_Noise_Instrument10_4::
+ audio_header SFX_Noise_Instrument10_4, Ch8
+
+SFX_Noise_Instrument11_4::
+ audio_header SFX_Noise_Instrument11_4, Ch8
+
+SFX_Noise_Instrument12_4::
+ audio_header SFX_Noise_Instrument12_4, Ch8
+
+SFX_Noise_Instrument13_4::
+ audio_header SFX_Noise_Instrument13_4, Ch8
+
+SFX_Noise_Instrument14_4::
+ audio_header SFX_Noise_Instrument14_4, Ch8
+
+SFX_Noise_Instrument15_4::
+ audio_header SFX_Noise_Instrument15_4, Ch8
+
+SFX_Noise_Instrument16_4::
+ audio_header SFX_Noise_Instrument16_4, Ch8
+
+SFX_Noise_Instrument17_4::
+ audio_header SFX_Noise_Instrument17_4, Ch8
+
+SFX_Noise_Instrument18_4::
+ audio_header SFX_Noise_Instrument18_4, Ch8
+
+SFX_Noise_Instrument19_4::
+ audio_header SFX_Noise_Instrument19_4, Ch8
+
+SFX_Cry00_4::
+ audio_header SFX_Cry00_4, Ch5, Ch6, Ch8
+
+SFX_Cry01_4::
+ audio_header SFX_Cry01_4, Ch5, Ch6, Ch8
+
+SFX_Cry02_4::
+ audio_header SFX_Cry02_4, Ch5, Ch6, Ch8
+
+SFX_Cry03_4::
+ audio_header SFX_Cry03_4, Ch5, Ch6, Ch8
+
+SFX_Cry04_4::
+ audio_header SFX_Cry04_4, Ch5, Ch6, Ch8
+
+SFX_Cry05_4::
+ audio_header SFX_Cry05_4, Ch5, Ch6, Ch8
+
+SFX_Cry06_4::
+ audio_header SFX_Cry06_4, Ch5, Ch6, Ch8
+
+SFX_Cry07_4::
+ audio_header SFX_Cry07_4, Ch5, Ch6, Ch8
+
+SFX_Cry08_4::
+ audio_header SFX_Cry08_4, Ch5, Ch6, Ch8
+
+SFX_Cry09_4::
+ audio_header SFX_Cry09_4, Ch5, Ch6, Ch8
+
+SFX_Cry0A_4::
+ audio_header SFX_Cry0A_4, Ch5, Ch6, Ch8
+
+SFX_Cry0B_4::
+ audio_header SFX_Cry0B_4, Ch5, Ch6, Ch8
+
+SFX_Cry0C_4::
+ audio_header SFX_Cry0C_4, Ch5, Ch6, Ch8
+
+SFX_Cry0D_4::
+ audio_header SFX_Cry0D_4, Ch5, Ch6, Ch8
+
+SFX_Cry0E_4::
+ audio_header SFX_Cry0E_4, Ch5, Ch6, Ch8
+
+SFX_Cry0F_4::
+ audio_header SFX_Cry0F_4, Ch5, Ch6, Ch8
+
+SFX_Cry10_4::
+ audio_header SFX_Cry10_4, Ch5, Ch6, Ch8
+
+SFX_Cry11_4::
+ audio_header SFX_Cry11_4, Ch5, Ch6, Ch8
+
+SFX_Cry12_4::
+ audio_header SFX_Cry12_4, Ch5, Ch6, Ch8
+
+SFX_Cry13_4::
+ audio_header SFX_Cry13_4, Ch5, Ch6, Ch8
+
+SFX_Cry14_4::
+ audio_header SFX_Cry14_4, Ch5, Ch6, Ch8
+
+SFX_Cry15_4::
+ audio_header SFX_Cry15_4, Ch5, Ch6, Ch8
+
+SFX_Cry16_4::
+ audio_header SFX_Cry16_4, Ch5, Ch6, Ch8
+
+SFX_Cry17_4::
+ audio_header SFX_Cry17_4, Ch5, Ch6, Ch8
+
+SFX_Cry18_4::
+ audio_header SFX_Cry18_4, Ch5, Ch6, Ch8
+
+SFX_Cry19_4::
+ audio_header SFX_Cry19_4, Ch5, Ch6, Ch8
+
+SFX_Cry1A_4::
+ audio_header SFX_Cry1A_4, Ch5, Ch6, Ch8
+
+SFX_Cry1B_4::
+ audio_header SFX_Cry1B_4, Ch5, Ch6, Ch8
+
+SFX_Cry1C_4::
+ audio_header SFX_Cry1C_4, Ch5, Ch6, Ch8
+
+SFX_Cry1D_4::
+ audio_header SFX_Cry1D_4, Ch5, Ch6, Ch8
+
+SFX_Cry1E_4::
+ audio_header SFX_Cry1E_4, Ch5, Ch6, Ch8
+
+SFX_Cry1F_4::
+ audio_header SFX_Cry1F_4, Ch5, Ch6, Ch8
+
+SFX_Cry20_4::
+ audio_header SFX_Cry20_4, Ch5, Ch6, Ch8
+
+SFX_Cry21_4::
+ audio_header SFX_Cry21_4, Ch5, Ch6, Ch8
+
+SFX_Cry22_4::
+ audio_header SFX_Cry22_4, Ch5, Ch6, Ch8
+
+SFX_Cry23_4::
+ audio_header SFX_Cry23_4, Ch5, Ch6, Ch8
+
+SFX_Cry24_4::
+ audio_header SFX_Cry24_4, Ch5, Ch6, Ch8
+
+SFX_Cry25_4::
+ audio_header SFX_Cry25_4, Ch5, Ch6, Ch8
+
+SFX_Get_Item1_4::
+ audio_header SFX_Get_Item1_4, Ch5, Ch6, Ch7
+
+SFX_Get_Item2_4::
+ audio_header SFX_Get_Item2_4, Ch5, Ch6, Ch7
+
+SFX_Tink_4::
+ audio_header SFX_Tink_4, Ch5
+
+SFX_Heal_HP_4::
+ audio_header SFX_Heal_HP_4, Ch5
+
+SFX_Heal_Ailment_4::
+ audio_header SFX_Heal_Ailment_4, Ch5
+
+SFX_Start_Menu_4::
+ audio_header SFX_Start_Menu_4, Ch8
+
+SFX_Press_AB_4::
+ audio_header SFX_Press_AB_4, Ch5
+
+SFX_Surfing_Jump::
+ audio_header SFX_Surfing_Jump, Ch8
+
+SFX_Surfing_Flip::
+ audio_header SFX_Surfing_Flip, Ch5
+
+SFX_Surfing_Crash::
+ audio_header SFX_Surfing_Crash, Ch8
+
+SFX_Unknown_802cc::
+ audio_header SFX_Unknown_802cc, Ch5
+
+SFX_Surfing_Land::
+ audio_header SFX_Surfing_Land, Ch8
+
+SFX_Get_Item2_4_2::
+ audio_header SFX_Get_Item2_4_2, Ch5, Ch6, Ch7
diff --git a/audio/music/dungeon1.asm b/audio/music/dungeon1.asm
index 49c6f89c..445576bb 100644
--- a/audio/music/dungeon1.asm
+++ b/audio/music/dungeon1.asm
@@ -6,10 +6,8 @@ Music_Dungeon1_Ch1::
vibrato 10, 1, 4
note_type 12, 4, -5
rest 8
- stereo_panning %1110, %1101
octave 4
note F#, 8
- stereo_panning %1111, %1111
Music_Dungeon1_branch_7dee5::
note_type 12, 11, 2
diff --git a/audio/music/meetjessiejames.asm b/audio/music/meetjessiejames.asm
new file mode 100644
index 00000000..d1f9f795
--- /dev/null
+++ b/audio/music/meetjessiejames.asm
@@ -0,0 +1,308 @@
+Music_MeetJessieJames_Ch1::
+ tempo 144
+ volume 7, 7
+ duty_cycle 3
+ vibrato 8, 1, 4
+ note_type 12, 11, 2
+ octave 3
+ note G#, 1
+ note G_, 1
+ note F#, 2
+ note F_, 2
+ note E_, 2
+ note D#, 2
+ note D_, 2
+ note C#, 2
+ note C_, 2
+ note_type 12, 11, 6
+ note D#, 12
+ note C_, 4
+
+Music_MeetJessieJames_branch_83187::
+ note_type 12, 11, 2
+ octave 4
+ note D_, 16
+ rest 12
+ note_type 12, 11, 4
+ octave 3
+ note A#, 4
+ rest 16
+ rest 8
+ note_type 12, 11, 2
+ octave 2
+ note A_, 2
+ octave 3
+ note A#, 2
+ note A_, 4
+ note D_, 1
+ note D#, 1
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ note D#, 2
+ note D_, 2
+ note D#, 2
+ note F_, 2
+ note D_, 1
+ note D#, 1
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ octave 2
+ note A#, 4
+ note_type 12, 11, 4
+ octave 3
+ note B_, 4
+ note_type 12, 11, 2
+ note D_, 1
+ note D#, 1
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ note D#, 2
+ note D_, 2
+ note D#, 2
+ note F_, 2
+ note D_, 1
+ note D#, 1
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ octave 2
+ note A#, 2
+ octave 3
+ note B_, 2
+ note_type 12, 11, 4
+ note A#, 4
+ sound_loop 0, Music_MeetJessieJames_branch_83187
+
+
+Music_MeetJessieJames_Ch2::
+ duty_cycle 3
+ vibrato 6, 1, 5
+ note_type 12, 12, 2
+ octave 4
+ note D_, 1
+ note C#, 1
+ note C_, 2
+ octave 3
+ note B_, 2
+ note A#, 2
+ note A_, 2
+ note G#, 2
+ note G_, 2
+ note F#, 2
+ note_type 12, 12, 7
+ note A_, 12
+ octave 4
+ note C#, 4
+
+Music_MeetJessieJames_branch_831df::
+ note_type 12, 12, 2
+ octave 3
+ note C#, 1
+ note D_, 1
+ note D_, 2
+ note D_, 2
+ note C#, 2
+ note D_, 2
+ note C#, 2
+ note D_, 2
+ note E_, 2
+ note C#, 1
+ note D_, 1
+ note D_, 2
+ note D_, 2
+ note C#, 2
+ octave 2
+ note A_, 4
+ note_type 12, 12, 5
+ octave 4
+ note C#, 4
+ note_type 12, 12, 2
+ note D_, 1
+ octave 3
+ note D_, 1
+ note D_, 2
+ note D_, 2
+ note C#, 2
+ note D_, 2
+ note C#, 2
+ note D_, 2
+ note E_, 2
+ note C#, 1
+ note D_, 1
+ note D_, 2
+ note D_, 2
+ note C#, 2
+ note_type 12, 12, 6
+ octave 4
+ note D_, 8
+ note_type 12, 12, 2
+ note D#, 6
+ note F_, 4
+ note D#, 4
+ octave 3
+ note A#, 2
+ octave 4
+ note D#, 6
+ note F_, 4
+ note D#, 2
+ note_type 12, 12, 5
+ note D_, 4
+ note_type 12, 12, 2
+ note D#, 6
+ note F_, 4
+ note D#, 4
+ octave 3
+ note A#, 2
+ octave 4
+ note D#, 4
+ note F_, 4
+ note_type 12, 12, 5
+ note D#, 8
+ sound_loop 0, Music_MeetJessieJames_branch_831df
+
+
+Music_MeetJessieJames_Ch3::
+ note_type 12, 1, 0
+ rest 16
+ rest 8
+ octave 4
+ note D_, 2
+ octave 3
+ note A_, 2
+ octave 4
+ note C_, 2
+ note D#, 2
+
+Music_MeetJessieJames_branch_83235::
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A#, 2
+ note A_, 2
+ note D#, 2
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note D_, 1
+ rest 1
+ octave 3
+ note A_, 2
+ octave 4
+ note C_, 2
+ note D_, 2
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ octave 3
+ note A#, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note A#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ octave 3
+ note A#, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ sound_loop 0, Music_MeetJessieJames_branch_83235
diff --git a/audio/music/printer.asm b/audio/music/printer.asm
new file mode 100644
index 00000000..4466db5b
--- /dev/null
+++ b/audio/music/printer.asm
@@ -0,0 +1,316 @@
+Music_GBPrinter_Ch3::
+ tempo 256
+ note_type 12, 1, 0
+ octave 4
+ note B_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+.loop
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ note C_, 1
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ note D#, 1
+ note E_, 1
+ rest 1
+ octave 4
+ note D#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note B_, 1
+ note A#, 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ sound_loop 0, .loop
diff --git a/audio/music/surfingpikachu.asm b/audio/music/surfingpikachu.asm
new file mode 100644
index 00000000..8e161443
--- /dev/null
+++ b/audio/music/surfingpikachu.asm
@@ -0,0 +1,690 @@
+Music_SurfingPikachu_Ch1::
+ tempo 117
+ volume 7, 7
+ duty_cycle 3
+ vibrato 8, 1, 4
+ note_type 12, 11, 3
+ octave 3
+ note E_, 6
+ note_type 12, 11, 2
+ note F#, 2
+ note_type 12, 11, 3
+ note E_, 6
+ note_type 12, 11, 2
+ note F#, 16
+ rest 2
+ note_type 12, 11, 3
+ note E_, 6
+ note_type 12, 11, 2
+ note A_, 2
+ note_type 12, 11, 3
+ note E_, 6
+ note_type 12, 11, 2
+ note A_, 14
+ note_type 12, 11, 2
+ note D#, 2
+ note C#, 1
+ note D#, 1
+ octave 2
+ note B_, 6
+ octave 3
+ note E_, 4
+ note E_, 4
+ note E_, 8
+ note G#, 4
+ note G#, 4
+ note G#, 2
+
+Music_SurfingPikachu_branch_82d1a::
+ note_type 12, 11, 3
+ octave 3
+ note G#, 4
+ note E_, 4
+ note F#, 4
+ note E_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note G#, 2
+ note F#, 2
+ note E_, 2
+ note D#, 2
+ note E_, 2
+ note D#, 2
+ note C#, 6
+ note F#, 2
+ note A_, 8
+ octave 2
+ note B_, 6
+ octave 3
+ note E_, 2
+ note G#, 8
+ note G#, 4
+ note E_, 4
+ note F#, 4
+ note E_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note G#, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note E_, 2
+ note G#, 2
+ note F#, 6
+ note E_, 2
+ note F#, 1
+ rest 3
+ note A_, 4
+ duty_cycle 0
+ note_type 12, 11, 2
+ note G#, 1
+ note F#, 1
+ note G#, 2
+ note B_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note E_, 2
+ note D#, 2
+ note F#, 2
+ note F#, 2
+ note D#, 2
+ note F#, 2
+ note B_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note B_, 1
+ note A#, 1
+ note B_, 2
+ note G#, 2
+ note E_, 2
+ note G#, 2
+ note G_, 2
+ note G#, 2
+ note A_, 2
+ octave 4
+ note C#, 2
+ note C_, 2
+ note C#, 3
+ octave 3
+ note F#, 1
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note A_, 2
+ note E_, 3
+ note E_, 1
+ note B_, 2
+ note A_, 2
+ note G#, 6
+ note E_, 1
+ note F_, 1
+ note F#, 2
+ note F#, 2
+ note D#, 2
+ note F#, 2
+ note B_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note B_, 1
+ note A#, 1
+ note B_, 2
+ note G#, 2
+ note E_, 2
+ note G#, 2
+ note G_, 2
+ note G#, 2
+ note A_, 2
+ octave 4
+ note C#, 2
+ note C_, 2
+ note C#, 3
+ octave 3
+ note F#, 1
+ note A_, 2
+ note G#, 2
+ note A_, 2
+ octave 4
+ note D#, 2
+ note E_, 2
+ note E_, 1
+ note D#, 1
+ note E_, 1
+ note D#, 1
+ note E_, 1
+ note D#, 1
+ note E_, 8
+ duty_cycle 3
+ sound_loop 0, Music_SurfingPikachu_branch_82d1a
+
+
+Music_SurfingPikachu_Ch2::
+ duty_cycle 3
+ vibrato 6, 1, 5
+ note_type 12, 12, 4
+ octave 3
+ note B_, 6
+ note_type 12, 12, 2
+ octave 4
+ note E_, 2
+ note_type 12, 12, 4
+ octave 3
+ note B_, 6
+ note_type 12, 12, 2
+ octave 4
+ note E_, 2
+ note_type 12, 11, 2
+ octave 3
+ note B_, 2
+ octave 4
+ note C#, 2
+ note D#, 2
+ note C#, 2
+ octave 3
+ note B_, 2
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note_type 12, 12, 4
+ octave 4
+ note C#, 6
+ note_type 12, 12, 2
+ note F#, 2
+ note_type 12, 12, 4
+ note C#, 6
+ note_type 12, 12, 2
+ note F#, 2
+ note_type 12, 11, 2
+ note C#, 2
+ note D#, 2
+ note E_, 2
+ note D#, 2
+ note C#, 2
+ octave 3
+ note B_, 2
+ note A_, 2
+ note G#, 2
+ note_type 12, 12, 2
+ note E_, 6
+ note B_, 4
+ note B_, 4
+ note B_, 8
+ note B_, 4
+ note B_, 4
+ note B_, 2
+
+Music_SurfingPikachu_branch_82de0::
+ note_type 12, 12, 6
+ octave 4
+ note E_, 4
+ octave 3
+ note B_, 4
+ note A_, 4
+ octave 4
+ note C#, 4
+ octave 3
+ note B_, 6
+ note A_, 2
+ note G#, 8
+ note F#, 6
+ note A_, 2
+ octave 4
+ note C#, 8
+ octave 3
+ note E_, 6
+ note G#, 2
+ note B_, 8
+ octave 4
+ note E_, 4
+ octave 3
+ note B_, 4
+ note A_, 4
+ octave 4
+ note C#, 4
+ octave 3
+ note B_, 6
+ octave 4
+ note D#, 2
+ note E_, 8
+ note D#, 6
+ note C#, 2
+ note D#, 1
+ rest 3
+ note F#, 4
+ note E_, 10
+ note_type 12, 12, 6
+ duty_cycle 2
+ note E_, 2
+ note D#, 2
+ note C#, 2
+ octave 3
+ note B_, 6
+ octave 4
+ note C#, 2
+ note D#, 4
+ octave 3
+ note B_, 4
+ octave 4
+ note E_, 6
+ note F#, 2
+ note G#, 8
+ note A_, 6
+ note G#, 2
+ note A_, 4
+ note F#, 4
+ note G#, 10
+ note E_, 2
+ note D#, 2
+ note C#, 2
+ octave 3
+ note B_, 6
+ octave 4
+ note C#, 2
+ note D#, 4
+ octave 3
+ note B_, 4
+ octave 4
+ note E_, 6
+ note F#, 2
+ note G#, 8
+ note A_, 4
+ note F#, 4
+ note D#, 4
+ octave 5
+ note C#, 4
+ octave 4
+ note B_, 8
+ note_type 12, 12, 2
+ octave 5
+ note E_, 4
+ note_type 12, 12, 6
+ duty_cycle 3
+ octave 3
+ note B_, 1
+ note A#, 1
+ note B_, 1
+ octave 4
+ note C#, 1
+ sound_loop 0, Music_SurfingPikachu_branch_82de0
+
+
+Music_SurfingPikachu_Ch3::
+ note_type 12, 1, 0
+ octave 4
+ note B_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 6
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D#, 1
+ rest 1
+
+Music_SurfingPikachu_branch_82ea0::
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ note C_, 1
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ note D#, 1
+ note E_, 1
+ rest 1
+ octave 4
+ note D#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note B_, 1
+ note A#, 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D_, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ sound_loop 0, Music_SurfingPikachu_branch_82ea0
diff --git a/audio/music/yellowintro.asm b/audio/music/yellowintro.asm
new file mode 100644
index 00000000..bb741a22
--- /dev/null
+++ b/audio/music/yellowintro.asm
@@ -0,0 +1,484 @@
+Music_YellowIntro_Ch1::
+ tempo 116
+ volume 7, 7
+ duty_cycle 3
+ vibrato 8, 1, 4
+ note_type 12, 11, 2
+ octave 3
+ note G#, 2
+ note B_, 4
+ note B_, 4
+ note B_, 4
+ note B_, 4
+ note B_, 4
+ note B_, 3
+ note A#, 1
+ note B_, 2
+ note B_, 10
+ note_type 12, 11, 6
+ octave 4
+ note C#, 1
+ note C_, 1
+ note C#, 10
+ octave 3
+ note G#, 1
+ note G_, 1
+ note G#, 4
+ note B_, 4
+ octave 4
+ note E_, 4
+ note F#, 8
+ note E_, 8
+ octave 3
+ note A_, 4
+ note B_, 4
+ octave 4
+ note C#, 4
+ octave 3
+ note B_, 4
+ note G#, 6
+ note_type 12, 11, 2
+ note B_, 2
+ note_type 12, 11, 6
+ note G#, 6
+ note_type 12, 11, 2
+ note B_, 2
+ note_type 12, 11, 6
+ octave 4
+ note E_, 6
+ note_type 12, 11, 2
+ note G#, 2
+ note_type 12, 11, 6
+ note E_, 6
+ note_type 12, 11, 2
+ note G#, 2
+ note_type 12, 11, 6
+ octave 3
+ note A_, 4
+ note F#, 4
+ note A_, 4
+ note B_, 4
+ note F#, 4
+ note G#, 4
+ note A_, 2
+ note G#, 2
+ note F#, 2
+ note D#, 2
+ note_type 12, 11, 3
+ note B_, 2
+ octave 4
+ note E_, 4
+ note E_, 4
+ note E_, 4
+ note E_, 2
+ note C#, 2
+ note F#, 4
+ note F#, 3
+ note D#, 1
+ note F#, 2
+ note F#, 8
+ note_type 12, 11, 6
+ note F#, 1
+ note F_, 1
+ note F#, 8
+ octave 3
+ note B_, 1
+ note A#, 1
+ note B_, 8
+ octave 4
+ note F#, 1
+ note F_, 1
+ note F#, 2
+ note_type 12, 11, 3
+ note F#, 1
+ note E_, 1
+ note D#, 1
+ note C#, 1
+ note_type 12, 11, 2
+ octave 3
+ note B_, 16
+ sound_ret
+
+
+Music_YellowIntro_Ch2::
+ duty_cycle 2
+ vibrato 6, 1, 5
+ note_type 12, 12, 2
+ octave 3
+ note B_, 2
+ octave 4
+ note E_, 4
+ note E_, 4
+ note E_, 4
+ note E_, 4
+ note E_, 4
+ note E_, 3
+ note D#, 1
+ note E_, 2
+ note E_, 4
+ note_type 12, 12, 5
+ note G#, 1
+ note G_, 1
+ note G#, 10
+ octave 3
+ note B_, 1
+ note A#, 1
+ note B_, 6
+ note_type 12, 12, 7
+ octave 4
+ note E_, 4
+ note G#, 4
+ note B_, 4
+ octave 5
+ note C#, 16
+ octave 4
+ note A_, 4
+ note G#, 4
+ note F#, 4
+ note E_, 4
+ octave 3
+ note B_, 6
+ note_type 12, 12, 2
+ octave 4
+ note E_, 2
+ note_type 12, 12, 7
+ octave 3
+ note B_, 6
+ note_type 12, 12, 2
+ octave 4
+ note E_, 2
+ note_type 12, 12, 7
+ note G#, 6
+ note_type 12, 12, 2
+ note B_, 2
+ note_type 12, 12, 7
+ note G#, 6
+ note_type 12, 12, 2
+ note B_, 2
+ note_type 12, 12, 7
+ note C#, 4
+ octave 3
+ note A_, 4
+ octave 4
+ note C#, 4
+ note D#, 4
+ note E_, 2
+ note D#, 2
+ note C#, 2
+ note D#, 4
+ note D#, 2
+ note C#, 2
+ octave 3
+ note B_, 2
+ note_type 12, 12, 3
+ octave 4
+ note E_, 2
+ note G#, 4
+ note G#, 4
+ note G#, 4
+ note G#, 2
+ note F#, 2
+ note A_, 4
+ note A_, 3
+ note F#, 1
+ note A_, 2
+ note A_, 4
+ note_type 12, 12, 7
+ note B_, 1
+ note A#, 1
+ note B_, 8
+ note B_, 1
+ note A#, 1
+ note B_, 8
+ note B_, 1
+ note A#, 1
+ note B_, 6
+ note_type 12, 12, 3
+ note B_, 1
+ note A_, 1
+ note G#, 1
+ note F#, 1
+ note_type 12, 12, 2
+ note E_, 16
+ sound_ret
+
+
+Music_YellowIntro_Ch3::
+ note_type 12, 1, 0
+ octave 4
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ octave 3
+ note B_, 1
+ rest 1
+ octave 4
+ note C#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note F#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note C#, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 1
+ octave 4
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note G#, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note A_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note E_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note E_, 1
+ rest 1
+ octave 5
+ note E_, 1
+ rest 1
+ octave 4
+ note A_, 1
+ rest 1
+ octave 5
+ note F#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ rest 1
+ octave 5
+ note C#, 1
+ rest 3
+ note F#, 1
+ rest 1
+ octave 4
+ note F#, 1
+ note G#, 1
+ note A_, 1
+ octave 5
+ note C#, 1
+ note E_, 1
+ rest 15
+ sound_ret
diff --git a/audio/music/yellowunusedsong.asm b/audio/music/yellowunusedsong.asm
new file mode 100644
index 00000000..f1e4d18f
--- /dev/null
+++ b/audio/music/yellowunusedsong.asm
@@ -0,0 +1,326 @@
+Music_YellowUnusedSong_Ch1::
+ tempo 140
+ volume 7, 7
+ duty_cycle 3
+ vibrato 8, 1, 4
+ note_type 8, 11, 2
+ octave 3
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note G_, 6
+ note G_, 6
+ note A_, 6
+ note E_, 6
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note A_, 6
+ note G_, 6
+ note A_, 12
+
+Music_YellowUnusedSong_branch_82fde::
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note G_, 6
+ note G_, 6
+ note A_, 6
+ note E_, 6
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note G_, 6
+ octave 4
+ note D#, 6
+ note D_, 12
+ rest 16
+ rest 16
+ rest 16
+ rest 16
+ rest 16
+ rest 16
+ octave 3
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note G_, 6
+ note G_, 6
+ note A_, 6
+ note E_, 6
+ note A_, 6
+ note A_, 2
+ note A_, 2
+ note A_, 2
+ note A#, 6
+ note A#, 6
+ note A_, 6
+ note G_, 6
+ note A_, 12
+ sound_loop 0, Music_YellowUnusedSong_branch_82fde
+
+
+Music_YellowUnusedSong_Ch2::
+ duty_cycle 2
+ note_type 8, 12, 2
+ octave 4
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note C_, 6
+ note C_, 6
+ note D_, 6
+ octave 3
+ note A_, 6
+ octave 4
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note D_, 6
+ note A#, 6
+ note A_, 12
+
+Music_YellowUnusedSong_branch_8302a::
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note C_, 6
+ note C_, 6
+ note D_, 6
+ octave 3
+ note A_, 6
+ octave 4
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note C_, 6
+ note G#, 6
+ note G_, 12
+ note_type 8, 9, 0
+ octave 3
+ note D#, 16
+ note D#, 8
+ note D#, 16
+ note D#, 8
+ octave 2
+ note A#, 16
+ note A#, 8
+ octave 3
+ note D#, 12
+ note F_, 12
+ note_type 8, 12, 2
+ octave 4
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note C_, 6
+ note C_, 6
+ note D_, 6
+ octave 3
+ note A_, 6
+ octave 4
+ note D_, 6
+ note D_, 2
+ note D_, 2
+ note D_, 2
+ note D#, 6
+ note D#, 6
+ note D_, 6
+ note A#, 6
+ note A_, 12
+ sound_loop 0, Music_YellowUnusedSong_branch_8302a
+
+
+Music_YellowUnusedSong_Ch3::
+ note_type 12, 1, 0
+ vibrato 2, 1, 5
+ rest 16
+ rest 12
+ octave 4
+ note C_, 4
+ note D_, 8
+ note D#, 8
+ note G_, 8
+ note A#, 8
+
+Music_YellowUnusedSong_branch_83075::
+ note A_, 8
+ note A#, 8
+ note G_, 8
+ note A_, 4
+ note D_, 4
+ note A_, 8
+ note A#, 8
+ octave 5
+ note C#, 8
+ note D_, 8
+ note D#, 16
+ note D#, 16
+ octave 4
+ note A#, 16
+ octave 5
+ note D#, 8
+ note F_, 8
+ octave 4
+ note D_, 16
+ note D_, 16
+ octave 4
+ note D_, 8
+ note D#, 8
+ note G_, 8
+ note A#, 8
+ sound_loop 0, Music_YellowUnusedSong_branch_83075
+
+
+Music_YellowUnusedSong_Ch4::
+ drum_speed 12
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 4
+ drum_note 3, 4
+
+Music_YellowUnusedSong_branch_830c3::
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 4
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_speed 8
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_speed 12
+ drum_note 3, 4
+ drum_note 3, 4
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 2
+ drum_note 3, 4
+ drum_note 3, 4
+ sound_loop 0, Music_YellowUnusedSong_branch_830c3
diff --git a/audio/pikachu_cries.asm b/audio/pikachu_cries.asm
new file mode 100644
index 00000000..4ccc6181
--- /dev/null
+++ b/audio/pikachu_cries.asm
@@ -0,0 +1,172 @@
+pcm: MACRO
+; All of the pcm data has one trailing byte that is never processed.
+ dw .End - .Start - 1
+.Start
+\1
+.End
+ENDM
+
+
+SECTION "Pikachu Cries 1", ROMX
+
+PikachuCry1::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_1.pcm"
+
+PikachuCry2::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_2.pcm"
+
+PikachuCry3::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_3.pcm"
+
+PikachuCry4::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_4.pcm"
+
+
+SECTION "Pikachu Cries 2", ROMX
+
+PikachuCry5::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_5.pcm"
+
+PikachuCry6::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_6.pcm"
+
+PikachuCry7::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_7.pcm"
+
+
+SECTION "Pikachu Cries 3", ROMX
+
+PikachuCry8::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_8.pcm"
+
+PikachuCry9::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_9.pcm"
+
+PikachuCry10::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_10.pcm"
+
+
+SECTION "Pikachu Cries 4", ROMX
+
+PikachuCry11::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_11.pcm"
+
+PikachuCry12::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_12.pcm"
+
+PikachuCry13::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_13.pcm"
+
+
+SECTION "Pikachu Cries 5", ROMX
+
+PikachuCry14::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_14.pcm"
+
+PikachuCry15::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_15.pcm"
+
+
+SECTION "Pikachu Cries 6", ROMX
+
+PikachuCry16::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_16.pcm"
+
+PikachuCry18::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_18.pcm"
+
+PikachuCry22::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_22.pcm"
+
+
+SECTION "Pikachu Cries 7", ROMX
+
+PikachuCry20::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_20.pcm"
+
+PikachuCry21::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_21.pcm"
+
+
+SECTION "Pikachu Cries 8", ROMX
+
+PikachuCry19::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_19.pcm"
+
+PikachuCry24::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_24.pcm"
+
+PikachuCry26::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_26.pcm"
+
+
+SECTION "Pikachu Cries 9", ROMX
+
+PikachuCry17::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_17.pcm"
+
+PikachuCry23::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_23.pcm"
+
+PikachuCry25::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_25.pcm"
+
+
+SECTION "Pikachu Cries 10", ROMX
+
+PikachuCry27::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_27.pcm"
+
+PikachuCry28::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_28.pcm"
+
+PikachuCry29::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_29.pcm"
+
+PikachuCry30::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_30.pcm"
+
+PikachuCry31::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_31.pcm"
+
+
+SECTION "Pikachu Cries 11", ROMX
+
+PikachuCry32::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_32.pcm"
+
+PikachuCry33::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_33.pcm"
+
+PikachuCry34::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_34.pcm"
+
+PikachuCry41::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_41.pcm"
+
+
+SECTION "Pikachu Cries 12", ROMX
+
+PikachuCry35::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_35.pcm"
+
+PikachuCry36::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_36.pcm"
+
+PikachuCry39::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_39.pcm"
+
+
+SECTION "Pikachu Cries 13", ROMX
+
+PikachuCry37::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_37.pcm"
+
+PikachuCry38::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_38.pcm"
+
+PikachuCry40::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_40.pcm"
+
+PikachuCry42::
+ pcm INCBIN "audio/pikachu_cries/pikachu_cry_42.pcm"
diff --git a/audio/pikachu_cries/pikachu_cry_1.wav b/audio/pikachu_cries/pikachu_cry_1.wav
new file mode 100644
index 00000000..4d384ac7
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_1.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_10.wav b/audio/pikachu_cries/pikachu_cry_10.wav
new file mode 100644
index 00000000..452def52
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_10.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_11.wav b/audio/pikachu_cries/pikachu_cry_11.wav
new file mode 100644
index 00000000..39b6f5c0
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_11.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_12.wav b/audio/pikachu_cries/pikachu_cry_12.wav
new file mode 100644
index 00000000..6bdcd74b
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_12.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_13.wav b/audio/pikachu_cries/pikachu_cry_13.wav
new file mode 100644
index 00000000..1bdbc65c
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_13.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_14.wav b/audio/pikachu_cries/pikachu_cry_14.wav
new file mode 100644
index 00000000..38932232
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_14.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_15.wav b/audio/pikachu_cries/pikachu_cry_15.wav
new file mode 100644
index 00000000..7424d663
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_15.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_16.wav b/audio/pikachu_cries/pikachu_cry_16.wav
new file mode 100644
index 00000000..d703e1e9
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_16.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_17.wav b/audio/pikachu_cries/pikachu_cry_17.wav
new file mode 100644
index 00000000..9558a0ec
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_17.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_18.wav b/audio/pikachu_cries/pikachu_cry_18.wav
new file mode 100644
index 00000000..08e7a1f3
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_18.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_19.wav b/audio/pikachu_cries/pikachu_cry_19.wav
new file mode 100644
index 00000000..2bc077bd
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_19.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_2.wav b/audio/pikachu_cries/pikachu_cry_2.wav
new file mode 100644
index 00000000..624bf2d4
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_2.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_20.wav b/audio/pikachu_cries/pikachu_cry_20.wav
new file mode 100644
index 00000000..44152d7c
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_20.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_21.wav b/audio/pikachu_cries/pikachu_cry_21.wav
new file mode 100644
index 00000000..72b3dde6
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_21.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_22.wav b/audio/pikachu_cries/pikachu_cry_22.wav
new file mode 100644
index 00000000..9c764d04
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_22.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_23.wav b/audio/pikachu_cries/pikachu_cry_23.wav
new file mode 100644
index 00000000..4d88f7ae
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_23.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_24.wav b/audio/pikachu_cries/pikachu_cry_24.wav
new file mode 100644
index 00000000..b7a31857
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_24.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_25.wav b/audio/pikachu_cries/pikachu_cry_25.wav
new file mode 100644
index 00000000..9b05e306
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_25.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_26.wav b/audio/pikachu_cries/pikachu_cry_26.wav
new file mode 100644
index 00000000..89dec6f3
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_26.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_27.wav b/audio/pikachu_cries/pikachu_cry_27.wav
new file mode 100644
index 00000000..be7d2168
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_27.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_28.wav b/audio/pikachu_cries/pikachu_cry_28.wav
new file mode 100644
index 00000000..1117c422
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_28.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_29.wav b/audio/pikachu_cries/pikachu_cry_29.wav
new file mode 100644
index 00000000..df3ab87c
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_29.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_3.wav b/audio/pikachu_cries/pikachu_cry_3.wav
new file mode 100644
index 00000000..20429bfa
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_3.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_30.wav b/audio/pikachu_cries/pikachu_cry_30.wav
new file mode 100644
index 00000000..d420f509
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_30.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_31.wav b/audio/pikachu_cries/pikachu_cry_31.wav
new file mode 100644
index 00000000..658c48a2
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_31.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_32.wav b/audio/pikachu_cries/pikachu_cry_32.wav
new file mode 100644
index 00000000..52ff34bb
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_32.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_33.wav b/audio/pikachu_cries/pikachu_cry_33.wav
new file mode 100644
index 00000000..f7a13cb3
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_33.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_34.wav b/audio/pikachu_cries/pikachu_cry_34.wav
new file mode 100644
index 00000000..d6a66bfb
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_34.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_35.wav b/audio/pikachu_cries/pikachu_cry_35.wav
new file mode 100644
index 00000000..0a6a4559
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_35.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_36.wav b/audio/pikachu_cries/pikachu_cry_36.wav
new file mode 100644
index 00000000..d59194e7
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_36.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_37.wav b/audio/pikachu_cries/pikachu_cry_37.wav
new file mode 100644
index 00000000..ea4f20c4
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_37.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_38.wav b/audio/pikachu_cries/pikachu_cry_38.wav
new file mode 100644
index 00000000..63f5a4f8
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_38.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_39.wav b/audio/pikachu_cries/pikachu_cry_39.wav
new file mode 100644
index 00000000..3d8f17bb
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_39.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_4.wav b/audio/pikachu_cries/pikachu_cry_4.wav
new file mode 100644
index 00000000..8f0ac046
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_4.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_40.wav b/audio/pikachu_cries/pikachu_cry_40.wav
new file mode 100644
index 00000000..719382ca
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_40.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_41.wav b/audio/pikachu_cries/pikachu_cry_41.wav
new file mode 100644
index 00000000..a12208c8
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_41.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_42.wav b/audio/pikachu_cries/pikachu_cry_42.wav
new file mode 100644
index 00000000..8cae8eda
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_42.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_5.wav b/audio/pikachu_cries/pikachu_cry_5.wav
new file mode 100644
index 00000000..64959015
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_5.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_6.wav b/audio/pikachu_cries/pikachu_cry_6.wav
new file mode 100644
index 00000000..d91e2852
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_6.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_7.wav b/audio/pikachu_cries/pikachu_cry_7.wav
new file mode 100644
index 00000000..4b61cfc5
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_7.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_8.wav b/audio/pikachu_cries/pikachu_cry_8.wav
new file mode 100644
index 00000000..20a4d345
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_8.wav
Binary files differ
diff --git a/audio/pikachu_cries/pikachu_cry_9.wav b/audio/pikachu_cries/pikachu_cry_9.wav
new file mode 100644
index 00000000..1f4a8238
--- /dev/null
+++ b/audio/pikachu_cries/pikachu_cry_9.wav
Binary files differ
diff --git a/audio/play_battle_music.asm b/audio/play_battle_music.asm
index 93cf8a77..bf86c9ae 100644
--- a/audio/play_battle_music.asm
+++ b/audio/play_battle_music.asm
@@ -2,9 +2,7 @@ PlayBattleMusic::
xor a
ld [wAudioFadeOutControl], a
ld [wLowHealthAlarm], a
- dec a ; SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
call DelayFrame
ld c, BANK(Music_GymLeaderBattle)
ld a, [wGymLeaderNo]
diff --git a/audio/pokedex_rating_sfx.asm b/audio/pokedex_rating_sfx.asm
index 4a5647cb..aefbd066 100644
--- a/audio/pokedex_rating_sfx.asm
+++ b/audio/pokedex_rating_sfx.asm
@@ -10,9 +10,7 @@ PlayPokedexRatingSfx::
jr .getSfxPointer
.gotSfxPointer
push bc
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySoundWaitForCurrent
+ call StopAllMusic
pop bc
ld b, $0
ld hl, PokedexRatingSfxPointers
diff --git a/audio/sfx/battle_27.asm b/audio/sfx/battle_27.asm
index 1b505811..33f273fa 100644
--- a/audio/sfx/battle_27.asm
+++ b/audio/sfx/battle_27.asm
@@ -2,9 +2,9 @@ SFX_Battle_27_Ch5:
duty_cycle 2
square_note 15, 3, -7, 1984
-SFX_Battle_27_branch_2062a:
+SFX_Battle_27_branch_205da:
square_note 15, 13, -7, 1984
- sound_loop 4, SFX_Battle_27_branch_2062a
+ sound_loop 4, SFX_Battle_27_branch_205da
square_note 15, 13, 1, 1984
sound_ret
@@ -13,9 +13,9 @@ SFX_Battle_27_Ch6:
duty_cycle_pattern 2, 3, 0, 3
square_note 15, 2, -7, 1992
-SFX_Battle_27_branch_2063d:
+SFX_Battle_27_branch_205ed:
square_note 15, 12, -7, 1991
- sound_loop 4, SFX_Battle_27_branch_2063d
+ sound_loop 4, SFX_Battle_27_branch_205ed
square_note 15, 12, 1, 1992
sound_ret
diff --git a/audio/sfx/battle_36.asm b/audio/sfx/battle_36.asm
index 773bf753..ea4d351f 100644
--- a/audio/sfx/battle_36.asm
+++ b/audio/sfx/battle_36.asm
@@ -12,10 +12,10 @@ SFX_Battle_36_Ch5:
square_note 2, 15, 1, 1792
square_note 2, 15, 1, 2000
-SFX_Battle_36_branch_20930:
+SFX_Battle_36_branch_208e0:
square_note 2, 15, 1, 1792
square_note 2, 15, 1, 2016
- sound_loop 12, SFX_Battle_36_branch_20930
+ sound_loop 12, SFX_Battle_36_branch_208e0
square_note 15, 15, 1, 1792
sound_ret
@@ -35,7 +35,7 @@ SFX_Battle_36_Ch6:
square_note 2, 15, 1, 2001
square_note 2, 15, 1, 1793
square_note 2, 15, 1, 2017
- sound_loop 12, SFX_Battle_36_branch_20930
+ sound_loop 12, SFX_Battle_36_branch_208e0
square_note 15, 15, 1, 1793
sound_ret
diff --git a/audio/sfx/cry00_4.asm b/audio/sfx/cry00_4.asm
new file mode 100644
index 00000000..87bf036e
--- /dev/null
+++ b/audio/sfx/cry00_4.asm
@@ -0,0 +1,21 @@
+SFX_Cry00_4_Ch5:
+ duty_cycle_pattern 3, 3, 1, 1
+ square_note 4, 15, 3, 1816
+ square_note 15, 14, 5, 1944
+ square_note 8, 9, 1, 1880
+ sound_ret
+
+
+SFX_Cry00_4_Ch6:
+ duty_cycle_pattern 2, 2, 0, 0
+ square_note 5, 11, 3, 1800
+ square_note 15, 12, 5, 1928
+ square_note 8, 7, 1, 1864
+ sound_ret
+
+
+SFX_Cry00_4_Ch8:
+ noise_note 3, 10, 1, 28
+ noise_note 14, 9, 4, 44
+ noise_note 8, 8, 1, 28
+ sound_ret
diff --git a/audio/sfx/cry01_4.asm b/audio/sfx/cry01_4.asm
new file mode 100644
index 00000000..98824d06
--- /dev/null
+++ b/audio/sfx/cry01_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry01_4_Ch5:
+ duty_cycle_pattern 2, 2, 0, 0
+ square_note 4, 15, 3, 1536
+ square_note 8, 13, 5, 1888
+ square_note 3, 14, 2, 1824
+ square_note 8, 13, 1, 1808
+ sound_ret
+
+
+SFX_Cry01_4_Ch6:
+ duty_cycle_pattern 1, 1, 2, 2
+ square_note 5, 11, 3, 1777
+ square_note 7, 12, 5, 1874
+ square_note 3, 10, 2, 1809
+ square_note 8, 11, 1, 1537
+ sound_ret
+
+
+SFX_Cry01_4_Ch8:
+ noise_note 3, 10, 2, 60
+ noise_note 12, 9, 4, 44
+ noise_note 3, 8, 2, 28
+ noise_note 8, 7, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry02_4.asm b/audio/sfx/cry02_4.asm
new file mode 100644
index 00000000..aed17087
--- /dev/null
+++ b/audio/sfx/cry02_4.asm
@@ -0,0 +1,17 @@
+SFX_Cry02_4_Ch5:
+ duty_cycle 0
+ square_note 8, 15, 5, 1152
+ square_note 2, 14, 1, 1504
+ square_note 8, 13, 1, 1500
+ sound_ret
+
+
+SFX_Cry02_4_Ch6:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 7, 9, 5, 1089
+ square_note 2, 8, 1, 1313
+ square_note 8, 6, 1, 1306
+
+
+SFX_Cry02_4_Ch8:
+ sound_ret
diff --git a/audio/sfx/cry03_4.asm b/audio/sfx/cry03_4.asm
new file mode 100644
index 00000000..b4de22ce
--- /dev/null
+++ b/audio/sfx/cry03_4.asm
@@ -0,0 +1,30 @@
+SFX_Cry03_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 4, 15, 7, 1544
+ square_note 6, 14, 6, 1536
+ square_note 6, 13, 7, 1520
+ square_note 6, 12, 4, 1504
+ square_note 5, 13, 3, 1472
+ square_note 4, 13, 3, 1440
+ square_note 8, 14, 1, 1408
+ sound_ret
+
+
+SFX_Cry03_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 4, 12, 7, 1284
+ square_note 6, 10, 6, 1282
+ square_note 6, 9, 7, 1265
+ square_note 4, 11, 4, 1249
+ square_note 5, 10, 3, 1218
+ square_note 4, 11, 3, 1187
+ square_note 8, 12, 1, 1154
+ sound_ret
+
+
+SFX_Cry03_4_Ch8:
+ noise_note 12, 14, 4, 76
+ noise_note 10, 12, 7, 92
+ noise_note 12, 11, 6, 76
+ noise_note 15, 10, 2, 92
+ sound_ret
diff --git a/audio/sfx/cry04_4.asm b/audio/sfx/cry04_4.asm
new file mode 100644
index 00000000..408ab37a
--- /dev/null
+++ b/audio/sfx/cry04_4.asm
@@ -0,0 +1,32 @@
+SFX_Cry04_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 4, 15, 7, 1696
+ square_note 8, 14, 6, 1700
+ square_note 4, 13, 6, 1696
+ square_note 12, 13, 3, 1568
+ square_note 8, 12, 3, 1572
+ square_note 4, 12, 2, 1568
+ square_note 8, 11, 1, 1552
+ sound_ret
+
+
+SFX_Cry04_4_Ch6:
+ duty_cycle_pattern 1, 1, 2, 2
+ square_note 4, 14, 7, 1537
+ square_note 8, 13, 6, 1539
+ square_note 4, 12, 6, 1537
+ square_note 12, 12, 3, 1409
+ square_note 8, 11, 3, 1411
+ square_note 4, 11, 2, 1410
+ square_note 8, 10, 1, 1393
+ sound_ret
+
+
+SFX_Cry04_4_Ch8:
+ noise_note 7, 13, 6, 92
+ noise_note 8, 14, 6, 76
+ noise_note 4, 13, 4, 92
+ noise_note 4, 13, 4, 76
+ noise_note 7, 12, 3, 76
+ noise_note 8, 10, 1, 92
+ sound_ret
diff --git a/audio/sfx/cry05_4.asm b/audio/sfx/cry05_4.asm
new file mode 100644
index 00000000..cce656b1
--- /dev/null
+++ b/audio/sfx/cry05_4.asm
@@ -0,0 +1,19 @@
+SFX_Cry05_4_Ch5:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 6, 14, 2, 1280
+ square_note 6, 14, 3, 1408
+ square_note 6, 13, 3, 1392
+ square_note 8, 10, 1, 1376
+ sound_ret
+
+
+SFX_Cry05_4_Ch6:
+ duty_cycle_pattern 3, 3, 1, 1
+ square_note 6, 14, 2, 1154
+ square_note 6, 13, 3, 1281
+ square_note 6, 11, 2, 1250
+ square_note 8, 8, 1, 1217
+
+
+SFX_Cry05_4_Ch8:
+ sound_ret
diff --git a/audio/sfx/cry06_4.asm b/audio/sfx/cry06_4.asm
new file mode 100644
index 00000000..2fbbb161
--- /dev/null
+++ b/audio/sfx/cry06_4.asm
@@ -0,0 +1,22 @@
+SFX_Cry06_4_Ch5:
+ duty_cycle_pattern 3, 3, 2, 2
+ square_note 6, 8, 3, 583
+ square_note 15, 6, 2, 550
+ square_note 4, 5, 2, 581
+ square_note 9, 6, 3, 518
+ square_note 15, 8, 2, 549
+ square_note 15, 4, 2, 519
+
+
+SFX_Cry06_4_Ch6:
+ sound_ret
+
+
+SFX_Cry06_4_Ch8:
+ noise_note 8, 13, 4, 140
+ noise_note 4, 14, 2, 156
+ noise_note 15, 12, 6, 140
+ noise_note 8, 14, 4, 172
+ noise_note 15, 13, 7, 156
+ noise_note 15, 15, 2, 172
+ sound_ret
diff --git a/audio/sfx/cry07_4.asm b/audio/sfx/cry07_4.asm
new file mode 100644
index 00000000..7e44544f
--- /dev/null
+++ b/audio/sfx/cry07_4.asm
@@ -0,0 +1,21 @@
+SFX_Cry07_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 4, 15, 3, 1760
+ square_note 15, 14, 4, 1600
+ square_note 8, 12, 1, 1568
+ sound_ret
+
+
+SFX_Cry07_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 3, 12, 3, 1667
+ square_note 14, 11, 4, 1538
+ square_note 8, 10, 1, 1537
+ sound_ret
+
+
+SFX_Cry07_4_Ch8:
+ noise_note 4, 13, 3, 92
+ noise_note 15, 14, 6, 76
+ noise_note 8, 11, 1, 92
+ sound_ret
diff --git a/audio/sfx/cry08_4.asm b/audio/sfx/cry08_4.asm
new file mode 100644
index 00000000..67dcb820
--- /dev/null
+++ b/audio/sfx/cry08_4.asm
@@ -0,0 +1,23 @@
+SFX_Cry08_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 15, 6, 1381
+ square_note 10, 14, 4, 1404
+ square_note 3, 12, 2, 1372
+ square_note 15, 11, 2, 1340
+ sound_ret
+
+
+SFX_Cry08_4_Ch6:
+ duty_cycle_pattern 1, 1, 2, 2
+ square_note 14, 13, 6, 1283
+ square_note 9, 11, 4, 1307
+ square_note 4, 9, 2, 1274
+ square_note 15, 10, 2, 1243
+ sound_ret
+
+
+SFX_Cry08_4_Ch8:
+ noise_note 12, 14, 6, 76
+ noise_note 11, 13, 7, 92
+ noise_note 15, 12, 2, 76
+ sound_ret
diff --git a/audio/sfx/cry09_4.asm b/audio/sfx/cry09_4.asm
new file mode 100644
index 00000000..7dec80d3
--- /dev/null
+++ b/audio/sfx/cry09_4.asm
@@ -0,0 +1,35 @@
+SFX_Cry09_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 15, 7, 1952
+ square_note 6, 14, 6, 1955
+ square_note 10, 15, 4, 1952
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 10, 15, 6, 2008
+ square_note 4, 14, 3, 2007
+ square_note 15, 15, 2, 2008
+ sound_ret
+
+
+SFX_Cry09_4_Ch6:
+ duty_cycle_pattern 0, 0, 1, 1
+ square_note 2, 0, 8, 0
+ square_note 15, 10, 7, 1697
+ square_note 6, 8, 6, 1698
+ square_note 10, 7, 4, 1697
+ duty_cycle_pattern 1, 1, 3, 3
+ square_note 10, 7, 6, 1750
+ square_note 4, 8, 3, 1753
+ square_note 15, 10, 2, 1751
+ sound_ret
+
+
+SFX_Cry09_4_Ch8:
+ noise_note 2, 15, 2, 60
+ noise_note 8, 14, 4, 62
+ noise_note 15, 13, 7, 60
+ noise_note 6, 12, 5, 59
+ noise_note 6, 14, 4, 61
+ noise_note 8, 11, 6, 60
+ noise_note 6, 13, 4, 61
+ noise_note 8, 12, 1, 59
+ sound_ret
diff --git a/audio/sfx/cry0a_4.asm b/audio/sfx/cry0a_4.asm
new file mode 100644
index 00000000..c3cf315b
--- /dev/null
+++ b/audio/sfx/cry0a_4.asm
@@ -0,0 +1,35 @@
+SFX_Cry0A_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 8, 15, 7, 1760
+ square_note 6, 14, 6, 1765
+ square_note 3, 15, 4, 1760
+ square_note 3, 15, 6, 1744
+ square_note 3, 14, 3, 1728
+ square_note 4, 15, 2, 1712
+ square_note 15, 10, 2, 1736
+ sound_ret
+
+
+SFX_Cry0A_4_Ch6:
+ duty_cycle_pattern 0, 0, 1, 1
+ square_note 3, 0, 8, 0
+ square_note 8, 10, 7, 1697
+ square_note 6, 8, 6, 1699
+ square_note 3, 7, 4, 1697
+ square_note 3, 7, 6, 1681
+ square_note 3, 8, 3, 1666
+ square_note 4, 10, 2, 1649
+ square_note 15, 7, 2, 1673
+ sound_ret
+
+
+SFX_Cry0A_4_Ch8:
+ noise_note 2, 15, 2, 60
+ noise_note 8, 14, 4, 62
+ noise_note 8, 13, 7, 60
+ noise_note 5, 12, 5, 59
+ noise_note 3, 13, 4, 44
+ noise_note 2, 11, 6, 60
+ noise_note 3, 10, 4, 44
+ noise_note 8, 9, 1, 60
+ sound_ret
diff --git a/audio/sfx/cry0b_4.asm b/audio/sfx/cry0b_4.asm
new file mode 100644
index 00000000..610e2831
--- /dev/null
+++ b/audio/sfx/cry0b_4.asm
@@ -0,0 +1,37 @@
+SFX_Cry0B_4_Ch5:
+ duty_cycle_pattern 3, 0, 3, 0
+ square_note 4, 15, 1, 1792
+ square_note 4, 14, 1, 1920
+ square_note 4, 13, 1, 1856
+ square_note 4, 14, 1, 1856
+ square_note 4, 15, 1, 1920
+ square_note 4, 13, 1, 1792
+ square_note 4, 15, 1, 1793
+ square_note 4, 13, 1, 1922
+ square_note 4, 12, 1, 1858
+ square_note 8, 11, 1, 1857
+ sound_ret
+
+
+SFX_Cry0B_4_Ch6:
+ duty_cycle_pattern 1, 0, 1, 0
+ square_note 12, 0, 8, 0
+ square_note 4, 15, 1, 1793
+ square_note 4, 14, 1, 1922
+ square_note 4, 13, 1, 1857
+ square_note 4, 14, 1, 1857
+ square_note 4, 15, 1, 1922
+ square_note 8, 13, 1, 1793
+ sound_ret
+
+
+SFX_Cry0B_4_Ch8:
+ noise_note 15, 0, 8, 0
+ noise_note 4, 0, 8, 0
+ noise_note 4, 13, 1, 76
+ noise_note 4, 11, 1, 44
+ noise_note 4, 13, 1, 60
+ noise_note 4, 11, 1, 60
+ noise_note 4, 12, 1, 44
+ noise_note 8, 10, 1, 76
+ sound_ret
diff --git a/audio/sfx/cry0c_4.asm b/audio/sfx/cry0c_4.asm
new file mode 100644
index 00000000..cc8766a1
--- /dev/null
+++ b/audio/sfx/cry0c_4.asm
@@ -0,0 +1,29 @@
+SFX_Cry0C_4_Ch5:
+ duty_cycle_pattern 3, 0, 3, 0
+ square_note 8, 15, 5, 1536
+ square_note 2, 13, 2, 1592
+ square_note 2, 12, 2, 1584
+ square_note 2, 12, 2, 1576
+ square_note 2, 11, 2, 1568
+ square_note 2, 11, 2, 1552
+ square_note 2, 10, 2, 1560
+ square_note 2, 11, 2, 1552
+ square_note 8, 12, 1, 1568
+ sound_ret
+
+
+SFX_Cry0C_4_Ch6:
+ duty_cycle_pattern 1, 0, 1, 0
+ square_note 12, 12, 3, 1472
+ square_note 3, 11, 1, 1529
+ square_note 2, 10, 1, 1521
+ square_note 2, 10, 1, 1513
+ square_note 2, 9, 1, 1505
+ square_note 2, 9, 1, 1497
+ square_note 2, 8, 1, 1489
+ square_note 2, 9, 1, 1497
+ square_note 8, 9, 1, 1505
+
+
+SFX_Cry0C_4_Ch8:
+ sound_ret
diff --git a/audio/sfx/cry0d_4.asm b/audio/sfx/cry0d_4.asm
new file mode 100644
index 00000000..2119f0a9
--- /dev/null
+++ b/audio/sfx/cry0d_4.asm
@@ -0,0 +1,40 @@
+SFX_Cry0D_4_Ch5:
+ duty_cycle_pattern 2, 0, 2, 0
+ square_note 5, 15, 2, 1616
+ square_note 9, 13, 1, 1632
+ square_note 5, 14, 2, 1554
+ square_note 9, 12, 1, 1570
+ square_note 5, 15, 2, 1552
+ square_note 6, 13, 1, 1568
+ sound_loop 2, SFX_Cry0D_4_Ch5
+ sound_ret
+
+
+SFX_Cry0D_4_Ch6:
+ duty_cycle_pattern 1, 0, 0, 0
+ square_note 4, 0, 8, 0
+ square_note 5, 15, 2, 1617
+ square_note 9, 13, 1, 1633
+ square_note 5, 14, 2, 1556
+ square_note 8, 12, 1, 1572
+ square_note 5, 15, 2, 1553
+ square_note 12, 13, 1, 1569
+ square_note 5, 14, 2, 1556
+ square_note 8, 12, 1, 1572
+ square_note 5, 15, 2, 1553
+ square_note 4, 13, 1, 1569
+ sound_ret
+
+
+SFX_Cry0D_4_Ch8:
+ noise_note 6, 13, 2, 28
+ noise_note 9, 11, 1, 44
+ noise_note 8, 12, 2, 44
+ noise_note 9, 11, 1, 60
+ noise_note 6, 12, 2, 44
+ noise_note 9, 10, 2, 60
+ noise_note 7, 12, 2, 44
+ noise_note 5, 10, 1, 60
+ noise_note 9, 12, 2, 44
+ noise_note 4, 10, 1, 60
+ sound_ret
diff --git a/audio/sfx/cry0e_4.asm b/audio/sfx/cry0e_4.asm
new file mode 100644
index 00000000..0c18e996
--- /dev/null
+++ b/audio/sfx/cry0e_4.asm
@@ -0,0 +1,23 @@
+SFX_Cry0E_4_Ch5:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 4, 14, 1, 1792
+ square_note 4, 15, 2, 1920
+ square_note 2, 9, 2, 1856
+ square_note 8, 14, 1, 1536
+ sound_ret
+
+
+SFX_Cry0E_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 4, 11, 1, 1761
+ square_note 3, 12, 2, 1761
+ square_note 3, 6, 2, 1665
+ square_note 8, 11, 1, 1505
+ sound_ret
+
+
+SFX_Cry0E_4_Ch8:
+ noise_note 2, 6, 1, 50
+ noise_note 2, 6, 1, 33
+ noise_note 8, 6, 1, 17
+ sound_ret
diff --git a/audio/sfx/cry0f_4.asm b/audio/sfx/cry0f_4.asm
new file mode 100644
index 00000000..6debdb09
--- /dev/null
+++ b/audio/sfx/cry0f_4.asm
@@ -0,0 +1,29 @@
+SFX_Cry0F_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 1
+ square_note 4, 15, 7, 1984
+ square_note 12, 14, 6, 1986
+ square_note 6, 11, 5, 1664
+ square_note 4, 12, 4, 1648
+ square_note 4, 11, 5, 1632
+ square_note 8, 12, 1, 1600
+ sound_ret
+
+
+SFX_Cry0F_4_Ch6:
+ duty_cycle_pattern 3, 0, 3, 0
+ square_note 3, 12, 7, 1921
+ square_note 12, 11, 6, 1920
+ square_note 6, 10, 5, 1601
+ square_note 4, 12, 4, 1586
+ square_note 6, 11, 5, 1569
+ square_note 8, 10, 1, 1538
+ sound_ret
+
+
+SFX_Cry0F_4_Ch8:
+ noise_note 3, 14, 4, 60
+ noise_note 12, 13, 6, 44
+ noise_note 4, 14, 4, 60
+ noise_note 8, 11, 7, 92
+ noise_note 15, 12, 2, 93
+ sound_ret
diff --git a/audio/sfx/cry10_4.asm b/audio/sfx/cry10_4.asm
new file mode 100644
index 00000000..39c374bc
--- /dev/null
+++ b/audio/sfx/cry10_4.asm
@@ -0,0 +1,31 @@
+SFX_Cry10_4_Ch5:
+ duty_cycle_pattern 3, 0, 2, 1
+ square_note 8, 15, 7, 1664
+ square_note 2, 15, 7, 1632
+ square_note 1, 14, 7, 1600
+ square_note 1, 14, 7, 1568
+ square_note 15, 13, 1, 1536
+ square_note 4, 12, 7, 1856
+ square_note 4, 10, 7, 1840
+ square_note 15, 9, 1, 1824
+ sound_ret
+
+
+SFX_Cry10_4_Ch6:
+ duty_cycle_pattern 1, 3, 2, 1
+ square_note 10, 14, 7, 1666
+ square_note 2, 14, 7, 1634
+ square_note 1, 13, 7, 1602
+ square_note 1, 13, 7, 1570
+ square_note 15, 12, 1, 1538
+ square_note 4, 11, 7, 1858
+ square_note 2, 9, 7, 1842
+ square_note 15, 8, 1, 1826
+ sound_ret
+
+
+SFX_Cry10_4_Ch8:
+ noise_note 4, 7, 4, 33
+ noise_note 4, 7, 4, 16
+ noise_note 4, 7, 1, 32
+ sound_ret
diff --git a/audio/sfx/cry11_4.asm b/audio/sfx/cry11_4.asm
new file mode 100644
index 00000000..8e75ec6a
--- /dev/null
+++ b/audio/sfx/cry11_4.asm
@@ -0,0 +1,34 @@
+SFX_Cry11_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 6, 15, 7, 1952
+ square_note 8, 14, 6, 1956
+ square_note 4, 13, 6, 1952
+ square_note 15, 13, 3, 1824
+ square_note 8, 12, 3, 1827
+ square_note 2, 12, 2, 1832
+ square_note 8, 11, 1, 1840
+ sound_ret
+
+
+SFX_Cry11_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 4, 0, 8, 0
+ square_note 6, 10, 7, 1857
+ square_note 8, 8, 6, 1859
+ square_note 4, 7, 6, 1857
+ square_note 13, 8, 3, 1730
+ square_note 7, 7, 3, 1729
+ square_note 3, 8, 2, 1740
+ square_note 8, 7, 1, 1752
+ sound_ret
+
+
+SFX_Cry11_4_Ch8:
+ noise_note 2, 15, 2, 76
+ noise_note 6, 14, 6, 58
+ noise_note 4, 13, 7, 58
+ noise_note 6, 13, 6, 44
+ noise_note 8, 14, 5, 60
+ noise_note 12, 13, 2, 61
+ noise_note 8, 13, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry12_4.asm b/audio/sfx/cry12_4.asm
new file mode 100644
index 00000000..0c98bdee
--- /dev/null
+++ b/audio/sfx/cry12_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry12_4_Ch5:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 12, 15, 2, 1088
+ square_note 15, 14, 3, 1184
+ square_note 4, 13, 2, 1168
+ square_note 8, 13, 1, 1152
+ sound_ret
+
+
+SFX_Cry12_4_Ch6:
+ duty_cycle_pattern 3, 2, 3, 2
+ square_note 11, 13, 2, 1080
+ square_note 14, 12, 6, 1176
+ square_note 3, 11, 2, 1160
+ square_note 8, 11, 1, 1144
+ sound_ret
+
+
+SFX_Cry12_4_Ch8:
+ noise_note 10, 14, 6, 108
+ noise_note 15, 13, 2, 92
+ noise_note 3, 12, 2, 108
+ noise_note 8, 13, 1, 92
+ sound_ret
diff --git a/audio/sfx/cry13_4.asm b/audio/sfx/cry13_4.asm
new file mode 100644
index 00000000..649e1a73
--- /dev/null
+++ b/audio/sfx/cry13_4.asm
@@ -0,0 +1,30 @@
+SFX_Cry13_4_Ch5:
+ duty_cycle_pattern 0, 3, 0, 3
+ square_note 15, 15, 6, 1472
+ square_note 8, 14, 3, 1468
+ square_note 6, 13, 2, 1488
+ square_note 6, 11, 2, 1504
+ square_note 6, 12, 2, 1520
+ square_note 8, 11, 1, 1536
+ sound_ret
+
+
+SFX_Cry13_4_Ch6:
+ duty_cycle_pattern 2, 1, 2, 1
+ square_note 14, 12, 6, 1201
+ square_note 7, 12, 3, 1197
+ square_note 5, 11, 2, 1217
+ square_note 8, 9, 2, 1233
+ square_note 6, 10, 2, 1249
+ square_note 8, 9, 1, 1265
+ sound_ret
+
+
+SFX_Cry13_4_Ch8:
+ noise_note 10, 14, 6, 92
+ noise_note 10, 13, 6, 108
+ noise_note 4, 12, 2, 76
+ noise_note 6, 13, 3, 92
+ noise_note 8, 11, 3, 76
+ noise_note 8, 10, 1, 92
+ sound_ret
diff --git a/audio/sfx/cry14_4.asm b/audio/sfx/cry14_4.asm
new file mode 100644
index 00000000..b3dc1b2d
--- /dev/null
+++ b/audio/sfx/cry14_4.asm
@@ -0,0 +1,21 @@
+SFX_Cry14_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 8, 14, 4, 1936
+ square_note 15, 15, 5, 1984
+ square_note 8, 13, 1, 2008
+ sound_ret
+
+
+SFX_Cry14_4_Ch6:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 10, 12, 4, 1905
+ square_note 15, 11, 6, 1954
+ square_note 8, 10, 1, 1975
+ sound_ret
+
+
+SFX_Cry14_4_Ch8:
+ noise_note 8, 14, 4, 76
+ noise_note 14, 12, 4, 60
+ noise_note 8, 13, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry15_4.asm b/audio/sfx/cry15_4.asm
new file mode 100644
index 00000000..7764d751
--- /dev/null
+++ b/audio/sfx/cry15_4.asm
@@ -0,0 +1,30 @@
+SFX_Cry15_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 4, 15, 3, 1920
+ square_note 15, 14, 7, 1792
+ square_note 8, 13, 3, 1808
+ square_note 4, 12, 2, 1792
+ square_note 4, 13, 2, 1776
+ square_note 8, 12, 1, 1760
+ sound_ret
+
+
+SFX_Cry15_4_Ch6:
+ duty_cycle_pattern 1, 1, 2, 2
+ square_note 6, 12, 3, 1793
+ square_note 14, 11, 7, 1665
+ square_note 7, 11, 3, 1682
+ square_note 3, 10, 2, 1665
+ square_note 4, 11, 2, 1650
+ square_note 8, 10, 1, 1633
+ sound_ret
+
+
+SFX_Cry15_4_Ch8:
+ noise_note 6, 14, 3, 92
+ noise_note 14, 13, 6, 76
+ noise_note 6, 12, 6, 60
+ noise_note 3, 11, 3, 76
+ noise_note 3, 10, 2, 92
+ noise_note 8, 11, 1, 108
+ sound_ret
diff --git a/audio/sfx/cry16_4.asm b/audio/sfx/cry16_4.asm
new file mode 100644
index 00000000..35ddd284
--- /dev/null
+++ b/audio/sfx/cry16_4.asm
@@ -0,0 +1,21 @@
+SFX_Cry16_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 13, 7, 1920
+ square_note 4, 14, 6, 1952
+ square_note 15, 13, 2, 1856
+ sound_ret
+
+
+SFX_Cry16_4_Ch6:
+ duty_cycle_pattern 1, 1, 2, 2
+ square_note 15, 12, 7, 1875
+ square_note 5, 11, 6, 1906
+ square_note 15, 12, 2, 1809
+ sound_ret
+
+
+SFX_Cry16_4_Ch8:
+ noise_note 13, 15, 6, 76
+ noise_note 4, 14, 6, 60
+ noise_note 15, 15, 2, 76
+ sound_ret
diff --git a/audio/sfx/cry17_4.asm b/audio/sfx/cry17_4.asm
new file mode 100644
index 00000000..a5c8de8e
--- /dev/null
+++ b/audio/sfx/cry17_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry17_4_Ch5:
+ duty_cycle_pattern 0, 0, 3, 3
+ square_note 15, 15, 7, 1280
+ square_note 15, 14, 7, 1288
+ square_note 8, 11, 4, 1152
+ square_note 15, 10, 2, 1120
+ sound_ret
+
+
+SFX_Cry17_4_Ch6:
+ duty_cycle_pattern 1, 0, 1, 0
+ square_note 14, 13, 7, 1153
+ square_note 14, 12, 7, 1161
+ square_note 10, 11, 4, 1025
+ square_note 15, 12, 2, 993
+ sound_ret
+
+
+SFX_Cry17_4_Ch8:
+ noise_note 14, 15, 7, 124
+ noise_note 12, 15, 6, 108
+ noise_note 9, 14, 4, 124
+ noise_note 15, 14, 2, 108
+ sound_ret
diff --git a/audio/sfx/cry18_4.asm b/audio/sfx/cry18_4.asm
new file mode 100644
index 00000000..2909234a
--- /dev/null
+++ b/audio/sfx/cry18_4.asm
@@ -0,0 +1,34 @@
+SFX_Cry18_4_Ch5:
+ duty_cycle_pattern 1, 1, 0, 0
+ square_note 10, 15, 5, 1664
+ square_note 3, 14, 2, 1696
+ square_note 3, 15, 2, 1728
+ square_note 3, 14, 2, 1760
+ square_note 3, 13, 2, 1792
+ square_note 3, 12, 2, 1760
+ square_note 3, 13, 2, 1728
+ square_note 8, 12, 1, 1696
+ sound_ret
+
+
+SFX_Cry18_4_Ch6:
+ duty_cycle_pattern 0, 0, 3, 3
+ square_note 9, 13, 5, 1585
+ square_note 3, 13, 2, 1618
+ square_note 3, 14, 2, 1649
+ square_note 3, 11, 2, 1681
+ square_note 3, 12, 2, 1714
+ square_note 3, 11, 2, 1681
+ square_note 3, 12, 2, 1649
+ square_note 8, 11, 1, 1617
+ sound_ret
+
+
+SFX_Cry18_4_Ch8:
+ noise_note 6, 14, 3, 76
+ noise_note 4, 12, 3, 60
+ noise_note 5, 13, 4, 60
+ noise_note 4, 12, 4, 44
+ noise_note 6, 11, 4, 60
+ noise_note 8, 12, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry19_4.asm b/audio/sfx/cry19_4.asm
new file mode 100644
index 00000000..0deaf3e3
--- /dev/null
+++ b/audio/sfx/cry19_4.asm
@@ -0,0 +1,18 @@
+SFX_Cry19_4_Ch5:
+ duty_cycle_pattern 0, 1, 2, 3
+ square_note 7, 13, 2, 1856
+ square_note 15, 14, 5, 1888
+ square_note 15, 12, 1, 1840
+ sound_ret
+
+
+SFX_Cry19_4_Ch6:
+ duty_cycle_pattern 2, 0, 0, 1
+ square_note 2, 12, 2, 1793
+ square_note 4, 12, 2, 1800
+ square_note 15, 13, 7, 1857
+ square_note 15, 10, 2, 1793
+
+
+SFX_Cry19_4_Ch8:
+ sound_ret
diff --git a/audio/sfx/cry1a_4.asm b/audio/sfx/cry1a_4.asm
new file mode 100644
index 00000000..1a1856e7
--- /dev/null
+++ b/audio/sfx/cry1a_4.asm
@@ -0,0 +1,30 @@
+SFX_Cry1A_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 6, 15, 7, 1856
+ square_note 12, 14, 6, 1860
+ square_note 6, 13, 5, 1872
+ square_note 4, 12, 3, 1888
+ square_note 3, 12, 3, 1920
+ square_note 8, 13, 1, 1952
+ sound_ret
+
+
+SFX_Cry1A_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 6, 12, 7, 1793
+ square_note 11, 11, 6, 1794
+ square_note 6, 10, 5, 1809
+ square_note 4, 9, 3, 1825
+ square_note 3, 10, 3, 1857
+ square_note 8, 9, 1, 1890
+ sound_ret
+
+
+SFX_Cry1A_4_Ch8:
+ noise_note 3, 14, 2, 60
+ noise_note 8, 13, 6, 76
+ noise_note 5, 13, 4, 60
+ noise_note 12, 12, 7, 76
+ noise_note 2, 14, 2, 60
+ noise_note 8, 13, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry1b_4.asm b/audio/sfx/cry1b_4.asm
new file mode 100644
index 00000000..f0a57d88
--- /dev/null
+++ b/audio/sfx/cry1b_4.asm
@@ -0,0 +1,26 @@
+SFX_Cry1B_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 6, 15, 7, 1728
+ square_note 15, 14, 7, 1792
+ square_note 4, 15, 4, 1776
+ square_note 4, 14, 4, 1760
+ square_note 8, 13, 1, 1744
+ sound_ret
+
+
+SFX_Cry1B_4_Ch6:
+ duty_cycle_pattern 0, 0, 2, 2
+ square_note 7, 14, 6, 1665
+ square_note 14, 13, 5, 1729
+ square_note 4, 12, 4, 1713
+ square_note 4, 13, 4, 1697
+ square_note 8, 12, 1, 1681
+ sound_ret
+
+
+SFX_Cry1B_4_Ch8:
+ noise_note 10, 10, 6, 60
+ noise_note 14, 9, 4, 44
+ noise_note 5, 10, 3, 60
+ noise_note 8, 9, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry1c_4.asm b/audio/sfx/cry1c_4.asm
new file mode 100644
index 00000000..2df760db
--- /dev/null
+++ b/audio/sfx/cry1c_4.asm
@@ -0,0 +1,31 @@
+SFX_Cry1C_4_Ch5:
+ duty_cycle_pattern 3, 3, 1, 1
+ square_note 7, 13, 6, 2017
+ square_note 6, 12, 6, 2018
+ square_note 9, 13, 6, 2017
+ square_note 7, 12, 6, 2016
+ square_note 5, 11, 6, 2018
+ square_note 7, 12, 6, 2017
+ square_note 6, 11, 6, 2016
+ square_note 8, 10, 1, 2015
+ sound_ret
+
+
+SFX_Cry1C_4_Ch6:
+ duty_cycle_pattern 1, 0, 1, 0
+ square_note 6, 12, 3, 1993
+ square_note 6, 11, 3, 1991
+ square_note 10, 12, 4, 1987
+ square_note 8, 11, 4, 1991
+ square_note 6, 12, 3, 1993
+ square_note 15, 10, 2, 1989
+ sound_ret
+
+
+SFX_Cry1C_4_Ch8:
+ noise_note 13, 1, -1, 124
+ noise_note 13, 15, 7, 140
+ noise_note 12, 13, 6, 124
+ noise_note 8, 12, 4, 108
+ noise_note 15, 11, 3, 92
+ sound_ret
diff --git a/audio/sfx/cry1d_4.asm b/audio/sfx/cry1d_4.asm
new file mode 100644
index 00000000..52f4f474
--- /dev/null
+++ b/audio/sfx/cry1d_4.asm
@@ -0,0 +1,29 @@
+SFX_Cry1D_4_Ch5:
+ duty_cycle_pattern 3, 3, 1, 0
+ square_note 15, 15, 0, 1797
+ square_note 10, 14, 0, 1792
+ square_note 6, 11, 4, 1808
+ square_note 4, 13, 3, 1792
+ square_note 6, 11, 2, 1568
+ square_note 8, 10, 1, 1572
+ sound_ret
+
+
+SFX_Cry1D_4_Ch6:
+ duty_cycle_pattern 0, 2, 0, 2
+ square_note 15, 11, 0, 1731
+ square_note 10, 10, 0, 1729
+ square_note 6, 8, 4, 1746
+ square_note 4, 9, 3, 1729
+ square_note 6, 8, 2, 1505
+ square_note 8, 6, 1, 1512
+ sound_ret
+
+
+SFX_Cry1D_4_Ch8:
+ noise_note 6, 14, 6, 76
+ noise_note 15, 13, 6, 60
+ noise_note 10, 12, 5, 74
+ noise_note 1, 11, 2, 91
+ noise_note 15, 12, 2, 76
+ sound_ret
diff --git a/audio/sfx/cry1e_4.asm b/audio/sfx/cry1e_4.asm
new file mode 100644
index 00000000..70bbc648
--- /dev/null
+++ b/audio/sfx/cry1e_4.asm
@@ -0,0 +1,38 @@
+SFX_Cry1E_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 6, 15, 2, 1536
+ square_note 6, 14, 2, 1600
+ square_note 6, 13, 2, 1664
+ square_note 6, 14, 2, 1728
+ square_note 6, 13, 2, 1792
+ square_note 6, 12, 2, 1856
+ square_note 6, 11, 2, 1920
+ square_note 8, 10, 1, 1984
+ sound_ret
+
+
+SFX_Cry1E_4_Ch6:
+ duty_cycle_pattern 0, 1, 0, 1
+ square_note 3, 0, 8, 1
+ square_note 6, 12, 2, 1473
+ square_note 6, 11, 2, 1538
+ square_note 6, 10, 2, 1601
+ square_note 6, 11, 2, 1666
+ square_note 6, 10, 2, 1730
+ square_note 6, 9, 2, 1793
+ square_note 6, 10, 2, 1858
+ square_note 8, 8, 1, 1921
+ sound_ret
+
+
+SFX_Cry1E_4_Ch8:
+ noise_note 6, 0, 8, 1
+ noise_note 5, 14, 2, 92
+ noise_note 5, 12, 2, 76
+ noise_note 5, 13, 2, 60
+ noise_note 5, 11, 2, 44
+ noise_note 5, 12, 2, 28
+ noise_note 5, 10, 2, 27
+ noise_note 5, 9, 2, 26
+ noise_note 8, 8, 1, 24
+ sound_ret
diff --git a/audio/sfx/cry1f_4.asm b/audio/sfx/cry1f_4.asm
new file mode 100644
index 00000000..b0c843f2
--- /dev/null
+++ b/audio/sfx/cry1f_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry1F_4_Ch5:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 3, 15, 4, 1601
+ square_note 13, 13, 6, 1825
+ square_note 8, 15, 4, 1817
+ square_note 8, 12, 1, 1818
+ sound_ret
+
+
+SFX_Cry1F_4_Ch6:
+ duty_cycle_pattern 3, 0, 3, 0
+ square_note 4, 15, 4, 1408
+ square_note 14, 14, 6, 1760
+ square_note 8, 13, 5, 1752
+ square_note 8, 13, 1, 1756
+ sound_ret
+
+
+SFX_Cry1F_4_Ch8:
+ noise_note 5, 12, 4, 70
+ noise_note 13, 10, 5, 68
+ noise_note 8, 12, 4, 69
+ noise_note 8, 11, 1, 68
+ sound_ret
diff --git a/audio/sfx/cry20_4.asm b/audio/sfx/cry20_4.asm
new file mode 100644
index 00000000..858fe171
--- /dev/null
+++ b/audio/sfx/cry20_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry20_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 13, 15, 1, 1297
+ square_note 13, 14, 1, 1301
+ square_note 13, 14, 1, 1297
+ square_note 8, 13, 1, 1297
+ sound_ret
+
+
+SFX_Cry20_4_Ch6:
+ duty_cycle_pattern 0, 1, 1, 1
+ square_note 12, 14, 1, 1292
+ square_note 12, 13, 1, 1296
+ square_note 14, 12, 1, 1292
+ square_note 8, 12, 1, 1290
+ sound_ret
+
+
+SFX_Cry20_4_Ch8:
+ noise_note 14, 15, 2, 101
+ noise_note 13, 14, 2, 85
+ noise_note 14, 13, 2, 86
+ noise_note 8, 13, 1, 102
+ sound_ret
diff --git a/audio/sfx/cry21_4.asm b/audio/sfx/cry21_4.asm
new file mode 100644
index 00000000..bc720c10
--- /dev/null
+++ b/audio/sfx/cry21_4.asm
@@ -0,0 +1,27 @@
+SFX_Cry21_4_Ch5:
+ duty_cycle_pattern 0, 1, 2, 3
+ square_note 3, 15, 3, 1380
+ square_note 2, 14, 2, 1348
+ square_note 5, 13, 1, 1314
+ square_note 2, 11, 2, 1156
+ square_note 8, 13, 1, 1186
+ square_note 3, 15, 3, 1316
+ square_note 4, 14, 4, 1252
+ square_note 8, 13, 1, 1282
+ sound_ret
+
+
+SFX_Cry21_4_Ch6:
+ duty_cycle_pattern 3, 0, 3, 0
+ square_note 3, 13, 3, 1376
+ square_note 2, 12, 2, 1344
+ square_note 5, 12, 1, 1312
+ square_note 2, 9, 2, 1152
+ square_note 8, 12, 1, 1184
+ square_note 3, 13, 3, 1312
+ square_note 3, 12, 4, 1248
+ square_note 8, 12, 1, 1280
+
+
+SFX_Cry21_4_Ch8:
+ sound_ret
diff --git a/audio/sfx/cry22_4.asm b/audio/sfx/cry22_4.asm
new file mode 100644
index 00000000..e27f0770
--- /dev/null
+++ b/audio/sfx/cry22_4.asm
@@ -0,0 +1,24 @@
+SFX_Cry22_4_Ch5:
+ duty_cycle_pattern 0, 1, 0, 1
+ square_note 2, 3, -5, 897
+ square_note 7, 15, 5, 1537
+ square_note 1, 12, 2, 1153
+ square_note 8, 9, 1, 897
+ sound_ret
+
+
+SFX_Cry22_4_Ch6:
+ duty_cycle_pattern 3, 2, 3, 2
+ square_note 2, 3, -6, 1456
+ square_note 7, 13, 5, 1885
+ square_note 1, 11, 2, 1712
+ square_note 8, 6, 1, 1456
+ sound_ret
+
+
+SFX_Cry22_4_Ch8:
+ noise_note 2, 9, 2, 73
+ noise_note 7, 11, 5, 41
+ noise_note 1, 10, 2, 57
+ noise_note 8, 9, 1, 73
+ sound_ret
diff --git a/audio/sfx/cry23_4.asm b/audio/sfx/cry23_4.asm
new file mode 100644
index 00000000..7e087dd2
--- /dev/null
+++ b/audio/sfx/cry23_4.asm
@@ -0,0 +1,25 @@
+SFX_Cry23_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 15, 7, 1984
+ square_note 6, 14, 4, 1985
+ square_note 10, 15, 6, 1984
+ square_note 4, 13, 3, 1986
+ square_note 8, 12, 1, 1984
+ sound_ret
+
+
+SFX_Cry23_4_Ch6:
+ duty_cycle_pattern 1, 1, 3, 3
+ square_note 15, 9, 7, 1921
+ square_note 6, 8, 4, 1920
+ square_note 10, 9, 6, 1921
+ square_note 15, 8, 3, 1921
+ sound_ret
+
+
+SFX_Cry23_4_Ch8:
+ noise_note 3, 15, 2, 60
+ noise_note 13, 14, 6, 44
+ noise_note 15, 13, 7, 60
+ noise_note 8, 12, 1, 44
+ sound_ret
diff --git a/audio/sfx/cry24_4.asm b/audio/sfx/cry24_4.asm
new file mode 100644
index 00000000..e08d59f4
--- /dev/null
+++ b/audio/sfx/cry24_4.asm
@@ -0,0 +1,33 @@
+SFX_Cry24_4_Ch5:
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 15, 7, 1664
+ square_note 10, 14, 6, 1668
+ square_note 15, 13, 7, 1680
+ square_note 8, 13, 5, 1680
+ square_note 6, 12, 4, 1672
+ square_note 5, 13, 3, 1648
+ square_note 4, 13, 3, 1632
+ square_note 8, 12, 1, 1600
+ sound_ret
+
+
+SFX_Cry24_4_Ch6:
+ duty_cycle_pattern 0, 0, 1, 1
+ square_note 15, 11, 7, 1601
+ square_note 10, 9, 6, 1602
+ square_note 15, 10, 7, 1617
+ square_note 8, 10, 5, 1617
+ square_note 6, 9, 4, 1607
+ square_note 5, 10, 3, 1585
+ square_note 4, 9, 3, 1570
+ square_note 8, 7, 1, 1537
+ sound_ret
+
+
+SFX_Cry24_4_Ch8:
+ noise_note 15, 14, 4, 60
+ noise_note 10, 12, 7, 76
+ noise_note 10, 12, 7, 60
+ noise_note 12, 11, 7, 76
+ noise_note 15, 10, 2, 92
+ sound_ret
diff --git a/audio/sfx/cry25_4.asm b/audio/sfx/cry25_4.asm
new file mode 100644
index 00000000..02af0c0a
--- /dev/null
+++ b/audio/sfx/cry25_4.asm
@@ -0,0 +1,26 @@
+SFX_Cry25_4_Ch5:
+ duty_cycle_pattern 2, 2, 1, 1
+ square_note 6, 15, 4, 1856
+ square_note 15, 14, 3, 1840
+ square_note 4, 15, 4, 1856
+ square_note 5, 11, 3, 1864
+ square_note 8, 13, 1, 1872
+ sound_ret
+
+
+SFX_Cry25_4_Ch6:
+ duty_cycle_pattern 1, 3, 1, 3
+ square_note 6, 12, 3, 1810
+ square_note 15, 11, 3, 1796
+ square_note 3, 12, 3, 1810
+ square_note 4, 12, 3, 1825
+ square_note 8, 11, 1, 1842
+ sound_ret
+
+
+SFX_Cry25_4_Ch8:
+ noise_note 8, 13, 6, 44
+ noise_note 12, 12, 6, 60
+ noise_note 10, 11, 6, 44
+ noise_note 8, 9, 1, 28
+ sound_ret
diff --git a/audio/sfx/get_item1_4.asm b/audio/sfx/get_item1_4.asm
new file mode 100644
index 00000000..3fc984c5
--- /dev/null
+++ b/audio/sfx/get_item1_4.asm
@@ -0,0 +1,47 @@
+SFX_Get_Item1_4_Ch5:
+ execute_music
+ tempo 256
+ volume 7, 7
+ vibrato 6, 2, 6
+ duty_cycle 2
+ toggle_perfect_pitch
+ note_type 4, 11, 1
+ octave 3
+ note G#, 2
+ note G#, 2
+ note G#, 2
+ note_type 12, 11, 3
+ octave 4
+ note E_, 4
+ sound_ret
+
+
+SFX_Get_Item1_4_Ch6:
+ execute_music
+ vibrato 8, 2, 7
+ duty_cycle 2
+ note_type 4, 12, 1
+ octave 4
+ note E_, 2
+ note E_, 2
+ note E_, 2
+ note_type 12, 12, 3
+ note B_, 4
+ sound_ret
+
+
+SFX_Get_Item1_4_Ch7:
+ execute_music
+ note_type 4, 1, 0
+ octave 4
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note_type 12, 1, 0
+ octave 4
+ note B_, 2
+ rest 2
+ sound_ret
diff --git a/audio/sfx/get_item1_4_2.asm b/audio/sfx/get_item1_4_2.asm
new file mode 100644
index 00000000..f2889b62
--- /dev/null
+++ b/audio/sfx/get_item1_4_2.asm
@@ -0,0 +1,47 @@
+SFX_Get_Item1_4_2_Ch5:
+ execute_music
+ tempo 256
+ volume 7, 7
+ vibrato 6, 2, 6
+ duty_cycle 2
+ toggle_perfect_pitch
+ note_type 4, 11, 1
+ octave 3
+ note G#, 2
+ note G#, 2
+ note G#, 2
+ note_type 12, 11, 3
+ octave 4
+ note E_, 4
+ sound_ret
+
+
+SFX_Get_Item1_4_2_Ch6:
+ execute_music
+ vibrato 8, 2, 7
+ duty_cycle 2
+ note_type 4, 12, 1
+ octave 4
+ note E_, 2
+ note E_, 2
+ note E_, 2
+ note_type 12, 12, 3
+ note B_, 4
+ sound_ret
+
+
+SFX_Get_Item1_4_2_Ch8:
+ execute_music
+ note_type 4, 1, 0
+ octave 4
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note B_, 1
+ rest 1
+ note_type 12, 1, 0
+ octave 4
+ note B_, 2
+ rest 2
+ sound_ret
diff --git a/audio/sfx/get_item2_4.asm b/audio/sfx/get_item2_4.asm
new file mode 100644
index 00000000..33681fb2
--- /dev/null
+++ b/audio/sfx/get_item2_4.asm
@@ -0,0 +1,69 @@
+SFX_Get_Item2_4_Ch5:
+ execute_music
+ tempo 256
+ volume 7, 7
+ duty_cycle 2
+ toggle_perfect_pitch
+ note_type 5, 11, 4
+ octave 4
+ note D_, 4
+ note C_, 4
+ octave 3
+ note A_, 8
+ note_type 5, 11, 2
+ octave 4
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ note C_, 2
+ note C_, 2
+ octave 3
+ note A#, 2
+ note_type 5, 11, 4
+ octave 4
+ note C_, 8
+ sound_ret
+
+
+SFX_Get_Item2_4_Ch6:
+ execute_music
+ vibrato 8, 2, 7
+ duty_cycle 2
+ note_type 5, 12, 5
+ octave 4
+ note A_, 4
+ note F_, 4
+ note C_, 8
+ note_type 5, 12, 2
+ note A#, 2
+ note A#, 2
+ note A#, 2
+ note G_, 2
+ note G_, 2
+ note A#, 2
+ note_type 5, 12, 4
+ note A_, 8
+ sound_ret
+
+
+SFX_Get_Item2_4_Ch7:
+ execute_music
+ note_type 5, 1, 0
+ octave 5
+ note F_, 4
+ note D#, 4
+ note C_, 8
+ note D#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note F_, 1
+ rest 1
+ note F_, 1
+ rest 1
+ note G_, 1
+ rest 1
+ note A_, 8
+ sound_ret
diff --git a/audio/sfx/get_item2_4_2.asm b/audio/sfx/get_item2_4_2.asm
new file mode 100644
index 00000000..04ca9f21
--- /dev/null
+++ b/audio/sfx/get_item2_4_2.asm
@@ -0,0 +1,69 @@
+SFX_Get_Item2_4_2_Ch5:
+ execute_music
+ tempo 256
+ volume 7, 7
+ duty_cycle 2
+ toggle_perfect_pitch
+ note_type 5, 11, 4
+ octave 4
+ note D_, 4
+ note C_, 4
+ octave 3
+ note A_, 8
+ note_type 5, 11, 2
+ octave 4
+ note D#, 2
+ note D#, 2
+ note D_, 2
+ note C_, 2
+ note C_, 2
+ octave 3
+ note A#, 2
+ note_type 5, 11, 4
+ octave 4
+ note C_, 8
+ sound_ret
+
+
+SFX_Get_Item2_4_2_Ch6:
+ execute_music
+ vibrato 8, 2, 7
+ duty_cycle 2
+ note_type 5, 12, 5
+ octave 4
+ note A_, 4
+ note F_, 4
+ note C_, 8
+ note_type 5, 12, 2
+ note A#, 2
+ note A#, 2
+ note A#, 2
+ note G_, 2
+ note G_, 2
+ note A#, 2
+ note_type 5, 12, 4
+ note A_, 8
+ sound_ret
+
+
+SFX_Get_Item2_4_2_Ch7:
+ execute_music
+ note_type 5, 1, 0
+ octave 5
+ note F_, 4
+ note D#, 4
+ note C_, 8
+ note D#, 1
+ rest 1
+ note D#, 1
+ rest 1
+ note E_, 1
+ rest 1
+ note F_, 1
+ rest 1
+ note F_, 1
+ rest 1
+ note G_, 1
+ rest 1
+ note A_, 8
+ sound_ret
diff --git a/audio/sfx/heal_ailment_4.asm b/audio/sfx/heal_ailment_4.asm
new file mode 100644
index 00000000..4320c06b
--- /dev/null
+++ b/audio/sfx/heal_ailment_4.asm
@@ -0,0 +1,9 @@
+SFX_Heal_Ailment_4_Ch5:
+ duty_cycle 2
+ pitch_sweep 1, 4
+ square_note 4, 15, 2, 1536
+ square_note 4, 15, 2, 1536
+ pitch_sweep 1, 7
+ square_note 15, 15, 2, 1536
+ pitch_sweep 0, 8
+ sound_ret
diff --git a/audio/sfx/heal_hp_4.asm b/audio/sfx/heal_hp_4.asm
new file mode 100644
index 00000000..95dbadb0
--- /dev/null
+++ b/audio/sfx/heal_hp_4.asm
@@ -0,0 +1,7 @@
+SFX_Heal_HP_4_Ch5:
+ duty_cycle 2
+ pitch_sweep 1, 7
+ square_note 15, 15, 0, 1264
+ square_note 15, 15, 2, 1616
+ pitch_sweep 0, 8
+ sound_ret
diff --git a/audio/sfx/noise_instrument01_4.asm b/audio/sfx/noise_instrument01_4.asm
new file mode 100644
index 00000000..9b7aaadb
--- /dev/null
+++ b/audio/sfx/noise_instrument01_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument01_4_Ch8:
+ noise_note 0, 12, 1, 51
+ sound_ret
diff --git a/audio/sfx/noise_instrument02_4.asm b/audio/sfx/noise_instrument02_4.asm
new file mode 100644
index 00000000..769e1610
--- /dev/null
+++ b/audio/sfx/noise_instrument02_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument02_4_Ch8:
+ noise_note 0, 11, 1, 51
+ sound_ret
diff --git a/audio/sfx/noise_instrument03_4.asm b/audio/sfx/noise_instrument03_4.asm
new file mode 100644
index 00000000..d4a0535d
--- /dev/null
+++ b/audio/sfx/noise_instrument03_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument03_4_Ch8:
+ noise_note 0, 10, 1, 51
+ sound_ret
diff --git a/audio/sfx/noise_instrument04_4.asm b/audio/sfx/noise_instrument04_4.asm
new file mode 100644
index 00000000..5defa2de
--- /dev/null
+++ b/audio/sfx/noise_instrument04_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument04_4_Ch8:
+ noise_note 0, 8, 1, 51
+ sound_ret
diff --git a/audio/sfx/noise_instrument05_4.asm b/audio/sfx/noise_instrument05_4.asm
new file mode 100644
index 00000000..6e713056
--- /dev/null
+++ b/audio/sfx/noise_instrument05_4.asm
@@ -0,0 +1,8 @@
+SFX_Noise_Instrument05_4_Ch8:
+ noise_note 7, 8, 4, 55
+ noise_note 6, 8, 4, 54
+ noise_note 5, 8, 3, 53
+ noise_note 4, 8, 3, 52
+ noise_note 3, 8, 2, 51
+ noise_note 2, 8, 1, 50
+ sound_ret
diff --git a/audio/sfx/noise_instrument06_4.asm b/audio/sfx/noise_instrument06_4.asm
new file mode 100644
index 00000000..fb7402a9
--- /dev/null
+++ b/audio/sfx/noise_instrument06_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument06_4_Ch8:
+ noise_note 0, 5, 1, 42
+ sound_ret
diff --git a/audio/sfx/noise_instrument07_4.asm b/audio/sfx/noise_instrument07_4.asm
new file mode 100644
index 00000000..d6262f95
--- /dev/null
+++ b/audio/sfx/noise_instrument07_4.asm
@@ -0,0 +1,4 @@
+SFX_Noise_Instrument07_4_Ch8:
+ noise_note 1, 4, 1, 43
+ noise_note 0, 6, 1, 42
+ sound_ret
diff --git a/audio/sfx/noise_instrument08_4.asm b/audio/sfx/noise_instrument08_4.asm
new file mode 100644
index 00000000..9c3b3ba6
--- /dev/null
+++ b/audio/sfx/noise_instrument08_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument08_4_Ch8:
+ noise_note 0, 8, 1, 16
+ sound_ret
diff --git a/audio/sfx/noise_instrument09_4.asm b/audio/sfx/noise_instrument09_4.asm
new file mode 100644
index 00000000..89839b7c
--- /dev/null
+++ b/audio/sfx/noise_instrument09_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument09_4_Ch8:
+ noise_note 0, 8, 2, 35
+ sound_ret
diff --git a/audio/sfx/noise_instrument10_4.asm b/audio/sfx/noise_instrument10_4.asm
new file mode 100644
index 00000000..694fa6c7
--- /dev/null
+++ b/audio/sfx/noise_instrument10_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument10_4_Ch8:
+ noise_note 0, 8, 2, 37
+ sound_ret
diff --git a/audio/sfx/noise_instrument11_4.asm b/audio/sfx/noise_instrument11_4.asm
new file mode 100644
index 00000000..868b73c6
--- /dev/null
+++ b/audio/sfx/noise_instrument11_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument11_4_Ch8:
+ noise_note 0, 8, 2, 38
+ sound_ret
diff --git a/audio/sfx/noise_instrument12_4.asm b/audio/sfx/noise_instrument12_4.asm
new file mode 100644
index 00000000..1d55d4f5
--- /dev/null
+++ b/audio/sfx/noise_instrument12_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument12_4_Ch8:
+ noise_note 0, 10, 1, 16
+ sound_ret
diff --git a/audio/sfx/noise_instrument13_4.asm b/audio/sfx/noise_instrument13_4.asm
new file mode 100644
index 00000000..1b461841
--- /dev/null
+++ b/audio/sfx/noise_instrument13_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument13_4_Ch8:
+ noise_note 0, 10, 2, 17
+ sound_ret
diff --git a/audio/sfx/noise_instrument14_4.asm b/audio/sfx/noise_instrument14_4.asm
new file mode 100644
index 00000000..7d1f5734
--- /dev/null
+++ b/audio/sfx/noise_instrument14_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument14_4_Ch8:
+ noise_note 0, 10, 2, 80
+ sound_ret
diff --git a/audio/sfx/noise_instrument15_4.asm b/audio/sfx/noise_instrument15_4.asm
new file mode 100644
index 00000000..6d25965a
--- /dev/null
+++ b/audio/sfx/noise_instrument15_4.asm
@@ -0,0 +1,4 @@
+SFX_Noise_Instrument15_4_Ch8:
+ noise_note 0, 10, 1, 24
+ noise_note 0, 3, 1, 51
+ sound_ret
diff --git a/audio/sfx/noise_instrument16_4.asm b/audio/sfx/noise_instrument16_4.asm
new file mode 100644
index 00000000..8a3e4808
--- /dev/null
+++ b/audio/sfx/noise_instrument16_4.asm
@@ -0,0 +1,4 @@
+SFX_Noise_Instrument16_4_Ch8:
+ noise_note 2, 9, 1, 40
+ noise_note 0, 7, 1, 24
+ sound_ret
diff --git a/audio/sfx/noise_instrument17_4.asm b/audio/sfx/noise_instrument17_4.asm
new file mode 100644
index 00000000..42d04ea2
--- /dev/null
+++ b/audio/sfx/noise_instrument17_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument17_4_Ch8:
+ noise_note 0, 9, 1, 34
+ sound_ret
diff --git a/audio/sfx/noise_instrument18_4.asm b/audio/sfx/noise_instrument18_4.asm
new file mode 100644
index 00000000..c0c77719
--- /dev/null
+++ b/audio/sfx/noise_instrument18_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument18_4_Ch8:
+ noise_note 0, 7, 1, 34
+ sound_ret
diff --git a/audio/sfx/noise_instrument19_4.asm b/audio/sfx/noise_instrument19_4.asm
new file mode 100644
index 00000000..1b37d5a1
--- /dev/null
+++ b/audio/sfx/noise_instrument19_4.asm
@@ -0,0 +1,3 @@
+SFX_Noise_Instrument19_4_Ch8:
+ noise_note 0, 6, 1, 34
+ sound_ret
diff --git a/audio/sfx/press_ab_4.asm b/audio/sfx/press_ab_4.asm
new file mode 100644
index 00000000..aecfe952
--- /dev/null
+++ b/audio/sfx/press_ab_4.asm
@@ -0,0 +1,7 @@
+SFX_Press_AB_4_Ch5:
+ duty_cycle 2
+ square_note 0, 9, 1, 1984
+ square_note 0, 8, 1, 2000
+ square_note 0, 9, 1, 1984
+ square_note 12, 10, 1, 2000
+ sound_ret
diff --git a/audio/sfx/save_3.asm b/audio/sfx/save_3.asm
index 8db092b2..10589ab3 100644
--- a/audio/sfx/save_3.asm
+++ b/audio/sfx/save_3.asm
@@ -1,36 +1,19 @@
SFX_Save_3_Ch5:
duty_cycle 2
-IF DEF(_RED)
- square_note 4, 15, 4, 1792
- square_note 3, 14, 4, 1664
- square_note 3, 14, 4, 1728
- square_note 3, 14, 4, 1792
- square_note 2, 14, 4, 1952
-ELSE
square_note 3, 14, 4, 1536
square_note 3, 14, 4, 1664
square_note 3, 14, 4, 1728
square_note 3, 14, 4, 1792
square_note 15, 15, 2, 2016
-ENDC
sound_ret
SFX_Save_3_Ch6:
duty_cycle 2
-IF DEF(_RED)
- square_note 4, 0, 8, 0
- square_note 3, 13, 4, 1793
- square_note 3, 12, 4, 1665
- square_note 3, 12, 4, 1729
- square_note 3, 12, 4, 1793
- square_note 2, 12, 4, 1953
-ELSE
square_note 3, 0, 8, 0
square_note 3, 12, 4, 1537
square_note 3, 12, 4, 1665
square_note 3, 12, 4, 1729
square_note 3, 12, 4, 1793
square_note 15, 13, 2, 2017
-ENDC
sound_ret
diff --git a/audio/sfx/shooting_star.asm b/audio/sfx/shooting_star.asm
index cbef7398..6a06ec5a 100644
--- a/audio/sfx/shooting_star.asm
+++ b/audio/sfx/shooting_star.asm
@@ -1,5 +1,5 @@
SFX_Shooting_Star_Ch5:
- duty_cycle_pattern 3, 2, 1, 0
+ duty_cycle_pattern 2, 0, 2, 0
pitch_sweep 2, -7
square_note 4, 4, 0, 2016
square_note 4, 6, 0, 2016
diff --git a/audio/sfx/start_menu_4.asm b/audio/sfx/start_menu_4.asm
new file mode 100644
index 00000000..9debc1c8
--- /dev/null
+++ b/audio/sfx/start_menu_4.asm
@@ -0,0 +1,4 @@
+SFX_Start_Menu_4_Ch8:
+ noise_note 1, 14, 2, 51
+ noise_note 8, 14, 1, 34
+ sound_ret
diff --git a/audio/sfx/surfing_crash.asm b/audio/sfx/surfing_crash.asm
new file mode 100644
index 00000000..26e5b0f7
--- /dev/null
+++ b/audio/sfx/surfing_crash.asm
@@ -0,0 +1,5 @@
+SFX_Surfing_Crash_Ch8:
+ noise_note 3, 15, 3, 102
+ noise_note 3, 3, 3, 83
+ noise_note 7, 15, 5, 81
+ sound_ret
diff --git a/audio/sfx/surfing_flip.asm b/audio/sfx/surfing_flip.asm
new file mode 100644
index 00000000..034a55d2
--- /dev/null
+++ b/audio/sfx/surfing_flip.asm
@@ -0,0 +1,8 @@
+SFX_Surfing_Flip_Ch5:
+ duty_cycle 2
+ square_note 3, 12, 4, 1888
+ square_note 0, 10, 4, 1856
+ square_note 2, 12, 4, 1856
+ square_note 0, 10, 4, 1888
+ square_note 15, 12, 1, 1888
+ sound_ret
diff --git a/audio/sfx/surfing_jump.asm b/audio/sfx/surfing_jump.asm
new file mode 100644
index 00000000..af12d9e9
--- /dev/null
+++ b/audio/sfx/surfing_jump.asm
@@ -0,0 +1,9 @@
+SFX_Surfing_Jump_Ch8:
+ noise_note 6, 15, 1, 17
+ noise_note 7, 15, 2, 34
+ noise_note 8, 15, 3, 51
+ noise_note 9, 15, 4, 66
+ noise_note 10, 15, 5, 51
+ noise_note 11, 15, 6, 34
+ noise_note 12, 15, 7, 17
+ sound_ret
diff --git a/audio/sfx/surfing_land.asm b/audio/sfx/surfing_land.asm
new file mode 100644
index 00000000..8cc4ffa1
--- /dev/null
+++ b/audio/sfx/surfing_land.asm
@@ -0,0 +1,5 @@
+SFX_Surfing_Land_Ch8:
+ noise_note 2, 15, 1, 50
+ noise_note 2, 0, 0, 0
+ noise_note 4, 14, 6, 33
+ sound_ret
diff --git a/audio/sfx/swap_2.asm b/audio/sfx/swap_2.asm
new file mode 100644
index 00000000..51d0f273
--- /dev/null
+++ b/audio/sfx/swap_2.asm
@@ -0,0 +1,11 @@
+SFX_Swap_2_Ch5:
+ duty_cycle 2
+ square_note 8, 14, 1, 1856
+ sound_ret
+
+
+SFX_Swap_2_Ch6:
+ duty_cycle 2
+ square_note 2, 0, 8, 0
+ square_note 8, 11, 1, 1857
+ sound_ret
diff --git a/audio/sfx/tink_4.asm b/audio/sfx/tink_4.asm
new file mode 100644
index 00000000..16b7be91
--- /dev/null
+++ b/audio/sfx/tink_4.asm
@@ -0,0 +1,8 @@
+SFX_Tink_4_Ch5:
+ duty_cycle 2
+ pitch_sweep 3, -2
+ square_note 4, 15, 2, 512
+ pitch_sweep 2, 2
+ square_note 8, 14, 2, 512
+ pitch_sweep 0, 8
+ sound_ret
diff --git a/audio/sfx/unknown_802cc.asm b/audio/sfx/unknown_802cc.asm
new file mode 100644
index 00000000..3126cf1e
--- /dev/null
+++ b/audio/sfx/unknown_802cc.asm
@@ -0,0 +1,5 @@
+SFX_Unknown_802cc_Ch5:
+ duty_cycle 2
+ square_note 3, 11, 4, 1984
+ square_note 0, 10, 1, 1920
+ sound_ret
diff --git a/audio/sfx/unused_cry_4.asm b/audio/sfx/unused_cry_4.asm
new file mode 100644
index 00000000..72e534aa
--- /dev/null
+++ b/audio/sfx/unused_cry_4.asm
@@ -0,0 +1,32 @@
+; This corresponds to Cry_Unused_Ch5, Cry_Unused_Ch6, and Cry_Unused_Ch8 in pokegold and pokecrystal.
+SFX_UnusedCry_4_Ch5: ; unreferenced
+ duty_cycle_pattern 3, 3, 0, 0
+ square_note 15, 14, 0, 1920
+ square_note 15, 15, 0, 1924
+ square_note 15, 12, 3, 1504
+ square_note 15, 12, 4, 1536
+ square_note 10, 6, -4, 1920
+ square_note 8, 7, 1, 1924
+ sound_ret
+
+
+SFX_UnusedCry_4_Ch6: ; unreferenced
+ duty_cycle_pattern 0, 0, 1, 1
+ square_note 15, 10, 0, 1857
+ square_note 15, 11, 0, 1859
+ square_note 15, 9, 3, 1457
+ square_note 15, 9, 4, 1473
+ square_note 10, 4, -4, 1857
+ square_note 8, 3, 1, 1862
+ sound_ret
+
+
+SFX_UnusedCry_4_Ch8: ; unreferenced
+ noise_note 2, 15, 2, 76
+ noise_note 6, 14, 0, 58
+ noise_note 15, 13, 0, 58
+ noise_note 8, 13, 0, 44
+ noise_note 6, 14, 6, 76
+ noise_note 12, 7, -5, 76
+ noise_note 15, 13, 3, 76
+ sound_ret
diff --git a/audio/wave_instruments.asm b/audio/wave_instruments.asm
index 31e7d016..89536a35 100644
--- a/audio/wave_instruments.asm
+++ b/audio/wave_instruments.asm
@@ -8,7 +8,6 @@
dw .wave5 ; used in the Lavender Town and Pokemon Tower themes
dw .wave5 ; unused
dw .wave5 ; unused
- dw .wave5 ; unused
; these are the definitions for the channel 3 instruments
; each instrument definition is made up of 32 points (nibbles) that form
diff --git a/constants.asm b/constants.asm
index a307549b..99714a84 100644
--- a/constants.asm
+++ b/constants.asm
@@ -35,3 +35,5 @@ INCLUDE "constants/tileset_constants.asm"
INCLUDE "constants/event_constants.asm"
INCLUDE "constants/text_constants.asm"
INCLUDE "constants/menu_constants.asm"
+INCLUDE "constants/sprite_anim_constants.asm"
+INCLUDE "constants/pikachu_emotion_constants.asm"
diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm
index fdbe8775..8db305a5 100644
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -40,6 +40,8 @@ BIT_TEST_BATTLE EQU 0
const BATTLE_TYPE_NORMAL ; 0
const BATTLE_TYPE_OLD_MAN ; 1
const BATTLE_TYPE_SAFARI ; 2
+ const BATTLE_TYPE_RUN ; 3
+ const BATTLE_TYPE_PIKACHU ; 4
; damage limits before type effectiveness
MIN_NEUTRAL_DAMAGE EQU 2
diff --git a/constants/credits_constants.asm b/constants/credits_constants.asm
index 78dc7675..ff2a5179 100644
--- a/constants/credits_constants.asm
+++ b/constants/credits_constants.asm
@@ -1,69 +1,91 @@
; CreditsTextPointers indexes (see data/credits/credits_text.asm)
const_def
- const CRED_VERSION ; $00
- const CRED_TAJIRI ; $01
- const CRED_TA_OOTA ; $02
- const CRED_MORIMOTO ; $03
- const CRED_WATANABE ; $04
- const CRED_MASUDE ; $05
- const CRED_NISINO ; $06
- const CRED_SUGIMORI ; $07
- const CRED_NISHIDA ; $08
- const CRED_MIYAMOTO ; $09
- const CRED_KAWAGUCHI ; $0A
- const CRED_ISHIHARA ; $0B
- const CRED_YAMAUCHI ; $0C
- const CRED_ZINNAI ; $0D
- const CRED_HISHIDA ; $0E
- const CRED_SAKAI ; $0F
- const CRED_YAMAGUCHI ; $10
- const CRED_YAMAMOTO ; $11
- const CRED_TANIGUCHI ; $12
- const CRED_NONOMURA ; $13
- const CRED_FUZIWARA ; $14
- const CRED_MATSUSIMA ; $15
- const CRED_TOMISAWA ; $16
- const CRED_KAWAMOTO ; $17
- const CRED_KAKEI ; $18
- const CRED_TSUCHIYA ; $19
- const CRED_TA_NAKAMURA ; $1A
- const CRED_YUDA ; $1B
- const CRED_MON ; $1C
- const CRED_DIRECTOR ; $1D
- const CRED_PROGRAMMERS ; $1E
- const CRED_CHAR_DESIGN ; $1F
- const CRED_MUSIC ; $20
- const CRED_SOUND_EFFECTS ; $21
- const CRED_GAME_DESIGN ; $22
- const CRED_MONSTER_DESIGN ; $23
- const CRED_GAME_SCENE ; $24
- const CRED_PARAM ; $25
- const CRED_MAP ; $26
- const CRED_TEST ; $27
- const CRED_SPECIAL ; $28
- const CRED_PRODUCERS ; $29
- const CRED_PRODUCER ; $2A
- const CRED_EXECUTIVE ; $2B
- const CRED_TAMADA ; $2C
- const CRED_SA_OOTA ; $2D
- const CRED_YOSHIKAWA ; $2E
- const CRED_TO_OOTA ; $2F
- const CRED_US_STAFF ; $30
- const CRED_US_COORD ; $31
- const CRED_TILDEN ; $32
- const CRED_KAWAKAMI ; $33
- const CRED_HI_NAKAMURA ; $34
- const CRED_GIESE ; $35
- const CRED_OSBORNE ; $36
- const CRED_TRANS ; $37
- const CRED_OGASAWARA ; $38
- const CRED_IWATA ; $39
- const CRED_IZUSHI ; $3A
- const CRED_HARADA ; $3B
- const CRED_MURAKAWA ; $3C
- const CRED_FUKUI ; $3D
- const CRED_CLUB ; $3E
- const CRED_PAAD ; $3F
+ const CRED_VERSION ; 00
+ const CRED_TAJIRI ; 01
+ const CRED_OOTA ; 02
+ const CRED_MORIMOTO ; 03
+ const CRED_WATANABE ; 04
+ const CRED_MASUDA ; 05
+ const CRED_NISHINO ; 06
+ const CRED_SUGIMORI ; 07
+ const CRED_NISHIDA ; 08
+ const CRED_MIYAMOTO ; 09
+ const CRED_KAWAGUCHI ; 0a
+ const CRED_ISHIHARA ; 0b
+ const CRED_YAMAUCHI ; 0c
+ const CRED_ZINNAI ; 0d
+ const CRED_HISHIDA ; 0e
+ const CRED_SAKAI ; 0f
+ const CRED_YAMAGUCHI ; 10
+ const CRED_YAMAMOTO ; 11
+ const CRED_TANIGUCHI ; 12
+ const CRED_NONOMURA ; 13
+ const CRED_FUZIWARA ; 14
+ const CRED_MATSUSIMA ; 15
+ const CRED_TOMISAWA ; 16
+ const CRED_KAWAMOTO ; 17
+ const CRED_KAKEI ; 18
+ const CRED_TSUCHIYA ; 19
+ const CRED_NAKAMURA ; 1a
+ const CRED_YUDA ; 1b
+ const CRED_POKEMON ; 1c
+ const CRED_DIRECTOR ; 1d
+ const CRED_PROGRAMMERS ; 1e
+ const CRED_CHARACTER_DESIGN ; 1f
+ const CRED_MUSIC ; 20
+ const CRED_SOUND_EFFECTS ; 21
+ const CRED_GAME_DESIGN ; 22
+ const CRED_MONSTER_DESIGN ; 23
+ const CRED_GAME_SCENARIO ; 24
+ const CRED_PARAMETRIC_DESIGN ; 25
+ const CRED_MAP_DESIGN ; 26
+ const CRED_TESTING ; 27
+ const CRED_SPECIAL_THANKS ; 28
+ const CRED_PRODUCER ; 29
+ const CRED_EXECUTIVE_PRODUCER ; 2a
+ const CRED_TAMADA ; 2b
+ const CRED_OOTA2 ; 2c
+ const CRED_YOSHIKAWA ; 2d
+ const CRED_OOTA23 ; 2e
+ const CRED_YOSHIDA ; 2f
+ const CRED_MATSUMITA ; 30
+ const CRED_SEYA ; 31
+ const CRED_SEKINE ; 32
+ const CRED_SHIMAMURA ; 33
+ const CRED_SHIMOYAMADA ; 34
+ const CRED_SUPER_MARIO_CLUB ; 35
+ const CRED_IZUSHI ; 36
+ const CRED_NOMURA ; 37
+ const CRED_HARADA ; 38
+ const CRED_YAMAGAMI ; 39
+ const CRED_NISHIMURA ; 3a
+ const CRED_SAEKI ; 3b
+ const CRED_FUZII ; 3c
+ const CRED_SHOGAKUKAN ; 3d
+ const CRED_OOTANI ; 3e
+ const CRED_PIKACHU_VOICE ; 3f
+ const CRED_U_S_STAFF ; 40
+ const CRED_U_S_COORD ; 41
+ const CRED_TILDEN ; 42
+ const CRED_KAWAKAMI ; 43
+ const CRED_NAKAMURA2 ; 44
+ const CRED_SHOEMAKE ; 45
+ const CRED_OSBORNE ; 46
+ const CRED_TRANSLATION ; 47
+ const CRED_OGASAWARA ; 48
+ const CRED_IWATA ; 49
+ const CRED_IZUSHI2 ; 4a
+ const CRED_HARADA2 ; 4b
+ const CRED_MURAKAWA ; 4c
+ const CRED_FUKUI ; 4d
+ const CRED_SUPER_MARIO_CLUB2 ; 4e
+ const CRED_PAAD ; 4f
+ const CRED_PRODUCERS ; 50
+ const CRED_HOSOKAWA ; 51
+ const CRED_OKUBO ; 52
+ const CRED_NAKAMICHI ; 53
+ const CRED_YOSHIMURA ; 54
+ const CRED_YAMAZAKI ; 55
NUM_CRED_STRINGS EQU const_value
const_def -1, -1
diff --git a/constants/event_constants.asm b/constants/event_constants.asm
index 4f169880..bf4926aa 100644
--- a/constants/event_constants.asm
+++ b/constants/event_constants.asm
@@ -5,7 +5,8 @@
const EVENT_FOLLOWED_OAK_INTO_LAB
const_skip 2
const EVENT_HALL_OF_FAME_DEX_RATING
- const_skip 2
+ const_skip
+ const EVENT_PLAYER_AT_RIGHT_EXIT_TO_PALLET_TOWN
const EVENT_PALLET_AFTER_GETTING_POKEBALLS
const_skip 17
const EVENT_GOT_TOWN_MAP
@@ -25,7 +26,12 @@
const_next $28
const EVENT_VIRIDIAN_GYM_OPEN
const EVENT_GOT_TM42
- const_skip 14
+ const_skip 2
+ const EVENT_02C
+ const EVENT_02D
+ const EVENT_02E
+ const EVENT_02F
+ const_skip 8
const EVENT_OAK_GOT_PARCEL
const EVENT_GOT_OAKS_PARCEL
const_skip 22
@@ -55,7 +61,8 @@
const EVENT_BEAT_CERULEAN_RIVAL
const_skip 14
const EVENT_BEAT_CERULEAN_ROCKET_THIEF
- const_skip 18
+ const EVENT_GOT_BULBASAUR_IN_CERULEAN
+ const_skip 17
const EVENT_BEAT_CERULEAN_GYM_TRAINER_0
const EVENT_BEAT_CERULEAN_GYM_TRAINER_1
const_skip 2
@@ -96,12 +103,15 @@
const EVENT_RESCUED_MR_FUJI_2
const_skip 16
const EVENT_GOT_POKE_FLUTE
+ const_skip 30
+ const EVENT_GOT_SQUIRTLE_FROM_OFFICER_JENNY
; Vermilion City events
const_next $150
const_skip
const EVENT_GOT_BIKE_VOUCHER
- const_skip 4
+ const EVENT_152
+ const_skip 3
const EVENT_SEEL_FAN_BOAST
const EVENT_PIKACHU_FAN_BOAST
const_skip 8
@@ -505,7 +515,8 @@
const EVENT_NUGGET_REWARD_AVAILABLE
; Route 25 events
- const_next $550
+ const_next $550 - 1
+ const EVENT_54F
const EVENT_MET_BILL
const EVENT_BEAT_ROUTE_25_TRAINER_0
const EVENT_BEAT_ROUTE_25_TRAINER_1
@@ -529,6 +540,8 @@
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1
const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2
+ const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3
+ const EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4
; Mt. Moon events
const_next $570
@@ -540,13 +553,13 @@
const EVENT_BEAT_MT_MOON_1_TRAINER_4
const EVENT_BEAT_MT_MOON_1_TRAINER_5
const EVENT_BEAT_MT_MOON_1_TRAINER_6
- const_skip
+ const EVENT_GOT_DOME_FOSSIL
const EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
const EVENT_BEAT_MT_MOON_3_TRAINER_0
const EVENT_BEAT_MT_MOON_3_TRAINER_1
const EVENT_BEAT_MT_MOON_3_TRAINER_2
const EVENT_BEAT_MT_MOON_3_TRAINER_3
- const EVENT_GOT_DOME_FOSSIL
+ const EVENT_57E
const EVENT_GOT_HELIX_FOSSIL
; S.S. Anne events
@@ -606,7 +619,9 @@
const_skip 15
const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0
const EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_1
- const_skip 15
+ const_skip 13
+ const EVENT_6A0
+ const_skip
const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
const EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
@@ -683,7 +698,11 @@
const EVENT_BEAT_SILPH_CO_10F_TRAINER_1
const_skip 5
const EVENT_SILPH_CO_10_UNLOCKED_DOOR
- const_skip 11
+ const_skip 7
+ const EVENT_780
+ const EVENT_781
+ const EVENT_782
+ const_skip
const EVENT_BEAT_SILPH_CO_11F_TRAINER_0
const EVENT_BEAT_SILPH_CO_11F_TRAINER_1
const_skip 2
diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm
index 91463e7c..e6290c8a 100644
--- a/constants/gfx_constants.asm
+++ b/constants/gfx_constants.asm
@@ -12,6 +12,11 @@ BG_MAP_HEIGHT EQU 32 ; tiles
SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE
+; DMGPalToGBCPal
+CONVERT_BGP EQU 0
+CONVERT_OBP0 EQU 1
+CONVERT_OBP1 EQU 2
+
; HP bar
HP_BAR_GREEN EQU 0
HP_BAR_YELLOW EQU 1
diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm
index 4770a29a..91205861 100644
--- a/constants/hide_show_constants.asm
+++ b/constants/hide_show_constants.asm
@@ -3,238 +3,246 @@ SHOW EQU $15
; MissableObjects indexes (see data/maps/hide_show_data.asm)
; this is a list of the sprites that can be enabled/disabled during the game
-; sprites marked with an X are constants that are never used
-; because those sprites are not (de)activated in a map's script
-; (they are either items or sprites that deactivate after battle
-; and are detected in wMissableObjectList)
+; TODO: mark sprite constants with an X that are never used
const_def
const HS_PALLET_TOWN_OAK ; 00
const HS_LYING_OLD_MAN ; 01
- const HS_OLD_MAN ; 02
- const HS_MUSEUM_GUY ; 03
- const HS_GYM_GUY ; 04
- const HS_CERULEAN_RIVAL ; 05
- const HS_CERULEAN_ROCKET ; 06
- const HS_CERULEAN_GUARD_1 ; 07
- const HS_CERULEAN_CAVE_GUY ; 08
- const HS_CERULEAN_GUARD_2 ; 09
- const HS_SAFFRON_CITY_1 ; 0A
- const HS_SAFFRON_CITY_2 ; 0B
- const HS_SAFFRON_CITY_3 ; 0C
- const HS_SAFFRON_CITY_4 ; 0D
- const HS_SAFFRON_CITY_5 ; 0E
- const HS_SAFFRON_CITY_6 ; 0F
- const HS_SAFFRON_CITY_7 ; 10
- const HS_SAFFRON_CITY_8 ; 11
- const HS_SAFFRON_CITY_9 ; 12
- const HS_SAFFRON_CITY_A ; 13
- const HS_SAFFRON_CITY_B ; 14
- const HS_SAFFRON_CITY_C ; 15
- const HS_SAFFRON_CITY_D ; 16
- const HS_SAFFRON_CITY_E ; 17
- const HS_SAFFRON_CITY_F ; 18
- const HS_ROUTE_2_ITEM_1 ; 19 X
- const HS_ROUTE_2_ITEM_2 ; 1A X
- const HS_ROUTE_4_ITEM ; 1B X
- const HS_ROUTE_9_ITEM ; 1C X
- const HS_ROUTE_12_SNORLAX ; 1D
- const HS_ROUTE_12_ITEM_1 ; 1E X
- const HS_ROUTE_12_ITEM_2 ; 1F X
- const HS_ROUTE_15_ITEM ; 20 X
- const HS_ROUTE_16_SNORLAX ; 21
- const HS_ROUTE_22_RIVAL_1 ; 22
- const HS_ROUTE_22_RIVAL_2 ; 23
- const HS_NUGGET_BRIDGE_GUY ; 24
- const HS_ROUTE_24_ITEM ; 25 X
- const HS_ROUTE_25_ITEM ; 26 X
- const HS_DAISY_SITTING ; 27
- const HS_DAISY_WALKING ; 28
- const HS_TOWN_MAP ; 29
- const HS_OAKS_LAB_RIVAL ; 2A
- const HS_STARTER_BALL_1 ; 2B
- const HS_STARTER_BALL_2 ; 2C
- const HS_STARTER_BALL_3 ; 2D
- const HS_OAKS_LAB_OAK_1 ; 2E
- const HS_POKEDEX_1 ; 2F
- const HS_POKEDEX_2 ; 30
- const HS_OAKS_LAB_OAK_2 ; 31
- const HS_VIRIDIAN_GYM_GIOVANNI ; 32
- const HS_VIRIDIAN_GYM_ITEM ; 33 X
- const HS_OLD_AMBER ; 34
- const HS_CERULEAN_CAVE_1F_ITEM_1 ; 35 X
- const HS_CERULEAN_CAVE_1F_ITEM_2 ; 36 X
- const HS_CERULEAN_CAVE_1F_ITEM_3 ; 37 X
- const HS_POKEMON_TOWER_2F_RIVAL ; 38
- const HS_POKEMON_TOWER_3F_ITEM ; 39 X
- const HS_POKEMON_TOWER_4F_ITEM_1 ; 3A X
- const HS_POKEMON_TOWER_4F_ITEM_2 ; 3B X
- const HS_POKEMON_TOWER_4F_ITEM_3 ; 3C X
- const HS_POKEMON_TOWER_5F_ITEM ; 3D X
- const HS_POKEMON_TOWER_6F_ITEM_1 ; 3E X
- const HS_POKEMON_TOWER_6F_ITEM_2 ; 3F X
- const HS_POKEMON_TOWER_7F_ROCKET_1 ; 40 X
- const HS_POKEMON_TOWER_7F_ROCKET_2 ; 41 X
- const HS_POKEMON_TOWER_7F_ROCKET_3 ; 42 X
+ const HS_OLD_MAN_1 ; 02
+ const HS_OLD_MAN ; 03
+ const HS_MUSEUM_GUY ; 04
+ const HS_GYM_GUY ; 05
+ const HS_CERULEAN_RIVAL ; 06
+ const HS_CERULEAN_ROCKET ; 07
+ const HS_CERULEAN_GUARD_1 ; 08
+ const HS_CERULEAN_CAVE_GUY ; 09
+ const HS_CERULEAN_GUARD_2 ; 0A
+ const HS_SAFFRON_CITY_1 ; 0B
+ const HS_SAFFRON_CITY_2 ; 0C
+ const HS_SAFFRON_CITY_3 ; 0D
+ const HS_SAFFRON_CITY_4 ; 0E
+ const HS_SAFFRON_CITY_5 ; 0F
+ const HS_SAFFRON_CITY_6 ; 10
+ const HS_SAFFRON_CITY_7 ; 11
+ const HS_SAFFRON_CITY_8 ; 12
+ const HS_SAFFRON_CITY_9 ; 13
+ const HS_SAFFRON_CITY_A ; 14
+ const HS_SAFFRON_CITY_B ; 15
+ const HS_SAFFRON_CITY_C ; 16
+ const HS_SAFFRON_CITY_D ; 17
+ const HS_SAFFRON_CITY_E ; 18
+ const HS_SAFFRON_CITY_F ; 19
+ const HS_ROUTE_2_ITEM_1 ; 1A
+ const HS_ROUTE_2_ITEM_2 ; 1B
+ const HS_ROUTE_4_ITEM ; 1C
+ const HS_ROUTE_9_ITEM ; 1D
+ const HS_ROUTE_12_SNORLAX ; 1E
+ const HS_ROUTE_12_ITEM_1 ; 1F
+ const HS_ROUTE_12_ITEM_2 ; 20
+ const HS_ROUTE_15_ITEM ; 21
+ const HS_ROUTE_16_SNORLAX ; 22
+ const HS_ROUTE_22_RIVAL_1 ; 23
+ const HS_ROUTE_22_RIVAL_2 ; 24
+ const HS_NUGGET_BRIDGE_GUY ; 25
+ const HS_ROUTE_24_ITEM ; 26
+ const HS_ROUTE_25_ITEM ; 27
+ const HS_DAISY_SITTING ; 28
+ const HS_DAISY_WALKING ; 29
+ const HS_TOWN_MAP ; 2A
+ const HS_OAKS_LAB_RIVAL ; 2B
+ const HS_STARTER_BALL_1 ; 2C
+ const HS_OAKS_LAB_OAK_1 ; 2D
+ const HS_POKEDEX_1 ; 2E
+ const HS_POKEDEX_2 ; 2F
+ const HS_OAKS_LAB_OAK_2 ; 30
+ const HS_VIRIDIAN_GYM_GIOVANNI ; 31
+ const HS_VIRIDIAN_GYM_ITEM ; 32
+ const HS_OLD_AMBER ; 33
+ const HS_CERULEAN_BULBASAUR ; 34
+ const HS_CERULEAN_CAVE_1F_ITEM_1 ; 35
+ const HS_CERULEAN_CAVE_1F_ITEM_2 ; 36
+ const HS_CERULEAN_CAVE_1F_ITEM_3 ; 37
+ const HS_CERULEAN_CAVE_1F_ITEM_4 ; 38
+ const HS_POKEMON_TOWER_2F_RIVAL ; 39
+ const HS_POKEMON_TOWER_3F_ITEM ; 3A
+ const HS_POKEMON_TOWER_4F_ITEM_1 ; 3B
+ const HS_POKEMON_TOWER_4F_ITEM_2 ; 3C
+ const HS_POKEMON_TOWER_4F_ITEM_3 ; 3D
+ const HS_POKEMON_TOWER_5F_ITEM ; 3E
+ const HS_POKEMON_TOWER_6F_ITEM_1 ; 3F
+ const HS_POKEMON_TOWER_6F_ITEM_2 ; 40
+ const HS_POKEMON_TOWER_7F_JESSIE ; 41
+ const HS_POKEMON_TOWER_7F_JAMES ; 42
const HS_POKEMON_TOWER_7F_MR_FUJI ; 43
const HS_MR_FUJIS_HOUSE_MR_FUJI ; 44
const HS_CELADON_MANSION_EEVEE_GIFT ; 45
const HS_GAME_CORNER_ROCKET ; 46
- const HS_WARDENS_HOUSE_ITEM ; 47 X
- const HS_POKEMON_MANSION_1F_ITEM_1 ; 48 X
- const HS_POKEMON_MANSION_1F_ITEM_2 ; 49 X
+ const HS_WARDENS_HOUSE_ITEM ; 47
+ const HS_POKEMON_MANSION_1F_ITEM_1 ; 48
+ const HS_POKEMON_MANSION_1F_ITEM_2 ; 49
const HS_FIGHTING_DOJO_GIFT_1 ; 4A
const HS_FIGHTING_DOJO_GIFT_2 ; 4B
const HS_SILPH_CO_1F_RECEPTIONIST ; 4C
- const HS_VOLTORB_1 ; 4D X
- const HS_VOLTORB_2 ; 4E X
- const HS_VOLTORB_3 ; 4F X
- const HS_ELECTRODE_1 ; 50 X
- const HS_VOLTORB_4 ; 51 X
- const HS_VOLTORB_5 ; 52 X
- const HS_ELECTRODE_2 ; 53 X
- const HS_VOLTORB_6 ; 54 X
- const HS_ZAPDOS ; 55 X
- const HS_POWER_PLANT_ITEM_1 ; 56 X
- const HS_POWER_PLANT_ITEM_2 ; 57 X
- const HS_POWER_PLANT_ITEM_3 ; 58 X
- const HS_POWER_PLANT_ITEM_4 ; 59 X
- const HS_POWER_PLANT_ITEM_5 ; 5A X
- const HS_MOLTRES ; 5B X
- const HS_VICTORY_ROAD_2F_ITEM_1 ; 5C X
- const HS_VICTORY_ROAD_2F_ITEM_2 ; 5D X
- const HS_VICTORY_ROAD_2F_ITEM_3 ; 5E X
- const HS_VICTORY_ROAD_2F_ITEM_4 ; 5F X
+ const HS_VOLTORB_1 ; 4D
+ const HS_VOLTORB_2 ; 4E
+ const HS_VOLTORB_3 ; 4F
+ const HS_ELECTRODE_1 ; 50
+ const HS_VOLTORB_4 ; 51
+ const HS_VOLTORB_5 ; 52
+ const HS_ELECTRODE_2 ; 53
+ const HS_VOLTORB_6 ; 54
+ const HS_ZAPDOS ; 55
+ const HS_POWER_PLANT_ITEM_1 ; 56
+ const HS_POWER_PLANT_ITEM_2 ; 57
+ const HS_POWER_PLANT_ITEM_3 ; 58
+ const HS_POWER_PLANT_ITEM_4 ; 59
+ const HS_POWER_PLANT_ITEM_5 ; 5A
+ const HS_MOLTRES ; 5B
+ const HS_VICTORY_ROAD_2F_ITEM_1 ; 5C
+ const HS_VICTORY_ROAD_2F_ITEM_2 ; 5D
+ const HS_VICTORY_ROAD_2F_ITEM_3 ; 5E
+ const HS_VICTORY_ROAD_2F_ITEM_4 ; 5F
const HS_VICTORY_ROAD_2F_BOULDER ; 60
const HS_BILL_POKEMON ; 61
const HS_BILL_1 ; 62
const HS_BILL_2 ; 63
- const HS_VIRIDIAN_FOREST_ITEM_1 ; 64 X
- const HS_VIRIDIAN_FOREST_ITEM_2 ; 65 X
- const HS_VIRIDIAN_FOREST_ITEM_3 ; 66 X
- const HS_MT_MOON_1F_ITEM_1 ; 67 X
- const HS_MT_MOON_1F_ITEM_2 ; 68 X
- const HS_MT_MOON_1F_ITEM_3 ; 69 X
- const HS_MT_MOON_1F_ITEM_4 ; 6A X
- const HS_MT_MOON_1F_ITEM_5 ; 6B X
- const HS_MT_MOON_1F_ITEM_6 ; 6C X
- const HS_MT_MOON_B2F_FOSSIL_1 ; 6D
- const HS_MT_MOON_B2F_FOSSIL_2 ; 6E
- const HS_MT_MOON_B2F_ITEM_1 ; 6F X
- const HS_MT_MOON_B2F_ITEM_2 ; 70 X
- const HS_SS_ANNE_2F_RIVAL ; 71
- const HS_SS_ANNE_1F_ROOMS_ITEM ; 72 X
- const HS_SS_ANNE_2F_ROOMS_ITEM_1 ; 73 X
- const HS_SS_ANNE_2F_ROOMS_ITEM_2 ; 74 X
- const HS_SS_ANNE_B1F_ROOMS_ITEM_1 ; 75 X
- const HS_SS_ANNE_B1F_ROOMS_ITEM_2 ; 76 X
- const HS_SS_ANNE_B1F_ROOMS_ITEM_3 ; 77 X
- const HS_VICTORY_ROAD_3F_ITEM_1 ; 78 X
- const HS_VICTORY_ROAD_3F_ITEM_2 ; 79 X
- const HS_VICTORY_ROAD_3F_BOULDER ; 7A
- const HS_ROCKET_HIDEOUT_B1F_ITEM_1 ; 7B X
- const HS_ROCKET_HIDEOUT_B1F_ITEM_2 ; 7C X
- const HS_ROCKET_HIDEOUT_B2F_ITEM_1 ; 7D X
- const HS_ROCKET_HIDEOUT_B2F_ITEM_2 ; 7E X
- const HS_ROCKET_HIDEOUT_B2F_ITEM_3 ; 7F X
- const HS_ROCKET_HIDEOUT_B2F_ITEM_4 ; 80 X
- const HS_ROCKET_HIDEOUT_B3F_ITEM_1 ; 81 X
- const HS_ROCKET_HIDEOUT_B3F_ITEM_2 ; 82 X
- const HS_ROCKET_HIDEOUT_B4F_GIOVANNI ; 83
- const HS_ROCKET_HIDEOUT_B4F_ITEM_1 ; 84 X
- const HS_ROCKET_HIDEOUT_B4F_ITEM_2 ; 85 X
- const HS_ROCKET_HIDEOUT_B4F_ITEM_3 ; 86 X
- const HS_ROCKET_HIDEOUT_B4F_ITEM_4 ; 87
- const HS_ROCKET_HIDEOUT_B4F_ITEM_5 ; 88
- const HS_SILPH_CO_2F_1 ; 89 XXX never (de)activated?
- const HS_SILPH_CO_2F_2 ; 8A
- const HS_SILPH_CO_2F_3 ; 8B
- const HS_SILPH_CO_2F_4 ; 8C
- const HS_SILPH_CO_2F_5 ; 8D
- const HS_SILPH_CO_3F_1 ; 8E
- const HS_SILPH_CO_3F_2 ; 8F
- const HS_SILPH_CO_3F_ITEM ; 90 X
- const HS_SILPH_CO_4F_1 ; 91
- const HS_SILPH_CO_4F_2 ; 92
- const HS_SILPH_CO_4F_3 ; 93
- const HS_SILPH_CO_4F_ITEM_1 ; 94 X
- const HS_SILPH_CO_4F_ITEM_2 ; 95 X
- const HS_SILPH_CO_4F_ITEM_3 ; 96 X
- const HS_SILPH_CO_5F_1 ; 97
- const HS_SILPH_CO_5F_2 ; 98
- const HS_SILPH_CO_5F_3 ; 99
- const HS_SILPH_CO_5F_4 ; 9A
- const HS_SILPH_CO_5F_ITEM_1 ; 9B X
- const HS_SILPH_CO_5F_ITEM_2 ; 9C X
- const HS_SILPH_CO_5F_ITEM_3 ; 9D X
- const HS_SILPH_CO_6F_1 ; 9E
- const HS_SILPH_CO_6F_2 ; 9F
- const HS_SILPH_CO_6F_3 ; A0
- const HS_SILPH_CO_6F_ITEM_1 ; A1 X
- const HS_SILPH_CO_6F_ITEM_2 ; A2 X
- const HS_SILPH_CO_7F_1 ; A3
- const HS_SILPH_CO_7F_2 ; A4
- const HS_SILPH_CO_7F_3 ; A5
- const HS_SILPH_CO_7F_4 ; A6
- const HS_SILPH_CO_7F_RIVAL ; A7
- const HS_SILPH_CO_7F_ITEM_1 ; A8 X
- const HS_SILPH_CO_7F_ITEM_2 ; A9 X
- const HS_SILPH_CO_7F_8 ; AA XXX sprite doesn't exist
- const HS_SILPH_CO_8F_1 ; AB
- const HS_SILPH_CO_8F_2 ; AC
- const HS_SILPH_CO_8F_3 ; AD
- const HS_SILPH_CO_9F_1 ; AE
- const HS_SILPH_CO_9F_2 ; AF
- const HS_SILPH_CO_9F_3 ; B0
- const HS_SILPH_CO_10F_1 ; B1
- const HS_SILPH_CO_10F_2 ; B2
- const HS_SILPH_CO_10F_3 ; B3 XXX never (de)activated?
- const HS_SILPH_CO_10F_ITEM_1 ; B4 X
- const HS_SILPH_CO_10F_ITEM_2 ; B5 X
- const HS_SILPH_CO_10F_ITEM_3 ; B6 X
- const HS_SILPH_CO_11F_1 ; B7
- const HS_SILPH_CO_11F_2 ; B8
- const HS_SILPH_CO_11F_3 ; B9
- const HS_UNUSED_MAP_F4_1 ; BA XXX sprite doesn't exist
- const HS_POKEMON_MANSION_2F_ITEM ; BB X
- const HS_POKEMON_MANSION_3F_ITEM_1 ; BC X
- const HS_POKEMON_MANSION_3F_ITEM_2 ; BD X
- const HS_POKEMON_MANSION_B1F_ITEM_1 ; BE X
- const HS_POKEMON_MANSION_B1F_ITEM_2 ; BF X
- const HS_POKEMON_MANSION_B1F_ITEM_3 ; C0 X
- const HS_POKEMON_MANSION_B1F_ITEM_4 ; C1 X
- const HS_POKEMON_MANSION_B1F_ITEM_5 ; C2 X
- const HS_SAFARI_ZONE_EAST_ITEM_1 ; C3 X
- const HS_SAFARI_ZONE_EAST_ITEM_2 ; C4 X
- const HS_SAFARI_ZONE_EAST_ITEM_3 ; C5 X
- const HS_SAFARI_ZONE_EAST_ITEM_4 ; C6 X
- const HS_SAFARI_ZONE_NORTH_ITEM_1 ; C7 X
- const HS_SAFARI_ZONE_NORTH_ITEM_2 ; C8 X
- const HS_SAFARI_ZONE_WEST_ITEM_1 ; C9 X
- const HS_SAFARI_ZONE_WEST_ITEM_2 ; CA X
- const HS_SAFARI_ZONE_WEST_ITEM_3 ; CB X
- const HS_SAFARI_ZONE_WEST_ITEM_4 ; CC X
- const HS_SAFARI_ZONE_CENTER_ITEM ; CD X
- const HS_CERULEAN_CAVE_2F_ITEM_1 ; CE X
- const HS_CERULEAN_CAVE_2F_ITEM_2 ; CF X
- const HS_CERULEAN_CAVE_2F_ITEM_3 ; D0 X
- const HS_MEWTWO ; D1 X
- const HS_CERULEAN_CAVE_B1F_ITEM_1 ; D2 X
- const HS_CERULEAN_CAVE_B1F_ITEM_2 ; D3 X
- const HS_VICTORY_ROAD_1F_ITEM_1 ; D4 X
- const HS_VICTORY_ROAD_1F_ITEM_2 ; D5 X
- const HS_CHAMPIONS_ROOM_OAK ; D6
- const HS_SEAFOAM_ISLANDS_1F_BOULDER_1 ; D7
- const HS_SEAFOAM_ISLANDS_1F_BOULDER_2 ; D8
- const HS_SEAFOAM_ISLANDS_B1F_BOULDER_1 ; D9
- const HS_SEAFOAM_ISLANDS_B1F_BOULDER_2 ; DA
- const HS_SEAFOAM_ISLANDS_B2F_BOULDER_1 ; DB
- const HS_SEAFOAM_ISLANDS_B2F_BOULDER_2 ; DC
- const HS_SEAFOAM_ISLANDS_B3F_BOULDER_1 ; DD
- const HS_SEAFOAM_ISLANDS_B3F_BOULDER_2 ; DE
- const HS_SEAFOAM_ISLANDS_B3F_BOULDER_3 ; DF
- const HS_SEAFOAM_ISLANDS_B3F_BOULDER_4 ; E0
- const HS_SEAFOAM_ISLANDS_B4F_BOULDER_1 ; E1
- const HS_SEAFOAM_ISLANDS_B4F_BOULDER_2 ; E2
- const HS_ARTICUNO ; E3 X
+ const HS_VIRIDIAN_FOREST_ITEM_1 ; 64
+ const HS_VIRIDIAN_FOREST_ITEM_2 ; 65
+ const HS_VIRIDIAN_FOREST_ITEM_3 ; 66
+ const HS_MT_MOON_1F_ITEM_1 ; 67
+ const HS_MT_MOON_1F_ITEM_2 ; 68
+ const HS_MT_MOON_1F_ITEM_3 ; 69
+ const HS_MT_MOON_1F_ITEM_4 ; 6A
+ const HS_MT_MOON_1F_ITEM_5 ; 6B
+ const HS_MT_MOON_1F_ITEM_6 ; 6C
+ const HS_MT_MOON_B2F_JESSIE ; 6D
+ const HS_MT_MOON_B2F_JAMES ; 6E
+ const HS_MT_MOON_B2F_FOSSIL_1 ; 6F
+ const HS_MT_MOON_B2F_FOSSIL_2 ; 70
+ const HS_MT_MOON_B2F_ITEM_1 ; 71
+ const HS_MT_MOON_B2F_ITEM_2 ; 72
+ const HS_SS_ANNE_2F_RIVAL ; 73
+ const HS_SS_ANNE_1F_ROOMS_ITEM ; 74
+ const HS_SS_ANNE_2F_ROOMS_ITEM_1 ; 75
+ const HS_SS_ANNE_2F_ROOMS_ITEM_2 ; 76
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_1 ; 77
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_2 ; 78
+ const HS_SS_ANNE_B1F_ROOMS_ITEM_3 ; 79
+ const HS_VICTORY_ROAD_3F_ITEM_1 ; 7A
+ const HS_VICTORY_ROAD_3F_ITEM_2 ; 7B
+ const HS_VICTORY_ROAD_3F_BOULDER ; 7C
+ const HS_ROCKET_HIDEOUT_B1F_ITEM_1 ; 7D
+ const HS_ROCKET_HIDEOUT_B1F_ITEM_2 ; 7E
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_1 ; 7F
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_2 ; 80
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_3 ; 81
+ const HS_ROCKET_HIDEOUT_B2F_ITEM_4 ; 82
+ const HS_ROCKET_HIDEOUT_B3F_ITEM_1 ; 83
+ const HS_ROCKET_HIDEOUT_B3F_ITEM_2 ; 84
+ const HS_ROCKET_HIDEOUT_B4F_GIOVANNI ; 85
+ const HS_ROCKET_HIDEOUT_B4F_JAMES ; 86
+ const HS_ROCKET_HIDEOUT_B4F_JESSIE ; 87
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_1 ; 88
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_2 ; 89
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_3 ; 8A
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_4 ; 8B
+ const HS_ROCKET_HIDEOUT_B4F_ITEM_5 ; 8C
+ const HS_SILPH_CO_2F_1 ; 8D XXX never (de)activated?
+ const HS_SILPH_CO_2F_2 ; 8E
+ const HS_SILPH_CO_2F_3 ; 8F
+ const HS_SILPH_CO_2F_4 ; 90
+ const HS_SILPH_CO_2F_5 ; 91
+ const HS_SILPH_CO_3F_1 ; 92
+ const HS_SILPH_CO_3F_2 ; 93
+ const HS_SILPH_CO_3F_ITEM ; 94
+ const HS_SILPH_CO_4F_1 ; 95
+ const HS_SILPH_CO_4F_2 ; 96
+ const HS_SILPH_CO_4F_3 ; 97
+ const HS_SILPH_CO_4F_ITEM_1 ; 98
+ const HS_SILPH_CO_4F_ITEM_2 ; 99
+ const HS_SILPH_CO_4F_ITEM_3 ; 9A
+ const HS_SILPH_CO_5F_1 ; 9B
+ const HS_SILPH_CO_5F_2 ; 9C
+ const HS_SILPH_CO_5F_3 ; 9D
+ const HS_SILPH_CO_5F_4 ; 9E
+ const HS_SILPH_CO_5F_ITEM_1 ; 9F
+ const HS_SILPH_CO_5F_ITEM_2 ; A0
+ const HS_SILPH_CO_5F_ITEM_3 ; A1
+ const HS_SILPH_CO_6F_1 ; A2
+ const HS_SILPH_CO_6F_2 ; A3
+ const HS_SILPH_CO_6F_3 ; A4
+ const HS_SILPH_CO_6F_ITEM_1 ; A5
+ const HS_SILPH_CO_6F_ITEM_2 ; A6
+ const HS_SILPH_CO_7F_1 ; A7
+ const HS_SILPH_CO_7F_2 ; A8
+ const HS_SILPH_CO_7F_3 ; A9
+ const HS_SILPH_CO_7F_4 ; AA
+ const HS_SILPH_CO_7F_RIVAL ; AB
+ const HS_SILPH_CO_7F_ITEM_1 ; AC
+ const HS_SILPH_CO_7F_ITEM_2 ; AD
+ const HS_SILPH_CO_7F_8 ; AE XXX sprite doesn't exist
+ const HS_SILPH_CO_8F_1 ; AF
+ const HS_SILPH_CO_8F_2 ; B0
+ const HS_SILPH_CO_8F_3 ; B1
+ const HS_SILPH_CO_9F_1 ; B2
+ const HS_SILPH_CO_9F_2 ; B3
+ const HS_SILPH_CO_9F_3 ; B4
+ const HS_SILPH_CO_10F_1 ; B5
+ const HS_SILPH_CO_10F_2 ; B6
+ const HS_SILPH_CO_10F_3 ; B7 XXX never (de)activated?
+ const HS_SILPH_CO_10F_ITEM_1 ; B8
+ const HS_SILPH_CO_10F_ITEM_2 ; B9
+ const HS_SILPH_CO_10F_ITEM_3 ; BA
+ const HS_SILPH_CO_11F_1 ; BB
+ const HS_SILPH_CO_11F_JAMES ; BC
+ const HS_SILPH_CO_11F_2 ; BD
+ const HS_SILPH_CO_11F_JESSIE ; BE
+ const HS_UNUSED_MAP_F4_1 ; BF XXX sprite doesn't exist
+ const HS_POKEMON_MANSION_2F_ITEM ; C0
+ const HS_POKEMON_MANSION_3F_ITEM_1 ; C1
+ const HS_POKEMON_MANSION_3F_ITEM_2 ; C2
+ const HS_POKEMON_MANSION_B1F_ITEM_1 ; C3
+ const HS_POKEMON_MANSION_B1F_ITEM_2 ; C4
+ const HS_POKEMON_MANSION_B1F_ITEM_3 ; C5
+ const HS_POKEMON_MANSION_B1F_ITEM_4 ; C6
+ const HS_POKEMON_MANSION_B1F_ITEM_5 ; C7
+ const HS_SAFARI_ZONE_EAST_ITEM_1 ; C8
+ const HS_SAFARI_ZONE_EAST_ITEM_2 ; C9
+ const HS_SAFARI_ZONE_EAST_ITEM_3 ; CA
+ const HS_SAFARI_ZONE_EAST_ITEM_4 ; CB
+ const HS_SAFARI_ZONE_NORTH_ITEM_1 ; CC
+ const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CD
+ const HS_SAFARI_ZONE_WEST_ITEM_1 ; CE
+ const HS_SAFARI_ZONE_WEST_ITEM_2 ; CF
+ const HS_SAFARI_ZONE_WEST_ITEM_3 ; D0
+ const HS_SAFARI_ZONE_WEST_ITEM_4 ; D1
+ const HS_SAFARI_ZONE_CENTER_ITEM ; D2
+ const HS_CERULEAN_CAVE_2F_ITEM_1 ; D3
+ const HS_CERULEAN_CAVE_2F_ITEM_2 ; D4
+ const HS_CERULEAN_CAVE_2F_ITEM_3 ; D5
+ const HS_CERULEAN_CAVE_2F_ITEM_4 ; D6
+ const HS_MEWTWO ; D7
+ const HS_CERULEAN_CAVE_B1F_ITEM_1 ; D8
+ const HS_CERULEAN_CAVE_B1F_ITEM_2 ; D9
+ const HS_CERULEAN_CAVE_B1F_ITEM_3 ; DA
+ const HS_CERULEAN_CAVE_B1F_ITEM_4 ; DB
+ const HS_VICTORY_ROAD_1F_ITEM_1 ; DC
+ const HS_VICTORY_ROAD_1F_ITEM_2 ; DD
+ const HS_CHAMPIONS_ROOM_OAK ; DE
+ const HS_SEAFOAM_ISLANDS_1F_BOULDER_1 ; DF
+ const HS_SEAFOAM_ISLANDS_1F_BOULDER_2 ; E0
+ const HS_SEAFOAM_ISLANDS_B1F_BOULDER_1 ; E1
+ const HS_SEAFOAM_ISLANDS_B1F_BOULDER_2 ; E2
+ const HS_SEAFOAM_ISLANDS_B2F_BOULDER_1 ; E3
+ const HS_SEAFOAM_ISLANDS_B2F_BOULDER_2 ; E4
+ const HS_SEAFOAM_ISLANDS_B3F_BOULDER_1 ; E5
+ const HS_SEAFOAM_ISLANDS_B3F_BOULDER_2 ; E6
+ const HS_SEAFOAM_ISLANDS_B3F_BOULDER_3 ; E7
+ const HS_SEAFOAM_ISLANDS_B3F_BOULDER_4 ; E8
+ const HS_SEAFOAM_ISLANDS_B4F_BOULDER_1 ; E9
+ const HS_SEAFOAM_ISLANDS_B4F_BOULDER_2 ; EA
+ const HS_ARTICUNO ; EB
+ const HS_DAISY_SITTING_COPY ; EC
+ const HS_DAISY_WALKING_COPY ; ED
+ const HS_TOWN_MAP_COPY ; EE
NUM_HS_OBJECTS EQU const_value
diff --git a/constants/icon_constants.asm b/constants/icon_constants.asm
index 14202da3..bc73632e 100644
--- a/constants/icon_constants.asm
+++ b/constants/icon_constants.asm
@@ -11,6 +11,7 @@
const ICON_GRASS ; $7
const ICON_SNAKE ; $8
const ICON_QUADRUPED ; $9
+ const ICON_PIKACHU ; $A
ICON_TRADEBUBBLE EQU $e
diff --git a/constants/item_constants.asm b/constants/item_constants.asm
index d8a5910f..08ea1294 100644
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -215,3 +215,6 @@ NUM_TM_HM EQU NUM_TMS + NUM_HMS
; These fit in 7 bytes, with one unused bit left over.
__tmhm_value__ = NUM_TM_HM + 1
UNUSED_TMNUM EQU __tmhm_value__
+
+; used for Time Capsule held item compatibility
+TWISTEDSPOON_GSC EQU $60
diff --git a/constants/map_constants.asm b/constants/map_constants.asm
index 58343342..c365cd5b 100644
--- a/constants/map_constants.asm
+++ b/constants/map_constants.asm
@@ -81,7 +81,7 @@ FIRST_INDOOR_MAP EQU const_value
mapconst MT_MOON_B1F, 14, 14 ; $3C
mapconst MT_MOON_B2F, 18, 20 ; $3D
mapconst CERULEAN_TRASHED_HOUSE, 4, 4 ; $3E
- mapconst CERULEAN_TRADE_HOUSE, 4, 4 ; $3F
+ mapconst CERULEAN_MELANIES_HOUSE, 4, 4 ; $3F
mapconst CERULEAN_POKECENTER, 4, 7 ; $40
mapconst CERULEAN_GYM, 7, 5 ; $41
mapconst BIKE_SHOP, 4, 4 ; $42
@@ -266,6 +266,7 @@ FIRST_INDOOR_MAP EQU const_value
mapconst LORELEIS_ROOM, 6, 5 ; $F5
mapconst BRUNOS_ROOM, 6, 5 ; $F6
mapconst AGATHAS_ROOM, 6, 5 ; $F7
+ mapconst SUMMER_BEACH_HOUSE, 4, 7 ; $F8
NUM_MAPS EQU const_value
; Indoor maps, such as houses, use this as the Map ID in their exit warps
diff --git a/constants/move_effect_constants.asm b/constants/move_effect_constants.asm
index bc444647..9b895490 100644
--- a/constants/move_effect_constants.asm
+++ b/constants/move_effect_constants.asm
@@ -39,7 +39,7 @@
const SLEEP_EFFECT ; $20
const POISON_SIDE_EFFECT2 ; $21
const BURN_SIDE_EFFECT2 ; $22
- const_skip ; $23
+ const UNUSED_EFFECT_23 ; $23
const PARALYZE_SIDE_EFFECT2 ; $24
const FLINCH_SIDE_EFFECT2 ; $25
const OHKO_EFFECT ; $26 moves like Horn Drill
diff --git a/constants/music_constants.asm b/constants/music_constants.asm
index fcca9005..46955712 100644
--- a/constants/music_constants.asm
+++ b/constants/music_constants.asm
@@ -45,7 +45,7 @@ ENDM
music_const MUSIC_BIKE_RIDING, Music_BikeRiding
music_const MUSIC_SURFING, Music_Surfing
music_const MUSIC_GAME_CORNER, Music_GameCorner
- music_const MUSIC_INTRO_BATTLE, Music_IntroBattle
+ music_const MUSIC_YELLOW_INTRO, Music_YellowIntro
music_const MUSIC_DUNGEON1, Music_Dungeon1
music_const MUSIC_DUNGEON2, Music_Dungeon2
music_const MUSIC_DUNGEON3, Music_Dungeon3
@@ -56,7 +56,13 @@ ENDM
music_const MUSIC_MEET_FEMALE_TRAINER, Music_MeetFemaleTrainer
music_const MUSIC_MEET_MALE_TRAINER, Music_MeetMaleTrainer
- ; AUDIO_1 AUDIO_2 AUDIO_3
+ ; AUDIO_4
+ music_const MUSIC_SURFING_PIKACHU, Music_SurfingPikachu
+ music_const MUSIC_MEET_JESSIE_JAMES, Music_MeetJessieJames
+ music_const MUSIC_YELLOW_UNUSED_SONG, Music_YellowUnusedSong
+ music_const MUSIC_GB_PRINTER, Music_GBPrinter
+
+ ; AUDIO_1 AUDIO_2 AUDIO_3 AUDIO_4
NOISE_INSTRUMENTS_START EQUS "SFX_NOISE_INSTRUMENT01"
music_const SFX_NOISE_INSTRUMENT01, SFX_Noise_Instrument01_1
music_const SFX_NOISE_INSTRUMENT02, SFX_Noise_Instrument02_1
@@ -127,9 +133,10 @@ CRY_SFX_END EQUS "SFX_CRY_25 + 3"
music_const SFX_START_MENU, SFX_Start_Menu_1
music_const SFX_PRESS_AB, SFX_Press_AB_1
- ; AUDIO_1 AUDIO_3
+ ; AUDIO_1 AUDIO_3 AUDIO_4
music_const SFX_GET_ITEM_1, SFX_Get_Item1_1
+ ; AUDIO_1 AUDIO_3
music_const SFX_POKEDEX_RATING, SFX_Pokedex_Rating_1
music_const SFX_GET_KEY_ITEM, SFX_Get_Key_Item_1
music_const SFX_POISONED, SFX_Poisoned_1
@@ -241,4 +248,13 @@ MAX_SFX_ID_2 EQUS "SFX_SILPH_SCOPE"
music_const SFX_SHOOTING_STAR, SFX_Shooting_Star
MAX_SFX_ID_3 EQUS "SFX_SHOOTING_STAR"
+ ; AUDIO_4
+ music_const SFX_SURFING_JUMP, SFX_Surfing_Jump
+ music_const SFX_SURFING_FLIP, SFX_Surfing_Flip
+ music_const SFX_SURFING_CRASH, SFX_Surfing_Crash
+ music_const SFX_UNKNOWN_802CC_4, SFX_802cc_4
+ music_const SFX_SURFING_LAND, SFX_Surfing_Land
+ music_const SFX_GET_ITEM2_4_2, SFX_Get_Item2_4_2
+MAX_SFX_ID_4 EQUS "SFX_GET_ITEM2_4_2 + 2"
+
SFX_STOP_ALL_MUSIC EQU $ff
diff --git a/constants/oam_constants.asm b/constants/oam_constants.asm
index be63dc24..0b783d8b 100644
--- a/constants/oam_constants.asm
+++ b/constants/oam_constants.asm
@@ -11,6 +11,7 @@ OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
; OAM attribute masks
+OAM_HIGH_PALS EQU 1 << 2 ; palettes %100-%111 are OBP1
OAM_OBP1 EQU 1 << OAM_OBP_NUM ; OBJ palette 1
OAM_HFLIP EQU 1 << OAM_X_FLIP ; horizontal flip
OAM_VFLIP EQU 1 << OAM_Y_FLIP ; vertical flip
diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm
index c26945e8..0fb63b74 100644
--- a/constants/palette_constants.asm
+++ b/constants/palette_constants.asm
@@ -9,6 +9,8 @@ NUM_PAL_COLORS EQU const_value
PAL_COLOR_SIZE EQU 2
PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE
+NUM_ACTIVE_PALS EQU 4
+
; pal/blk packets
; SetPalFunctions indexes (see engine/gfx/palettes.asm)
const_def
@@ -70,4 +72,7 @@ SET_PAL_DEFAULT EQU $ff
const PAL_BADGE ; $22
const PAL_CAVE ; $23
const PAL_GAMEFREAK ; $24
+ const PAL_25 ; $25
+ const PAL_26 ; $26
+ const PAL_27 ; $27
NUM_SGB_PALS EQU const_value
diff --git a/constants/pikachu_emotion_constants.asm b/constants/pikachu_emotion_constants.asm
new file mode 100644
index 00000000..f9298f16
--- /dev/null
+++ b/constants/pikachu_emotion_constants.asm
@@ -0,0 +1,229 @@
+; pikachu happiness modifiers
+ const_def 1
+ const PIKAHAPPY_LEVELUP
+ const PIKAHAPPY_USEDITEM
+ const PIKAHAPPY_USEDXITEM
+ const PIKAHAPPY_GYMLEADER
+ const PIKAHAPPY_USEDTMHM
+ const PIKAHAPPY_WALKING
+ const PIKAHAPPY_DEPOSITED
+ const PIKAHAPPY_FAINTED
+ const PIKAHAPPY_PSNFNT
+ const PIKAHAPPY_CARELESSTRAINER
+ const PIKAHAPPY_TRADE
+
+dpikapic: MACRO
+ db (\1_id - PikaPicAnimPointers) / 2
+ENDM
+
+dpikaemotion: MACRO
+ db (\1_id - PikachuEmotionTable) / 2
+ENDM
+
+ldpikaemotion: MACRO
+ ld \1, (\2_id - PikachuEmotionTable) / 2
+ENDM
+
+; Starter Pikachu emotion commands constants
+
+ const_def
+ const PIKAEMOTION_DUMMY1
+ const PIKAEMOTION_PRINTTEXT
+ const PIKAEMOTION_PLAYPCMSOUNDCLIP
+ const PIKAEMOTION_DOEMOTIONBUBBLE
+ const PIKAEMOTION_4
+ const PIKAEMOTION_5
+ const PIKAEMOTION_SUBCMD
+ const PIKAEMOTION_DELAYFRAMES
+ const PIKAEMOTION_DUMMY2
+ const PIKAEMOTION_9
+ const PIKAEMOTION_DUMMY3
+
+ const_def
+ const PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ const PIKAEMOTION_SUBCMD_LOADFONT
+ const PIKAEMOTION_SUBCMD_SHOWMAPVIEW
+ const PIKAEMOTION_SUBCMD_WAITBUTTONPRESS
+ const PIKAEMOTION_SUBCMD_CHECKPEWTERCENTER
+ const PIKAEMOTION_SUBCMD_CHECKLAVENDERTOWER
+ const PIKAEMOTION_SUBCMD_CHECKBILLSHOUSE
+
+ const_def
+ const PIKASTEPDIR_DOWN
+ const PIKASTEPDIR_UP
+ const PIKASTEPDIR_LEFT
+ const PIKASTEPDIR_RIGHT
+ const PIKASTEPDIR_DOWN_LEFT
+ const PIKASTEPDIR_DOWN_RIGHT
+ const PIKASTEPDIR_UP_LEFT
+ const PIKASTEPDIR_UP_RIGHT
+
+
+; MACROs for commands
+pikaemotion_dummy1: MACRO
+ db PIKAEMOTION_DUMMY1
+ENDM
+
+pikaemotion_printtext: MACRO
+ db PIKAEMOTION_PRINTTEXT
+ dw \1
+ENDM
+
+pikaemotion_pcm: MACRO
+ db PIKAEMOTION_PLAYPCMSOUNDCLIP
+IF _NARG > 0
+ dpikacry \1
+ELSE
+ db $ff
+ENDC
+ENDM
+
+pikaemotion_emotebubble: MACRO
+ db PIKAEMOTION_DOEMOTIONBUBBLE
+ db \1
+ENDM
+
+pikaemotion_movement: MACRO
+ db PIKAEMOTION_4
+ dw \1
+ENDM
+
+pikaemotion_pikapic: MACRO
+ db PIKAEMOTION_5
+ dpikapic \1
+ENDM
+
+pikaemotion_subcmd: MACRO
+ db PIKAEMOTION_SUBCMD
+ db \1
+ENDM
+
+pikaemotion_delay: MACRO
+ db PIKAEMOTION_DELAYFRAMES
+ db \1
+ENDM
+
+pikaemotion_dummy2: MACRO
+ db PIKAEMOTION_DUMMY2
+ENDM
+
+pikaemotion_9: MACRO
+ db PIKAEMOTION_9
+ENDM
+
+pikaemotion_dummy3: MACRO
+ db PIKAEMOTION_DUMMY3
+ENDM
+
+pikacry_def: MACRO
+\1_id::
+ dba \1
+ENDM
+
+dpikacry: MACRO
+ db (\1_id - PikachuCriesPointerTable) / 3
+ENDM
+
+ldpikacry: MACRO
+ ld \1, (\2_id - PikachuCriesPointerTable) / 3
+ENDM
+
+pikacry: MACRO
+ ldpikacry a, \1
+ENDM
+
+
+ const_def
+ const pikapic_nop_command
+pikapic_nop: MACRO
+ db pikapic_nop_command
+ENDM
+
+ const pikapic_writebyte_command
+pikapic_writebyte: MACRO
+ db pikapic_writebyte_command
+ db \1
+ENDM
+
+ const pikapic_loadgfx_command
+pikapic_loadgfx: MACRO
+ db pikapic_loadgfx_command
+ db (\1_id - PikaPicAnimGFXHeaders) / 4
+ENDM
+
+ const pikapic_animation_command
+pikapic_animation: MACRO
+ ; frameset pointer, starting vtile, y offset, x offset
+ db pikapic_animation_command
+ db (\1_id - PikaPicAnimBGFramesPointers) / 2
+ db 0, \2, \3, \4
+ENDM
+
+ const pikapic_nop4_command
+pikapic_nop4: MACRO
+ db pikapic_nop4_command
+ENDM
+
+ const pikapic_nop5_command
+pikapic_nop5: MACRO
+ db pikapic_nop5_command
+ENDM
+
+ const pikapic_waitbgmapeleteobject_command
+pikapic_waitbgmapeleteobject: MACRO
+ db pikapic_waitbgmapeleteobject_command
+ db \1
+ENDM
+
+ const pikapic_nop7_command
+pikapic_nop7: MACRO
+ db pikapic_nop7_command
+ENDM
+
+ const pikapic_nop8_command
+pikapic_nop8: MACRO
+ db pikapic_nop8_command
+ENDM
+
+ const pikapic_jump_command
+pikapic_jump: MACRO ; 9
+ db pikapic_jump_command
+ dw \1
+ENDM
+
+ const pikapic_setduration_command
+pikapic_setduration: MACRO ; a
+ db pikapic_setduration_command
+ dw \1
+ENDM
+
+ const pikapic_cry_command
+pikapic_cry: MACRO ; b
+ db pikapic_cry_command
+IF _NARG == 0
+ db $ff
+else
+ dpikacry \1
+ endc
+ENDM
+
+ const pikapic_thunderbolt_command
+pikapic_thunderbolt: MACRO ; c
+ db pikapic_thunderbolt_command
+ENDM
+
+ const pikapic_waitbgmap_command
+pikapic_waitbgmap: MACRO ; d
+ db pikapic_waitbgmap_command
+ENDM
+
+ const pikapic_ret_command
+pikapic_ret: MACRO ; e
+ db pikapic_ret_command
+ENDM
+
+pikapic_looptofinish: MACRO
+.loop\@
+ pikapic_waitbgmap
+ pikapic_jump .loop\@
+ENDM
diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm
index d01398b8..f5c1c7b8 100644
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -200,10 +200,13 @@
NUM_POKEMON_INDEXES EQU const_value - 1
-; starters
-STARTER1 EQU CHARMANDER
-STARTER2 EQU SQUIRTLE
-STARTER3 EQU BULBASAUR
+; player starter
+STARTER_PIKACHU EQU PIKACHU
+
+; rival starters
+RIVAL_STARTER_JOLTEON EQU 1
+RIVAL_STARTER_FLAREON EQU 2
+RIVAL_STARTER_VAPOREON EQU 3
; ghost Marowak in Pokémon Tower
RESTLESS_SOUL EQU MAROWAK
diff --git a/constants/script_constants.asm b/constants/script_constants.asm
index fe50e8ae..3195e7f4 100644
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -3,6 +3,11 @@
const EXCLAMATION_BUBBLE ; 0
const QUESTION_BUBBLE ; 1
const SMILE_BUBBLE ; 2
+ const SKULL_BUBBLE ; 3
+ const HEART_BUBBLE ; 4
+ const BOLT_BUBBLE ; 5
+ const ZZZ_BUBBLE ; 6
+ const FISH_BUBBLE ; 7
; slot symbols
SLOTS7 EQU $0200
diff --git a/constants/sprite_anim_constants.asm b/constants/sprite_anim_constants.asm
new file mode 100644
index 00000000..f5a90ab9
--- /dev/null
+++ b/constants/sprite_anim_constants.asm
@@ -0,0 +1,17 @@
+; animated_object struct members (see macros/wram.asm)
+ANIM_OBJ_INDEX EQUS "wAnimatedObject0Index - wAnimatedObject0"
+ANIM_OBJ_FRAME_SET EQUS "wAnimatedObject0FramesetID - wAnimatedObject0"
+ANIM_OBJ_CALLBACK EQUS "wAnimatedObject0AnimSeqID - wAnimatedObject0"
+ANIM_OBJ_TILE EQUS "wAnimatedObject0TileID - wAnimatedObject0"
+ANIM_OBJ_X_COORD EQUS "wAnimatedObject0XCoord - wAnimatedObject0"
+ANIM_OBJ_Y_COORD EQUS "wAnimatedObject0YCoord - wAnimatedObject0"
+ANIM_OBJ_X_OFFSET EQUS "wAnimatedObject0XOffset - wAnimatedObject0"
+ANIM_OBJ_Y_OFFSET EQUS "wAnimatedObject0YOffset - wAnimatedObject0"
+ANIM_OBJ_DURATION EQUS "wAnimatedObject0Duration - wAnimatedObject0"
+ANIM_OBJ_DURATION_OFFSET EQUS "wAnimatedObject0DurationOffset - wAnimatedObject0"
+ANIM_OBJ_FRAME_IDX EQUS "wAnimatedObject0FrameIndex - wAnimatedObject0"
+ANIM_OBJ_FIELD_B EQUS "wAnimatedObject0FieldB - wAnimatedObject0"
+ANIM_OBJ_FIELD_C EQUS "wAnimatedObject0FieldC - wAnimatedObject0"
+ANIM_OBJ_FIELD_D EQUS "wAnimatedObject0FieldD - wAnimatedObject0"
+ANIM_OBJ_FIELD_E EQUS "wAnimatedObject0FieldE - wAnimatedObject0"
+ANIM_OBJ_FIELD_F EQUS "wAnimatedObject0FieldF - wAnimatedObject0"
diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm
index ee7238d9..2807663e 100644
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -32,7 +32,7 @@
const SPRITE_MIDDLE_AGED_WOMAN ; $1c
const SPRITE_BRUNETTE_GIRL ; $1d
const SPRITE_LANCE ; $1e
- const SPRITE_UNUSED_SCIENTIST ; $1f
+ const SPRITE_UNUSED_RED_1 ; $1f
const SPRITE_SCIENTIST ; $20
const SPRITE_ROCKER ; $21
const SPRITE_SWIMMER ; $22
@@ -51,28 +51,38 @@
const SPRITE_FISHER ; $2f
const SPRITE_KOGA ; $30
const SPRITE_GUARD ; $31
- const SPRITE_UNUSED_GUARD ; $32
+ const SPRITE_UNUSED_RED_2 ; $32
const SPRITE_MOM ; $33
const SPRITE_BALDING_GUY ; $34
const SPRITE_LITTLE_BOY ; $35
- const SPRITE_UNUSED_GAMEBOY_KID ; $36
+ const SPRITE_UNUSED_RED_3 ; $36
const SPRITE_GAMEBOY_KID ; $37
const SPRITE_FAIRY ; $38
const SPRITE_AGATHA ; $39
const SPRITE_BRUNO ; $3a
const SPRITE_LORELEI ; $3b
const SPRITE_SEEL ; $3c
+ const SPRITE_PIKACHU ; $3d
+ const SPRITE_OFFICER_JENNY ; $3e
+ const SPRITE_SANDSHREW ; $3f
+ const SPRITE_ODDISH ; $40
+ const SPRITE_BULBASAUR ; $41
+ const SPRITE_JIGGLYPUFF ; $42
+ const SPRITE_CLEFAIRY ; $43
+ const SPRITE_CHANSEY ; $44
+ const SPRITE_JESSIE ; $45
+ const SPRITE_JAMES ; $46
FIRST_STILL_SPRITE EQU const_value
- const SPRITE_POKE_BALL ; $3d
- const SPRITE_FOSSIL ; $3e
- const SPRITE_BOULDER ; $3f
- const SPRITE_PAPER ; $40
- const SPRITE_POKEDEX ; $41
- const SPRITE_CLIPBOARD ; $42
- const SPRITE_SNORLAX ; $43
- const SPRITE_UNUSED_OLD_AMBER ; $44
- const SPRITE_OLD_AMBER ; $45
- const SPRITE_UNUSED_GAMBLER_ASLEEP_1 ; $46
- const SPRITE_UNUSED_GAMBLER_ASLEEP_2 ; $47
- const SPRITE_GAMBLER_ASLEEP ; $48
+ const SPRITE_POKE_BALL ; $47
+ const SPRITE_FOSSIL ; $48
+ const SPRITE_BOULDER ; $49
+ const SPRITE_PAPER ; $4a
+ const SPRITE_POKEDEX ; $4b
+ const SPRITE_CLIPBOARD ; $4c
+ const SPRITE_SNORLAX ; $4d
+ const SPRITE_UNUSED_OLD_AMBER ; $4e
+ const SPRITE_OLD_AMBER ; $4f
+ const SPRITE_UNUSED_GAMBLER_ASLEEP_1 ; $50
+ const SPRITE_UNUSED_GAMBLER_ASLEEP_2 ; $51
+ const SPRITE_GAMBLER_ASLEEP ; $52
NUM_SPRITES EQU const_value - 1
diff --git a/constants/text_constants.asm b/constants/text_constants.asm
index e0d36148..f8ecfd52 100644
--- a/constants/text_constants.asm
+++ b/constants/text_constants.asm
@@ -18,5 +18,6 @@ LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES)
const TEXT_BLACKED_OUT ; $d1
const TEXT_REPEL_WORE_OFF ; $d2
const TEXT_SAFARI_GAME_OVER ; $d3
+ const TEXT_PIKACHU_ANIM ; $d4
TEXT_START_MENU EQU $00
diff --git a/constants/tileset_constants.asm b/constants/tileset_constants.asm
index 446df021..a07f9eb9 100644
--- a/constants/tileset_constants.asm
+++ b/constants/tileset_constants.asm
@@ -25,4 +25,5 @@
const CLUB ; 21
const FACILITY ; 22
const PLATEAU ; 23
+ const BEACH_HOUSE ; 24
NUM_TILESETS EQU const_value
diff --git a/data/battle_anims/special_effects.asm b/data/battle_anims/special_effects.asm
index 98385d47..dd73ff8d 100644
--- a/data/battle_anims/special_effects.asm
+++ b/data/battle_anims/special_effects.asm
@@ -18,7 +18,7 @@ AnimationIdSpecialEffects:
anim_special_effect THUNDERBOLT, FlashScreenEveryEightFrameBlocks
anim_special_effect REFLECT, AnimationFlashScreen
anim_special_effect SELFDESTRUCT, DoExplodeSpecialEffects
- anim_special_effect SPORE, AnimationFlashScreen
+ anim_special_effect SPORE, FlashScreenEveryFourFrameBlocks
anim_special_effect EXPLOSION, DoExplodeSpecialEffects
anim_special_effect ROCK_SLIDE, DoRockSlideSpecialEffects
anim_special_effect TRADE_BALL_DROP_ANIM, TradeHidePokemon
diff --git a/data/cgb/bg_map_attributes.asm b/data/cgb/bg_map_attributes.asm
new file mode 100644
index 00000000..81535e72
--- /dev/null
+++ b/data/cgb/bg_map_attributes.asm
@@ -0,0 +1,506 @@
+BGMapAttributes_Unknown1:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_Unknown2:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_GameFreakIntro:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$01,$01,$01,$02,$02,$00,$00,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$01,$01,$01,$02,$02,$00,$00,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$01,$01,$01,$02,$02,$00,$00,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_TrainerCard:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$00,$00,$03,$03,$00,$00,$00,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$01,$01,$00,$00,$03,$03,$00,$01,$01,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$02,$02,$00,$00,$03,$03,$00,$00,$02,$02,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$02,$02,$00,$00,$03,$03,$00,$00,$02,$02,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_PartyMenu:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_NidorinoIntro:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_TitleScreen:
+ db $23
+ dw $024d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+; vBGMap1
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_Slots:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_Pokedex:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_StatusScreen:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_Battle:
+ db $23
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_WholeScreen:
+ db $3f
+ dw $000d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+
+BGMapAttributes_Unknown13:
+ db $23
+ dw $024d
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+; vBGMap1
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
+ db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
diff --git a/data/credits/credits_mons.asm b/data/credits/credits_mons.asm
index 5af4a309..4e2711be 100644
--- a/data/credits/credits_mons.asm
+++ b/data/credits/credits_mons.asm
@@ -15,3 +15,7 @@ CreditsMons:
db VILEPLUME
db NIDOKING
db PARASECT
+
+REPT 9
+ db GENGAR
+ENDR
diff --git a/data/credits/credits_order.asm b/data/credits/credits_order.asm
index f8454e91..c2b5e523 100644
--- a/data/credits/credits_order.asm
+++ b/data/credits/credits_order.asm
@@ -2,39 +2,36 @@ CreditsOrder:
; subsequent credits elements will be displayed on separate lines.
; CRED_TEXT, CRED_TEXT_FADE, CRED_TEXT_MON, and CRED_TEXT_FADE_MON are
; commands that are used to go to the next set of credits texts.
- db CRED_MON, CRED_VERSION, CRED_TEXT_FADE_MON
+ db CRED_POKEMON, CRED_VERSION, CRED_TEXT_FADE_MON
db CRED_DIRECTOR, CRED_TAJIRI, CRED_TEXT_FADE_MON
- db CRED_PROGRAMMERS, CRED_TA_OOTA, CRED_MORIMOTO, CRED_TEXT_FADE
- db CRED_PROGRAMMERS, CRED_WATANABE, CRED_MASUDE, CRED_TAMADA, CRED_TEXT_MON
- db CRED_CHAR_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, CRED_TEXT_FADE_MON
- db CRED_MUSIC, CRED_MASUDE, CRED_TEXT_FADE
- db CRED_SOUND_EFFECTS, CRED_MASUDE, CRED_TEXT_MON
- db CRED_GAME_DESIGN, CRED_TAJIRI, CRED_TEXT_FADE_MON
- db CRED_MONSTER_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, CRED_FUZIWARA, CRED_TEXT_FADE
- db CRED_MONSTER_DESIGN, CRED_MORIMOTO, CRED_SA_OOTA, CRED_YOSHIKAWA, CRED_TEXT_MON
- db CRED_GAME_SCENE, CRED_TAJIRI, CRED_TEXT_FADE
- db CRED_GAME_SCENE, CRED_TANIGUCHI, CRED_NONOMURA, CRED_ZINNAI, CRED_TEXT_MON
- db CRED_PARAM, CRED_NISINO, CRED_TA_NAKAMURA, CRED_TEXT_FADE_MON
- db CRED_MAP, CRED_TAJIRI, CRED_NISINO, CRED_TEXT_FADE
- db CRED_MAP, CRED_MATSUSIMA, CRED_NONOMURA, CRED_TANIGUCHI, CRED_TEXT_MON
- db CRED_TEST, CRED_KAKEI, CRED_TSUCHIYA, CRED_TEXT_FADE
- db CRED_TEST, CRED_TA_NAKAMURA, CRED_YUDA, CRED_TEXT_MON
- db CRED_SPECIAL, CRED_HISHIDA, CRED_SAKAI, CRED_TEXT_FADE
- db CRED_SPECIAL, CRED_YAMAGUCHI, CRED_YAMAMOTO, CRED_TEXT
- db CRED_SPECIAL, CRED_TOMISAWA, CRED_KAWAMOTO, CRED_TO_OOTA, CRED_TEXT_MON
- db CRED_PRODUCERS, CRED_MIYAMOTO, CRED_TEXT_FADE
- db CRED_PRODUCERS, CRED_KAWAGUCHI, CRED_TEXT
- db CRED_PRODUCERS, CRED_ISHIHARA, CRED_TEXT_MON
- db CRED_US_STAFF, CRED_TEXT_FADE
- db CRED_US_COORD, CRED_TILDEN, CRED_TEXT_FADE
- db CRED_US_COORD, CRED_KAWAKAMI, CRED_HI_NAKAMURA, CRED_TEXT
- db CRED_US_COORD, CRED_GIESE, CRED_OSBORNE, CRED_TEXT
- db CRED_TRANS, CRED_OGASAWARA, CRED_TEXT_FADE
- db CRED_PROGRAMMERS, CRED_MURAKAWA, CRED_FUKUI, CRED_TEXT_FADE
- db CRED_SPECIAL, CRED_IWATA, CRED_TEXT_FADE
- db CRED_SPECIAL, CRED_HARADA, CRED_TEXT
- db CRED_TEST, CRED_PAAD, CRED_CLUB, CRED_TEXT_FADE
+ db CRED_PROGRAMMERS, CRED_OOTA, CRED_MORIMOTO, CRED_WATANABE, CRED_TEXT_FADE
+ db CRED_PROGRAMMERS, CRED_MASUDA, CRED_TAMADA, CRED_TEXT_MON
+ db CRED_CHARACTER_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, CRED_TEXT_FADE_MON
+ db CRED_MUSIC, CRED_MASUDA, CRED_TEXT_FADE
+ db CRED_SOUND_EFFECTS, CRED_MASUDA, CRED_WATANABE, CRED_TEXT_MON
+ db CRED_GAME_DESIGN, CRED_TAJIRI, CRED_NISHINO, CRED_TEXT_FADE_MON
+ db CRED_MONSTER_DESIGN, CRED_SUGIMORI, CRED_NISHIDA, CRED_YOSHIDA, CRED_TEXT_FADE_MON
+ db CRED_GAME_SCENARIO, CRED_TAJIRI, CRED_TEXT_FADE
+ db CRED_GAME_SCENARIO, CRED_MATSUMITA, CRED_TEXT_MON
+ db CRED_PARAMETRIC_DESIGN, CRED_NISHINO, CRED_TEXT_FADE_MON
+ db CRED_MAP_DESIGN, CRED_TAJIRI, CRED_NISHINO, CRED_SEYA, CRED_TEXT_FADE_MON
+ db CRED_TESTING, CRED_SEKINE, CRED_SEYA, CRED_TEXT_FADE
+ db CRED_TESTING, CRED_SHIMAMURA, CRED_SHIMOYAMADA, CRED_TEXT_MON
+ db CRED_SPECIAL_THANKS, CRED_SHOGAKUKAN, CRED_TEXT_FADE_MON
+ db CRED_PIKACHU_VOICE, CRED_OOTANI, CRED_TEXT_FADE_MON
db CRED_PRODUCER, CRED_IZUSHI, CRED_TEXT_FADE
- db CRED_EXECUTIVE, CRED_YAMAUCHI, CRED_TEXT_FADE_MON
+ db CRED_PRODUCER, CRED_KAWAGUCHI, CRED_TEXT
+ db CRED_PRODUCER, CRED_ISHIHARA, CRED_TEXT_MON
+ db CRED_U_S_STAFF, CRED_TEXT_FADE
+ db CRED_U_S_COORD, CRED_TILDEN, CRED_TEXT_FADE
+ db CRED_U_S_COORD, CRED_KAWAKAMI, CRED_NAKAMURA2, CRED_TEXT
+ db CRED_U_S_COORD, CRED_SHOEMAKE, CRED_OSBORNE, CRED_TEXT
+ db CRED_TRANSLATION, CRED_OGASAWARA, CRED_TEXT_FADE
+ db CRED_PROGRAMMERS, CRED_MURAKAWA, CRED_FUKUI, CRED_TEXT_FADE
+ db CRED_CHARACTER_DESIGN, CRED_HOSOKAWA, CRED_TEXT_FADE
+ db CRED_SPECIAL_THANKS, CRED_OKUBO, CRED_HARADA2, CRED_TEXT_FADE
+ db CRED_SPECIAL_THANKS, CRED_NAKAMICHI, CRED_YOSHIMURA, CRED_YAMAZAKI, CRED_TEXT
+ db CRED_TESTING, CRED_PAAD, CRED_SUPER_MARIO_CLUB2, CRED_TEXT_FADE
+ db CRED_EXECUTIVE_PRODUCER, CRED_YAMAUCHI, CRED_TEXT_FADE_MON
db CRED_COPYRIGHT, CRED_TEXT_FADE_MON
db CRED_THE_END
diff --git a/data/credits/credits_text.asm b/data/credits/credits_text.asm
index 220f8a37..0dcc1d5a 100644
--- a/data/credits/credits_text.asm
+++ b/data/credits/credits_text.asm
@@ -1,202 +1,267 @@
CreditsTextPointers:
; entries correspond to CRED_* constants
table_width 2, CreditsTextPointers
- dw CredVersion
- dw CredTajiri
- dw CredTaOota
- dw CredMorimoto
- dw CredWatanabe
- dw CredMasuda
- dw CredNisino
- dw CredSugimori
- dw CredNishida
- dw CredMiyamoto
- dw CredKawaguchi
- dw CredIshihara
- dw CredYamauchi
- dw CredZinnai
- dw CredHishida
- dw CredSakai
- dw CredYamaguchi
- dw CredYamamoto
- dw CredTaniguchi
- dw CredNonomura
- dw CredFuziwara
- dw CredMatsusima
- dw CredTomisawa
- dw CredKawamoto
- dw CredKakei
- dw CredTsuchiya
- dw CredTaNakamura
- dw CredYuda
- dw CredMon
- dw CredDirector
- dw CredProgrammers
- dw CredCharDesign
- dw CredMusic
- dw CredSoundEffects
- dw CredGameDesign
- dw CredMonsterDesign
- dw CredGameScene
- dw CredParam
- dw CredMap
- dw CredTest
- dw CredSpecial
- dw CredProducers
- dw CredProducer
- dw CredExecutive
- dw CredTamada
- dw CredSaOota
- dw CredYoshikawa
- dw CredToOota
- dw CredUSStaff
- dw CredUSCoord
- dw CredTilden
- dw CredKawakami
- dw CredHiNakamura
- dw CredGiese
- dw CredOsborne
- dw CredTrans
- dw CredOgasawara
- dw CredIwata
- dw CredIzushi
- dw CredHarada
- dw CredMurakawa
- dw CredFukui
- dw CredClub
- dw CredPAAD
+ dw CreditsText_Version
+ dw CreditsText_Tajiri
+ dw CreditsText_Oota
+ dw CreditsText_Morimoto
+ dw CreditsText_Watanabe
+ dw CreditsText_Masuda
+ dw CreditsText_Nishino
+ dw CreditsText_Sugimori
+ dw CreditsText_Nishida
+ dw CreditsText_Miyamoto
+ dw CreditsText_Kawaguchi
+ dw CreditsText_Ishihara
+ dw CreditsText_Yamauchi
+ dw CreditsText_Zinnai
+ dw CreditsText_Hishida
+ dw CreditsText_Sakai
+ dw CreditsText_Yamaguchi
+ dw CreditsText_Yamamoto
+ dw CreditsText_Taniguchi
+ dw CreditsText_Nonomura
+ dw CreditsText_Fuziwara
+ dw CreditsText_Matsusima
+ dw CreditsText_Tomisawa
+ dw CreditsText_Kawamoto
+ dw CreditsText_Kakei
+ dw CreditsText_Tsuchiya
+ dw CreditsText_Nakamura
+ dw CreditsText_Yuda
+ dw CreditsText_Pokemon
+ dw CreditsText_Director
+ dw CreditsText_Programmers
+ dw CreditsText_CharacterDesign
+ dw CreditsText_Music
+ dw CreditsText_SoundEffects
+ dw CreditsText_GameDesign
+ dw CreditsText_MonsterDesign
+ dw CreditsText_GameScenario
+ dw CreditsText_ParametricDesign
+ dw CreditsText_MapDesign
+ dw CreditsText_Testing
+ dw CreditsText_SpecialThanks
+ dw CreditsText_Producer
+ dw CreditsText_ExecutiveProducer
+ dw CreditsText_Tamada
+ dw CreditsText_Oota2
+ dw CreditsText_Yoshikawa
+ dw CreditsText_Oota23
+ dw CreditsText_Yoshida
+ dw CreditsText_Matsumita
+ dw CreditsText_Seya
+ dw CreditsText_Sekine
+ dw CreditsText_Shimamura
+ dw CreditsText_Shimoyamada
+ dw CreditsText_SuperMarioClub
+ dw CreditsText_Izushi
+ dw CreditsText_Nomura
+ dw CreditsText_Harada
+ dw CreditsText_Yamagami
+ dw CreditsText_Nishimura
+ dw CreditsText_Saeki
+ dw CreditsText_Fuzii
+ dw CreditsText_Shogakukan
+ dw CreditsText_Ootani
+ dw CreditsText_PikachuVoice
+ dw CreditsText_USStaff
+ dw CreditsText_USCoord
+ dw CreditsText_Tilden
+ dw CreditsText_Kawakami
+ dw CreditsText_Nakamura2
+ dw CreditsText_Shoemake
+ dw CreditsText_Osborne
+ dw CreditsText_Translation
+ dw CreditsText_Ogasawara
+ dw CreditsText_Iwata
+ dw CreditsText_Izushi2
+ dw CreditsText_Harada2
+ dw CreditsText_Murakawa
+ dw CreditsText_Fukui
+ dw CreditsText_SuperMarioClub2
+ dw CreditsText_Paad
+ dw CreditsText_Producers
+ dw CreditsText_Hosokawa
+ dw CreditsText_Okubo
+ dw CreditsText_Nakamichi
+ dw CreditsText_Yoshimura
+ dw CreditsText_Yamazaki
assert_table_length NUM_CRED_STRINGS
-CredVersion: ; this 1 byte difference makes all bank addresses offset by 1 in the blue version
-IF DEF(_RED)
- db -8, "RED VERSION STAFF@"
-ENDC
-IF DEF(_BLUE)
- db -8, "BLUE VERSION STAFF@"
-ENDC
-CredTajiri:
+CreditsText_Version:
+ db -6, "YELLOW VERSION"
+ next " STAFF@"
+CreditsText_Tajiri:
db -6, "SATOSHI TAJIRI@"
-CredTaOota:
+CreditsText_Oota:
db -6, "TAKENORI OOTA@"
-CredMorimoto:
+CreditsText_Morimoto:
db -7, "SHIGEKI MORIMOTO@"
-CredWatanabe:
+CreditsText_Watanabe:
db -7, "TETSUYA WATANABE@"
-CredMasuda:
+CreditsText_Masuda:
db -6, "JUNICHI MASUDA@"
-CredNisino:
- db -5, "KOHJI NISINO@"
-CredSugimori:
+CreditsText_Nishino:
+ db -5, "KOHJI NISHINO@"
+CreditsText_Sugimori:
db -5, "KEN SUGIMORI@"
-CredNishida:
+CreditsText_Nishida:
db -6, "ATSUKO NISHIDA@"
-CredMiyamoto:
+CreditsText_Miyamoto:
db -7, "SHIGERU MIYAMOTO@"
-CredKawaguchi:
+CreditsText_Kawaguchi:
db -8, "TAKASHI KAWAGUCHI@"
-CredIshihara:
+CreditsText_Ishihara:
db -8, "TSUNEKAZU ISHIHARA@"
-CredYamauchi:
+CreditsText_Yamauchi:
db -7, "HIROSHI YAMAUCHI@"
-CredZinnai:
+CreditsText_Zinnai:
db -7, "HIROYUKI ZINNAI@"
-CredHishida:
+CreditsText_Hishida:
db -7, "TATSUYA HISHIDA@"
-CredSakai:
+CreditsText_Sakai:
db -6, "YASUHIRO SAKAI@"
-CredYamaguchi:
+CreditsText_Yamaguchi:
db -7, "WATARU YAMAGUCHI@"
-CredYamamoto:
+CreditsText_Yamamoto:
db -8, "KAZUYUKI YAMAMOTO@"
-CredTaniguchi:
+CreditsText_Taniguchi:
db -8, "RYOHSUKE TANIGUCHI@"
-CredNonomura:
+CreditsText_Nonomura:
db -8, "FUMIHIRO NONOMURA@"
-CredFuziwara:
+CreditsText_Fuziwara:
db -7, "MOTOFUMI FUZIWARA@"
-CredMatsusima:
+CreditsText_Matsusima:
db -7, "KENJI MATSUSIMA@"
-CredTomisawa:
+CreditsText_Tomisawa:
db -7, "AKIHITO TOMISAWA@"
-CredKawamoto:
+CreditsText_Kawamoto:
db -7, "HIROSHI KAWAMOTO@"
-CredKakei:
+CreditsText_Kakei:
db -6, "AKIYOSHI KAKEI@"
-CredTsuchiya:
+CreditsText_Tsuchiya:
db -7, "KAZUKI TSUCHIYA@"
-CredTaNakamura:
+CreditsText_Nakamura:
db -6, "TAKEO NAKAMURA@"
-CredYuda:
+CreditsText_Yuda:
db -6, "MASAMITSU YUDA@"
-CredMon:
+CreditsText_Pokemon:
db -3, "#MON@"
-CredDirector:
+CreditsText_Director:
db -3, "DIRECTOR@"
-CredProgrammers:
+CreditsText_Programmers:
db -5, "PROGRAMMERS@"
-CredCharDesign:
+CreditsText_CharacterDesign:
db -7, "CHARACTER DESIGN@"
-CredMusic:
+CreditsText_Music:
db -2, "MUSIC@"
-CredSoundEffects:
+CreditsText_SoundEffects:
db -6, "SOUND EFFECTS@"
-CredGameDesign:
+CreditsText_GameDesign:
db -5, "GAME DESIGN@"
-CredMonsterDesign:
+CreditsText_MonsterDesign:
db -6, "MONSTER DESIGN@"
-CredGameScene:
+CreditsText_GameScenario:
db -6, "GAME SCENARIO@"
-CredParam:
- db -8, "PARAMETRIC DESIGN@"
-CredMap:
+CreditsText_ParametricDesign:
+ db -7, "PARAMETRIC DESIGN@"
+CreditsText_MapDesign:
db -4, "MAP DESIGN@"
-CredTest:
- db -7, "PRODUCT TESTING@"
-CredSpecial:
+CreditsText_Testing:
+ db -6, "PRODUCT TESTING@"
+CreditsText_SpecialThanks:
db -6, "SPECIAL THANKS@"
-CredProducers:
+CreditsText_Producers:
db -4, "PRODUCERS@"
-CredProducer:
- db -4, "PRODUCER@"
-CredExecutive:
+CreditsText_Producer:
+ db -3, "PRODUCER@"
+CreditsText_ExecutiveProducer:
db -8, "EXECUTIVE PRODUCER@"
-CredTamada:
+CreditsText_Tamada:
db -6, "SOUSUKE TAMADA@"
-CredSaOota:
+CreditsText_Oota2:
db -5, "SATOSHI OOTA@"
-CredYoshikawa:
+CreditsText_Yoshikawa:
db -6, "RENA YOSHIKAWA@"
-CredToOota:
+CreditsText_Oota23:
db -6, "TOMOMICHI OOTA@"
-CredUSStaff:
+CreditsText_Matsumita:
+ db -8, "TOSHINOBU MATSUMIYA@"
+CreditsText_Seya:
+ db -5, "NOBUHIRO SEYA@"
+CreditsText_Yoshida:
+ db -7, "HIRONOBU YOSHIDA@"
+CreditsText_Sekine:
+ db -6, "KAZUHITO SEKINE@"
+CreditsText_Shimamura:
+ db -7, "KAZUSHI SHIMAMURA@"
+CreditsText_Shimoyamada:
+ db -9, "TERUYUKI SHIMOYAMADA@"
+CreditsText_SuperMarioClub:
+ db -9, "NCL SUPER MARIO CLUB@"
+CreditsText_Izushi:
+ db -7, "TAKEHIRO IZUSHI@"
+CreditsText_Nomura:
+ db -5, "FUZIKO NOMURA@"
+CreditsText_Harada:
+ db -6, "TAKAHIRO HARADA@"
+CreditsText_Yamagami:
+ db -7, "HITOSHI YAMAGAMI@"
+CreditsText_Nishimura:
+ db -8, "KENTAROU NISHIMURA@"
+CreditsText_Saeki:
+ db -5, "NAOKO SAEKI@"
+CreditsText_Fuzii:
+ db -5, "TAKAYA FUZII@"
+CreditsText_Shogakukan:
+ db -4, "SHOGAKUKAN"
+ next "PRODUCTION@"
+CreditsText_Ootani:
+ db -5, "IKUE OOTANI@"
+CreditsText_PikachuVoice:
+ db -6, "PIKACHU VOICE@"
+
+ db -3, "××××××××@"
+CreditsText_USStaff:
db -7, "US VERSION STAFF@"
-CredUSCoord:
+CreditsText_USCoord:
db -7, "US COORDINATION@"
-CredTilden:
+CreditsText_Tilden:
db -5, "GAIL TILDEN@"
-CredKawakami:
+CreditsText_Kawakami:
db -6, "NAOKO KAWAKAMI@"
-CredHiNakamura:
+CreditsText_Nakamura2:
db -6, "HIRO NAKAMURA@"
-CredGiese:
- db -6, "WILLIAM GIESE@"
-CredOsborne:
+CreditsText_Shoemake:
+ db -6, "RANDY SHOEMAKE@"
+CreditsText_Osborne:
db -5, "SARA OSBORNE@"
-CredTrans:
+CreditsText_Translation:
db -7, "TEXT TRANSLATION@"
-CredOgasawara:
+CreditsText_Ogasawara:
db -6, "NOB OGASAWARA@"
-CredIwata:
+CreditsText_Iwata:
db -5, "SATORU IWATA@"
-CredIzushi:
+CreditsText_Izushi2:
db -7, "TAKEHIRO IZUSHI@"
-CredHarada:
+CreditsText_Harada2:
db -7, "TAKAHIRO HARADA@"
-CredMurakawa:
+CreditsText_Murakawa:
db -7, "TERUKI MURAKAWA@"
-CredFukui:
+CreditsText_Fukui:
db -5, "KOHTA FUKUI@"
-CredClub:
+CreditsText_SuperMarioClub2:
db -9, "NCL SUPER MARIO CLUB@"
-CredPAAD:
+CreditsText_Paad:
db -5, "PAAD TESTING@"
+CreditsText_Hosokawa:
+ db -8, "TAKEHIKO HOSOKAWA@"
+CreditsText_Okubo:
+ db -5, "KENJI OKUBO@"
+CreditsText_Nakamichi:
+ db -7, "KIMIKO NAKAMICHI@"
+CreditsText_Yoshimura:
+ db -6, "KAMON YOSHIMURA@"
+CreditsText_Yamazaki:
+ db -6, "SAKAE YAMAZAKI@"
diff --git a/data/events/bench_guys.asm b/data/events/bench_guys.asm
index 2e7eeb2a..f597a26d 100644
--- a/data/events/bench_guys.asm
+++ b/data/events/bench_guys.asm
@@ -5,16 +5,19 @@ ENDM
BenchGuyTextPointers:
; map id, player facing direction, predef text
- bench_guy_text VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT, ViridianCityPokecenterBenchGuyText
- bench_guy_text PEWTER_POKECENTER, SPRITE_FACING_LEFT, PewterCityPokecenterBenchGuyText
- bench_guy_text CERULEAN_POKECENTER, SPRITE_FACING_LEFT, CeruleanCityPokecenterBenchGuyText
- bench_guy_text LAVENDER_POKECENTER, SPRITE_FACING_LEFT, LavenderCityPokecenterBenchGuyText
- bench_guy_text VERMILION_POKECENTER, SPRITE_FACING_LEFT, VermilionCityPokecenterBenchGuyText
- bench_guy_text CELADON_POKECENTER, SPRITE_FACING_LEFT, CeladonCityPokecenterBenchGuyText
- bench_guy_text CELADON_HOTEL, SPRITE_FACING_LEFT, CeladonCityHotelText
- bench_guy_text FUCHSIA_POKECENTER, SPRITE_FACING_LEFT, FuchsiaCityPokecenterBenchGuyText
- bench_guy_text CINNABAR_POKECENTER, SPRITE_FACING_LEFT, CinnabarIslandPokecenterBenchGuyText
- bench_guy_text SAFFRON_POKECENTER, SPRITE_FACING_LEFT, SaffronCityPokecenterBenchGuyText
- bench_guy_text MT_MOON_POKECENTER, SPRITE_FACING_LEFT, MtMoonPokecenterBenchGuyText
- bench_guy_text ROCK_TUNNEL_POKECENTER, SPRITE_FACING_LEFT, RockTunnelPokecenterBenchGuyText
+ bench_guy_text VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT, ViridianCityPokecenterBenchGuyText
+ bench_guy_text PEWTER_POKECENTER, SPRITE_FACING_LEFT, PewterCityPokecenterBenchGuyText
+ bench_guy_text CERULEAN_POKECENTER, SPRITE_FACING_LEFT, CeruleanCityPokecenterBenchGuyText
+ bench_guy_text LAVENDER_POKECENTER, SPRITE_FACING_LEFT, LavenderCityPokecenterBenchGuyText
+ bench_guy_text VERMILION_POKECENTER, SPRITE_FACING_LEFT, VermilionCityPokecenterBenchGuyText
+ bench_guy_text CELADON_POKECENTER, SPRITE_FACING_LEFT, CeladonCityPokecenterBenchGuyText
+ bench_guy_text CELADON_HOTEL, SPRITE_FACING_LEFT, CeladonCityHotelText
+ bench_guy_text FUCHSIA_POKECENTER, SPRITE_FACING_LEFT, FuchsiaCityPokecenterBenchGuyText
+ bench_guy_text CINNABAR_POKECENTER, SPRITE_FACING_LEFT, CinnabarIslandPokecenterBenchGuyText
+ bench_guy_text SAFFRON_POKECENTER, SPRITE_FACING_LEFT, SaffronCityPokecenterBenchGuyText
+ bench_guy_text MT_MOON_POKECENTER, SPRITE_FACING_LEFT, MtMoonPokecenterBenchGuyText
+ bench_guy_text ROCK_TUNNEL_POKECENTER, SPRITE_FACING_LEFT, RockTunnelPokecenterBenchGuyText
+ bench_guy_text SAFARI_ZONE_WEST_REST_HOUSE, SPRITE_FACING_LEFT, UnusedBenchGuyText1
+ bench_guy_text SAFARI_ZONE_EAST_REST_HOUSE, SPRITE_FACING_LEFT, UnusedBenchGuyText2
+ bench_guy_text SAFARI_ZONE_NORTH_REST_HOUSE, SPRITE_FACING_LEFT, UnusedBenchGuyText3
db -1 ; end
diff --git a/data/events/hidden_item_coords.asm b/data/events/hidden_item_coords.asm
index 115f53aa..5705feed 100644
--- a/data/events/hidden_item_coords.asm
+++ b/data/events/hidden_item_coords.asm
@@ -4,58 +4,59 @@ ENDM
HiddenItemCoords:
; map id, x, y
+ hidden_item SILPH_CO_5F, 12, 3
+ hidden_item SILPH_CO_9F, 2, 15
+ hidden_item POKEMON_MANSION_3F, 1, 9
+ hidden_item POKEMON_MANSION_B1F, 1, 9
+ hidden_item SAFARI_ZONE_WEST, 6, 5
+ hidden_item CERULEAN_CAVE_2F, 16, 13
+ hidden_item CERULEAN_CAVE_B1F, 8, 14
+ hidden_item UNUSED_MAP_6F, 14, 11
+ hidden_item SEAFOAM_ISLANDS_B2F, 15, 15
+ hidden_item SEAFOAM_ISLANDS_B3F, 9, 16
+ hidden_item SEAFOAM_ISLANDS_B4F, 25, 17
hidden_item VIRIDIAN_FOREST, 1, 18
hidden_item VIRIDIAN_FOREST, 16, 42
hidden_item MT_MOON_B2F, 18, 12
- hidden_item ROUTE_25, 38, 3
- hidden_item ROUTE_9, 14, 7
- hidden_item SS_ANNE_KITCHEN, 13, 9
+ hidden_item MT_MOON_B2F, 33, 9
hidden_item SS_ANNE_B1F_ROOMS, 3, 1
- hidden_item ROUTE_10, 9, 17
- hidden_item ROUTE_10, 16, 53
+ hidden_item SS_ANNE_KITCHEN, 13, 9
+ hidden_item UNDERGROUND_PATH_NORTH_SOUTH, 3, 4
+ hidden_item UNDERGROUND_PATH_NORTH_SOUTH, 4, 34
+ hidden_item UNDERGROUND_PATH_WEST_EAST, 12, 2
+ hidden_item UNDERGROUND_PATH_WEST_EAST, 21, 5
hidden_item ROCKET_HIDEOUT_B1F, 21, 15
hidden_item ROCKET_HIDEOUT_B3F, 27, 17
hidden_item ROCKET_HIDEOUT_B4F, 25, 1
- hidden_item POKEMON_TOWER_5F, 4, 12
- hidden_item ROUTE_13, 1, 14
- hidden_item ROUTE_13, 16, 13
- hidden_item POKEMON_MANSION_B1F, 1, 9
- hidden_item SAFARI_ZONE_GATE, 10, 1 ; inaccessible
- hidden_item SAFARI_ZONE_WEST, 6, 5
- hidden_item SILPH_CO_5F, 12, 3
- hidden_item SILPH_CO_9F, 2, 15
- hidden_item COPYCATS_HOUSE_2F, 1, 1
- hidden_item CERULEAN_CAVE_1F, 14, 11
- hidden_item CERULEAN_CAVE_B1F, 27, 3
+ hidden_item ROUTE_10, 9, 17
+ hidden_item ROUTE_10, 16, 53
hidden_item POWER_PLANT, 17, 16
hidden_item POWER_PLANT, 12, 1
- hidden_item SEAFOAM_ISLANDS_B2F, 15, 15
- hidden_item SEAFOAM_ISLANDS_B4F, 25, 17
- hidden_item POKEMON_MANSION_1F, 8, 16
- hidden_item POKEMON_MANSION_3F, 1, 9
- hidden_item ROUTE_23, 9, 44
- hidden_item ROUTE_23, 19, 70
- hidden_item ROUTE_23, 8, 90
- hidden_item VICTORY_ROAD_2F, 5, 2
- hidden_item VICTORY_ROAD_2F, 26, 7
- hidden_item UNUSED_MAP_6F, 14, 11
- hidden_item VIRIDIAN_CITY, 14, 4
hidden_item ROUTE_11, 48, 5
hidden_item ROUTE_12, 2, 63
+ hidden_item ROUTE_13, 1, 14
+ hidden_item ROUTE_13, 16, 13
hidden_item ROUTE_17, 15, 14
hidden_item ROUTE_17, 8, 45
hidden_item ROUTE_17, 17, 72
hidden_item ROUTE_17, 4, 91
hidden_item ROUTE_17, 8, 121
- hidden_item UNDERGROUND_PATH_NORTH_SOUTH, 3, 4
- hidden_item UNDERGROUND_PATH_NORTH_SOUTH, 4, 34
- hidden_item UNDERGROUND_PATH_WEST_EAST, 12, 2
- hidden_item UNDERGROUND_PATH_WEST_EAST, 21, 5
- hidden_item CELADON_CITY, 48, 15
+ hidden_item ROUTE_23, 9, 44
+ hidden_item ROUTE_23, 19, 70
+ hidden_item ROUTE_23, 8, 90
+ hidden_item VICTORY_ROAD_2F, 5, 2
+ hidden_item VICTORY_ROAD_2F, 26, 7
+ hidden_item ROUTE_25, 38, 3
hidden_item ROUTE_25, 10, 1
- hidden_item MT_MOON_B2F, 33, 9
- hidden_item SEAFOAM_ISLANDS_B3F, 9, 16
- hidden_item VERMILION_CITY, 14, 11
- hidden_item CERULEAN_CITY, 15, 8
hidden_item ROUTE_4, 40, 3
+ hidden_item ROUTE_9, 14, 7
+ hidden_item COPYCATS_HOUSE_2F, 1, 1
+ hidden_item VIRIDIAN_CITY, 14, 4
+ hidden_item CERULEAN_CITY, 15, 8
+ hidden_item CERULEAN_CAVE_1F, 18, 7
+ hidden_item POKEMON_TOWER_5F, 4, 12
+ hidden_item VERMILION_CITY, 14, 11
+ hidden_item CELADON_CITY, 48, 15
+ hidden_item SAFARI_ZONE_GATE, 10, 1 ; inaccessible
+ hidden_item POKEMON_MANSION_1F, 8, 16
db -1 ; end
diff --git a/data/events/hidden_objects.asm b/data/events/hidden_objects.asm
index efb99026..2afd1275 100644
--- a/data/events/hidden_objects.asm
+++ b/data/events/hidden_objects.asm
@@ -1,178 +1,86 @@
HiddenObjectMaps:
- db REDS_HOUSE_2F
- db BLUES_HOUSE
- db OAKS_LAB
- db VIRIDIAN_POKECENTER
- db VIRIDIAN_MART
- db VIRIDIAN_SCHOOL_HOUSE
- db VIRIDIAN_GYM
- db MUSEUM_1F
- db PEWTER_GYM
- db PEWTER_MART
- db PEWTER_POKECENTER
- db CERULEAN_POKECENTER
- db CERULEAN_GYM
- db CERULEAN_MART
- db LAVENDER_POKECENTER
- db VERMILION_POKECENTER
- db VERMILION_GYM
- db CELADON_MANSION_2F
- db CELADON_POKECENTER
- db CELADON_GYM
- db GAME_CORNER
- db CELADON_HOTEL
- db FUCHSIA_POKECENTER
- db FUCHSIA_GYM
- db CINNABAR_GYM
- db CINNABAR_POKECENTER
- db SAFFRON_GYM
- db MT_MOON_POKECENTER
- db ROCK_TUNNEL_POKECENTER
- db TRADE_CENTER
- db COLOSSEUM
- db VIRIDIAN_FOREST
- db MT_MOON_B2F
- db INDIGO_PLATEAU
- db ROUTE_25
- db ROUTE_9
- db SS_ANNE_KITCHEN
- db SS_ANNE_B1F_ROOMS
- db ROCKET_HIDEOUT_B1F
- db ROCKET_HIDEOUT_B3F
- db ROCKET_HIDEOUT_B4F
- db SAFFRON_POKECENTER
- db POKEMON_TOWER_5F
- db ROUTE_13
- db SAFARI_ZONE_GATE
- db SAFARI_ZONE_WEST
- db SILPH_CO_5F
- db SILPH_CO_9F
- db COPYCATS_HOUSE_2F
- db CERULEAN_CAVE_1F
- db CERULEAN_CAVE_B1F
- db POWER_PLANT
- db SEAFOAM_ISLANDS_B2F
- db SEAFOAM_ISLANDS_B4F
- db POKEMON_MANSION_1F
- db POKEMON_MANSION_3F
- db ROUTE_23
- db VICTORY_ROAD_2F
- db UNUSED_MAP_6F
- db BILLS_HOUSE
- db VIRIDIAN_CITY
- db SAFARI_ZONE_WEST_REST_HOUSE
- db SAFARI_ZONE_EAST_REST_HOUSE
- db SAFARI_ZONE_NORTH_REST_HOUSE
- db ROUTE_15_GATE_2F
- db MR_FUJIS_HOUSE
- db CELADON_MANSION_ROOF_HOUSE
- db FIGHTING_DOJO
- db ROUTE_10
- db INDIGO_PLATEAU_LOBBY
- db CINNABAR_LAB_FOSSIL_ROOM
- db BIKE_SHOP
- db ROUTE_11
- db ROUTE_12
- db POKEMON_MANSION_2F
- db POKEMON_MANSION_B1F
- db SILPH_CO_11F
- db ROUTE_17
- db UNDERGROUND_PATH_NORTH_SOUTH
- db UNDERGROUND_PATH_WEST_EAST
- db CELADON_CITY
- db SEAFOAM_ISLANDS_B3F
- db VERMILION_CITY
- db CERULEAN_CITY
- db ROUTE_4
- db -1 ; end
-
-HiddenObjectPointers:
-; each of these pointers is for the corresponding map in HiddenObjectMaps
- dw RedsHouse2FHiddenObjects
- dw BluesHouseHiddenObjects
- dw OaksLabHiddenObjects
- dw ViridianPokecenterHiddenObjects
- dw ViridianMartHiddenObjects
- dw ViridianSchoolHiddenObjects
- dw ViridianGymHiddenObjects
- dw Museum1FHiddenObjects
- dw PewterGymHiddenObjects
- dw PewterMartHiddenObjects
- dw PewterPokecenterHiddenObjects
- dw CeruleanPokecenterHiddenObjects
- dw CeruleanGymHiddenObjects
- dw CeruleanMartHiddenObjects
- dw LavenderPokecenterHiddenObjects
- dw VermilionPokecenterHiddenObjects
- dw VermilionGymHiddenObjects
- dw CeladonMansion2HiddenObjects
- dw CeladonPokecenterHiddenObjects
- dw CeladonGymHiddenObjects
- dw GameCornerHiddenObjects
- dw CeladonHotelHiddenObjects
- dw FuchsiaPokecenterHiddenObjects
- dw FuchsiaGymHiddenObjects
- dw CinnabarGymHiddenObjects
- dw CinnabarPokecenterHiddenObjects
- dw SaffronGymHiddenObjects
- dw MtMoonPokecenterHiddenObjects
- dw RockTunnelPokecenterHiddenObjects
- dw TradeCenterHiddenObjects
- dw ColosseumHiddenObjects
- dw ViridianForestHiddenObjects
- dw MtMoon3HiddenObjects
- dw IndigoPlateauHiddenObjects
- dw Route25HiddenObjects
- dw Route9HiddenObjects
- dw SSAnne6HiddenObjects
- dw SSAnne10HiddenObjects
- dw RocketHideout1HiddenObjects
- dw RocketHideout3HiddenObjects
- dw RocketHideout4HiddenObjects
- dw SaffronPokecenterHiddenObjects
- dw PokemonTower5HiddenObjects
- dw Route13HiddenObjects
- dw SafariZoneEntranceHiddenObjects
- dw SafariZoneWestHiddenObjects
- dw SilphCo5FHiddenObjects
- dw SilphCo9FHiddenObjects
- dw CopycatsHouse2FHiddenObjects
- dw CeruleanCave1HiddenObjects
- dw CeruleanCave3HiddenObjects
- dw PowerPlantHiddenObjects
- dw SeafoamIslands3HiddenObjects
- dw SeafoamIslands5HiddenObjects
- dw Mansion1HiddenObjects
- dw Mansion3HiddenObjects
- dw Route23HiddenObjects
- dw VictoryRoad2HiddenObjects
- dw Unused6FHiddenObjects
- dw BillsHouseHiddenObjects
- dw ViridianCityHiddenObjects
- dw SafariZoneRestHouse2HiddenObjects
- dw SafariZoneRestHouse3HiddenObjects
- dw SafariZoneRestHouse4HiddenObjects
- dw Route15GateUpstairsHiddenObjects
- dw LavenderHouse1HiddenObjects
- dw CeladonMansion5HiddenObjects
- dw FightingDojoHiddenObjects
- dw Route10HiddenObjects
- dw IndigoPlateauLobbyHiddenObjects
- dw CinnabarLab4HiddenObjects
- dw BikeShopHiddenObjects
- dw Route11HiddenObjects
- dw Route12HiddenObjects
- dw Mansion2HiddenObjects
- dw Mansion4HiddenObjects
- dw SilphCo11FHiddenObjects
- dw Route17HiddenObjects
- dw UndergroundPathNsHiddenObjects
- dw UndergroundPathWeHiddenObjects
- dw CeladonCityHiddenObjects
- dw SeafoamIslands4HiddenObjects
- dw VermilionCityHiddenObjects
- dw CeruleanCityHiddenObjects
- dw Route4HiddenObjects
+ dbw SILPH_CO_11F, SilphCo11FHiddenObjects
+ dbw SILPH_CO_5F, SilphCo5FHiddenObjects
+ dbw SILPH_CO_9F, SilphCo9FHiddenObjects
+ dbw POKEMON_MANSION_2F, Mansion2HiddenObjects
+ dbw POKEMON_MANSION_3F, Mansion3HiddenObjects
+ dbw POKEMON_MANSION_B1F, Mansion4HiddenObjects
+ dbw SAFARI_ZONE_WEST, SafariZoneWestHiddenObjects
+ dbw CERULEAN_CAVE_2F, CeruleanCave2HiddenObjects
+ dbw CERULEAN_CAVE_B1F, CeruleanCave3HiddenObjects
+ dbw UNUSED_MAP_6F, UnusedMap6FHiddenObjects
+ dbw SEAFOAM_ISLANDS_B2F, SeafoamIslands3HiddenObjects
+ dbw SEAFOAM_ISLANDS_B3F, SeafoamIslands4HiddenObjects
+ dbw SEAFOAM_ISLANDS_B4F, SeafoamIslands5HiddenObjects
+ dbw VIRIDIAN_FOREST, ViridianForestHiddenObjects
+ dbw MT_MOON_B2F, MtMoon3HiddenObjects
+ dbw SS_ANNE_B1F_ROOMS, SSAnne10HiddenObjects
+ dbw SS_ANNE_KITCHEN, SSAnne6HiddenObjects
+ dbw UNDERGROUND_PATH_NORTH_SOUTH, UndergroundPathNsHiddenObjects
+ dbw UNDERGROUND_PATH_WEST_EAST, UndergroundPathWeHiddenObjects
+ dbw ROCKET_HIDEOUT_B1F, RocketHideout1HiddenObjects
+ dbw ROCKET_HIDEOUT_B3F, RocketHideout3HiddenObjects
+ dbw ROCKET_HIDEOUT_B4F, RocketHideout4HiddenObjects
+ dbw ROUTE_10, Route10HiddenObjects
+ dbw ROCK_TUNNEL_POKECENTER, RockTunnelPokecenterHiddenObjects
+ dbw POWER_PLANT, PowerPlantHiddenObjects
+ dbw ROUTE_11, Route11HiddenObjects
+ dbw ROUTE_12, Route12HiddenObjects
+ dbw ROUTE_13, Route13HiddenObjects
+ dbw ROUTE_15_GATE_2F, Route15Gate2FHiddenObjects
+ dbw ROUTE_17, Route17HiddenObjects
+ dbw ROUTE_23, Route23HiddenObjects
+ dbw VICTORY_ROAD_2F, VictoryRoad2HiddenObjects
+ dbw ROUTE_25, Route25HiddenObjects
+ dbw BILLS_HOUSE, BillsHouseHiddenObjects
+ dbw ROUTE_4, Route4HiddenObjects
+ dbw MT_MOON_POKECENTER, MtMoonPokecenterHiddenObjects
+ dbw ROUTE_9, Route9HiddenObjects
+ dbw TRADE_CENTER, TradeCenterHiddenObjects
+ dbw COLOSSEUM, ColosseumHiddenObjects
+ dbw INDIGO_PLATEAU, IndigoPlateauHiddenObjects
+ dbw INDIGO_PLATEAU_LOBBY, IndigoPlateauLobbyHiddenObjects
+ dbw COPYCATS_HOUSE_2F, CopycatsHouse2FHiddenObjects
+ dbw FIGHTING_DOJO, FightingDojoHiddenObjects
+ dbw SAFFRON_GYM, SaffronGymHiddenObjects
+ dbw SAFFRON_POKECENTER, SaffronPokecenterHiddenObjects
+ dbw REDS_HOUSE_2F, RedsHouse2FHiddenObjects
+ dbw BLUES_HOUSE, BluesHouseHiddenObjects
+ dbw OAKS_LAB, OaksLabHiddenObjects
+ dbw VIRIDIAN_CITY, ViridianCityHiddenObjects
+ dbw VIRIDIAN_POKECENTER, ViridianPokecenterHiddenObjects
+ dbw VIRIDIAN_SCHOOL_HOUSE, ViridianSchoolHiddenObjects
+ dbw VIRIDIAN_GYM, ViridianGymHiddenObjects
+ dbw MUSEUM_1F, Museum1FHiddenObjects
+ dbw PEWTER_GYM, PewterGymHiddenObjects
+ dbw PEWTER_POKECENTER, PewterPokecenterHiddenObjects
+ dbw CERULEAN_CITY, CeruleanCityHiddenObjects
+ dbw CERULEAN_POKECENTER, CeruleanPokecenterHiddenObjects
+ dbw CERULEAN_GYM, CeruleanGymHiddenObjects
+ dbw BIKE_SHOP, BikeShopHiddenObjects
+ dbw CERULEAN_CAVE_1F, CeruleanCave1HiddenObjects
+ dbw LAVENDER_POKECENTER, LavenderPokecenterHiddenObjects
+ dbw POKEMON_TOWER_5F, Pokemontower5HiddenObjects
+ dbw MR_FUJIS_HOUSE, LavenderHouse1HiddenObjects
+ dbw VERMILION_CITY, VermilionCityHiddenObjects
+ dbw VERMILION_POKECENTER, VermilionPokecenterHiddenObjects
+ dbw POKEMON_FAN_CLUB, PokemonFanClubHiddenObjects
+ dbw VERMILION_GYM, VermilionGymHiddenObjects
+ dbw CELADON_CITY, CeladonCityHiddenObjects
+ dbw CELADON_HOTEL, CeladonHotelHiddenObjects
+ dbw CELADON_MANSION_2F, CeladonMansion2HiddenObjects
+ dbw CELADON_MANSION_ROOF_HOUSE, CeladonMansion5HiddenObjects
+ dbw CELADON_POKECENTER, CeladonPokecenterHiddenObjects
+ dbw CELADON_GYM, CeladonGymHiddenObjects
+ dbw GAME_CORNER, GameCornerHiddenObjects
+ dbw FUCHSIA_POKECENTER, FuchsiaPokecenterHiddenObjects
+ dbw SAFARI_ZONE_GATE, SafariZoneEntranceHiddenObjects
+ dbw FUCHSIA_GYM, FuchsiaGymHiddenObjects
+ dbw POKEMON_MANSION_1F, Mansion1HiddenObjects
+ dbw CINNABAR_GYM, CinnabarGymHiddenObjects
+ dbw CINNABAR_LAB_FOSSIL_ROOM, CinnabarLab4HiddenObjects
+ dbw CINNABAR_POKECENTER, CinnabarPokecenterHiddenObjects
+ db -1 ; end
hidden_object: MACRO
db \2 ; y coord
@@ -193,6 +101,176 @@ ENDM
; from interacting with them in any direction.
ANY_FACING EQU $d0
+SilphCo11FHiddenObjects:
+ hidden_object 10, 12, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db -1 ; end
+
+SilphCo5FHiddenObjects:
+ hidden_object 12, 3, ELIXER, HiddenItems
+ db -1 ; end
+
+SilphCo9FHiddenObjects:
+ hidden_object 2, 15, MAX_POTION, HiddenItems
+ db -1 ; end
+
+Mansion2HiddenObjects:
+ hidden_object 2, 11, SPRITE_FACING_UP, Mansion2Script_Switches
+ db -1 ; end
+
+Mansion3HiddenObjects:
+ hidden_object 1, 9, MAX_REVIVE, HiddenItems
+ hidden_object 10, 5, SPRITE_FACING_UP, Mansion3Script_Switches
+ db -1 ; end
+
+Mansion4HiddenObjects:
+ hidden_object 1, 9, RARE_CANDY, HiddenItems
+ hidden_object 20, 3, SPRITE_FACING_UP, Mansion4Script_Switches
+ hidden_object 18, 25, SPRITE_FACING_UP, Mansion4Script_Switches
+ db -1 ; end
+
+SafariZoneWestHiddenObjects:
+ hidden_object 6, 5, REVIVE, HiddenItems
+ db -1 ; end
+
+CeruleanCave2HiddenObjects:
+ hidden_object 16, 13, PP_UP, HiddenItems
+ db -1 ; end
+
+CeruleanCave3HiddenObjects:
+ hidden_object 8, 14, PP_UP, HiddenItems
+ db -1 ; end
+
+UnusedMap6FHiddenObjects:
+ hidden_object 14, 11, MAX_ELIXER, HiddenItems
+ db -1 ; end
+
+SeafoamIslands3HiddenObjects:
+ hidden_object 15, 15, NUGGET, HiddenItems
+ db -1 ; end
+
+SeafoamIslands4HiddenObjects:
+ hidden_object 9, 16, MAX_ELIXER, HiddenItems
+ db -1 ; end
+
+SeafoamIslands5HiddenObjects:
+ hidden_object 25, 17, ULTRA_BALL, HiddenItems
+ db -1 ; end
+
+ViridianForestHiddenObjects:
+ hidden_object 1, 18, POTION, HiddenItems
+ hidden_object 16, 42, ANTIDOTE, HiddenItems
+ db -1 ; end
+
+MtMoon3HiddenObjects:
+ hidden_object 18, 12, MOON_STONE, HiddenItems
+ hidden_object 33, 9, ETHER, HiddenItems
+ db -1 ; end
+
+SSAnne10HiddenObjects:
+ hidden_object 3, 1, HYPER_POTION, HiddenItems
+ db -1 ; end
+
+SSAnne6HiddenObjects:
+ hidden_object 13, 5, SPRITE_FACING_DOWN, PrintTrashText
+ hidden_object 13, 7, SPRITE_FACING_DOWN, PrintTrashText
+ hidden_object 13, 9, GREAT_BALL, HiddenItems
+ db -1 ; end
+
+UndergroundPathNsHiddenObjects:
+ hidden_object 3, 4, FULL_RESTORE, HiddenItems
+ hidden_object 4, 34, X_SPECIAL, HiddenItems
+ db -1 ; end
+
+UndergroundPathWeHiddenObjects:
+ hidden_object 12, 2, NUGGET, HiddenItems
+ hidden_object 21, 5, ELIXER, HiddenItems
+ db -1 ; end
+
+RocketHideout1HiddenObjects:
+ hidden_object 21, 15, PP_UP, HiddenItems
+ db -1 ; end
+
+RocketHideout3HiddenObjects:
+ hidden_object 27, 17, NUGGET, HiddenItems
+ db -1 ; end
+
+RocketHideout4HiddenObjects:
+ hidden_object 25, 1, SUPER_POTION, HiddenItems
+ db -1 ; end
+
+Route10HiddenObjects:
+ hidden_object 9, 17, SUPER_POTION, HiddenItems
+ hidden_object 16, 53, MAX_ETHER, HiddenItems
+ db -1 ; end
+
+RockTunnelPokecenterHiddenObjects:
+ hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db -1 ; end
+
+PowerPlantHiddenObjects:
+ hidden_object 17, 16, MAX_ELIXER, HiddenItems
+ hidden_object 12, 1, PP_UP, HiddenItems
+ db -1 ; end
+
+Route11HiddenObjects:
+ hidden_object 48, 5, ESCAPE_ROPE, HiddenItems
+ db -1 ; end
+
+Route12HiddenObjects:
+ hidden_object 2, 63, HYPER_POTION, HiddenItems
+ db -1 ; end
+
+Route13HiddenObjects:
+ hidden_object 1, 14, PP_UP, HiddenItems
+ hidden_object 16, 13, CALCIUM, HiddenItems
+ db -1 ; end
+
+Route15Gate2FHiddenObjects:
+ hidden_object 1, 2, SPRITE_FACING_UP, Route15GateLeftBinoculars
+ db -1 ; end
+
+Route17HiddenObjects:
+ hidden_object 15, 14, RARE_CANDY, HiddenItems
+ hidden_object 8, 45, FULL_RESTORE, HiddenItems
+ hidden_object 17, 72, PP_UP, HiddenItems
+ hidden_object 4, 91, MAX_REVIVE, HiddenItems
+ hidden_object 8, 121, MAX_ELIXER, HiddenItems
+ db -1 ; end
+
+Route23HiddenObjects:
+ hidden_object 9, 44, FULL_RESTORE, HiddenItems
+ hidden_object 19, 70, ULTRA_BALL, HiddenItems
+ hidden_object 8, 90, MAX_ETHER, HiddenItems
+ db -1 ; end
+
+VictoryRoad2HiddenObjects:
+ hidden_object 5, 2, ULTRA_BALL, HiddenItems
+ hidden_object 26, 7, FULL_RESTORE, HiddenItems
+ db -1 ; end
+
+Route25HiddenObjects:
+ hidden_object 38, 3, ETHER, HiddenItems
+ hidden_object 10, 1, ELIXER, HiddenItems
+ db -1 ; end
+
+BillsHouseHiddenObjects:
+ hidden_object 1, 4, SPRITE_FACING_UP, BillsHousePC
+ db -1 ; end
+
+Route4HiddenObjects:
+ hidden_object 40, 3, GREAT_BALL, HiddenItems
+ db -1 ; end
+
+MtMoonPokecenterHiddenObjects:
+ hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
+ hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db -1 ; end
+
+Route9HiddenObjects:
+ hidden_object 14, 7, ETHER, HiddenItems
+ db -1 ; end
+
TradeCenterHiddenObjects:
hidden_object 5, 4, ANY_FACING, CableClubRightGameboy
hidden_object 4, 4, ANY_FACING, CableClubLeftGameboy
@@ -203,6 +281,35 @@ ColosseumHiddenObjects:
hidden_object 4, 4, ANY_FACING, CableClubLeftGameboy
db -1 ; end
+IndigoPlateauHiddenObjects:
+ hidden_object 8, 13, $ff, PrintIndigoPlateauHQText ; inaccessible
+ hidden_object 11, 13, SPRITE_FACING_DOWN, PrintIndigoPlateauHQText ; inaccessible
+ db -1 ; end
+
+IndigoPlateauLobbyHiddenObjects:
+ hidden_object 15, 7, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db -1 ; end
+
+CopycatsHouse2FHiddenObjects:
+ hidden_object 1, 1, NUGGET, HiddenItems
+ db -1 ; end
+
+FightingDojoHiddenObjects:
+ hidden_object 3, 9, SPRITE_FACING_UP, PrintFightingDojoText
+ hidden_object 6, 9, SPRITE_FACING_UP, PrintFightingDojoText
+ hidden_object 4, 0, SPRITE_FACING_UP, PrintFightingDojoText2
+ hidden_object 5, 0, SPRITE_FACING_UP, PrintFightingDojoText3
+ db -1 ; end
+
+SaffronGymHiddenObjects:
+ hidden_object 9, 15, SPRITE_FACING_UP, GymStatues
+ db -1 ; end
+
+SaffronPokecenterHiddenObjects:
+ hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
+ hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
+ db -1 ; end
+
RedsHouse2FHiddenObjects:
hidden_object 0, 1, SPRITE_FACING_UP, OpenRedsPC
hidden_object 3, 5, ANY_FACING, PrintRedSNESText
@@ -221,14 +328,15 @@ OaksLabHiddenObjects:
hidden_object 1, 1, SPRITE_FACING_UP, DisplayOakLabEmailText
db -1 ; end
+ViridianCityHiddenObjects:
+ hidden_object 14, 4, POTION, HiddenItems
+ db -1 ; end
+
ViridianPokecenterHiddenObjects:
hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
-ViridianMartHiddenObjects:
- db -1 ; end
-
ViridianSchoolHiddenObjects:
hidden_text_predef 3, 4, ViridianSchoolNotebook, PrintNotebookText
hidden_text_predef 3, 0, ViridianSchoolBlackboard, PrintBlackboardLinkCableText
@@ -249,14 +357,15 @@ PewterGymHiddenObjects:
hidden_object 6, 10, SPRITE_FACING_UP, GymStatues
db -1 ; end
-PewterMartHiddenObjects:
- db -1 ; end
-
PewterPokecenterHiddenObjects:
hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
+CeruleanCityHiddenObjects:
+ hidden_object 15, 8, RARE_CANDY, HiddenItems
+ db -1 ; end
+
CeruleanPokecenterHiddenObjects:
hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
@@ -267,7 +376,17 @@ CeruleanGymHiddenObjects:
hidden_object 6, 11, SPRITE_FACING_UP, GymStatues
db -1 ; end
-CeruleanMartHiddenObjects:
+BikeShopHiddenObjects:
+ hidden_object 1, 0, ANY_FACING, PrintNewBikeText
+ hidden_object 2, 1, ANY_FACING, PrintNewBikeText
+ hidden_object 1, 2, ANY_FACING, PrintNewBikeText
+ hidden_object 3, 2, ANY_FACING, PrintNewBikeText
+ hidden_object 0, 4, ANY_FACING, PrintNewBikeText
+ hidden_object 1, 5, ANY_FACING, PrintNewBikeText
+ db -1 ; end
+
+CeruleanCave1HiddenObjects:
+ hidden_object 18, 7, PP_UP, HiddenItems
db -1 ; end
LavenderPokecenterHiddenObjects:
@@ -275,11 +394,30 @@ LavenderPokecenterHiddenObjects:
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
+Pokemontower5HiddenObjects:
+ hidden_object 4, 12, ELIXER, HiddenItems
+ db -1 ; end
+
+LavenderHouse1HiddenObjects:
+ hidden_object 0, 1, SPRITE_FACING_DOWN, PrintMagazinesText
+ hidden_object 1, 1, SPRITE_FACING_DOWN, PrintMagazinesText
+ hidden_object 7, 1, SPRITE_FACING_DOWN, PrintMagazinesText
+ db -1 ; end
+
+VermilionCityHiddenObjects:
+ hidden_object 14, 11, MAX_ETHER, HiddenItems
+ db -1 ; end
+
VermilionPokecenterHiddenObjects:
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
db -1 ; end
+PokemonFanClubHiddenObjects:
+ hidden_object 1, 0, SPRITE_FACING_UP, FanClubPicture1
+ hidden_object 6, 0, SPRITE_FACING_UP, FanClubPicture2
+ db -1 ; end
+
VermilionGymHiddenObjects:
hidden_object 3, 14, SPRITE_FACING_UP, GymStatues
hidden_object 6, 14, SPRITE_FACING_UP, GymStatues
@@ -302,10 +440,24 @@ VermilionGymHiddenObjects:
hidden_object 9, 11, 14, GymTrashScript
db -1 ; end
+CeladonCityHiddenObjects:
+ hidden_object 48, 15, PP_UP, HiddenItems
+ db -1 ; end
+
+CeladonHotelHiddenObjects:
+ hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
+ db -1 ; end
+
CeladonMansion2HiddenObjects:
hidden_object 0, 5, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
+CeladonMansion5HiddenObjects:
+ hidden_text_predef 3, 0, LinkCableHelp, PrintBlackboardLinkCableText
+ hidden_text_predef 4, 0, LinkCableHelp, PrintBlackboardLinkCableText
+ hidden_text_predef 3, 4, TMNotebook, PrintNotebookText
+ db -1 ; end
+
CeladonPokecenterHiddenObjects:
hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
@@ -367,21 +519,25 @@ GameCornerHiddenObjects:
hidden_object 12, 15, COIN+10, HiddenCoins
db -1 ; end
-CeladonHotelHiddenObjects:
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- db -1 ; end
-
FuchsiaPokecenterHiddenObjects:
hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
db -1 ; end
+SafariZoneEntranceHiddenObjects:
+ hidden_object 10, 1, NUGGET, HiddenItems ; inaccessible
+ db -1 ; end
+
FuchsiaGymHiddenObjects:
hidden_object 3, 15, SPRITE_FACING_UP, GymStatues
hidden_object 6, 15, SPRITE_FACING_UP, GymStatues
db -1 ; end
+Mansion1HiddenObjects:
+ hidden_object 8, 16, MOON_STONE, HiddenItems
+ hidden_object 2, 5, SPRITE_FACING_UP, Mansion1Script_Switches
+ db -1 ; end
+
CinnabarGymHiddenObjects:
hidden_object 17, 13, SPRITE_FACING_UP, GymStatues
; third param: ([hGymGateAnswer] << 4) | [hGymGateIndex]
@@ -393,276 +549,12 @@ CinnabarGymHiddenObjects:
hidden_object 1, 7, (TRUE << 4) | 6, PrintCinnabarQuiz
db -1 ; end
-CinnabarPokecenterHiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-SaffronGymHiddenObjects:
- hidden_object 9, 15, SPRITE_FACING_UP, GymStatues
- db -1 ; end
-
-MtMoonPokecenterHiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-RockTunnelPokecenterHiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-ViridianForestHiddenObjects:
- hidden_object 1, 18, POTION, HiddenItems
- hidden_object 16, 42, ANTIDOTE, HiddenItems
- db -1 ; end
-
-MtMoon3HiddenObjects:
- hidden_object 18, 12, MOON_STONE, HiddenItems
- hidden_object 33, 9, ETHER, HiddenItems
- db -1 ; end
-
-IndigoPlateauHiddenObjects:
- hidden_object 8, 13, $ff, PrintIndigoPlateauHQText ; inaccessible
- hidden_object 11, 13, SPRITE_FACING_DOWN, PrintIndigoPlateauHQText ; inaccessible
- db -1 ; end
-
-Route25HiddenObjects:
- hidden_object 38, 3, ETHER, HiddenItems
- hidden_object 10, 1, ELIXER, HiddenItems
- db -1 ; end
-
-Route9HiddenObjects:
- hidden_object 14, 7, ETHER, HiddenItems
- db -1 ; end
-
-SSAnne6HiddenObjects:
- hidden_object 13, 5, SPRITE_FACING_DOWN, PrintTrashText
- hidden_object 13, 7, SPRITE_FACING_DOWN, PrintTrashText
- hidden_object 13, 9, GREAT_BALL, HiddenItems
- db -1 ; end
-
-SSAnne10HiddenObjects:
- hidden_object 3, 1, HYPER_POTION, HiddenItems
- db -1 ; end
-
-Route10HiddenObjects:
- hidden_object 9, 17, SUPER_POTION, HiddenItems
- hidden_object 16, 53, MAX_ETHER, HiddenItems
- db -1 ; end
-
-RocketHideout1HiddenObjects:
- hidden_object 21, 15, PP_UP, HiddenItems
- db -1 ; end
-
-RocketHideout3HiddenObjects:
- hidden_object 27, 17, NUGGET, HiddenItems
- db -1 ; end
-
-RocketHideout4HiddenObjects:
- hidden_object 25, 1, SUPER_POTION, HiddenItems
- db -1 ; end
-
-SaffronPokecenterHiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-PokemonTower5HiddenObjects:
- hidden_object 4, 12, ELIXER, HiddenItems
- db -1 ; end
-
-Route13HiddenObjects:
- hidden_object 1, 14, PP_UP, HiddenItems
- hidden_object 16, 13, CALCIUM, HiddenItems
- db -1 ; end
-
-SafariZoneEntranceHiddenObjects:
- hidden_object 10, 1, NUGGET, HiddenItems ; inaccessible
- db -1 ; end
-
-SafariZoneWestHiddenObjects:
- hidden_object 6, 5, REVIVE, HiddenItems
- db -1 ; end
-
-SilphCo5FHiddenObjects:
- hidden_object 12, 3, ELIXER, HiddenItems
- db -1 ; end
-
-SilphCo9FHiddenObjects:
- hidden_object 2, 15, MAX_POTION, HiddenItems
- db -1 ; end
-
-CopycatsHouse2FHiddenObjects:
- hidden_object 1, 1, NUGGET, HiddenItems
- db -1 ; end
-
-CeruleanCave1HiddenObjects:
- hidden_object 14, 11, RARE_CANDY, HiddenItems
- db -1 ; end
-
-CeruleanCave3HiddenObjects:
- hidden_object 27, 3, ULTRA_BALL, HiddenItems
- db -1 ; end
-
-PowerPlantHiddenObjects:
- hidden_object 17, 16, MAX_ELIXER, HiddenItems
- hidden_object 12, 1, PP_UP, HiddenItems
- db -1 ; end
-
-SeafoamIslands3HiddenObjects:
- hidden_object 15, 15, NUGGET, HiddenItems
- db -1 ; end
-
-SeafoamIslands5HiddenObjects:
- hidden_object 25, 17, ULTRA_BALL, HiddenItems
- db -1 ; end
-
-Mansion1HiddenObjects:
- hidden_object 8, 16, MOON_STONE, HiddenItems
- hidden_object 2, 5, SPRITE_FACING_UP, Mansion1Script_Switches
- db -1 ; end
-
-Mansion2HiddenObjects:
- hidden_object 2, 11, SPRITE_FACING_UP, Mansion2Script_Switches
- db -1 ; end
-
-Mansion3HiddenObjects:
- hidden_object 1, 9, MAX_REVIVE, HiddenItems
- hidden_object 10, 5, SPRITE_FACING_UP, Mansion3Script_Switches
- db -1 ; end
-
-Mansion4HiddenObjects:
- hidden_object 1, 9, RARE_CANDY, HiddenItems
- hidden_object 20, 3, SPRITE_FACING_UP, Mansion4Script_Switches
- hidden_object 18, 25, SPRITE_FACING_UP, Mansion4Script_Switches
- db -1 ; end
-
-Route23HiddenObjects:
- hidden_object 9, 44, FULL_RESTORE, HiddenItems
- hidden_object 19, 70, ULTRA_BALL, HiddenItems
- hidden_object 8, 90, MAX_ETHER, HiddenItems
- db -1 ; end
-
-VictoryRoad2HiddenObjects:
- hidden_object 5, 2, ULTRA_BALL, HiddenItems
- hidden_object 26, 7, FULL_RESTORE, HiddenItems
- db -1 ; end
-
-Unused6FHiddenObjects:
- hidden_object 14, 11, MAX_ELIXER, HiddenItems
- db -1 ; end
-
-BillsHouseHiddenObjects:
- hidden_object 1, 4, SPRITE_FACING_UP, BillsHousePC
- db -1 ; end
-
-ViridianCityHiddenObjects:
- hidden_object 14, 4, POTION, HiddenItems
- db -1 ; end
-
-SafariZoneRestHouse2HiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-SafariZoneRestHouse3HiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-SafariZoneRestHouse4HiddenObjects:
- hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText
- hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-Route15GateUpstairsHiddenObjects:
- hidden_object 1, 2, SPRITE_FACING_UP, Route15GateLeftBinoculars
- db -1 ; end
-
-LavenderHouse1HiddenObjects:
- hidden_object 0, 1, SPRITE_FACING_DOWN, PrintMagazinesText
- hidden_object 1, 1, SPRITE_FACING_DOWN, PrintMagazinesText
- hidden_object 7, 1, SPRITE_FACING_DOWN, PrintMagazinesText
- db -1 ; end
-
-CeladonMansion5HiddenObjects:
- hidden_text_predef 3, 0, LinkCableHelp, PrintBlackboardLinkCableText
- hidden_text_predef 4, 0, LinkCableHelp, PrintBlackboardLinkCableText
- hidden_text_predef 3, 4, TMNotebook, PrintNotebookText
- db -1 ; end
-
-FightingDojoHiddenObjects:
- hidden_object 3, 9, SPRITE_FACING_UP, PrintFightingDojoText
- hidden_object 6, 9, SPRITE_FACING_UP, PrintFightingDojoText
- hidden_object 4, 0, SPRITE_FACING_UP, PrintFightingDojoText2
- hidden_object 5, 0, SPRITE_FACING_UP, PrintFightingDojoText3
- db -1 ; end
-
-IndigoPlateauLobbyHiddenObjects:
- hidden_object 15, 7, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
CinnabarLab4HiddenObjects:
hidden_object 0, 4, SPRITE_FACING_UP, OpenPokemonCenterPC
hidden_object 2, 4, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
-BikeShopHiddenObjects:
- hidden_object 1, 0, ANY_FACING, PrintNewBikeText
- hidden_object 2, 1, ANY_FACING, PrintNewBikeText
- hidden_object 1, 2, ANY_FACING, PrintNewBikeText
- hidden_object 3, 2, ANY_FACING, PrintNewBikeText
- hidden_object 0, 4, ANY_FACING, PrintNewBikeText
- hidden_object 1, 5, ANY_FACING, PrintNewBikeText
- db -1 ; end
-
-Route11HiddenObjects:
- hidden_object 48, 5, ESCAPE_ROPE, HiddenItems
- db -1 ; end
-
-Route12HiddenObjects:
- hidden_object 2, 63, HYPER_POTION, HiddenItems
- db -1 ; end
-
-SilphCo11FHiddenObjects:
- hidden_object 10, 12, SPRITE_FACING_UP, OpenPokemonCenterPC
- db -1 ; end
-
-Route17HiddenObjects:
- hidden_object 15, 14, RARE_CANDY, HiddenItems
- hidden_object 8, 45, FULL_RESTORE, HiddenItems
- hidden_object 17, 72, PP_UP, HiddenItems
- hidden_object 4, 91, MAX_REVIVE, HiddenItems
- hidden_object 8, 121, MAX_ELIXER, HiddenItems
- db -1 ; end
-
-UndergroundPathNsHiddenObjects:
- hidden_object 3, 4, FULL_RESTORE, HiddenItems
- hidden_object 4, 34, X_SPECIAL, HiddenItems
- db -1 ; end
-
-UndergroundPathWeHiddenObjects:
- hidden_object 12, 2, NUGGET, HiddenItems
- hidden_object 21, 5, ELIXER, HiddenItems
- db -1 ; end
-
-CeladonCityHiddenObjects:
- hidden_object 48, 15, PP_UP, HiddenItems
- db -1 ; end
-
-SeafoamIslands4HiddenObjects:
- hidden_object 9, 16, MAX_ELIXER, HiddenItems
- db -1 ; end
-
-VermilionCityHiddenObjects:
- hidden_object 14, 11, MAX_ETHER, HiddenItems
- db -1 ; end
-
-CeruleanCityHiddenObjects:
- hidden_object 15, 8, RARE_CANDY, HiddenItems
- db -1 ; end
-
-Route4HiddenObjects:
- hidden_object 40, 3, GREAT_BALL, HiddenItems
+CinnabarPokecenterHiddenObjects:
+ hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText
+ hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC
db -1 ; end
diff --git a/data/events/prize_mon_levels.asm b/data/events/prize_mon_levels.asm
index eb30ac80..53a2a966 100644
--- a/data/events/prize_mon_levels.asm
+++ b/data/events/prize_mon_levels.asm
@@ -1,19 +1,8 @@
PrizeMonLevelDictionary:
-IF DEF(_RED)
- db ABRA, 9
- db CLEFAIRY, 8
- db NIDORINA, 17
+ db ABRA, 15
+ db VULPIX, 18
+ db WIGGLYTUFF, 22
- db DRATINI, 18
- db SCYTHER, 25
- db PORYGON, 26
-ENDC
-IF DEF(_BLUE)
- db ABRA, 6
- db CLEFAIRY, 12
- db NIDORINO, 17
-
- db PINSIR, 20
- db DRATINI, 24
- db PORYGON, 18
-ENDC
+ db SCYTHER, 30
+ db PINSIR, 30
+ db PORYGON, 26
diff --git a/data/events/prizes.asm b/data/events/prizes.asm
index 34cd75d7..9c8b0229 100644
--- a/data/events/prizes.asm
+++ b/data/events/prizes.asm
@@ -3,55 +3,28 @@ PrizeDifferentMenuPtrs:
dw PrizeMenuMon2Entries, PrizeMenuMon2Cost
dw PrizeMenuTMsEntries, PrizeMenuTMsCost
-NoThanksText:
- db "NO THANKS@"
-
PrizeMenuMon1Entries:
db ABRA
- db CLEFAIRY
-IF DEF(_RED)
- db NIDORINA
-ENDC
-IF DEF(_BLUE)
- db NIDORINO
-ENDC
+ db VULPIX
+ db WIGGLYTUFF
db "@"
PrizeMenuMon1Cost:
-IF DEF(_RED)
- bcd2 180
- bcd2 500
-ENDC
-IF DEF(_BLUE)
- bcd2 120
- bcd2 750
-ENDC
- bcd2 1200
+ bcd2 230
+ bcd2 1000
+ bcd2 2680
db "@"
PrizeMenuMon2Entries:
-IF DEF(_RED)
- db DRATINI
db SCYTHER
-ENDC
-IF DEF(_BLUE)
db PINSIR
- db DRATINI
-ENDC
db PORYGON
db "@"
PrizeMenuMon2Cost:
-IF DEF(_RED)
- bcd2 2800
- bcd2 5500
- bcd2 9999
-ENDC
-IF DEF(_BLUE)
- bcd2 2500
- bcd2 4600
bcd2 6500
-ENDC
+ bcd2 6500
+ bcd2 9999
db "@"
PrizeMenuTMsEntries:
diff --git a/data/events/trades.asm b/data/events/trades.asm
index 560abfa1..d7afa5ff 100644
--- a/data/events/trades.asm
+++ b/data/events/trades.asm
@@ -2,14 +2,14 @@ TradeMons:
; entries correspond to TRADE_FOR_* constants
table_width 3 + NAME_LENGTH, TradeMons
; give mon, get mon, dialog id, nickname
- db NIDORINO, NIDORINA, TRADE_DIALOGSET_CASUAL, "TERRY@@@@@@"
- db ABRA, MR_MIME, TRADE_DIALOGSET_CASUAL, "MARCEL@@@@@"
- db BUTTERFREE, BEEDRILL, TRADE_DIALOGSET_HAPPY, "CHIKUCHIKU@"
- db PONYTA, SEEL, TRADE_DIALOGSET_CASUAL, "SAILOR@@@@@"
- db SPEAROW, FARFETCHD, TRADE_DIALOGSET_HAPPY, "DUX@@@@@@@@"
- db SLOWBRO, LICKITUNG, TRADE_DIALOGSET_CASUAL, "MARC@@@@@@@"
- db POLIWHIRL, JYNX, TRADE_DIALOGSET_POLITE, "LOLA@@@@@@@"
- db RAICHU, ELECTRODE, TRADE_DIALOGSET_POLITE, "DORIS@@@@@@"
- db VENONAT, TANGELA, TRADE_DIALOGSET_HAPPY, "CRINKLES@@@"
- db NIDORAN_M, NIDORAN_F, TRADE_DIALOGSET_HAPPY, "SPOT@@@@@@@"
+ db LICKITUNG, DUGTRIO, TRADE_DIALOGSET_CASUAL, "GURIO@@@@@@"
+ db CLEFAIRY, MR_MIME, TRADE_DIALOGSET_CASUAL, "MILES@@@@@@"
+ db BUTTERFREE, BEEDRILL, TRADE_DIALOGSET_HAPPY, "STINGER@@@@"
+ db KANGASKHAN, MUK, TRADE_DIALOGSET_CASUAL, "STICKY@@@@@"
+ db MEW, MEW, TRADE_DIALOGSET_HAPPY, "BART@@@@@@@"
+ db TANGELA, PARASECT, TRADE_DIALOGSET_CASUAL, "SPIKE@@@@@@"
+ db PIDGEOT, PIDGEOT, TRADE_DIALOGSET_POLITE, "MARTY@@@@@@"
+ db GOLDUCK, RHYDON, TRADE_DIALOGSET_POLITE, "BUFFY@@@@@@"
+ db GROWLITHE, DEWGONG, TRADE_DIALOGSET_HAPPY, "CEZANNE@@@@"
+ db CUBONE, MACHOKE, TRADE_DIALOGSET_HAPPY, "RICKY@@@@@@"
assert_table_length NUM_NPC_TRADES
diff --git a/data/icon_pointers.asm b/data/icon_pointers.asm
index 79db936e..9092e1b1 100644
--- a/data/icon_pointers.asm
+++ b/data/icon_pointers.asm
@@ -20,6 +20,7 @@ MonPartySpritePointers:
mon_icon_header SnakeIconFrame1, 1, 1, ICON_SNAKE << 2 + 2
mon_icon_header QuadrupedIconFrame1, 0, 1, ICON_QUADRUPED << 2
mon_icon_header QuadrupedIconFrame1, 1, 1, ICON_QUADRUPED << 2 + 2
+ mon_icon_header PikachuSprite, 0, 4, ICON_PIKACHU << 2
mon_icon_header TradeBubbleIconGFX, 0, 4, ICON_TRADEBUBBLE << 2
mon_icon_header MonsterSprite, 0, 4, ICONOFFSET + ICON_MON << 2
mon_icon_header PokeBallSprite, 0, 8, ICONOFFSET + ICON_BALL << 2
@@ -34,4 +35,5 @@ MonPartySpritePointers:
mon_icon_header SnakeIconFrame2, 1, 1, ICONOFFSET + ICON_SNAKE << 2 + 2
mon_icon_header QuadrupedIconFrame2, 0, 1, ICONOFFSET + ICON_QUADRUPED << 2
mon_icon_header QuadrupedIconFrame2, 1, 1, ICONOFFSET + ICON_QUADRUPED << 2 + 2
+ mon_icon_header PikachuSprite, 12, 4, ICONOFFSET + ICON_PIKACHU << 2
mon_icon_header TradeBubbleIconGFX, 4, 4, ICONOFFSET + ICON_TRADEBUBBLE << 2
diff --git a/data/items/marts.asm b/data/items/marts.asm
index c6a80de5..c8b60da1 100644
--- a/data/items/marts.asm
+++ b/data/items/marts.asm
@@ -2,13 +2,13 @@
; they are texts
ViridianCashierText::
- script_mart POKE_BALL, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL
+ script_mart POKE_BALL, POTION, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL
PewterCashierText::
script_mart POKE_BALL, POTION, ESCAPE_ROPE, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL
CeruleanCashierText::
- script_mart POKE_BALL, POTION, REPEL, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL
+ script_mart POKE_BALL, POTION, ESCAPE_ROPE, REPEL, ANTIDOTE, BURN_HEAL, AWAKENING, PARLYZ_HEAL
BikeShopCashierText:: ; unreferenced
script_mart BICYCLE
@@ -35,7 +35,7 @@ CeladonMart5Clerk2Text::
script_mart HP_UP, PROTEIN, IRON, CARBOS, CALCIUM
FuchsiaCashierText::
- script_mart ULTRA_BALL, GREAT_BALL, SUPER_POTION, REVIVE, FULL_HEAL, SUPER_REPEL
+ script_mart ULTRA_BALL, GREAT_BALL, HYPER_POTION, REVIVE, FULL_HEAL, SUPER_REPEL
UnusedCashierText:: ; unreferenced
script_mart GREAT_BALL, HYPER_POTION, SUPER_POTION, FULL_HEAL, REVIVE
diff --git a/data/maps/bit_5_maps.asm b/data/maps/bit_5_maps.asm
new file mode 100644
index 00000000..c32bb114
--- /dev/null
+++ b/data/maps/bit_5_maps.asm
@@ -0,0 +1,30 @@
+; SetMapSpecificScriptFlagsOnMapReload sets bit 5
+; of wCurrentMapScriptFlags for these maps.
+
+Bit5Maps:
+ db SILPH_CO_2F
+ db SILPH_CO_3F
+ db SILPH_CO_4F
+ db SILPH_CO_5F
+ db SILPH_CO_6F
+ db SILPH_CO_7F
+ db SILPH_CO_8F
+ db SILPH_CO_9F
+ db SILPH_CO_10F
+ db SILPH_CO_11F
+ db POKEMON_MANSION_2F
+ db POKEMON_MANSION_3F
+ db POKEMON_MANSION_B1F
+ db POKEMON_MANSION_1F
+ db CINNABAR_GYM
+ db GAME_CORNER
+ db ROCKET_HIDEOUT_B1F
+ db ROCKET_HIDEOUT_B4F
+ db VICTORY_ROAD_3F
+ db VICTORY_ROAD_1F
+ db VICTORY_ROAD_2F
+ db LANCES_ROOM
+ db LORELEIS_ROOM
+ db BRUNOS_ROOM
+ db AGATHAS_ROOM
+ db -1 ; end
diff --git a/data/maps/headers/CeruleanMelaniesHouse.asm b/data/maps/headers/CeruleanMelaniesHouse.asm
new file mode 100644
index 00000000..7d7d2fd7
--- /dev/null
+++ b/data/maps/headers/CeruleanMelaniesHouse.asm
@@ -0,0 +1,3 @@
+
+ map_header CeruleanMelaniesHouse, CERULEAN_MELANIES_HOUSE, HOUSE, 0
+ end_map_header
diff --git a/data/maps/headers/CeruleanTradeHouse.asm b/data/maps/headers/CeruleanTradeHouse.asm
deleted file mode 100644
index 20970b77..00000000
--- a/data/maps/headers/CeruleanTradeHouse.asm
+++ /dev/null
@@ -1,3 +0,0 @@
-
- map_header CeruleanTradeHouse, CERULEAN_TRADE_HOUSE, HOUSE, 0
- end_map_header
diff --git a/data/maps/headers/SummerBeachHouse.asm b/data/maps/headers/SummerBeachHouse.asm
new file mode 100644
index 00000000..64f55acc
--- /dev/null
+++ b/data/maps/headers/SummerBeachHouse.asm
@@ -0,0 +1,3 @@
+
+ map_header SummerBeachHouse, SUMMER_BEACH_HOUSE, BEACH_HOUSE, 0
+ end_map_header
diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm
index f54e484a..6d5d4aa6 100644
--- a/data/maps/hide_show_data.asm
+++ b/data/maps/hide_show_data.asm
@@ -66,7 +66,7 @@ MapHSPointers:
dw NoHS
dw MtMoonB2FHS
dw NoHS
- dw NoHS
+ dw CeruleanMelaniesHouseHS
dw NoHS
dw NoHS
dw NoHS
@@ -251,6 +251,7 @@ MapHSPointers:
dw NoHS
dw NoHS
dw NoHS
+ dw NoHS
assert_table_length NUM_MAPS
dw -1 ; end
@@ -267,6 +268,7 @@ PalletTownHS:
ViridianCityHS:
db VIRIDIAN_CITY, $05, SHOW
db VIRIDIAN_CITY, $07, HIDE
+ db VIRIDIAN_CITY, $08, HIDE
PewterCityHS:
db PEWTER_CITY, $03, SHOW
db PEWTER_CITY, $05, SHOW
@@ -322,21 +324,22 @@ BluesHouseHS:
OaksLabHS:
db OAKS_LAB, $01, SHOW
db OAKS_LAB, $02, SHOW
- db OAKS_LAB, $03, SHOW
+ db OAKS_LAB, $03, HIDE
db OAKS_LAB, $04, SHOW
- db OAKS_LAB, $05, HIDE
- db OAKS_LAB, $06, SHOW
- db OAKS_LAB, $07, SHOW
- db OAKS_LAB, $08, HIDE
+ db OAKS_LAB, $05, SHOW
+ db OAKS_LAB, $06, HIDE
ViridianGymHS:
db VIRIDIAN_GYM, $01, SHOW
db VIRIDIAN_GYM, $0B, SHOW
Museum1FHS:
db MUSEUM_1F, $05, SHOW
+CeruleanMelaniesHouseHS:
+ db CERULEAN_MELANIES_HOUSE, $02, SHOW
CeruleanCaveHS:
db CERULEAN_CAVE_1F, $01, SHOW
db CERULEAN_CAVE_1F, $02, SHOW
db CERULEAN_CAVE_1F, $03, SHOW
+ db CERULEAN_CAVE_1F, $04, SHOW
PokemonTower2FHS:
db POKEMON_TOWER_2F, $01, SHOW
PokemonTower3FHS:
@@ -351,10 +354,9 @@ PokemonTower6FHS:
db POKEMON_TOWER_6F, $04, SHOW
db POKEMON_TOWER_6F, $05, SHOW
PokemonTower7FHS:
- db POKEMON_TOWER_7F, $01, SHOW
- db POKEMON_TOWER_7F, $02, SHOW
+ db POKEMON_TOWER_7F, $01, HIDE ; jessie & james?
+ db POKEMON_TOWER_7F, $02, HIDE
db POKEMON_TOWER_7F, $03, SHOW
- db POKEMON_TOWER_7F, $04, SHOW
MrFujisHouseHS:
db MR_FUJIS_HOUSE, $05, HIDE
CeladonMansionRoofHouseHS:
@@ -398,9 +400,9 @@ BillsHouseHS:
db BILLS_HOUSE, $02, HIDE
db BILLS_HOUSE, $03, HIDE
ViridianForestHS:
- db VIRIDIAN_FOREST, $05, SHOW
- db VIRIDIAN_FOREST, $06, SHOW
db VIRIDIAN_FOREST, $07, SHOW
+ db VIRIDIAN_FOREST, $08, SHOW
+ db VIRIDIAN_FOREST, $09, SHOW
MtMoon1FHS:
db MT_MOON_1F, $08, SHOW
db MT_MOON_1F, $09, SHOW
@@ -409,10 +411,12 @@ MtMoon1FHS:
db MT_MOON_1F, $0C, SHOW
db MT_MOON_1F, $0D, SHOW
MtMoonB2FHS:
- db MT_MOON_B2F, $06, SHOW
+ db MT_MOON_B2F, $02, HIDE
+ db MT_MOON_B2F, $06, HIDE
db MT_MOON_B2F, $07, SHOW
db MT_MOON_B2F, $08, SHOW
db MT_MOON_B2F, $09, SHOW
+ db MT_MOON_B2F, $0A, SHOW
SSAnne2FHS:
db SS_ANNE_2F, $02, HIDE
SSAnne1FRoomsHS:
@@ -441,6 +445,8 @@ RocketHideoutB3FHS:
db ROCKET_HIDEOUT_B3F, $04, SHOW
RocketHideoutB4FHS:
db ROCKET_HIDEOUT_B4F, $01, SHOW
+ db ROCKET_HIDEOUT_B4F, $02, HIDE
+ db ROCKET_HIDEOUT_B4F, $03, HIDE
db ROCKET_HIDEOUT_B4F, $05, SHOW
db ROCKET_HIDEOUT_B4F, $06, SHOW
db ROCKET_HIDEOUT_B4F, $07, SHOW
@@ -505,6 +511,7 @@ SilphCo11FHS:
db SILPH_CO_11F, $03, SHOW
db SILPH_CO_11F, $04, SHOW
db SILPH_CO_11F, $05, SHOW
+ db SILPH_CO_11F, $06, SHOW
UnusedMapF4HS:
db UNUSED_MAP_F4, $02, SHOW
PokemonMansion2FHS:
@@ -537,10 +544,13 @@ CeruleanCave2FHS:
db CERULEAN_CAVE_2F, $01, SHOW
db CERULEAN_CAVE_2F, $02, SHOW
db CERULEAN_CAVE_2F, $03, SHOW
+ db CERULEAN_CAVE_2F, $04, SHOW
CeruleanCaveB1FHS:
db CERULEAN_CAVE_B1F, $01, SHOW
db CERULEAN_CAVE_B1F, $02, SHOW
db CERULEAN_CAVE_B1F, $03, SHOW
+ db CERULEAN_CAVE_B1F, $04, SHOW
+ db CERULEAN_CAVE_B1F, $05, SHOW
VictoryRoad1FHS:
db VICTORY_ROAD_1F, $03, SHOW
db VICTORY_ROAD_1F, $04, SHOW
@@ -564,5 +574,9 @@ SeafoamIslandsB4FHS:
db SEAFOAM_ISLANDS_B4F, $01, HIDE
db SEAFOAM_ISLANDS_B4F, $02, HIDE
db SEAFOAM_ISLANDS_B4F, $03, SHOW
+BluesHouseHSCopy: ; unreferenced
+ db BLUES_HOUSE, $01, SHOW
+ db BLUES_HOUSE, $02, HIDE
+ db BLUES_HOUSE, $03, SHOW
db $FF, $01, SHOW ; end
assert_table_length NUM_HS_OBJECTS + 1
diff --git a/data/maps/map_header_banks.asm b/data/maps/map_header_banks.asm
index 87ec01cf..454e3260 100644
--- a/data/maps/map_header_banks.asm
+++ b/data/maps/map_header_banks.asm
@@ -64,7 +64,7 @@ MapHeaderBanks::
db BANK(MtMoonB1F_h)
db BANK(MtMoonB2F_h)
db BANK(CeruleanTrashedHouse_h)
- db BANK(CeruleanTradeHouse_h)
+ db BANK(CeruleanMelaniesHouse_h)
db BANK(CeruleanPokecenter_h)
db BANK(CeruleanGym_h)
db BANK(BikeShop_h)
@@ -249,4 +249,5 @@ MapHeaderBanks::
db BANK(LoreleisRoom_h)
db BANK(BrunosRoom_h)
db BANK(AgathasRoom_h)
+ db BANK(SummerBeachHouse_h)
assert_table_length NUM_MAPS
diff --git a/data/maps/map_header_pointers.asm b/data/maps/map_header_pointers.asm
index 44457ce6..0f37b129 100644
--- a/data/maps/map_header_pointers.asm
+++ b/data/maps/map_header_pointers.asm
@@ -64,7 +64,7 @@ MapHeaderPointers::
dw MtMoonB1F_h
dw MtMoonB2F_h
dw CeruleanTrashedHouse_h
- dw CeruleanTradeHouse_h
+ dw CeruleanMelaniesHouse_h
dw CeruleanPokecenter_h
dw CeruleanGym_h
dw BikeShop_h
@@ -249,4 +249,5 @@ MapHeaderPointers::
dw LoreleisRoom_h
dw BrunosRoom_h
dw AgathasRoom_h
+ dw SummerBeachHouse_h
assert_table_length NUM_MAPS
diff --git a/data/maps/objects/BluesHouse.asm b/data/maps/objects/BluesHouse.asm
index 4858b785..f4931a47 100644
--- a/data/maps/objects/BluesHouse.asm
+++ b/data/maps/objects/BluesHouse.asm
@@ -8,7 +8,7 @@ BluesHouse_Object:
def_signs
def_objects
- object SPRITE_DAISY, 2, 3, STAY, RIGHT, 1 ; Daisy, sitting by map
+ object SPRITE_DAISY, 2, 3, STAY, RIGHT, 1, 0 ; Daisy, sitting by map
object SPRITE_DAISY, 6, 4, WALK, UP_DOWN, 2, 0 ; Daisy, walking around
object SPRITE_POKEDEX, 3, 3, STAY, NONE, 3, 0 ; map on table
diff --git a/data/maps/objects/CeladonPokecenter.asm b/data/maps/objects/CeladonPokecenter.asm
index 65a04a1c..0a298fd0 100644
--- a/data/maps/objects/CeladonPokecenter.asm
+++ b/data/maps/objects/CeladonPokecenter.asm
@@ -9,8 +9,9 @@ CeladonPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
- object SPRITE_GENTLEMAN, 7, 3, WALK, LEFT_RIGHT, 2 ; person
+ object SPRITE_GENTLEMAN, 7, 3, STAY, DOWN, 2 ; person
object SPRITE_BEAUTY, 10, 5, WALK, ANY_DIR, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to CELADON_POKECENTER
diff --git a/data/maps/objects/CeruleanCave1F.asm b/data/maps/objects/CeruleanCave1F.asm
index 7e5e8c85..8c3d260e 100644
--- a/data/maps/objects/CeruleanCave1F.asm
+++ b/data/maps/objects/CeruleanCave1F.asm
@@ -15,8 +15,9 @@ CeruleanCave1F_Object:
def_signs
def_objects
- object SPRITE_POKE_BALL, 7, 13, STAY, NONE, 1, FULL_RESTORE
- object SPRITE_POKE_BALL, 19, 3, STAY, NONE, 2, MAX_ELIXER
- object SPRITE_POKE_BALL, 5, 0, STAY, NONE, 3, NUGGET
+ object SPRITE_POKE_BALL, 29, 16, STAY, NONE, 1, RARE_CANDY
+ object SPRITE_POKE_BALL, 7, 11, STAY, NONE, 2, MAX_ELIXER
+ object SPRITE_POKE_BALL, 29, 9, STAY, NONE, 3, MAX_REVIVE
+ object SPRITE_POKE_BALL, 18, 3, STAY, NONE, 4, ULTRA_BALL
def_warps_to CERULEAN_CAVE_1F
diff --git a/data/maps/objects/CeruleanCave2F.asm b/data/maps/objects/CeruleanCave2F.asm
index 6622bb77..787ae539 100644
--- a/data/maps/objects/CeruleanCave2F.asm
+++ b/data/maps/objects/CeruleanCave2F.asm
@@ -12,8 +12,9 @@ CeruleanCave2F_Object:
def_signs
def_objects
- object SPRITE_POKE_BALL, 29, 9, STAY, NONE, 1, PP_UP
- object SPRITE_POKE_BALL, 4, 15, STAY, NONE, 2, ULTRA_BALL
- object SPRITE_POKE_BALL, 13, 6, STAY, NONE, 3, FULL_RESTORE
+ object SPRITE_POKE_BALL, 0, 11, STAY, NONE, 1, RARE_CANDY
+ object SPRITE_POKE_BALL, 16, 7, STAY, NONE, 2, ULTRA_BALL
+ object SPRITE_POKE_BALL, 19, 11, STAY, NONE, 3, MAX_REVIVE
+ object SPRITE_POKE_BALL, 27, 9, STAY, NONE, 4, FULL_RESTORE
def_warps_to CERULEAN_CAVE_2F
diff --git a/data/maps/objects/CeruleanCaveB1F.asm b/data/maps/objects/CeruleanCaveB1F.asm
index 886238c2..3493ab7e 100644
--- a/data/maps/objects/CeruleanCaveB1F.asm
+++ b/data/maps/objects/CeruleanCaveB1F.asm
@@ -8,7 +8,9 @@ CeruleanCaveB1F_Object:
def_objects
object SPRITE_MONSTER, 27, 13, STAY, DOWN, 1, MEWTWO, 70
- object SPRITE_POKE_BALL, 16, 9, STAY, NONE, 2, ULTRA_BALL
- object SPRITE_POKE_BALL, 18, 1, STAY, NONE, 3, MAX_REVIVE
+ object SPRITE_POKE_BALL, 26, 1, STAY, NONE, 2, ULTRA_BALL
+ object SPRITE_POKE_BALL, 2, 13, STAY, NONE, 3, ULTRA_BALL
+ object SPRITE_POKE_BALL, 3, 13, STAY, NONE, 4, MAX_REVIVE
+ object SPRITE_POKE_BALL, 15, 3, STAY, NONE, 5, MAX_ELIXER
def_warps_to CERULEAN_CAVE_B1F
diff --git a/data/maps/objects/CeruleanCity.asm b/data/maps/objects/CeruleanCity.asm
index 9b15c1c5..2d155e25 100644
--- a/data/maps/objects/CeruleanCity.asm
+++ b/data/maps/objects/CeruleanCity.asm
@@ -1,9 +1,9 @@
CeruleanCity_Object:
- db $f ; border block
+ db $a ; border block
def_warps
warp 27, 11, 0, CERULEAN_TRASHED_HOUSE
- warp 13, 15, 0, CERULEAN_TRADE_HOUSE
+ warp 13, 15, 0, CERULEAN_MELANIES_HOUSE
warp 19, 17, 0, CERULEAN_POKECENTER
warp 30, 19, 0, CERULEAN_GYM
warp 13, 25, 0, BIKE_SHOP
@@ -27,11 +27,11 @@ CeruleanCity_Object:
object SPRITE_COOLTRAINER_M, 31, 20, STAY, DOWN, 3 ; person
object SPRITE_SUPER_NERD, 15, 18, WALK, UP_DOWN, 4 ; person
object SPRITE_SUPER_NERD, 9, 21, WALK, LEFT_RIGHT, 5 ; person
- object SPRITE_GUARD, 28, 12, STAY, DOWN, 6 ; person
+ object SPRITE_OFFICER_JENNY, 28, 12, STAY, DOWN, 6 ; person
object SPRITE_COOLTRAINER_F, 29, 26, STAY, LEFT, 7 ; person
- object SPRITE_MONSTER, 28, 26, STAY, DOWN, 8 ; person
+ object SPRITE_POKE_BALL, 28, 26, STAY, DOWN, 8 ; person
object SPRITE_COOLTRAINER_F, 9, 27, WALK, LEFT_RIGHT, 9 ; person
object SPRITE_SUPER_NERD, 4, 12, STAY, DOWN, 10 ; person
- object SPRITE_GUARD, 27, 12, STAY, DOWN, 11 ; person
+ object SPRITE_OFFICER_JENNY, 27, 12, STAY, DOWN, 11 ; person
def_warps_to CERULEAN_CITY
diff --git a/data/maps/objects/CeruleanMelaniesHouse.asm b/data/maps/objects/CeruleanMelaniesHouse.asm
new file mode 100644
index 00000000..cbd25533
--- /dev/null
+++ b/data/maps/objects/CeruleanMelaniesHouse.asm
@@ -0,0 +1,16 @@
+CeruleanMelaniesHouse_Object:
+ db $a ; border block
+
+ def_warps
+ warp 2, 7, 1, LAST_MAP
+ warp 3, 7, 1, LAST_MAP
+
+ def_signs
+
+ def_objects
+ object SPRITE_GIRL, 3, 1, STAY, DOWN, 1 ; person
+ object SPRITE_BULBASAUR, 4, 1, STAY, DOWN, 2 ; person
+ object SPRITE_ODDISH, 1, 4, STAY, NONE, 3 ; person
+ object SPRITE_SANDSHREW, 5, 3, STAY, LEFT, 4 ; person
+
+ def_warps_to CERULEAN_MELANIES_HOUSE
diff --git a/data/maps/objects/CeruleanPokecenter.asm b/data/maps/objects/CeruleanPokecenter.asm
index af6c0ac3..b90db6a5 100644
--- a/data/maps/objects/CeruleanPokecenter.asm
+++ b/data/maps/objects/CeruleanPokecenter.asm
@@ -10,7 +10,8 @@ CeruleanPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_SUPER_NERD, 10, 5, WALK, ANY_DIR, 2 ; person
- object SPRITE_GENTLEMAN, 4, 3, STAY, DOWN, 3 ; person
+ object SPRITE_GENTLEMAN, 4, 3, STAY, UP, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to CERULEAN_POKECENTER
diff --git a/data/maps/objects/CeruleanTradeHouse.asm b/data/maps/objects/CeruleanTradeHouse.asm
deleted file mode 100644
index 04638ded..00000000
--- a/data/maps/objects/CeruleanTradeHouse.asm
+++ /dev/null
@@ -1,14 +0,0 @@
-CeruleanTradeHouse_Object:
- db $a ; border block
-
- def_warps
- warp 2, 7, 1, LAST_MAP
- warp 3, 7, 1, LAST_MAP
-
- def_signs
-
- def_objects
- object SPRITE_GRANNY, 5, 4, STAY, LEFT, 1 ; person
- object SPRITE_GAMBLER, 1, 2, STAY, NONE, 2 ; person
-
- def_warps_to CERULEAN_TRADE_HOUSE
diff --git a/data/maps/objects/CinnabarGym.asm b/data/maps/objects/CinnabarGym.asm
index b2dccbd3..a680d3fd 100644
--- a/data/maps/objects/CinnabarGym.asm
+++ b/data/maps/objects/CinnabarGym.asm
@@ -8,7 +8,7 @@ CinnabarGym_Object:
def_signs
def_objects
- object SPRITE_MIDDLE_AGED_MAN, 3, 3, STAY, DOWN, 1, OPP_BLAINE, 1
+ object SPRITE_SILPH_PRESIDENT, 3, 3, STAY, DOWN, 1, OPP_BLAINE, 1
object SPRITE_SUPER_NERD, 17, 2, STAY, DOWN, 2, OPP_SUPER_NERD, 9
object SPRITE_SUPER_NERD, 17, 8, STAY, DOWN, 3, OPP_BURGLAR, 4
object SPRITE_SUPER_NERD, 11, 4, STAY, DOWN, 4, OPP_SUPER_NERD, 10
diff --git a/data/maps/objects/CinnabarPokecenter.asm b/data/maps/objects/CinnabarPokecenter.asm
index b1d89678..0a2a11aa 100644
--- a/data/maps/objects/CinnabarPokecenter.asm
+++ b/data/maps/objects/CinnabarPokecenter.asm
@@ -12,5 +12,6 @@ CinnabarPokecenter_Object:
object SPRITE_COOLTRAINER_F, 9, 4, WALK, ANY_DIR, 2 ; person
object SPRITE_GENTLEMAN, 2, 6, STAY, NONE, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to CINNABAR_POKECENTER
diff --git a/data/maps/objects/CopycatsHouse1F.asm b/data/maps/objects/CopycatsHouse1F.asm
index c1250c91..bc635385 100644
--- a/data/maps/objects/CopycatsHouse1F.asm
+++ b/data/maps/objects/CopycatsHouse1F.asm
@@ -11,6 +11,6 @@ CopycatsHouse1F_Object:
def_objects
object SPRITE_MIDDLE_AGED_WOMAN, 2, 2, STAY, DOWN, 1 ; person
object SPRITE_MIDDLE_AGED_MAN, 5, 4, STAY, LEFT, 2 ; person
- object SPRITE_FAIRY, 1, 4, WALK, UP_DOWN, 3 ; person
+ object SPRITE_CHANSEY, 1, 4, STAY, NONE, 3 ; person
def_warps_to COPYCATS_HOUSE_1F
diff --git a/data/maps/objects/FuchsiaCity.asm b/data/maps/objects/FuchsiaCity.asm
index d0230a01..a601a896 100644
--- a/data/maps/objects/FuchsiaCity.asm
+++ b/data/maps/objects/FuchsiaCity.asm
@@ -33,7 +33,7 @@ FuchsiaCity_Object:
object SPRITE_GAMBLER, 28, 17, WALK, LEFT_RIGHT, 2 ; person
object SPRITE_FISHER, 30, 14, STAY, DOWN, 3 ; person
object SPRITE_YOUNGSTER, 24, 8, STAY, UP, 4 ; person
- object SPRITE_FAIRY, 31, 5, WALK, ANY_DIR, 5 ; person
+ object SPRITE_CHANSEY, 31, 5, STAY, DOWN, 5 ; person
object SPRITE_POKE_BALL, 25, 6, STAY, NONE, 6 ; person
object SPRITE_MONSTER, 12, 6, WALK, LEFT_RIGHT, 7 ; person
object SPRITE_MONSTER, 30, 12, WALK, LEFT_RIGHT, 8 ; person
diff --git a/data/maps/objects/FuchsiaGym.asm b/data/maps/objects/FuchsiaGym.asm
index a48794ff..95b2e42e 100644
--- a/data/maps/objects/FuchsiaGym.asm
+++ b/data/maps/objects/FuchsiaGym.asm
@@ -8,7 +8,7 @@ FuchsiaGym_Object:
def_signs
def_objects
- object SPRITE_KOGA, 4, 10, STAY, DOWN, 1, OPP_KOGA, 1
+ object SPRITE_SILPH_WORKER, 4, 10, STAY, DOWN, 1, OPP_KOGA, 1
object SPRITE_ROCKER, 8, 13, STAY, DOWN, 2, OPP_JUGGLER, 7
object SPRITE_ROCKER, 7, 8, STAY, RIGHT, 3, OPP_JUGGLER, 3
object SPRITE_ROCKER, 1, 12, STAY, DOWN, 4, OPP_JUGGLER, 8
diff --git a/data/maps/objects/FuchsiaPokecenter.asm b/data/maps/objects/FuchsiaPokecenter.asm
index 54c5952b..4eb9d196 100644
--- a/data/maps/objects/FuchsiaPokecenter.asm
+++ b/data/maps/objects/FuchsiaPokecenter.asm
@@ -9,8 +9,9 @@ FuchsiaPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
- object SPRITE_ROCKER, 2, 3, STAY, NONE, 2 ; person
+ object SPRITE_ROCKER, 4, 3, STAY, UP, 2 ; person
object SPRITE_COOLTRAINER_F, 6, 5, WALK, LEFT_RIGHT, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to FUCHSIA_POKECENTER
diff --git a/data/maps/objects/GameCorner.asm b/data/maps/objects/GameCorner.asm
index 90708941..4e425e86 100644
--- a/data/maps/objects/GameCorner.asm
+++ b/data/maps/objects/GameCorner.asm
@@ -18,8 +18,8 @@ GameCorner_Object:
object SPRITE_MIDDLE_AGED_WOMAN, 8, 11, STAY, LEFT, 6 ; person
object SPRITE_GYM_GUIDE, 8, 14, STAY, LEFT, 7 ; person
object SPRITE_GAMBLER, 11, 15, STAY, RIGHT, 8 ; person
- object SPRITE_CLERK, 14, 11, STAY, LEFT, 9 ; person
- object SPRITE_GENTLEMAN, 17, 13, STAY, RIGHT, 10 ; person
+ object SPRITE_MIDDLE_AGED_MAN, 14, 11, STAY, LEFT, 9 ; person
+ object SPRITE_FISHING_GURU, 17, 13, STAY, RIGHT, 10 ; person
object SPRITE_ROCKET, 9, 5, STAY, UP, 11, OPP_ROCKET, 7
def_warps_to GAME_CORNER
diff --git a/data/maps/objects/IndigoPlateauLobby.asm b/data/maps/objects/IndigoPlateauLobby.asm
index 3244b4ad..db101be0 100644
--- a/data/maps/objects/IndigoPlateauLobby.asm
+++ b/data/maps/objects/IndigoPlateauLobby.asm
@@ -14,5 +14,6 @@ IndigoPlateauLobby_Object:
object SPRITE_COOLTRAINER_F, 5, 1, STAY, DOWN, 3 ; person
object SPRITE_CLERK, 0, 5, STAY, RIGHT, 4 ; person
object SPRITE_LINK_RECEPTIONIST, 13, 6, STAY, DOWN, 5 ; person
+ object SPRITE_CHANSEY, 8, 5, STAY, DOWN, 6 ; person
def_warps_to INDIGO_PLATEAU_LOBBY
diff --git a/data/maps/objects/LavenderPokecenter.asm b/data/maps/objects/LavenderPokecenter.asm
index 98975531..667b584f 100644
--- a/data/maps/objects/LavenderPokecenter.asm
+++ b/data/maps/objects/LavenderPokecenter.asm
@@ -10,7 +10,8 @@ LavenderPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_GENTLEMAN, 5, 3, STAY, NONE, 2 ; person
- object SPRITE_LITTLE_GIRL, 2, 6, WALK, UP_DOWN, 3 ; person
+ object SPRITE_LITTLE_GIRL, 10, 5, WALK, LEFT_RIGHT, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to LAVENDER_POKECENTER
diff --git a/data/maps/objects/MtMoonB2F.asm b/data/maps/objects/MtMoonB2F.asm
index 7b2e7e5a..b2c1ff1d 100644
--- a/data/maps/objects/MtMoonB2F.asm
+++ b/data/maps/objects/MtMoonB2F.asm
@@ -11,13 +11,14 @@ MtMoonB2F_Object:
def_objects
object SPRITE_SUPER_NERD, 12, 8, STAY, RIGHT, 1, OPP_SUPER_NERD, 2
- object SPRITE_ROCKET, 11, 16, STAY, DOWN, 2, OPP_ROCKET, 1
+ object SPRITE_JESSIE, 9, 3, STAY, LEFT, 2
object SPRITE_ROCKET, 15, 22, STAY, DOWN, 3, OPP_ROCKET, 2
object SPRITE_ROCKET, 29, 11, STAY, UP, 4, OPP_ROCKET, 3
- object SPRITE_ROCKET, 29, 17, STAY, LEFT, 5, OPP_ROCKET, 4
- object SPRITE_FOSSIL, 12, 6, STAY, NONE, 6 ; person
- object SPRITE_FOSSIL, 13, 6, STAY, NONE, 7 ; person
- object SPRITE_POKE_BALL, 25, 21, STAY, NONE, 8, HP_UP
- object SPRITE_POKE_BALL, 29, 5, STAY, NONE, 9, TM_MEGA_PUNCH
+ object SPRITE_ROCKET, 29, 17, STAY, LEFT, 5, OPP_ROCKET, 1
+ object SPRITE_JAMES, 9, 4, STAY, LEFT, 6
+ object SPRITE_FOSSIL, 12, 6, STAY, NONE, 7 ; person
+ object SPRITE_FOSSIL, 13, 6, STAY, NONE, 8 ; person
+ object SPRITE_POKE_BALL, 25, 21, STAY, NONE, 9, HP_UP
+ object SPRITE_POKE_BALL, 29, 5, STAY, NONE, 10, TM_MEGA_PUNCH
def_warps_to MT_MOON_B2F
diff --git a/data/maps/objects/MtMoonPokecenter.asm b/data/maps/objects/MtMoonPokecenter.asm
index 5648de6e..e94dd27d 100644
--- a/data/maps/objects/MtMoonPokecenter.asm
+++ b/data/maps/objects/MtMoonPokecenter.asm
@@ -14,5 +14,6 @@ MtMoonPokecenter_Object:
object SPRITE_MIDDLE_AGED_MAN, 10, 6, WALK, LEFT_RIGHT, 4 ; person
object SPRITE_CLIPBOARD, 7, 2, STAY, NONE, 5 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 6 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 7 ; person
def_warps_to MT_MOON_POKECENTER
diff --git a/data/maps/objects/OaksLab.asm b/data/maps/objects/OaksLab.asm
index e7f3701c..366fc894 100644
--- a/data/maps/objects/OaksLab.asm
+++ b/data/maps/objects/OaksLab.asm
@@ -9,15 +9,13 @@ OaksLab_Object:
def_objects
object SPRITE_BLUE, 4, 3, STAY, NONE, 1, OPP_RIVAL1, 1
- object SPRITE_POKE_BALL, 6, 3, STAY, NONE, 2 ; person
- object SPRITE_POKE_BALL, 7, 3, STAY, NONE, 3 ; person
- object SPRITE_POKE_BALL, 8, 3, STAY, NONE, 4 ; person
- object SPRITE_OAK, 5, 2, STAY, DOWN, 5 ; person
- object SPRITE_POKEDEX, 2, 1, STAY, NONE, 6 ; person
- object SPRITE_POKEDEX, 3, 1, STAY, NONE, 7 ; person
- object SPRITE_OAK, 5, 10, STAY, UP, 8 ; person
- object SPRITE_GIRL, 1, 9, WALK, UP_DOWN, 9 ; person
- object SPRITE_SCIENTIST, 2, 10, STAY, NONE, 10 ; person
- object SPRITE_SCIENTIST, 8, 10, STAY, NONE, 11 ; person
+ object SPRITE_POKE_BALL, 7, 3, STAY, NONE, 2 ; person
+ object SPRITE_OAK, 5, 2, STAY, DOWN, 3 ; person
+ object SPRITE_POKEDEX, 2, 1, STAY, NONE, 4 ; person
+ object SPRITE_POKEDEX, 3, 1, STAY, NONE, 5 ; person
+ object SPRITE_OAK, 5, 10, STAY, UP, 6 ; person
+ object SPRITE_GIRL, 1, 9, WALK, UP_DOWN, 7 ; person
+ object SPRITE_SCIENTIST, 2, 10, STAY, NONE, 8 ; person
+ object SPRITE_SCIENTIST, 8, 10, STAY, NONE, 9 ; person
def_warps_to OAKS_LAB
diff --git a/data/maps/objects/PalletTown.asm b/data/maps/objects/PalletTown.asm
index d362b2c9..c84dc921 100644
--- a/data/maps/objects/PalletTown.asm
+++ b/data/maps/objects/PalletTown.asm
@@ -13,7 +13,7 @@ PalletTown_Object:
sign 11, 5, 7 ; PalletTownText7
def_objects
- object SPRITE_OAK, 8, 5, STAY, NONE, 1 ; person
+ object SPRITE_OAK, 10, 4, STAY, NONE, 1 ; person
object SPRITE_GIRL, 3, 8, WALK, ANY_DIR, 2 ; person
object SPRITE_FISHER, 11, 14, WALK, ANY_DIR, 3 ; person
diff --git a/data/maps/objects/PewterPokecenter.asm b/data/maps/objects/PewterPokecenter.asm
index 8d41a155..e9a40d20 100644
--- a/data/maps/objects/PewterPokecenter.asm
+++ b/data/maps/objects/PewterPokecenter.asm
@@ -10,7 +10,9 @@ PewterPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_GENTLEMAN, 11, 7, STAY, LEFT, 2 ; person
- object SPRITE_FAIRY, 1, 3, STAY, DOWN, 3 ; person
+ object SPRITE_JIGGLYPUFF, 1, 3, STAY, DOWN, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_COOLTRAINER_F, 4, 3, STAY, UP, 5 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 6 ; person
def_warps_to PEWTER_POKECENTER
diff --git a/data/maps/objects/PokemonFanClub.asm b/data/maps/objects/PokemonFanClub.asm
index 19fbb129..eb3e945e 100644
--- a/data/maps/objects/PokemonFanClub.asm
+++ b/data/maps/objects/PokemonFanClub.asm
@@ -6,13 +6,11 @@ PokemonFanClub_Object:
warp 3, 7, 1, LAST_MAP
def_signs
- sign 1, 0, 7 ; FanClubText7
- sign 6, 0, 8 ; FanClubText8
def_objects
object SPRITE_FISHER, 6, 3, STAY, LEFT, 1 ; person
object SPRITE_GIRL, 1, 3, STAY, RIGHT, 2 ; person
- object SPRITE_FAIRY, 6, 4, STAY, LEFT, 3 ; person
+ object SPRITE_CLEFAIRY, 6, 4, STAY, LEFT, 3 ; person
object SPRITE_SEEL, 1, 4, STAY, RIGHT, 4 ; person
object SPRITE_GENTLEMAN, 3, 1, STAY, DOWN, 5 ; person
object SPRITE_LINK_RECEPTIONIST, 5, 1, STAY, DOWN, 6 ; person
diff --git a/data/maps/objects/PokemonTower7F.asm b/data/maps/objects/PokemonTower7F.asm
index 6d258f0d..e5fe486b 100644
--- a/data/maps/objects/PokemonTower7F.asm
+++ b/data/maps/objects/PokemonTower7F.asm
@@ -7,9 +7,8 @@ PokemonTower7F_Object:
def_signs
def_objects
- object SPRITE_ROCKET, 9, 11, STAY, RIGHT, 1, OPP_ROCKET, 19
- object SPRITE_ROCKET, 12, 9, STAY, LEFT, 2, OPP_ROCKET, 20
- object SPRITE_ROCKET, 9, 7, STAY, RIGHT, 3, OPP_ROCKET, 21
- object SPRITE_MR_FUJI, 10, 3, STAY, DOWN, 4 ; person
+ object SPRITE_JESSIE, 10, 8, STAY, DOWN, 1
+ object SPRITE_JAMES, 11, 8, STAY, DOWN, 2
+ object SPRITE_MR_FUJI, 10, 3, STAY, DOWN, 3
def_warps_to POKEMON_TOWER_7F
diff --git a/data/maps/objects/RedsHouse2F.asm b/data/maps/objects/RedsHouse2F.asm
index 826e68fd..2a254ec1 100644
--- a/data/maps/objects/RedsHouse2F.asm
+++ b/data/maps/objects/RedsHouse2F.asm
@@ -3,6 +3,12 @@ RedsHouse2F_Object:
def_warps
warp 7, 1, 2, REDS_HOUSE_1F
+IF DEF(_DEBUG)
+ warp 7, 2, 3, MT_MOON_B2F
+ warp 7, 3, 0, ROCKET_HIDEOUT_ELEVATOR
+ warp 7, 4, 0, POKEMON_TOWER_7F
+ warp 7, 5, 3, SILPH_CO_11F
+ENDC
def_signs
diff --git a/data/maps/objects/RockTunnelPokecenter.asm b/data/maps/objects/RockTunnelPokecenter.asm
index 4f5a1906..7b99d491 100644
--- a/data/maps/objects/RockTunnelPokecenter.asm
+++ b/data/maps/objects/RockTunnelPokecenter.asm
@@ -9,8 +9,9 @@ RockTunnelPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
- object SPRITE_GENTLEMAN, 7, 3, WALK, LEFT_RIGHT, 2 ; person
+ object SPRITE_GENTLEMAN, 7, 3, STAY, DOWN, 2 ; person
object SPRITE_FISHER, 2, 5, STAY, NONE, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to ROCK_TUNNEL_POKECENTER
diff --git a/data/maps/objects/RocketHideoutB4F.asm b/data/maps/objects/RocketHideoutB4F.asm
index 5dcf107f..3541befc 100644
--- a/data/maps/objects/RocketHideoutB4F.asm
+++ b/data/maps/objects/RocketHideoutB4F.asm
@@ -10,8 +10,8 @@ RocketHideoutB4F_Object:
def_objects
object SPRITE_GIOVANNI, 25, 3, STAY, DOWN, 1, OPP_GIOVANNI, 1
- object SPRITE_ROCKET, 23, 12, STAY, DOWN, 2, OPP_ROCKET, 16
- object SPRITE_ROCKET, 26, 12, STAY, DOWN, 3, OPP_ROCKET, 17
+ object SPRITE_JAMES, 25, 10, STAY, DOWN, 2
+ object SPRITE_JESSIE, 24, 10, STAY, DOWN, 3
object SPRITE_ROCKET, 11, 2, STAY, DOWN, 4, OPP_ROCKET, 18
object SPRITE_POKE_BALL, 10, 12, STAY, NONE, 5, HP_UP
object SPRITE_POKE_BALL, 9, 4, STAY, NONE, 6, TM_RAZOR_WIND
diff --git a/data/maps/objects/Route11.asm b/data/maps/objects/Route11.asm
index ce7d3490..0814aeb1 100644
--- a/data/maps/objects/Route11.asm
+++ b/data/maps/objects/Route11.asm
@@ -3,9 +3,9 @@ Route11_Object:
def_warps
warp 49, 8, 0, ROUTE_11_GATE_1F
- warp 49, 9, 1, ROUTE_11_GATE_1F
+ warp 49, 9, 0, ROUTE_11_GATE_1F
warp 58, 8, 2, ROUTE_11_GATE_1F
- warp 58, 9, 3, ROUTE_11_GATE_1F
+ warp 58, 9, 2, ROUTE_11_GATE_1F
warp 4, 5, 0, DIGLETTS_CAVE_ROUTE_11
def_signs
diff --git a/data/maps/objects/Route12.asm b/data/maps/objects/Route12.asm
index 22ac15e8..bdb74d68 100644
--- a/data/maps/objects/Route12.asm
+++ b/data/maps/objects/Route12.asm
@@ -3,7 +3,7 @@ Route12_Object:
def_warps
warp 10, 15, 0, ROUTE_12_GATE_1F
- warp 11, 15, 1, ROUTE_12_GATE_1F
+ warp 11, 15, 0, ROUTE_12_GATE_1F
warp 10, 21, 2, ROUTE_12_GATE_1F
warp 11, 77, 0, ROUTE_12_SUPER_ROD_HOUSE
diff --git a/data/maps/objects/Route15.asm b/data/maps/objects/Route15.asm
index d145dbfb..884e1704 100644
--- a/data/maps/objects/Route15.asm
+++ b/data/maps/objects/Route15.asm
@@ -3,9 +3,9 @@ Route15_Object:
def_warps
warp 7, 8, 0, ROUTE_15_GATE_1F
- warp 7, 9, 1, ROUTE_15_GATE_1F
+ warp 7, 9, 0, ROUTE_15_GATE_1F
warp 14, 8, 2, ROUTE_15_GATE_1F
- warp 14, 9, 3, ROUTE_15_GATE_1F
+ warp 14, 9, 2, ROUTE_15_GATE_1F
def_signs
sign 39, 9, 12 ; Route15Text12
diff --git a/data/maps/objects/Route16.asm b/data/maps/objects/Route16.asm
index 44e2de01..50a8a4bf 100644
--- a/data/maps/objects/Route16.asm
+++ b/data/maps/objects/Route16.asm
@@ -3,13 +3,13 @@ Route16_Object:
def_warps
warp 17, 10, 0, ROUTE_16_GATE_1F
- warp 17, 11, 1, ROUTE_16_GATE_1F
+ warp 17, 11, 0, ROUTE_16_GATE_1F
warp 24, 10, 2, ROUTE_16_GATE_1F
- warp 24, 11, 3, ROUTE_16_GATE_1F
+ warp 24, 11, 2, ROUTE_16_GATE_1F
warp 17, 4, 4, ROUTE_16_GATE_1F
- warp 17, 5, 5, ROUTE_16_GATE_1F
+ warp 17, 5, 4, ROUTE_16_GATE_1F
warp 24, 4, 6, ROUTE_16_GATE_1F
- warp 24, 5, 7, ROUTE_16_GATE_1F
+ warp 24, 5, 6, ROUTE_16_GATE_1F
warp 7, 5, 0, ROUTE_16_FLY_HOUSE
def_signs
diff --git a/data/maps/objects/Route18.asm b/data/maps/objects/Route18.asm
index eafdf1d0..cbb881fe 100644
--- a/data/maps/objects/Route18.asm
+++ b/data/maps/objects/Route18.asm
@@ -3,9 +3,9 @@ Route18_Object:
def_warps
warp 33, 8, 0, ROUTE_18_GATE_1F
- warp 33, 9, 1, ROUTE_18_GATE_1F
+ warp 33, 9, 0, ROUTE_18_GATE_1F
warp 40, 8, 2, ROUTE_18_GATE_1F
- warp 40, 9, 3, ROUTE_18_GATE_1F
+ warp 40, 9, 2, ROUTE_18_GATE_1F
def_signs
sign 43, 7, 4 ; Route18Text4
diff --git a/data/maps/objects/Route18Gate2F.asm b/data/maps/objects/Route18Gate2F.asm
index 2fa6fd58..a2080d46 100644
--- a/data/maps/objects/Route18Gate2F.asm
+++ b/data/maps/objects/Route18Gate2F.asm
@@ -9,6 +9,6 @@ Route18Gate2F_Object:
sign 6, 2, 3 ; Route18GateUpstairsText3
def_objects
- object SPRITE_YOUNGSTER, 4, 2, WALK, LEFT_RIGHT, 1 ; person
+ object SPRITE_COOK, 4, 2, WALK, LEFT_RIGHT, 1 ; person
def_warps_to ROUTE_18_GATE_2F
diff --git a/data/maps/objects/Route19.asm b/data/maps/objects/Route19.asm
index 224b2cbb..55511b21 100644
--- a/data/maps/objects/Route19.asm
+++ b/data/maps/objects/Route19.asm
@@ -2,17 +2,18 @@ Route19_Object:
db $43 ; border block
def_warps
+ warp 5, 9, 0, SUMMER_BEACH_HOUSE
def_signs
- sign 11, 9, 11 ; Route19Text11
+ sign 11, 11, 11
def_objects
- object SPRITE_COOLTRAINER_M, 8, 7, STAY, LEFT, 1, OPP_SWIMMER, 2
- object SPRITE_COOLTRAINER_M, 13, 7, STAY, LEFT, 2, OPP_SWIMMER, 3
+ object SPRITE_COOLTRAINER_M, 9, 7, STAY, RIGHT, 1, OPP_SWIMMER, 2
+ object SPRITE_COOLTRAINER_M, 12, 9, STAY, LEFT, 2, OPP_SWIMMER, 3
object SPRITE_SWIMMER, 13, 25, STAY, LEFT, 3, OPP_SWIMMER, 4
object SPRITE_SWIMMER, 4, 27, STAY, RIGHT, 4, OPP_SWIMMER, 5
object SPRITE_SWIMMER, 16, 31, STAY, UP, 5, OPP_SWIMMER, 6
- object SPRITE_SWIMMER, 9, 11, STAY, DOWN, 6, OPP_SWIMMER, 7
+ object SPRITE_SWIMMER, 9, 13, STAY, DOWN, 6, OPP_SWIMMER, 7
object SPRITE_SWIMMER, 8, 43, STAY, LEFT, 7, OPP_BEAUTY, 12
object SPRITE_SWIMMER, 11, 43, STAY, RIGHT, 8, OPP_BEAUTY, 13
object SPRITE_SWIMMER, 9, 42, STAY, UP, 9, OPP_SWIMMER, 8
diff --git a/data/maps/objects/Route2.asm b/data/maps/objects/Route2.asm
index 66f9ff1e..6977133b 100644
--- a/data/maps/objects/Route2.asm
+++ b/data/maps/objects/Route2.asm
@@ -8,6 +8,7 @@ Route2_Object:
warp 16, 35, 1, ROUTE_2_GATE
warp 15, 39, 2, ROUTE_2_GATE
warp 3, 43, 2, VIRIDIAN_FOREST_SOUTH_GATE
+ warp 17, 35, 1, ROUTE_2_GATE
def_signs
sign 5, 65, 3 ; Route2Text3
diff --git a/data/maps/objects/Route22Gate.asm b/data/maps/objects/Route22Gate.asm
index 68593daa..53944c52 100644
--- a/data/maps/objects/Route22Gate.asm
+++ b/data/maps/objects/Route22Gate.asm
@@ -5,7 +5,7 @@ Route22Gate_Object:
warp 4, 7, 0, LAST_MAP
warp 5, 7, 0, LAST_MAP
warp 4, 0, 0, LAST_MAP
- warp 5, 0, 1, LAST_MAP
+ warp 5, 0, 0, LAST_MAP
def_signs
diff --git a/data/maps/objects/Route24.asm b/data/maps/objects/Route24.asm
index d621e2b3..b3cf1298 100644
--- a/data/maps/objects/Route24.asm
+++ b/data/maps/objects/Route24.asm
@@ -14,5 +14,6 @@ Route24_Object:
object SPRITE_COOLTRAINER_F, 10, 28, STAY, RIGHT, 6, OPP_LASS, 8
object SPRITE_YOUNGSTER, 11, 31, STAY, LEFT, 7, OPP_BUG_CATCHER, 9
object SPRITE_POKE_BALL, 10, 5, STAY, NONE, 8, TM_THUNDER_WAVE
+ object SPRITE_COOLTRAINER_M, 6, 5, STAY, DOWN, 9
def_warps_to ROUTE_24
diff --git a/data/maps/objects/Route5.asm b/data/maps/objects/Route5.asm
index 75f4a629..98f76683 100644
--- a/data/maps/objects/Route5.asm
+++ b/data/maps/objects/Route5.asm
@@ -2,7 +2,7 @@ Route5_Object:
db $a ; border block
def_warps
- warp 10, 29, 3, ROUTE_5_GATE
+ warp 10, 29, 2, ROUTE_5_GATE
warp 9, 29, 2, ROUTE_5_GATE
warp 10, 33, 0, ROUTE_5_GATE
warp 17, 27, 0, UNDERGROUND_PATH_ROUTE_5
diff --git a/data/maps/objects/Route6.asm b/data/maps/objects/Route6.asm
index bafcdf90..f18c66f5 100644
--- a/data/maps/objects/Route6.asm
+++ b/data/maps/objects/Route6.asm
@@ -11,8 +11,8 @@ Route6_Object:
sign 19, 15, 7 ; Route6Text7
def_objects
- object SPRITE_COOLTRAINER_M, 10, 21, STAY, RIGHT, 1, OPP_JR_TRAINER_M, 4
- object SPRITE_COOLTRAINER_F, 11, 21, STAY, LEFT, 2, OPP_JR_TRAINER_F, 2
+ object SPRITE_COOLTRAINER_M, 10, 21, STAY, RIGHT, 1, OPP_JR_TRAINER_M, 10
+ object SPRITE_COOLTRAINER_F, 11, 21, STAY, LEFT, 2, OPP_JR_TRAINER_F, 25
object SPRITE_YOUNGSTER, 0, 15, STAY, RIGHT, 3, OPP_BUG_CATCHER, 10
object SPRITE_COOLTRAINER_M, 11, 31, STAY, LEFT, 4, OPP_JR_TRAINER_M, 5
object SPRITE_COOLTRAINER_F, 11, 30, STAY, LEFT, 5, OPP_JR_TRAINER_F, 3
diff --git a/data/maps/objects/Route7.asm b/data/maps/objects/Route7.asm
index d2346f2c..64b0387f 100644
--- a/data/maps/objects/Route7.asm
+++ b/data/maps/objects/Route7.asm
@@ -3,9 +3,9 @@ Route7_Object:
def_warps
warp 18, 9, 2, ROUTE_7_GATE
- warp 18, 10, 3, ROUTE_7_GATE
+ warp 18, 10, 2, ROUTE_7_GATE
warp 11, 9, 0, ROUTE_7_GATE
- warp 11, 10, 1, ROUTE_7_GATE
+ warp 11, 10, 0, ROUTE_7_GATE
warp 5, 13, 0, UNDERGROUND_PATH_ROUTE_7
def_signs
diff --git a/data/maps/objects/Route7Gate.asm b/data/maps/objects/Route7Gate.asm
index 2b165016..85064914 100644
--- a/data/maps/objects/Route7Gate.asm
+++ b/data/maps/objects/Route7Gate.asm
@@ -4,7 +4,7 @@ Route7Gate_Object:
def_warps
warp 0, 3, 3, LAST_MAP
warp 0, 4, 3, LAST_MAP
- warp 5, 3, 0, LAST_MAP
+ warp 5, 3, 1, LAST_MAP
warp 5, 4, 1, LAST_MAP
def_signs
diff --git a/data/maps/objects/Route8.asm b/data/maps/objects/Route8.asm
index d375b23e..aaa69ea2 100644
--- a/data/maps/objects/Route8.asm
+++ b/data/maps/objects/Route8.asm
@@ -3,9 +3,9 @@ Route8_Object:
def_warps
warp 1, 9, 0, ROUTE_8_GATE
- warp 1, 10, 1, ROUTE_8_GATE
+ warp 1, 10, 0, ROUTE_8_GATE
warp 8, 9, 2, ROUTE_8_GATE
- warp 8, 10, 3, ROUTE_8_GATE
+ warp 8, 10, 2, ROUTE_8_GATE
warp 13, 3, 0, UNDERGROUND_PATH_ROUTE_8
def_signs
diff --git a/data/maps/objects/Route8Gate.asm b/data/maps/objects/Route8Gate.asm
index f03530b5..64b935da 100644
--- a/data/maps/objects/Route8Gate.asm
+++ b/data/maps/objects/Route8Gate.asm
@@ -2,9 +2,9 @@ Route8Gate_Object:
db $a ; border block
def_warps
- warp 0, 3, 0, LAST_MAP
+ warp 0, 3, 1, LAST_MAP
warp 0, 4, 1, LAST_MAP
- warp 5, 3, 2, LAST_MAP
+ warp 5, 3, 3, LAST_MAP
warp 5, 4, 3, LAST_MAP
def_signs
diff --git a/data/maps/objects/Route9.asm b/data/maps/objects/Route9.asm
index 8d110629..f67f337b 100644
--- a/data/maps/objects/Route9.asm
+++ b/data/maps/objects/Route9.asm
@@ -8,7 +8,7 @@ Route9_Object:
def_objects
object SPRITE_COOLTRAINER_F, 13, 10, STAY, LEFT, 1, OPP_JR_TRAINER_F, 5
- object SPRITE_COOLTRAINER_M, 24, 7, STAY, LEFT, 2, OPP_JR_TRAINER_M, 7
+ object SPRITE_COOLTRAINER_M, 24, 7, STAY, LEFT, 2, OPP_YOUNGSTER, 14
object SPRITE_COOLTRAINER_M, 31, 7, STAY, RIGHT, 3, OPP_JR_TRAINER_M, 8
object SPRITE_COOLTRAINER_F, 48, 8, STAY, RIGHT, 4, OPP_JR_TRAINER_F, 6
object SPRITE_HIKER, 16, 15, STAY, LEFT, 5, OPP_HIKER, 11
diff --git a/data/maps/objects/SSAnne1FRooms.asm b/data/maps/objects/SSAnne1FRooms.asm
index 3a1fc459..afb30af4 100644
--- a/data/maps/objects/SSAnne1FRooms.asm
+++ b/data/maps/objects/SSAnne1FRooms.asm
@@ -19,7 +19,7 @@ SSAnne1FRooms_Object:
object SPRITE_GIRL, 22, 3, WALK, UP_DOWN, 5 ; person
object SPRITE_MIDDLE_AGED_MAN, 0, 14, STAY, NONE, 6 ; person
object SPRITE_LITTLE_GIRL, 2, 11, STAY, DOWN, 7 ; person
- object SPRITE_FAIRY, 3, 11, STAY, DOWN, 8 ; person
+ object SPRITE_JIGGLYPUFF, 3, 11, STAY, DOWN, 8 ; person
object SPRITE_GIRL, 10, 13, STAY, RIGHT, 9 ; person
object SPRITE_POKE_BALL, 12, 15, STAY, NONE, 10, TM_BODY_SLAM
object SPRITE_GENTLEMAN, 21, 13, WALK, LEFT_RIGHT, 11 ; person
diff --git a/data/maps/objects/SaffronCity.asm b/data/maps/objects/SaffronCity.asm
index f69b3333..49f94706 100644
--- a/data/maps/objects/SaffronCity.asm
+++ b/data/maps/objects/SaffronCity.asm
@@ -38,6 +38,5 @@ SaffronCity_Object:
object SPRITE_BIRD, 31, 12, STAY, DOWN, 12 ; person
object SPRITE_ROCKER, 18, 8, STAY, UP, 13 ; person
object SPRITE_ROCKET, 18, 22, STAY, DOWN, 14 ; person
- object SPRITE_ROCKET, 19, 22, STAY, DOWN, 15 ; person
def_warps_to SAFFRON_CITY
diff --git a/data/maps/objects/SaffronGym.asm b/data/maps/objects/SaffronGym.asm
index 9623440a..8cec0421 100644
--- a/data/maps/objects/SaffronGym.asm
+++ b/data/maps/objects/SaffronGym.asm
@@ -38,7 +38,7 @@ SaffronGym_Object:
def_signs
def_objects
- object SPRITE_GIRL, 9, 8, STAY, DOWN, 1, OPP_SABRINA, 1
+ object SPRITE_COOLTRAINER_F, 9, 8, STAY, DOWN, 1, OPP_SABRINA, 1
object SPRITE_CHANNELER, 10, 1, STAY, DOWN, 2, OPP_CHANNELER, 22
object SPRITE_YOUNGSTER, 17, 1, STAY, DOWN, 3, OPP_PSYCHIC_TR, 1
object SPRITE_CHANNELER, 3, 7, STAY, DOWN, 4, OPP_CHANNELER, 23
diff --git a/data/maps/objects/SaffronPokecenter.asm b/data/maps/objects/SaffronPokecenter.asm
index aa6161ca..ab52a72c 100644
--- a/data/maps/objects/SaffronPokecenter.asm
+++ b/data/maps/objects/SaffronPokecenter.asm
@@ -12,5 +12,6 @@ SaffronPokecenter_Object:
object SPRITE_BEAUTY, 5, 5, STAY, NONE, 2 ; person
object SPRITE_GENTLEMAN, 8, 3, STAY, DOWN, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to SAFFRON_POKECENTER
diff --git a/data/maps/objects/SeafoamIslands1F.asm b/data/maps/objects/SeafoamIslands1F.asm
index 3d92f199..913ca7c7 100644
--- a/data/maps/objects/SeafoamIslands1F.asm
+++ b/data/maps/objects/SeafoamIslands1F.asm
@@ -17,7 +17,3 @@ SeafoamIslands1F_Object:
object SPRITE_BOULDER, 26, 7, STAY, BOULDER_MOVEMENT_BYTE_2, 2 ; person
def_warps_to SEAFOAM_ISLANDS_1F
-
- ; holes
- warp_to 17, 6, SEAFOAM_ISLANDS_1F_WIDTH
- warp_to 24, 6, SEAFOAM_ISLANDS_1F_WIDTH
diff --git a/data/maps/objects/SilphCo11F.asm b/data/maps/objects/SilphCo11F.asm
index fd1167f0..dab1144c 100644
--- a/data/maps/objects/SilphCo11F.asm
+++ b/data/maps/objects/SilphCo11F.asm
@@ -13,7 +13,8 @@ SilphCo11F_Object:
object SPRITE_SILPH_PRESIDENT, 7, 5, STAY, DOWN, 1 ; person
object SPRITE_BEAUTY, 10, 5, STAY, DOWN, 2 ; person
object SPRITE_GIOVANNI, 6, 9, STAY, DOWN, 3, OPP_GIOVANNI, 2
- object SPRITE_ROCKET, 3, 16, STAY, UP, 4, OPP_ROCKET, 41
+ object SPRITE_JAMES, 2, 8, STAY, UP, 4
object SPRITE_ROCKET, 15, 9, STAY, UP, 5, OPP_ROCKET, 40
+ object SPRITE_JESSIE, 3, 8, STAY, UP, 6
def_warps_to SILPH_CO_11F
diff --git a/data/maps/objects/SummerBeachHouse.asm b/data/maps/objects/SummerBeachHouse.asm
new file mode 100644
index 00000000..c503b8a7
--- /dev/null
+++ b/data/maps/objects/SummerBeachHouse.asm
@@ -0,0 +1,18 @@
+SummerBeachHouse_Object:
+ db $a ; border block
+
+ def_warps
+ warp 2, 7, 0, LAST_MAP
+ warp 3, 7, 0, LAST_MAP
+
+ def_signs
+ sign 3, 0, 3
+ sign 7, 0, 4
+ sign 11, 0, 5
+ sign 13, 1, 6
+
+ def_objects
+ object SPRITE_FISHING_GURU, 2, 3, STAY, DOWN, 1 ; surfin' dude
+ object SPRITE_PIKACHU, 5, 3, WALK, 1, 2 ; pikachu
+
+ def_warps_to SUMMER_BEACH_HOUSE
diff --git a/data/maps/objects/VermilionCity.asm b/data/maps/objects/VermilionCity.asm
index 1b989ad7..3ea219c3 100644
--- a/data/maps/objects/VermilionCity.asm
+++ b/data/maps/objects/VermilionCity.asm
@@ -13,20 +13,21 @@ VermilionCity_Object:
warp 7, 3, 0, VERMILION_OLD_ROD_HOUSE
def_signs
- sign 27, 3, 7 ; VermilionCityText7
- sign 37, 13, 8 ; VermilionCityText8
- sign 24, 13, 9 ; MartSignText
- sign 12, 3, 10 ; PokeCenterSignText
- sign 7, 13, 11 ; VermilionCityText11
- sign 7, 19, 12 ; VermilionCityText12
- sign 29, 15, 13 ; VermilionCityText13
+ sign 27, 3, 8 ; VermilionCityText7
+ sign 37, 13, 9 ; VermilionCityText8
+ sign 24, 13, 10 ; MartSignText
+ sign 12, 3, 11 ; PokeCenterSignText
+ sign 7, 13, 12 ; VermilionCityText11
+ sign 7, 19, 13 ; VermilionCityText12
+ sign 29, 15, 14 ; VermilionCityText13
def_objects
- object SPRITE_BEAUTY, 19, 7, WALK, LEFT_RIGHT, 1 ; person
+ object SPRITE_COOLTRAINER_F, 19, 7, WALK, LEFT_RIGHT, 1 ; person
object SPRITE_GAMBLER, 14, 6, STAY, NONE, 2 ; person
object SPRITE_SAILOR, 19, 30, STAY, UP, 3 ; person
object SPRITE_GAMBLER, 30, 7, STAY, NONE, 4 ; person
object SPRITE_MONSTER, 29, 9, WALK, UP_DOWN, 5 ; person
object SPRITE_SAILOR, 25, 27, WALK, LEFT_RIGHT, 6 ; person
+ object SPRITE_OFFICER_JENNY, 19, 15, STAY, NONE, 7 ; person
def_warps_to VERMILION_CITY
diff --git a/data/maps/objects/VermilionPokecenter.asm b/data/maps/objects/VermilionPokecenter.asm
index e656b80c..f52bf24e 100644
--- a/data/maps/objects/VermilionPokecenter.asm
+++ b/data/maps/objects/VermilionPokecenter.asm
@@ -12,5 +12,6 @@ VermilionPokecenter_Object:
object SPRITE_FISHING_GURU, 10, 5, STAY, NONE, 2 ; person
object SPRITE_SAILOR, 5, 4, STAY, NONE, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to VERMILION_POKECENTER
diff --git a/data/maps/objects/VermilionTradeHouse.asm b/data/maps/objects/VermilionTradeHouse.asm
index ec60415f..5eace66e 100644
--- a/data/maps/objects/VermilionTradeHouse.asm
+++ b/data/maps/objects/VermilionTradeHouse.asm
@@ -8,6 +8,6 @@ VermilionTradeHouse_Object:
def_signs
def_objects
- object SPRITE_LITTLE_GIRL, 3, 5, STAY, UP, 1 ; person
+ object SPRITE_GENTLEMAN, 3, 5, STAY, UP, 1 ; person
def_warps_to VERMILION_TRADE_HOUSE
diff --git a/data/maps/objects/ViridianCity.asm b/data/maps/objects/ViridianCity.asm
index c4ee9b69..9e3e30bb 100644
--- a/data/maps/objects/ViridianCity.asm
+++ b/data/maps/objects/ViridianCity.asm
@@ -9,12 +9,12 @@ ViridianCity_Object:
warp 32, 7, 0, VIRIDIAN_GYM
def_signs
- sign 17, 17, 8 ; ViridianCityText8
- sign 19, 1, 9 ; ViridianCityText9
- sign 21, 29, 10 ; ViridianCityText10
- sign 30, 19, 11 ; MartSignText
- sign 24, 25, 12 ; PokeCenterSignText
- sign 27, 7, 13 ; ViridianCityText13
+ sign 17, 17, 9 ; ViridianCityText8
+ sign 19, 1, 10 ; ViridianCityText9
+ sign 21, 29, 11 ; ViridianCityText10
+ sign 30, 19, 12 ; MartSignText
+ sign 24, 25, 13 ; PokeCenterSignText
+ sign 27, 7, 14 ; ViridianCityText13
def_objects
object SPRITE_YOUNGSTER, 13, 20, WALK, ANY_DIR, 1 ; person
@@ -24,5 +24,6 @@ ViridianCity_Object:
object SPRITE_GAMBLER_ASLEEP, 18, 9, STAY, NONE, 5 ; person
object SPRITE_FISHER, 6, 23, STAY, DOWN, 6 ; person
object SPRITE_GAMBLER, 17, 5, WALK, LEFT_RIGHT, 7 ; person
+ object SPRITE_GAMBLER, 18, 9, STAY, NONE, 8
def_warps_to VIRIDIAN_CITY
diff --git a/data/maps/objects/ViridianForest.asm b/data/maps/objects/ViridianForest.asm
index 22d0b67a..56d48f6d 100644
--- a/data/maps/objects/ViridianForest.asm
+++ b/data/maps/objects/ViridianForest.asm
@@ -3,28 +3,30 @@ ViridianForest_Object:
def_warps
warp 1, 0, 2, VIRIDIAN_FOREST_NORTH_GATE
- warp 2, 0, 3, VIRIDIAN_FOREST_NORTH_GATE
+ warp 2, 0, 2, VIRIDIAN_FOREST_NORTH_GATE
warp 15, 47, 1, VIRIDIAN_FOREST_SOUTH_GATE
warp 16, 47, 1, VIRIDIAN_FOREST_SOUTH_GATE
warp 17, 47, 1, VIRIDIAN_FOREST_SOUTH_GATE
warp 18, 47, 1, VIRIDIAN_FOREST_SOUTH_GATE
def_signs
- sign 24, 40, 9 ; ViridianForestText9
- sign 16, 32, 10 ; ViridianForestText10
- sign 26, 17, 11 ; ViridianForestText11
- sign 4, 24, 12 ; ViridianForestText12
- sign 18, 45, 13 ; ViridianForestText13
- sign 2, 1, 14 ; ViridianForestText14
+ sign 24, 40, 11 ; ViridianForestText9
+ sign 16, 32, 12 ; ViridianForestText10
+ sign 26, 17, 13 ; ViridianForestText11
+ sign 4, 24, 14 ; ViridianForestText12
+ sign 18, 45, 15 ; ViridianForestText13
+ sign 2, 1, 16 ; ViridianForestText14
def_objects
object SPRITE_YOUNGSTER, 16, 43, STAY, NONE, 1 ; person
object SPRITE_YOUNGSTER, 30, 33, STAY, LEFT, 2, OPP_BUG_CATCHER, 1
object SPRITE_YOUNGSTER, 30, 19, STAY, LEFT, 3, OPP_BUG_CATCHER, 2
object SPRITE_YOUNGSTER, 2, 18, STAY, LEFT, 4, OPP_BUG_CATCHER, 3
- object SPRITE_POKE_BALL, 25, 11, STAY, NONE, 5, ANTIDOTE
- object SPRITE_POKE_BALL, 12, 29, STAY, NONE, 6, POTION
- object SPRITE_POKE_BALL, 1, 31, STAY, NONE, 7, POKE_BALL
- object SPRITE_YOUNGSTER, 27, 40, STAY, NONE, 8 ; person
+ object SPRITE_COOLTRAINER_F, 2, 41, STAY, NONE, 5, OPP_LASS, 19
+ object SPRITE_YOUNGSTER, 13, 17, STAY, RIGHT, 6, OPP_BUG_CATCHER, 15
+ object SPRITE_POKE_BALL, 25, 11, STAY, NONE, 7, POTION
+ object SPRITE_POKE_BALL, 12, 29, STAY, NONE, 8, POTION
+ object SPRITE_POKE_BALL, 1, 31, STAY, NONE, 9, POKE_BALL
+ object SPRITE_YOUNGSTER, 27, 40, STAY, NONE, 10 ; person
def_warps_to VIRIDIAN_FOREST
diff --git a/data/maps/objects/ViridianForestSouthGate.asm b/data/maps/objects/ViridianForestSouthGate.asm
index 3693e7ec..c73205cd 100644
--- a/data/maps/objects/ViridianForestSouthGate.asm
+++ b/data/maps/objects/ViridianForestSouthGate.asm
@@ -3,7 +3,7 @@ ViridianForestSouthGate_Object:
def_warps
warp 4, 0, 3, VIRIDIAN_FOREST
- warp 5, 0, 4, VIRIDIAN_FOREST
+ warp 5, 0, 3, VIRIDIAN_FOREST
warp 4, 7, 5, LAST_MAP
warp 5, 7, 5, LAST_MAP
diff --git a/data/maps/objects/ViridianPokecenter.asm b/data/maps/objects/ViridianPokecenter.asm
index 889281e1..ef510f72 100644
--- a/data/maps/objects/ViridianPokecenter.asm
+++ b/data/maps/objects/ViridianPokecenter.asm
@@ -10,7 +10,8 @@ ViridianPokecenter_Object:
def_objects
object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person
object SPRITE_GENTLEMAN, 10, 5, WALK, UP_DOWN, 2 ; person
- object SPRITE_COOLTRAINER_M, 4, 3, STAY, NONE, 3 ; person
+ object SPRITE_COOLTRAINER_M, 4, 3, STAY, UP, 3 ; person
object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person
+ object SPRITE_CHANSEY, 4, 1, STAY, DOWN, 5 ; person
def_warps_to VIRIDIAN_POKECENTER
diff --git a/data/maps/objects/ViridianSchoolHouse.asm b/data/maps/objects/ViridianSchoolHouse.asm
index 8f228632..632baaba 100644
--- a/data/maps/objects/ViridianSchoolHouse.asm
+++ b/data/maps/objects/ViridianSchoolHouse.asm
@@ -10,5 +10,6 @@ ViridianSchoolHouse_Object:
def_objects
object SPRITE_BRUNETTE_GIRL, 3, 5, STAY, UP, 1 ; person
object SPRITE_COOLTRAINER_F, 4, 1, STAY, DOWN, 2 ; person
+ object SPRITE_LITTLE_GIRL, 4, 5, STAY, UP, 3 ; person
def_warps_to VIRIDIAN_SCHOOL_HOUSE
diff --git a/data/maps/songs.asm b/data/maps/songs.asm
index 111b87b8..7378804e 100644
--- a/data/maps/songs.asm
+++ b/data/maps/songs.asm
@@ -63,7 +63,7 @@ MapSongBanks::
db MUSIC_DUNGEON3, BANK(Music_Dungeon3) ; MT_MOON_B1F
db MUSIC_DUNGEON3, BANK(Music_Dungeon3) ; MT_MOON_B2F
db MUSIC_CITIES2, BANK(Music_Cities2) ; CERULEAN_TRASHED_HOUSE
- db MUSIC_CITIES2, BANK(Music_Cities2) ; CERULEAN_TRADE_HOUSE
+ db MUSIC_CITIES2, BANK(Music_Cities2) ; CERULEAN_MELANIES_HOUSE
db MUSIC_POKECENTER, BANK(Music_Pokecenter) ; CERULEAN_POKECENTER
db MUSIC_GYM, BANK(Music_Gym) ; CERULEAN_GYM
db MUSIC_CITIES2, BANK(Music_Cities2) ; BIKE_SHOP
@@ -248,4 +248,5 @@ MapSongBanks::
db MUSIC_GYM, BANK(Music_Gym) ; LORELEIS_ROOM
db MUSIC_DUNGEON1, BANK(Music_Dungeon1) ; BRUNOS_ROOM
db MUSIC_POKEMON_TOWER, BANK(Music_PokemonTower) ; AGATHAS_ROOM
+ db MUSIC_ROUTES3, BANK(Music_Routes3) ; SUMMER_BEACH_HOUSE
assert_table_length NUM_MAPS
diff --git a/data/maps/sprite_sets.asm b/data/maps/sprite_sets.asm
index 6aad2958..b42e9245 100644
--- a/data/maps/sprite_sets.asm
+++ b/data/maps/sprite_sets.asm
@@ -68,13 +68,13 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $01
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_BLUE
db SPRITE_YOUNGSTER
db SPRITE_GIRL
db SPRITE_FISHER
db SPRITE_COOLTRAINER_M
db SPRITE_GAMBLER
- db SPRITE_SEEL
db SPRITE_OAK
db SPRITE_SWIMMER
db SPRITE_POKE_BALL
@@ -83,13 +83,13 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $02
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_YOUNGSTER
db SPRITE_ROCKET
db SPRITE_SUPER_NERD
db SPRITE_HIKER
- db SPRITE_MONSTER
db SPRITE_BLUE
- db SPRITE_GUARD
+ db SPRITE_OFFICER_JENNY
db SPRITE_COOLTRAINER_F
db SPRITE_COOLTRAINER_M
db SPRITE_POKE_BALL
@@ -98,6 +98,7 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $03
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_LITTLE_GIRL
db SPRITE_GIRL
db SPRITE_SUPER_NERD
@@ -106,19 +107,18 @@ SPRITE_SET_LENGTH EQU 9 + 2
db SPRITE_MONSTER
db SPRITE_COOLTRAINER_F
db SPRITE_COOLTRAINER_M
- db SPRITE_GUARD
db SPRITE_POKE_BALL
db SPRITE_UNUSED_GAMBLER_ASLEEP_2
assert_table_length SPRITE_SET_LENGTH
; sprite set $04
table_width 1
- db SPRITE_BEAUTY
+ db SPRITE_PIKACHU
+ db SPRITE_OFFICER_JENNY
db SPRITE_SUPER_NERD
db SPRITE_YOUNGSTER
db SPRITE_GAMBLER
db SPRITE_MONSTER
- db SPRITE_GUARD
db SPRITE_SAILOR
db SPRITE_COOLTRAINER_F
db SPRITE_COOLTRAINER_M
@@ -128,6 +128,7 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $05
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_LITTLE_GIRL
db SPRITE_LITTLE_BOY
db SPRITE_GIRL
@@ -135,7 +136,6 @@ SPRITE_SET_LENGTH EQU 9 + 2
db SPRITE_MIDDLE_AGED_MAN
db SPRITE_GRAMPS
db SPRITE_MONSTER
- db SPRITE_GUARD
db SPRITE_ROCKET
db SPRITE_POKE_BALL
db SPRITE_SNORLAX
@@ -143,7 +143,7 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $06
table_width 1
- db SPRITE_YOUNGSTER
+ db SPRITE_PIKACHU
db SPRITE_GYM_GUIDE
db SPRITE_MONSTER
db SPRITE_BLUE
@@ -158,6 +158,7 @@ SPRITE_SET_LENGTH EQU 9 + 2
; sprite set $07
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_ROCKET
db SPRITE_SCIENTIST
db SPRITE_SILPH_WORKER
@@ -166,13 +167,13 @@ SPRITE_SET_LENGTH EQU 9 + 2
db SPRITE_BIRD
db SPRITE_ROCKER
db SPRITE_COOLTRAINER_M
- db SPRITE_MONSTER
db SPRITE_POKE_BALL
db SPRITE_UNUSED_GAMBLER_ASLEEP_2
assert_table_length SPRITE_SET_LENGTH
; sprite set $08
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_BIKER
db SPRITE_SUPER_NERD
db SPRITE_MIDDLE_AGED_MAN
@@ -181,13 +182,13 @@ SPRITE_SET_LENGTH EQU 9 + 2
db SPRITE_BEAUTY
db SPRITE_FISHER
db SPRITE_ROCKER
- db SPRITE_MONSTER
db SPRITE_POKE_BALL
db SPRITE_SNORLAX
assert_table_length SPRITE_SET_LENGTH
; sprite set $09
table_width 1
+ db SPRITE_PIKACHU
db SPRITE_BIKER
db SPRITE_COOLTRAINER_M
db SPRITE_SILPH_WORKER
@@ -196,16 +197,15 @@ SPRITE_SET_LENGTH EQU 9 + 2
db SPRITE_HIKER
db SPRITE_GAMBLER
db SPRITE_MIDDLE_AGED_MAN
- db SPRITE_SUPER_NERD
db SPRITE_POKE_BALL
db SPRITE_SNORLAX
assert_table_length SPRITE_SET_LENGTH
; sprite set $0a
table_width 1
- db SPRITE_BIRD
+ db SPRITE_PIKACHU
db SPRITE_COOLTRAINER_M
- db SPRITE_FAIRY
+ db SPRITE_CHANSEY
db SPRITE_FISHER
db SPRITE_GAMBLER
db SPRITE_MONSTER
diff --git a/data/maps/town_map_entries.asm b/data/maps/town_map_entries.asm
index fdec1e15..954a3ee9 100644
--- a/data/maps/town_map_entries.asm
+++ b/data/maps/town_map_entries.asm
@@ -116,4 +116,5 @@ InternalMapEntries:
internal_map ROCK_TUNNEL_B1F, 14, 3, RockTunnelName
internal_map SILPH_CO_ELEVATOR, 10, 5, SilphCoName
internal_map AGATHAS_ROOM, 0, 2, PokemonLeagueName
+ internal_map SUMMER_BEACH_HOUSE, 6, 15, Route19Name
db -1 ; end
diff --git a/data/moves/animations.asm b/data/moves/animations.asm
index 0d8a2bd4..15f1ad52 100644
--- a/data/moves/animations.asm
+++ b/data/moves/animations.asm
@@ -204,7 +204,6 @@ AttackAnimationPointers:
dw ThrowRockAnim
dw ThrowBaitAnim
assert_table_length NUM_ATTACK_ANIMS
- dw ZigZagScreenAnim
; each animation is a list of subanimations
; and/or special effects, terminated by -1
@@ -225,10 +224,6 @@ battle_anim: MACRO
ENDC
ENDM
-ZigZagScreenAnim:
- battle_anim NO_MOVE, SE_WAVY_SCREEN
- db -1 ; end
-
PoundAnim:
StruggleAnim:
battle_anim POUND, SUBANIM_01, 0, 8
diff --git a/data/moves/grammar.asm b/data/moves/grammar.asm
index bc3d1dc6..e44b1abc 100644
--- a/data/moves/grammar.asm
+++ b/data/moves/grammar.asm
@@ -6,7 +6,6 @@ ExclamationPointMoveSets:
; set 1
db RECOVER
- db BIDE
db SELFDESTRUCT
db AMNESIA
db 0 ; end set
@@ -17,6 +16,7 @@ ExclamationPointMoveSets:
db TELEPORT
db MIMIC
db DOUBLE_TEAM
+ db BIDE ; corrected JP grammar: moved from set 1 in pokered
db BARRAGE
db 0 ; end set
diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm
index 6b279f5a..0e4a79af 100644
--- a/data/moves/tmhm_moves.asm
+++ b/data/moves/tmhm_moves.asm
@@ -13,3 +13,5 @@ FOR n, 1, NUM_HMS + 1
db HM{02d:n}_MOVE
ENDR
assert_table_length NUM_TM_HM
+
+ db -1 ; end
diff --git a/data/pikachu/pikachu_emotions.asm b/data/pikachu/pikachu_emotions.asm
new file mode 100644
index 00000000..f72beaa4
--- /dev/null
+++ b/data/pikachu/pikachu_emotions.asm
@@ -0,0 +1,266 @@
+PikachuEmotion0:
+ db $ff
+
+PikachuEmotion2:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble SMILE_BUBBLE
+ pikaemotion_pcm PikachuCry35
+ pikaemotion_pikapic PikaPicAnimScript2
+ db $ff
+
+PikachuEmotion10:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_emotebubble HEART_BUBBLE
+ pikaemotion_pcm PikachuCry5
+ pikaemotion_pikapic PikaPicAnimScript10
+ db $ff
+
+PikachuEmotion7:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_movement PikachuMovementData_fd224
+ pikaemotion_pcm PikachuCry1
+ pikaemotion_movement PikachuMovementData_fd224
+ pikaemotion_pikapic PikaPicAnimScript7
+ db $ff
+
+PikachuEmotion4:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_movement PikachuMovementData_fd230
+ pikaemotion_pcm PikachuCry29
+ pikaemotion_pikapic PikaPicAnimScript4
+ db $ff
+
+PikachuEmotion1:
+ pikaemotion_dummy2
+ pikaemotion_pcm
+ pikaemotion_pikapic PikaPicAnimScript1
+ db $ff
+
+PikachuEmotion8:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry39
+ pikaemotion_pikapic PikaPicAnimScript8
+ db $ff
+
+PikachuEmotion5:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry31
+ pikaemotion_pikapic PikaPicAnimScript5
+ db $ff
+
+PikachuEmotion6:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_pcm
+ pikaemotion_movement PikachuMovementData_fd21e
+ pikaemotion_emotebubble SKULL_BUBBLE
+ pikaemotion_pikapic PikaPicAnimScript6
+ db $ff
+
+PikachuEmotion3:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry40
+ pikaemotion_pikapic PikaPicAnimScript3
+ db $ff
+
+PikachuEmotion9:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_pcm PikachuCry6
+ pikaemotion_movement PikachuMovementData_fd218
+ pikaemotion_emotebubble SKULL_BUBBLE
+ pikaemotion_pikapic PikaPicAnimScript9
+ db $ff
+
+PikachuEmotion11:
+ pikaemotion_emotebubble ZZZ_BUBBLE
+ pikaemotion_pcm PikachuCry37
+ pikaemotion_pikapic PikaPicAnimScript11
+ db $ff
+
+PikachuEmotion12:
+ pikaemotion_dummy2
+ pikaemotion_pcm
+ pikaemotion_pikapic PikaPicAnimScript12
+ db $ff
+
+PikachuEmotion13:
+ pikaemotion_dummy2
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES
+ pikaemotion_movement PikachuMovementData_fd21e
+ pikaemotion_pikapic PikaPicAnimScript13
+ db $ff
+
+PikachuEmotion14:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble BOLT_BUBBLE
+ pikaemotion_pcm PikachuCry10
+ pikaemotion_pikapic PikaPicAnimScript14
+ db $ff
+
+PikachuEmotion15:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry34
+ pikaemotion_pikapic PikaPicAnimScript15
+ db $ff
+
+PikachuEmotion16:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry33
+ pikaemotion_pikapic PikaPicAnimScript16
+ db $ff
+
+PikachuEmotion17:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry13
+ pikaemotion_pikapic PikaPicAnimScript17
+ db $ff
+
+PikachuEmotion18:
+ pikaemotion_dummy2
+ pikaemotion_pcm
+ pikaemotion_pikapic PikaPicAnimScript18
+ db $ff
+
+PikachuEmotion19:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble HEART_BUBBLE
+ pikaemotion_pcm PikachuCry33
+ pikaemotion_pikapic PikaPicAnimScript19
+ db $ff
+
+PikachuEmotion20:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble HEART_BUBBLE
+ pikaemotion_pcm PikachuCry5
+ pikaemotion_pikapic PikaPicAnimScript20
+ db $ff
+
+PikachuEmotion21:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble FISH_BUBBLE
+ pikaemotion_pcm
+ pikaemotion_pikapic PikaPicAnimScript21
+ db $ff
+
+PikachuEmotion22:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry4
+ pikaemotion_pikapic PikaPicAnimScript22
+ db $ff
+
+PikachuEmotion23:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry19
+ pikaemotion_pikapic PikaPicAnimScript23
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW
+ db $ff
+
+PikachuEmotion24:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble EXCLAMATION_BUBBLE
+ pikaemotion_pcm
+ pikaemotion_pikapic PikaPicAnimScript24
+ db $ff
+
+PikachuEmotion25:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble BOLT_BUBBLE
+ pikaemotion_pcm PikachuCry35
+ pikaemotion_pikapic PikaPicAnimScript25
+ db $ff
+
+PikachuEmotion26:
+ pikaemotion_dummy2
+ pikaemotion_emotebubble ZZZ_BUBBLE
+ pikaemotion_pcm PikachuCry37
+ pikaemotion_pikapic PikaPicAnimScript26
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKPEWTERCENTER
+ db $ff
+
+PikachuEmotion27:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry9
+ pikaemotion_pikapic PikaPicAnimScript27
+ db $ff
+
+PikachuEmotion28:
+ pikaemotion_dummy2
+ pikaemotion_pcm PikachuCry15
+ pikaemotion_pikapic PikaPicAnimScript28
+ db $ff
+
+PikachuEmotion29:
+ pikaemotion_pcm PikachuCry5
+ pikaemotion_pikapic PikaPicAnimScript10
+ db $ff
+
+PikachuEmotion30:
+ pikaemotion_9
+ pikaemotion_emotebubble HEART_BUBBLE
+ pikaemotion_pcm PikachuCry5
+ pikaemotion_pikapic PikaPicAnimScript20
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADFONT
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKLAVENDERTOWER
+ db $ff
+
+PikachuEmotion31:
+ pikaemotion_pcm PikachuCry19
+ pikaemotion_pikapic PikaPicAnimScript23
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW
+ pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKBILLSHOUSE
+ db $ff
+
+PikachuEmotion32:
+ pikaemotion_pcm PikachuCry26
+ pikaemotion_pikapic PikaPicAnimScript23
+ db $ff
+
+PikachuMovementData_fd218:
+ db $00
+ db $39, 2 - 1
+ db $3e, 31 - 1
+ db $3f
+
+PikachuMovementData_fd21e:
+ db $00
+ db $39, 1 - 1
+ db $3e, 31 - 1
+ db $3f
+
+PikachuMovementData_fd224:
+ db $00
+ db $3c, 8 - 1, (2 << 4) | (16 - 1)
+ db $3c, 8 - 1, (2 << 4) | (16 - 1)
+ db $3f
+
+PikachuMovementData_fd22c:
+ db $3b, 32 - 1, 4 - 1
+ db $3f
+
+PikachuMovementData_fd230:
+ db $00
+ db $3c, 16 - 1, (1 << 4) | (16 - 1)
+ db $3c, 16 - 1, (1 << 4) | (16 - 1)
+ db $3f
+
+PikachuMovementData_fd238:
+ db $00
+ db $05, 8 - 1
+ db $39, 1 - 1
+ db $05, 8 - 1
+ db $06, 8 - 1
+ db $39, 1 - 1
+ db $06, 8 - 1
+ db $08, 8 - 1
+ db $39, 1 - 1
+ db $08, 8 - 1
+ db $07, 8 - 1
+ db $39, 1 - 1
+ db $07, 8 - 1
+ db $3f
diff --git a/data/pikachu/pikachu_pic_animation.asm b/data/pikachu/pikachu_pic_animation.asm
new file mode 100644
index 00000000..89eedc8d
--- /dev/null
+++ b/data/pikachu/pikachu_pic_animation.asm
@@ -0,0 +1,403 @@
+PikaPicAnimThunderboltPals:
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db 4, %11000000
+ db 4, %11100100
+ db -1 ; end
+
+Data_fe26b:
+ pikapic_loadgfx Pic_e4000
+ pikapic_loadgfx Pic_e49d1
+ pikapic_loadgfx PikachuSprite
+ pikapic_animation PikaPicAnimBGFrames_1, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_2, $b2, $5, $5
+ pikapic_animation PikaPicAnimBGFrames_3, $b6, $5, $5
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript0:
+PikaPicAnimScript1:
+PikaPicAnimScript29:
+ pikapic_setduration 40
+ pikapic_loadgfx Pic_e4000
+ pikapic_loadgfx GFX_e40cc
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_6, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry PikachuCry3
+ pikapic_looptofinish
+
+PikaPicAnimScript2:
+ pikapic_setduration 44
+ pikapic_loadgfx Pic_e411c
+ pikapic_loadgfx GFX_e41d2
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_7, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript3:
+ pikapic_setduration 80
+ pikapic_loadgfx Pic_e4272
+ pikapic_loadgfx GFX_e4323
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_8, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript4:
+ pikapic_setduration 70
+ pikapic_loadgfx Pic_e4383
+ pikapic_loadgfx GFX_e444b
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_9, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript5:
+ pikapic_setduration 32
+ pikapic_loadgfx Pic_e458b
+ pikapic_loadgfx GFX_e463b
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_10, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript6:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e467b
+ pikapic_loadgfx GFX_e472e
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_11, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry PikachuCry38
+ pikapic_looptofinish
+
+PikaPicAnimScript7:
+ pikapic_setduration 58
+ pikapic_loadgfx Pic_e476e
+ pikapic_loadgfx GFX_e4841
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_12, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript8:
+ pikapic_setduration 44
+ pikapic_loadgfx Pic_e49d1
+ pikapic_loadgfx GFX_e4a99
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_13, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript9:
+ pikapic_setduration 56
+ pikapic_loadgfx Pic_e4b39
+ pikapic_loadgfx GFX_e4bde
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_14, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript10:
+ pikapic_setduration 56
+ pikapic_loadgfx Pic_e4c3e
+ pikapic_loadgfx GFX_e4ce0
+ pikapic_loadgfx GFX_e4e70
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_16, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript11:
+ pikapic_setduration 100
+ pikapic_loadgfx Pic_e5000
+ pikapic_loadgfx GFX_e50af
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_17, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript12:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e523f
+ pikapic_loadgfx GFX_e52fe
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_18, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry PikachuCry25
+ pikapic_looptofinish
+
+PikaPicAnimScript13:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e548e
+ pikapic_loadgfx GFX_e5541
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_19, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript14:
+ pikapic_setduration 40
+ pikapic_loadgfx Pic_e56d1
+ pikapic_loadgfx GFX_e5794
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_20, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript15:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e5924
+ pikapic_loadgfx GFX_e59ed
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_21, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript16:
+ pikapic_setduration 32
+ pikapic_loadgfx Pic_e5b7d
+ pikapic_loadgfx GFX_e5c4d
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_22, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript17:
+ pikapic_setduration 100
+ pikapic_loadgfx Pic_e5ddd
+ pikapic_loadgfx GFX_e5e90
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_23, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript18:
+ pikapic_setduration 32
+ pikapic_loadgfx GFX_e6020
+ pikapic_loadgfx GFX_e61b0
+ pikapic_animation PikaPicAnimBGFrames_5, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_24, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry PikachuCry18
+ pikapic_looptofinish
+
+PikaPicAnimScript19:
+ pikapic_setduration 44
+ pikapic_loadgfx Pic_e6340
+ pikapic_loadgfx GFX_e63f7
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_25, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript20:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e6587
+ pikapic_loadgfx GFX_e6646
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_26, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript21:
+ pikapic_setduration 40
+ pikapic_loadgfx Pic_e67d6
+ pikapic_loadgfx GFX_e682f
+ pikapic_loadgfx GFX_e69bf
+ pikapic_loadgfx GFX_e6b4f
+ pikapic_loadgfx GFX_e6cdf
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_27, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry PikachuCry20
+ pikapic_looptofinish
+
+PikaPicAnimScript22:
+ pikapic_setduration 40
+ pikapic_loadgfx GFX_e6e6f
+ pikapic_loadgfx GFX_e6fff
+ pikapic_animation PikaPicAnimBGFrames_5, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_28, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript23:
+ pikapic_setduration 70
+ pikapic_loadgfx GFX_e718f
+ pikapic_loadgfx GFX_e731f
+ pikapic_animation PikaPicAnimBGFrames_5, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_29, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript24:
+ pikapic_setduration 60
+ pikapic_loadgfx GFX_e74af
+ pikapic_loadgfx GFX_e763f
+ pikapic_animation PikaPicAnimBGFrames_5, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_30, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript25:
+ pikapic_setduration 50
+ pikapic_loadgfx Pic_e77cf
+ pikapic_loadgfx GFX_e7863
+ pikapic_loadgfx GFX_e79f3
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_31, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_writebyte 13
+ pikapic_waitbgmap
+ pikapic_thunderbolt
+ pikapic_ret
+
+Data_fe51f:
+ pikapic_waitbgmap
+PikaPicAnimScript26:
+ pikapic_setduration 100
+ pikapic_loadgfx Pic_e5000
+ pikapic_loadgfx GFX_e50af
+ pikapic_loadgfx GFX_e7b83
+ pikapic_loadgfx GFX_e7d13
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_32, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript27:
+ pikapic_setduration 30
+ pikapic_loadgfx Pic_f0abf
+ pikapic_loadgfx GFX_f0b64
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_33, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+PikaPicAnimScript28:
+ pikapic_setduration 64
+ pikapic_loadgfx Pic_f0cf4
+ pikapic_loadgfx GFX_f0d82
+ pikapic_animation PikaPicAnimBGFrames_4, $80, $0, $0
+ pikapic_animation PikaPicAnimBGFrames_34, $99, $0, $0
+ pikapic_waitbgmap
+ pikapic_cry
+ pikapic_looptofinish
+
+pikapicanimgfx: MACRO
+IF _NARG == 2
+\2_id::
+ db \1 ; size (-1 if compressed)
+ dba \2 ; pointer
+ELSE
+ db \1 ; size
+ dbw \2, \3 ; bank, address
+ENDC
+ENDM
+
+PikaPicAnimGFXHeaders:
+ pikapicanimgfx 1, $39, NULL ; 00
+ pikapicanimgfx -1, Pic_e4000 ; 01
+ pikapicanimgfx 5, GFX_e40cc ; 02
+ pikapicanimgfx -1, Pic_e411c ; 03
+ pikapicanimgfx 10, GFX_e41d2 ; 04
+ pikapicanimgfx -1, Pic_e4272 ; 05
+ pikapicanimgfx 6, GFX_e4323 ; 06
+ pikapicanimgfx -1, Pic_e4383 ; 07
+ pikapicanimgfx 20, GFX_e444b ; 08
+ pikapicanimgfx -1, Pic_e458b ; 09
+ pikapicanimgfx 4, GFX_e463b ; 0a
+ pikapicanimgfx -1, Pic_e467b ; 0b
+ pikapicanimgfx 4, GFX_e472e ; 0c
+ pikapicanimgfx -1, Pic_e476e ; 0d
+ pikapicanimgfx 25, GFX_e4841 ; 0e
+ pikapicanimgfx -1, Pic_e49d1 ; 0f
+ pikapicanimgfx 10, GFX_e4a99 ; 00
+ pikapicanimgfx -1, Pic_e4b39 ; 11
+ pikapicanimgfx 6, GFX_e4bde ; 12
+ pikapicanimgfx -1, Pic_e4c3e ; 13
+ pikapicanimgfx 25, GFX_e4ce0 ; 14
+ pikapicanimgfx 25, GFX_e4e70 ; 15
+ pikapicanimgfx -1, Pic_e5000 ; 16
+ pikapicanimgfx 25, GFX_e50af ; 17
+ pikapicanimgfx -1, Pic_e523f ; 18
+ pikapicanimgfx 25, GFX_e52fe ; 19
+ pikapicanimgfx -1, Pic_e548e ; 1a
+ pikapicanimgfx 25, GFX_e5541 ; 1b
+ pikapicanimgfx -1, Pic_e56d1 ; 1c
+ pikapicanimgfx 25, GFX_e5794 ; 1d
+ pikapicanimgfx -1, Pic_e5924 ; 1e
+ pikapicanimgfx 25, GFX_e59ed ; 1f
+ pikapicanimgfx -1, Pic_e5b7d ; 20
+ pikapicanimgfx 25, GFX_e5c4d ; 21
+ pikapicanimgfx -1, Pic_e5ddd ; 22
+ pikapicanimgfx 25, GFX_e5e90 ; 23
+ pikapicanimgfx 25, GFX_e6020 ; 24
+ pikapicanimgfx 25, GFX_e61b0 ; 25
+ pikapicanimgfx -1, Pic_e6340 ; 26
+ pikapicanimgfx 25, GFX_e63f7 ; 27
+ pikapicanimgfx -1, Pic_e6587 ; 28
+ pikapicanimgfx 25, GFX_e6646 ; 29
+ pikapicanimgfx -1, Pic_e67d6 ; 2a
+ pikapicanimgfx 25, GFX_e682f ; 2b
+ pikapicanimgfx 25, GFX_e69bf ; 2c
+ pikapicanimgfx 25, GFX_e6b4f ; 2d
+ pikapicanimgfx 25, GFX_e6cdf ; 2e
+ pikapicanimgfx 25, GFX_e6e6f ; 2f
+ pikapicanimgfx 25, GFX_e6fff ; 30
+ pikapicanimgfx 25, GFX_e718f ; 31
+ pikapicanimgfx 25, GFX_e731f ; 32
+ pikapicanimgfx 25, GFX_e74af ; 33
+ pikapicanimgfx 25, GFX_e763f ; 34
+ pikapicanimgfx -1, Pic_e77cf ; 35
+ pikapicanimgfx 25, GFX_e7863 ; 36
+ pikapicanimgfx 25, GFX_e79f3 ; 37
+ pikapicanimgfx 25, GFX_e7b83 ; 38
+ pikapicanimgfx 25, GFX_e7d13 ; 39
+ pikapicanimgfx -1, Pic_f0abf ; 3a
+ pikapicanimgfx 25, GFX_f0b64 ; 3b
+ pikapicanimgfx -1, Pic_f0cf4 ; 3c
+ pikapicanimgfx 25, GFX_f0d82 ; 3d
+ pikapicanimgfx 24, PikachuSprite ; 3e
diff --git a/data/pikachu/pikachu_pic_objects.asm b/data/pikachu/pikachu_pic_objects.asm
new file mode 100644
index 00000000..c3a44bc9
--- /dev/null
+++ b/data/pikachu/pikachu_pic_objects.asm
@@ -0,0 +1,308 @@
+pikaanim_def: MACRO
+\1_id:
+ dw \1
+ENDM
+
+PikaPicAnimBGFramesPointers:
+ pikaanim_def PikaPicAnimBGFrames_0 ; 00
+ pikaanim_def PikaPicAnimBGFrames_1 ; 01
+ pikaanim_def PikaPicAnimBGFrames_2 ; 02
+ pikaanim_def PikaPicAnimBGFrames_3 ; 03
+ pikaanim_def PikaPicAnimBGFrames_4 ; 04
+ pikaanim_def PikaPicAnimBGFrames_5 ; 05
+ pikaanim_def PikaPicAnimBGFrames_6 ; 06
+ pikaanim_def PikaPicAnimBGFrames_7 ; 07
+ pikaanim_def PikaPicAnimBGFrames_8 ; 08
+ pikaanim_def PikaPicAnimBGFrames_9 ; 09
+ pikaanim_def PikaPicAnimBGFrames_10 ; 0a
+ pikaanim_def PikaPicAnimBGFrames_11 ; 0b
+ pikaanim_def PikaPicAnimBGFrames_12 ; 0c
+ pikaanim_def PikaPicAnimBGFrames_13 ; 0d
+ pikaanim_def PikaPicAnimBGFrames_14 ; 0e
+ pikaanim_def PikaPicAnimBGFrames_15 ; 0f
+ pikaanim_def PikaPicAnimBGFrames_16 ; 10
+ pikaanim_def PikaPicAnimBGFrames_17 ; 11
+ pikaanim_def PikaPicAnimBGFrames_18 ; 12
+ pikaanim_def PikaPicAnimBGFrames_19 ; 13
+ pikaanim_def PikaPicAnimBGFrames_20 ; 14
+ pikaanim_def PikaPicAnimBGFrames_21 ; 15
+ pikaanim_def PikaPicAnimBGFrames_22 ; 16
+ pikaanim_def PikaPicAnimBGFrames_23 ; 17
+ pikaanim_def PikaPicAnimBGFrames_24 ; 18
+ pikaanim_def PikaPicAnimBGFrames_25 ; 19
+ pikaanim_def PikaPicAnimBGFrames_26 ; 1a
+ pikaanim_def PikaPicAnimBGFrames_27 ; 1b
+ pikaanim_def PikaPicAnimBGFrames_28 ; 1c
+ pikaanim_def PikaPicAnimBGFrames_29 ; 1d
+ pikaanim_def PikaPicAnimBGFrames_30 ; 1e
+ pikaanim_def PikaPicAnimBGFrames_31 ; 1f
+ pikaanim_def PikaPicAnimBGFrames_32 ; 20
+ pikaanim_def PikaPicAnimBGFrames_33 ; 21
+ pikaanim_def PikaPicAnimBGFrames_34 ; 22
+ pikaanim_def PikaPicAnimBGFrames_35 ; 23
+
+pikaframe: MACRO
+ db (\1_id - PikaPicTilemapPointers) / 2, \2
+ENDM
+
+pikaframedelay EQUS "db 0,"
+pikaframeend EQUS "db $e0"
+
+PikaPicAnimBGFrames_0:
+PikaPicAnimBGFrames_1:
+ ; Tilemap idx, duration
+ pikaframe PikaAnimTilemap_1, 20
+ pikaframe PikaAnimTilemap_7, 2
+ pikaframe PikaAnimTilemap_1, 1
+ pikaframe PikaAnimTilemap_7, 2
+ pikaframe PikaAnimTilemap_1, 1
+ pikaframe PikaAnimTilemap_7, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_fdc1e: ; unreferenced
+ pikaframe PikaAnimTilemap_2, 2
+ pikaframe PikaAnimTilemap_1, 1
+ pikaframe PikaAnimTilemap_2, 2
+ pikaframe PikaAnimTilemap_1, 1
+ pikaframe PikaAnimTilemap_2, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_2:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_8, 8
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_8, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_3:
+ pikaframe PikaAnimTilemap_8, 8
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_8, 8
+ pikaframedelay 8
+ pikaframeend
+
+PikaPicAnimBGFrames_4:
+PikaPicAnimBGFrames_35:
+ pikaframe PikaAnimTilemap_1, 0
+ pikaframeend
+
+PikaPicAnimBGFrames_5:
+ pikaframe PikaAnimTilemap_9, 0
+ pikaframeend
+
+PikaPicAnimBGFrames_6:
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_14, 4
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_14, 4
+ pikaframedelay 64
+ pikaframe PikaAnimTilemap_14, 4
+ pikaframedelay 64
+ pikaframeend
+
+PikaPicAnimBGFrames_7:
+ pikaframedelay 4
+ pikaframe PikaAnimTilemap_15, 4
+ pikaframedelay 4
+ pikaframe PikaAnimTilemap_15, 4
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_15, 4
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_15, 4
+ pikaframeend
+
+PikaPicAnimBGFrames_8:
+ pikaframe PikaAnimTilemap_16, 1
+ pikaframedelay 1
+ pikaframe PikaAnimTilemap_16, 1
+ pikaframedelay 64
+ pikaframe PikaAnimTilemap_16, 1
+ pikaframedelay 64
+ pikaframeend
+
+PikaPicAnimBGFrames_9:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_17, 8
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_17, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_10:
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_18, 2
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_18, 64
+ pikaframedelay 3
+ pikaframe PikaAnimTilemap_18, 64
+ pikaframeend
+
+PikaPicAnimBGFrames_11:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_19, 64
+ pikaframedelay 4
+ pikaframe PikaAnimTilemap_19, 64
+ pikaframeend
+
+PikaPicAnimBGFrames_12:
+ pikaframe PikaAnimTilemap_20, 8
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_20, 8
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_20, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_13:
+ pikaframe PikaAnimTilemap_21, 4
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_21, 4
+ pikaframedelay 64
+ pikaframe PikaAnimTilemap_21, 4
+ pikaframedelay 64
+ pikaframeend
+
+PikaPicAnimBGFrames_14:
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_22, 2
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_22, 2
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_22, 2
+ pikaframeend
+
+PikaPicAnimBGFrames_15:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_23, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_16:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_23, 3
+ pikaframe PikaAnimTilemap_24, 5
+ pikaframe PikaAnimTilemap_23, 3
+ pikaframedelay 5
+ pikaframeend
+
+PikaPicAnimBGFrames_17:
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_25, 8
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_25, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_18:
+ pikaframedelay 13
+ pikaframe PikaAnimTilemap_26, 12
+ pikaframedelay 100
+ pikaframe PikaAnimTilemap_26, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_19:
+ pikaframedelay 5
+ pikaframe PikaAnimTilemap_27, 5
+ pikaframedelay 5
+ pikaframe PikaAnimTilemap_27, 5
+ pikaframedelay 100
+ pikaframeend
+
+PikaPicAnimBGFrames_20:
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_28, 2
+ pikaframedelay 2
+ pikaframe PikaAnimTilemap_28, 2
+ pikaframeend
+
+PikaPicAnimBGFrames_21:
+ pikaframedelay 5
+ pikaframe PikaAnimTilemap_29, 5
+ pikaframedelay 5
+ pikaframe PikaAnimTilemap_29, 5
+ pikaframeend
+
+PikaPicAnimBGFrames_22:
+ pikaframe PikaAnimTilemap_30, 8
+ pikaframedelay 100
+ pikaframeend
+
+PikaPicAnimBGFrames_23:
+ pikaframedelay 10
+ pikaframe PikaAnimTilemap_31, 3
+ pikaframedelay 3
+ pikaframe PikaAnimTilemap_31, 3
+ pikaframedelay 100
+ pikaframeend
+
+PikaPicAnimBGFrames_24:
+ pikaframedelay 3
+ pikaframe PikaAnimTilemap_32, 100
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_32, 8
+ pikaframeend
+
+PikaPicAnimBGFrames_25:
+ pikaframe PikaAnimTilemap_33, 6
+ pikaframedelay 6
+ pikaframe PikaAnimTilemap_33, 6
+ pikaframedelay 6
+ pikaframeend
+
+PikaPicAnimBGFrames_26:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_34, 12
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_34, 12
+ pikaframeend
+
+PikaPicAnimBGFrames_27:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_9, 2
+ pikaframe PikaAnimTilemap_10, 1
+ pikaframe PikaAnimTilemap_11, 1
+ pikaframe PikaAnimTilemap_12, 100
+ pikaframeend
+
+PikaPicAnimBGFrames_28:
+ pikaframedelay 8
+ pikaframe PikaAnimTilemap_36, 100
+ pikaframeend
+
+PikaPicAnimBGFrames_29:
+ pikaframedelay 16
+ pikaframe PikaAnimTilemap_37, 16
+ pikaframedelay 16
+ pikaframe PikaAnimTilemap_37, 16
+ pikaframeend
+
+PikaPicAnimBGFrames_30:
+ pikaframedelay 6
+ pikaframe PikaAnimTilemap_38, 6
+ pikaframedelay 6
+ pikaframe PikaAnimTilemap_38, 6
+ pikaframedelay 100
+ pikaframeend
+
+PikaPicAnimBGFrames_31:
+ pikaframedelay 6
+ pikaframe PikaAnimTilemap_9, 6
+ pikaframe PikaAnimTilemap_10, 100
+ pikaframeend
+
+PikaPicAnimBGFrames_32:
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_9, 8
+ pikaframedelay 20
+ pikaframe PikaAnimTilemap_9, 8
+ pikaframe PikaAnimTilemap_10, 8
+ pikaframe PikaAnimTilemap_11, 100
+ pikaframeend
+
+PikaPicAnimBGFrames_33:
+ pikaframedelay 4
+ pikaframe PikaAnimTilemap_9, 100
+ pikaframeend
+
+PikaPicAnimBGFrames_34:
+ pikaframedelay 12
+ pikaframe PikaAnimTilemap_9, 12
+ pikaframedelay 12
+ pikaframe PikaAnimTilemap_9, 100
+ pikaframeend
diff --git a/data/pikachu/pikachu_pic_tilemaps.asm b/data/pikachu/pikachu_pic_tilemaps.asm
new file mode 100644
index 00000000..d11ba04e
--- /dev/null
+++ b/data/pikachu/pikachu_pic_tilemaps.asm
@@ -0,0 +1,254 @@
+pikatilemap_def: MACRO
+\1_id:
+ dw \1
+ENDM
+
+PikaPicTilemapPointers:
+ pikatilemap_def PikaAnimTilemap_0
+ pikatilemap_def PikaAnimTilemap_1
+ pikatilemap_def PikaAnimTilemap_2
+ pikatilemap_def PikaAnimTilemap_3
+ pikatilemap_def PikaAnimTilemap_4
+ pikatilemap_def PikaAnimTilemap_5
+ pikatilemap_def PikaAnimTilemap_6
+ pikatilemap_def PikaAnimTilemap_7
+ pikatilemap_def PikaAnimTilemap_8
+ pikatilemap_def PikaAnimTilemap_9
+ pikatilemap_def PikaAnimTilemap_10
+ pikatilemap_def PikaAnimTilemap_11
+ pikatilemap_def PikaAnimTilemap_12
+ pikatilemap_def PikaAnimTilemap_13
+ pikatilemap_def PikaAnimTilemap_14
+ pikatilemap_def PikaAnimTilemap_15
+ pikatilemap_def PikaAnimTilemap_16
+ pikatilemap_def PikaAnimTilemap_17
+ pikatilemap_def PikaAnimTilemap_18
+ pikatilemap_def PikaAnimTilemap_19
+ pikatilemap_def PikaAnimTilemap_20
+ pikatilemap_def PikaAnimTilemap_21
+ pikatilemap_def PikaAnimTilemap_22
+ pikatilemap_def PikaAnimTilemap_23
+ pikatilemap_def PikaAnimTilemap_24
+ pikatilemap_def PikaAnimTilemap_25
+ pikatilemap_def PikaAnimTilemap_26
+ pikatilemap_def PikaAnimTilemap_27
+ pikatilemap_def PikaAnimTilemap_28
+ pikatilemap_def PikaAnimTilemap_29
+ pikatilemap_def PikaAnimTilemap_30
+ pikatilemap_def PikaAnimTilemap_31
+ pikatilemap_def PikaAnimTilemap_32
+ pikatilemap_def PikaAnimTilemap_33
+ pikatilemap_def PikaAnimTilemap_34
+ pikatilemap_def PikaAnimTilemap_35
+ pikatilemap_def PikaAnimTilemap_36
+ pikatilemap_def PikaAnimTilemap_37
+ pikatilemap_def PikaAnimTilemap_38
+ pikatilemap_def PikaAnimTilemap_39
+ pikatilemap_def PikaAnimTilemap_40
+ pikatilemap_def PikaAnimTilemap_41
+ pikatilemap_def PikaAnimTilemap_42
+
+PikaAnimTilemap_0:
+ db -1 ; unused
+
+; $ff inhibits overwriting that tile
+
+PikaAnimTilemap_1:
+PikaAnimTilemap_42:
+ db 5, 5
+ db $00, $05, $0a, $0f, $14
+ db $01, $06, $0b, $10, $15
+ db $02, $07, $0c, $11, $16
+ db $03, $08, $0d, $12, $17
+ db $04, $09, $0e, $13, $18
+
+PikaAnimTilemap_2:
+ db 5, 5
+ db $19, $1e, $23, $28, $2d
+ db $1a, $1f, $24, $29, $2e
+ db $1b, $20, $25, $2a, $2f
+ db $1c, $21, $26, $2b, $30
+ db $1d, $22, $27, $2c, $31
+
+PikaAnimTilemap_7:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $20, $25, $ff, $ff
+ db $ff, $21, $26, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_3:
+ db 1, 1
+ db $00
+
+PikaAnimTilemap_4:
+ db 2, 1
+ db $00
+ db $01
+
+PikaAnimTilemap_5:
+ db 1, 2
+ db $00, $01
+
+PikaAnimTilemap_6:
+PikaAnimTilemap_8:
+ db 2, 2
+ db $00, $01
+ db $02, $03
+
+PikaAnimTilemap_fde71: ; unused
+ db 3, 2
+ db $00, $01
+ db $02, $03
+ db $04, $05
+
+PikaAnimTilemap_fde79: ; unused
+ db 2, 3
+ db $00, $01, $02
+ db $03, $04, $05
+
+PikaAnimTilemap_14:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $02, $03, $04
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_15:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+
+PikaAnimTilemap_16:
+ db 5, 5
+ db $00, $01, $ff, $ff, $ff
+ db $02, $03, $ff, $ff, $ff
+ db $04, $05, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_17:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+ db $0a, $0b, $0c, $0d, $0e
+ db $0f, $10, $11, $12, $13
+
+PikaAnimTilemap_18:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $00, $01
+ db $ff, $ff, $ff, $02, $03
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_19:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $ff, $ff, $ff
+ db $02, $03, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_20:
+ db 5, 5
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+ db $0a, $0b, $0c, $0d, $0e
+ db $0f, $10, $11, $12, $13
+ db $14, $15, $16, $17, $18
+
+PikaAnimTilemap_21:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+ db $ff, $ff, $ff, $ff, $ff
+
+PikaAnimTilemap_22:
+ db 5, 5
+ db $ff, $ff, $ff, $ff, $ff
+ db $ff, $ff, $ff, $ff, $ff
+ db $00, $01, $ff, $ff, $ff
+ db $02, $03, $ff, $ff, $ff
+ db $04, $05, $ff, $ff, $ff
+
+PikaAnimTilemap_23:
+ db 5, 5
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+ db $0a, $0b, $0c, $0d, $0e
+ db $0f, $10, $11, $12, $13
+ db $14, $15, $16, $17, $18
+
+PikaAnimTilemap_24:
+ db 5, 5
+ db $19, $1a, $1b, $1c, $1d
+ db $1e, $1f, $20, $21, $22
+ db $23, $24, $25, $26, $27
+ db $28, $29, $2a, $2b, $2c
+ db $2d, $2e, $2f, $30, $31
+
+PikaAnimTilemap_9:
+PikaAnimTilemap_25:
+PikaAnimTilemap_26:
+PikaAnimTilemap_27:
+PikaAnimTilemap_28:
+PikaAnimTilemap_29:
+PikaAnimTilemap_30:
+PikaAnimTilemap_31:
+PikaAnimTilemap_32:
+PikaAnimTilemap_33:
+PikaAnimTilemap_34:
+PikaAnimTilemap_35:
+PikaAnimTilemap_36:
+PikaAnimTilemap_37:
+PikaAnimTilemap_38:
+PikaAnimTilemap_39:
+ db 5, 5
+ db $00, $01, $02, $03, $04
+ db $05, $06, $07, $08, $09
+ db $0a, $0b, $0c, $0d, $0e
+ db $0f, $10, $11, $12, $13
+ db $14, $15, $16, $17, $18
+
+PikaAnimTilemap_10:
+PikaAnimTilemap_40:
+ db 5, 5
+ db $19, $1a, $1b, $1c, $1d
+ db $1e, $1f, $20, $21, $22
+ db $23, $24, $25, $26, $27
+ db $28, $29, $2a, $2b, $2c
+ db $2d, $2e, $2f, $30, $31
+
+PikaAnimTilemap_11:
+PikaAnimTilemap_41:
+ db 5, 5
+ db $32, $33, $34, $35, $36
+ db $37, $38, $39, $3a, $3b
+ db $3c, $3d, $3e, $3f, $40
+ db $41, $42, $43, $44, $45
+ db $46, $47, $48, $49, $4a
+
+PikaAnimTilemap_12:
+ db 5, 5
+ db $4b, $4c, $4d, $4e, $4f
+ db $50, $51, $52, $53, $54
+ db $55, $56, $57, $58, $59
+ db $5a, $5b, $5c, $5d, $5e
+ db $5f, $60, $61, $62, $63
+
+PikaAnimTilemap_13:
+ db 5, 5
+ db $64, $65, $66, $67, $68
+ db $69, $6a, $6b, $6c, $6d
+ db $6e, $6f, $70, $71, $72
+ db $73, $74, $75, $76, $77
+ db $78, $79, $7a, $7b, $7c
diff --git a/data/player_names.asm b/data/player_names.asm
index f57c9877..cf461a7a 100644
--- a/data/player_names.asm
+++ b/data/player_names.asm
@@ -1,7 +1,6 @@
-IF DEF(_RED)
DefaultNamesPlayer:
db "NEW NAME"
- next "RED"
+ next "YELLOW"
next "ASH"
next "JACK"
db "@"
@@ -12,20 +11,3 @@ DefaultNamesRival:
next "GARY"
next "JOHN"
db "@"
-ENDC
-
-IF DEF(_BLUE)
-DefaultNamesPlayer:
- db "NEW NAME"
- next "BLUE"
- next "GARY"
- next "JOHN"
- db "@"
-
-DefaultNamesRival:
- db "NEW NAME"
- next "RED"
- next "ASH"
- next "JACK"
- db "@"
-ENDC
diff --git a/data/player_names_list.asm b/data/player_names_list.asm
index 56075df0..a5f38919 100644
--- a/data/player_names_list.asm
+++ b/data/player_names_list.asm
@@ -1,7 +1,6 @@
-IF DEF(_RED)
DefaultNamesPlayerList:
db "NEW NAME@"
- db "RED@"
+ db "YELLOW@"
db "ASH@"
db "JACK@"
@@ -10,18 +9,3 @@ DefaultNamesRivalList:
db "BLUE@"
db "GARY@"
db "JOHN@"
-ENDC
-
-IF DEF(_BLUE)
-DefaultNamesPlayerList:
- db "NEW NAME@"
- db "BLUE@"
- db "GARY@"
- db "JOHN@"
-
-DefaultNamesRivalList:
- db "NEW NAME@"
- db "RED@"
- db "ASH@"
- db "JACK@"
-ENDC
diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm
index 691e75b0..7b478ef8 100644
--- a/data/pokemon/base_stats.asm
+++ b/data/pokemon/base_stats.asm
@@ -150,4 +150,5 @@ INCLUDE "data/pokemon/base_stats/dratini.asm"
INCLUDE "data/pokemon/base_stats/dragonair.asm"
INCLUDE "data/pokemon/base_stats/dragonite.asm"
INCLUDE "data/pokemon/base_stats/mewtwo.asm"
- assert_table_length NUM_POKEMON - 1 ; discount Mew
+INCLUDE "data/pokemon/base_stats/mew.asm"
+ assert_table_length NUM_POKEMON
diff --git a/data/pokemon/base_stats/alakazam.asm b/data/pokemon/base_stats/alakazam.asm
index 0064416f..30bf57cc 100644
--- a/data/pokemon/base_stats/alakazam.asm
+++ b/data/pokemon/base_stats/alakazam.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/alakazam.pic", 0, 1 ; sprite dimensions
dw AlakazamPicFront, AlakazamPicBack
- db TELEPORT, CONFUSION, DISABLE, NO_MOVE ; level 1 learnset
+ db TELEPORT, KINESIS, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_SLOW ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/butterfree.asm b/data/pokemon/base_stats/butterfree.asm
index f18cf5e9..56f64df8 100644
--- a/data/pokemon/base_stats/butterfree.asm
+++ b/data/pokemon/base_stats/butterfree.asm
@@ -17,7 +17,7 @@
tmhm RAZOR_WIND, WHIRLWIND, TOXIC, TAKE_DOWN, DOUBLE_EDGE, \
HYPER_BEAM, RAGE, MEGA_DRAIN, SOLARBEAM, PSYCHIC_M, \
TELEPORT, MIMIC, DOUBLE_TEAM, REFLECT, BIDE, \
- SWIFT, REST, PSYWAVE, SUBSTITUTE
+ SWIFT, REST, PSYWAVE, SUBSTITUTE, FLASH
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/chansey.asm b/data/pokemon/base_stats/chansey.asm
index fc1fcb71..0d673e2b 100644
--- a/data/pokemon/base_stats/chansey.asm
+++ b/data/pokemon/base_stats/chansey.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/chansey.pic", 0, 1 ; sprite dimensions
dw ChanseyPicFront, ChanseyPicBack
- db POUND, DOUBLESLAP, NO_MOVE, NO_MOVE ; level 1 learnset
+ db POUND, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/charizard.asm b/data/pokemon/base_stats/charizard.asm
index 715e0f7f..6ecf64d4 100644
--- a/data/pokemon/base_stats/charizard.asm
+++ b/data/pokemon/base_stats/charizard.asm
@@ -19,7 +19,7 @@
SEISMIC_TOSS, RAGE, DRAGON_RAGE, EARTHQUAKE, FISSURE, \
DIG, MIMIC, DOUBLE_TEAM, REFLECT, BIDE, \
FIRE_BLAST, SWIFT, SKULL_BASH, REST, SUBSTITUTE, \
- CUT, STRENGTH
+ CUT, FLY, STRENGTH
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/cubone.asm b/data/pokemon/base_stats/cubone.asm
index 6a813ab6..fc155047 100644
--- a/data/pokemon/base_stats/cubone.asm
+++ b/data/pokemon/base_stats/cubone.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/cubone.pic", 0, 1 ; sprite dimensions
dw CubonePicFront, CubonePicBack
- db BONE_CLUB, GROWL, NO_MOVE, NO_MOVE ; level 1 learnset
+ db GROWL, NO_MOVE, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/diglett.asm b/data/pokemon/base_stats/diglett.asm
index c8ee014b..46780291 100644
--- a/data/pokemon/base_stats/diglett.asm
+++ b/data/pokemon/base_stats/diglett.asm
@@ -16,7 +16,7 @@
; tm/hm learnset
tmhm TOXIC, BODY_SLAM, TAKE_DOWN, DOUBLE_EDGE, RAGE, \
EARTHQUAKE, FISSURE, DIG, MIMIC, DOUBLE_TEAM, \
- BIDE, REST, ROCK_SLIDE, SUBSTITUTE
+ BIDE, REST, ROCK_SLIDE, SUBSTITUTE, CUT
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/dragonair.asm b/data/pokemon/base_stats/dragonair.asm
index 1178ebcc..b95254f2 100644
--- a/data/pokemon/base_stats/dragonair.asm
+++ b/data/pokemon/base_stats/dragonair.asm
@@ -4,7 +4,7 @@
; hp atk def spd spc
db DRAGON, DRAGON ; type
- db 45 ; catch rate
+ db 27 ; catch rate
db 144 ; base exp
INCBIN "gfx/pokemon/front/dragonair.pic", 0, 1 ; sprite dimensions
diff --git a/data/pokemon/base_stats/dragonite.asm b/data/pokemon/base_stats/dragonite.asm
index 968d53b6..d84adc2f 100644
--- a/data/pokemon/base_stats/dragonite.asm
+++ b/data/pokemon/base_stats/dragonite.asm
@@ -4,7 +4,7 @@
; hp atk def spd spc
db DRAGON, FLYING ; type
- db 45 ; catch rate
+ db 9 ; catch rate
db 218 ; base exp
INCBIN "gfx/pokemon/front/dragonite.pic", 0, 1 ; sprite dimensions
diff --git a/data/pokemon/base_stats/dugtrio.asm b/data/pokemon/base_stats/dugtrio.asm
index cffc8750..94e733e9 100644
--- a/data/pokemon/base_stats/dugtrio.asm
+++ b/data/pokemon/base_stats/dugtrio.asm
@@ -16,7 +16,8 @@
; tm/hm learnset
tmhm TOXIC, BODY_SLAM, TAKE_DOWN, DOUBLE_EDGE, HYPER_BEAM, \
RAGE, EARTHQUAKE, FISSURE, DIG, MIMIC, \
- DOUBLE_TEAM, BIDE, REST, ROCK_SLIDE, SUBSTITUTE
+ DOUBLE_TEAM, BIDE, REST, ROCK_SLIDE, SUBSTITUTE, \
+ CUT
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/eevee.asm b/data/pokemon/base_stats/eevee.asm
index a3a6ed4c..6919285d 100644
--- a/data/pokemon/base_stats/eevee.asm
+++ b/data/pokemon/base_stats/eevee.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/eevee.pic", 0, 1 ; sprite dimensions
dw EeveePicFront, EeveePicBack
- db TACKLE, SAND_ATTACK, NO_MOVE, NO_MOVE ; level 1 learnset
+ db TACKLE, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/flareon.asm b/data/pokemon/base_stats/flareon.asm
index 5ccf33ef..2aa8f507 100644
--- a/data/pokemon/base_stats/flareon.asm
+++ b/data/pokemon/base_stats/flareon.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/flareon.pic", 0, 1 ; sprite dimensions
dw FlareonPicFront, FlareonPicBack
- db TACKLE, SAND_ATTACK, QUICK_ATTACK, EMBER ; level 1 learnset
+ db TACKLE, TAIL_WHIP, QUICK_ATTACK, EMBER ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/gyarados.asm b/data/pokemon/base_stats/gyarados.asm
index f08d29c9..62dd980f 100644
--- a/data/pokemon/base_stats/gyarados.asm
+++ b/data/pokemon/base_stats/gyarados.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/gyarados.pic", 0, 1 ; sprite dimensions
dw GyaradosPicFront, GyaradosPicBack
- db BITE, DRAGON_RAGE, LEER, HYDRO_PUMP ; level 1 learnset
+ db TACKLE, NO_MOVE, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_SLOW ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/jolteon.asm b/data/pokemon/base_stats/jolteon.asm
index cb7e989e..a4b74759 100644
--- a/data/pokemon/base_stats/jolteon.asm
+++ b/data/pokemon/base_stats/jolteon.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/jolteon.pic", 0, 1 ; sprite dimensions
dw JolteonPicFront, JolteonPicBack
- db TACKLE, SAND_ATTACK, QUICK_ATTACK, THUNDERSHOCK ; level 1 learnset
+ db TACKLE, TAIL_WHIP, QUICK_ATTACK, THUNDERSHOCK ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/kabutops.asm b/data/pokemon/base_stats/kabutops.asm
index 62585d70..e3a6d44f 100644
--- a/data/pokemon/base_stats/kabutops.asm
+++ b/data/pokemon/base_stats/kabutops.asm
@@ -18,7 +18,7 @@
TAKE_DOWN, DOUBLE_EDGE, BUBBLEBEAM, WATER_GUN, ICE_BEAM, \
BLIZZARD, HYPER_BEAM, SUBMISSION, SEISMIC_TOSS, RAGE, \
MIMIC, DOUBLE_TEAM, REFLECT, BIDE, SKULL_BASH, \
- REST, SUBSTITUTE, SURF
+ REST, SUBSTITUTE, CUT, SURF
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/kadabra.asm b/data/pokemon/base_stats/kadabra.asm
index 51fc6a91..77fbf556 100644
--- a/data/pokemon/base_stats/kadabra.asm
+++ b/data/pokemon/base_stats/kadabra.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/kadabra.pic", 0, 1 ; sprite dimensions
dw KadabraPicFront, KadabraPicBack
- db TELEPORT, CONFUSION, DISABLE, NO_MOVE ; level 1 learnset
+ db TELEPORT, KINESIS, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_SLOW ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/marowak.asm b/data/pokemon/base_stats/marowak.asm
index 3d22e68a..ee2b778f 100644
--- a/data/pokemon/base_stats/marowak.asm
+++ b/data/pokemon/base_stats/marowak.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/marowak.pic", 0, 1 ; sprite dimensions
dw MarowakPicFront, MarowakPicBack
- db BONE_CLUB, GROWL, LEER, FOCUS_ENERGY ; level 1 learnset
+ db BONE_CLUB, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/mew.asm b/data/pokemon/base_stats/mew.asm
index 82a7ec47..c7f268a2 100644
--- a/data/pokemon/base_stats/mew.asm
+++ b/data/pokemon/base_stats/mew.asm
@@ -24,8 +24,7 @@
SELFDESTRUCT, EGG_BOMB, FIRE_BLAST, SWIFT, SKULL_BASH, \
SOFTBOILED, DREAM_EATER, SKY_ATTACK, REST, THUNDER_WAVE, \
PSYWAVE, EXPLOSION, ROCK_SLIDE, TRI_ATTACK, SUBSTITUTE, \
- CUT, FLY, SURF, STRENGTH, FLASH, \
- UNUSED
+ CUT, FLY, SURF, STRENGTH, FLASH
; end
- db %11111111 ; padding
+ db 0 ; padding
diff --git a/data/pokemon/base_stats/mewtwo.asm b/data/pokemon/base_stats/mewtwo.asm
index 5b276291..5d76160f 100644
--- a/data/pokemon/base_stats/mewtwo.asm
+++ b/data/pokemon/base_stats/mewtwo.asm
@@ -16,12 +16,11 @@
; tm/hm learnset
tmhm MEGA_PUNCH, MEGA_KICK, TOXIC, BODY_SLAM, TAKE_DOWN, \
DOUBLE_EDGE, BUBBLEBEAM, WATER_GUN, ICE_BEAM, BLIZZARD, \
- HYPER_BEAM, PAY_DAY, SUBMISSION, COUNTER, SEISMIC_TOSS, \
- RAGE, SOLARBEAM, THUNDERBOLT, THUNDER, PSYCHIC_M, \
- TELEPORT, MIMIC, DOUBLE_TEAM, REFLECT, BIDE, \
- METRONOME, SELFDESTRUCT, FIRE_BLAST, SKULL_BASH, REST, \
- THUNDER_WAVE, PSYWAVE, TRI_ATTACK, SUBSTITUTE, STRENGTH, \
- FLASH
+ HYPER_BEAM, SUBMISSION, COUNTER, SEISMIC_TOSS, RAGE, \
+ SOLARBEAM, THUNDERBOLT, THUNDER, PSYCHIC_M, TELEPORT, \
+ MIMIC, DOUBLE_TEAM, REFLECT, BIDE, METRONOME, \
+ SELFDESTRUCT, FIRE_BLAST, SKULL_BASH, REST, THUNDER_WAVE, \
+ PSYWAVE, TRI_ATTACK, SUBSTITUTE, STRENGTH, FLASH
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/primeape.asm b/data/pokemon/base_stats/primeape.asm
index 12f8bb01..6d533b28 100644
--- a/data/pokemon/base_stats/primeape.asm
+++ b/data/pokemon/base_stats/primeape.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/primeape.pic", 0, 1 ; sprite dimensions
dw PrimeapePicFront, PrimeapePicBack
- db SCRATCH, LEER, KARATE_CHOP, FURY_SWIPES ; level 1 learnset
+ db SCRATCH, LEER, LOW_KICK, KARATE_CHOP ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/tangela.asm b/data/pokemon/base_stats/tangela.asm
index 5380a4a7..8ab7d548 100644
--- a/data/pokemon/base_stats/tangela.asm
+++ b/data/pokemon/base_stats/tangela.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/tangela.pic", 0, 1 ; sprite dimensions
dw TangelaPicFront, TangelaPicBack
- db CONSTRICT, BIND, NO_MOVE, NO_MOVE ; level 1 learnset
+ db CONSTRICT, NO_MOVE, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/vaporeon.asm b/data/pokemon/base_stats/vaporeon.asm
index ec5c01d2..5c45b173 100644
--- a/data/pokemon/base_stats/vaporeon.asm
+++ b/data/pokemon/base_stats/vaporeon.asm
@@ -10,7 +10,7 @@
INCBIN "gfx/pokemon/front/vaporeon.pic", 0, 1 ; sprite dimensions
dw VaporeonPicFront, VaporeonPicBack
- db TACKLE, SAND_ATTACK, QUICK_ATTACK, WATER_GUN ; level 1 learnset
+ db TACKLE, TAIL_WHIP, QUICK_ATTACK, WATER_GUN ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
diff --git a/data/pokemon/base_stats/venomoth.asm b/data/pokemon/base_stats/venomoth.asm
index c01ee263..ff4295d0 100644
--- a/data/pokemon/base_stats/venomoth.asm
+++ b/data/pokemon/base_stats/venomoth.asm
@@ -10,14 +10,14 @@
INCBIN "gfx/pokemon/front/venomoth.pic", 0, 1 ; sprite dimensions
dw VenomothPicFront, VenomothPicBack
- db TACKLE, DISABLE, POISONPOWDER, LEECH_LIFE ; level 1 learnset
+ db TACKLE, DISABLE, SUPERSONIC, CONFUSION ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
tmhm RAZOR_WIND, WHIRLWIND, TOXIC, TAKE_DOWN, DOUBLE_EDGE, \
HYPER_BEAM, RAGE, MEGA_DRAIN, SOLARBEAM, PSYCHIC_M, \
TELEPORT, MIMIC, DOUBLE_TEAM, REFLECT, BIDE, \
- SWIFT, REST, PSYWAVE, SUBSTITUTE
+ SWIFT, REST, PSYWAVE, SUBSTITUTE, FLASH
; end
db 0 ; padding
diff --git a/data/pokemon/base_stats/venonat.asm b/data/pokemon/base_stats/venonat.asm
index 9c9ff071..49ee0b97 100644
--- a/data/pokemon/base_stats/venonat.asm
+++ b/data/pokemon/base_stats/venonat.asm
@@ -16,7 +16,7 @@
; tm/hm learnset
tmhm TOXIC, TAKE_DOWN, DOUBLE_EDGE, RAGE, MEGA_DRAIN, \
SOLARBEAM, PSYCHIC_M, MIMIC, DOUBLE_TEAM, REFLECT, \
- BIDE, REST, PSYWAVE, SUBSTITUTE
+ BIDE, REST, PSYWAVE, SUBSTITUTE, FLASH
; end
db 0 ; padding
diff --git a/data/pokemon/dex_entries.asm b/data/pokemon/dex_entries.asm
index c99087e2..ae243768 100644
--- a/data/pokemon/dex_entries.asm
+++ b/data/pokemon/dex_entries.asm
@@ -197,60 +197,11 @@ PokedexEntryPointers:
; weight in pounds
; text entry
-RhydonDexEntry:
- db "DRILL@"
- db 6,3
- dw 2650
- text_far _RhydonDexEntry
- text_end
-
-KangaskhanDexEntry:
- db "PARENT@"
- db 7,3
- dw 1760
- text_far _KangaskhanDexEntry
- text_end
-
-NidoranMDexEntry:
- db "POISON PIN@"
- db 1,8
- dw 200
- text_far _NidoranMDexEntry
- text_end
-
-ClefairyDexEntry:
- db "FAIRY@"
- db 2,0
- dw 170
- text_far _ClefairyDexEntry
- text_end
-
-SpearowDexEntry:
- db "TINY BIRD@"
- db 1,0
- dw 40
- text_far _SpearowDexEntry
- text_end
-
-VoltorbDexEntry:
- db "BALL@"
- db 1,8
- dw 230
- text_far _VoltorbDexEntry
- text_end
-
-NidokingDexEntry:
- db "DRILL@"
- db 4,7
- dw 1370
- text_far _NidokingDexEntry
- text_end
-
-SlowbroDexEntry:
- db "HERMITCRAB@"
- db 5,3
- dw 1730
- text_far _SlowbroDexEntry
+BulbasaurDexEntry:
+ db "SEED@"
+ db 2,4
+ dw 150
+ text_far _BulbasaurDexEntry
text_end
IvysaurDexEntry:
@@ -260,165 +211,137 @@ IvysaurDexEntry:
text_far _IvysaurDexEntry
text_end
-ExeggutorDexEntry:
- db "COCONUT@"
+VenusaurDexEntry:
+ db "SEED@"
db 6,7
- dw 2650
- text_far _ExeggutorDexEntry
- text_end
-
-LickitungDexEntry:
- db "LICKING@"
- db 3,11
- dw 1440
- text_far _LickitungDexEntry
- text_end
-
-ExeggcuteDexEntry:
- db "EGG@"
- db 1,4
- dw 60
- text_far _ExeggcuteDexEntry
- text_end
-
-GrimerDexEntry:
- db "SLUDGE@"
- db 2,11
- dw 660
- text_far _GrimerDexEntry
+ dw 2210
+ text_far _VenusaurDexEntry
text_end
-GengarDexEntry:
- db "SHADOW@"
- db 4,11
- dw 890
- text_far _GengarDexEntry
+CharmanderDexEntry:
+ db "LIZARD@"
+ db 2,0
+ dw 190
+ text_far _CharmanderDexEntry
text_end
-NidoranFDexEntry:
- db "POISON PIN@"
- db 1,4
- dw 150
- text_far _NidoranFDexEntry
+CharmeleonDexEntry:
+ db "FLAME@"
+ db 3,7
+ dw 420
+ text_far _CharmeleonDexEntry
text_end
-NidoqueenDexEntry:
- db "DRILL@"
- db 4,3
- dw 1320
- text_far _NidoqueenDexEntry
+CharizardDexEntry:
+ db "FLAME@"
+ db 5,7
+ dw 2000
+ text_far _CharizardDexEntry
text_end
-CuboneDexEntry:
- db "LONELY@"
- db 1,4
- dw 140
- text_far _CuboneDexEntry
+SquirtleDexEntry:
+ db "TINYTURTLE@"
+ db 1,8
+ dw 200
+ text_far _SquirtleDexEntry
text_end
-RhyhornDexEntry:
- db "SPIKES@"
+WartortleDexEntry:
+ db "TURTLE@"
db 3,3
- dw 2540
- text_far _RhyhornDexEntry
+ dw 500
+ text_far _WartortleDexEntry
text_end
-LaprasDexEntry:
- db "TRANSPORT@"
- db 8,2
- dw 4850
- text_far _LaprasDexEntry
+BlastoiseDexEntry:
+ db "SHELLFISH@"
+ db 5,3
+ dw 1890
+ text_far _BlastoiseDexEntry
text_end
-ArcanineDexEntry:
- db "LEGENDARY@"
- db 6,3
- dw 3420
- text_far _ArcanineDexEntry
+CaterpieDexEntry:
+ db "WORM@"
+ db 1,0
+ dw 60
+ text_far _CaterpieDexEntry
text_end
-MewDexEntry:
- db "NEW SPECIE@"
- db 1,4
- dw 90
- text_far _MewDexEntry
+MetapodDexEntry:
+ db "COCOON@"
+ db 2,4
+ dw 220
+ text_far _MetapodDexEntry
text_end
-GyaradosDexEntry:
- db "ATROCIOUS@"
- db 21,4
- dw 5180
- text_far _GyaradosDexEntry
+ButterfreeDexEntry:
+ db "BUTTERFLY@"
+ db 3,7
+ dw 710
+ text_far _ButterfreeDexEntry
text_end
-ShellderDexEntry:
- db "BIVALVE@"
+WeedleDexEntry:
+ db "HAIRY BUG@"
db 1,0
- dw 90
- text_far _ShellderDexEntry
- text_end
-
-TentacoolDexEntry:
- db "JELLYFISH@"
- db 2,11
- dw 1000
- text_far _TentacoolDexEntry
+ dw 70
+ text_far _WeedleDexEntry
text_end
-GastlyDexEntry:
- db "GAS@"
- db 4,3
- dw 2
- text_far _GastlyDexEntry
+KakunaDexEntry:
+ db "COCOON@"
+ db 2,0
+ dw 220
+ text_far _KakunaDexEntry
text_end
-ScytherDexEntry:
- db "MANTIS@"
- db 4,11
- dw 1230
- text_far _ScytherDexEntry
+BeedrillDexEntry:
+ db "POISON BEE@"
+ db 3,3
+ dw 650
+ text_far _BeedrillDexEntry
text_end
-StaryuDexEntry:
- db "STARSHAPE@"
- db 2,7
- dw 760
- text_far _StaryuDexEntry
+PidgeyDexEntry:
+ db "TINY BIRD@"
+ db 1,0
+ dw 40
+ text_far _PidgeyDexEntry
text_end
-BlastoiseDexEntry:
- db "SHELLFISH@"
- db 5,3
- dw 1890
- text_far _BlastoiseDexEntry
+PidgeottoDexEntry:
+ db "BIRD@"
+ db 3,7
+ dw 660
+ text_far _PidgeottoDexEntry
text_end
-PinsirDexEntry:
- db "STAGBEETLE@"
+PidgeotDexEntry:
+ db "BIRD@"
db 4,11
- dw 1210
- text_far _PinsirDexEntry
+ dw 870
+ text_far _PidgeotDexEntry
text_end
-TangelaDexEntry:
- db "VINE@"
- db 3,3
- dw 770
- text_far _TangelaDexEntry
+RattataDexEntry:
+ db "RAT@"
+ db 1,0
+ dw 80
+ text_far _RattataDexEntry
text_end
-GrowlitheDexEntry:
- db "PUPPY@"
+RaticateDexEntry:
+ db "RAT@"
db 2,4
- dw 420
- text_far _GrowlitheDexEntry
+ dw 410
+ text_far _RaticateDexEntry
text_end
-OnixDexEntry:
- db "ROCK SNAKE@"
- db 28,10
- dw 4630
- text_far _OnixDexEntry
+SpearowDexEntry:
+ db "TINY BIRD@"
+ db 1,0
+ dw 40
+ text_far _SpearowDexEntry
text_end
FearowDexEntry:
@@ -428,165 +351,179 @@ FearowDexEntry:
text_far _FearowDexEntry
text_end
-PidgeyDexEntry:
- db "TINY BIRD@"
- db 1,0
- dw 40
- text_far _PidgeyDexEntry
- text_end
-
-SlowpokeDexEntry:
- db "DOPEY@"
- db 3,11
- dw 790
- text_far _SlowpokeDexEntry
+EkansDexEntry:
+ db "SNAKE@"
+ db 6,7
+ dw 150
+ text_far _EkansDexEntry
text_end
-KadabraDexEntry:
- db "PSI@"
- db 4,3
- dw 1250
- text_far _KadabraDexEntry
+ArbokDexEntry:
+ db "COBRA@"
+ db 11,6
+ dw 1430
+ text_far _ArbokDexEntry
text_end
-GravelerDexEntry:
- db "ROCK@"
- db 3,3
- dw 2320
- text_far _GravelerDexEntry
+PikachuDexEntry:
+ db "MOUSE@"
+ db 1,4
+ dw 130
+ text_far _PikachuDexEntry
text_end
-ChanseyDexEntry:
- db "EGG@"
- db 3,7
- dw 760
- text_far _ChanseyDexEntry
+RaichuDexEntry:
+ db "MOUSE@"
+ db 2,7
+ dw 660
+ text_far _RaichuDexEntry
text_end
-MachokeDexEntry:
- db "SUPERPOWER@"
- db 4,11
- dw 1550
- text_far _MachokeDexEntry
+SandshrewDexEntry:
+ db "MOUSE@"
+ db 2,0
+ dw 260
+ text_far _SandshrewDexEntry
text_end
-MrMimeDexEntry:
- db "BARRIER@"
- db 4,3
- dw 1200
- text_far _MrMimeDexEntry
+SandslashDexEntry:
+ db "MOUSE@"
+ db 3,3
+ dw 650
+ text_far _SandslashDexEntry
text_end
-HitmonleeDexEntry:
- db "KICKING@"
- db 4,11
- dw 1100
- text_far _HitmonleeDexEntry
+NidoranFDexEntry:
+ db "POISON PIN@"
+ db 1,4
+ dw 150
+ text_far _NidoranFDexEntry
text_end
-HitmonchanDexEntry:
- db "PUNCHING@"
- db 4,7
- dw 1110
- text_far _HitmonchanDexEntry
+NidorinaDexEntry:
+ db "POISON PIN@"
+ db 2,7
+ dw 440
+ text_far _NidorinaDexEntry
text_end
-ArbokDexEntry:
- db "COBRA@"
- db 11,6
- dw 1430
- text_far _ArbokDexEntry
+NidoqueenDexEntry:
+ db "DRILL@"
+ db 4,3
+ dw 1320
+ text_far _NidoqueenDexEntry
text_end
-ParasectDexEntry:
- db "MUSHROOM@"
- db 3,3
- dw 650
- text_far _ParasectDexEntry
+NidoranMDexEntry:
+ db "POISON PIN@"
+ db 1,8
+ dw 200
+ text_far _NidoranMDexEntry
text_end
-PsyduckDexEntry:
- db "DUCK@"
- db 2,7
+NidorinoDexEntry:
+ db "POISON PIN@"
+ db 2,11
dw 430
- text_far _PsyduckDexEntry
+ text_far _NidorinoDexEntry
text_end
-DrowzeeDexEntry:
- db "HYPNOSIS@"
- db 3,3
- dw 710
- text_far _DrowzeeDexEntry
+NidokingDexEntry:
+ db "DRILL@"
+ db 4,7
+ dw 1370
+ text_far _NidokingDexEntry
text_end
-GolemDexEntry:
- db "MEGATON@"
- db 4,7
- dw 6620
- text_far _GolemDexEntry
+ClefairyDexEntry:
+ db "FAIRY@"
+ db 2,0
+ dw 170
+ text_far _ClefairyDexEntry
text_end
-MagmarDexEntry:
- db "SPITFIRE@"
+ClefableDexEntry:
+ db "FAIRY@"
db 4,3
- dw 980
- text_far _MagmarDexEntry
+ dw 880
+ text_far _ClefableDexEntry
text_end
-ElectabuzzDexEntry:
- db "ELECTRIC@"
+VulpixDexEntry:
+ db "FOX@"
+ db 2,0
+ dw 220
+ text_far _VulpixDexEntry
+ text_end
+
+NinetalesDexEntry:
+ db "FOX@"
db 3,7
- dw 660
- text_far _ElectabuzzDexEntry
+ dw 440
+ text_far _NinetalesDexEntry
text_end
-MagnetonDexEntry:
- db "MAGNET@"
+JigglypuffDexEntry:
+ db "BALLOON@"
+ db 1,8
+ dw 120
+ text_far _JigglypuffDexEntry
+ text_end
+
+WigglytuffDexEntry:
+ db "BALLOON@"
db 3,3
- dw 1320
- text_far _MagnetonDexEntry
+ dw 260
+ text_far _WigglytuffDexEntry
text_end
-KoffingDexEntry:
- db "POISON GAS@"
- db 2,0
- dw 20
- text_far _KoffingDexEntry
+ZubatDexEntry:
+ db "BAT@"
+ db 2,7
+ dw 170
+ text_far _ZubatDexEntry
text_end
-MankeyDexEntry:
- db "PIG MONKEY@"
+GolbatDexEntry:
+ db "BAT@"
+ db 5,3
+ dw 1210
+ text_far _GolbatDexEntry
+ text_end
+
+OddishDexEntry:
+ db "WEED@"
db 1,8
- dw 620
- text_far _MankeyDexEntry
+ dw 120
+ text_far _OddishDexEntry
text_end
-SeelDexEntry:
- db "SEA LION@"
- db 3,7
- dw 1980
- text_far _SeelDexEntry
+GloomDexEntry:
+ db "WEED@"
+ db 2,7
+ dw 190
+ text_far _GloomDexEntry
text_end
-DiglettDexEntry:
- db "MOLE@"
- db 0,8
- dw 20
- text_far _DiglettDexEntry
+VileplumeDexEntry:
+ db "FLOWER@"
+ db 3,11
+ dw 410
+ text_far _VileplumeDexEntry
text_end
-TaurosDexEntry:
- db "WILD BULL@"
- db 4,7
- dw 1950
- text_far _TaurosDexEntry
+ParasDexEntry:
+ db "MUSHROOM@"
+ db 1,0
+ dw 120
+ text_far _ParasDexEntry
text_end
-FarfetchdDexEntry:
- db "WILD DUCK@"
- db 2,7
- dw 330
- text_far _FarfetchdDexEntry
+ParasectDexEntry:
+ db "MUSHROOM@"
+ db 3,3
+ dw 650
+ text_far _ParasectDexEntry
text_end
VenonatDexEntry:
@@ -596,60 +533,25 @@ VenonatDexEntry:
text_far _VenonatDexEntry
text_end
-DragoniteDexEntry:
- db "DRAGON@"
- db 7,3
- dw 4630
- text_far _DragoniteDexEntry
- text_end
-
-DoduoDexEntry:
- db "TWIN BIRD@"
- db 4,7
- dw 860
- text_far _DoduoDexEntry
- text_end
-
-PoliwagDexEntry:
- db "TADPOLE@"
- db 2,0
- dw 270
- text_far _PoliwagDexEntry
- text_end
-
-JynxDexEntry:
- db "HUMANSHAPE@"
- db 4,7
- dw 900
- text_far _JynxDexEntry
- text_end
-
-MoltresDexEntry:
- db "FLAME@"
- db 6,7
- dw 1320
- text_far _MoltresDexEntry
- text_end
-
-ArticunoDexEntry:
- db "FREEZE@"
- db 5,7
- dw 1220
- text_far _ArticunoDexEntry
+VenomothDexEntry:
+ db "POISONMOTH@"
+ db 4,11
+ dw 280
+ text_far _VenomothDexEntry
text_end
-ZapdosDexEntry:
- db "ELECTRIC@"
- db 5,3
- dw 1160
- text_far _ZapdosDexEntry
+DiglettDexEntry:
+ db "MOLE@"
+ db 0,8
+ dw 20
+ text_far _DiglettDexEntry
text_end
-DittoDexEntry:
- db "TRANSFORM@"
- db 1,0
- dw 90
- text_far _DittoDexEntry
+DugtrioDexEntry:
+ db "MOLE@"
+ db 2,4
+ dw 730
+ text_far _DugtrioDexEntry
text_end
MeowthDexEntry:
@@ -659,214 +561,228 @@ MeowthDexEntry:
text_far _MeowthDexEntry
text_end
-KrabbyDexEntry:
- db "RIVER CRAB@"
- db 1,4
- dw 140
- text_far _KrabbyDexEntry
+PersianDexEntry:
+ db "CLASSY CAT@"
+ db 3,3
+ dw 710
+ text_far _PersianDexEntry
text_end
-VulpixDexEntry:
- db "FOX@"
- db 2,0
- dw 220
- text_far _VulpixDexEntry
+PsyduckDexEntry:
+ db "DUCK@"
+ db 2,7
+ dw 430
+ text_far _PsyduckDexEntry
text_end
-NinetalesDexEntry:
- db "FOX@"
- db 3,7
- dw 440
- text_far _NinetalesDexEntry
+GolduckDexEntry:
+ db "DUCK@"
+ db 5,7
+ dw 1690
+ text_far _GolduckDexEntry
text_end
-PikachuDexEntry:
- db "MOUSE@"
- db 1,4
- dw 130
- text_far _PikachuDexEntry
+MankeyDexEntry:
+ db "PIG MONKEY@"
+ db 1,8
+ dw 620
+ text_far _MankeyDexEntry
text_end
-RaichuDexEntry:
- db "MOUSE@"
- db 2,7
- dw 660
- text_far _RaichuDexEntry
+PrimeapeDexEntry:
+ db "PIG MONKEY@"
+ db 3,3
+ dw 710
+ text_far _PrimeapeDexEntry
text_end
-DratiniDexEntry:
- db "DRAGON@"
- db 5,11
- dw 70
- text_far _DratiniDexEntry
+GrowlitheDexEntry:
+ db "PUPPY@"
+ db 2,4
+ dw 420
+ text_far _GrowlitheDexEntry
text_end
-DragonairDexEntry:
- db "DRAGON@"
- db 13,1
- dw 360
- text_far _DragonairDexEntry
+ArcanineDexEntry:
+ db "LEGENDARY@"
+ db 6,3
+ dw 3420
+ text_far _ArcanineDexEntry
text_end
-KabutoDexEntry:
- db "SHELLFISH@"
- db 1,8
- dw 250
- text_far _KabutoDexEntry
+PoliwagDexEntry:
+ db "TADPOLE@"
+ db 2,0
+ dw 270
+ text_far _PoliwagDexEntry
text_end
-KabutopsDexEntry:
- db "SHELLFISH@"
+PoliwhirlDexEntry:
+ db "TADPOLE@"
+ db 3,3
+ dw 440
+ text_far _PoliwhirlDexEntry
+ text_end
+
+PoliwrathDexEntry:
+ db "TADPOLE@"
db 4,3
- dw 890
- text_far _KabutopsDexEntry
+ dw 1190
+ text_far _PoliwrathDexEntry
text_end
-HorseaDexEntry:
- db "DRAGON@"
- db 1,4
- dw 180
- text_far _HorseaDexEntry
+AbraDexEntry:
+ db "PSI@"
+ db 2,11
+ dw 430
+ text_far _AbraDexEntry
text_end
-SeadraDexEntry:
- db "DRAGON@"
- db 3,11
- dw 550
- text_far _SeadraDexEntry
+KadabraDexEntry:
+ db "PSI@"
+ db 4,3
+ dw 1250
+ text_far _KadabraDexEntry
text_end
-SandshrewDexEntry:
- db "MOUSE@"
- db 2,0
- dw 260
- text_far _SandshrewDexEntry
+AlakazamDexEntry:
+ db "PSI@"
+ db 4,11
+ dw 1060
+ text_far _AlakazamDexEntry
text_end
-SandslashDexEntry:
- db "MOUSE@"
- db 3,3
- dw 650
- text_far _SandslashDexEntry
+MachopDexEntry:
+ db "SUPERPOWER@"
+ db 2,7
+ dw 430
+ text_far _MachopDexEntry
text_end
-OmanyteDexEntry:
- db "SPIRAL@"
- db 1,4
- dw 170
- text_far _OmanyteDexEntry
+MachokeDexEntry:
+ db "SUPERPOWER@"
+ db 4,11
+ dw 1550
+ text_far _MachokeDexEntry
text_end
-OmastarDexEntry:
- db "SPIRAL@"
- db 3,3
- dw 770
- text_far _OmastarDexEntry
+MachampDexEntry:
+ db "SUPERPOWER@"
+ db 5,3
+ dw 2870
+ text_far _MachampDexEntry
text_end
-JigglypuffDexEntry:
- db "BALLOON@"
- db 1,8
- dw 120
- text_far _JigglypuffDexEntry
+BellsproutDexEntry:
+ db "FLOWER@"
+ db 2,4
+ dw 90
+ text_far _BellsproutDexEntry
text_end
-WigglytuffDexEntry:
- db "BALLOON@"
+WeepinbellDexEntry:
+ db "FLYCATCHER@"
db 3,3
- dw 260
- text_far _WigglytuffDexEntry
+ dw 140
+ text_far _WeepinbellDexEntry
text_end
-EeveeDexEntry:
- db "EVOLUTION@"
- db 1,0
- dw 140
- text_far _EeveeDexEntry
+VictreebelDexEntry:
+ db "FLYCATCHER@"
+ db 5,7
+ dw 340
+ text_far _VictreebelDexEntry
text_end
-FlareonDexEntry:
- db "FLAME@"
+TentacoolDexEntry:
+ db "JELLYFISH@"
db 2,11
- dw 550
- text_far _FlareonDexEntry
+ dw 1000
+ text_far _TentacoolDexEntry
text_end
-JolteonDexEntry:
- db "LIGHTNING@"
- db 2,7
- dw 540
- text_far _JolteonDexEntry
+TentacruelDexEntry:
+ db "JELLYFISH@"
+ db 5,3
+ dw 1210
+ text_far _TentacruelDexEntry
text_end
-VaporeonDexEntry:
- db "BUBBLE JET@"
- db 3,3
- dw 640
- text_far _VaporeonDexEntry
+GeodudeDexEntry:
+ db "ROCK@"
+ db 1,4
+ dw 440
+ text_far _GeodudeDexEntry
text_end
-MachopDexEntry:
- db "SUPERPOWER@"
- db 2,7
- dw 430
- text_far _MachopDexEntry
+GravelerDexEntry:
+ db "ROCK@"
+ db 3,3
+ dw 2320
+ text_far _GravelerDexEntry
text_end
-ZubatDexEntry:
- db "BAT@"
- db 2,7
- dw 170
- text_far _ZubatDexEntry
+GolemDexEntry:
+ db "MEGATON@"
+ db 4,7
+ dw 6620
+ text_far _GolemDexEntry
text_end
-EkansDexEntry:
- db "SNAKE@"
- db 6,7
- dw 150
- text_far _EkansDexEntry
+PonytaDexEntry:
+ db "FIRE HORSE@"
+ db 3,3
+ dw 660
+ text_far _PonytaDexEntry
text_end
-ParasDexEntry:
- db "MUSHROOM@"
- db 1,0
- dw 120
- text_far _ParasDexEntry
+RapidashDexEntry:
+ db "FIRE HORSE@"
+ db 5,7
+ dw 2090
+ text_far _RapidashDexEntry
text_end
-PoliwhirlDexEntry:
- db "TADPOLE@"
- db 3,3
- dw 440
- text_far _PoliwhirlDexEntry
+SlowpokeDexEntry:
+ db "DOPEY@"
+ db 3,11
+ dw 790
+ text_far _SlowpokeDexEntry
text_end
-PoliwrathDexEntry:
- db "TADPOLE@"
- db 4,3
- dw 1190
- text_far _PoliwrathDexEntry
+SlowbroDexEntry:
+ db "HERMITCRAB@"
+ db 5,3
+ dw 1730
+ text_far _SlowbroDexEntry
text_end
-WeedleDexEntry:
- db "HAIRY BUG@"
+MagnemiteDexEntry:
+ db "MAGNET@"
db 1,0
- dw 70
- text_far _WeedleDexEntry
+ dw 130
+ text_far _MagnemiteDexEntry
text_end
-KakunaDexEntry:
- db "COCOON@"
- db 2,0
- dw 220
- text_far _KakunaDexEntry
+MagnetonDexEntry:
+ db "MAGNET@"
+ db 3,3
+ dw 1320
+ text_far _MagnetonDexEntry
text_end
-BeedrillDexEntry:
- db "POISON BEE@"
- db 3,3
- dw 650
- text_far _BeedrillDexEntry
+FarfetchdDexEntry:
+ db "WILD DUCK@"
+ db 2,7
+ dw 330
+ text_far _FarfetchdDexEntry
+ text_end
+
+DoduoDexEntry:
+ db "TWIN BIRD@"
+ db 4,7
+ dw 860
+ text_far _DoduoDexEntry
text_end
DodrioDexEntry:
@@ -876,25 +792,11 @@ DodrioDexEntry:
text_far _DodrioDexEntry
text_end
-PrimeapeDexEntry:
- db "PIG MONKEY@"
- db 3,3
- dw 710
- text_far _PrimeapeDexEntry
- text_end
-
-DugtrioDexEntry:
- db "MOLE@"
- db 2,4
- dw 730
- text_far _DugtrioDexEntry
- text_end
-
-VenomothDexEntry:
- db "POISONMOTH@"
- db 4,11
- dw 280
- text_far _VenomothDexEntry
+SeelDexEntry:
+ db "SEA LION@"
+ db 3,7
+ dw 1980
+ text_far _SeelDexEntry
text_end
DewgongDexEntry:
@@ -904,81 +806,81 @@ DewgongDexEntry:
text_far _DewgongDexEntry
text_end
-CaterpieDexEntry:
- db "WORM@"
- db 1,0
- dw 60
- text_far _CaterpieDexEntry
+GrimerDexEntry:
+ db "SLUDGE@"
+ db 2,11
+ dw 660
+ text_far _GrimerDexEntry
text_end
-MetapodDexEntry:
- db "COCOON@"
- db 2,4
- dw 220
- text_far _MetapodDexEntry
+MukDexEntry:
+ db "SLUDGE@"
+ db 3,11
+ dw 660
+ text_far _MukDexEntry
text_end
-ButterfreeDexEntry:
- db "BUTTERFLY@"
- db 3,7
- dw 710
- text_far _ButterfreeDexEntry
+ShellderDexEntry:
+ db "BIVALVE@"
+ db 1,0
+ dw 90
+ text_far _ShellderDexEntry
text_end
-MachampDexEntry:
- db "SUPERPOWER@"
- db 5,3
- dw 2870
- text_far _MachampDexEntry
+CloysterDexEntry:
+ db "BIVALVE@"
+ db 4,11
+ dw 2920
+ text_far _CloysterDexEntry
text_end
-GolduckDexEntry:
- db "DUCK@"
- db 5,7
- dw 1690
- text_far _GolduckDexEntry
+GastlyDexEntry:
+ db "GAS@"
+ db 4,3
+ dw 2
+ text_far _GastlyDexEntry
text_end
-HypnoDexEntry:
- db "HYPNOSIS@"
+HaunterDexEntry:
+ db "GAS@"
db 5,3
- dw 1670
- text_far _HypnoDexEntry
+ dw 2
+ text_far _HaunterDexEntry
text_end
-GolbatDexEntry:
- db "BAT@"
- db 5,3
- dw 1210
- text_far _GolbatDexEntry
+GengarDexEntry:
+ db "SHADOW@"
+ db 4,11
+ dw 890
+ text_far _GengarDexEntry
text_end
-MewtwoDexEntry:
- db "GENETIC@"
- db 6,7
- dw 2690
- text_far _MewtwoDexEntry
+OnixDexEntry:
+ db "ROCK SNAKE@"
+ db 28,10
+ dw 4630
+ text_far _OnixDexEntry
text_end
-SnorlaxDexEntry:
- db "SLEEPING@"
- db 6,11
- dw 10140
- text_far _SnorlaxDexEntry
+DrowzeeDexEntry:
+ db "HYPNOSIS@"
+ db 3,3
+ dw 710
+ text_far _DrowzeeDexEntry
text_end
-MagikarpDexEntry:
- db "FISH@"
- db 2,11
- dw 220
- text_far _MagikarpDexEntry
+HypnoDexEntry:
+ db "HYPNOSIS@"
+ db 5,3
+ dw 1670
+ text_far _HypnoDexEntry
text_end
-MukDexEntry:
- db "SLUDGE@"
- db 3,11
- dw 660
- text_far _MukDexEntry
+KrabbyDexEntry:
+ db "RIVER CRAB@"
+ db 1,4
+ dw 140
+ text_far _KrabbyDexEntry
text_end
KinglerDexEntry:
@@ -988,11 +890,11 @@ KinglerDexEntry:
text_far _KinglerDexEntry
text_end
-CloysterDexEntry:
- db "BIVALVE@"
- db 4,11
- dw 2920
- text_far _CloysterDexEntry
+VoltorbDexEntry:
+ db "BALL@"
+ db 1,8
+ dw 230
+ text_far _VoltorbDexEntry
text_end
ElectrodeDexEntry:
@@ -1002,25 +904,25 @@ ElectrodeDexEntry:
text_far _ElectrodeDexEntry
text_end
-ClefableDexEntry:
- db "FAIRY@"
- db 4,3
- dw 880
- text_far _ClefableDexEntry
+ExeggcuteDexEntry:
+ db "EGG@"
+ db 1,4
+ dw 60
+ text_far _ExeggcuteDexEntry
text_end
-WeezingDexEntry:
- db "POISON GAS@"
- db 3,11
- dw 210
- text_far _WeezingDexEntry
+ExeggutorDexEntry:
+ db "COCONUT@"
+ db 6,7
+ dw 2650
+ text_far _ExeggutorDexEntry
text_end
-PersianDexEntry:
- db "CLASSY CAT@"
- db 3,3
- dw 710
- text_far _PersianDexEntry
+CuboneDexEntry:
+ db "LONELY@"
+ db 1,4
+ dw 140
+ text_far _CuboneDexEntry
text_end
MarowakDexEntry:
@@ -1030,67 +932,88 @@ MarowakDexEntry:
text_far _MarowakDexEntry
text_end
-HaunterDexEntry:
- db "GAS@"
- db 5,3
- dw 2
- text_far _HaunterDexEntry
+HitmonleeDexEntry:
+ db "KICKING@"
+ db 4,11
+ dw 1100
+ text_far _HitmonleeDexEntry
text_end
-AbraDexEntry:
- db "PSI@"
- db 2,11
- dw 430
- text_far _AbraDexEntry
+HitmonchanDexEntry:
+ db "PUNCHING@"
+ db 4,7
+ dw 1110
+ text_far _HitmonchanDexEntry
text_end
-AlakazamDexEntry:
- db "PSI@"
- db 4,11
- dw 1060
- text_far _AlakazamDexEntry
+LickitungDexEntry:
+ db "LICKING@"
+ db 3,11
+ dw 1440
+ text_far _LickitungDexEntry
text_end
-PidgeottoDexEntry:
- db "BIRD@"
- db 3,7
- dw 660
- text_far _PidgeottoDexEntry
+KoffingDexEntry:
+ db "POISON GAS@"
+ db 2,0
+ dw 20
+ text_far _KoffingDexEntry
text_end
-PidgeotDexEntry:
- db "BIRD@"
- db 4,11
- dw 870
- text_far _PidgeotDexEntry
+WeezingDexEntry:
+ db "POISON GAS@"
+ db 3,11
+ dw 210
+ text_far _WeezingDexEntry
text_end
-StarmieDexEntry:
- db "MYSTERIOUS@"
+RhyhornDexEntry:
+ db "SPIKES@"
+ db 3,3
+ dw 2540
+ text_far _RhyhornDexEntry
+ text_end
+
+RhydonDexEntry:
+ db "DRILL@"
+ db 6,3
+ dw 2650
+ text_far _RhydonDexEntry
+ text_end
+
+ChanseyDexEntry:
+ db "EGG@"
db 3,7
- dw 1760
- text_far _StarmieDexEntry
+ dw 760
+ text_far _ChanseyDexEntry
text_end
-BulbasaurDexEntry:
- db "SEED@"
- db 2,4
- dw 150
- text_far _BulbasaurDexEntry
+TangelaDexEntry:
+ db "VINE@"
+ db 3,3
+ dw 770
+ text_far _TangelaDexEntry
text_end
-VenusaurDexEntry:
- db "SEED@"
- db 6,7
- dw 2210
- text_far _VenusaurDexEntry
+KangaskhanDexEntry:
+ db "PARENT@"
+ db 7,3
+ dw 1760
+ text_far _KangaskhanDexEntry
text_end
-TentacruelDexEntry:
- db "JELLYFISH@"
- db 5,3
- dw 1210
- text_far _TentacruelDexEntry
+HorseaDexEntry:
+ db "DRAGON@"
+ db 1,4
+ dw 180
+ text_far _HorseaDexEntry
+ text_end
+
+SeadraDexEntry:
+ db "DRAGON@"
+ db 3,11
+ dw 550
+ text_far _SeadraDexEntry
text_end
GoldeenDexEntry:
@@ -1107,53 +1030,123 @@ SeakingDexEntry:
text_far _SeakingDexEntry
text_end
-PonytaDexEntry:
- db "FIRE HORSE@"
- db 3,3
+StaryuDexEntry:
+ db "STARSHAPE@"
+ db 2,7
+ dw 760
+ text_far _StaryuDexEntry
+ text_end
+
+StarmieDexEntry:
+ db "MYSTERIOUS@"
+ db 3,7
+ dw 1760
+ text_far _StarmieDexEntry
+ text_end
+
+MrMimeDexEntry:
+ db "BARRIER@"
+ db 4,3
+ dw 1200
+ text_far _MrMimeDexEntry
+ text_end
+
+ScytherDexEntry:
+ db "MANTIS@"
+ db 4,11
+ dw 1230
+ text_far _ScytherDexEntry
+ text_end
+
+JynxDexEntry:
+ db "HUMANSHAPE@"
+ db 4,7
+ dw 900
+ text_far _JynxDexEntry
+ text_end
+
+ElectabuzzDexEntry:
+ db "ELECTRIC@"
+ db 3,7
dw 660
- text_far _PonytaDexEntry
+ text_far _ElectabuzzDexEntry
text_end
-RapidashDexEntry:
- db "FIRE HORSE@"
- db 5,7
- dw 2090
- text_far _RapidashDexEntry
+MagmarDexEntry:
+ db "SPITFIRE@"
+ db 4,3
+ dw 980
+ text_far _MagmarDexEntry
text_end
-RattataDexEntry:
- db "RAT@"
- db 1,0
- dw 80
- text_far _RattataDexEntry
+PinsirDexEntry:
+ db "STAGBEETLE@"
+ db 4,11
+ dw 1210
+ text_far _PinsirDexEntry
text_end
-RaticateDexEntry:
- db "RAT@"
- db 2,4
- dw 410
- text_far _RaticateDexEntry
+TaurosDexEntry:
+ db "WILD BULL@"
+ db 4,7
+ dw 1950
+ text_far _TaurosDexEntry
text_end
-NidorinoDexEntry:
- db "POISON PIN@"
+MagikarpDexEntry:
+ db "FISH@"
db 2,11
- dw 430
- text_far _NidorinoDexEntry
+ dw 220
+ text_far _MagikarpDexEntry
text_end
-NidorinaDexEntry:
- db "POISON PIN@"
+GyaradosDexEntry:
+ db "ATROCIOUS@"
+ db 21,4
+ dw 5180
+ text_far _GyaradosDexEntry
+ text_end
+
+LaprasDexEntry:
+ db "TRANSPORT@"
+ db 8,2
+ dw 4850
+ text_far _LaprasDexEntry
+ text_end
+
+DittoDexEntry:
+ db "TRANSFORM@"
+ db 1,0
+ dw 90
+ text_far _DittoDexEntry
+ text_end
+
+EeveeDexEntry:
+ db "EVOLUTION@"
+ db 1,0
+ dw 140
+ text_far _EeveeDexEntry
+ text_end
+
+VaporeonDexEntry:
+ db "BUBBLE JET@"
+ db 3,3
+ dw 640
+ text_far _VaporeonDexEntry
+ text_end
+
+JolteonDexEntry:
+ db "LIGHTNING@"
db 2,7
- dw 440
- text_far _NidorinaDexEntry
+ dw 540
+ text_far _JolteonDexEntry
text_end
-GeodudeDexEntry:
- db "ROCK@"
- db 1,4
- dw 440
- text_far _GeodudeDexEntry
+FlareonDexEntry:
+ db "FLAME@"
+ db 2,11
+ dw 550
+ text_far _FlareonDexEntry
text_end
PorygonDexEntry:
@@ -1163,95 +1156,102 @@ PorygonDexEntry:
text_far _PorygonDexEntry
text_end
-AerodactylDexEntry:
- db "FOSSIL@"
- db 5,11
- dw 1300
- text_far _AerodactylDexEntry
+OmanyteDexEntry:
+ db "SPIRAL@"
+ db 1,4
+ dw 170
+ text_far _OmanyteDexEntry
text_end
-MagnemiteDexEntry:
- db "MAGNET@"
- db 1,0
- dw 130
- text_far _MagnemiteDexEntry
+OmastarDexEntry:
+ db "SPIRAL@"
+ db 3,3
+ dw 770
+ text_far _OmastarDexEntry
text_end
-CharmanderDexEntry:
- db "LIZARD@"
- db 2,0
- dw 190
- text_far _CharmanderDexEntry
+KabutoDexEntry:
+ db "SHELLFISH@"
+ db 1,8
+ dw 250
+ text_far _KabutoDexEntry
text_end
-SquirtleDexEntry:
- db "TINYTURTLE@"
- db 1,8
- dw 200
- text_far _SquirtleDexEntry
+KabutopsDexEntry:
+ db "SHELLFISH@"
+ db 4,3
+ dw 890
+ text_far _KabutopsDexEntry
text_end
-CharmeleonDexEntry:
- db "FLAME@"
- db 3,7
- dw 420
- text_far _CharmeleonDexEntry
+AerodactylDexEntry:
+ db "FOSSIL@"
+ db 5,11
+ dw 1300
+ text_far _AerodactylDexEntry
text_end
-WartortleDexEntry:
- db "TURTLE@"
- db 3,3
- dw 500
- text_far _WartortleDexEntry
+SnorlaxDexEntry:
+ db "SLEEPING@"
+ db 6,11
+ dw 10140
+ text_far _SnorlaxDexEntry
text_end
-CharizardDexEntry:
- db "FLAME@"
+ArticunoDexEntry:
+ db "FREEZE@"
db 5,7
- dw 2000
- text_far _CharizardDexEntry
+ dw 1220
+ text_far _ArticunoDexEntry
text_end
-OddishDexEntry:
- db "WEED@"
- db 1,8
- dw 120
- text_far _OddishDexEntry
+ZapdosDexEntry:
+ db "ELECTRIC@"
+ db 5,3
+ dw 1160
+ text_far _ZapdosDexEntry
text_end
-GloomDexEntry:
- db "WEED@"
- db 2,7
- dw 190
- text_far _GloomDexEntry
+MoltresDexEntry:
+ db "FLAME@"
+ db 6,7
+ dw 1320
+ text_far _MoltresDexEntry
text_end
-VileplumeDexEntry:
- db "FLOWER@"
- db 3,11
- dw 410
- text_far _VileplumeDexEntry
+DratiniDexEntry:
+ db "DRAGON@"
+ db 5,11
+ dw 70
+ text_far _DratiniDexEntry
text_end
-BellsproutDexEntry:
- db "FLOWER@"
- db 2,4
- dw 90
- text_far _BellsproutDexEntry
+DragonairDexEntry:
+ db "DRAGON@"
+ db 13,1
+ dw 360
+ text_far _DragonairDexEntry
text_end
-WeepinbellDexEntry:
- db "FLYCATCHER@"
- db 3,3
- dw 140
- text_far _WeepinbellDexEntry
+DragoniteDexEntry:
+ db "DRAGON@"
+ db 7,3
+ dw 4630
+ text_far _DragoniteDexEntry
text_end
-VictreebelDexEntry:
- db "FLYCATCHER@"
- db 5,7
- dw 340
- text_far _VictreebelDexEntry
+MewtwoDexEntry:
+ db "GENETIC@"
+ db 6,7
+ dw 2690
+ text_far _MewtwoDexEntry
+ text_end
+
+MewDexEntry:
+ db "NEW SPECIE@"
+ db 1,4
+ dw 90
+ text_far _MewDexEntry
text_end
MissingNoDexEntry:
diff --git a/data/pokemon/dex_text.asm b/data/pokemon/dex_text.asm
index cdb7e179..7e84a83d 100644
--- a/data/pokemon/dex_text.asm
+++ b/data/pokemon/dex_text.asm
@@ -1,1509 +1,1508 @@
-_RhydonDexEntry::
- text "Protected by an"
- next "armor-like hide,"
- next "it is capable of"
+_BulbasaurDexEntry::
+ text "It can go for days"
+ next "without eating a"
+ next "single morsel."
- page "living in molten"
- next "lava of 3,600"
- next "degrees"
+ page "In the bulb on"
+ next "its back, it"
+ next "stores energy"
dex
-_KangaskhanDexEntry::
- text "The infant rarely"
- next "ventures out of"
- next "its mother's"
+_IvysaurDexEntry::
+ text "The bulb on its"
+ next "back grows by"
+ next "drawing energy."
- page "protective pouch"
- next "until it is 3"
- next "years old"
+ page "It gives off an"
+ next "aroma when it is"
+ next "ready to bloom"
dex
-_NidoranMDexEntry::
- text "Stiffens its ears"
- next "to sense danger."
- next "The larger its"
+_VenusaurDexEntry::
+ text "The flower on its"
+ next "back catches the"
+ next "sun's rays."
- page "horns, the more"
- next "powerful its"
- next "secreted venom"
+ page "The sunlight is"
+ next "then absorbed and"
+ next "used for energy"
dex
-_ClefairyDexEntry::
- text "Its magical and"
- next "cute appeal has"
- next "many admirers."
+_CharmanderDexEntry::
+ text "The flame at the"
+ next "tip of its tail"
+ next "makes a sound as"
- page "It is rare and"
- next "found only in"
- next "certain areas"
+ page "it burns. You can"
+ next "only hear it in"
+ next "quiet places"
dex
-_SpearowDexEntry::
- text "Eats bugs in"
- next "grassy areas. It"
- next "has to flap its"
+_CharmeleonDexEntry::
+ text "Tough fights could"
+ next "excite this"
+ next "#MON. When"
- page "short wings at"
- next "high speed to"
- next "stay airborne"
+ page "excited, it may"
+ next "blow out bluish-"
+ next "white flames"
dex
-_VoltorbDexEntry::
- text "Usually found in"
- next "power plants."
- next "Easily mistaken"
+_CharizardDexEntry::
+ text "When expelling a"
+ next "blast of super"
+ next "hot fire, the red"
- page "for a # BALL,"
- next "they have zapped"
- next "many people"
+ page "flame at the tip"
+ next "of its tail burns"
+ next "more intensely"
dex
-_NidokingDexEntry::
- text "It uses its"
- next "powerful tail in"
- next "battle to smash,"
+_SquirtleDexEntry::
+ text "Shoots water at"
+ next "prey while in the"
+ next "water."
- page "constrict, then"
- next "break the prey's"
- next "bones"
+ page "Withdraws into"
+ next "its shell when in"
+ next "danger"
dex
-_SlowbroDexEntry::
- text "The SHELLDER that"
- next "is latched onto"
- next "SLOWPOKE's tail"
+_WartortleDexEntry::
+ text "When tapped, this"
+ next "#MON will pull"
+ next "in its head, but"
- page "is said to feed"
- next "on the host's left"
- next "over scraps"
+ page "its tail will"
+ next "still stick out a"
+ next "little bit"
dex
-_IvysaurDexEntry::
- text "When the bulb on"
- next "its back grows"
- next "large, it appears"
+_BlastoiseDexEntry::
+ text "Once it takes aim"
+ next "at its enemy, it"
+ next "blasts out water"
- page "to lose the"
- next "ability to stand"
- next "on its hind legs"
+ page "with even more"
+ next "force than a fire"
+ next "hose"
dex
-_ExeggutorDexEntry::
- text "Legend has it that"
- next "on rare occasions,"
- next "one of its heads"
+_CaterpieDexEntry::
+ text "If you touch the"
+ next "feeler on top of"
+ next "its head, it will"
- page "will drop off and"
- next "continue on as an"
- next "EXEGGCUTE"
+ page "release a horrible"
+ next "stink to protect"
+ next "itself"
dex
-_LickitungDexEntry::
- text "Its tongue can be"
- next "extended like a"
- next "chameleon's. It"
+_MetapodDexEntry::
+ text "Hardens its shell"
+ next "to protect itself."
+ next "However, a large"
- page "leaves a tingling"
- next "sensation when it"
- next "licks enemies"
+ page "impact may cause"
+ next "it to pop out of"
+ next "its shell"
dex
-_ExeggcuteDexEntry::
- text "Often mistaken"
- next "for eggs."
- next "When disturbed,"
+_ButterfreeDexEntry::
+ text "Its wings, covered"
+ next "with poisonous"
+ next "powders, repel"
- page "they quickly"
- next "gather and attack"
- next "in swarms"
+ page "water. This"
+ next "allows it to fly"
+ next "in the rain"
dex
-_GrimerDexEntry::
- text "Appears in filthy"
- next "areas. Thrives by"
- next "sucking up"
+_WeedleDexEntry::
+ text "Beware of the"
+ next "sharp stinger on"
+ next "its head. It"
- page "polluted sludge"
- next "that is pumped"
- next "out of factories"
+ page "hides in grass"
+ next "and bushes where"
+ next "it eats leaves"
dex
-_GengarDexEntry::
- text "Under a full moon,"
- next "this #MON"
- next "likes to mimic"
+_KakunaDexEntry::
+ text "Able to move only"
+ next "slightly. When"
+ next "endangered, it"
- page "the shadows of"
- next "people and laugh"
- next "at their fright"
+ page "may stick out its"
+ next "stinger and poison"
+ next "its enemy"
dex
-_NidoranFDexEntry::
- text "Although small,"
- next "its venomous"
- next "barbs render this"
+_BeedrillDexEntry::
+ text "It has 3 poisonous"
+ next "stingers on its"
+ next "forelegs and its"
- page "#MON dangerous."
- next "The female has"
- next "smaller horns"
+ page "tail. They are"
+ next "used to jab its"
+ next "enemy repeatedly"
dex
-_NidoqueenDexEntry::
- text "Its hard scales"
- next "provide strong"
- next "protection. It"
+_PidgeyDexEntry::
+ text "Very docile. If"
+ next "attacked, it will"
+ next "often kick up"
- page "uses its hefty"
- next "bulk to execute"
- next "powerful moves"
+ page "sand to protect"
+ next "itself rather"
+ next "than fight back"
dex
-_CuboneDexEntry::
- text "Because it never"
- next "removes its skull"
- next "helmet, no one"
+_PidgeottoDexEntry::
+ text "This #MON is"
+ next "full of vitality."
+ next "It constantly"
- page "has ever seen"
- next "this #MON's"
- next "real face"
+ page "flies around its"
+ next "large territory in"
+ next "search of prey"
dex
-_RhyhornDexEntry::
- text "Its massive bones"
- next "are 1000 times"
- next "harder than human"
+_PidgeotDexEntry::
+ text "This #MON flies"
+ next "at Mach 2 speed,"
+ next "seeking prey."
- page "bones. It can"
- next "easily knock a"
- next "trailer flying"
+ page "Its large talons"
+ next "are feared as"
+ next "wicked weapons"
dex
-_LaprasDexEntry::
- text "A #MON that"
- next "has been over-"
- next "hunted almost to"
+_RattataDexEntry::
+ text "Will chew on any-"
+ next "thing with its"
+ next "fangs. If you see"
- page "extinction. It"
- next "can ferry people"
- next "across the water"
+ page "one, it is certain"
+ next "that 40 more live"
+ next "in the area"
dex
-_ArcanineDexEntry::
- text "A #MON that"
- next "has been admired"
- next "since the past"
+_RaticateDexEntry::
+ text "Its hind feet are"
+ next "webbed. They act"
+ next "as flippers, so"
- page "for its beauty."
- next "It runs agilely"
- next "as if on wings"
+ page "it can swim in"
+ next "rivers and hunt"
+ next "for prey"
dex
-_MewDexEntry::
- text "So rare that it"
- next "is still said to"
- next "be a mirage by"
+_SpearowDexEntry::
+ text "Inept at flying"
+ next "high. However, it"
+ next "can fly around"
- page "many experts. Only"
- next "a few people have"
- next "seen it worldwide"
+ page "very fast to"
+ next "protect its ter-"
+ next "ritory"
dex
-_GyaradosDexEntry::
- text "Rarely seen in"
- next "the wild. Huge"
- next "and vicious, it"
+_FearowDexEntry::
+ text "A #MON that"
+ next "dates back many"
+ next "years. If it"
- page "is capable of"
- next "destroying entire"
- next "cities in a rage"
+ page "senses danger, it"
+ next "flies high and"
+ next "away, instantly"
dex
-_ShellderDexEntry::
- text "Its hard shell"
- next "repels any kind"
- next "of attack."
+_EkansDexEntry::
+ text "The older it gets,"
+ next "the longer it"
+ next "grows. At night,"
- page "It is vulnerable"
- next "only when its"
- next "shell is open"
+ page "it wraps its long"
+ next "body around tree"
+ next "branches to rest"
dex
-_TentacoolDexEntry::
- text "Drifts in shallow"
- next "seas. Anglers who"
- next "hook them by"
+_ArbokDexEntry::
+ text "The frightening"
+ next "patterns on its"
+ next "belly have been"
- page "accident are"
- next "often punished by"
- next "its stinging acid"
+ page "studied. Six"
+ next "variations have"
+ next "been confirmed"
dex
-_GastlyDexEntry::
- text "Almost invisible,"
- next "this gaseous"
- next "#MON cloaks"
+_PikachuDexEntry::
+ text "It keeps its tail"
+ next "raised to monitor"
+ next "its surroundings."
- page "the target and"
- next "puts it to sleep"
- next "without notice"
+ page "If you yank its"
+ next "tail, it will try"
+ next "to bite you"
dex
-_ScytherDexEntry::
- text "With ninja-like"
- next "agility and speed,"
- next "it can create the"
+_RaichuDexEntry::
+ text "When electricity"
+ next "builds up inside"
+ next "its body, it"
- page "illusion that"
- next "there is more"
- next "than one"
+ page "becomes feisty."
+ next "It also glows in"
+ next "the dark"
dex
-_StaryuDexEntry::
- text "An enigmatic"
- next "#MON that can"
- next "effortlessly"
+_SandshrewDexEntry::
+ text "Its body is dry."
+ next "When it gets cold"
+ next "at night, its"
- page "regenerate any"
- next "appendage it"
- next "loses in battle"
+ page "hide is said to"
+ next "become coated with"
+ next "a fine dew"
dex
-_BlastoiseDexEntry::
- text "A brutal #MON"
- next "with pressurized"
- next "water jets on its"
+_SandslashDexEntry::
+ text "It is skilled at"
+ next "slashing enemies"
+ next "with its claws."
- page "shell. They are"
- next "used for high"
- next "speed tackles"
+ page "If broken, they"
+ next "start to grow back"
+ next "in a day"
dex
-_PinsirDexEntry::
- text "If it fails to"
- next "crush the victim"
- next "in its pincers,"
+_NidoranFDexEntry::
+ text "A mild-mannered"
+ next "#MON that does"
+ next "not like to"
- page "it will swing it"
- next "around and toss"
- next "it hard"
+ page "fight. Beware, its"
+ next "small horns"
+ next "secrete venom"
dex
-_TangelaDexEntry::
- text "The whole body is"
- next "swathed with wide"
- next "vines that are"
+_NidorinaDexEntry::
+ text "When resting deep"
+ next "in its burrow, its"
+ next "thorns always"
- page "similar to sea-"
- next "weed. Its vines"
- next "shake as it walks"
+ page "retract."
+ next "This is proof that"
+ next "it is relaxed"
dex
-_GrowlitheDexEntry::
- text "Very protective"
- next "of its territory."
- next "It will bark and"
+_NidoqueenDexEntry::
+ text "Tough scales cover"
+ next "the sturdy body"
+ next "of this #MON."
- page "bite to repel"
- next "intruders from"
- next "its space"
+ page "It appears that"
+ next "the scales grow"
+ next "in cycles"
dex
-_OnixDexEntry::
- text "As it grows, the"
- next "stone portions of"
- next "its body harden"
+_NidoranMDexEntry::
+ text "Its large ears"
+ next "are always kept"
+ next "upright. If it"
- page "to become similar"
- next "to a diamond, but"
- next "colored black"
+ page "senses danger, it"
+ next "will attack with a"
+ next "poisonous sting"
dex
-_FearowDexEntry::
- text "With its huge and"
- next "magnificent wings,"
- next "it can keep aloft"
+_NidorinoDexEntry::
+ text "Its horns contain"
+ next "venom. If they"
+ next "are stabbed into"
- page "without ever"
- next "having to land"
- next "for rest"
+ page "an enemy, the"
+ next "impact makes the"
+ next "poison leak out"
dex
-_PidgeyDexEntry::
- text "A common sight in"
- next "forests and woods."
- next "It flaps its"
+_NidokingDexEntry::
+ text "Its steel-like"
+ next "hide adds to its"
+ next "powerful tackle."
- page "wings at ground"
- next "level to kick up"
- next "blinding sand"
+ page "Its horns are so"
+ next "hard, they can"
+ next "pierce a diamond"
dex
-_SlowpokeDexEntry::
- text "Incredibly slow"
- next "and dopey. It"
- next "takes 5 seconds"
+_ClefairyDexEntry::
+ text "Adored for their"
+ next "cute looks and"
+ next "playfulness. They"
- page "for it to feel"
- next "pain when under"
- next "attack"
+ page "are thought to be"
+ next "rare, as they do"
+ next "not appear often"
dex
-_KadabraDexEntry::
- text "It emits special"
- next "alpha waves from"
- next "its body that"
+_ClefableDexEntry::
+ text "They appear to be"
+ next "very protective of"
+ next "their own world."
- page "induce headaches"
- next "just by being"
- next "close by"
+ page "It is a kind of"
+ next "fairy, rarely seen"
+ next "by people"
dex
-_GravelerDexEntry::
- text "Rolls down slopes"
- next "to move. It rolls"
- next "over any obstacle"
+_VulpixDexEntry::
+ text "Both its fur and"
+ next "its tails are"
+ next "beautiful. As it"
- page "without slowing"
- next "or changing its"
- next "direction"
+ page "grows, the tails"
+ next "split and form"
+ next "more tails"
dex
-_ChanseyDexEntry::
- text "A rare and elusive"
- next "#MON that is"
- next "said to bring"
+_NinetalesDexEntry::
+ text "According to an"
+ next "enduring legend,"
+ next "9 noble saints"
- page "happiness to those"
- next "who manage to get"
- next "it"
+ page "were united and"
+ next "reincarnated as"
+ next "this #MON"
dex
-_MachokeDexEntry::
- text "Its muscular body"
- next "is so powerful, it"
- next "must wear a power"
+_JigglypuffDexEntry::
+ text "Uses its alluring"
+ next "eyes to enrapture"
+ next "its foe. It then"
- page "save belt to be"
- next "able to regulate"
- next "its motions"
+ page "sings a pleasing"
+ next "melody that lulls"
+ next "the foe to sleep"
dex
-_MrMimeDexEntry::
- text "If interrupted"
- next "while it is"
- next "miming, it will"
+_WigglytuffDexEntry::
+ text "Its body is full"
+ next "of elasticity. By"
+ next "inhaling deeply,"
- page "slap around the"
- next "offender with its"
- next "broad hands"
+ page "it can continue"
+ next "to inflate itself"
+ next "without limit"
dex
-_HitmonleeDexEntry::
- text "When in a hurry,"
- next "its legs lengthen"
- next "progressively."
+_ZubatDexEntry::
+ text "Emits ultrasonic"
+ next "cries while it"
+ next "flies. They act"
- page "It runs smoothly"
- next "with extra long,"
- next "loping strides"
+ page "as a sonar used"
+ next "to check for ob-"
+ next "jects in its way"
dex
-_HitmonchanDexEntry::
- text "While apparently"
- next "doing nothing, it"
- next "fires punches in"
+_GolbatDexEntry::
+ text "It attacks in a"
+ next "stealthy manner,"
+ next "without warning."
- page "lightning fast"
- next "volleys that are"
- next "impossible to see"
+ page "Its sharp fangs"
+ next "are used to bite"
+ next "and suck blood"
dex
-_ArbokDexEntry::
- text "It is rumored that"
- next "the ferocious"
- next "warning markings"
+_OddishDexEntry::
+ text "It may be mistaken"
+ next "for a clump of"
+ next "weeds. If you try"
- page "on its belly"
- next "differ from area"
- next "to area"
+ page "to yank it out of"
+ next "the ground, it"
+ next "shrieks horribly"
dex
-_ParasectDexEntry::
- text "A host-parasite"
- next "pair in which the"
- next "parasite mushroom"
+_GloomDexEntry::
+ text "Smells incredibly"
+ next "foul! However,"
+ next "around 1 out of"
- page "has taken over the"
- next "host bug. Prefers"
- next "damp places"
+ page "1,000 people enjoy"
+ next "sniffing its nose-"
+ next "bending stink"
dex
-_PsyduckDexEntry::
- text "While lulling its"
- next "enemies with its"
- next "vacant look, this"
+_VileplumeDexEntry::
+ text "Flaps its broad"
+ next "flower petals to"
+ next "scatter its"
- page "wily #MON will"
- next "use psychokinetic"
- next "powers"
+ page "poisonous pollen."
+ next "The flapping sound"
+ next "is very loud"
dex
-_DrowzeeDexEntry::
- text "Puts enemies to"
- next "sleep then eats"
- next "their dreams."
+_ParasDexEntry::
+ text "Burrows under the"
+ next "ground to gnaw on"
+ next "tree roots. The"
- page "Occasionally gets"
- next "sick from eating"
- next "bad dreams"
+ page "mushrooms on its"
+ next "back absorb most"
+ next "of the nutrition"
dex
-_GolemDexEntry::
- text "Its boulder-like"
- next "body is extremely"
- next "hard. It can"
+_ParasectDexEntry::
+ text "The bug host is"
+ next "drained of energy"
+ next "by the mushrooms"
- page "easily withstand"
- next "dynamite blasts"
- next "without damage"
+ page "on its back. They"
+ next "appear to do all"
+ next "the thinking"
dex
-_MagmarDexEntry::
- text "Its body always"
- next "burns with an"
- next "orange glow that"
+_VenonatDexEntry::
+ text "Its large eyes act"
+ next "as radars. In a"
+ next "bright place, you"
- page "enables it to"
- next "hide perfectly"
- next "among flames"
+ page "can see that they"
+ next "are clusters of"
+ next "many tiny eyes"
dex
-_ElectabuzzDexEntry::
- text "Normally found"
- next "near power plants,"
- next "they can wander"
+_VenomothDexEntry::
+ text "The powdery scales"
+ next "on its wings are"
+ next "hard to remove."
- page "away and cause"
- next "major blackouts"
- next "in cities"
+ page "They also contain"
+ next "poison that leaks"
+ next "out on contact"
dex
-_MagnetonDexEntry::
- text "Formed by several"
- next "MAGNEMITEs linked"
- next "together. They"
+_DiglettDexEntry::
+ text "It prefers dark"
+ next "places. It spends"
+ next "most of its time"
- page "frequently appear"
- next "when sunspots"
- next "flare up"
+ page "underground,"
+ next "though it may pop"
+ next "up in caves"
dex
-_KoffingDexEntry::
- text "Because it stores"
- next "several kinds of"
- next "toxic gases in"
+_DugtrioDexEntry::
+ text "A team of triplets"
+ next "that can burrow"
+ next "over 60 MPH."
- page "its body, it is"
- next "prone to exploding"
- next "without warning"
+ page "Due to this, some"
+ next "people think it's"
+ next "an earthquake"
dex
-_MankeyDexEntry::
- text "Extremely quick to"
- next "anger. It could"
- next "be docile one"
+_MeowthDexEntry::
+ text "Appears to be more"
+ next "active at night."
+ next "It loves round"
- page "moment then"
- next "thrashing away"
- next "the next instant"
+ page "and shiny things."
+ next "It can't stop from"
+ next "picking them up"
dex
-_SeelDexEntry::
- text "The protruding"
- next "horn on its head"
- next "is very hard."
+_PersianDexEntry::
+ text "The gem in its"
+ next "forehead glows on"
+ next "its own! It walks"
- page "It is used for"
- next "bashing through"
- next "thick ice"
+ page "with all the grace"
+ next "and elegance of a"
+ next "proud queen"
dex
-_DiglettDexEntry::
- text "Lives about one"
- next "yard underground"
- next "where it feeds on"
+_PsyduckDexEntry::
+ text "Always tormented"
+ next "by headaches."
+ next "It uses psychic"
- page "plant roots. It"
- next "sometimes appears"
- next "above ground"
+ page "powers, but it is"
+ next "not known if it"
+ next "intends to do so"
dex
-_TaurosDexEntry::
- text "When it targets"
- next "an enemy, it"
- next "charges furiously"
+_GolduckDexEntry::
+ text "Its slim and long"
+ next "limbs end in broad"
+ next "flippers. They"
- page "while whipping its"
- next "body with its"
- next "long tails"
+ page "are used for swim-"
+ next "ming gracefully"
+ next "in lakes"
dex
-_FarfetchdDexEntry::
- text "The sprig of"
- next "green onions it"
- next "holds is its"
+_MankeyDexEntry::
+ text "An agile #MON"
+ next "that lives in"
+ next "trees. It angers"
- page "weapon. It is"
- next "used much like a"
- next "metal sword"
+ page "easily and will"
+ next "not hesitate to"
+ next "attack anything"
dex
-_VenonatDexEntry::
- text "Lives in the"
- next "shadows of tall"
- next "trees where it"
+_PrimeapeDexEntry::
+ text "It stops being"
+ next "angry only when"
+ next "nobody else is"
- page "eats insects. It"
- next "is attracted by"
- next "light at night"
+ page "around. To view"
+ next "this moment is"
+ next "very difficult"
dex
-_DragoniteDexEntry::
- text "An extremely"
- next "rarely seen"
- next "marine #MON."
+_GrowlitheDexEntry::
+ text "A #MON with a"
+ next "friendly nature."
+ next "However, it will"
- page "Its intelligence"
- next "is said to match"
- next "that of humans"
+ page "bark fiercely at"
+ next "anything invading"
+ next "its territory"
dex
-_DoduoDexEntry::
- text "A bird that makes"
- next "up for its poor"
- next "flying with its"
+_ArcanineDexEntry::
+ text "A legendary #-"
+ next "MON in China."
+ next "Many people are"
- page "fast foot speed."
- next "Leaves giant"
- next "footprints"
+ page "charmed by its"
+ next "grace and beauty"
+ next "while running"
dex
_PoliwagDexEntry::
- text "Its newly grown"
- next "legs prevent it"
- next "from running. It"
+ text "The direction of"
+ next "the spiral on the"
+ next "belly differs by"
- page "appears to prefer"
- next "swimming than"
- next "trying to stand"
+ page "area. It is more"
+ next "adept at swimming"
+ next "than walking"
dex
-_JynxDexEntry::
- text "It seductively"
- next "wiggles its hips"
- next "as it walks. It"
+_PoliwhirlDexEntry::
+ text "Under attack, it"
+ next "uses its belly "
+ next "spiral to put the"
- page "can cause people"
- next "to dance in"
- next "unison with it"
+ page "foe to sleep. It"
+ next "then makes its"
+ next "escape"
dex
-_MoltresDexEntry::
- text "Known as the"
- next "legendary bird of"
- next "fire. Every flap"
+_PoliwrathDexEntry::
+ text "Swims powerfully"
+ next "using all the"
+ next "muscles in its"
- page "of its wings"
- next "creates a dazzling"
- next "flash of flames"
+ page "body. It can even"
+ next "overtake champion"
+ next "swimmers"
dex
-_ArticunoDexEntry::
- text "A legendary bird"
- next "#MON that is"
- next "said to appear to"
+_AbraDexEntry::
+ text "Sleeps 18 hours a"
+ next "day. If it senses"
+ next "danger, it will"
- page "doomed people who"
- next "are lost in icy"
- next "mountains"
+ page "teleport itself to"
+ next "safety even as it"
+ next "sleeps"
dex
-_ZapdosDexEntry::
- text "A legendary bird"
- next "#MON that is"
- next "said to appear"
+_KadabraDexEntry::
+ text "Many odd things"
+ next "happen if this"
+ next "#MON is close"
- page "from clouds while"
- next "dropping enormous"
- next "lightning bolts"
+ page "by. For example,"
+ next "it makes clocks"
+ next "run backwards"
dex
-_DittoDexEntry::
- text "Capable of copying"
- next "an enemy's genetic"
- next "code to instantly"
+_AlakazamDexEntry::
+ text "A #MON that can"
+ next "memorize anything."
+ next "It never forgets"
- page "transform itself"
- next "into a duplicate"
- next "of the enemy"
+ page "what it learns--"
+ next "that's why this"
+ next "#MON is smart"
dex
-_MeowthDexEntry::
- text "Adores circular"
- next "objects. Wanders"
- next "the streets on a"
+_MachopDexEntry::
+ text "Very powerful in"
+ next "spite of its small"
+ next "size. Its mastery"
- page "nightly basis to"
- next "look for dropped"
- next "loose change"
+ page "of many types of"
+ next "martial arts makes"
+ next "it very tough"
dex
-_KrabbyDexEntry::
- text "Its pincers are"
- next "not only powerful"
- next "weapons, they are"
+_MachokeDexEntry::
+ text "The belt around"
+ next "its waist holds"
+ next "back its energy."
- page "used for balance"
- next "when walking"
- next "sideways"
+ page "Without it, this"
+ next "#MON would be"
+ next "unstoppable"
dex
-_VulpixDexEntry::
- text "At the time of"
- next "birth, it has"
- next "just one tail."
+_MachampDexEntry::
+ text "One arm alone can"
+ next "move mountains."
+ next "Using all four"
- page "The tail splits"
- next "from its tip as"
- next "it grows older"
+ page "arms, this #MON"
+ next "fires off awesome"
+ next "punches"
dex
-_NinetalesDexEntry::
- text "Very smart and"
- next "very vengeful."
- next "Grabbing one of"
+_BellsproutDexEntry::
+ text "Prefers hot and"
+ next "humid places."
+ next "It ensnares tiny"
- page "its many tails"
- next "could result in a"
- next "1000-year curse"
+ page "insects with its"
+ next "vines and devours"
+ next "them"
dex
-_PikachuDexEntry::
- text "When several of"
- next "these #MON"
- next "gather, their"
+_WeepinbellDexEntry::
+ text "When hungry, it"
+ next "swallows anything"
+ next "that moves. Its"
- page "electricity could"
- next "build and cause"
- next "lightning storms"
+ page "hapless prey is"
+ next "melted inside by"
+ next "strong acids"
dex
-_RaichuDexEntry::
- text "Its long tail"
- next "serves as a"
- next "ground to protect"
+_VictreebelDexEntry::
+ text "Lures prey with"
+ next "the sweet aroma of"
+ next "honey. Swallowed"
- page "itself from its"
- next "own high voltage"
- next "power"
+ page "whole, the prey is"
+ next "melted in a day,"
+ next "bones and all"
dex
-_DratiniDexEntry::
- text "Long considered a"
- next "mythical #MON"
- next "until recently"
+_TentacoolDexEntry::
+ text "It can sometimes"
+ next "be found all dry"
+ next "and shriveled up"
- page "when a small"
- next "colony was found"
- next "living underwater"
+ page "on a beach. Toss"
+ next "it back into the"
+ next "sea to revive it"
dex
-_DragonairDexEntry::
- text "A mystical #MON"
- next "that exudes a"
- next "gentle aura."
+_TentacruelDexEntry::
+ text "Its 80 tentacles"
+ next "can stretch and"
+ next "contract freely."
- page "Has the ability"
- next "to change climate"
- next "conditions"
+ page "They wrap around"
+ next "prey and weaken"
+ next "it with poison"
dex
-_KabutoDexEntry::
- text "A #MON that"
- next "was resurrected"
- next "from a fossil"
+_GeodudeDexEntry::
+ text "Commonly found"
+ next "near mountain"
+ next "trails, etc."
- page "found in what was"
- next "once the ocean"
- next "floor eons ago"
+ page "If you step on"
+ next "one by accident,"
+ next "it gets angry"
dex
-_KabutopsDexEntry::
- text "Its sleek shape is"
- next "perfect for swim-"
- next "ming. It slashes"
+_GravelerDexEntry::
+ text "Often seen rolling"
+ next "down mountain"
+ next "trails. Obstacles"
- page "prey with its"
- next "claws and drains"
- next "the body fluids"
+ page "are just things to"
+ next "roll straight"
+ next "over, not avoid"
dex
-_HorseaDexEntry::
- text "Known to shoot"
- next "down flying bugs"
- next "with precision"
+_GolemDexEntry::
+ text "Once it sheds its"
+ next "skin, its body"
+ next "turns tender and"
- page "blasts of ink"
- next "from the surface"
- next "of the water"
+ page "whitish. Its hide"
+ next "hardens when it's"
+ next "exposed to air"
dex
-_SeadraDexEntry::
- text "Capable of swim-"
- next "ming backwards by"
- next "rapidly flapping"
+_PonytaDexEntry::
+ text "Capable of jumping"
+ next "incredibly high."
+ next "Its hooves and"
- page "its wing-like"
- next "pectoral fins and"
- next "stout tail"
+ page "sturdy legs absorb"
+ next "the impact of a"
+ next "hard landing"
dex
-_SandshrewDexEntry::
- text "Burrows deep"
- next "underground in"
- next "arid locations"
+_RapidashDexEntry::
+ text "Just loves to run."
+ next "If it sees some-"
+ next "thing faster than"
- page "far from water."
- next "It only emerges"
- next "to hunt for food"
+ page "itself, it will"
+ next "give chase at top"
+ next "speed"
dex
-_SandslashDexEntry::
- text "Curls up into a"
- next "spiny ball when"
- next "threatened. It"
+_SlowpokeDexEntry::
+ text "Incredibly slow"
+ next "and sluggish. It"
+ next "is quite content"
- page "can roll while"
- next "curled up to"
- next "attack or escape"
+ page "to loll about"
+ next "without worrying"
+ next "about the time"
dex
-_OmanyteDexEntry::
- text "Although long"
- next "extinct, in rare"
- next "cases, it can be"
+_SlowbroDexEntry::
+ text "Lives lazily by"
+ next "the sea. If the"
+ next "SHELLDER on its"
- page "genetically"
- next "resurrected from"
- next "fossils"
+ page "tail comes off,"
+ next "it becomes a"
+ next "SLOWPOKE again"
dex
-_OmastarDexEntry::
- text "A prehistoric"
- next "#MON that died"
- next "out when its"
+_MagnemiteDexEntry::
+ text "It is born with"
+ next "the ability to"
+ next "defy gravity. It"
- page "heavy shell made"
- next "it impossible to"
- next "catch prey"
+ page "floats in air on"
+ next "powerful electro-"
+ next "magnetic waves"
dex
-_JigglypuffDexEntry::
- text "When its huge eyes"
- next "light up, it sings"
- next "a mysteriously"
+_MagnetonDexEntry::
+ text "Generates strange"
+ next "radio signals. It"
+ next "raises the tem-"
- page "soothing melody"
- next "that lulls its"
- next "enemies to sleep"
+ page "perature by 3.6F"
+ next "degrees within"
+ next "3,300 feet"
dex
-_WigglytuffDexEntry::
- text "The body is soft"
- next "and rubbery. When"
- next "angered, it will"
+_FarfetchdDexEntry::
+ text "Lives where reedy"
+ next "plants grow. They"
+ next "are rarely seen,"
- page "suck in air and"
- next "inflate itself to"
- next "an enormous size"
+ page "so it's thought"
+ next "their numbers are"
+ next "decreasing"
dex
-_EeveeDexEntry::
- text "Its genetic code"
- next "is irregular."
- next "It may mutate if"
+_DoduoDexEntry::
+ text "Its short wings"
+ next "make flying dif-"
+ next "ficult. Instead,"
- page "it is exposed to"
- next "radiation from"
- next "element STONEs"
+ page "this #MON runs"
+ next "at high speed on"
+ next "developed legs"
dex
-_FlareonDexEntry::
- text "When storing"
- next "thermal energy in"
- next "its body, its"
+_DodrioDexEntry::
+ text "One of DODUO's 2"
+ next "heads splits to"
+ next "form a unique"
- page "temperature could"
- next "soar to over 1600"
- next "degrees"
+ page "species. It runs"
+ next "close to 40 MPH"
+ next "in prairies"
dex
-_JolteonDexEntry::
- text "It accumulates"
- next "negative ions in"
- next "the atmosphere to"
+_SeelDexEntry::
+ text "Loves freezing"
+ next "cold conditions."
+ next "Relishes swimming"
- page "blast out 10000-"
- next "volt lightning"
- next "bolts"
+ page "in a frigid cli-"
+ next "mate of around 14F"
+ next "degrees"
dex
-_VaporeonDexEntry::
- text "Lives close to"
- next "water. Its long"
- next "tail is ridged"
+_DewgongDexEntry::
+ text "Its entire body is"
+ next "a snowy-white."
+ next "Unharmed by even"
- page "with a fin which"
- next "is often mistaken"
- next "for a mermaid's"
+ page "intense cold, it"
+ next "swims powerfully"
+ next "in icy waters"
dex
-_MachopDexEntry::
- text "Loves to build"
- next "its muscles."
- next "It trains in all"
+_GrimerDexEntry::
+ text "Made of hardened"
+ next "sludge. It smells"
+ next "too putrid to"
- page "styles of martial"
- next "arts to become"
- next "even stronger"
+ page "touch."
+ next "Even weeds won't"
+ next "grow in its path"
dex
-_ZubatDexEntry::
- text "Forms colonies in"
- next "perpetually dark"
- next "places. Uses"
+_MukDexEntry::
+ text "Smells so awful,"
+ next "it can cause"
+ next "fainting. Through"
- page "ultrasonic waves"
- next "to identify and"
- next "approach targets"
+ page "degeneration, it"
+ next "lost its sense of"
+ next "smell"
dex
-_EkansDexEntry::
- text "Moves silently"
- next "and stealthily."
- next "Eats the eggs of"
+_ShellderDexEntry::
+ text "The shell can"
+ next "withstand any"
+ next "attack. However,"
- page "birds, such as"
- next "PIDGEY and"
- next "SPEAROW, whole"
+ page "when it is open,"
+ next "the tender body"
+ next "is exposed"
dex
-_ParasDexEntry::
- text "Burrows to suck"
- next "tree roots. The"
- next "mushrooms on its"
+_CloysterDexEntry::
+ text "For protection, it"
+ next "uses its harder-"
+ next "than-diamonds"
- page "back grow by draw-"
- next "ing nutrients from"
- next "the bug host"
+ page "shell. It also"
+ next "shoots spikes from"
+ next "the shell"
dex
-_PoliwhirlDexEntry::
- text "Capable of living"
- next "in or out of"
- next "water. When out"
+_GastlyDexEntry::
+ text "Said to appear in"
+ next "decrepit, deserted"
+ next "buildings. It has"
- page "of water, it"
- next "sweats to keep"
- next "its body slimy"
+ page "no real shape as"
+ next "it appears to be"
+ next "made of a gas"
dex
-_PoliwrathDexEntry::
- text "An adept swimmer"
- next "at both the front"
- next "crawl and breast"
+_HaunterDexEntry::
+ text "By licking, it"
+ next "saps the victim's"
+ next "life. It causes"
- page "stroke. Easily"
- next "overtakes the best"
- next "human swimmers"
+ page "shaking that won't"
+ next "stop until the"
+ next "victim's demise"
dex
-_WeedleDexEntry::
- text "Often found in"
- next "forests, eating"
- next "leaves."
+_GengarDexEntry::
+ text "A GENGAR is close"
+ next "by if you feel a"
+ next "sudden chill."
- page "It has a sharp"
- next "venomous stinger"
- next "on its head"
+ page "It may be trying"
+ next "to lay a curse"
+ next "on you"
dex
-_KakunaDexEntry::
- text "Almost incapable"
- next "of moving, this"
- next "#MON can only"
+_OnixDexEntry::
+ text "Burrows at high"
+ next "speed in search"
+ next "of food. The"
- page "harden its shell"
- next "to protect itself"
- next "from predators"
+ page "tunnels it leaves"
+ next "are used as homes"
+ next "by DIGLETTs"
dex
-_BeedrillDexEntry::
- text "Flies at high"
- next "speed and attacks"
- next "using its large"
+_DrowzeeDexEntry::
+ text "If you sleep by"
+ next "it all the time,"
+ next "it will sometimes"
- page "venomous stingers"
- next "on its forelegs"
- next "and tail"
+ page "show you dreams"
+ next "it has eaten in"
+ next "the past"
dex
-_DodrioDexEntry::
- text "Uses its three"
- next "brains to execute"
- next "complex plans."
+_HypnoDexEntry::
+ text "Avoid eye contact"
+ next "if you come across"
+ next "one. It will try"
- page "While two heads"
- next "sleep, one head"
- next "stays awake"
+ page "to put you to"
+ next "sleep by using"
+ next "its pendulum"
dex
-_PrimeapeDexEntry::
- text "Always furious"
- next "and tenacious to"
- next "boot. It will not"
+_KrabbyDexEntry::
+ text "Its pincers are"
+ next "superb weapons."
+ next "They sometimes"
- page "abandon chasing"
- next "its quarry until"
- next "it is caught"
+ page "break off during"
+ next "battle, but they"
+ next "grow back fast"
dex
-_DugtrioDexEntry::
- text "A team of DIGLETT"
- next "triplets."
- next "It triggers huge"
+_KinglerDexEntry::
+ text "One claw grew"
+ next "massively and as"
+ next "hard as steel."
- page "earthquakes by"
- next "burrowing 60 miles"
- next "underground"
+ page "It has 10,000-HP"
+ next "strength. However,"
+ next "it is too heavy"
dex
-_VenomothDexEntry::
- text "The dust-like"
- next "scales covering"
- next "its wings are"
+_VoltorbDexEntry::
+ text "It is said to"
+ next "camouflage itself"
+ next "as a # BALL. It"
- page "color coded to"
- next "indicate the kinds"
- next "of poison it has"
+ page "will self-destruct"
+ next "with very little"
+ next "stimulus"
dex
-_DewgongDexEntry::
- text "Stores thermal"
- next "energy in its"
- next "body. Swims at a"
+_ElectrodeDexEntry::
+ text "Stores electrical"
+ next "energy inside its"
+ next "body. Even the"
- page "steady 8 knots"
- next "even in intensely"
- next "cold waters"
+ page "slightest shock"
+ next "could trigger a"
+ next "huge explosion"
dex
-_CaterpieDexEntry::
- text "Its short feet"
- next "are tipped with"
- next "suction pads that"
+_ExeggcuteDexEntry::
+ text "The heads attract"
+ next "each other and"
+ next "spin around."
- page "enable it to"
- next "tirelessly climb"
- next "slopes and walls"
+ page "There must be 6"
+ next "heads for it to"
+ next "maintain balance"
dex
-_MetapodDexEntry::
- text "This #MON is"
- next "vulnerable to"
- next "attack while its"
+_ExeggutorDexEntry::
+ text "Its cries are very"
+ next "noisy. This is"
+ next "because each of"
- page "shell is soft,"
- next "exposing its weak"
- next "and tender body"
+ page "the 3 heads thinks"
+ next "about whatever it"
+ next "likes"
dex
-_ButterfreeDexEntry::
- text "In battle, it"
- next "flaps its wings"
- next "at high speed to"
+_CuboneDexEntry::
+ text "Wears the skull"
+ next "of its deceased"
+ next "mother. Its cries"
- page "release highly"
- next "toxic dust into"
- next "the air"
+ page "echo inside the"
+ next "skull and come out"
+ next "as a sad melody"
dex
-_MachampDexEntry::
- text "Using its heavy"
- next "muscles, it throws"
- next "powerful punches"
+_MarowakDexEntry::
+ text "Small and weak,"
+ next "this #MON is"
+ next "adept with its"
- page "that can send the"
- next "victim clear over"
- next "the horizon"
+ page "bone club. It has"
+ next "grown more vicious"
+ next "over the ages"
dex
-_GolduckDexEntry::
- text "Often seen swim-"
- next "ming elegantly by"
- next "lake shores. It"
+_HitmonleeDexEntry::
+ text "When kicking, the"
+ next "sole of its foot"
+ next "turns as hard as"
- page "is often mistaken"
- next "for the Japanese"
- next "monster, Kappa"
+ page "a diamond on im-"
+ next "pact and destroys"
+ next "its enemy"
dex
-_HypnoDexEntry::
- text "When it locks eyes"
- next "with an enemy, it"
- next "will use a mix of"
+_HitmonchanDexEntry::
+ text "Punches in cork-"
+ next "screw fashion. It"
+ next "can punch its way"
- page "PSI moves such as"
- next "HYPNOSIS and"
- next "CONFUSION"
+ page "through a concrete"
+ next "wall in the same"
+ next "way as a drill"
dex
-_GolbatDexEntry::
- text "Once it strikes,"
- next "it will not stop"
- next "draining energy"
+_LickitungDexEntry::
+ text "Its tongue spans"
+ next "almost 7 feet and"
+ next "moves more freely"
- page "from the victim"
- next "even if it gets"
- next "too heavy to fly"
+ page "than its forelegs."
+ next "Its licks can"
+ next "cause paralysis"
dex
-_MewtwoDexEntry::
- text "It was created by"
- next "a scientist after"
- next "years of horrific"
+_KoffingDexEntry::
+ text "In hot places, its"
+ next "internal gases"
+ next "could expand and"
- page "gene splicing and"
- next "DNA engineering"
- next "experiments"
- dex
+ page "explode without"
+ next "any warning. Be"
+ next "very careful!@@"
-_SnorlaxDexEntry::
- text "Very lazy. Just"
- next "eats and sleeps."
- next "As its rotund"
+_WeezingDexEntry::
+ text "It lives and grows"
+ next "by absorbing dust,"
+ next "germs and poison"
- page "bulk builds, it"
- next "becomes steadily"
- next "more slothful"
+ page "gases that are"
+ next "contained in toxic"
+ next "waste and garbage"
dex
-_MagikarpDexEntry::
- text "In the distant"
- next "past, it was"
- next "somewhat stronger"
+_RhyhornDexEntry::
+ text "A #MON with a"
+ next "one-track mind."
+ next "Once it charges, "
- page "than the horribly"
- next "weak descendants"
- next "that exist today"
+ page "it won't stop"
+ next "running until it"
+ next "falls asleep"
dex
-_MukDexEntry::
- text "Thickly covered"
- next "with a filthy,"
- next "vile sludge. It"
+_RhydonDexEntry::
+ text "Walks on its hind"
+ next "legs. Shows signs"
+ next "of intelligence."
- page "is so toxic, even"
- next "its footprints"
- next "contain poison"
+ page "Its armor-like"
+ next "hide even repels"
+ next "molten lava"
dex
-_KinglerDexEntry::
- text "The large pincer"
- next "has 10000 hp of"
- next "crushing power."
+_ChanseyDexEntry::
+ text "A gentle and kind-"
+ next "hearted #MON"
+ next "that shares its"
- page "However, its huge"
- next "size makes it"
- next "unwieldy to use"
+ page "nutritious eggs"
+ next "if it sees an"
+ next "injured #MON"
dex
-_CloysterDexEntry::
- text "When attacked, it"
- next "launches its"
- next "horns in quick"
+_TangelaDexEntry::
+ text "Its identity is"
+ next "obscured by masses"
+ next "of thick, blue"
- page "volleys. Its"
- next "innards have"
- next "never been seen"
+ page "vines. The vines"
+ next "are said to never"
+ next "stop growing"
dex
-_ElectrodeDexEntry::
- text "It stores electric"
- next "energy under very"
- next "high pressure."
+_KangaskhanDexEntry::
+ text "Raises its young"
+ next "in its belly"
+ next "pouch. Won't run"
- page "It often explodes"
- next "with little or no"
- next "provocation"
+ page "from any fight"
+ next "to keep its young"
+ next "protected"
dex
-_ClefableDexEntry::
- text "A timid fairy"
- next "#MON that is"
- next "rarely seen. It"
+_HorseaDexEntry::
+ text "If it senses any"
+ next "danger, it will"
+ next "vigorously spray"
- page "will run and hide"
- next "the moment it"
- next "senses people"
+ page "water or a special"
+ next "type of ink from"
+ next "its mouth"
dex
-_WeezingDexEntry::
- text "Where two kinds"
- next "of poison gases"
- next "meet, 2 KOFFINGs"
+_SeadraDexEntry::
+ text "Touching the back"
+ next "fin causes numb-"
+ next "ness. It hooks"
- page "can fuse into a"
- next "WEEZING over many"
- next "years"
+ page "its tail to coral"
+ next "to stay in place"
+ next "while sleeping"
dex
-_PersianDexEntry::
- text "Although its fur"
- next "has many admirers,"
- next "it is tough to"
+_GoldeenDexEntry::
+ text "When it is time"
+ next "for them to lay"
+ next "eggs, they can be"
- page "raise as a pet"
- next "because of its"
- next "fickle meanness"
+ page "seen swimming up"
+ next "rivers and falls"
+ next "in large groups"
dex
-_MarowakDexEntry::
- text "The bone it holds"
- next "is its key weapon."
- next "It throws the"
+_SeakingDexEntry::
+ text "It is the male's"
+ next "job to make a"
+ next "nest by carving"
- page "bone skillfully"
- next "like a boomerang"
- next "to KO targets"
+ page "out boulders in a"
+ next "stream using the"
+ next "horn on its head"
dex
-_HaunterDexEntry::
- text "Because of its"
- next "ability to slip"
- next "through block"
+_StaryuDexEntry::
+ text "As long as the"
+ next "center section is"
+ next "unharmed, it can"
- page "walls, it is said"
- next "to be from an-"
- next "other dimension"
+ page "grow back fully"
+ next "even if it is"
+ next "chopped to bits"
dex
-_AbraDexEntry::
- text "Using its ability"
- next "to read minds, it"
- next "will identify"
+_StarmieDexEntry::
+ text "The center section"
+ next "is named the core."
+ next "People think it"
- page "impending danger"
- next "and TELEPORT to"
- next "safety"
+ page "is communicating"
+ next "when it glows in"
+ next "7 colors"
dex
-_AlakazamDexEntry::
- text "Its brain can out-"
- next "perform a super-"
- next "computer."
+_MrMimeDexEntry::
+ text "Always practices"
+ next "its pantomime act."
+ next "It makes enemies"
- page "Its intelligence"
- next "quotient is said"
- next "to be 5,000"
+ page "believe something"
+ next "exists that"
+ next "really doesn't"
dex
-_PidgeottoDexEntry::
- text "Very protective"
- next "of its sprawling"
- next "territorial area,"
+_ScytherDexEntry::
+ text "Leaps out of tall"
+ next "grass and slices"
+ next "prey with its"
- page "this #MON will"
- next "fiercely peck at"
- next "any intruder"
+ page "scythes. The move-"
+ next "ment looks like"
+ next "that of a ninja"
dex
-_PidgeotDexEntry::
- text "When hunting, it"
- next "skims the surface"
- next "of water at high"
+_JynxDexEntry::
+ text "Appears to move"
+ next "to a rhythm of"
+ next "its own, as if it"
- page "speed to pick off"
- next "unwary prey such"
- next "as MAGIKARP"
+ page "were dancing. It"
+ next "wiggles its hips"
+ next "as it walks"
dex
-_StarmieDexEntry::
- text "Its central core"
- next "glows with the"
- next "seven colors of"
+_ElectabuzzDexEntry::
+ text "If a major power"
+ next "outage occurs, it"
+ next "is certain that"
- page "the rainbow. Some"
- next "people value the"
- next "core as a gem"
+ page "this #MON has"
+ next "eaten electricity"
+ next "at a power plant"
dex
-_BulbasaurDexEntry::
- text "A strange seed was"
- next "planted on its"
- next "back at birth."
+_MagmarDexEntry::
+ text "Born in an active"
+ next "volcano. Its body"
+ next "is always cloaked"
- page "The plant sprouts"
- next "and grows with"
- next "this #MON"
+ page "in flames, so it"
+ next "looks like a big"
+ next "ball of fire"
dex
-_VenusaurDexEntry::
- text "The plant blooms"
- next "when it is"
- next "absorbing solar"
+_PinsirDexEntry::
+ text "Grips its prey in"
+ next "its pincers and"
+ next "squeezes hard! It"
- page "energy. It stays"
- next "on the move to"
- next "seek sunlight"
+ page "can't move if it's"
+ next "cold, so it lives"
+ next "in warm places"
dex
-_TentacruelDexEntry::
- text "The tentacles are"
- next "normally kept"
- next "short. On hunts,"
+_TaurosDexEntry::
+ text "A rowdy #MON"
+ next "with a lot of"
+ next "stamina. Once"
- page "they are extended"
- next "to ensnare and"
- next "immobilize prey"
+ page "running, it won't"
+ next "stop until it hits"
+ next "something"
dex
-_GoldeenDexEntry::
- text "Its tail fin"
- next "billows like an"
- next "elegant ballroom"
+_MagikarpDexEntry::
+ text "Famous for being"
+ next "very unreliable."
+ next "It can be found"
- page "dress, giving it"
- next "the nickname of"
- next "the Water Queen"
+ page "swimming in seas,"
+ next "lakes, rivers and"
+ next "shallow puddles"
dex
-_SeakingDexEntry::
- text "In the autumn"
- next "spawning season,"
- next "they can be seen"
+_GyaradosDexEntry::
+ text "Brutally vicious"
+ next "and enormously"
+ next "destructive."
- page "swimming power-"
- next "fully up rivers"
- next "and creeks"
+ page "Known for totally"
+ next "destroying cities"
+ next "in ancient times"
dex
-_PonytaDexEntry::
- text "Its hooves are 10"
- next "times harder than"
- next "diamonds. It can"
+_LaprasDexEntry::
+ text "A gentle soul that"
+ next "can read the minds"
+ next "of people. It can"
- page "trample anything"
- next "completely flat"
- next "in little time"
+ page "ferry people"
+ next "across the sea on"
+ next "its back"
dex
-_RapidashDexEntry::
- text "Very competitive,"
- next "this #MON will"
- next "chase anything"
+_DittoDexEntry::
+ text "When it spots an"
+ next "enemy, its body"
+ next "transfigures into"
- page "that moves fast"
- next "in the hopes of"
- next "racing it"
+ page "an almost perfect"
+ next "copy of its oppo-"
+ next "nent"
dex
-_RattataDexEntry::
- text "Bites anything"
- next "when it attacks."
- next "Small and very"
+_EeveeDexEntry::
+ text "Its genetic code"
+ next "is unstable, so it"
+ next "could evolve in"
- page "quick, it is a"
- next "common sight in"
- next "many places"
+ page "a variety of ways."
+ next "There are only a"
+ next "few alive"
dex
-_RaticateDexEntry::
- text "It uses its whis-"
- next "kers to maintain"
- next "its balance."
+_VaporeonDexEntry::
+ text "Its cell structure"
+ next "is similar to"
+ next "water molecules."
- page "It apparently"
- next "slows down if"
- next "they are cut off"
+ page "It will melt away"
+ next "and become invis-"
+ next "ible in water"
dex
-_NidorinoDexEntry::
- text "An aggressive"
- next "#MON that is"
- next "quick to attack."
+_JolteonDexEntry::
+ text "A sensitive #-"
+ next "MON that easily"
+ next "becomes sad or"
- page "The horn on its"
- next "head secretes a"
- next "powerful venom"
+ page "angry. Every time"
+ next "its mood changes,"
+ next "it charges power"
dex
-_NidorinaDexEntry::
- text "The female's horn"
- next "develops slowly."
- next "Prefers physical"
+_FlareonDexEntry::
+ text "It has a flame"
+ next "chamber inside its"
+ next "body. It inhales,"
- page "attacks such as"
- next "clawing and"
- next "biting"
+ page "then blows out"
+ next "fire that is over"
+ next "3,000F degrees"
dex
-_GeodudeDexEntry::
- text "Found in fields"
- next "and mountains."
- next "Mistaking them"
+_PorygonDexEntry::
+ text "The only #MON"
+ next "people anticipate"
+ next "can fly into"
- page "for boulders,"
- next "people often step"
- next "or trip on them"
+ page "space. None has"
+ next "managed the feat"
+ next "yet, however"
dex
-_PorygonDexEntry::
- text "A #MON that"
- next "consists entirely"
- next "of programming"
+_OmanyteDexEntry::
+ text "An ancient #MON"
+ next "that was recovered"
+ next "from a fossil. It"
- page "code. Capable of"
- next "moving freely in"
- next "cyberspace"
+ page "swims by cleverly"
+ next "twisting its 10"
+ next "tentacles about"
dex
-_AerodactylDexEntry::
- text "A ferocious, pre-"
- next "historic #MON"
- next "that goes for the"
+_OmastarDexEntry::
+ text "Sharp beaks ring"
+ next "its mouth. Its"
+ next "shell was too big"
- page "enemy's throat"
- next "with its serrated"
- next "saw-like fangs"
+ page "for it to move"
+ next "freely, so it"
+ next "became extinct"
dex
-_MagnemiteDexEntry::
- text "Uses anti-gravity"
- next "to stay suspended."
- next "Appears without"
+_KabutoDexEntry::
+ text "A #MON that was"
+ next "recovered from a"
+ next "fossil. It uses"
- page "warning and uses"
- next "THUNDER WAVE and"
- next "similar moves"
+ page "the eyes on its"
+ next "back while hiding"
+ next "on the sea floor"
dex
-_CharmanderDexEntry::
- text "Obviously prefers"
- next "hot places. When"
- next "it rains, steam"
+_KabutopsDexEntry::
+ text "A slim and fast"
+ next "swimmer. It slices"
+ next "its prey with its"
- page "is said to spout"
- next "from the tip of"
- next "its tail"
+ page "sharp sickles and"
+ next "drinks the body"
+ next "fluids"
dex
-_SquirtleDexEntry::
- text "After birth, its"
- next "back swells and"
- next "hardens into a"
+_AerodactylDexEntry::
+ text "A savage #MON"
+ next "that died out in"
+ next "ancient times. It"
- page "shell. Powerfully"
- next "sprays foam from"
- next "its mouth"
+ page "was resurrected"
+ next "using DNA taken"
+ next "from amber"
dex
-_CharmeleonDexEntry::
- text "When it swings"
- next "its burning tail,"
- next "it elevates the"
+_SnorlaxDexEntry::
+ text "Will eat anything,"
+ next "even if the food"
+ next "happens to be a"
- page "temperature to"
- next "unbearably high"
- next "levels"
+ page "little moldy. It"
+ next "never gets an"
+ next "upset stomach"
dex
-_WartortleDexEntry::
- text "Often hides in"
- next "water to stalk"
- next "unwary prey. For"
+_ArticunoDexEntry::
+ text "A legendary bird"
+ next "#MON. It"
+ next "freezes water"
- page "swimming fast, it"
- next "moves its ears to"
- next "maintain balance"
+ page "that is contained"
+ next "in winter air and"
+ next "makes it snow"
dex
-_CharizardDexEntry::
- text "Spits fire that"
- next "is hot enough to"
- next "melt boulders."
+_ZapdosDexEntry::
+ text "This legendary"
+ next "bird #MON is"
+ next "said to appear"
- page "Known to cause"
- next "forest fires"
- next "unintentionally"
+ page "when the sky turns"
+ next "dark and lightning"
+ next "showers down"
dex
-_OddishDexEntry::
- text "During the day,"
- next "it keeps its face"
- next "buried in the"
+_MoltresDexEntry::
+ text "A legendary bird"
+ next "#MON. As it"
+ next "flaps its flaming"
- page "ground. At night,"
- next "it wanders around"
- next "sowing its seeds"
+ page "wings, even the"
+ next "night sky will"
+ next "turn red"
dex
-_GloomDexEntry::
- text "The fluid that"
- next "oozes from its"
- next "mouth isn't drool."
+_DratiniDexEntry::
+ text "The existence of"
+ next "this mythical"
+ next "#MON was only"
- page "It is a nectar"
- next "that is used to"
- next "attract prey"
+ page "recently confirmed"
+ next "by a fisherman"
+ next "who caught one"
dex
-_VileplumeDexEntry::
- text "The larger its"
- next "petals, the more"
- next "toxic pollen it"
+_DragonairDexEntry::
+ text "According to a"
+ next "witness, its body"
+ next "was surrounded by"
- page "contains. Its big"
- next "head is heavy and"
- next "hard to hold up"
+ page "a strange aura"
+ next "that gave it a"
+ next "mystical look"
dex
-_BellsproutDexEntry::
- text "A carnivorous"
- next "#MON that traps"
- next "and eats bugs."
+_DragoniteDexEntry::
+ text "It is said that"
+ next "this #MON lives"
+ next "somewhere in the"
- page "It uses its root"
- next "feet to soak up"
- next "needed moisture"
+ page "sea and that it"
+ next "flies. However, it"
+ next "is only a rumor"
dex
-_WeepinbellDexEntry::
- text "It spits out"
- next "POISONPOWDER to"
- next "immobilize the"
+_MewtwoDexEntry::
+ text "Its DNA is almost"
+ next "the same as MEW's."
+ next "However, its size"
- page "enemy and then"
- next "finishes it with"
- next "a spray of ACID"
+ page "and disposition"
+ next "are vastly dif-"
+ next "ferent"
dex
-_VictreebelDexEntry::
- text "Said to live in"
- next "huge colonies"
- next "deep in jungles,"
+_MewDexEntry::
+ text "When viewed"
+ next "through a micro-"
+ next "scope, this"
- page "although no one"
- next "has ever returned"
- next "from there"
+ page "#MON's short,"
+ next "fine, delicate"
+ next "hair can be seen"
dex
diff --git a/data/pokemon/evos_moves.asm b/data/pokemon/evos_moves.asm
index c5fcc292..d3a8ed1c 100644
--- a/data/pokemon/evos_moves.asm
+++ b/data/pokemon/evos_moves.asm
@@ -224,11 +224,11 @@ NidoranMEvosMoves:
db 0
; Learnset
db 8, HORN_ATTACK
- db 14, POISON_STING
- db 21, FOCUS_ENERGY
- db 29, FURY_ATTACK
- db 36, HORN_DRILL
- db 43, DOUBLE_KICK
+ db 12, DOUBLE_KICK
+ db 17, POISON_STING
+ db 23, FOCUS_ENERGY
+ db 30, FURY_ATTACK
+ db 38, HORN_DRILL
db 0
ClefairyEvosMoves:
@@ -273,7 +273,7 @@ NidokingEvosMoves:
db 0
; Learnset
db 8, HORN_ATTACK
- db 14, POISON_STING
+ db 12, DOUBLE_KICK
db 23, THRASH
db 0
@@ -362,11 +362,11 @@ NidoranFEvosMoves:
db 0
; Learnset
db 8, SCRATCH
- db 14, POISON_STING
- db 21, TAIL_WHIP
- db 29, BITE
- db 36, FURY_SWIPES
- db 43, DOUBLE_KICK
+ db 12, DOUBLE_KICK
+ db 17, POISON_STING
+ db 23, TAIL_WHIP
+ db 30, BITE
+ db 38, FURY_SWIPES
db 0
NidoqueenEvosMoves:
@@ -374,7 +374,7 @@ NidoqueenEvosMoves:
db 0
; Learnset
db 8, SCRATCH
- db 14, POISON_STING
+ db 12, DOUBLE_KICK
db 23, BODY_SLAM
db 0
@@ -383,6 +383,9 @@ CuboneEvosMoves:
db EV_LEVEL, 28, MAROWAK
db 0
; Learnset
+ db 10, BONE_CLUB
+ db 13, TAIL_WHIP
+ db 18, HEADBUTT
db 25, LEER
db 31, FOCUS_ENERGY
db 38, THRASH
@@ -488,6 +491,7 @@ ScytherEvosMoves:
db 29, SLASH
db 35, SWORDS_DANCE
db 42, AGILITY
+ db 50, WING_ATTACK
db 0
StaryuEvosMoves:
@@ -520,6 +524,7 @@ PinsirEvosMoves:
; Evolutions
db 0
; Learnset
+ db 21, BIND
db 25, SEISMIC_TOSS
db 30, GUILLOTINE
db 36, FOCUS_ENERGY
@@ -532,12 +537,14 @@ TangelaEvosMoves:
; Evolutions
db 0
; Learnset
- db 29, ABSORB
+ db 24, BIND
+ db 27, ABSORB
+ db 29, VINE_WHIP
db 32, POISONPOWDER
db 36, STUN_SPORE
db 39, SLEEP_POWDER
db 45, SLAM
- db 49, GROWTH
+ db 48, GROWTH
db 0
MissingNo1FEvosMoves:
@@ -642,6 +649,7 @@ ChanseyEvosMoves:
; Evolutions
db 0
; Learnset
+ db 12, DOUBLESLAP
db 24, SING
db 30, GROWL
db 38, MINIMIZE
@@ -824,11 +832,13 @@ MankeyEvosMoves:
db EV_LEVEL, 28, PRIMEAPE
db 0
; Learnset
+ db 9, LOW_KICK
db 15, KARATE_CHOP
db 21, FURY_SWIPES
db 27, FOCUS_ENERGY
db 33, SEISMIC_TOSS
db 39, THRASH
+ db 45, SCREECH
db 0
SeelEvosMoves:
@@ -900,7 +910,9 @@ VenonatEvosMoves:
db EV_LEVEL, 31, VENOMOTH
db 0
; Learnset
- db 24, POISONPOWDER
+ db 11, SUPERSONIC
+ db 19, CONFUSION
+ db 22, POISONPOWDER
db 27, LEECH_LIFE
db 30, STUN_SPORE
db 35, PSYBEAM
@@ -1073,11 +1085,15 @@ PikachuEvosMoves:
db EV_ITEM, THUNDER_STONE, 1, RAICHU
db 0
; Learnset
- db 9, THUNDER_WAVE
- db 16, QUICK_ATTACK
- db 26, SWIFT
+ db 6, TAIL_WHIP
+ db 8, THUNDER_WAVE
+ db 11, QUICK_ATTACK
+ db 15, DOUBLE_TEAM
+ db 20, SLAM
+ db 26, THUNDERBOLT
db 33, AGILITY
- db 43, THUNDER
+ db 41, THUNDER
+ db 50, LIGHT_SCREEN
db 0
RaichuEvosMoves:
@@ -1249,52 +1265,55 @@ EeveeEvosMoves:
db EV_ITEM, WATER_STONE, 1, VAPOREON
db 0
; Learnset
- db 27, QUICK_ATTACK
- db 31, TAIL_WHIP
- db 37, BITE
- db 45, TAKE_DOWN
+ db 8, SAND_ATTACK
+ db 16, GROWL
+ db 23, QUICK_ATTACK
+ db 30, BITE
+ db 36, FOCUS_ENERGY
+ db 42, TAKE_DOWN
db 0
FlareonEvosMoves:
; Evolutions
db 0
; Learnset
- db 27, QUICK_ATTACK
- db 31, EMBER
- db 37, TAIL_WHIP
- db 40, BITE
- db 42, LEER
- db 44, FIRE_SPIN
- db 48, RAGE
- db 54, FLAMETHROWER
+ db 8, SAND_ATTACK
+ db 16, EMBER
+ db 23, QUICK_ATTACK
+ db 30, BITE
+ db 36, FIRE_SPIN
+ db 42, SMOG
+ db 47, LEER
+ db 52, FLAMETHROWER
db 0
JolteonEvosMoves:
; Evolutions
db 0
; Learnset
- db 27, QUICK_ATTACK
- db 31, THUNDERSHOCK
- db 37, TAIL_WHIP
- db 40, THUNDER_WAVE
- db 42, DOUBLE_KICK
- db 44, AGILITY
- db 48, PIN_MISSILE
- db 54, THUNDER
+ db 8, SAND_ATTACK
+ db 16, THUNDERSHOCK
+ db 23, QUICK_ATTACK
+ db 30, DOUBLE_KICK
+ db 36, PIN_MISSILE
+ db 42, THUNDER_WAVE
+ db 47, AGILITY
+ db 52, THUNDER
db 0
VaporeonEvosMoves:
; Evolutions
db 0
; Learnset
- db 27, QUICK_ATTACK
- db 31, WATER_GUN
- db 37, TAIL_WHIP
- db 40, BITE
- db 42, ACID_ARMOR
- db 44, HAZE
- db 48, MIST
- db 54, HYDRO_PUMP
+ db 8, SAND_ATTACK
+ db 16, WATER_GUN
+ db 23, QUICK_ATTACK
+ db 30, BITE
+ db 36, AURORA_BEAM
+ db 42, HAZE
+ db 42, MIST
+ db 47, ACID_ARMOR
+ db 52, HYDRO_PUMP
db 0
MachopEvosMoves:
@@ -1414,11 +1433,14 @@ PrimeapeEvosMoves:
; Evolutions
db 0
; Learnset
+ db 9, LOW_KICK
db 15, KARATE_CHOP
db 21, FURY_SWIPES
db 27, FOCUS_ENERGY
+ db 28, RAGE
db 37, SEISMIC_TOSS
db 46, THRASH
+ db 45, SCREECH
db 0
DugtrioEvosMoves:
@@ -1436,7 +1458,7 @@ VenomothEvosMoves:
; Evolutions
db 0
; Learnset
- db 24, POISONPOWDER
+ db 22, POISONPOWDER
db 27, LEECH_LIFE
db 30, STUN_SPORE
db 38, PSYBEAM
@@ -1479,19 +1501,21 @@ MetapodEvosMoves:
db EV_LEVEL, 10, BUTTERFREE
db 0
; Learnset
+ db 7, HARDEN
db 0
ButterfreeEvosMoves:
; Evolutions
db 0
; Learnset
- db 12, CONFUSION
- db 15, POISONPOWDER
- db 16, STUN_SPORE
- db 17, SLEEP_POWDER
- db 21, SUPERSONIC
- db 26, WHIRLWIND
- db 32, PSYBEAM
+ db 10, CONFUSION
+ db 13, POISONPOWDER
+ db 14, STUN_SPORE
+ db 15, SLEEP_POWDER
+ db 18, SUPERSONIC
+ db 23, WHIRLWIND
+ db 28, GUST
+ db 34, PSYBEAM
db 0
MachampEvosMoves:
@@ -1671,6 +1695,9 @@ MarowakEvosMoves:
; Evolutions
db 0
; Learnset
+ db 10, BONE_CLUB
+ db 13, TAIL_WHIP
+ db 18, HEADBUTT
db 25, LEER
db 33, FOCUS_ENERGY
db 41, THRASH
@@ -1891,11 +1918,11 @@ NidorinoEvosMoves:
db 0
; Learnset
db 8, HORN_ATTACK
- db 14, POISON_STING
- db 23, FOCUS_ENERGY
- db 32, FURY_ATTACK
- db 41, HORN_DRILL
- db 50, DOUBLE_KICK
+ db 12, DOUBLE_KICK
+ db 19, POISON_STING
+ db 27, FOCUS_ENERGY
+ db 36, FURY_ATTACK
+ db 46, HORN_DRILL
db 0
NidorinaEvosMoves:
@@ -1904,11 +1931,11 @@ NidorinaEvosMoves:
db 0
; Learnset
db 8, SCRATCH
- db 14, POISON_STING
- db 23, TAIL_WHIP
- db 32, BITE
- db 41, FURY_SWIPES
- db 50, DOUBLE_KICK
+ db 12, DOUBLE_KICK
+ db 19, POISON_STING
+ db 27, TAIL_WHIP
+ db 36, BITE
+ db 46, FURY_SWIPES
db 0
GeodudeEvosMoves:
diff --git a/data/pokemon/menu_icons.asm b/data/pokemon/menu_icons.asm
index d6ed5b35..56237664 100644
--- a/data/pokemon/menu_icons.asm
+++ b/data/pokemon/menu_icons.asm
@@ -24,8 +24,8 @@ MonPartyData:
nybble ICON_BIRD ; Fearow
nybble ICON_SNAKE ; Ekans
nybble ICON_SNAKE ; Arbok
- nybble ICON_FAIRY ; Pikachu
- nybble ICON_FAIRY ; Raichu
+ nybble ICON_PIKACHU ; Pikachu
+ nybble ICON_PIKACHU ; Raichu
nybble ICON_MON ; Sandshrew
nybble ICON_MON ; Sandslash
nybble ICON_MON ; NidoranF
diff --git a/data/pokemon/mew.asm b/data/pokemon/mew.asm
deleted file mode 100644
index c68867ee..00000000
--- a/data/pokemon/mew.asm
+++ /dev/null
@@ -1,15 +0,0 @@
-; Mew's pics and base data are not grouped with the other Pokémon
-; because it was a last-minute addition "as a kind of prank".
-; Shigeki Morimoto explained in an Iwata Asks interview:
-; "We put Mew in right at the very end. The cartridge was really full and
-; there wasn't room for much more on there. Then the debug features which
-; weren't going to be included in the final version of the game were removed,
-; creating a miniscule 300 bytes of free space. So we thought that we could
-; slot Mew in there. What we did would be unthinkable nowadays!"
-; http://iwataasks.nintendo.com/interviews/#/ds/pokemon/0/0
-
-MewPicFront:: INCBIN "gfx/pokemon/front/mew.pic"
-MewPicBack:: INCBIN "gfx/pokemon/back/mewb.pic"
-
-MewBaseStats::
-INCLUDE "data/pokemon/base_stats/mew.asm"
diff --git a/data/pokemon/title_mons.asm b/data/pokemon/title_mons.asm
deleted file mode 100644
index 655e9ed0..00000000
--- a/data/pokemon/title_mons.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-TitleMons:
-; mons on the title screen are randomly chosen from here
-IF DEF(_RED)
- db STARTER1
- db STARTER2
- db STARTER3
- db WEEDLE
- db NIDORAN_M
- db SCYTHER
- db PIKACHU
- db CLEFAIRY
- db RHYDON
- db ABRA
- db GASTLY
- db DITTO
- db PIDGEOTTO
- db ONIX
- db PONYTA
- db MAGIKARP
-ENDC
-IF DEF(_BLUE)
- db STARTER2
- db STARTER1
- db STARTER3
- db MANKEY
- db HITMONLEE
- db VULPIX
- db CHANSEY
- db AERODACTYL
- db JOLTEON
- db SNORLAX
- db GLOOM
- db POLIWAG
- db DODUO
- db PORYGON
- db GENGAR
- db RAICHU
-ENDC
diff --git a/data/pokemon/unknown_list.asm b/data/pokemon/unknown_list.asm
new file mode 100644
index 00000000..010d415b
--- /dev/null
+++ b/data/pokemon/unknown_list.asm
@@ -0,0 +1,36 @@
+; This list is used by a unreferenced function.
+
+Pointer_3b0ee:
+ db NIDOKING
+ db IVYSAUR
+ db EXEGGUTOR
+ db GENGAR
+ db NIDOQUEEN
+ db ARCANINE
+ db GYARADOS
+ db BLASTOISE
+ db GOLEM
+ db DRAGONITE
+ db NINETALES
+ db DRAGONAIR
+ db KABUTOPS
+ db OMASTAR
+ db JIGGLYPUFF
+ db FLAREON
+ db JOLTEON
+ db VAPOREON
+ db BEEDRILL
+ db BUTTERFREE
+ db MACHAMP
+ db CLOYSTER
+ db CLEFABLE
+ db ALAKAZAM
+ db STARMIE
+ db VENUSAUR
+ db TENTACRUEL
+ db CHARMELEON
+ db WARTORTLE
+ db CHARIZARD
+ db VILEPLUME
+ db VICTREEBEL
+ db -1 ; end
diff --git a/data/sgb/sgb_border.asm b/data/sgb/sgb_border.asm
index aa11a326..9955acda 100644
--- a/data/sgb/sgb_border.asm
+++ b/data/sgb/sgb_border.asm
@@ -1,62 +1,87 @@
BorderPalettes:
-IF DEF(_RED)
- INCBIN "gfx/sgb/red_border.tilemap"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/sgb/blue_border.tilemap"
-ENDC
+ INCBIN "gfx/sgb/border.tilemap"
ds $100
-IF DEF(_RED)
- RGB 30,29,29 ; PAL_SGB1
- RGB 25,22,25
- RGB 25,17,21
- RGB 24,14,12
-ENDC
-IF DEF(_BLUE)
- RGB 0,0,0 ; PAL_SGB1 (the first color is not defined, but if used, turns up as 30,29,29... o_O)
- RGB 10,17,26
- RGB 5,9,20
- RGB 16,20,27
-ENDC
-
- ds $18
-
-IF DEF(_RED)
- RGB 30,29,29 ; PAL_SGB2
- RGB 22,31,16
- RGB 27,20,6
- RGB 15,15,15
-ENDC
-IF DEF(_BLUE)
- RGB 30,29,29 ; PAL_SGB2
- RGB 27,11,6
- RGB 5,9,20
- RGB 28,25,15
-ENDC
-
- ds $18
-
-IF DEF(_RED)
- RGB 30,29,29 ; PAL_SGB3
- RGB 31,31,17
- RGB 18,21,29
- RGB 15,15,15
-ENDC
-IF DEF(_BLUE)
- RGB 30,29,29 ; PAL_SGB3
- RGB 12,15,11
- RGB 5,9,20
- RGB 14,22,17
-ENDC
-
- ds $18
+ RGB 24, 6, 6
+ RGB 31, 25, 9
+ RGB 25, 10, 10
+ RGB 0, 0, 0
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 18, 24, 18
+ RGB 25, 10, 10
+ RGB 15, 25, 15
+ RGB 0, 0, 0
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 18, 6, 31
+ RGB 31, 25, 9
+ RGB 15, 25, 15
+ RGB 0, 0, 0
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 12, 31, 6
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
+ RGB 31, 31, 25
SGBBorderGraphics:
-IF DEF(_RED)
- INCBIN "gfx/sgb/red_border.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/sgb/blue_border.2bpp"
-ENDC
+ INCBIN "gfx/sgb/border.2bpp"
diff --git a/data/sgb/sgb_packets.asm b/data/sgb/sgb_packets.asm
index 0b6219e1..38257fa1 100644
--- a/data/sgb/sgb_packets.asm
+++ b/data/sgb/sgb_packets.asm
@@ -58,10 +58,6 @@ BlkPacket_WholeScreen:
ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,17
ds 8, 0
-; unused
- db $03, 00,00, 19,17, $00
- db $00
-
BlkPacket_Battle:
ATTR_BLK 5
ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 ; message box: pal 2
@@ -70,40 +66,16 @@ BlkPacket_Battle:
ATTR_BLK_DATA %011, 2,2,0, 00,04, 08,11 ; player mon: pal 2
ATTR_BLK_DATA %011, 3,3,0, 11,00, 19,06 ; enemy mon : pal 3
-; unused
- db $03, 00,00, 19,11, $00
- db $03, 00,12, 19,17, $02
- db $03, 01,00, 10,03, $01
- db $03, 10,08, 19,10, $00
- db $03, 00,04, 08,11, $02
- db $03, 11,00, 19,07, $03
- db $00
-
BlkPacket_StatusScreen:
ATTR_BLK 1
ATTR_BLK_DATA %111, 1,1,0, 01,00, 07,06 ; mon: pal 1, HP bar: pal 0
ds 8, 0
-; unused
- db $02, 00,00, 17,00
- db $03, 01,00, 07,06, $01
- db $03, 01,07, 19,17, $00
- db $03, 08,00, 19,06, $00
- db $00
-
BlkPacket_Pokedex:
ATTR_BLK 1
ATTR_BLK_DATA %111, 1,1,0, 01,01, 08,08 ; mon: pal 1, everything else: pal 0
ds 8, 0
-; unused
- db $02, 00,00, 17,00
- db $01, 00,01, 19,00
- db $03, 01,01, 08,08, $01
- db $03, 01,09, 08,17, $00
- db $03, 09,01, 19,17, $00
- db $00
-
BlkPacket_Slots:
ATTR_BLK 5
ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,11 ; "3" rows and top of screen: pal 1
@@ -112,27 +84,13 @@ BlkPacket_Slots:
ATTR_BLK_DATA %011, 0,0,0, 04,04, 15,09 ; slot reels: pal 0
ATTR_BLK_DATA %011, 0,0,0, 00,12, 19,17 ; message box: pal 0
-; unused
- db $03, 00,00, 19,11, $01
- db $03, 00,04, 19,09, $02
- db $03, 00,06, 19,07, $03
- db $03, 04,04, 15,09, $00
- db $03, 00,12, 19,17, $00
- db $00
-
BlkPacket_Titlescreen:
ATTR_BLK 3
- ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 ; pokemon logo: pal 0
- ATTR_BLK_DATA %010, 1,1,0, 00,08, 19,09 ; version text: pal 1
- ATTR_BLK_DATA %011, 2,2,0, 00,10, 19,17 ; player, mon, copyright text: pal 2
+ ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 ; pokemon logo, version text: pal 0
+ ATTR_BLK_DATA %011, 2,2,0, 00,08, 19,17 ; pikachu, copyright text: pal 2
+ ATTR_BLK_DATA %010, 0,0,0, 09,08, 10,08 ; pika bubble: pal 0
ds 12, 0
-; unused
- db $03, 00,00, 19,07, $00
- db $03, 00,08, 19,09, $01
- db $03, 00,10, 19,17, $02
- db $00
-
BlkPacket_NidorinoIntro:
ATTR_BLK 3
ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 ; upper black bar: pal 1
@@ -140,12 +98,6 @@ BlkPacket_NidorinoIntro:
ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 ; lower black bar: pal 1
ds 12, 0
-; unused
- db $03, 00,00, 19,03, $01
- db $03, 00,04, 19,13, $00
- db $03, 00,14, 19,17, $01
- db $00
-
BlkPacket_PartyMenu:
ATTR_BLK 7
ATTR_BLK_DATA %110, 0,0,1, 01,00, 02,12 ; mon sprites: pal 0, everything else: pal 1
@@ -157,46 +109,20 @@ BlkPacket_PartyMenu:
ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 ; HP bar 5: pal set dynamically
ds 4, 0
-; unused
- db $02, 00,00, 17,01
- db $03, 01,00, 02,12, $00
- db $03, 01,13, 02,17, $01
- db $03, 03,00, 19,17, $01
- db $03, 12,00, 18,01, $00
- db $03, 12,02, 18,03, $00
- db $03, 12,04, 18,05, $00
- db $03, 12,06, 18,07, $00
- db $03, 12,08, 18,09, $00
- db $03, 12,10, 18,11, $00
- db $00
-
BlkPacket_TrainerCard:
ATTR_BLK 10
ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13 ; Boulder Badge
ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13 ; Cascade Badge
ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13 ; Thunder Badge
ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12 ; Rainbow Badge
- ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,14 ; Rainbow Badge
- ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,14 ; Rainbow Badge
+ ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,13 ; Rainbow Badge
+ ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,13 ; Rainbow Badge
ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16 ; Soul Badge
ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16 ; Marsh Badge
ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16 ; Volcano Badge
ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16 ; Earth Badge
ds 2, 0
-; unused
- db $03, 03,12, 04,13, $00
- db $03, 07,12, 08,13, $01
- db $03, 11,12, 12,13, $03
- db $03, 16,11, 17,12, $02
- db $03, 14,13, 15,14, $01
- db $03, 16,13, 17,14, $03
- db $03, 03,15, 04,16, $02
- db $03, 07,15, 08,16, $03
- db $03, 11,15, 12,16, $02
- db $03, 15,15, 16,16, $01
- db $00
-
BlkPacket_GameFreakIntro:
ATTR_BLK 3
ATTR_BLK_DATA %111, 1,1,0, 05,11, 07,13 ; falling stars (left): pal 1, GameFreak logo: pal 0
@@ -204,15 +130,10 @@ BlkPacket_GameFreakIntro:
ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 ; falling stars (right): pal 3
ds 12, 0
-; unused
- db $03, 00,00, 19,10, $00
- db $03, 00,11, 04,13, $00
- db $03, 05,11, 07,13, $01
- db $03, 08,11, 19,13, $00
- db $03, 00,14, 19,17, $00
- db $03, 08,11, 09,13, $02
- db $03, 12,11, 14,13, $03
- db $00
+UnknownPacket_72751:
+ ATTR_BLK 1
+ ATTR_BLK_DATA %111, 1,1,0, 04,00, 15,05
+ ds 8
PalPacket_Empty: PAL_SET 0, 0, 0, 0
@@ -226,6 +147,8 @@ PalPacket_TrainerCard: PAL_SET PAL_MEWMON, PAL_BADGE, PAL_REDMON, PAL_YELLOWM
PalPacket_Generic: PAL_SET PAL_MEWMON, 0, 0, 0
PalPacket_NidorinoIntro: PAL_SET PAL_PURPLEMON, PAL_BLACK, 0, 0
PalPacket_GameFreakIntro: PAL_SET PAL_GAMEFREAK, PAL_REDMON, PAL_VIRIDIAN, PAL_BLUEMON
+UnknownPalPacket_72811: PAL_SET PAL_25, PAL_25, PAL_25, PAL_25
+UnknownPalPacket_72821: PAL_SET PAL_25, PAL_27, PAL_25, PAL_25
PalTrnPacket: PAL_TRN
MltReq1Packet: MLT_REQ 1
@@ -241,14 +164,14 @@ MaskEnCancelPacket: MASK_EN 0
; This set of packets is found in several Japanese SGB-compatible titles.
; It appears to be part of NCL's SGB devkit.
-DataSnd_72548:
+DataSnd_728a1:
DATA_SND $85d, $0, 11
db $8C ; cpx #$8c (2)
db $D0, $F4 ; bne -$0c
db $60 ; rts
ds 7, 0
-DataSnd_72558:
+DataSnd_728b1:
DATA_SND $852, $0, 11
db $A9, $E7 ; lda #$e7
db $9F, $01, $C0, $7E ; sta $7ec001, x
@@ -258,7 +181,7 @@ DataSnd_72558:
db $E8 ; inx
db $E0 ; cpx #$8c (1)
-DataSnd_72568:
+DataSnd_728c1:
DATA_SND $847, $0, 11
db $C4 ; cmp #$c4 (2)
db $D0, $16 ; bne +$16
@@ -268,7 +191,7 @@ DataSnd_72568:
db $D0, $10 ; bne +$10
db $A2, $28 ; ldx #$28
-DataSnd_72578:
+DataSnd_728d1:
DATA_SND $83c, $0, 11
db $F0, $12 ; beq +$12
db $A5 ; lda dp
@@ -279,7 +202,7 @@ DataSnd_72578:
db $CA ; dex
db $C9 ; cmp #$c4 (1)
-DataSnd_72588:
+DataSnd_728e1:
DATA_SND $831, $0, 11
dbw $0C, $CAA5 ; tsb $caa5
db $C9, $7E ; cmp #$7e
@@ -288,7 +211,7 @@ DataSnd_72588:
db $CB ; wai
db $C9, $7E ; cmp #$7e
-DataSnd_72598:
+DataSnd_728f1:
DATA_SND $826, $0, 11
db $39 ; bne +$39 (2)
dbw $CD, $C48 ; cmp $c48
@@ -297,7 +220,7 @@ DataSnd_72598:
db $C9, $C9 ; cmp #$c9
db $80, $D0 ; bra -$30
-DataSnd_725a8:
+DataSnd_72901:
DATA_SND $81b, $0, 11
db $EA ; nop
db $EA ; nop
@@ -309,7 +232,7 @@ DataSnd_725a8:
dbw $CD,$C4F ; cmp $c4f
db $D0 ; bne +$39 (1)
-DataSnd_725b8:
+DataSnd_72911:
DATA_SND $810, $0, 11
dbw $4C, $820 ; jmp $820
db $EA ; nop
diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm
index 58aba757..ba753f6a 100644
--- a/data/sgb/sgb_palettes.asm
+++ b/data/sgb/sgb_palettes.asm
@@ -1,53 +1,89 @@
SuperPalettes:
; entries correspond to PAL_* constants
table_width 2 * 4, SuperPalettes
- RGB 31,29,31, 21,28,11, 20,26,31, 03,02,02 ; PAL_ROUTE
- RGB 31,29,31, 25,28,27, 20,26,31, 03,02,02 ; PAL_PALLET
- RGB 31,29,31, 17,26,03, 20,26,31, 03,02,02 ; PAL_VIRIDIAN
- RGB 31,29,31, 23,25,16, 20,26,31, 03,02,02 ; PAL_PEWTER
- RGB 31,29,31, 17,20,30, 20,26,31, 03,02,02 ; PAL_CERULEAN
- RGB 31,29,31, 27,20,27, 20,26,31, 03,02,02 ; PAL_LAVENDER
- RGB 31,29,31, 30,18,00, 20,26,31, 03,02,02 ; PAL_VERMILION
- RGB 31,29,31, 16,30,22, 20,26,31, 03,02,02 ; PAL_CELADON
- RGB 31,29,31, 31,15,22, 20,26,31, 03,02,02 ; PAL_FUCHSIA
- RGB 31,29,31, 26,10,06, 20,26,31, 03,02,02 ; PAL_CINNABAR
- RGB 31,29,31, 22,14,24, 20,26,31, 03,02,02 ; PAL_INDIGO
- RGB 31,29,31, 27,27,03, 20,26,31, 03,02,02 ; PAL_SAFFRON
- RGB 31,29,31, 20,26,31, 17,23,10, 03,02,02 ; PAL_TOWNMAP
-IF DEF(_RED)
- RGB 31,29,31, 30,30,17, 17,23,10, 21,00,04 ; PAL_LOGO1
-ENDC
-IF DEF(_BLUE)
- RGB 31,29,31, 30,30,17, 21,00,04, 14,19,29 ; PAL_LOGO1
-ENDC
- RGB 31,29,31, 30,30,17, 18,18,24, 07,07,16 ; PAL_LOGO2
- RGB 31,29,31, 24,20,30, 11,20,30, 03,02,02 ; PAL_0F
- RGB 31,29,31, 30,22,17, 16,14,19, 03,02,02 ; PAL_MEWMON
- RGB 31,29,31, 18,20,27, 11,15,23, 03,02,02 ; PAL_BLUEMON
- RGB 31,29,31, 31,20,10, 26,10,06, 03,02,02 ; PAL_REDMON
- RGB 31,29,31, 21,25,29, 14,19,25, 03,02,02 ; PAL_CYANMON
- RGB 31,29,31, 27,22,24, 21,15,23, 03,02,02 ; PAL_PURPLEMON
- RGB 31,29,31, 28,20,15, 21,14,09, 03,02,02 ; PAL_BROWNMON
- RGB 31,29,31, 20,26,16, 09,20,11, 03,02,02 ; PAL_GREENMON
- RGB 31,29,31, 30,22,24, 28,15,21, 03,02,02 ; PAL_PINKMON
- RGB 31,29,31, 31,28,14, 26,20,00, 03,02,02 ; PAL_YELLOWMON
- RGB 31,29,31, 26,21,22, 15,15,18, 03,02,02 ; PAL_GREYMON
- RGB 31,29,31, 26,21,22, 27,20,06, 03,02,02 ; PAL_SLOTS1
-IF DEF(_RED)
- RGB 31,29,31, 31,31,17, 25,17,21, 03,02,02 ; PAL_SLOTS2
- RGB 31,29,31, 22,31,16, 25,17,21, 03,02,02 ; PAL_SLOTS3
- RGB 31,29,31, 16,19,29, 25,17,21, 03,02,02 ; PAL_SLOTS4
-ENDC
-IF DEF(_BLUE)
- RGB 31,29,31, 31,31,17, 16,19,29, 03,02,02 ; PAL_SLOTS2
- RGB 31,29,31, 22,31,16, 16,19,29, 03,02,02 ; PAL_SLOTS3
- RGB 31,29,31, 25,17,21, 16,19,29, 03,02,02 ; PAL_SLOTS4
-ENDC
- RGB 31,29,31, 07,07,07, 02,03,03, 03,02,02 ; PAL_BLACK
- RGB 31,29,31, 30,26,15, 09,20,11, 03,02,02 ; PAL_GREENBAR
- RGB 31,29,31, 30,26,15, 26,20,00, 03,02,02 ; PAL_YELLOWBAR
- RGB 31,29,31, 30,26,15, 26,10,06, 03,02,02 ; PAL_REDBAR
- RGB 31,29,31, 30,22,17, 11,15,23, 03,02,02 ; PAL_BADGE
- RGB 31,29,31, 21,14,09, 18,24,22, 03,02,02 ; PAL_CAVE
- RGB 31,29,31, 31,28,14, 24,20,10, 03,02,02 ; PAL_GAMEFREAK
+ RGB 31,31,30, 23,26,19, 23,27,31, 06,06,06 ; PAL_ROUTE
+ RGB 31,31,30, 28,27,31, 23,27,31, 06,06,06 ; PAL_PALLET
+ RGB 31,31,30, 26,31,21, 23,27,31, 06,06,06 ; PAL_VIRIDIAN
+ RGB 31,31,30, 23,23,22, 23,27,31, 06,06,06 ; PAL_PEWTER
+ RGB 31,31,30, 22,23,31, 23,27,31, 06,06,06 ; PAL_CERULEAN
+ RGB 31,31,30, 27,23,29, 23,27,31, 06,06,06 ; PAL_LAVENDER
+ RGB 31,31,30, 31,25,16, 23,27,31, 06,06,06 ; PAL_VERMILION
+ RGB 31,31,30, 22,31,22, 23,27,31, 06,06,06 ; PAL_CELADON
+ RGB 31,31,30, 31,26,26, 23,27,31, 06,06,06 ; PAL_FUCHSIA
+ RGB 31,31,30, 31,15,14, 23,27,31, 06,06,06 ; PAL_CINNABAR
+ RGB 31,31,30, 17,17,25, 23,27,31, 06,06,06 ; PAL_INDIGO
+ RGB 31,31,30, 31,31,19, 23,27,31, 06,06,06 ; PAL_SAFFRON
+ RGB 31,31,30, 20,26,31, 17,23,10, 03,02,02 ; PAL_TOWNMAP
+ RGB 31,31,30, 30,30,17, 21,00,04, 21,00,04 ; PAL_LOGO1
+ RGB 31,31,30, 30,30,17, 18,18,24, 07,07,16 ; PAL_LOGO2
+ RGB 31,31,30, 24,20,30, 11,20,30, 03,02,02 ; PAL_0F
+ RGB 31,31,30, 31,30,22, 27,16,16, 06,06,06 ; PAL_MEWMON
+ RGB 31,31,30, 21,22,31, 09,10,20, 06,06,06 ; PAL_BLUEMON
+ RGB 31,31,30, 31,24,11, 26,09,06, 06,06,06 ; PAL_REDMON
+ RGB 31,31,30, 26,28,31, 07,24,28, 06,06,06 ; PAL_CYANMON
+ RGB 31,31,30, 27,22,30, 22,15,23, 06,06,06 ; PAL_PURPLEMON
+ RGB 31,31,30, 26,23,18, 18,14,10, 06,06,06 ; PAL_BROWNMON
+ RGB 31,31,30, 24,28,18, 13,21,15, 06,06,06 ; PAL_GREENMON
+ RGB 31,31,30, 31,24,26, 31,18,21, 06,06,06 ; PAL_PINKMON
+ RGB 31,31,30, 31,31,19, 28,23,09, 06,06,06 ; PAL_YELLOWMON
+ RGB 31,31,30, 25,25,18, 16,16,14, 06,06,06 ; PAL_GREYMON
+ RGB 31,31,30, 27,22,30, 26,09,06, 06,06,06 ; PAL_SLOTS1
+ RGB 31,31,30, 31,23,26, 29,29,08, 06,06,06 ; PAL_SLOTS2
+ RGB 31,31,30, 23,31,20, 29,29,08, 06,06,06 ; PAL_SLOTS3
+ RGB 31,31,30, 23,29,31, 29,29,08, 06,06,06 ; PAL_SLOTS4
+ RGB 31,31,30, 06,06,06, 06,06,06, 06,06,06 ; PAL_BLACK
+ RGB 31,31,30, 31,31,19, 00,21,00, 06,06,06 ; PAL_GREENBAR
+ RGB 31,31,30, 31,31,19, 28,23,09, 06,06,06 ; PAL_YELLOWBAR
+ RGB 31,31,30, 31,31,19, 26,09,06, 06,06,06 ; PAL_REDBAR
+ RGB 31,31,30, 20,15,11, 22,21,20, 06,06,06 ; PAL_BADGE
+ RGB 31,31,30, 20,15,11, 22,21,20, 06,06,06 ; PAL_CAVE
+ RGB 31,31,30, 28,24,14, 20,20,11, 06,06,06 ; PAL_GAMEFREAK
+ RGB 31,31,30, 31,30,22, 23,27,31, 06,06,06 ; PAL_25
+ RGB 31,31,30, 28,23,09, 18,14,10, 06,06,06 ; PAL_26
+ RGB 31,31,30, 16,16,16, 31,25,09, 06,06,06 ; PAL_27
+ assert_table_length NUM_SGB_PALS
+
+GBCBasePalettes:
+; entries correspond to PAL_* constants
+ table_width 2 * 4, GBCBasePalettes
+ RGB 31,31,31, 16,31,04, 11,23,31, 03,03,03 ; PAL_ROUTE
+ RGB 31,31,31, 23,17,31, 11,23,31, 03,03,03 ; PAL_PALLET
+ RGB 31,31,31, 19,31,00, 11,23,31, 03,03,03 ; PAL_VIRIDIAN
+ RGB 31,31,31, 18,18,15, 11,23,31, 03,03,03 ; PAL_PEWTER
+ RGB 31,31,31, 05,08,31, 11,23,31, 03,03,03 ; PAL_CERULEAN
+ RGB 31,31,31, 25,04,31, 11,23,31, 03,03,03 ; PAL_LAVENDER
+ RGB 31,31,31, 31,19,00, 11,23,31, 03,03,03 ; PAL_VERMILION
+ RGB 31,31,31, 05,31,05, 11,23,31, 03,03,03 ; PAL_CELADON
+ RGB 31,31,31, 31,15,15, 11,23,31, 03,03,03 ; PAL_FUCHSIA
+ RGB 31,31,31, 31,08,08, 11,23,31, 03,03,03 ; PAL_CINNABAR
+ RGB 31,31,31, 11,08,31, 11,23,31, 03,03,03 ; PAL_INDIGO
+ RGB 31,31,31, 31,31,00, 11,23,31, 03,03,03 ; PAL_SAFFRON
+ RGB 31,31,31, 00,21,31, 10,28,00, 01,01,01 ; PAL_TOWNMAP
+ RGB 31,31,31, 31,31,00, 31,00,00, 31,00,00 ; PAL_LOGO1
+ RGB 31,31,31, 31,31,00, 07,07,25, 00,00,17 ; PAL_LOGO2
+ RGB 31,31,31, 13,01,31, 00,09,31, 01,01,01 ; PAL_0F
+ RGB 31,31,31, 31,31,00, 31,01,01, 03,03,03 ; PAL_MEWMON
+ RGB 31,31,31, 16,18,31, 00,01,25, 03,03,03 ; PAL_BLUEMON
+ RGB 31,31,31, 31,17,00, 31,00,00, 03,03,03 ; PAL_REDMON
+ RGB 31,31,31, 16,26,31, 00,17,31, 03,03,03 ; PAL_CYANMON
+ RGB 31,31,31, 25,15,31, 19,00,22, 03,03,03 ; PAL_PURPLEMON
+ RGB 31,31,31, 29,18,10, 17,09,05, 03,03,03 ; PAL_BROWNMON
+ RGB 31,31,31, 17,31,11, 01,22,06, 03,03,03 ; PAL_GREENMON
+ RGB 31,31,31, 31,15,18, 31,00,06, 03,03,03 ; PAL_PINKMON
+ RGB 31,31,31, 31,31,00, 28,14,00, 03,03,03 ; PAL_YELLOWMON
+ RGB 31,31,31, 20,23,10, 11,11,05, 03,03,03 ; PAL_GREYMON
+ RGB 31,31,31, 25,01,31, 31,00,00, 03,03,03 ; PAL_SLOTS1
+ RGB 31,31,31, 31,04,19, 31,31,00, 03,03,03 ; PAL_SLOTS2
+ RGB 31,31,31, 08,31,00, 31,31,00, 03,03,03 ; PAL_SLOTS3
+ RGB 31,31,31, 00,31,31, 31,31,00, 03,03,03 ; PAL_SLOTS4
+ RGB 31,31,31, 03,03,03, 03,03,03, 03,03,03 ; PAL_BLACK
+ RGB 31,31,31, 31,31,00, 00,31,00, 03,03,03 ; PAL_GREENBAR
+ RGB 31,31,31, 31,31,00, 31,18,00, 03,03,03 ; PAL_YELLOWBAR
+ RGB 31,31,31, 31,31,00, 31,00,00, 03,03,03 ; PAL_REDBAR
+ RGB 31,31,31, 23,08,00, 17,14,11, 03,03,03 ; PAL_BADGE
+ RGB 31,31,31, 23,08,00, 17,14,11, 03,03,03 ; PAL_CAVE
+ RGB 31,31,31, 31,19,00, 19,19,00, 03,03,03 ; PAL_GAMEFREAK
+ RGB 31,31,31, 31,31,00, 11,23,31, 03,03,03 ; PAL_25
+ RGB 31,31,31, 31,18,00, 19,07,01, 03,03,03 ; PAL_26
+ RGB 31,31,31, 09,09,09, 31,21,00, 03,03,03 ; PAL_27
assert_table_length NUM_SGB_PALS
diff --git a/data/sprite_anims/intro_frames.asm b/data/sprite_anims/intro_frames.asm
new file mode 100644
index 00000000..bed2aa6f
--- /dev/null
+++ b/data/sprite_anims/intro_frames.asm
@@ -0,0 +1,70 @@
+YellowIntro_AnimatedObjectFramesData:
+ dw Unkn_fa100
+ dw Unkn_fa103
+ dw Unkn_fa10a
+ dw Unkn_fa111
+ dw Unkn_fa118
+ dw Unkn_fa11b
+ dw Unkn_fa11e
+ dw Unkn_fa121
+ dw Unkn_fa124
+ dw Unkn_fa127
+ dw Unkn_fa138
+
+Unkn_fa100:
+ frame $00, 32
+ endanim
+
+Unkn_fa103:
+ frame $01, 4
+ frame $02, 4
+ frame $03, 4
+ dorestart
+
+Unkn_fa10a:
+ frame $04, 4
+ frame $05, 4
+ frame $06, 4
+ dorestart
+
+Unkn_fa111:
+ frame $07, 4
+ frame $08, 4
+ frame $09, 4
+ dorestart
+
+Unkn_fa118:
+ frame $0a, 32
+ endanim
+
+Unkn_fa11b:
+ frame $0b, 32
+ endanim
+
+Unkn_fa11e:
+ frame $0c, 32
+ endanim
+
+Unkn_fa121:
+ frame $0d, 32
+ endanim
+
+Unkn_fa124:
+ frame $0e, 32
+ endanim
+
+Unkn_fa127:
+ frame $0f, 31
+ frame $11, 2
+ frame $0f, 2
+ frame $11, 2
+ frame $0f, 31
+ frame $11, 2
+ frame $0f, 23
+ frame $10, 32
+ endanim
+
+Unkn_fa138:
+ frame $12, 4
+ frame $13, 4
+ dorestart
diff --git a/data/sprite_anims/intro_oam.asm b/data/sprite_anims/intro_oam.asm
new file mode 100644
index 00000000..f966d082
--- /dev/null
+++ b/data/sprite_anims/intro_oam.asm
@@ -0,0 +1,165 @@
+YellowIntro_AnimatedObjectOAMData:
+ dbw $00, Unkn_fa179
+ dbw $96, Unkn_fa17e
+ dbw $98, Unkn_fa17e
+ dbw $9a, Unkn_fa17e
+ dbw $0c, Unkn_fa18f
+ dbw $0e, Unkn_fa18f
+ dbw $3c, Unkn_fa18f
+ dbw $60, Unkn_fa1b0
+ dbw $70, Unkn_fa1b0
+ dbw $80, Unkn_fa1b0
+ dbw $90, Unkn_fa201
+ dbw $00, Unkn_fa201
+ dbw $06, Unkn_fa201
+ dbw $c6, Unkn_fa292
+ dbw $6d, Unkn_fa2f7
+ dbw $f0, Unkn_fa308
+ dbw $f4, Unkn_fa308
+ dbw $f8, Unkn_fa308
+ dbw $9c, Unkn_fa329
+ dbw $ec, Unkn_fa329
+
+Unkn_fa179:
+ db 1
+ db $fc, $fc, $00, $00
+Unkn_fa17e:
+ db 4
+ db $f8, $f8, $00, $00
+ db $f8, $00, $01, $00
+ db $00, $f8, $10, $00
+ db $00, $00, $11, $00
+
+Unkn_fa18f:
+ db 8
+ db $f0, $f8, $00, $00
+ db $f0, $00, $01, $00
+ db $f8, $f8, $10, $00
+ db $f8, $00, $11, $00
+ db $00, $f8, $20, $00
+ db $00, $00, $20, $20
+ db $08, $f8, $21, $00
+ db $08, $00, $21, $20
+
+Unkn_fa1b0:
+ db 20
+ db $e8, $f8, $00, $00
+ db $e8, $00, $01, $00
+ db $f0, $f8, $02, $00
+ db $f0, $00, $03, $00
+ db $f8, $f0, $04, $00
+ db $f8, $f8, $05, $00
+ db $f8, $00, $06, $00
+ db $f8, $08, $04, $20
+ db $00, $f0, $07, $00
+ db $00, $f8, $08, $00
+ db $00, $00, $08, $20
+ db $00, $08, $07, $20
+ db $08, $f0, $09, $00
+ db $08, $f8, $0a, $00
+ db $08, $00, $0a, $20
+ db $08, $08, $09, $20
+ db $10, $f0, $0b, $00
+ db $10, $f8, $0c, $00
+ db $10, $00, $0c, $20
+ db $10, $08, $0b, $20
+
+Unkn_fa201:
+ db 36
+ db $e8, $e8, $00, $00
+ db $e8, $f0, $01, $00
+ db $e8, $f8, $02, $00
+ db $e8, $00, $03, $00
+ db $e8, $08, $04, $00
+ db $e8, $10, $05, $00
+ db $f0, $e8, $10, $00
+ db $f0, $f0, $11, $00
+ db $f0, $f8, $12, $00
+ db $f0, $00, $13, $00
+ db $f0, $08, $14, $00
+ db $f0, $10, $15, $00
+ db $f8, $e8, $20, $00
+ db $f8, $f0, $21, $00
+ db $f8, $f8, $22, $00
+ db $f8, $00, $23, $00
+ db $f8, $08, $24, $00
+ db $f8, $10, $25, $00
+ db $00, $e8, $30, $00
+ db $00, $f0, $31, $00
+ db $00, $f8, $32, $00
+ db $00, $00, $33, $00
+ db $00, $08, $34, $00
+ db $00, $10, $35, $00
+ db $08, $e8, $40, $00
+ db $08, $f0, $41, $00
+ db $08, $f8, $42, $00
+ db $08, $00, $43, $00
+ db $08, $08, $44, $00
+ db $08, $10, $45, $00
+ db $10, $e8, $50, $00
+ db $10, $f0, $51, $00
+ db $10, $f8, $52, $00
+ db $10, $00, $53, $00
+ db $10, $08, $54, $00
+ db $10, $10, $55, $00
+
+Unkn_fa292:
+ db 25
+ db $ec, $f0, $00, $00
+ db $ec, $f8, $01, $00
+ db $ec, $00, $02, $00
+ db $ec, $08, $03, $00
+ db $ec, $10, $04, $00
+ db $f4, $f0, $05, $00
+ db $f4, $f8, $06, $00
+ db $f4, $00, $07, $00
+ db $f4, $08, $08, $00
+ db $f4, $10, $09, $00
+ db $fc, $f0, $10, $00
+ db $fc, $f8, $11, $00
+ db $fc, $00, $12, $00
+ db $fc, $08, $13, $00
+ db $fc, $10, $14, $00
+ db $04, $f0, $15, $00
+ db $04, $f8, $16, $00
+ db $04, $00, $17, $00
+ db $04, $08, $18, $00
+ db $04, $10, $19, $00
+ db $0c, $f0, $20, $00
+ db $0c, $f8, $21, $00
+ db $0c, $00, $22, $00
+ db $0c, $08, $23, $00
+ db $0c, $10, $24, $00
+
+Unkn_fa2f7:
+ db 4
+ db $fc, $f0, $00, $00
+ db $fc, $f8, $01, $00
+ db $fc, $00, $01, $20
+ db $fc, $08, $00, $20
+
+Unkn_fa308:
+ db 8
+ db $f8, $e8, $00, $10
+ db $f8, $f0, $01, $10
+ db $00, $e8, $02, $10
+ db $00, $f0, $03, $10
+ db $f8, $08, $01, $30
+ db $f8, $10, $00, $30
+ db $00, $08, $03, $30
+ db $00, $10, $02, $30
+
+Unkn_fa329:
+ db 12
+ db $f8, $d8, $00, $10
+ db $f8, $e0, $01, $10
+ db $f8, $e8, $02, $10
+ db $00, $d8, $10, $10
+ db $00, $e0, $11, $10
+ db $00, $e8, $12, $10
+ db $f8, $10, $02, $30
+ db $f8, $18, $01, $30
+ db $f8, $20, $00, $30
+ db $00, $10, $12, $30
+ db $00, $18, $11, $30
+ db $00, $20, $10, $30
diff --git a/data/sprite_anims/surfing_pikachu_frames.asm b/data/sprite_anims/surfing_pikachu_frames.asm
new file mode 100644
index 00000000..cf3463a3
--- /dev/null
+++ b/data/sprite_anims/surfing_pikachu_frames.asm
@@ -0,0 +1,200 @@
+SurfingPikachuFrames:
+ dw Unkn_f943d ; 00
+ dw Unkn_f9440 ; 01
+ dw Unkn_f9445 ; 02
+ dw Unkn_f944a ; 03
+ dw Unkn_f944f ; 04
+ dw Unkn_f9454 ; 05
+ dw Unkn_f9459 ; 06
+ dw Unkn_f945e ; 07
+ dw Unkn_f9463 ; 08
+ dw Unkn_f9468 ; 09
+ dw Unkn_f946d ; 0a
+ dw Unkn_f9472 ; 0b
+ dw Unkn_f9477 ; 0c
+ dw Unkn_f947c ; 0d
+ dw Unkn_f9481 ; 0e
+ dw Unkn_f9486 ; 0f
+ dw Unkn_f948b ; 10
+ dw Unkn_f9494 ; 11
+ dw Unkn_f9499 ; 12
+ dw Unkn_f949e ; 13
+ dw Unkn_f94fb ; 14
+ dw Unkn_f94a1 ; 15
+ dw Unkn_f94b0 ; 16
+ dw Unkn_f94bf ; 17
+ dw Unkn_f94ce ; 18
+ dw Unkn_f94dd ; 19
+ dw Unkn_f94ec ; 1a
+ dw Unkn_f94fe ; 1b
+
+Unkn_f943d:
+ frame $00, 32
+ endanim
+
+Unkn_f9440:
+ frame $01, 8
+ frame $02, 8
+ dorestart
+
+Unkn_f9445:
+ frame $03, 8
+ frame $04, 8
+ dorestart
+
+Unkn_f944a:
+ frame $05, 8
+ frame $06, 8
+ dorestart
+
+Unkn_f944f:
+ frame $07, 8
+ frame $08, 8
+ dorestart
+
+Unkn_f9454:
+ frame $09, 8
+ frame $0a, 8
+ dorestart
+
+Unkn_f9459:
+ frame $0b, 8
+ frame $0c, 8
+ dorestart
+
+Unkn_f945e:
+ frame $0d, 8
+ frame $0e, 8
+ dorestart
+
+Unkn_f9463:
+ frame $01, 8, OAM_HFLIP, OAM_VFLIP
+ frame $02, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f9468:
+ frame $03, 8, OAM_HFLIP, OAM_VFLIP
+ frame $04, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f946d:
+ frame $05, 8, OAM_HFLIP, OAM_VFLIP
+ frame $06, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f9472:
+ frame $07, 8, OAM_HFLIP, OAM_VFLIP
+ frame $08, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f9477:
+ frame $09, 8, OAM_HFLIP, OAM_VFLIP
+ frame $0a, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f947c:
+ frame $0b, 8, OAM_HFLIP, OAM_VFLIP
+ frame $0c, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f9481:
+ frame $0d, 8, OAM_HFLIP, OAM_VFLIP
+ frame $0e, 8, OAM_HFLIP, OAM_VFLIP
+ dorestart
+
+Unkn_f9486:
+ frame $11, 7
+ frame $12, 7
+ dorestart
+
+Unkn_f948b:
+ frame $13, 2
+ frame $14, 2
+ dorepeat 8
+ frame $15, 2
+ endanim
+
+Unkn_f9494:
+ frame $16, 32
+ frame $16, 32
+ delanim
+
+Unkn_f9499:
+ frame $17, 32
+ frame $17, 32
+ delanim
+
+Unkn_f949e:
+ frame $18, 32
+ endanim
+
+Unkn_f94a1:
+ frame $1a, 4
+ dorepeat 1
+ frame $1a, 3
+ dorepeat 1
+ frame $1a, 2
+ dorepeat 1
+ frame $1a, 1
+ delanim
+
+Unkn_f94b0:
+ frame $1b, 4
+ dorepeat 1
+ frame $1b, 3
+ dorepeat 1
+ frame $1b, 2
+ dorepeat 1
+ frame $1b, 1
+ delanim
+
+Unkn_f94bf:
+ frame $1c, 4
+ dorepeat 1
+ frame $1c, 3
+ dorepeat 1
+ frame $1c, 2
+ dorepeat 1
+ frame $1c, 1
+ delanim
+
+Unkn_f94ce:
+ frame $1d, 4
+ dorepeat 1
+ frame $1d, 3
+ dorepeat 1
+ frame $1d, 2
+ dorepeat 1
+ frame $1d, 1
+ delanim
+
+Unkn_f94dd:
+ frame $1e, 4
+ dorepeat 1
+ frame $1e, 3
+ dorepeat 1
+ frame $1e, 2
+ dorepeat 1
+ frame $1e, 1
+ delanim
+
+Unkn_f94ec:
+ frame $1f, 4
+ dorepeat 1
+ frame $1f, 3
+ dorepeat 1
+ frame $1f, 2
+ dorepeat 1
+ frame $1f, 1
+ delanim
+
+Unkn_f94fb:
+ frame $19, 1
+ delanim
+
+Unkn_f94fe:
+ frame $20, 7
+ frame $21, 7
+ frame $22, 7
+ frame $23, 7
+ dorestart
diff --git a/data/sprite_anims/surfing_pikachu_oam.asm b/data/sprite_anims/surfing_pikachu_oam.asm
new file mode 100644
index 00000000..d3aa441f
--- /dev/null
+++ b/data/sprite_anims/surfing_pikachu_oam.asm
@@ -0,0 +1,182 @@
+SurfingPikachuOAMData:
+ dbw $00, .Frame0
+ dbw $00, .Frame1
+ dbw $36, .Frame2
+ dbw $03, .Frame3
+ dbw $39, .Frame4
+ dbw $06, .Frame5
+ dbw $3c, .Frame6
+ dbw $09, .Frame7
+ dbw $60, .Frame8
+ dbw $0c, .Frame9
+ dbw $63, .Frame10
+ dbw $30, .Frame11
+ dbw $66, .Frame12
+ dbw $33, .Frame13
+ dbw $69, .Frame14
+ dbw $6c, .Frame15
+ dbw $9c, .Frame16
+ dbw $a0, .Frame17
+ dbw $a3, .Frame18
+ dbw $a7, .Frame19
+ dbw $a8, .Frame20
+ dbw $98, .Frame21
+ dbw $e0, .Frame22
+ dbw $e6, .Frame23
+ dbw $ca, .Frame24
+ dbw $a7, .Frame25
+ dbw $00, .Frame26
+ dbw $00, .Frame27
+ dbw $00, .Frame28
+ dbw $00, .Frame29
+ dbw $00, .Frame30
+ dbw $00, .Frame31
+ dbw $80, .Frame32
+ dbw $84, .Frame33
+ dbw $88, .Frame34
+ dbw $8c, .Frame35
+
+.Frame0:
+ db 1
+ db $fc, $fc, $00, $00
+
+.Frame1:
+.Frame2:
+.Frame3:
+.Frame4:
+.Frame5:
+.Frame6:
+.Frame7:
+.Frame8:
+.Frame9:
+.Frame10:
+.Frame11:
+.Frame12:
+.Frame13:
+.Frame14:
+.Frame15:
+.Frame16:
+.Frame17:
+.Frame18:
+ db 9
+ db $f4, $f4, $00, $00
+ db $f4, $fc, $01, $00
+ db $f4, $04, $02, $00
+ db $fc, $f4, $10, $00
+ db $fc, $fc, $11, $00
+ db $fc, $04, $12, $00
+ db $04, $f4, $20, $00
+ db $04, $fc, $21, $00
+ db $04, $04, $22, $00
+
+.Frame22:
+.Frame23:
+.Frame24:
+ db 12
+ db $f8, $e8, $00, $00
+ db $f8, $f0, $01, $00
+ db $f8, $f8, $02, $00
+ db $f8, $00, $03, $00
+ db $f8, $08, $04, $00
+ db $f8, $10, $05, $00
+ db $00, $e8, $10, $00
+ db $00, $f0, $11, $00
+ db $00, $f8, $12, $00
+ db $00, $00, $13, $00
+ db $00, $08, $14, $00
+ db $00, $10, $15, $00
+
+.Frame25:
+ db 3
+ db $fc, $0b, $00, $10
+ db $04, $03, $0f, $10
+ db $04, $0b, $10, $10
+
+.Frame19:
+ db 6
+ db $fc, $f0, $00, $30
+ db $fc, $08, $00, $10
+ db $04, $f0, $10, $30
+ db $04, $f8, $0f, $30
+ db $04, $00, $0f, $10
+ db $04, $08, $10, $10
+
+.Frame20:
+ db 12
+ db $f4, $f0, $00, $10
+ db $f4, $f8, $01, $10
+ db $f4, $00, $01, $30
+ db $f4, $08, $00, $30
+ db $fc, $f0, $10, $10
+ db $fc, $f8, $11, $10
+ db $fc, $00, $11, $30
+ db $fc, $08, $10, $30
+ db $04, $f0, $20, $10
+ db $04, $f8, $21, $10
+ db $04, $00, $21, $30
+ db $04, $08, $20, $30
+
+.Frame21:
+ db 3
+ db $04, $f4, $00, $00
+ db $04, $fc, $01, $00
+ db $04, $04, $02, $00
+
+.Frame26:
+ db 3
+ db $fc, $f4, $bf, $00
+ db $fc, $fc, $d5, $00
+ db $fc, $04, $d0, $00
+
+.Frame27:
+ db 4
+ db $fc, $f0, $bf, $00
+ db $fc, $f8, $d1, $00
+ db $fc, $00, $d5, $00
+ db $fc, $08, $d0, $00
+
+.Frame28:
+ db 4
+ db $fc, $f0, $bf, $00
+ db $fc, $f8, $d3, $00
+ db $fc, $00, $d5, $00
+ db $fc, $08, $d0, $00
+
+.Frame29:
+ db 4
+ db $fc, $f0, $bf, $00
+ db $fc, $f8, $d7, $00
+ db $fc, $00, $d5, $00
+ db $fc, $08, $d0, $00
+
+.Frame30:
+ db 4
+ db $fc, $f0, $bf, $00
+ db $fc, $f8, $d1, $00
+ db $fc, $00, $d8, $00
+ db $fc, $08, $d0, $00
+
+.Frame31:
+ db 4
+ db $fc, $f0, $bf, $00
+ db $fc, $f8, $d5, $00
+ db $fc, $00, $d0, $00
+ db $fc, $08, $d0, $00
+
+.Frame32:
+.Frame33:
+.Frame34:
+.Frame35:
+ db 12
+ db $f4, $f0, $03, $20
+ db $f4, $f8, $02, $20
+ db $f4, $00, $01, $20
+ db $f4, $08, $00, $20
+ db $fc, $f0, $13, $20
+ db $fc, $f8, $12, $20
+ db $fc, $00, $11, $20
+ db $fc, $08, $10, $20
+ db $04, $f0, $23, $20
+ db $04, $f8, $22, $20
+ db $04, $00, $21, $20
+ db $04, $08, $20, $20
diff --git a/data/sprites/facings.asm b/data/sprites/facings.asm
index eb583d53..d3455d74 100644
--- a/data/sprites/facings.asm
+++ b/data/sprites/facings.asm
@@ -1,59 +1,126 @@
SpriteFacingAndAnimationTable:
; This table is used for overworld sprites $1-$9.
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 0
- dw .WalkingDown, .NormalOAM ; facing down, walk animation frame 1
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 2
- dw .WalkingDown, .FlippedOAM ; facing down, walk animation frame 3
- dw .StandingUp, .NormalOAM ; facing up, walk animation frame 0
- dw .WalkingUp, .NormalOAM ; facing up, walk animation frame 1
- dw .StandingUp, .NormalOAM ; facing up, walk animation frame 2
- dw .WalkingUp, .FlippedOAM ; facing up, walk animation frame 3
- dw .StandingLeft, .NormalOAM ; facing left, walk animation frame 0
- dw .WalkingLeft, .NormalOAM ; facing left, walk animation frame 1
- dw .StandingLeft, .NormalOAM ; facing left, walk animation frame 2
- dw .WalkingLeft, .NormalOAM ; facing left, walk animation frame 3
- dw .StandingLeft, .FlippedOAM ; facing right, walk animation frame 0
- dw .WalkingLeft, .FlippedOAM ; facing right, walk animation frame 1
- dw .StandingLeft, .FlippedOAM ; facing right, walk animation frame 2
- dw .WalkingLeft, .FlippedOAM ; facing right, walk animation frame 3
+ dw .StandingDown ; facing down, walk animation frame 0
+ dw .WalkingDown ; facing down, walk animation frame 1
+ dw .StandingDown ; facing down, walk animation frame 2
+ dw .WalkingDown2 ; facing down, walk animation frame 3
+ dw .StandingUp ; facing up, walk animation frame 0
+ dw .WalkingUp ; facing up, walk animation frame 1
+ dw .StandingUp ; facing up, walk animation frame 2
+ dw .WalkingUp2 ; facing up, walk animation frame 3
+ dw .StandingLeft ; facing left, walk animation frame 0
+ dw .WalkingLeft ; facing left, walk animation frame 1
+ dw .StandingLeft ; facing left, walk animation frame 2
+ dw .WalkingLeft ; facing left, walk animation frame 3
+ dw .StandingRight ; facing right, walk animation frame 0
+ dw .WalkingRight ; facing right, walk animation frame 1
+ dw .StandingRight ; facing right, walk animation frame 2
+ dw .WalkingRight ; facing right, walk animation frame 3
; The rest of this table is used for sprites $a and $b.
; All orientation and animation parameters lead to the same result.
; Used for immobile sprites like items on the ground.
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 0
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 1
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 2
- dw .StandingDown, .NormalOAM ; facing down, walk animation frame 3
- dw .StandingDown, .NormalOAM ; facing up, walk animation frame 0
- dw .StandingDown, .NormalOAM ; facing up, walk animation frame 1
- dw .StandingDown, .NormalOAM ; facing up, walk animation frame 2
- dw .StandingDown, .NormalOAM ; facing up, walk animation frame 3
- dw .StandingDown, .NormalOAM ; facing left, walk animation frame 0
- dw .StandingDown, .NormalOAM ; facing left, walk animation frame 1
- dw .StandingDown, .NormalOAM ; facing left, walk animation frame 2
- dw .StandingDown, .NormalOAM ; facing left, walk animation frame 3
- dw .StandingDown, .NormalOAM ; facing right, walk animation frame 0
- dw .StandingDown, .NormalOAM ; facing right, walk animation frame 1
- dw .StandingDown, .NormalOAM ; facing right, walk animation frame 2
- dw .StandingDown, .NormalOAM ; facing right, walk animation frame 3
-
-; four tile ids compose an overworld sprite
-.StandingDown: db $00, $01, $02, $03
-.WalkingDown: db $80, $81, $82, $83
-.StandingUp: db $04, $05, $06, $07
-.WalkingUp: db $84, $85, $86, $87
-.StandingLeft: db $08, $09, $0a, $0b
-.WalkingLeft: db $88, $89, $8a, $8b
-
-.NormalOAM:
- ; y, x, attributes
- db 0, 0, $00 ; top left
- db 0, 8, $00 ; top right
- db 8, 0, OAMFLAG_CANBEMASKED ; bottom left
- db 8, 8, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
-
-.FlippedOAM:
- ; y, x, attributes
- db 0, 8, OAM_HFLIP ; top left
- db 0, 0, OAM_HFLIP ; top right
- db 8, 8, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left
- db 8, 0, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+ dw .StandingDown
+; special case
+ dw .SpecialCase ; pikachu maybe?
+
+; Tables used as a reference to transform OAM data.
+
+; Format:
+; db y, x, attributes, tile index
+
+.StandingDown:
+ db 4 ; #
+ db 0, 0, $00, 0
+ db 0, 8, $01, 0
+ db 8, 0, $02, OAMFLAG_CANBEMASKED
+ db 8, 8, $03, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingDown:
+ db 4 ; #
+ db 0, 0, $80, 0
+ db 0, 8, $81, 0
+ db 8, 0, $82, OAMFLAG_CANBEMASKED
+ db 8, 8, $83, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingDown2:
+ db 4 ; #
+ db 0, 8, $80, OAM_HFLIP
+ db 0, 0, $81, OAM_HFLIP
+ db 8, 8, $82, OAM_HFLIP | OAMFLAG_CANBEMASKED
+ db 8, 0, $83, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.StandingUp:
+ db 4 ; #
+ db 0, 0, $04, 0
+ db 0, 8, $05, 0
+ db 8, 0, $06, OAMFLAG_CANBEMASKED
+ db 8, 8, $07, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingUp:
+ db 4 ; #
+ db 0, 0, $84, 0
+ db 0, 8, $85, 0
+ db 8, 0, $86, OAMFLAG_CANBEMASKED
+ db 8, 8, $87, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingUp2:
+ db 4 ; #
+ db 0, 8, $84, OAM_HFLIP
+ db 0, 0, $85, OAM_HFLIP
+ db 8, 8, $86, OAM_HFLIP | OAMFLAG_CANBEMASKED
+ db 8, 0, $87, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.StandingLeft:
+ db 4 ; #
+ db 0, 0, $08, 0
+ db 0, 8, $09, 0
+ db 8, 0, $0a, OAMFLAG_CANBEMASKED
+ db 8, 8, $0b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingLeft:
+ db 4 ; #
+ db 0, 0, $88, 0
+ db 0, 8, $89, 0
+ db 8, 0, $8a, OAMFLAG_CANBEMASKED
+ db 8, 8, $8b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.StandingRight:
+ db 4 ; #
+ db 0, 8, $08, OAM_HFLIP
+ db 0, 0, $09, OAM_HFLIP
+ db 8, 8, $0a, OAM_HFLIP | OAMFLAG_CANBEMASKED
+ db 8, 0, $0b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.WalkingRight:
+ db 4 ; #
+ db 0, 8, $88, OAM_HFLIP
+ db 0, 0, $89, OAM_HFLIP
+ db 8, 8, $8a, OAM_HFLIP | OAMFLAG_CANBEMASKED
+ db 8, 0, $8b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
+
+.SpecialCase:
+ db 9 ; #
+ db -4, -4, $00, 0
+ db -4, 4, $01, 0
+ db -4, 12, $00, OAM_HFLIP
+ db 4, -4, $01, 0
+ db 4, 4, $02, 0
+ db 4, 12, $01, 0
+ db 12, -4, $00, OAM_VFLIP | OAMFLAG_CANBEMASKED
+ db 12, 4, $01, OAMFLAG_CANBEMASKED
+ db 12, 12, $00, OAM_VFLIP | OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA
diff --git a/data/sprites/sprites.asm b/data/sprites/sprites.asm
index 1cd793c1..47b52b1c 100644
--- a/data/sprites/sprites.asm
+++ b/data/sprites/sprites.asm
@@ -37,7 +37,7 @@ SpriteSheetPointerTable:
overworld_sprite MiddleAgedWomanSprite, 12 ; SPRITE_MIDDLE_AGED_WOMAN
overworld_sprite BrunetteGirlSprite, 12 ; SPRITE_BRUNETTE_GIRL
overworld_sprite LanceSprite, 12 ; SPRITE_LANCE
- overworld_sprite ScientistSprite, 12 ; SPRITE_UNUSED_SCIENTIST
+ overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_1
overworld_sprite ScientistSprite, 12 ; SPRITE_SCIENTIST
overworld_sprite RockerSprite, 12 ; SPRITE_ROCKER
overworld_sprite SwimmerSprite, 12 ; SPRITE_SWIMMER
@@ -56,17 +56,27 @@ SpriteSheetPointerTable:
overworld_sprite FisherSprite, 12 ; SPRITE_FISHER
overworld_sprite KogaSprite, 12 ; SPRITE_KOGA
overworld_sprite GuardSprite, 12 ; SPRITE_GUARD
- overworld_sprite GuardSprite, 12 ; SPRITE_UNUSED_GUARD
+ overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_2
overworld_sprite MomSprite, 12 ; SPRITE_MOM
overworld_sprite BaldingGuySprite, 12 ; SPRITE_BALDING_GUY
overworld_sprite LittleBoySprite, 12 ; SPRITE_LITTLE_BOY
- overworld_sprite GameboyKidSprite, 12 ; SPRITE_UNUSED_GAMEBOY_KID
+ overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_3
overworld_sprite GameboyKidSprite, 12 ; SPRITE_GAMEBOY_KID
overworld_sprite FairySprite, 12 ; SPRITE_FAIRY
overworld_sprite AgathaSprite, 12 ; SPRITE_AGATHA
overworld_sprite BrunoSprite, 12 ; SPRITE_BRUNO
overworld_sprite LoreleiSprite, 12 ; SPRITE_LORELEI
overworld_sprite SeelSprite, 12 ; SPRITE_SEEL
+ overworld_sprite PikachuSprite, 12 ; SPRITE_PIKACHU
+ overworld_sprite OfficerJennySprite, 12 ; SPRITE_OFFICER_JENNY
+ overworld_sprite SandshrewSprite, 12 ; SPRITE_SANDSHREW
+ overworld_sprite OddishSprite, 12 ; SPRITE_ODDISH
+ overworld_sprite BulbasaurSprite, 12 ; SPRITE_BULBASAUR
+ overworld_sprite JigglypuffSprite, 12 ; SPRITE_JIGGLYPUFF
+ overworld_sprite ClefairySprite, 12 ; SPRITE_CLEFAIRY
+ overworld_sprite ChanseySprite, 12 ; SPRITE_CHANSEY
+ overworld_sprite JessieSprite, 12 ; SPRITE_JESSIE
+ overworld_sprite JamesSprite, 12 ; SPRITE_JAMES
overworld_sprite PokeBallSprite, 4 ; SPRITE_POKE_BALL
overworld_sprite FossilSprite, 4 ; SPRITE_FOSSIL
overworld_sprite BoulderSprite, 4 ; SPRITE_BOULDER
diff --git a/data/text/text_1.asm b/data/text/text_1.asm
index af1d3827..eb394afe 100644
--- a/data/text/text_1.asm
+++ b/data/text/text_1.asm
@@ -147,3 +147,8 @@ _OaksAideNoRoomText::
text_ram wOaksAideRewardItemName
text "."
done
+
+_NurseChanseyText::
+ text "CHANSEY: Chaaan"
+ line "sey!"
+ done
diff --git a/data/text/text_2.asm b/data/text/text_2.asm
index 230a38f0..dd74bd79 100644
--- a/data/text/text_2.asm
+++ b/data/text/text_2.asm
@@ -17,6 +17,15 @@ _AIBattleUseItemText::
text "!"
prompt
+_BoxFullDebugText::
+ text "The BOX is full!"
+ done
+
+_BoxWillBeClearedText::
+ text "The BOX will be"
+ line "cleared."
+ done
+
_TradeWentToText::
text_ram wcf4b
text " went"
@@ -318,7 +327,7 @@ _GameOverText::
line "GAME is over!"
done
-_CinnabarGymQuizIntroText::
+_CinnabarGymQuizDummyIntroText::
text "#MON Quiz!"
para "Get it right and"
@@ -337,6 +346,34 @@ _CinnabarGymQuizIntroText::
line "Here we go!"
prompt
+_CinnabarGymQuizIntroText::
+ text "#MON Quiz!"
+
+ para "Get it right and"
+ line "the door opens to"
+ cont "the next room!"
+
+ para "Get it wrong and"
+ line "face the trainer"
+ cont "blocking the way!"
+
+ para "If you want to"
+ line "conserve your"
+ cont "#MON for the"
+ cont "GYM LEADER..."
+
+ para "Then get it right!"
+ line "Here we go!"
+ para ""
+ done
+
+_CinnabarGymQuizShortIntroText::
+ text "#MON Quiz!"
+
+ line "Test your skill!"
+ para ""
+ done
+
_CinnabarQuizQuestionsText1::
text "CATERPIE evolves"
line "into BUTTERFREE?"
@@ -602,6 +639,14 @@ _KabutopsFossilText::
cont "rare #MON."
done
+_FanClubPicture1Text::
+ text "My cute RAPIDASH."
+ done
+
+_FanClubPicture2Text::
+ text "My beloved FEAROW."
+ done
+
_LinkCableHelpText1::
text "TRAINER TIPS"
@@ -947,6 +992,10 @@ _GotAwayText::
text "Got away safely!"
prompt
+_RunAwayText::
+ text "Hurry, get away!"
+ prompt
+
_ItemsCantBeUsedHereText::
text "Items can't be"
line "used here."
@@ -977,7 +1026,7 @@ _NoMovesLeftText::
_MultiHitText::
text "Hit the enemy"
line "@"
- text_decimal wPlayerNumHits, 1, 1
+ text_decimal wPlayerNumHits,1,1
text " times!"
prompt
@@ -1233,88 +1282,6 @@ _GrewLevelText::
text "!@"
text_end
-_WildMonAppearedText::
- text "Wild @"
- text_ram wEnemyMonNick
- text_start
- line "appeared!"
- prompt
-
-_HookedMonAttackedText::
- text "The hooked"
- line "@"
- text_ram wEnemyMonNick
- text_start
- cont "attacked!"
- prompt
-
-_EnemyAppearedText::
- text_ram wEnemyMonNick
- text_start
- line "appeared!"
- prompt
-
-_TrainerWantsToFightText::
- text_ram wTrainerName
- text " wants"
- line "to fight!"
- prompt
-
-_UnveiledGhostText::
- text "SILPH SCOPE"
- line "unveiled the"
- cont "GHOST's identity!"
- prompt
-
-_GhostCantBeIDdText::
- text "Darn! The GHOST"
- line "can't be ID'd!"
- prompt
-
-_GoText::
- text "Go! @"
- text_end
-
-_DoItText::
- text "Do it! @"
- text_end
-
-_GetmText::
- text "Get'm! @"
- text_end
-
-_EnemysWeakText::
- text "The enemy's weak!"
- line "Get'm! @"
- text_end
-
-_PlayerMon1Text::
- text_ram wBattleMonNick
- text "!"
- done
-
-_PlayerMon2Text::
- text_ram wBattleMonNick
- text " @"
- text_end
-
-_EnoughText::
- text "enough!@"
- text_end
-
-_OKExclamationText::
- text "OK!@"
- text_end
-
-_GoodText::
- text "good!@"
- text_end
-
-_ComeBackText::
- text_start
- line "Come back!"
- done
-
_SuperEffectiveText::
text "It's super"
line "effective!"
@@ -1339,454 +1306,17 @@ _SafariZoneAngryText::
line "is angry!"
prompt
-; money related
-_PickUpPayDayMoneyText::
- text "<PLAYER> picked up"
- line "¥@"
- text_bcd wTotalPayDayMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
- text "!"
- prompt
-
-_ClearSaveDataText::
- text "Clear all saved"
- line "data?"
- done
-
-_WhichFloorText::
- text "Which floor do"
- line "you want? "
- done
-
-_PartyMenuNormalText::
- text "Choose a #MON."
- done
-
-_PartyMenuItemUseText::
- text "Use item on which"
- line "#MON?"
- done
-
-_PartyMenuBattleText::
- text "Bring out which"
- line "#MON?"
- done
-
-_PartyMenuUseTMText::
- text "Use TM on which"
- line "#MON?"
- done
-
-_PartyMenuSwapMonText::
- text "Move #MON"
- line "where?"
- done
-
-_PotionText::
- text_ram wcd6d
- text_start
- line "recovered by @"
- text_decimal wHPBarHPDifference, 2, 3
- text "!"
- done
-
-_AntidoteText::
- text_ram wcd6d
- text " was"
- line "cured of poison!"
- done
-
-_ParlyzHealText::
- text_ram wcd6d
- text "'s"
- line "rid of paralysis!"
- done
-
-_BurnHealText::
- text_ram wcd6d
- text "'s"
- line "burn was healed!"
- done
-
-_IceHealText::
- text_ram wcd6d
- text " was"
- line "defrosted!"
- done
-
-_AwakeningText::
- text_ram wcd6d
- text_start
- line "woke up!"
- done
-
-_FullHealText::
- text_ram wcd6d
- text "'s"
- line "health returned!"
- done
-
-_ReviveText::
- text_ram wcd6d
+_WildMonAppearedText::
+ text "Wild @"
+ text_ram wEnemyMonNick
text_start
- line "is revitalized!"
- done
-
-_RareCandyText::
- text_ram wcd6d
- text " grew"
- line "to level @"
- text_decimal wCurEnemyLVL, 1, 3
- text "!@"
- text_end
-
-_TurnedOnPC1Text::
- text "<PLAYER> turned on"
- line "the PC."
- prompt
-
-_AccessedBillsPCText::
- text "Accessed BILL's"
- line "PC."
-
- para "Accessed #MON"
- line "Storage System."
- prompt
-
-_AccessedSomeonesPCText::
- text "Accessed someone's"
- line "PC."
-
- para "Accessed #MON"
- line "Storage System."
- prompt
-
-_AccessedMyPCText::
- text "Accessed my PC."
-
- para "Accessed Item"
- line "Storage System."
- prompt
-
-_TurnedOnPC2Text::
- text "<PLAYER> turned on"
- line "the PC."
- prompt
-
-_WhatDoYouWantText::
- text "What do you want"
- line "to do?"
- done
-
-_WhatToDepositText::
- text "What do you want"
- line "to deposit?"
- done
-
-_DepositHowManyText::
- text "How many?"
- done
-
-_ItemWasStoredText::
- text_ram wcd6d
- text " was"
- line "stored via PC."
- prompt
-
-_NothingToDepositText::
- text "You have nothing"
- line "to deposit."
- prompt
-
-_NoRoomToStoreText::
- text "No room left to"
- line "store items."
- prompt
-
-_WhatToWithdrawText::
- text "What do you want"
- line "to withdraw?"
- done
-
-_WithdrawHowManyText::
- text "How many?"
- done
-
-_WithdrewItemText::
- text "Withdrew"
- line "@"
- text_ram wcd6d
- text "."
- prompt
-
-_NothingStoredText::
- text "There is nothing"
- line "stored."
- prompt
-
-_CantCarryMoreText::
- text "You can't carry"
- line "any more items."
- prompt
-
-_WhatToTossText::
- text "What do you want"
- line "to toss away?"
- done
-
-_TossHowManyText::
- text "How many?"
- done
-
-_AccessedHoFPCText::
- text "Accessed #MON"
- line "LEAGUE's site."
-
- para "Accessed the HALL"
- line "OF FAME List."
- prompt
-
-_SwitchOnText::
- text "Switch on!"
- prompt
-
-_WhatText::
- text "What?"
- done
-
-_DepositWhichMonText::
- text "Deposit which"
- line "#MON?"
- done
-
-_MonWasStoredText::
- text_ram wcf4b
- text " was"
- line "stored in Box @"
- text_ram wBoxNumString
- text "."
- prompt
-
-_CantDepositLastMonText::
- text "You can't deposit"
- line "the last #MON!"
- prompt
-
-_BoxFullText::
- text "Oops! This Box is"
- line "full of #MON."
- prompt
-
-_MonIsTakenOutText::
- text_ram wcf4b
- text " is"
- line "taken out."
- cont "Got @"
- text_ram wcf4b
- text "."
- prompt
-
-_NoMonText::
- text "What? There are"
- line "no #MON here!"
- prompt
-
-_CantTakeMonText::
- text "You can't take"
- line "any more #MON."
-
- para "Deposit #MON"
- line "first."
- prompt
-
-_ReleaseWhichMonText::
- text "Release which"
- line "#MON?"
- done
-
-_OnceReleasedText::
- text "Once released,"
- line "@"
- text_ram wcf4b
- text " is"
- cont "gone forever. OK?"
- done
-
-_MonWasReleasedText::
- text_ram wcf4b
- text " was"
- line "released outside."
- cont "Bye @"
-
-_CF4BExclamationText::
- text_ram wcf4b
- text "!"
- prompt
-
-_RequireCoinCaseText::
- text "A COIN CASE is"
- line "required!@"
- text_end
-
-_ExchangeCoinsForPrizesText::
- text "We exchange your"
- line "coins for prizes."
+ line "appeared!"
prompt
-_WhichPrizeText::
- text "Which prize do"
- line "you want?"
- done
-
-_HereYouGoText::
- text "Here you go!@"
- text_end
-
-_SoYouWantPrizeText::
- text "So, you want"
+_HookedMonAttackedText::
+ text "The hooked"
line "@"
- text_ram wcd6d
- text "?"
- done
-
-_SorryNeedMoreCoinsText::
- text "Sorry, you need"
- line "more coins.@"
- text_end
-
-_OopsYouDontHaveEnoughRoomText::
- text "Oops! You don't"
- line "have enough room.@"
- text_end
-
-_OhFineThenText::
- text "Oh, fine then.@"
- text_end
-
-_GetDexRatedText::
- text "Want to get your"
- line "#DEX rated?"
- done
-
-_ClosedOaksPCText::
- text "Closed link to"
- line "PROF.OAK's PC.@"
- text_end
-
-_AccessedOaksPCText::
- text "Accessed PROF."
- line "OAK's PC."
-
- para "Accessed #DEX"
- line "Rating System."
- prompt
-
-_WhereWouldYouLikeText::
- text "Where would you"
- line "like to go?"
- done
-
-_PleaseWaitText::
- text "OK, please wait"
- line "just a moment."
- done
-
-_LinkCanceledText::
- text "The link was"
- line "canceled."
- done
-
-_OakSpeechText1::
- text "Hello there!"
- line "Welcome to the"
- cont "world of #MON!"
-
- para "My name is OAK!"
- line "People call me"
- cont "the #MON PROF!"
- prompt
-
-_OakSpeechText2A::
- text "This world is"
- line "inhabited by"
- cont "creatures called"
- cont "#MON!@"
- text_end
-
-_OakSpeechText2B::
+ text_ram wEnemyMonNick
text_start
-
- para "For some people,"
- line "#MON are"
- cont "pets. Others use"
- cont "them for fights."
-
- para "Myself..."
-
- para "I study #MON"
- line "as a profession."
- prompt
-
-_IntroducePlayerText::
- text "First, what is"
- line "your name?"
- prompt
-
-_IntroduceRivalText::
- text "This is my grand-"
- line "son. He's been"
- cont "your rival since"
- cont "you were a baby."
-
- para "...Erm, what is"
- line "his name again?"
- prompt
-
-_OakSpeechText3::
- text "<PLAYER>!"
-
- para "Your very own"
- line "#MON legend is"
- cont "about to unfold!"
-
- para "A world of dreams"
- line "and adventures"
- cont "with #MON"
- cont "awaits! Let's go!"
- done
-
-_DoYouWantToNicknameText::
- text "Do you want to"
- line "give a nickname"
- cont "to @"
- text_ram wcd6d
- text "?"
- done
-
-_YourNameIsText::
- text "Right! So your"
- line "name is <PLAYER>!"
- prompt
-
-_HisNameIsText::
- text "That's right! I"
- line "remember now! His"
- cont "name is <RIVAL>!"
+ cont "attacked!"
prompt
-
-_WillBeTradedText::
- text_ram wNameOfPlayerMonToBeTraded
- text " and"
- line "@"
- text_ram wcd6d
- text " will"
- cont "be traded."
- done
-
-_TextIDErrorText::
- text_decimal hSpriteIndexOrTextID, 1, 2
- text " ERROR."
- done
-
-_ContCharText::
- text "<_CONT>@"
- text_end
diff --git a/data/text/text_3.asm b/data/text/text_3.asm
index 6407dce7..bd418402 100644
--- a/data/text/text_3.asm
+++ b/data/text/text_3.asm
@@ -1,330 +1,637 @@
-_FileDataDestroyedText::
- text "The file data is"
- line "destroyed!"
+_EnemyAppearedText::
+ text_ram wEnemyMonNick
+ text_start
+ line "appeared!"
+ prompt
+
+_TrainerWantsToFightText::
+ text_ram wTrainerName
+ text " wants"
+ line "to fight!"
+ prompt
+
+_UnveiledGhostText::
+ text "SILPH SCOPE"
+ line "unveiled the"
+ cont "GHOST's identity!"
+ prompt
+
+_GhostCantBeIDdText::
+ text "Darn! The GHOST"
+ line "can't be ID'd!"
+ prompt
+
+_GoText::
+ text "Go! @"
+ text_end
+
+_DoItText::
+ text "Do it! @"
+ text_end
+
+_GetmText::
+ text "Get'm! @"
+ text_end
+
+_EnemysWeakText::
+ text "The enemy's weak!"
+ line "Get'm! @"
+ text_end
+
+_PlayerMon1Text::
+ text_ram wBattleMonNick
+ text "!"
+ done
+
+_PlayerMon2Text::
+ text_ram wBattleMonNick
+ text " @"
+ text_end
+
+_EnoughText::
+ text "enough!@"
+ text_end
+
+_OKExclamationText::
+ text "OK!@"
+ text_end
+
+_GoodText::
+ text "good!@"
+ text_end
+
+_ComeBackText::
+ text_start
+ line "Come back!"
+ done
+
+; money related
+_PickUpPayDayMoneyText::
+ text "<PLAYER> picked up"
+ line "¥@"
+ text_bcd wTotalPayDayMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
+ text "!"
prompt
-_WouldYouLikeToSaveText::
- text "Would you like to"
- line "SAVE the game?"
+_ClearSaveDataText::
+ text "Clear all saved"
+ line "data?"
done
-_GameSavedText::
- text "<PLAYER> saved"
- line "the game!"
+_WhichFloorText::
+ text "Which floor do"
+ line "you want? "
done
-_OlderFileWillBeErasedText::
- text "The older file"
- line "will be erased to"
- cont "save. Okay?"
+_SleepingPikachuText1::
+ text "There isn't any"
+ line "response..."
+ prompt
+
+_PartyMenuNormalText::
+ text "Choose a #MON."
done
-_WhenYouChangeBoxText::
- text "When you change a"
- line "#MON BOX, data"
- cont "will be saved."
+_PartyMenuItemUseText::
+ text "Use item on which"
+ line "#MON?"
+ done
- para "Is that okay?"
+_PartyMenuBattleText::
+ text "Bring out which"
+ line "#MON?"
done
-_ChooseABoxText::
- text "Choose a"
- line "<PKMN> BOX.@"
- text_end
+_PartyMenuUseTMText::
+ text "Teach to which"
+ line "#MON?"
+ done
-_EvolvedText::
- text_ram wcf4b
- text " evolved"
+_PartyMenuSwapMonText::
+ text "Move #MON"
+ line "where?"
done
-_IntoText::
- text_start
- line "into @"
+_PotionText::
text_ram wcd6d
+ text_start
+ line "recovered by @"
+ text_decimal wHPBarHPDifference, 2, 3
text "!"
done
-_StoppedEvolvingText::
- text "Huh? @"
- text_ram wcf4b
+_AntidoteText::
+ text_ram wcd6d
+ text " was"
+ line "cured of poison!"
+ done
+
+_ParlyzHealText::
+ text_ram wcd6d
+ text "'s"
+ line "rid of paralysis!"
+ done
+
+_BurnHealText::
+ text_ram wcd6d
+ text "'s"
+ line "burn was healed!"
+ done
+
+_IceHealText::
+ text_ram wcd6d
+ text " was"
+ line "defrosted!"
+ done
+
+_AwakeningText::
+ text_ram wcd6d
text_start
- line "stopped evolving!"
- prompt
+ line "woke up!"
+ done
-_IsEvolvingText::
- text "What? @"
- text_ram wcf4b
+_FullHealText::
+ text_ram wcd6d
+ text "'s"
+ line "health returned!"
+ done
+
+_ReviveText::
+ text_ram wcd6d
text_start
- line "is evolving!"
+ line "is revitalized!"
done
-_FellAsleepText::
- text "<TARGET>"
- line "fell asleep!"
+_RareCandyText::
+ text_ram wcd6d
+ text " grew"
+ line "to level @"
+ text_decimal wCurEnemyLVL, 1, 3
+ text "!@"
+ text_end
+
+_TurnedOnPC1Text::
+ text "<PLAYER> turned on"
+ line "the PC."
prompt
-_AlreadyAsleepText::
- text "<TARGET>'s"
- line "already asleep!"
+_AccessedBillsPCText::
+ text "Accessed BILL's"
+ line "PC."
+
+ para "Accessed #MON"
+ line "Storage System."
prompt
-_PoisonedText::
- text "<TARGET>"
- line "was poisoned!"
+_AccessedSomeonesPCText::
+ text "Accessed someone's"
+ line "PC."
+
+ para "Accessed #MON"
+ line "Storage System."
prompt
-_BadlyPoisonedText::
- text "<TARGET>'s"
- line "badly poisoned!"
+_AccessedMyPCText::
+ text "Accessed my PC."
+
+ para "Accessed Item"
+ line "Storage System."
prompt
-_BurnedText::
- text "<TARGET>"
- line "was burned!"
+_TurnedOnPC2Text::
+ text "<PLAYER> turned on"
+ line "the PC."
prompt
-_FrozenText::
- text "<TARGET>"
- line "was frozen solid!"
+_WhatDoYouWantText::
+ text "What do you want"
+ line "to do?"
+ done
+
+_WhatToDepositText::
+ text "What do you want"
+ line "to deposit?"
+ done
+
+_DepositHowManyText::
+ text "How many?"
+ done
+
+_ItemWasStoredText::
+ text_ram wcd6d
+ text " was"
+ line "stored via PC."
prompt
-_FireDefrostedText::
- text "Fire defrosted"
- line "<TARGET>!"
+_NothingToDepositText::
+ text "You have nothing"
+ line "to deposit."
prompt
-_MonsStatsRoseText::
- text "<USER>'s"
- line "@"
- text_ram wcf4b
- text "@"
- text_end
+_NoRoomToStoreText::
+ text "No room left to"
+ line "store items."
+ prompt
-_GreatlyRoseText::
- text "<SCROLL>greatly@"
- text_end
+_WhatToWithdrawText::
+ text "What do you want"
+ line "to withdraw?"
+ done
-_RoseText::
- text " rose!"
- prompt
+_WithdrawHowManyText::
+ text "How many?"
+ done
-_MonsStatsFellText::
- text "<TARGET>'s"
+_WithdrewItemText::
+ text "Withdrew"
line "@"
- text_ram wcf4b
- text "@"
- text_end
+ text_ram wcd6d
+ text "."
+ prompt
-_GreatlyFellText::
- text "<SCROLL>greatly@"
- text_end
+_NothingStoredText::
+ text "There is nothing"
+ line "stored."
+ prompt
-_FellText::
- text " fell!"
+_CantCarryMoreText::
+ text "You can't carry"
+ line "any more items."
prompt
-_RanFromBattleText::
- text "<USER>"
- line "ran from battle!"
+_WhatToTossText::
+ text "What do you want"
+ line "to toss away?"
+ done
+
+_TossHowManyText::
+ text "How many?"
+ done
+
+_AccessedHoFPCText::
+ text "Accessed #MON"
+ line "LEAGUE's site."
+
+ para "Accessed the HALL"
+ line "OF FAME List."
prompt
-_RanAwayScaredText::
- text "<TARGET>"
- line "ran away scared!"
+_SleepingPikachuText2::
+ text "There isn't any"
+ line "response..."
prompt
-_WasBlownAwayText::
- text "<TARGET>"
- line "was blown away!"
+_SwitchOnText::
+ text "Switch on!"
prompt
-_ChargeMoveEffectText::
- text "<USER>@"
- text_end
+_WhatText::
+ text "What?"
+ done
-_MadeWhirlwindText::
- text_start
- line "made a whirlwind!"
- prompt
+_DepositWhichMonText::
+ text "Deposit which"
+ line "#MON?"
+ done
-_TookInSunlightText::
- text_start
- line "took in sunlight!"
+_MonWasStoredText::
+ text_ram wcf4b
+ text " was"
+ line "stored in Box @"
+ text_ram wBoxNumString
+ text "."
prompt
-_LoweredItsHeadText::
- text_start
- line "lowered its head!"
+_CantDepositLastMonText::
+ text "You can't deposit"
+ line "the last #MON!"
prompt
-_SkyAttackGlowingText::
- text_start
- line "is glowing!"
+_BoxFullText::
+ text "Oops! This Box is"
+ line "full of #MON."
prompt
-_FlewUpHighText::
- text_start
- line "flew up high!"
+_MonIsTakenOutText::
+ text_ram wcf4b
+ text " is"
+ line "taken out."
+ cont "Got @"
+ text_ram wcf4b
+ text "."
prompt
-_DugAHoleText::
- text_start
- line "dug a hole!"
+_NoMonText::
+ text "What? There are"
+ line "no #MON here!"
prompt
-_BecameConfusedText::
- text "<TARGET>"
- line "became confused!"
+_CantTakeMonText::
+ text "You can't take"
+ line "any more #MON."
+
+ para "Deposit #MON"
+ line "first."
prompt
-_MimicLearnedMoveText::
- text "<USER>"
- line "learned"
- cont "@"
+_PikachuUnhappyText::
text_ram wcd6d
- text "!"
+ text " looks"
+ line "unhappy about it!"
prompt
-_MoveWasDisabledText::
- text "<TARGET>'s"
+_ReleaseWhichMonText::
+ text "Release which"
+ line "#MON?"
+ done
+
+_OnceReleasedText::
+ text "Once released,"
line "@"
- text_ram wcd6d
+ text_ram wcf4b
+ text " is"
+ cont "gone forever. OK?"
+ done
+
+_MonWasReleasedText::
+ text_ram wcf4b
text " was"
- cont "disabled!"
+ line "released outside."
+ cont "Bye @"
+
+_CF4BExclamationText::
+ text_ram wcf4b
+ text "!"
prompt
-_NothingHappenedText::
- text "Nothing happened!"
+_RequireCoinCaseText::
+ text "A COIN CASE is"
+ line "required!@"
+ text_end
+
+_ExchangeCoinsForPrizesText::
+ text "We exchange your"
+ line "coins for prizes."
prompt
-_NoEffectText::
- text "No effect!"
+_WhichPrizeText::
+ text "Which prize do"
+ line "you want?"
+ done
+
+_HereYouGoText::
+ text "Here you go!@"
+ text_end
+
+_SoYouWantPrizeText::
+ text "So, you want"
+ line "@"
+ text_ram wcd6d
+ text "?"
+ done
+
+_SorryNeedMoreCoinsText::
+ text "Sorry, you need"
+ line "more coins.@"
+ text_end
+
+_OopsYouDontHaveEnoughRoomText::
+ text "Oops! You don't"
+ line "have enough room.@"
+ text_end
+
+_OhFineThenText::
+ text "Oh, fine then.@"
+ text_end
+
+_GetDexRatedText::
+ text "Want to get your"
+ line "#DEX rated?"
+ done
+
+_ClosedOaksPCText::
+ text "Closed link to"
+ line "PROF.OAK's PC.@"
+ text_end
+
+_AccessedOaksPCText::
+ text "Accessed PROF."
+ line "OAK's PC."
+
+ para "Accessed #DEX"
+ line "Rating System."
prompt
-_ButItFailedText::
- text "But, it failed! "
+_ExpressionText::
+ text "This expression is"
+ line "No. @"
+ text_decimal wExpressionNumber, 1, 2
+ text "."
prompt
-_DidntAffectText::
- text "It didn't affect"
- line "<TARGET>!"
+_NotEnoughMemoryText::
+ text "Not enough Yellow"
+ line "Version memory."
+ done
+
+_OakSpeechText1::
+ text "Hello there!"
+ line "Welcome to the"
+ cont "world of #MON!"
+
+ para "My name is OAK!"
+ line "People call me"
+ cont "the #MON PROF!"
prompt
-_IsUnaffectedText::
- text "<TARGET>"
- line "is unaffected!"
+_OakSpeechText2A::
+ text "This world is"
+ line "inhabited by"
+ cont "creatures called"
+ cont "#MON!@"
+ text_end
+
+_OakSpeechText2B::
+ text $51,"For some people,"
+ line "#MON are"
+ cont "pets. Others use"
+ cont "them for fights."
+
+ para "Myself..."
+
+ para "I study #MON"
+ line "as a profession."
prompt
-_ParalyzedMayNotAttackText::
- text "<TARGET>'s"
- line "paralyzed! It may"
- cont "not attack!"
+_IntroducePlayerText::
+ text "First, what is"
+ line "your name?"
prompt
-_SubstituteText::
- text "It created a"
- line "SUBSTITUTE!"
+_IntroduceRivalText::
+ text "This is my grand-"
+ line "son. He's been"
+ cont "your rival since"
+ cont "you were a baby."
+
+ para "...Erm, what is"
+ line "his name again?"
prompt
-_HasSubstituteText::
- text "<USER>"
- line "has a SUBSTITUTE!"
+_OakSpeechText3::
+ text "<PLAYER>!"
+
+ para "Your very own"
+ line "#MON legend is"
+ cont "about to unfold!"
+
+ para "A world of dreams"
+ line "and adventures"
+ cont "with #MON"
+ cont "awaits! Let's go!"
+ done
+
+_DoYouWantToNicknameText::
+ text "Do you want to"
+ line "give a nickname"
+ cont "to @"
+ text_ram wcd6d
+ text "?"
+ done
+
+_YourNameIsText::
+ text "Right! So your"
+ line "name is <PLAYER>!"
prompt
-_TooWeakSubstituteText::
- text "Too weak to make"
- line "a SUBSTITUTE!"
+_HisNameIsText::
+ text "That's right! I"
+ line "remember now! His"
+ cont "name is <RIVAL>!"
prompt
-_CoinsScatteredText::
- text "Coins scattered"
- line "everywhere!"
+_WillBeTradedText::
+ text_ram wNameOfPlayerMonToBeTraded
+ text " and"
+ line "@"
+ text_ram wcd6d
+ text " will"
+ cont "be traded."
+ done
+
+_Colosseum3MonsText::
+ text "You need 3 #MON"
+ line "to fight!"
prompt
-_GettingPumpedText::
- text "<USER>'s"
- line "getting pumped!"
+_ColosseumMewText::
+ text "Sorry, MEW can't"
+ line "attend!"
prompt
-_WasSeededText::
- text "<TARGET>"
- line "was seeded!"
+_ColosseumDifferentMonsText::
+ text "Your #MON must"
+ line "all be different!"
prompt
-_EvadedAttackText::
- text "<TARGET>"
- line "evaded attack!"
+_ColosseumMaxL55Text::
+ text "No #MON can"
+ line "exceed L55!"
prompt
-_HitWithRecoilText::
- text "<USER>'s"
- line "hit with recoil!"
+_ColosseumMinL50Text::
+ text "All #MON must"
+ line "be at least L50!"
prompt
-_ConvertedTypeText::
- text "Converted type to"
- line "<TARGET>'s!"
+_ColosseumTotalL155Text::
+ text "Your total levels"
+ line "exceed 155!"
prompt
-_StatusChangesEliminatedText::
- text "All STATUS changes"
- line "are eliminated!"
+_ColosseumMaxL30Text::
+ text "No #MON can"
+ line "exceed L30!"
prompt
-_StartedSleepingEffect::
- text "<USER>"
- line "started sleeping!"
- done
+_ColosseumMinL25Text::
+ text "All #MON must"
+ line "be at least L25!"
+ prompt
-_FellAsleepBecameHealthyText::
- text "<USER>"
- line "fell asleep and"
- cont "became healthy!"
- done
+_ColosseumTotalL80Text::
+ text "Your total levels"
+ line "exceed 80!"
+ prompt
-_RegainedHealthText::
- text "<USER>"
- line "regained health!"
+_ColosseumMaxL20Text::
+ text "No #MON can"
+ line "exceed L20!"
prompt
-_TransformedText::
- text "<USER>"
- line "transformed into"
- cont "@"
- text_ram wcd6d
- text "!"
+_ColosseumMinL15Text::
+ text "All #MON must"
+ line "be at least L15!"
prompt
-_LightScreenProtectedText::
- text "<USER>'s"
- line "protected against"
- cont "special attacks!"
+_ColosseumTotalL50Text::
+ text "Your total levels"
+ line "exceed 50!"
prompt
-_ReflectGainedArmorText::
- text "<USER>"
- line "gained armor!"
+_ColosseumHeightText::
+ text_ram wcd6d
+ text " is over"
+ line "6’8” tall!"
prompt
-_ShroudedInMistText::
- text "<USER>'s"
- line "shrouded in mist!"
+_ColosseumWeightText::
+ text_ram wcd6d
+ text " weighs"
+ line "over 44 pounds!"
prompt
-_SuckedHealthText::
- text "Sucked health from"
- line "<TARGET>!"
+_ColosseumEvolvedText::
+ text_ram wcd6d
+ text " is an"
+ line "evolved #MON!"
prompt
-_DreamWasEatenText::
- text "<TARGET>'s"
- line "dream was eaten!"
+_ColosseumIneligibleText::
+ text "Your opponent is"
+ line "ineligible."
prompt
-_TradeCenterText1::
- text "!"
+_ColosseumWhereToText::
+ text "Where would you"
+ line "like to go?"
done
-_ColosseumText1::
- text "!"
+_ColosseumPleaseWaitText::
+ text "OK, please wait"
+ line "just a moment."
+ done
+
+_ColosseumCanceledText::
+ text "The link was"
+ line "canceled."
done
+
+_ColosseumVersionText::
+ text "The game versions"
+ line "don't match."
+ prompt
+
+_TextIDErrorText::
+ text_decimal hSpriteIndexOrTextID, 1, 2
+ text " error."
+ done
+
+_ContCharText::
+ text "<_CONT>@"
+ text_end
+
+_NoPokemonText::
+ text "There are no"
+ line "#MON here!"
+ prompt
diff --git a/data/text/text_4.asm b/data/text/text_4.asm
index 4c01b5f4..4c3d6a9c 100644
--- a/data/text/text_4.asm
+++ b/data/text/text_4.asm
@@ -1,221 +1,56 @@
-_PokemartGreetingText::
- text "Hi there!"
- next "May I help you?"
- done
-
-_PokemonFaintedText::
- text_ram wcd6d
- text_start
- line "fainted!"
- done
-
-_PlayerBlackedOutText::
- text "<PLAYER> is out of"
- line "useable #MON!"
-
- para "<PLAYER> blacked"
- line "out!"
+_FileDataDestroyedText::
+ text "The file data is"
+ line "destroyed!"
prompt
-_RepelWoreOffText::
- text "REPEL's effect"
- line "wore off."
+_WouldYouLikeToSaveText::
+ text "Would you like to"
+ line "SAVE the game?"
done
-_PokemartBuyingGreetingText::
- text "Take your time."
+_SavingText::
+ text "Saving..."
done
-_PokemartTellBuyPriceText::
- text_ram wcf4b
- text "?"
- line "That will be"
- cont "¥@"
- text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
- text ". OK?"
+_GameSavedText::
+ text "<PLAYER> saved"
+ line "the game!"
done
-_PokemartBoughtItemText::
- text "Here you are!"
- line "Thank you!"
- prompt
-
-_PokemartNotEnoughMoneyText::
- text "You don't have"
- line "enough money."
- prompt
-
-_PokemartItemBagFullText::
- text "You can't carry"
- line "any more items."
- prompt
-
-_PokemonSellingGreetingText::
- text "What would you"
- line "like to sell?"
- done
-
-_PokemartTellSellPriceText::
- text "I can pay you"
- line "¥@"
- text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
- text " for that."
+_OlderFileWillBeErasedText::
+ text "The older file"
+ line "will be erased to"
+ cont "save. Okay?"
done
-_PokemartItemBagEmptyText::
- text "You don't have"
- line "anything to sell."
- prompt
-
-_PokemartUnsellableItemText::
- text "I can't put a"
- line "price on that."
- prompt
+_WhenYouChangeBoxText::
+ text "When you change a"
+ line "#MON BOX, data"
+ cont "will be saved."
-_PokemartThankYouText::
- text "Thank you!"
+ para "Is that okay?"
done
-_PokemartAnythingElseText::
- text "Is there anything"
- line "else I can do?"
- done
-
-_LearnedMove1Text::
- text_ram wLearnMoveMonName
- text " learned"
- line "@"
- text_ram wcf4b
- text "!@"
+_ChooseABoxText::
+ text "Choose a"
+ line "<PKMN> BOX.@"
text_end
-_WhichMoveToForgetText::
- text "Which move should"
- next "be forgotten?"
- done
-
-_AbandonLearningText::
- text "Abandon learning"
- line "@"
+_EvolvedText::
text_ram wcf4b
- text "?"
+ text " evolved"
done
-_DidNotLearnText::
- text_ram wLearnMoveMonName
+_IntoText::
text_start
- line "did not learn"
- cont "@"
- text_ram wcf4b
- text "!"
- prompt
-
-_TryingToLearnText::
- text_ram wLearnMoveMonName
- text " is"
- line "trying to learn"
- cont "@"
- text_ram wcf4b
- text "!"
-
- para "But, @"
- text_ram wLearnMoveMonName
- text_start
- line "can't learn more"
- cont "than 4 moves!"
-
- para "Delete an older"
- line "move to make room"
- cont "for @"
- text_ram wcf4b
- text "?"
- done
-
-_OneTwoAndText::
- text "1, 2 and...@"
- text_end
-
-_PoofText::
- text " Poof!@"
- text_end
-
-_ForgotAndText::
- text_start
- para "@"
- text_ram wLearnMoveMonName
- text " forgot"
- line "@"
+ line "into @"
text_ram wcd6d
text "!"
-
- para "And..."
- prompt
-
-_HMCantDeleteText::
- text "HM techniques"
- line "can't be deleted!"
- prompt
-
-_PokemonCenterWelcomeText::
- text "Welcome to our"
- line "#MON CENTER!"
-
- para "We heal your"
- line "#MON back to"
- cont "perfect health!"
- prompt
-
-_ShallWeHealYourPokemonText::
- text "Shall we heal your"
- line "#MON?"
- done
-
-_NeedYourPokemonText::
- text "OK. We'll need"
- line "your #MON."
done
-_PokemonFightingFitText::
- text "Thank you!"
- line "Your #MON are"
- cont "fighting fit!"
+_StoppedEvolvingText::
+ text "Huh? @"
+ text_ram wcf4b
+ text_start
+ line "stopped evolving!"
prompt
-
-_PokemonCenterFarewellText::
- text "We hope to see"
- line "you again!"
- done
-
-_CableClubNPCAreaReservedFor2FriendsLinkedByCableText::
- text "This area is"
- line "reserved for 2"
- cont "friends who are"
- cont "linked by cable."
- done
-
-_CableClubNPCWelcomeText::
- text "Welcome to the"
- line "Cable Club!"
- done
-
-_CableClubNPCPleaseApplyHereHaveToSaveText::
- text "Please apply here."
-
- para "Before opening"
- line "the link, we have"
- cont "to save the game."
- done
-
-_CableClubNPCPleaseWaitText::
- text "Please wait.@"
- text_end
-
-_CableClubNPCLinkClosedBecauseOfInactivityText::
- text "The link has been"
- line "closed because of"
- cont "inactivity."
-
- para "Please contact"
- line "your friend and"
- cont "come again!"
- done
diff --git a/data/text/text_5.asm b/data/text/text_5.asm
index ae7151cc..fc758be9 100644
--- a/data/text/text_5.asm
+++ b/data/text/text_5.asm
@@ -1,104 +1,277 @@
-_CableClubNPCPleaseComeAgainText::
- text "Please come again!"
+_IsEvolvingText::
+ text "What? @"
+ text_ram wcf4b
+ text_start
+ line "is evolving!"
done
-_CableClubNPCMakingPreparationsText::
- text "We're making"
- line "preparations."
- cont "Please wait."
- done
+_FellAsleepText::
+ text "<TARGET>"
+ line "fell asleep!"
+ prompt
-_UsedStrengthText::
- text_ram wcd6d
- text " used"
- line "STRENGTH.@"
+_AlreadyAsleepText::
+ text "<TARGET>'s"
+ line "already asleep!"
+ prompt
+
+_PoisonedText::
+ text "<TARGET>"
+ line "was poisoned!"
+ prompt
+
+_BadlyPoisonedText::
+ text "<TARGET>'s"
+ line "badly poisoned!"
+ prompt
+
+_BurnedText::
+ text "<TARGET>"
+ line "was burned!"
+ prompt
+
+_FrozenText::
+ text "<TARGET>"
+ line "was frozen solid!"
+ prompt
+
+_FireDefrostedText::
+ text "Fire defrosted"
+ line "<TARGET>!"
+ prompt
+
+_MonsStatsRoseText::
+ text "<USER>'s"
+ line "@"
+ text_ram wcf4b
+ text "@"
text_end
-_CanMoveBouldersText::
- text_ram wcd6d
- text " can"
- line "move boulders."
+_GreatlyRoseText::
+ text "<SCROLL>greatly@"
+ text_end
+
+_RoseText::
+ text " rose!"
+ prompt
+
+_MonsStatsFellText::
+ text "<TARGET>'s"
+ line "@"
+ text_ram wcf4b
+ text "@"
+ text_end
+
+_GreatlyFellText::
+ text "<SCROLL>greatly@"
+ text_end
+
+_FellText::
+ text " fell!"
prompt
-_CurrentTooFastText::
- text "The current is"
- line "much too fast!"
+_RanFromBattleText::
+ text "<USER>"
+ line "ran from battle!"
prompt
-_CyclingIsFunText::
- text "Cycling is fun!"
- line "Forget SURFing!"
+_RanAwayScaredText::
+ text "<TARGET>"
+ line "ran away scared!"
prompt
-_FlashLightsAreaText::
- text "A blinding FLASH"
- line "lights the area!"
+_WasBlownAwayText::
+ text "<TARGET>"
+ line "was blown away!"
prompt
-_WarpToLastPokemonCenterText::
- text "Warp to the last"
- line "#MON CENTER."
- done
+_ChargeMoveEffectText::
+ text "<USER>@"
+ text_end
-_CannotUseTeleportNowText::
- text_ram wcd6d
- text " can't"
- line "use TELEPORT now."
+_MadeWhirlwindText::
+ text_start
+ line "made a whirlwind!"
prompt
-_CannotFlyHereText::
- text_ram wcd6d
- text " can't"
- line "FLY here."
+_TookInSunlightText::
+ text_start
+ line "took in sunlight!"
prompt
-_NotHealthyEnoughText::
- text "Not healthy"
- line "enough."
+_LoweredItsHeadText::
+ text_start
+ line "lowered its head!"
prompt
-_NewBadgeRequiredText::
- text "No! A new BADGE"
- line "is required."
+_SkyAttackGlowingText::
+ text_start
+ line "is glowing!"
prompt
-_CannotUseItemsHereText::
- text "You can't use items"
- line "here."
+_FlewUpHighText::
+ text_start
+ line "flew up high!"
prompt
-_CannotGetOffHereText::
- text "You can't get off"
- line "here."
+_DugAHoleText::
+ text_start
+ line "dug a hole!"
prompt
-_GotMonText::
- text "<PLAYER> got"
- line "@"
- text_ram wcd6d
- text "!@"
- text_end
+_BecameConfusedText::
+ text "<TARGET>"
+ line "became confused!"
+ prompt
-_SentToBoxText::
- text "There's no more"
- line "room for #MON!"
+_MimicLearnedMoveText::
+ text "<USER>"
+ line "learned"
cont "@"
- text_ram wBoxMonNicks
+ text_ram wcd6d
+ text "!"
+ prompt
+
+_MoveWasDisabledText::
+ text "<TARGET>'s"
+ line "@"
+ text_ram wcd6d
text " was"
- cont "sent to #MON"
- cont "BOX @"
- text_ram wcf4b
- text " on PC!"
+ cont "disabled!"
+ prompt
+
+_NothingHappenedText::
+ text "Nothing happened!"
+ prompt
+
+_NoEffectText::
+ text "No effect!"
+ prompt
+
+_ButItFailedText::
+ text "But, it failed! "
+ prompt
+
+_DidntAffectText::
+ text "It didn't affect"
+ line "<TARGET>!"
+ prompt
+
+_IsUnaffectedText::
+ text "<TARGET>"
+ line "is unaffected!"
+ prompt
+
+_ParalyzedMayNotAttackText::
+ text "<TARGET>'s"
+ line "paralyzed! It may"
+ cont "not attack!"
+ prompt
+
+_SubstituteText::
+ text "It created a"
+ line "SUBSTITUTE!"
+ prompt
+
+_HasSubstituteText::
+ text "<USER>"
+ line "has a SUBSTITUTE!"
+ prompt
+
+_TooWeakSubstituteText::
+ text "Too weak to make"
+ line "a SUBSTITUTE!"
+ prompt
+
+_WasSeededText::
+ text "<TARGET>"
+ line "was seeded!"
+ prompt
+
+_EvadedAttackText::
+ text "<TARGET>"
+ line "evaded attack!"
+ prompt
+
+_HitWithRecoilText::
+ text "<USER>'s"
+ line "hit with recoil!"
+ prompt
+
+_ConvertedTypeText::
+ text "Converted type to"
+ line "<TARGET>'s!"
+ prompt
+
+_StatusChangesEliminatedText::
+ text "All STATUS changes"
+ line "are eliminated!"
+ prompt
+
+_GettingPumpedText::
+ text "<USER>'s"
+ line "getting pumped!"
+ prompt
+
+_StartedSleepingEffect::
+ text "<USER>"
+ line "started sleeping!"
done
-_BoxIsFullText::
- text "There's no more"
- line "room for #MON!"
+_FellAsleepBecameHealthyText::
+ text "<USER>"
+ line "fell asleep and"
+ cont "became healthy!"
+ done
+
+_RegainedHealthText::
+ text "<USER>"
+ line "regained health!"
+ prompt
+
+_TransformedText::
+ text "<USER>"
+ line "transformed into"
+ cont "@"
+ text_ram wcd6d
+ text "!"
+ prompt
+
+_LightScreenProtectedText::
+ text "<USER>'s"
+ line "protected against"
+ cont "special attacks!"
+ prompt
- para "The #MON BOX"
- line "is full and can't"
- cont "accept any more!"
+_ReflectGainedArmorText::
+ text "<USER>"
+ line "gained armor!"
+ prompt
+
+_ShroudedInMistText::
+ text "<USER>'s"
+ line "shrouded in mist!"
+ prompt
+
+_CoinsScatteredText::
+ text "Coins scattered"
+ line "everywhere!"
+ prompt
+
+_SuckedHealthText::
+ text "Sucked health from"
+ line "<TARGET>!"
+ prompt
+
+_DreamWasEatenText::
+ text "<TARGET>'s"
+ line "dream was eaten!"
+ prompt
+
+_TradeCenterText1::
+ text "!"
+ done
- para "Change the BOX at"
- line "a #MON CENTER!"
+_ColosseumText1::
+ text "!"
done
diff --git a/data/text/text_6.asm b/data/text/text_6.asm
index 39eb22ea..bcdc75a3 100644
--- a/data/text/text_6.asm
+++ b/data/text/text_6.asm
@@ -1,231 +1,10 @@
-_ItemUseBallText00::
- text "It dodged the"
- line "thrown BALL!"
+TeachingHMsText::
+ text "Once a #MON"
+ line "learns an HM, the"
+ cont "technique can't"
+ cont "be replaced."
- para "This #MON"
- line "can't be caught!"
- prompt
-
-_ItemUseBallText01::
- text "You missed the"
- line "#MON!"
- prompt
-
-_ItemUseBallText02::
- text "Darn! The #MON"
- line "broke free!"
- prompt
-
-_ItemUseBallText03::
- text "Aww! It appeared"
- line "to be caught! "
- prompt
-
-_ItemUseBallText04::
- text "Shoot! It was so"
- line "close too!"
- prompt
-
-_ItemUseBallText05::
- text "All right!"
- line "@"
- text_ram wEnemyMonNick
- text " was"
- cont "caught!@"
- text_end
-
-_ItemUseBallText07::
- text_ram wBoxMonNicks
- text " was"
- line "transferred to"
- cont "BILL's PC!"
- prompt
-
-_ItemUseBallText08::
- text_ram wBoxMonNicks
- text " was"
- line "transferred to"
- cont "someone's PC!"
- prompt
-
-_ItemUseBallText06::
- text "New #DEX data"
- line "will be added for"
- cont "@"
- text_ram wEnemyMonNick
- text "!@"
- text_end
-
-_SurfingGotOnText::
- text "<PLAYER> got on"
- line "@"
- text_ram wcd6d
- text "!"
- prompt
-
-_SurfingNoPlaceToGetOffText::
- text "There's no place"
- line "to get off!"
- prompt
-
-_VitaminStatRoseText::
- text_ram wcd6d
- text "'s"
- line "@"
- text_ram wcf4b
- text " rose."
- prompt
-
-_VitaminNoEffectText::
- text "It won't have any"
- line "effect."
- prompt
-
-_ThrewBaitText::
- text "<PLAYER> threw"
- line "some BAIT."
- done
-
-_ThrewRockText::
- text "<PLAYER> threw a"
- line "ROCK."
- done
-
-_PlayedFluteNoEffectText::
- text "Played the #"
- line "FLUTE."
-
- para "Now, that's a"
- line "catchy tune!"
- prompt
-
-_FluteWokeUpText::
- text "All sleeping"
- line "#MON woke up."
- prompt
-
-_PlayedFluteHadEffectText::
- text "<PLAYER> played the"
- line "# FLUTE.@"
- text_end
-
-_CoinCaseNumCoinsText::
- text "Coins"
- line "@"
- text_bcd wPlayerCoins, 2 | LEADING_ZEROES | LEFT_ALIGN
- text " "
- prompt
-
-_ItemfinderFoundItemText::
- text "Yes! ITEMFINDER"
- line "indicates there's"
- cont "an item nearby."
- prompt
-
-_ItemfinderFoundNothingText::
- text "Nope! ITEMFINDER"
- line "isn't responding."
- prompt
-
-_RaisePPWhichTechniqueText::
- text "Raise PP of which"
- line "technique?"
- done
-
-_RestorePPWhichTechniqueText::
- text "Restore PP of"
- line "which technique?"
- done
-
-_PPMaxedOutText::
- text_ram wcf4b
- text "'s PP"
- line "is maxed out."
- prompt
-
-_PPIncreasedText::
- text_ram wcf4b
- text "'s PP"
- line "increased."
- prompt
-
-_PPRestoredText::
- text "PP was restored."
- prompt
-
-_BootedUpTMText::
- text "Booted up a TM!"
- prompt
-
-_BootedUpHMText::
- text "Booted up an HM!"
- prompt
-
-_TeachMachineMoveText::
- text "It contained"
- line "@"
- text_ram wcf4b
- text "!"
-
- para "Teach @"
- text_ram wcf4b
- text_start
- line "to a #MON?"
+ para "Better think care-"
+ line "fully before you"
+ cont "teach HM moves."
done
-
-_MonCannotLearnMachineMoveText::
- text_ram wcd6d
- text " is not"
- line "compatible with"
- cont "@"
- text_ram wcf4b
- text "."
-
- para "It can't learn"
- line "@"
- text_ram wcf4b
- text "."
- prompt
-
-_ItemUseNotTimeText::
- text "OAK: <PLAYER>!"
- line "This isn't the"
- cont "time to use that! "
- prompt
-
-_ItemUseNotYoursToUseText::
- text "This isn't yours"
- line "to use!"
- prompt
-
-_ItemUseNoEffectText::
- text "It won't have any"
- line "effect."
- prompt
-
-_ThrowBallAtTrainerMonText1::
- text "The trainer"
- line "blocked the BALL!"
- prompt
-
-_ThrowBallAtTrainerMonText2::
- text "Don't be a thief!"
- prompt
-
-_NoCyclingAllowedHereText::
- text "No cycling"
- next "allowed here."
- prompt
-
-_NoSurfingHereText::
- text "No SURFing on"
- line "@"
- text_ram wcd6d
- text " here!"
- prompt
-
-_BoxFullCannotThrowBallText::
- text "The #MON BOX"
- line "is full! Can't"
- cont "use that item!"
- prompt
diff --git a/data/text/text_7.asm b/data/text/text_7.asm
index 34f070bd..88c7d884 100644
--- a/data/text/text_7.asm
+++ b/data/text/text_7.asm
@@ -1,200 +1,216 @@
-_ItemUseText001::
- text "<PLAYER> used@"
- text_end
-
-_ItemUseText002::
- text_ram wcf4b
- text "!"
+_PokemonText::
+ text "#MON!"
done
-_GotOnBicycleText1::
- text "<PLAYER> got on the@"
- text_end
+_PokemartGreetingText::
+ text "Hi there!"
+ next "May I help you?"
+ done
-_GotOnBicycleText2::
- text_ram wcf4b
- text "!"
- prompt
+_PokemonFaintedText::
+ text_ram wcd6d
+ text_start
+ line "fainted!"
+ done
-_GotOffBicycleText1::
- text "<PLAYER> got off@"
- text_end
+_PlayerBlackedOutText::
+ text "<PLAYER> is out of"
+ line "useable #MON!"
-_GotOffBicycleText2::
- text "the @"
- text_ram wcf4b
- text "."
+ para "<PLAYER> blacked"
+ line "out!"
prompt
-_ThrewAwayItemText::
- text "Threw away"
- line "@"
- text_ram wcd6d
- text "."
- prompt
+_RepelWoreOffText::
+ text "REPEL's effect"
+ line "wore off."
+ done
-_IsItOKToTossItemText::
- text "Is it OK to toss"
- line "@"
+_PokemartBuyingGreetingText::
+ text "Take your time."
+ done
+
+_PokemartTellBuyPriceText::
text_ram wcf4b
text "?"
- prompt
+ line "That will be"
+ cont "¥@"
+ text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
+ text ". OK?"
+ done
-_TooImportantToTossText::
- text "That's too impor-"
- line "tant to toss!"
+_PokemartBoughtItemText::
+ text "Here you are!"
+ line "Thank you!"
prompt
-_AlreadyKnowsText::
- text_ram wcd6d
- text " knows"
- line "@"
- text_ram wcf4b
- text "!"
+_PokemartNotEnoughMoneyText::
+ text "You don't have"
+ line "enough money."
prompt
-_ConnectCableText::
- text "Okay, connect the"
- line "cable like so!"
+_PokemartItemBagFullText::
+ text "You can't carry"
+ line "any more items."
prompt
-_TradedForText::
- text "<PLAYER> traded"
- line "@"
- text_ram wInGameTradeGiveMonName
- text " for"
- cont "@"
- text_ram wInGameTradeReceiveMonName
- text "!@"
- text_end
+_PokemonSellingGreetingText::
+ text "What would you"
+ line "like to sell?"
+ done
-_WannaTrade1Text::
- text "I'm looking for"
- line "@"
- text_ram wInGameTradeGiveMonName
- text "! Wanna"
+_PokemartTellSellPriceText::
+ text "I can pay you"
+ line "¥@"
+ text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
+ text " for that."
+ done
- para "trade one for"
- line "@"
- text_ram wInGameTradeReceiveMonName
- text "? "
+_PokemartItemBagEmptyText::
+ text "You don't have"
+ line "anything to sell."
+ prompt
+
+_PokemartUnsellableItemText::
+ text "I can't put a"
+ line "price on that."
+ prompt
+
+_PokemartThankYouText::
+ text "Thank you!"
done
-_NoTrade1Text::
- text "Awww!"
- line "Oh well..."
+_PokemartAnythingElseText::
+ text "Is there anything"
+ line "else I can do?"
done
-_WrongMon1Text::
- text "What? That's not"
+_LearnedMove1Text::
+ text_ram wLearnMoveMonName
+ text " learned"
line "@"
- text_ram wInGameTradeGiveMonName
- text "!"
-
- para "If you get one,"
- line "come back here!"
- done
+ text_ram wcf4b
+ text "!@"
+ text_end
-_Thanks1Text::
- text "Hey thanks!"
+_WhichMoveToForgetText::
+ text "Which move should"
+ next "be forgotten?"
done
-_AfterTrade1Text::
- text "Isn't my old"
+_AbandonLearningText::
+ text "Abandon learning"
line "@"
- text_ram wInGameTradeReceiveMonName
- text " great?"
+ text_ram wcf4b
+ text "?"
done
-_WannaTrade2Text::
- text "Hello there! Do"
- line "you want to trade"
+_DidNotLearnText::
+ text_ram wLearnMoveMonName
+ text_start
+ line "did not learn"
+ cont "@"
+ text_ram wcf4b
+ text "!"
+ prompt
+
+_TryingToLearnText::
+ text_ram wLearnMoveMonName
+ text " is"
+ line "trying to learn"
+ cont "@"
+ text_ram wcf4b
+ text "!"
- para "your @"
- text_ram wInGameTradeGiveMonName
+ para "But, @"
+ text_ram wLearnMoveMonName
text_start
- line "for @"
- text_ram wInGameTradeReceiveMonName
+ line "can't learn more"
+ cont "than 4 moves!"
+
+ para "Delete an older"
+ line "move to make room"
+ cont "for @"
+ text_ram wcf4b
text "?"
done
-_NoTrade2Text::
- text "Well, if you"
- line "don't want to..."
- done
+_OneTwoAndText::
+ text "1, 2 and...@"
+ text_end
-_WrongMon2Text::
- text "Hmmm? This isn't"
- line "@"
- text_ram wInGameTradeGiveMonName
- text "."
+_PoofText::
+ text " Poof!@"
+ text_end
- para "Think of me when"
- line "you get one."
- done
+_ForgotAndText::
+ text_start
+ para "@"
+ text_ram wLearnMoveMonName
+ text " forgot"
+ line "@"
+ text_ram wcd6d
+ text "!"
-_Thanks2Text::
- text "Thanks!"
- done
+ para "And..."
+ prompt
-_AfterTrade2Text::
- text "The @"
- text_ram wInGameTradeGiveMonName
- text " you"
- line "traded to me"
+_HMCantDeleteText::
+ text "HM techniques"
+ line "can't be deleted!"
+ prompt
- para "went and evolved!"
- done
+_PokemonCenterWelcomeText::
+ text "Welcome to our"
+ line "#MON CENTER!"
-_WannaTrade3Text::
- text "Hi! Do you have"
- line "@"
- text_ram wInGameTradeGiveMonName
- text "?"
+ para "We heal your"
+ line "#MON back to"
+ cont "perfect health!"
+ prompt
- para "Want to trade it"
- line "for @"
- text_ram wInGameTradeReceiveMonName
- text "?"
+_ShallWeHealYourPokemonText::
+ text "Shall we heal your"
+ line "#MON?"
done
-_NoTrade3Text::
- text "That's too bad."
+_NeedYourPokemonText::
+ text "OK. We'll need"
+ line "your #MON."
done
-_WrongMon3Text::
- text "...This is no"
- line "@"
- text_ram wInGameTradeGiveMonName
- text "."
+_PokemonFightingFitText::
+ text "Thank you!"
+ line "Your #MON are"
+ cont "fighting fit!"
+ prompt
- para "If you get one,"
- line "trade it with me!"
+_PokemonCenterFarewellText::
+ text "We hope to see"
+ line "you again!"
done
-_Thanks3Text::
- text "Thanks pal!"
+_LooksContentText::
+ text "It looks very"
+ line "content asleep."
done
-_AfterTrade3Text::
- text "How is my old"
- line "@"
- text_ram wInGameTradeReceiveMonName
- text "?"
+_CableClubNPCAreaReservedFor2FriendsLinkedByCableText::
+ text "This area is"
+ line "reserved for 2"
+ cont "friends who are"
+ cont "linked by cable."
+ done
- para "My @"
- text_ram wInGameTradeGiveMonName
- text " is"
- line "doing great!"
+_CableClubNPCWelcomeText::
+ text "Welcome to the"
+ line "Cable Club!"
done
-_NothingToCutText::
- text "There isn't"
- line "anything to CUT!"
- prompt
+_CableClubNPCPleaseApplyHereHaveToSaveText::
+ text "Please apply here."
-_UsedCutText::
- text_ram wcd6d
- text " hacked"
- line "away with CUT!"
- prompt
+ para "Before opening"
+ line "the link, we have"
+ cont "to save the game."
+ done
diff --git a/data/text/text_8.asm b/data/text/text_8.asm
new file mode 100644
index 00000000..d8d11d50
--- /dev/null
+++ b/data/text/text_8.asm
@@ -0,0 +1,118 @@
+_CableClubNPCPleaseWaitText::
+ text "Please wait.@"
+ text_end
+
+_CableClubNPCLinkClosedBecauseOfInactivityText::
+ text "The link has been"
+ line "closed because of"
+ cont "inactivity."
+
+ para "Please contact"
+ line "your friend and"
+ cont "come again!"
+ done
+
+_CableClubNPCPleaseComeAgainText::
+ text "Please come again!"
+ done
+
+_CableClubNPCMakingPreparationsText::
+ text "We're making"
+ line "preparations."
+ cont "Please wait."
+ done
+
+_FlashLightsAreaText::
+ text "A blinding FLASH"
+ line "lights the area!"
+ prompt
+
+_WarpToLastPokemonCenterText::
+ text "Warp to the last"
+ line "#MON CENTER."
+ done
+
+_CannotUseTeleportNowText::
+ text_ram wcd6d
+ text " can't"
+ line "use TELEPORT now."
+ prompt
+
+_CannotFlyHereText::
+ text_ram wcd6d
+ text " can't"
+ line "FLY here."
+ prompt
+
+_NotHealthyEnoughText::
+ text "Not healthy"
+ line "enough."
+ prompt
+
+_NewBadgeRequiredText::
+ text "No! A new BADGE"
+ line "is required."
+ prompt
+
+_CannotUseItemsHereText::
+ text "You can't use items"
+ line "here."
+ prompt
+
+_CannotGetOffHereText::
+ text "You can't get off"
+ line "here."
+ prompt
+
+_UsedStrengthText::
+ text_ram wcd6d
+ text " used"
+ line "STRENGTH.@"
+ text_end
+
+_CanMoveBouldersText::
+ text_ram wcd6d
+ text " can"
+ line "move boulders."
+ prompt
+
+_CurrentTooFastText::
+ text "The current is"
+ line "much too fast!"
+ prompt
+
+_CyclingIsFunText::
+ text "Cycling is fun!"
+ line "Forget SURFing!"
+ prompt
+
+_GotMonText::
+ text "<PLAYER> got"
+ line "@"
+ text_ram wcd6d
+ text "!@"
+ text_end
+
+_SentToBoxText::
+ text "There's no more"
+ line "room for #MON!"
+ cont "@"
+ text_ram wBoxMonNicks
+ text " was"
+ cont "sent to #MON"
+ cont "BOX @"
+ text_ram wcf4b
+ text " on PC!"
+ done
+
+_BoxIsFullText::
+ text "There's no more"
+ line "room for #MON!"
+
+ para "The #MON BOX"
+ line "is full and can't"
+ cont "accept any more!"
+
+ para "Change the BOX at"
+ line "a #MON CENTER!"
+ done
diff --git a/data/text/text_9.asm b/data/text/text_9.asm
new file mode 100644
index 00000000..a5aff49c
--- /dev/null
+++ b/data/text/text_9.asm
@@ -0,0 +1,442 @@
+_ItemUseBallText00::
+ text "It dodged the"
+ line "thrown BALL!"
+
+ para "This #MON"
+ line "can't be caught!"
+ prompt
+
+_ItemUseBallText01::
+ text "You missed the"
+ line "#MON!"
+ prompt
+
+_ItemUseBallText02::
+ text "Darn! The #MON"
+ line "broke free!"
+ prompt
+
+_ItemUseBallText03::
+ text "Aww! It appeared"
+ line "to be caught! "
+ prompt
+
+_ItemUseBallText04::
+ text "Shoot! It was so"
+ line "close too!"
+ prompt
+
+_ItemUseBallText05::
+ text "All right!"
+ line "@"
+ text_ram wEnemyMonNick
+ text " was"
+ cont "caught!@"
+ text_end
+
+_ItemUseBallText07::
+ text_ram wBoxMonNicks
+ text " was"
+ line "transferred to"
+ cont "BILL's PC!"
+ prompt
+
+_ItemUseBallText08::
+ text_ram wBoxMonNicks
+ text " was"
+ line "transferred to"
+ cont "someone's PC!"
+ prompt
+
+_ItemUseBallText06::
+ text "New #DEX data"
+ line "will be added for"
+ cont "@"
+ text_ram wEnemyMonNick
+ text "!@"
+ text_end
+
+_SurfingGotOnText::
+ text "<PLAYER> got on"
+ line "@"
+ text_ram wcd6d
+ text "!"
+ prompt
+
+_SurfingNoPlaceToGetOffText::
+ text "There's no place"
+ line "to get off!"
+ prompt
+
+_RefusingText::
+ text_ram wcd6d
+ text_start
+ line "is refusing!"
+ prompt
+
+_VitaminStatRoseText::
+ text_ram wcd6d
+ text "'s"
+ line "@"
+ text_ram wcf4b
+ text " rose."
+ prompt
+
+_VitaminNoEffectText::
+ text "It won't have any"
+ line "effect."
+ prompt
+
+_ThrewBaitText::
+ text "<PLAYER> threw"
+ line "some BAIT."
+ done
+
+_ThrewRockText::
+ text "<PLAYER> threw a"
+ line "ROCK."
+ done
+
+_PlayedFluteNoEffectText::
+ text "Played the #"
+ line "FLUTE."
+
+ para "Now, that's a"
+ line "catchy tune!"
+ prompt
+
+_FluteWokeUpText::
+ text "All sleeping"
+ line "#MON woke up."
+ prompt
+
+_PlayedFluteHadEffectText::
+ text "<PLAYER> played the"
+ line "# FLUTE.@"
+ text_end
+
+_CoinCaseNumCoinsText::
+ text "Coins"
+ line "@"
+ text_bcd wPlayerCoins, 2 | LEADING_ZEROES | LEFT_ALIGN
+ text " "
+ prompt
+
+_ItemfinderFoundItemText::
+ text "Yes! ITEMFINDER"
+ line "indicates there's"
+ cont "an item nearby."
+ prompt
+
+_ItemfinderFoundNothingText::
+ text "Nope! ITEMFINDER"
+ line "isn't responding."
+ prompt
+
+_RaisePPWhichTechniqueText::
+ text "Raise PP of which"
+ line "technique?"
+ done
+
+_RestorePPWhichTechniqueText::
+ text "Restore PP of"
+ line "which technique?"
+ done
+
+_PPMaxedOutText::
+ text_ram wcf4b
+ text "'s PP"
+ line "is maxed out."
+ prompt
+
+_PPIncreasedText::
+ text_ram wcf4b
+ text "'s PP"
+ line "increased."
+ prompt
+
+_PPRestoredText::
+ text "PP was restored."
+ prompt
+
+_BootedUpTMText::
+ text "Booted up a TM!"
+ prompt
+
+_BootedUpHMText::
+ text "Booted up an HM!"
+ prompt
+
+_TeachMachineMoveText::
+ text "It contained"
+ line "@"
+ text_ram wcf4b
+ text "!"
+
+ para "Teach @"
+ text_ram wcf4b
+ text_start
+ line "to a #MON?"
+ done
+
+_MonCannotLearnMachineMoveText::
+ text_ram wcd6d
+ text " is not"
+ line "compatible with"
+ cont "@"
+ text_ram wcf4b
+ text "."
+
+ para "It can't learn"
+ line "@"
+ text_ram wcf4b
+ text "."
+ prompt
+
+_ItemUseNotTimeText::
+ text "OAK: <PLAYER>!"
+ line "This isn't the"
+ cont "time to use that! "
+ prompt
+
+_ItemUseNotYoursToUseText::
+ text "This isn't yours"
+ line "to use!"
+ prompt
+
+_ItemUseNoEffectText::
+ text "It won't have any"
+ line "effect."
+ prompt
+
+_ThrowBallAtTrainerMonText1::
+ text "The trainer"
+ line "blocked the BALL!"
+ prompt
+
+_ThrowBallAtTrainerMonText2::
+ text "Don't be a thief!"
+ prompt
+
+_NoCyclingAllowedHereText::
+ text "No cycling"
+ next "allowed here."
+ prompt
+
+_NoSurfingHereText::
+ text "No SURFing on"
+ line "@"
+ text_ram wcd6d
+ text " here!"
+ prompt
+
+_BoxFullCannotThrowBallText::
+ text "The #MON BOX"
+ line "is full! Can't"
+ cont "use that item!"
+ prompt
+
+_DontHavePokemonText::
+ text "You don't have a "
+ line "#MON!"
+ prompt
+
+_ItemUseText001::
+ text "<PLAYER> used@"
+ text_end
+
+_ItemUseText002::
+ text_ram wcf4b
+ text "!"
+ done
+
+_GotOnBicycleText1::
+ text "<PLAYER> got on the@"
+ text_end
+
+_GotOnBicycleText2::
+ text_ram wcf4b
+ text "!"
+ prompt
+
+_GotOffBicycleText1::
+ text "<PLAYER> got off@"
+ text_end
+
+_GotOffBicycleText2::
+ text "the @"
+ text_ram wcf4b
+ text "."
+ prompt
+
+_ThrewAwayItemText::
+ text "Threw away"
+ line "@"
+ text_ram wcd6d
+ text "."
+ prompt
+
+_IsItOKToTossItemText::
+ text "Is it OK to toss"
+ line "@"
+ text_ram wcf4b
+ text "?"
+ prompt
+
+_TooImportantToTossText::
+ text "That's too impor-"
+ line "tant to toss!"
+ prompt
+
+_AlreadyKnowsText::
+ text_ram wcd6d
+ text " knows"
+ line "@"
+ text_ram wcf4b
+ text "!"
+ prompt
+
+_ConnectCableText::
+ text "Okay, connect the"
+ line "cable like so!"
+ prompt
+
+_TradedForText::
+ text "<PLAYER> traded"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text " for"
+ cont "@"
+ text_ram wInGameTradeReceiveMonName
+ text "!@"
+ text_end
+
+_WannaTrade1Text::
+ text "I'm looking for"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text "! Wanna"
+
+ para "trade one for"
+ line "@"
+ text_ram wInGameTradeReceiveMonName
+ text "? "
+ done
+
+_NoTrade1Text::
+ text "Awww!"
+ line "Oh well..."
+ done
+
+_WrongMon1Text::
+ text "What? That's not"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text "!"
+
+ para "If you get one,"
+ line "come back here!"
+ done
+
+_Thanks1Text::
+ text "Hey thanks!"
+ done
+
+_AfterTrade1Text::
+ text "Isn't my old"
+ line "@"
+ text_ram wInGameTradeReceiveMonName
+ text " great?"
+ done
+
+_WannaTrade2Text::
+ text "Hello there! Do"
+ line "you want to trade"
+
+ para "your @"
+ text_ram wInGameTradeGiveMonName
+ text_start
+ line "for @"
+ text_ram wInGameTradeReceiveMonName
+ text "?"
+ done
+
+_NoTrade2Text::
+ text "Well, if you"
+ line "don't want to..."
+ done
+
+_WrongMon2Text::
+ text "Hmmm? This isn't"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text "."
+
+ para "Think of me when"
+ line "you get one."
+ done
+
+_Thanks2Text::
+ text "Thanks!"
+ done
+
+_AfterTrade2Text::
+ text "Hello there! Your"
+ line "old @"
+ text_ram wInGameTradeGiveMonName
+ text " is"
+ cont "magnificent!"
+ done
+
+_WannaTrade3Text::
+ text "Hi! Do you have"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text "?"
+
+ para "Want to trade it"
+ line "for @"
+ text_ram wInGameTradeReceiveMonName
+ text "?"
+ done
+
+_NoTrade3Text::
+ text "That's too bad."
+ done
+
+_WrongMon3Text::
+ text "...This is no"
+ line "@"
+ text_ram wInGameTradeGiveMonName
+ text "."
+
+ para "If you get one,"
+ line "trade it with me!"
+ done
+
+_Thanks3Text::
+ text "Thanks, pal!"
+ done
+
+_AfterTrade3Text::
+ text "How is my old"
+ line "@"
+ text_ram wInGameTradeReceiveMonName
+ text "?"
+
+ para "My @"
+ text_ram wInGameTradeGiveMonName
+ text " is"
+ line "doing great!"
+ done
+
+_NothingToCutText::
+ text "There isn't"
+ line "anything to CUT!"
+ prompt
+
+_UsedCutText::
+ text_ram wcd6d
+ text " hacked"
+ line "away with CUT!"
+ prompt
diff --git a/data/text_predef_pointers.asm b/data/text_predef_pointers.asm
index 8c125fa0..df882ebd 100644
--- a/data/text_predef_pointers.asm
+++ b/data/text_predef_pointers.asm
@@ -15,58 +15,60 @@ TextPredefs::
add_tx_pre AerodactylFossilText ; 09
add_tx_pre Route15UpstairsBinocularsText ; 0A
add_tx_pre KabutopsFossilText ; 0B
- add_tx_pre GymStatueText1 ; 0C
- add_tx_pre GymStatueText2 ; 0D
- add_tx_pre BookcaseText ; 0E
- add_tx_pre ViridianCityPokecenterBenchGuyText ; 0F
- add_tx_pre PewterCityPokecenterBenchGuyText ; 10
- add_tx_pre CeruleanCityPokecenterBenchGuyText ; 11
- add_tx_pre LavenderCityPokecenterBenchGuyText ; 12
- add_tx_pre VermilionCityPokecenterBenchGuyText ; 13
- add_tx_pre CeladonCityPokecenterBenchGuyText ; 14
- add_tx_pre CeladonCityHotelText ; 15
- add_tx_pre FuchsiaCityPokecenterBenchGuyText ; 16
- add_tx_pre CinnabarIslandPokecenterBenchGuyText ; 17
- add_tx_pre SaffronCityPokecenterBenchGuyText ; 18
- add_tx_pre MtMoonPokecenterBenchGuyText ; 19
- add_tx_pre RockTunnelPokecenterBenchGuyText ; 1A
- add_tx_pre UnusedBenchGuyText1 ; 1B XXX unused
- add_tx_pre UnusedBenchGuyText2 ; 1C XXX unused
- add_tx_pre UnusedBenchGuyText3 ; 1D XXX unused
- add_tx_pre UnusedPredefText ; 1E XXX unused
- add_tx_pre PokemonCenterPCText ; 1F
- add_tx_pre ViridianSchoolNotebook ; 20
- add_tx_pre ViridianSchoolBlackboard ; 21
- add_tx_pre JustAMomentText ; 22
- add_tx_pre OpenBillsPCText ; 23
- add_tx_pre FoundHiddenItemText ; 24
- add_tx_pre HiddenItemBagFullText ; 25 XXX unused
- add_tx_pre VermilionGymTrashText ; 26
- add_tx_pre IndigoPlateauHQText ; 27
- add_tx_pre GameCornerOutOfOrderText ; 28
- add_tx_pre GameCornerOutToLunchText ; 29
- add_tx_pre GameCornerSomeonesKeysText ; 2A
- add_tx_pre FoundHiddenCoinsText ; 2B
- add_tx_pre DroppedHiddenCoinsText ; 2C
- add_tx_pre BillsHouseMonitorText ; 2D
- add_tx_pre BillsHouseInitiatedText ; 2E
- add_tx_pre BillsHousePokemonList ; 2F
- add_tx_pre MagazinesText ; 30
- add_tx_pre CinnabarGymQuiz ; 31
- add_tx_pre GameCornerNoCoinsText ; 32
- add_tx_pre GameCornerCoinCaseText ; 33
- add_tx_pre LinkCableHelp ; 34
- add_tx_pre TMNotebook ; 35
- add_tx_pre FightingDojoText ; 36
- add_tx_pre EnemiesOnEverySideText ; 37
- add_tx_pre WhatGoesAroundComesAroundText ; 38
- add_tx_pre NewBicycleText ; 39
- add_tx_pre IndigoPlateauStatues ; 3A
- add_tx_pre VermilionGymTrashSuccessText1 ; 3B
- add_tx_pre VermilionGymTrashSuccessText2 ; 3C XXX unused
- add_tx_pre VermilionGymTrashSuccessText3 ; 3D
- add_tx_pre VermilionGymTrashFailText ; 3E
- add_tx_pre TownMapText ; 3F
- add_tx_pre BookOrSculptureText ; 40
- add_tx_pre ElevatorText ; 41
- add_tx_pre PokemonStuffText ; 42
+ add_tx_pre FanClubPicture1Text ; 0C
+ add_tx_pre FanClubPicture2Text ; 0D
+ add_tx_pre GymStatueText1 ; 0E
+ add_tx_pre GymStatueText2 ; 0F
+ add_tx_pre BookcaseText ; 10
+ add_tx_pre ViridianCityPokecenterBenchGuyText ; 11
+ add_tx_pre PewterCityPokecenterBenchGuyText ; 12
+ add_tx_pre CeruleanCityPokecenterBenchGuyText ; 13
+ add_tx_pre LavenderCityPokecenterBenchGuyText ; 14
+ add_tx_pre VermilionCityPokecenterBenchGuyText ; 15
+ add_tx_pre CeladonCityPokecenterBenchGuyText ; 16
+ add_tx_pre CeladonCityHotelText ; 17
+ add_tx_pre FuchsiaCityPokecenterBenchGuyText ; 18
+ add_tx_pre CinnabarIslandPokecenterBenchGuyText ; 19
+ add_tx_pre SaffronCityPokecenterBenchGuyText ; 1A
+ add_tx_pre MtMoonPokecenterBenchGuyText ; 1B
+ add_tx_pre RockTunnelPokecenterBenchGuyText ; 1C
+ add_tx_pre UnusedBenchGuyText1 ; 1D XXX unused
+ add_tx_pre UnusedBenchGuyText2 ; 1E XXX unused
+ add_tx_pre UnusedBenchGuyText3 ; 1F XXX unused
+ add_tx_pre UnusedPredefText ; 20 XXX unused
+ add_tx_pre PokemonCenterPCText ; 21
+ add_tx_pre ViridianSchoolNotebook ; 22
+ add_tx_pre ViridianSchoolBlackboard ; 23
+ add_tx_pre JustAMomentText ; 24
+ add_tx_pre OpenBillsPCText ; 25
+ add_tx_pre FoundHiddenItemText ; 26
+ add_tx_pre HiddenItemBagFullText ; 27 XXX unused
+ add_tx_pre VermilionGymTrashText ; 28
+ add_tx_pre IndigoPlateauHQText ; 29
+ add_tx_pre GameCornerOutOfOrderText ; 2A
+ add_tx_pre GameCornerOutToLunchText ; 2B
+ add_tx_pre GameCornerSomeonesKeysText ; 2C
+ add_tx_pre FoundHiddenCoinsText ; 2D
+ add_tx_pre DroppedHiddenCoinsText ; 2E
+ add_tx_pre BillsHouseMonitorText ; 2F
+ add_tx_pre BillsHouseInitiatedText ; 30
+ add_tx_pre BillsHousePokemonList ; 31
+ add_tx_pre MagazinesText ; 32
+ add_tx_pre CinnabarGymQuiz ; 33
+ add_tx_pre GameCornerNoCoinsText ; 34
+ add_tx_pre GameCornerCoinCaseText ; 35
+ add_tx_pre LinkCableHelp ; 36
+ add_tx_pre TMNotebook ; 37
+ add_tx_pre FightingDojoText ; 38
+ add_tx_pre EnemiesOnEverySideText ; 39
+ add_tx_pre WhatGoesAroundComesAroundText ; 3A
+ add_tx_pre NewBicycleText ; 3B
+ add_tx_pre IndigoPlateauStatues ; 3C
+ add_tx_pre VermilionGymTrashSuccessText1 ; 3D
+ add_tx_pre VermilionGymTrashSuccessText2 ; 3E XXX unused
+ add_tx_pre VermilionGymTrashSuccessText3 ; 3F
+ add_tx_pre VermilionGymTrashFailText ; 40
+ add_tx_pre TownMapText ; 41
+ add_tx_pre BookOrSculptureText ; 42
+ add_tx_pre ElevatorText ; 43
+ add_tx_pre PokemonStuffText ; 44
diff --git a/data/tilesets/collision_tile_ids.asm b/data/tilesets/collision_tile_ids.asm
index c1bee7ce..eb09f4fb 100644
--- a/data/tilesets/collision_tile_ids.asm
+++ b/data/tilesets/collision_tile_ids.asm
@@ -68,3 +68,6 @@ Facility_Coll::
Plateau_Coll::
coll_tiles $1b, $23, $2c, $2d, $3b, $45
+
+BeachHouse_Coll::
+ coll_tiles $01, $11, $12, $14
diff --git a/data/tilesets/door_tile_ids.asm b/data/tilesets/door_tile_ids.asm
index 716f76f3..950115e0 100644
--- a/data/tilesets/door_tile_ids.asm
+++ b/data/tilesets/door_tile_ids.asm
@@ -12,6 +12,7 @@ DoorTileIDPointers:
dbw LAB, .LabDoorTileIDs
dbw FACILITY, .FacilityDoorTileIDs
dbw PLATEAU, .PlateauDoorTileIDs
+ dbw INTERIOR, .InteriorDoorTileIDs
db -1 ; end
door_tiles: MACRO
@@ -53,3 +54,6 @@ ENDM
.PlateauDoorTileIDs:
door_tiles $3b, $1b
+
+.InteriorDoorTileIDs:
+ door_tiles $04, $15
diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm
index 375b0687..3355de6d 100644
--- a/data/tilesets/tileset_headers.asm
+++ b/data/tilesets/tileset_headers.asm
@@ -33,4 +33,5 @@ Tilesets:
tileset Club, $07,$17, -1, -1, TILEANIM_NONE
tileset Facility, $12, -1, -1, -1, TILEANIM_WATER
tileset Plateau, -1, -1, -1, $45, TILEANIM_WATER
+ tileset BeachHouse, -1, -1, -1, -1, TILEANIM_NONE
assert_table_length NUM_TILESETS
diff --git a/data/tilesets/warp_tile_ids.asm b/data/tilesets/warp_tile_ids.asm
index 80df6cdf..61b93a36 100644
--- a/data/tilesets/warp_tile_ids.asm
+++ b/data/tilesets/warp_tile_ids.asm
@@ -24,6 +24,7 @@ WarpTileIDPointers:
dw .ClubWarpTileIDs
dw .FacilityWarpTileIDs
dw .PlateauWarpTileIDs
+ dw .BeachHouseWarpTileIDs
assert_table_length NUM_TILESETS
warp_tiles: MACRO
@@ -92,3 +93,6 @@ ENDM
.ShipPortWarpTileIDs:
.ClubWarpTileIDs:
warp_tiles ; end
+
+.BeachHouseWarpTileIDs:
+ warp_tiles ; end
diff --git a/data/trainers/move_choices.asm b/data/trainers/move_choices.asm
index 2c3498af..d80722b1 100644
--- a/data/trainers/move_choices.asm
+++ b/data/trainers/move_choices.asm
@@ -28,7 +28,7 @@ TrainerClassMoveChoiceModifications:
move_choices 1 ; GAMBLER
move_choices 1, 3 ; BEAUTY
move_choices 1, 2 ; PSYCHIC_TR
- move_choices 1, 3 ; ROCKER
+ move_choices 1 ; ROCKER
move_choices 1 ; JUGGLER
move_choices 1 ; TAMER
move_choices 1 ; BIRD_KEEPER
@@ -44,11 +44,11 @@ TrainerClassMoveChoiceModifications:
move_choices 1 ; BRUNO
move_choices 1 ; BROCK
move_choices 1, 3 ; MISTY
- move_choices 1, 3 ; LT_SURGE
+ move_choices 1 ; LT_SURGE
move_choices 1, 3 ; ERIKA
move_choices 1, 3 ; KOGA
- move_choices 1, 3 ; BLAINE
- move_choices 1, 3 ; SABRINA
+ move_choices 1 ; BLAINE
+ move_choices 1 ; SABRINA
move_choices 1, 2 ; GENTLEMAN
move_choices 1, 3 ; RIVAL2
move_choices 1, 3 ; RIVAL3
diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm
index dddcf653..46bbf721 100644
--- a/data/trainers/parties.asm
+++ b/data/trainers/parties.asm
@@ -23,7 +23,7 @@ TrainerDataPointers:
dw TamerData
dw BirdKeeperData
dw BlackbeltData
- dw Green1Data
+ dw Rival1Data
dw ProfOakData
dw ChiefData
dw ScientistData
@@ -40,8 +40,8 @@ TrainerDataPointers:
dw BlaineData
dw SabrinaData
dw GentlemanData
- dw Green2Data
- dw Green3Data
+ dw Rival2Data
+ dw Rival3Data
dw LoreleiData
dw ChannelerData
dw AgathaData
@@ -77,12 +77,13 @@ YoungsterData:
db 18, NIDORAN_M, NIDORINO, 0
; Unused
db 17, SPEAROW, RATTATA, RATTATA, SPEAROW, 0
+ db 24, SANDSHREW, 0
BugCatcherData:
; Viridian Forest
- db 6, WEEDLE, CATERPIE, 0
- db 7, WEEDLE, KAKUNA, WEEDLE, 0
- db 9, WEEDLE, 0
+ db 7, CATERPIE, CATERPIE, 0
+ db 6, METAPOD, CATERPIE, METAPOD, 0
+ db 10, CATERPIE, 0
; Route 3
db 10, CATERPIE, WEEDLE, CATERPIE, 0
db 9, WEEDLE, KAKUNA, CATERPIE, METAPOD, 0
@@ -100,6 +101,7 @@ BugCatcherData:
; Route 9
db 19, BEEDRILL, BEEDRILL, 0
db 20, CATERPIE, WEEDLE, VENONAT, 0
+ db 8, CATERPIE, METAPOD, 0
LassData:
; Route 3
@@ -120,15 +122,16 @@ LassData:
; SS Anne 1F Rooms
db 18, PIDGEY, NIDORAN_F, 0
; SS Anne 2F Rooms
- db 18, RATTATA, PIKACHU, 0
+ db 20, JIGGLYPUFF, 0
; Route 8
db 23, NIDORAN_F, NIDORINA, 0
db 24, MEOWTH, MEOWTH, MEOWTH, 0
- db 19, PIDGEY, RATTATA, NIDORAN_M, MEOWTH, PIKACHU, 0
+ db 19, PIDGEY, RATTATA, NIDORAN_F, MEOWTH, NIDORAN_M, 0
db 22, CLEFAIRY, CLEFAIRY, 0
; Celadon Gym
db 23, BELLSPROUT, WEEPINBELL, 0
db 23, ODDISH, GLOOM, 0
+ db 6, NIDORAN_F, NIDORAN_M, 0
SailorData:
; SS Anne Stern
@@ -141,11 +144,11 @@ SailorData:
db 17, HORSEA, HORSEA, HORSEA, 0
db 20, MACHOP, 0
; Vermilion Gym
- db 21, PIKACHU, PIKACHU, 0
+ db 24, MAGNEMITE, 0
JrTrainerMData:
; Pewter Gym
- db 11, DIGLETT, SANDSHREW, 0
+ db 9, DIGLETT, SANDSHREW, 0
; Route 24/Route 25
db 14, RATTATA, EKANS, 0
; Route 24
@@ -160,12 +163,13 @@ JrTrainerMData:
db 19, RATTATA, DIGLETT, EKANS, SANDSHREW, 0
; Route 12
db 29, NIDORAN_M, NIDORINO, 0
+ db 16, WEEPINBELL, 0
JrTrainerFData:
; Cerulean Gym
db 19, GOLDEEN, 0
; Route 6
- db 16, RATTATA, PIKACHU, 0
+ db 16, ODDISH, BELLSPROUT, 0
db 16, PIDGEY, PIDGEY, PIDGEY, 0
; Unused
db 22, BULBASAUR, 0
@@ -173,7 +177,7 @@ JrTrainerFData:
db 18, ODDISH, BELLSPROUT, ODDISH, BELLSPROUT, 0
db 23, MEOWTH, 0
; Route 10
- db 20, PIKACHU, CLEFAIRY, 0
+ db 20, JIGGLYPUFF, CLEFAIRY, 0
db 21, PIDGEY, PIDGEOTTO, 0
; Rock Tunnel B1F
db 21, JIGGLYPUFF, PIDGEY, MEOWTH, 0
@@ -181,7 +185,7 @@ JrTrainerFData:
; Celadon Gym
db 24, BULBASAUR, IVYSAUR, 0
; Route 13
- db 24, PIDGEY, MEOWTH, RATTATA, PIKACHU, MEOWTH, 0
+ db 24, PIDGEY, MEOWTH, RATTATA, PIDGEY, MEOWTH, 0
db 30, POLIWAG, POLIWAG, 0
db 27, PIDGEY, MEOWTH, PIDGEY, PIDGEOTTO, 0
db 28, GOLDEEN, POLIWAG, HORSEA, 0
@@ -193,11 +197,12 @@ JrTrainerFData:
db 19, PIDGEY, RATTATA, RATTATA, BELLSPROUT, 0
; Route 15
db 28, GLOOM, ODDISH, ODDISH, 0
- db 29, PIKACHU, RAICHU, 0
+ db 29, PIDGEY, PIDGEOTTO, 0
db 33, CLEFAIRY, 0
db 29, BELLSPROUT, ODDISH, TANGELA, 0
; Route 20
db 30, TENTACOOL, HORSEA, SEEL, 0
+ db 20, CUBONE, 0
PokemaniacData:
; Route 10
@@ -267,14 +272,6 @@ BikerData:
db 33, WEEZING, 0
db 26, GRIMER, GRIMER, GRIMER, GRIMER, 0
; Route 17
- ; From https://www.smogon.com/smog/issue27/glitch:
- ; 0E:5FC2 is offset of the ending 0 for this first Biker on Route 17.
- ; BaseStats + (BASE_DATA_SIZE) * (000 - 1) = $5FC2;
- ; that's the formula from GetMonHeader for the base stats of mon #000.
- ; (BaseStats = $43DE and BANK(BaseStats) = $0E.)
- ; Finally, PokedexOrder lists 0 as the dex ID for every MissingNo.
- ; The result is that this data gets interpreted as the base stats
- ; for MissingNo: 0, 33, MUK, 0, 29, VOLTORB, VOLTORB, 0, ..., 28, GRIMER, GRIMER.
db 28, WEEZING, KOFFING, WEEZING, 0
db 33, MUK, 0
db 29, VOLTORB, VOLTORB, 0
@@ -383,7 +380,7 @@ BeautyData:
db 24, BELLSPROUT, BELLSPROUT, 0
db 26, EXEGGCUTE, 0
; Route 13
- db 27, RATTATA, PIKACHU, RATTATA, 0
+ db 27, RATTATA, VULPIX, RATTATA, 0
db 29, CLEFAIRY, MEOWTH, 0
; Route 20
db 35, SEAKING, 0
@@ -410,7 +407,7 @@ PsychicData:
RockerData:
; Vermilion Gym
- db 20, VOLTORB, MAGNEMITE, VOLTORB, 0
+ db 20, VOLTORB, VOLTORB, VOLTORB, 0
; Route 12
db 29, VOLTORB, ELECTRODE, 0
@@ -482,18 +479,12 @@ BlackbeltData:
; Victory Road 2F
db 43, MACHOKE, MACHOP, MACHOKE, 0
-Green1Data:
- db 5, SQUIRTLE, 0
- db 5, BULBASAUR, 0
- db 5, CHARMANDER, 0
+Rival1Data:
+ db 5, EEVEE, 0
; Route 22
- db $FF, 9, PIDGEY, 8, SQUIRTLE, 0
- db $FF, 9, PIDGEY, 8, BULBASAUR, 0
- db $FF, 9, PIDGEY, 8, CHARMANDER, 0
+ db $FF, 9, SPEAROW, 8, EEVEE, 0
; Cerulean City
- db $FF, 18, PIDGEOTTO, 15, ABRA, 15, RATTATA, 17, SQUIRTLE, 0
- db $FF, 18, PIDGEOTTO, 15, ABRA, 15, RATTATA, 17, BULBASAUR, 0
- db $FF, 18, PIDGEOTTO, 15, ABRA, 15, RATTATA, 17, CHARMANDER, 0
+ db $FF, 18, SPEAROW, 15, SANDSHREW, 15, RATTATA, 17, EEVEE, 0
ProfOakData:
; Unused
@@ -533,11 +524,11 @@ ScientistData:
GiovanniData:
; Rocket Hideout B4F
- db $FF, 25, ONIX, 24, RHYHORN, 29, KANGASKHAN, 0
+ db $FF, 25, ONIX, 24, RHYHORN, 29, PERSIAN, 0
; Silph Co. 11F
- db $FF, 37, NIDORINO, 35, KANGASKHAN, 37, RHYHORN, 41, NIDOQUEEN, 0
+ db $FF, 37, NIDORINO, 35, PERSIAN, 37, RHYHORN, 41, NIDOQUEEN, 0
; Viridian Gym
- db $FF, 45, RHYHORN, 42, DUGTRIO, 44, NIDOQUEEN, 45, NIDOKING, 50, RHYDON, 0
+ db $FF, 50, DUGTRIO, 53, PERSIAN, 53, NIDOQUEEN, 55, NIDOKING, 55, RHYDON, 0
RocketData:
; Mt. Moon B2F
@@ -601,6 +592,16 @@ RocketData:
; Silph Co. 11F
db 25, RATTATA, RATTATA, ZUBAT, RATTATA, EKANS, 0
db 32, CUBONE, DROWZEE, MAROWAK, 0
+; Jessie & James
+ db 14, EKANS, MEOWTH, KOFFING, 0
+ db 25, KOFFING, MEOWTH, EKANS, 0
+ db 27, MEOWTH, ARBOK, WEEZING, 0
+ db 31, WEEZING, ARBOK, MEOWTH, 0
+; Unused
+ db 16, KOFFING, 0
+ db 27, KOFFING, 0
+ db 29, WEEZING, 0
+ db 33, WEEZING, 0
CooltrainerMData:
; Viridian Gym
@@ -639,59 +640,57 @@ BrunoData:
db $FF, 53, ONIX, 55, HITMONCHAN, 55, HITMONLEE, 56, ONIX, 58, MACHAMP, 0
BrockData:
- db $FF, 12, GEODUDE, 14, ONIX, 0
+ db $FF, 10, GEODUDE, 12, ONIX, 0
MistyData:
db $FF, 18, STARYU, 21, STARMIE, 0
LtSurgeData:
- db $FF, 21, VOLTORB, 18, PIKACHU, 24, RAICHU, 0
+ db $FF, 28, RAICHU, 0
ErikaData:
- db $FF, 29, VICTREEBEL, 24, TANGELA, 29, VILEPLUME, 0
+ db $FF, 30, TANGELA, 32, WEEPINBELL, 32, GLOOM, 0
KogaData:
- db $FF, 37, KOFFING, 39, MUK, 37, KOFFING, 43, WEEZING, 0
+ db $FF, 44, VENONAT, 46, VENONAT, 48, VENONAT, 50, VENOMOTH, 0
BlaineData:
- db $FF, 42, GROWLITHE, 40, PONYTA, 42, RAPIDASH, 47, ARCANINE, 0
+ db $FF, 48, NINETALES, 50, RAPIDASH, 54, ARCANINE, 0
SabrinaData:
- db $FF, 38, KADABRA, 37, MR_MIME, 38, VENOMOTH, 43, ALAKAZAM, 0
+ db $FF, 50, ABRA, 50, KADABRA, 50, ALAKAZAM, 0
GentlemanData:
; SS Anne 1F Rooms
db 18, GROWLITHE, GROWLITHE, 0
db 19, NIDORAN_M, NIDORAN_F, 0
; SS Anne 2F Rooms/Vermilion Gym
- db 23, PIKACHU, 0
+ db 22, VOLTORB, MAGNEMITE, 0
; Unused
db 48, PRIMEAPE, 0
; SS Anne 2F Rooms
db 17, GROWLITHE, PONYTA, 0
-Green2Data:
+Rival2Data:
; SS Anne 2F
- db $FF, 19, PIDGEOTTO, 16, RATICATE, 18, KADABRA, 20, WARTORTLE, 0
- db $FF, 19, PIDGEOTTO, 16, RATICATE, 18, KADABRA, 20, IVYSAUR, 0
- db $FF, 19, PIDGEOTTO, 16, RATICATE, 18, KADABRA, 20, CHARMELEON, 0
+ db $FF, 19, SPEAROW, 16, RATTATA, 18, SANDSHREW, 20, EEVEE, 0
; Pokémon Tower 2F
- db $FF, 25, PIDGEOTTO, 23, GROWLITHE, 22, EXEGGCUTE, 20, KADABRA, 25, WARTORTLE, 0
- db $FF, 25, PIDGEOTTO, 23, GYARADOS, 22, GROWLITHE, 20, KADABRA, 25, IVYSAUR, 0
- db $FF, 25, PIDGEOTTO, 23, EXEGGCUTE, 22, GYARADOS, 20, KADABRA, 25, CHARMELEON, 0
+ db $FF, 25, FEAROW, 23, SHELLDER, 22, VULPIX, 20, SANDSHREW, 25, EEVEE, 0
+ db $FF, 25, FEAROW, 23, MAGNEMITE, 22, SHELLDER, 20, SANDSHREW, 25, EEVEE, 0
+ db $FF, 25, FEAROW, 23, VULPIX, 22, MAGNEMITE, 20, SANDSHREW, 25, EEVEE, 0
; Silph Co. 7F
- db $FF, 37, PIDGEOT, 38, GROWLITHE, 35, EXEGGCUTE, 35, ALAKAZAM, 40, BLASTOISE, 0
- db $FF, 37, PIDGEOT, 38, GYARADOS, 35, GROWLITHE, 35, ALAKAZAM, 40, VENUSAUR, 0
- db $FF, 37, PIDGEOT, 38, EXEGGCUTE, 35, GYARADOS, 35, ALAKAZAM, 40, CHARIZARD, 0
+ db $FF, 38, SANDSLASH, 35, NINETALES, 37, CLOYSTER, 35, KADABRA, 40, JOLTEON, 0
+ db $FF, 38, SANDSLASH, 35, CLOYSTER, 37, MAGNETON, 35, KADABRA, 40, FLAREON, 0
+ db $FF, 38, SANDSLASH, 35, MAGNETON, 37, NINETALES, 35, KADABRA, 40, VAPOREON, 0
; Route 22
- db $FF, 47, PIDGEOT, 45, RHYHORN, 45, GROWLITHE, 47, EXEGGCUTE, 50, ALAKAZAM, 53, BLASTOISE, 0
- db $FF, 47, PIDGEOT, 45, RHYHORN, 45, GYARADOS, 47, GROWLITHE, 50, ALAKAZAM, 53, VENUSAUR, 0
- db $FF, 47, PIDGEOT, 45, RHYHORN, 45, EXEGGCUTE, 47, GYARADOS, 50, ALAKAZAM, 53, CHARIZARD, 0
-
-Green3Data:
- db $FF, 61, PIDGEOT, 59, ALAKAZAM, 61, RHYDON, 61, ARCANINE, 63, EXEGGUTOR, 65, BLASTOISE, 0
- db $FF, 61, PIDGEOT, 59, ALAKAZAM, 61, RHYDON, 61, GYARADOS, 63, ARCANINE, 65, VENUSAUR, 0
- db $FF, 61, PIDGEOT, 59, ALAKAZAM, 61, RHYDON, 61, EXEGGUTOR, 63, GYARADOS, 65, CHARIZARD, 0
+ db $FF, 47, SANDSLASH, 45, EXEGGCUTE, 45, NINETALES, 47, CLOYSTER, 50, KADABRA, 53, JOLTEON, 0
+ db $FF, 47, SANDSLASH, 45, EXEGGCUTE, 45, CLOYSTER, 47, MAGNETON, 50, KADABRA, 53, FLAREON, 0
+ db $FF, 47, SANDSLASH, 45, EXEGGCUTE, 45, MAGNETON, 47, NINETALES, 50, KADABRA, 53, VAPOREON, 0
+
+Rival3Data:
+ db $FF, 61, SANDSLASH, 59, ALAKAZAM, 61, EXEGGUTOR, 61, CLOYSTER, 63, NINETALES, 65, JOLTEON, 0
+ db $FF, 61, SANDSLASH, 59, ALAKAZAM, 61, EXEGGUTOR, 61, MAGNETON, 63, CLOYSTER, 65, FLAREON, 0
+ db $FF, 61, SANDSLASH, 59, ALAKAZAM, 61, EXEGGUTOR, 61, NINETALES, 63, MAGNETON, 65, VAPOREON, 0
LoreleiData:
db $FF, 54, DEWGONG, 53, CLOYSTER, 54, SLOWBRO, 56, JYNX, 56, LAPRAS, 0
diff --git a/data/trainers/special_moves.asm b/data/trainers/special_moves.asm
index b797d1c7..d9c6b893 100644
--- a/data/trainers/special_moves.asm
+++ b/data/trainers/special_moves.asm
@@ -1,25 +1,160 @@
-; unique moves for gym leaders
-; this is not automatic! you have to write the index you want to [wLoneAttackNo]
-; first. e.g., erika's script writes 4 to [wLoneAttackNo] to get mega drain,
-; the fourth entry in the list.
-LoneMoves:
- ; pokemon index, move to give nth pokemon
- db 1, BIDE
- db 1, BUBBLEBEAM
- db 2, THUNDERBOLT
- db 2, MEGA_DRAIN
- db 3, TOXIC
- db 3, PSYWAVE
- db 3, FIRE_BLAST
- db 4, FISSURE
-
-; unique moves for elite 4
-; all trainers in this class are given this move automatically
-; (unrelated to LoneMoves)
-TeamMoves:
- ; trainer, move
- db LORELEI, BLIZZARD
- db BRUNO, FISSURE
- db AGATHA, TOXIC
- db LANCE, BARRIER
+; Yellow entry format:
+; db trainerclass, trainerid
+; repeat { db partymon location, partymon move, move id }
+; db 0
+
+SpecialTrainerMoves:
+ db BUG_CATCHER, 15
+ db 2, 2, TACKLE
+ db 2, 3, STRING_SHOT
+ db 0
+
+ db YOUNGSTER, 14
+ db 1, 4, FISSURE
+ db 0
+
+ db BROCK, 1
+ db 2, 3, BIND
+ db 2, 4, BIDE
+ db 0
+
+ db MISTY, 1
+ db 2, 4, BUBBLEBEAM
+ db 0
+
+ db LT_SURGE, 1
+ db 1, 1, THUNDERBOLT
+ db 1, 2, MEGA_PUNCH
+ db 1, 3, MEGA_KICK
+ db 1, 4, GROWL
+ db 0
+
+ db ERIKA, 1
+ db 1, 3, MEGA_DRAIN
+ db 2, 1, RAZOR_LEAF
+ db 3, 1, PETAL_DANCE
+ db 0
+
+ db KOGA, 1
+ db 1, 1, TOXIC
+ db 1, 2, TACKLE
+ db 2, 1, TOXIC
+ db 2, 3, SUPERSONIC
+ db 3, 1, TOXIC
+ db 3, 2, DOUBLE_EDGE
+ db 4, 1, LEECH_LIFE
+ db 4, 2, DOUBLE_TEAM
+ db 4, 3, PSYCHIC_M
+ db 4, 4, TOXIC
+ db 0
+
+ db BLAINE, 1
+ db 1, 1, FLAMETHROWER
+ db 1, 4, CONFUSE_RAY
+ db 3, 1, FLAMETHROWER
+ db 3, 2, FIRE_BLAST
+ db 3, 3, REFLECT
+ db 0
+
+ db SABRINA, 1
+ db 1, 1, FLASH
+ db 2, 1, KINESIS
+ db 2, 4, PSYWAVE
+ db 3, 1, PSYWAVE
+ db 0
+
+ db GIOVANNI, 3
+ db 1, 3, FISSURE
+ db 2, 2, DOUBLE_TEAM
+ db 3, 1, EARTHQUAKE
+ db 3, 3, THUNDER
+ db 4, 1, EARTHQUAKE
+ db 4, 2, LEER
+ db 4, 3, THUNDER
+ db 5, 1, ROCK_SLIDE
+ db 5, 4, EARTHQUAKE
+ db 0
+
+ db LORELEI, 1
+ db 1, 1, BUBBLEBEAM
+ db 2, 3, ICE_BEAM
+ db 3, 1, PSYCHIC_M
+ db 3, 2, SURF
+ db 4, 3, LOVELY_KISS
+ db 5, 3, BLIZZARD
+ db 0
+
+ db BRUNO, 1
+ db 1, 1, ROCK_SLIDE
+ db 1, 2, SCREECH
+ db 1, 4, DIG
+ db 2, 3, FIRE_PUNCH
+ db 2, 4, DOUBLE_TEAM
+ db 3, 1, DOUBLE_KICK
+ db 3, 2, MEGA_KICK
+ db 3, 4, DOUBLE_TEAM
+ db 4, 1, ROCK_SLIDE
+ db 4, 2, SCREECH
+ db 4, 4, EARTHQUAKE
+ db 5, 2, KARATE_CHOP
+ db 5, 3, STRENGTH
+ db 0
+
+ db AGATHA, 1
+ db 1, 2, SUBSTITUTE
+ db 1, 3, LICK
+ db 1, 4, MEGA_DRAIN
+ db 2, 2, TOXIC
+ db 2, 4, LEECH_LIFE
+ db 3, 2, LICK
+ db 4, 1, WRAP
+ db 5, 2, PSYCHIC_M
+ db 0
+
+ db LANCE, 1
+ db 1, 1, DRAGON_RAGE
+ db 2, 1, THUNDER_WAVE
+ db 2, 3, THUNDERBOLT
+ db 3, 1, BUBBLEBEAM
+ db 3, 2, WRAP
+ db 3, 3, ICE_BEAM
+ db 4, 1, WING_ATTACK
+ db 4, 2, SWIFT
+ db 4, 3, FLY
+ db 5, 1, BLIZZARD
+ db 5, 2, FIRE_BLAST
+ db 5, 3, THUNDER
+ db 0
+
+ db RIVAL3, 1
+ db 1, 3, EARTHQUAKE
+ db 2, 4, KINESIS
+ db 3, 4, LEECH_SEED
+ db 4, 1, ICE_BEAM
+ db 5, 1, CONFUSE_RAY
+ db 5, 4, FIRE_SPIN
+ db 6, 3, QUICK_ATTACK
+ db 0
+
+ db RIVAL3, 2
+ db 1, 3, EARTHQUAKE
+ db 2, 4, KINESIS
+ db 3, 4, LEECH_SEED
+ db 4, 1, THUNDERBOLT
+ db 5, 1, ICE_BEAM
+ db 6, 2, REFLECT
+ db 6, 3, QUICK_ATTACK
+ db 0
+
+ db RIVAL3, 3
+ db 1, 3, EARTHQUAKE
+ db 2, 4, KINESIS
+ db 3, 4, LEECH_SEED
+ db 4, 1, CONFUSE_RAY
+ db 4, 4, FIRE_SPIN
+ db 5, 1, THUNDERBOLT
+ db 6, 1, AURORA_BEAM
+ db 6, 3, QUICK_ATTACK
+ db 0
+
db -1 ; end
diff --git a/data/wild/grass_water.asm b/data/wild/grass_water.asm
index a09fdce6..b9789845 100644
--- a/data/wild/grass_water.asm
+++ b/data/wild/grass_water.asm
@@ -30,8 +30,8 @@ WildDataPointers:
dw Route16WildMons ; ROUTE_16
dw Route17WildMons ; ROUTE_17
dw Route18WildMons ; ROUTE_18
- dw SeaRoutesWildMons ; ROUTE_19
- dw SeaRoutesWildMons ; ROUTE_20
+ dw Route19WildMons ; ROUTE_19
+ dw Route20WildMons ; ROUTE_20
dw Route21WildMons ; ROUTE_21
dw Route22WildMons ; ROUTE_22
dw Route23WildMons ; ROUTE_23
@@ -248,6 +248,7 @@ WildDataPointers:
dw NothingWildMons
dw NothingWildMons
dw NothingWildMons
+ dw NothingWildMons
assert_table_length NUM_MAPS
dw -1 ; end
@@ -301,7 +302,8 @@ INCLUDE "data/wild/maps/SafariZoneCenter.asm"
INCLUDE "data/wild/maps/SafariZoneEast.asm"
INCLUDE "data/wild/maps/SafariZoneNorth.asm"
INCLUDE "data/wild/maps/SafariZoneWest.asm"
-INCLUDE "data/wild/maps/SeaRoutes.asm"
+INCLUDE "data/wild/maps/Route19.asm"
+INCLUDE "data/wild/maps/Route20.asm"
INCLUDE "data/wild/maps/SeafoamIslands1F.asm"
INCLUDE "data/wild/maps/SeafoamIslandsB1F.asm"
INCLUDE "data/wild/maps/SeafoamIslandsB2F.asm"
diff --git a/data/wild/maps/CeruleanCave1F.asm b/data/wild/maps/CeruleanCave1F.asm
index 243f88bb..ce1c35e5 100644
--- a/data/wild/maps/CeruleanCave1F.asm
+++ b/data/wild/maps/CeruleanCave1F.asm
@@ -1,20 +1,15 @@
CeruleanCave1FWildMons:
def_grass_wildmons 10 ; encounter rate
- db 46, GOLBAT
- db 46, HYPNO
- db 46, MAGNETON
- db 49, DODRIO
- db 49, VENOMOTH
-IF DEF(_RED)
- db 52, ARBOK
-ENDC
-IF DEF(_BLUE)
+ db 50, GOLBAT
+ db 55, GOLBAT
+ db 45, GRAVELER
+ db 55, GLOOM
+ db 55, WEEPINBELL
db 52, SANDSLASH
-ENDC
- db 49, KADABRA
- db 52, PARASECT
- db 53, RAICHU
- db 53, DITTO
+ db 54, VENOMOTH
+ db 54, PARASECT
+ db 55, DITTO
+ db 60, DITTO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/CeruleanCave2F.asm b/data/wild/maps/CeruleanCave2F.asm
index 5366fa58..1bd7c206 100644
--- a/data/wild/maps/CeruleanCave2F.asm
+++ b/data/wild/maps/CeruleanCave2F.asm
@@ -1,15 +1,15 @@
CeruleanCave2FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 51, DODRIO
- db 51, VENOMOTH
- db 51, KADABRA
- db 52, RHYDON
- db 52, MAROWAK
- db 52, ELECTRODE
- db 56, CHANSEY
- db 54, WIGGLYTUFF
- db 55, DITTO
+ db 52, GOLBAT
+ db 57, GOLBAT
+ db 50, GRAVELER
+ db 56, SANDSLASH
+ db 50, RHYHORN
db 60, DITTO
+ db 58, GLOOM
+ db 58, WEEPINBELL
+ db 60, RHYDON
+ db 58, RHYDON
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/CeruleanCaveB1F.asm b/data/wild/maps/CeruleanCaveB1F.asm
index a1889041..a90882ad 100644
--- a/data/wild/maps/CeruleanCaveB1F.asm
+++ b/data/wild/maps/CeruleanCaveB1F.asm
@@ -1,20 +1,15 @@
CeruleanCaveB1FWildMons:
def_grass_wildmons 25 ; encounter rate
- db 55, RHYDON
- db 55, MAROWAK
- db 55, ELECTRODE
- db 64, CHANSEY
- db 64, PARASECT
- db 64, RAICHU
-IF DEF(_RED)
- db 57, ARBOK
-ENDC
-IF DEF(_BLUE)
- db 57, SANDSLASH
-ENDC
+ db 54, GOLBAT
+ db 59, GOLBAT
+ db 55, GRAVELER
+ db 52, RHYHORN
+ db 62, RHYDON
+ db 60, DITTO
+ db 56, CHANSEY
db 65, DITTO
- db 63, DITTO
- db 67, DITTO
+ db 55, LICKITUNG
+ db 50, LICKITUNG
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/MtMoon1F.asm b/data/wild/maps/MtMoon1F.asm
index a62f9817..717ce078 100644
--- a/data/wild/maps/MtMoon1F.asm
+++ b/data/wild/maps/MtMoon1F.asm
@@ -1,15 +1,15 @@
MtMoon1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 8, ZUBAT
- db 7, ZUBAT
db 9, ZUBAT
- db 8, GEODUDE
+ db 10, GEODUDE
db 6, ZUBAT
+ db 7, ZUBAT
db 10, ZUBAT
db 10, GEODUDE
- db 8, PARAS
db 11, ZUBAT
- db 8, CLEFAIRY
+ db 12, SANDSHREW
+ db 11, CLEFAIRY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/MtMoonB1F.asm b/data/wild/maps/MtMoonB1F.asm
index 85645fbe..5683eac2 100644
--- a/data/wild/maps/MtMoonB1F.asm
+++ b/data/wild/maps/MtMoonB1F.asm
@@ -1,15 +1,15 @@
MtMoonB1FWildMons:
def_grass_wildmons 10 ; encounter rate
db 8, ZUBAT
- db 7, ZUBAT
- db 7, GEODUDE
- db 8, GEODUDE
db 9, ZUBAT
- db 10, PARAS
db 10, ZUBAT
+ db 10, GEODUDE
+ db 11, GEODUDE
db 11, ZUBAT
- db 9, CLEFAIRY
- db 9, GEODUDE
+ db 9, PARAS
+ db 11, PARAS
+ db 10, CLEFAIRY
+ db 12, CLEFAIRY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/MtMoonB2F.asm b/data/wild/maps/MtMoonB2F.asm
index 2e845ce3..a89422bb 100644
--- a/data/wild/maps/MtMoonB2F.asm
+++ b/data/wild/maps/MtMoonB2F.asm
@@ -1,15 +1,15 @@
MtMoonB2FWildMons:
def_grass_wildmons 10 ; encounter rate
- db 9, ZUBAT
- db 9, GEODUDE
db 10, ZUBAT
- db 10, GEODUDE
+ db 11, GEODUDE
+ db 13, PARAS
+ db 11, ZUBAT
db 11, ZUBAT
- db 10, PARAS
- db 12, PARAS
- db 10, CLEFAIRY
db 12, ZUBAT
- db 12, CLEFAIRY
+ db 13, ZUBAT
+ db 9, CLEFAIRY
+ db 11, CLEFAIRY
+ db 13, CLEFAIRY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonMansion1F.asm b/data/wild/maps/PokemonMansion1F.asm
index 61f4262e..de6b7cb0 100644
--- a/data/wild/maps/PokemonMansion1F.asm
+++ b/data/wild/maps/PokemonMansion1F.asm
@@ -1,29 +1,15 @@
PokemonMansion1FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 32, KOFFING
- db 30, KOFFING
- db 34, PONYTA
- db 30, PONYTA
+ db 34, RATTATA
+ db 34, RATICATE
+ db 23, GRIMER
+ db 26, GROWLITHE
+ db 37, RATTATA
+ db 37, RATICATE
+ db 30, GROWLITHE
+ db 26, GRIMER
db 34, GROWLITHE
- db 32, PONYTA
- db 30, GRIMER
- db 28, PONYTA
- db 37, WEEZING
- db 39, MUK
-ENDC
-IF DEF(_BLUE)
- db 32, GRIMER
- db 30, GRIMER
- db 34, PONYTA
- db 30, PONYTA
- db 34, VULPIX
- db 32, PONYTA
- db 30, KOFFING
- db 28, PONYTA
- db 37, MUK
- db 39, WEEZING
-ENDC
+ db 38, GROWLITHE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonMansion2F.asm b/data/wild/maps/PokemonMansion2F.asm
index c98d3bf3..1cfb0b8b 100644
--- a/data/wild/maps/PokemonMansion2F.asm
+++ b/data/wild/maps/PokemonMansion2F.asm
@@ -1,29 +1,15 @@
PokemonMansion2FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 32, GROWLITHE
- db 34, KOFFING
- db 34, KOFFING
- db 30, PONYTA
- db 30, KOFFING
- db 32, PONYTA
- db 30, GRIMER
- db 28, PONYTA
- db 39, WEEZING
- db 37, MUK
-ENDC
-IF DEF(_BLUE)
- db 32, VULPIX
- db 34, GRIMER
- db 34, GRIMER
- db 30, PONYTA
- db 30, GRIMER
- db 32, PONYTA
- db 30, KOFFING
- db 28, PONYTA
- db 39, MUK
- db 37, WEEZING
-ENDC
+ db 37, RATTATA
+ db 37, RATICATE
+ db 26, GRIMER
+ db 29, GRIMER
+ db 40, RATTATA
+ db 40, RATICATE
+ db 32, GRIMER
+ db 35, GRIMER
+ db 35, MUK
+ db 38, MUK
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonMansion3F.asm b/data/wild/maps/PokemonMansion3F.asm
index a707687f..05a8be23 100644
--- a/data/wild/maps/PokemonMansion3F.asm
+++ b/data/wild/maps/PokemonMansion3F.asm
@@ -1,29 +1,15 @@
PokemonMansion3FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 31, KOFFING
- db 33, GROWLITHE
- db 35, KOFFING
- db 32, PONYTA
- db 34, PONYTA
- db 40, WEEZING
- db 34, GRIMER
- db 38, WEEZING
- db 36, PONYTA
- db 42, MUK
-ENDC
-IF DEF(_BLUE)
- db 31, GRIMER
- db 33, VULPIX
+ db 40, RATTATA
+ db 40, RATICATE
+ db 32, GRIMER
db 35, GRIMER
- db 32, PONYTA
- db 34, MAGMAR
- db 40, MUK
- db 34, KOFFING
+ db 43, RATTATA
+ db 43, RATICATE
+ db 38, GRIMER
+ db 38, GRIMER
db 38, MUK
- db 36, PONYTA
- db 42, WEEZING
-ENDC
+ db 41, MUK
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonMansionB1F.asm b/data/wild/maps/PokemonMansionB1F.asm
index 767038c6..627f1b4d 100644
--- a/data/wild/maps/PokemonMansionB1F.asm
+++ b/data/wild/maps/PokemonMansionB1F.asm
@@ -1,29 +1,15 @@
PokemonMansionB1FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 33, KOFFING
- db 31, KOFFING
- db 35, GROWLITHE
- db 32, PONYTA
- db 31, KOFFING
- db 40, WEEZING
- db 34, PONYTA
db 35, GRIMER
- db 42, WEEZING
- db 42, MUK
-ENDC
-IF DEF(_BLUE)
- db 33, GRIMER
- db 31, GRIMER
- db 35, VULPIX
- db 32, PONYTA
- db 31, GRIMER
- db 40, MUK
- db 34, PONYTA
- db 35, KOFFING
- db 38, MAGMAR
- db 42, WEEZING
-ENDC
+ db 38, GRIMER
+ db 37, RATICATE
+ db 40, RATICATE
+ db 41, MUK
+ db 43, RATICATE
+ db 24, DITTO
+ db 46, RATICATE
+ db 18, DITTO
+ db 12, DITTO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonTower3F.asm b/data/wild/maps/PokemonTower3F.asm
index 0d4440cb..d98c9cd8 100644
--- a/data/wild/maps/PokemonTower3F.asm
+++ b/data/wild/maps/PokemonTower3F.asm
@@ -4,11 +4,11 @@ PokemonTower3FWildMons:
db 21, GASTLY
db 22, GASTLY
db 23, GASTLY
+ db 24, GASTLY
db 19, GASTLY
db 18, GASTLY
- db 24, GASTLY
- db 20, CUBONE
- db 22, CUBONE
+ db 25, GASTLY
+ db 20, HAUNTER
db 25, HAUNTER
end_grass_wildmons
diff --git a/data/wild/maps/PokemonTower4F.asm b/data/wild/maps/PokemonTower4F.asm
index de278221..1e5ccca6 100644
--- a/data/wild/maps/PokemonTower4F.asm
+++ b/data/wild/maps/PokemonTower4F.asm
@@ -4,12 +4,12 @@ PokemonTower4FWildMons:
db 21, GASTLY
db 22, GASTLY
db 23, GASTLY
+ db 24, GASTLY
db 19, GASTLY
db 18, GASTLY
+ db 25, GASTLY
+ db 20, HAUNTER
db 25, HAUNTER
- db 20, CUBONE
- db 22, CUBONE
- db 24, GASTLY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonTower5F.asm b/data/wild/maps/PokemonTower5F.asm
index 507dba26..3426333e 100644
--- a/data/wild/maps/PokemonTower5F.asm
+++ b/data/wild/maps/PokemonTower5F.asm
@@ -1,15 +1,15 @@
PokemonTower5FWildMons:
- def_grass_wildmons 10 ; encounter rate
- db 20, GASTLY
- db 21, GASTLY
+ def_grass_wildmons 15 ; encounter rate
db 22, GASTLY
db 23, GASTLY
- db 19, GASTLY
- db 18, GASTLY
- db 25, HAUNTER
- db 20, CUBONE
- db 22, CUBONE
db 24, GASTLY
+ db 25, GASTLY
+ db 26, GASTLY
+ db 21, GASTLY
+ db 20, CUBONE
+ db 27, GASTLY
+ db 22, HAUNTER
+ db 27, HAUNTER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonTower6F.asm b/data/wild/maps/PokemonTower6F.asm
index f0197631..6b7bd1e2 100644
--- a/data/wild/maps/PokemonTower6F.asm
+++ b/data/wild/maps/PokemonTower6F.asm
@@ -1,15 +1,15 @@
PokemonTower6FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 21, GASTLY
db 22, GASTLY
db 23, GASTLY
db 24, GASTLY
- db 20, GASTLY
- db 19, GASTLY
- db 26, HAUNTER
+ db 25, GASTLY
+ db 26, GASTLY
+ db 21, GASTLY
db 22, CUBONE
- db 24, CUBONE
- db 28, HAUNTER
+ db 27, GASTLY
+ db 22, HAUNTER
+ db 27, HAUNTER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PokemonTower7F.asm b/data/wild/maps/PokemonTower7F.asm
index 2b3d952b..91a9dfea 100644
--- a/data/wild/maps/PokemonTower7F.asm
+++ b/data/wild/maps/PokemonTower7F.asm
@@ -1,15 +1,15 @@
PokemonTower7FWildMons:
- def_grass_wildmons 15 ; encounter rate
- db 21, GASTLY
- db 22, GASTLY
- db 23, GASTLY
+ def_grass_wildmons 20 ; encounter rate
db 24, GASTLY
- db 20, GASTLY
- db 28, HAUNTER
- db 22, CUBONE
+ db 25, GASTLY
+ db 26, GASTLY
+ db 27, GASTLY
+ db 28, GASTLY
+ db 23, GASTLY
db 24, CUBONE
- db 28, HAUNTER
- db 30, HAUNTER
+ db 29, GASTLY
+ db 24, HAUNTER
+ db 29, HAUNTER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/PowerPlant.asm b/data/wild/maps/PowerPlant.asm
index 60b5d420..db61a702 100644
--- a/data/wild/maps/PowerPlant.asm
+++ b/data/wild/maps/PowerPlant.asm
@@ -1,21 +1,15 @@
PowerPlantWildMons:
def_grass_wildmons 10 ; encounter rate
- db 21, VOLTORB
- db 21, MAGNEMITE
- db 20, PIKACHU
- db 24, PIKACHU
- db 23, MAGNEMITE
- db 23, VOLTORB
- db 32, MAGNETON
- db 35, MAGNETON
-IF DEF(_RED)
- db 33, ELECTABUZZ
- db 36, ELECTABUZZ
-ENDC
-IF DEF(_BLUE)
- db 33, RAICHU
- db 36, RAICHU
-ENDC
+ db 30, MAGNEMITE
+ db 35, MAGNEMITE
+ db 33, MAGNETON
+ db 33, VOLTORB
+ db 37, VOLTORB
+ db 33, GRIMER
+ db 37, GRIMER
+ db 38, MAGNETON
+ db 33, MUK
+ db 37, MUK
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/RockTunnel1F.asm b/data/wild/maps/RockTunnel1F.asm
index 6ca947c0..65e85e40 100644
--- a/data/wild/maps/RockTunnel1F.asm
+++ b/data/wild/maps/RockTunnel1F.asm
@@ -1,15 +1,15 @@
RockTunnel1FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 16, ZUBAT
- db 17, ZUBAT
- db 17, GEODUDE
- db 15, MACHOP
- db 16, GEODUDE
- db 18, ZUBAT
db 15, ZUBAT
+ db 16, GEODUDE
+ db 17, ZUBAT
+ db 19, ZUBAT
+ db 18, GEODUDE
+ db 20, GEODUDE
+ db 21, ZUBAT
db 17, MACHOP
- db 13, ONIX
- db 15, ONIX
+ db 19, MACHOP
+ db 21, MACHOP
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/RockTunnelB1F.asm b/data/wild/maps/RockTunnelB1F.asm
index 4edd716c..7937b574 100644
--- a/data/wild/maps/RockTunnelB1F.asm
+++ b/data/wild/maps/RockTunnelB1F.asm
@@ -1,15 +1,15 @@
RockTunnelB1FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 16, ZUBAT
- db 17, ZUBAT
+ db 20, ZUBAT
db 17, GEODUDE
- db 15, MACHOP
- db 16, GEODUDE
- db 18, ZUBAT
- db 17, MACHOP
- db 17, ONIX
- db 13, ONIX
- db 18, GEODUDE
+ db 18, MACHOP
+ db 21, ZUBAT
+ db 22, ZUBAT
+ db 21, GEODUDE
+ db 20, MACHOP
+ db 14, ONIX
+ db 18, ONIX
+ db 22, ONIX
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route1.asm b/data/wild/maps/Route1.asm
index a9ed6a4a..75069cb5 100644
--- a/data/wild/maps/Route1.asm
+++ b/data/wild/maps/Route1.asm
@@ -1,15 +1,15 @@
Route1WildMons:
def_grass_wildmons 25 ; encounter rate
db 3, PIDGEY
- db 3, RATTATA
- db 3, RATTATA
+ db 4, PIDGEY
db 2, RATTATA
+ db 3, RATTATA
db 2, PIDGEY
db 3, PIDGEY
- db 3, PIDGEY
- db 4, RATTATA
- db 4, PIDGEY
db 5, PIDGEY
+ db 4, RATTATA
+ db 6, PIDGEY
+ db 7, PIDGEY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route10.asm b/data/wild/maps/Route10.asm
index f2d1b8f6..b48a1ebb 100644
--- a/data/wild/maps/Route10.asm
+++ b/data/wild/maps/Route10.asm
@@ -1,26 +1,15 @@
Route10WildMons:
def_grass_wildmons 15 ; encounter rate
- db 16, VOLTORB
- db 16, SPEAROW
- db 14, VOLTORB
-IF DEF(_RED)
- db 11, EKANS
- db 13, SPEAROW
- db 15, EKANS
- db 17, VOLTORB
- db 17, SPEAROW
- db 13, EKANS
- db 17, EKANS
-ENDC
-IF DEF(_BLUE)
- db 11, SANDSHREW
- db 13, SPEAROW
- db 15, SANDSHREW
- db 17, VOLTORB
- db 17, SPEAROW
- db 13, SANDSHREW
- db 17, SANDSHREW
-ENDC
+ db 16, MAGNEMITE
+ db 18, RATTATA
+ db 18, MAGNEMITE
+ db 20, MAGNEMITE
+ db 17, NIDORAN_M
+ db 17, NIDORAN_F
+ db 22, MAGNEMITE
+ db 20, RATICATE
+ db 16, MACHOP
+ db 18, MACHOP
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route11.asm b/data/wild/maps/Route11.asm
index 87cf94fa..70b2f465 100644
--- a/data/wild/maps/Route11.asm
+++ b/data/wild/maps/Route11.asm
@@ -1,26 +1,15 @@
Route11WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 14, EKANS
- db 15, SPEAROW
- db 12, EKANS
- db 9, DROWZEE
- db 13, SPEAROW
- db 13, DROWZEE
- db 15, EKANS
-ENDC
-IF DEF(_BLUE)
- db 14, SANDSHREW
- db 15, SPEAROW
- db 12, SANDSHREW
- db 9, DROWZEE
- db 13, SPEAROW
- db 13, DROWZEE
- db 15, SANDSHREW
-ENDC
- db 17, SPEAROW
- db 11, DROWZEE
+ db 16, PIDGEY
+ db 15, RATTATA
+ db 18, PIDGEY
db 15, DROWZEE
+ db 17, RATTATA
+ db 17, DROWZEE
+ db 18, PIDGEOTTO
+ db 20, PIDGEOTTO
+ db 19, DROWZEE
+ db 17, RATICATE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route12.asm b/data/wild/maps/Route12.asm
index 4c9388d3..6852d91f 100644
--- a/data/wild/maps/Route12.asm
+++ b/data/wild/maps/Route12.asm
@@ -1,30 +1,26 @@
Route12WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 24, ODDISH
- db 25, PIDGEY
- db 23, PIDGEY
- db 24, VENONAT
- db 22, ODDISH
- db 26, VENONAT
- db 26, ODDISH
- db 27, PIDGEY
- db 28, GLOOM
- db 30, GLOOM
-ENDC
-IF DEF(_BLUE)
- db 24, BELLSPROUT
- db 25, PIDGEY
- db 23, PIDGEY
- db 24, VENONAT
- db 22, BELLSPROUT
- db 26, VENONAT
- db 26, BELLSPROUT
- db 27, PIDGEY
- db 28, WEEPINBELL
- db 30, WEEPINBELL
-ENDC
+ db 25, ODDISH
+ db 25, BELLSPROUT
+ db 28, PIDGEY
+ db 28, PIDGEOTTO
+ db 27, ODDISH
+ db 27, BELLSPROUT
+ db 29, GLOOM
+ db 29, WEEPINBELL
+ db 26, FARFETCHD
+ db 31, FARFETCHD
end_grass_wildmons
- def_water_wildmons 0 ; encounter rate
+ def_water_wildmons 3 ; encounter rate
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWBRO
+ db 20, SLOWBRO
end_water_wildmons
diff --git a/data/wild/maps/Route13.asm b/data/wild/maps/Route13.asm
index c6196233..6a46ab12 100644
--- a/data/wild/maps/Route13.asm
+++ b/data/wild/maps/Route13.asm
@@ -1,30 +1,26 @@
Route13WildMons:
- def_grass_wildmons 20 ; encounter rate
-IF DEF(_RED)
- db 24, ODDISH
- db 25, PIDGEY
- db 27, PIDGEY
- db 24, VENONAT
- db 22, ODDISH
- db 26, VENONAT
- db 26, ODDISH
- db 25, DITTO
- db 28, GLOOM
- db 30, GLOOM
-ENDC
-IF DEF(_BLUE)
- db 24, BELLSPROUT
- db 25, PIDGEY
- db 27, PIDGEY
- db 24, VENONAT
- db 22, BELLSPROUT
- db 26, VENONAT
- db 26, BELLSPROUT
- db 25, DITTO
- db 28, WEEPINBELL
- db 30, WEEPINBELL
-ENDC
+ def_grass_wildmons 15 ; encounter rate
+ db 25, ODDISH
+ db 25, BELLSPROUT
+ db 28, PIDGEOTTO
+ db 28, PIDGEY
+ db 27, ODDISH
+ db 27, BELLSPROUT
+ db 29, GLOOM
+ db 29, WEEPINBELL
+ db 26, FARFETCHD
+ db 31, FARFETCHD
end_grass_wildmons
- def_water_wildmons 0 ; encounter rate
+ def_water_wildmons 3 ; encounter rate
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWPOKE
+ db 15, SLOWBRO
+ db 20, SLOWBRO
end_water_wildmons
diff --git a/data/wild/maps/Route14.asm b/data/wild/maps/Route14.asm
index dbc218fb..b49572b1 100644
--- a/data/wild/maps/Route14.asm
+++ b/data/wild/maps/Route14.asm
@@ -1,27 +1,15 @@
Route14WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 24, ODDISH
- db 26, PIDGEY
- db 23, DITTO
- db 24, VENONAT
- db 22, ODDISH
- db 26, VENONAT
db 26, ODDISH
- db 30, GLOOM
-ENDC
-IF DEF(_BLUE)
- db 24, BELLSPROUT
- db 26, PIDGEY
- db 23, DITTO
- db 24, VENONAT
- db 22, BELLSPROUT
- db 26, VENONAT
db 26, BELLSPROUT
- db 30, WEEPINBELL
-ENDC
- db 28, PIDGEOTTO
+ db 24, VENONAT
db 30, PIDGEOTTO
+ db 28, ODDISH
+ db 28, BELLSPROUT
+ db 30, GLOOM
+ db 30, WEEPINBELL
+ db 27, VENONAT
+ db 30, VENOMOTH
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route15.asm b/data/wild/maps/Route15.asm
index c437a97d..08d0851d 100644
--- a/data/wild/maps/Route15.asm
+++ b/data/wild/maps/Route15.asm
@@ -1,27 +1,15 @@
Route15WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 24, ODDISH
- db 26, DITTO
- db 23, PIDGEY
- db 26, VENONAT
- db 22, ODDISH
- db 28, VENONAT
db 26, ODDISH
- db 30, GLOOM
-ENDC
-IF DEF(_BLUE)
- db 24, BELLSPROUT
- db 26, DITTO
- db 23, PIDGEY
- db 26, VENONAT
- db 22, BELLSPROUT
- db 28, VENONAT
db 26, BELLSPROUT
+ db 24, VENONAT
+ db 32, PIDGEOTTO
+ db 28, ODDISH
+ db 28, BELLSPROUT
+ db 30, GLOOM
db 30, WEEPINBELL
-ENDC
- db 28, PIDGEOTTO
- db 30, PIDGEOTTO
+ db 27, VENONAT
+ db 30, VENOMOTH
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route16.asm b/data/wild/maps/Route16.asm
index 15ef2bf1..b9863b02 100644
--- a/data/wild/maps/Route16.asm
+++ b/data/wild/maps/Route16.asm
@@ -1,15 +1,15 @@
Route16WildMons:
def_grass_wildmons 25 ; encounter rate
- db 20, SPEAROW
db 22, SPEAROW
- db 18, RATTATA
- db 20, DODUO
- db 20, RATTATA
- db 18, DODUO
db 22, DODUO
- db 22, RATTATA
- db 23, RATICATE
+ db 23, RATTATA
+ db 24, DODUO
+ db 24, RATTATA
+ db 26, DODUO
+ db 23, SPEAROW
+ db 24, FEAROW
db 25, RATICATE
+ db 26, RATICATE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route17.asm b/data/wild/maps/Route17.asm
index b3b2b672..e6e14573 100644
--- a/data/wild/maps/Route17.asm
+++ b/data/wild/maps/Route17.asm
@@ -1,15 +1,15 @@
Route17WildMons:
def_grass_wildmons 25 ; encounter rate
- db 20, SPEAROW
- db 22, SPEAROW
- db 25, RATICATE
- db 24, DODUO
- db 27, RATICATE
db 26, DODUO
- db 28, DODUO
- db 29, RATICATE
- db 25, FEAROW
db 27, FEAROW
+ db 27, DODUO
+ db 28, DODUO
+ db 28, PONYTA
+ db 30, PONYTA
+ db 29, FEAROW
+ db 28, DODUO
+ db 32, PONYTA
+ db 29, DODRIO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route18.asm b/data/wild/maps/Route18.asm
index d2a1269a..b5929692 100644
--- a/data/wild/maps/Route18.asm
+++ b/data/wild/maps/Route18.asm
@@ -1,15 +1,15 @@
Route18WildMons:
def_grass_wildmons 25 ; encounter rate
- db 20, SPEAROW
db 22, SPEAROW
- db 25, RATICATE
+ db 22, DODUO
+ db 23, RATTATA
db 24, DODUO
- db 25, FEAROW
+ db 24, RATTATA
db 26, DODUO
- db 28, DODUO
- db 29, RATICATE
- db 27, FEAROW
- db 29, FEAROW
+ db 23, SPEAROW
+ db 24, FEAROW
+ db 25, RATICATE
+ db 26, RATICATE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SeaRoutes.asm b/data/wild/maps/Route19.asm
index 7ec50889..81ada961 100644
--- a/data/wild/maps/SeaRoutes.asm
+++ b/data/wild/maps/Route19.asm
@@ -1,4 +1,4 @@
-SeaRoutesWildMons:
+Route19WildMons:
def_grass_wildmons 0 ; encounter rate
end_grass_wildmons
diff --git a/data/wild/maps/Route2.asm b/data/wild/maps/Route2.asm
index 9ec6d912..bb591fa7 100644
--- a/data/wild/maps/Route2.asm
+++ b/data/wild/maps/Route2.asm
@@ -2,23 +2,14 @@ Route2WildMons:
def_grass_wildmons 25 ; encounter rate
db 3, RATTATA
db 3, PIDGEY
- db 4, PIDGEY
db 4, RATTATA
+ db 4, NIDORAN_M
+ db 4, NIDORAN_F
db 5, PIDGEY
-IF DEF(_RED)
- db 3, WEEDLE
- db 2, RATTATA
- db 5, RATTATA
- db 4, WEEDLE
- db 5, WEEDLE
-ENDC
-IF DEF(_BLUE)
- db 3, CATERPIE
- db 2, RATTATA
- db 5, RATTATA
- db 4, CATERPIE
- db 5, CATERPIE
-ENDC
+ db 6, NIDORAN_M
+ db 6, NIDORAN_F
+ db 7, PIDGEY
+ db 7, PIDGEY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route20.asm b/data/wild/maps/Route20.asm
new file mode 100644
index 00000000..e1d17955
--- /dev/null
+++ b/data/wild/maps/Route20.asm
@@ -0,0 +1,16 @@
+Route20WildMons:
+ def_grass_wildmons 0 ; encounter rate
+ end_grass_wildmons
+
+ def_water_wildmons 5 ; encounter rate
+ db 5, TENTACOOL
+ db 10, TENTACOOL
+ db 15, TENTACOOL
+ db 5, TENTACOOL
+ db 10, TENTACOOL
+ db 15, TENTACOOL
+ db 20, TENTACOOL
+ db 30, TENTACOOL
+ db 35, TENTACOOL
+ db 40, TENTACOOL
+ end_water_wildmons
diff --git a/data/wild/maps/Route21.asm b/data/wild/maps/Route21.asm
index 99cddd60..32dc50ee 100644
--- a/data/wild/maps/Route21.asm
+++ b/data/wild/maps/Route21.asm
@@ -1,15 +1,15 @@
Route21WildMons:
def_grass_wildmons 25 ; encounter rate
- db 21, RATTATA
- db 23, PIDGEY
- db 30, RATICATE
- db 23, RATTATA
- db 21, PIDGEY
- db 30, PIDGEOTTO
- db 32, PIDGEOTTO
- db 28, TANGELA
- db 30, TANGELA
- db 32, TANGELA
+ db 15, PIDGEY
+ db 13, RATTATA
+ db 13, PIDGEY
+ db 11, PIDGEY
+ db 17, PIDGEY
+ db 15, RATTATA
+ db 15, RATICATE
+ db 17, PIDGEOTTO
+ db 19, PIDGEOTTO
+ db 15, PIDGEOTTO
end_grass_wildmons
def_water_wildmons 5 ; encounter rate
diff --git a/data/wild/maps/Route22.asm b/data/wild/maps/Route22.asm
index 49e95bc9..b40e5bb4 100644
--- a/data/wild/maps/Route22.asm
+++ b/data/wild/maps/Route22.asm
@@ -1,28 +1,15 @@
Route22WildMons:
def_grass_wildmons 25 ; encounter rate
- db 3, RATTATA
-IF DEF(_RED)
- db 3, NIDORAN_M
- db 4, RATTATA
- db 4, NIDORAN_M
- db 2, RATTATA
db 2, NIDORAN_M
- db 3, SPEAROW
- db 5, SPEAROW
- db 3, NIDORAN_F
- db 4, NIDORAN_F
-ENDC
-IF DEF(_BLUE)
- db 3, NIDORAN_F
- db 4, RATTATA
- db 4, NIDORAN_F
- db 2, RATTATA
db 2, NIDORAN_F
- db 3, SPEAROW
- db 5, SPEAROW
- db 3, NIDORAN_M
+ db 3, MANKEY
+ db 3, RATTATA
db 4, NIDORAN_M
-ENDC
+ db 4, NIDORAN_F
+ db 5, MANKEY
+ db 2, SPEAROW
+ db 4, SPEAROW
+ db 6, SPEAROW
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route23.asm b/data/wild/maps/Route23.asm
index a2cde010..beaea051 100644
--- a/data/wild/maps/Route23.asm
+++ b/data/wild/maps/Route23.asm
@@ -1,25 +1,15 @@
Route23WildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 26, EKANS
-ENDC
-IF DEF(_BLUE)
- db 26, SANDSHREW
-ENDC
- db 33, DITTO
- db 26, SPEAROW
- db 38, FEAROW
- db 38, DITTO
- db 38, FEAROW
-IF DEF(_RED)
- db 41, ARBOK
-ENDC
-IF DEF(_BLUE)
- db 41, SANDSLASH
-ENDC
- db 43, DITTO
- db 41, FEAROW
- db 43, FEAROW
+ db 41, NIDORINO
+ db 41, NIDORINA
+ db 36, MANKEY
+ db 44, NIDORINO
+ db 44, NIDORINA
+ db 40, FEAROW
+ db 41, MANKEY
+ db 45, FEAROW
+ db 41, PRIMEAPE
+ db 46, PRIMEAPE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route24.asm b/data/wild/maps/Route24.asm
index 3c06d810..2703ff20 100644
--- a/data/wild/maps/Route24.asm
+++ b/data/wild/maps/Route24.asm
@@ -1,26 +1,15 @@
Route24WildMons:
def_grass_wildmons 25 ; encounter rate
-IF DEF(_RED)
- db 7, WEEDLE
- db 8, KAKUNA
- db 12, PIDGEY
db 12, ODDISH
- db 13, ODDISH
- db 10, ABRA
- db 14, ODDISH
-ENDC
-IF DEF(_BLUE)
- db 7, CATERPIE
- db 8, METAPOD
- db 12, PIDGEY
db 12, BELLSPROUT
- db 13, BELLSPROUT
- db 10, ABRA
- db 14, BELLSPROUT
-ENDC
db 13, PIDGEY
- db 8, ABRA
- db 12, ABRA
+ db 14, ODDISH
+ db 14, BELLSPROUT
+ db 15, PIDGEY
+ db 13, VENONAT
+ db 16, VENONAT
+ db 17, PIDGEY
+ db 17, PIDGEOTTO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route25.asm b/data/wild/maps/Route25.asm
index 9c59549f..c129a116 100644
--- a/data/wild/maps/Route25.asm
+++ b/data/wild/maps/Route25.asm
@@ -1,29 +1,15 @@
Route25WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 8, WEEDLE
- db 9, KAKUNA
- db 13, PIDGEY
db 12, ODDISH
- db 13, ODDISH
- db 12, ABRA
- db 14, ODDISH
- db 10, ABRA
- db 7, METAPOD
- db 8, CATERPIE
-ENDC
-IF DEF(_BLUE)
- db 8, CATERPIE
- db 9, METAPOD
- db 13, PIDGEY
db 12, BELLSPROUT
- db 13, BELLSPROUT
- db 12, ABRA
+ db 13, PIDGEY
+ db 14, ODDISH
db 14, BELLSPROUT
- db 10, ABRA
- db 7, KAKUNA
- db 8, WEEDLE
-ENDC
+ db 15, PIDGEY
+ db 13, VENONAT
+ db 16, VENONAT
+ db 17, PIDGEY
+ db 17, PIDGEOTTO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route3.asm b/data/wild/maps/Route3.asm
index 9a78dba7..fc975478 100644
--- a/data/wild/maps/Route3.asm
+++ b/data/wild/maps/Route3.asm
@@ -1,15 +1,15 @@
Route3WildMons:
def_grass_wildmons 20 ; encounter rate
- db 6, PIDGEY
- db 5, SPEAROW
- db 7, PIDGEY
- db 6, SPEAROW
- db 7, SPEAROW
- db 8, PIDGEY
db 8, SPEAROW
- db 3, JIGGLYPUFF
- db 5, JIGGLYPUFF
- db 7, JIGGLYPUFF
+ db 9, SPEAROW
+ db 9, MANKEY
+ db 10, SPEAROW
+ db 8, SANDSHREW
+ db 10, RATTATA
+ db 10, SANDSHREW
+ db 12, RATTATA
+ db 11, SPEAROW
+ db 12, SPEAROW
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route4.asm b/data/wild/maps/Route4.asm
index c4f1f536..6c94a750 100644
--- a/data/wild/maps/Route4.asm
+++ b/data/wild/maps/Route4.asm
@@ -1,26 +1,15 @@
Route4WildMons:
def_grass_wildmons 20 ; encounter rate
- db 10, RATTATA
- db 10, SPEAROW
- db 8, RATTATA
-IF DEF(_RED)
- db 6, EKANS
- db 8, SPEAROW
- db 10, EKANS
- db 12, RATTATA
- db 12, SPEAROW
- db 8, EKANS
- db 12, EKANS
-ENDC
-IF DEF(_BLUE)
- db 6, SANDSHREW
db 8, SPEAROW
+ db 9, SPEAROW
+ db 9, MANKEY
+ db 10, SPEAROW
+ db 8, SANDSHREW
+ db 10, RATTATA
db 10, SANDSHREW
db 12, RATTATA
+ db 11, SPEAROW
db 12, SPEAROW
- db 8, SANDSHREW
- db 12, SANDSHREW
-ENDC
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route5.asm b/data/wild/maps/Route5.asm
index 3af2ebd9..a3c8c2c5 100644
--- a/data/wild/maps/Route5.asm
+++ b/data/wild/maps/Route5.asm
@@ -1,29 +1,15 @@
Route5WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 13, ODDISH
- db 13, PIDGEY
db 15, PIDGEY
- db 10, MANKEY
- db 12, MANKEY
- db 15, ODDISH
- db 16, ODDISH
+ db 14, RATTATA
+ db 7, ABRA
db 16, PIDGEY
- db 14, MANKEY
- db 16, MANKEY
-ENDC
-IF DEF(_BLUE)
- db 13, BELLSPROUT
- db 13, PIDGEY
- db 15, PIDGEY
- db 10, MEOWTH
- db 12, MEOWTH
- db 15, BELLSPROUT
- db 16, BELLSPROUT
- db 16, PIDGEY
- db 14, MEOWTH
- db 16, MEOWTH
-ENDC
+ db 16, RATTATA
+ db 17, PIDGEY
+ db 17, PIDGEOTTO
+ db 3, JIGGLYPUFF
+ db 5, JIGGLYPUFF
+ db 7, JIGGLYPUFF
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route6.asm b/data/wild/maps/Route6.asm
index 593e890b..44e83011 100644
--- a/data/wild/maps/Route6.asm
+++ b/data/wild/maps/Route6.asm
@@ -1,30 +1,26 @@
Route6WildMons:
def_grass_wildmons 15 ; encounter rate
-IF DEF(_RED)
- db 13, ODDISH
- db 13, PIDGEY
db 15, PIDGEY
- db 10, MANKEY
- db 12, MANKEY
- db 15, ODDISH
- db 16, ODDISH
+ db 14, RATTATA
+ db 7, ABRA
db 16, PIDGEY
- db 14, MANKEY
- db 16, MANKEY
-ENDC
-IF DEF(_BLUE)
- db 13, BELLSPROUT
- db 13, PIDGEY
- db 15, PIDGEY
- db 10, MEOWTH
- db 12, MEOWTH
- db 15, BELLSPROUT
- db 16, BELLSPROUT
- db 16, PIDGEY
- db 14, MEOWTH
- db 16, MEOWTH
-ENDC
+ db 16, RATTATA
+ db 17, PIDGEY
+ db 17, PIDGEOTTO
+ db 3, JIGGLYPUFF
+ db 5, JIGGLYPUFF
+ db 7, JIGGLYPUFF
end_grass_wildmons
- def_water_wildmons 0 ; encounter rate
+ def_water_wildmons 3 ; encounter rate
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, PSYDUCK
+ db 15, GOLDUCK
+ db 20, GOLDUCK
end_water_wildmons
diff --git a/data/wild/maps/Route7.asm b/data/wild/maps/Route7.asm
index 51f78880..55474731 100644
--- a/data/wild/maps/Route7.asm
+++ b/data/wild/maps/Route7.asm
@@ -1,28 +1,15 @@
Route7WildMons:
def_grass_wildmons 15 ; encounter rate
- db 19, PIDGEY
-IF DEF(_RED)
- db 19, ODDISH
- db 17, MANKEY
- db 22, ODDISH
+ db 20, PIDGEY
db 22, PIDGEY
- db 18, MANKEY
- db 18, GROWLITHE
- db 20, GROWLITHE
- db 19, MANKEY
- db 20, MANKEY
-ENDC
-IF DEF(_BLUE)
- db 19, BELLSPROUT
- db 17, MEOWTH
- db 22, BELLSPROUT
- db 22, PIDGEY
- db 18, MEOWTH
- db 18, VULPIX
- db 20, VULPIX
- db 19, MEOWTH
- db 20, MEOWTH
-ENDC
+ db 20, RATTATA
+ db 15, ABRA
+ db 19, ABRA
+ db 24, PIDGEOTTO
+ db 26, ABRA
+ db 19, JIGGLYPUFF
+ db 24, JIGGLYPUFF
+ db 24, JIGGLYPUFF
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route8.asm b/data/wild/maps/Route8.asm
index 52995d1b..158b6342 100644
--- a/data/wild/maps/Route8.asm
+++ b/data/wild/maps/Route8.asm
@@ -1,28 +1,15 @@
Route8WildMons:
def_grass_wildmons 15 ; encounter rate
- db 18, PIDGEY
-IF DEF(_RED)
- db 18, MANKEY
- db 17, EKANS
- db 16, GROWLITHE
db 20, PIDGEY
- db 20, MANKEY
- db 19, EKANS
- db 17, GROWLITHE
- db 15, GROWLITHE
- db 18, GROWLITHE
-ENDC
-IF DEF(_BLUE)
- db 18, MEOWTH
- db 17, SANDSHREW
- db 16, VULPIX
- db 20, PIDGEY
- db 20, MEOWTH
- db 19, SANDSHREW
- db 17, VULPIX
- db 15, VULPIX
- db 18, VULPIX
-ENDC
+ db 22, PIDGEY
+ db 20, RATTATA
+ db 15, ABRA
+ db 19, ABRA
+ db 24, PIDGEOTTO
+ db 19, JIGGLYPUFF
+ db 24, JIGGLYPUFF
+ db 20, KADABRA
+ db 27, KADABRA
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/Route9.asm b/data/wild/maps/Route9.asm
index e771040a..f40a9311 100644
--- a/data/wild/maps/Route9.asm
+++ b/data/wild/maps/Route9.asm
@@ -1,26 +1,15 @@
Route9WildMons:
def_grass_wildmons 15 ; encounter rate
- db 16, RATTATA
- db 16, SPEAROW
- db 14, RATTATA
-IF DEF(_RED)
- db 11, EKANS
- db 13, SPEAROW
- db 15, EKANS
- db 17, RATTATA
+ db 16, NIDORAN_M
+ db 16, NIDORAN_F
+ db 18, RATTATA
+ db 18, NIDORAN_M
+ db 18, NIDORAN_F
db 17, SPEAROW
- db 13, EKANS
- db 17, EKANS
-ENDC
-IF DEF(_BLUE)
- db 11, SANDSHREW
- db 13, SPEAROW
- db 15, SANDSHREW
- db 17, RATTATA
- db 17, SPEAROW
- db 13, SANDSHREW
- db 17, SANDSHREW
-ENDC
+ db 18, NIDORINO
+ db 18, NIDORINA
+ db 20, RATICATE
+ db 19, FEAROW
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SafariZoneCenter.asm b/data/wild/maps/SafariZoneCenter.asm
index f0599e4b..cfc06064 100644
--- a/data/wild/maps/SafariZoneCenter.asm
+++ b/data/wild/maps/SafariZoneCenter.asm
@@ -1,28 +1,15 @@
SafariZoneCenterWildMons:
def_grass_wildmons 30 ; encounter rate
-IF DEF(_RED)
- db 22, NIDORAN_M
- db 25, RHYHORN
- db 22, VENONAT
+ db 14, NIDORAN_M
+ db 36, NIDORAN_F
db 24, EXEGGCUTE
- db 31, NIDORINO
- db 25, EXEGGCUTE
- db 31, NIDORINA
- db 30, PARASECT
- db 23, SCYTHER
-ENDC
-IF DEF(_BLUE)
- db 22, NIDORAN_F
- db 25, RHYHORN
- db 22, VENONAT
- db 24, EXEGGCUTE
- db 31, NIDORINA
- db 25, EXEGGCUTE
- db 31, NIDORINO
- db 30, PARASECT
- db 23, PINSIR
-ENDC
- db 23, CHANSEY
+ db 20, RHYHORN
+ db 23, NIDORINO
+ db 27, PARASECT
+ db 27, PARAS
+ db 32, PARASECT
+ db 22, TANGELA
+ db 7, CHANSEY
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SafariZoneEast.asm b/data/wild/maps/SafariZoneEast.asm
index 883f181d..5eb6fa85 100644
--- a/data/wild/maps/SafariZoneEast.asm
+++ b/data/wild/maps/SafariZoneEast.asm
@@ -1,29 +1,15 @@
SafariZoneEastWildMons:
def_grass_wildmons 30 ; encounter rate
-IF DEF(_RED)
- db 24, NIDORAN_M
- db 26, DODUO
- db 22, PARAS
- db 25, EXEGGCUTE
- db 33, NIDORINO
- db 23, EXEGGCUTE
- db 24, NIDORAN_F
- db 25, PARASECT
- db 25, KANGASKHAN
- db 28, SCYTHER
-ENDC
-IF DEF(_BLUE)
- db 24, NIDORAN_F
- db 26, DODUO
- db 22, PARAS
- db 25, EXEGGCUTE
- db 33, NIDORINA
- db 23, EXEGGCUTE
- db 24, NIDORAN_M
- db 25, PARASECT
- db 25, KANGASKHAN
- db 28, PINSIR
-ENDC
+ db 21, NIDORAN_M
+ db 29, NIDORAN_F
+ db 22, EXEGGCUTE
+ db 21, TAUROS
+ db 32, NIDORINA
+ db 19, CUBONE
+ db 26, EXEGGCUTE
+ db 24, MAROWAK
+ db 21, CHANSEY
+ db 15, SCYTHER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SafariZoneNorth.asm b/data/wild/maps/SafariZoneNorth.asm
index 40b4adcc..e8672bbb 100644
--- a/data/wild/maps/SafariZoneNorth.asm
+++ b/data/wild/maps/SafariZoneNorth.asm
@@ -1,26 +1,15 @@
SafariZoneNorthWildMons:
def_grass_wildmons 30 ; encounter rate
-IF DEF(_RED)
- db 22, NIDORAN_M
- db 26, RHYHORN
- db 23, PARAS
- db 25, EXEGGCUTE
- db 30, NIDORINO
- db 27, EXEGGCUTE
- db 30, NIDORINA
-ENDC
-IF DEF(_BLUE)
- db 22, NIDORAN_F
- db 26, RHYHORN
- db 23, PARAS
- db 25, EXEGGCUTE
- db 30, NIDORINA
- db 27, EXEGGCUTE
- db 30, NIDORINO
-ENDC
- db 32, VENOMOTH
- db 26, CHANSEY
- db 28, TAUROS
+ db 36, NIDORAN_M
+ db 14, NIDORAN_F
+ db 20, EXEGGCUTE
+ db 25, RHYHORN
+ db 23, NIDORINA
+ db 28, KANGASKHAN
+ db 16, CUBONE
+ db 33, KANGASKHAN
+ db 25, SCYTHER
+ db 15, PINSIR
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SafariZoneWest.asm b/data/wild/maps/SafariZoneWest.asm
index 821c0ed0..27d4aa8f 100644
--- a/data/wild/maps/SafariZoneWest.asm
+++ b/data/wild/maps/SafariZoneWest.asm
@@ -1,26 +1,15 @@
SafariZoneWestWildMons:
def_grass_wildmons 30 ; encounter rate
-IF DEF(_RED)
- db 25, NIDORAN_M
- db 26, DODUO
- db 23, VENONAT
- db 24, EXEGGCUTE
- db 33, NIDORINO
+ db 29, NIDORAN_M
+ db 21, NIDORAN_F
+ db 22, EXEGGCUTE
+ db 21, TAUROS
+ db 32, NIDORINO
+ db 19, CUBONE
db 26, EXEGGCUTE
- db 25, NIDORAN_F
-ENDC
-IF DEF(_BLUE)
- db 25, NIDORAN_F
- db 26, DODUO
- db 23, VENONAT
- db 24, EXEGGCUTE
- db 33, NIDORINA
- db 26, EXEGGCUTE
- db 25, NIDORAN_M
-ENDC
- db 31, VENOMOTH
- db 26, TAUROS
- db 28, KANGASKHAN
+ db 24, MAROWAK
+ db 25, PINSIR
+ db 27, TANGELA
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SeafoamIslands1F.asm b/data/wild/maps/SeafoamIslands1F.asm
index 42949942..7bfd3fe7 100644
--- a/data/wild/maps/SeafoamIslands1F.asm
+++ b/data/wild/maps/SeafoamIslands1F.asm
@@ -1,28 +1,15 @@
SeafoamIslands1FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 30, SEEL
-IF DEF(_RED)
- db 30, SLOWPOKE
- db 30, SHELLDER
- db 30, HORSEA
- db 28, HORSEA
- db 21, ZUBAT
- db 29, GOLBAT
- db 28, PSYDUCK
- db 28, SHELLDER
- db 38, GOLDUCK
-ENDC
-IF DEF(_BLUE)
- db 30, PSYDUCK
- db 30, STARYU
- db 30, KRABBY
- db 28, KRABBY
- db 21, ZUBAT
- db 29, GOLBAT
+ db 18, ZUBAT
+ db 25, KRABBY
+ db 27, KRABBY
+ db 27, ZUBAT
+ db 36, ZUBAT
db 28, SLOWPOKE
- db 28, STARYU
- db 38, SLOWBRO
-ENDC
+ db 30, SLOWPOKE
+ db 9, ZUBAT
+ db 27, GOLBAT
+ db 36, GOLBAT
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SeafoamIslandsB1F.asm b/data/wild/maps/SeafoamIslandsB1F.asm
index 86cabb9e..199c0019 100644
--- a/data/wild/maps/SeafoamIslandsB1F.asm
+++ b/data/wild/maps/SeafoamIslandsB1F.asm
@@ -1,29 +1,15 @@
SeafoamIslandsB1FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 30, STARYU
- db 30, HORSEA
- db 32, SHELLDER
- db 32, HORSEA
- db 28, SLOWPOKE
- db 30, SEEL
- db 30, SLOWPOKE
- db 28, SEEL
- db 38, DEWGONG
- db 37, SEADRA
-ENDC
-IF DEF(_BLUE)
- db 30, SHELLDER
- db 30, KRABBY
- db 32, STARYU
- db 32, KRABBY
- db 28, PSYDUCK
- db 30, SEEL
- db 30, PSYDUCK
- db 28, SEEL
- db 38, DEWGONG
- db 37, KINGLER
-ENDC
+ db 27, ZUBAT
+ db 26, KRABBY
+ db 36, ZUBAT
+ db 28, KRABBY
+ db 27, GOLBAT
+ db 29, SLOWPOKE
+ db 18, ZUBAT
+ db 28, KINGLER
+ db 22, SEEL
+ db 26, SEEL
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SeafoamIslandsB2F.asm b/data/wild/maps/SeafoamIslandsB2F.asm
index 0375bd51..2dcde913 100644
--- a/data/wild/maps/SeafoamIslandsB2F.asm
+++ b/data/wild/maps/SeafoamIslandsB2F.asm
@@ -1,28 +1,15 @@
SeafoamIslandsB2FWildMons:
def_grass_wildmons 10 ; encounter rate
- db 30, SEEL
-IF DEF(_RED)
- db 30, SLOWPOKE
- db 32, SEEL
- db 32, SLOWPOKE
- db 28, HORSEA
- db 30, STARYU
- db 30, HORSEA
- db 28, SHELLDER
- db 30, GOLBAT
- db 37, SLOWBRO
-ENDC
-IF DEF(_BLUE)
- db 30, PSYDUCK
- db 32, SEEL
- db 32, PSYDUCK
- db 28, KRABBY
- db 30, SHELLDER
- db 30, KRABBY
- db 28, STARYU
- db 30, GOLBAT
- db 37, GOLDUCK
-ENDC
+ db 27, ZUBAT
+ db 27, KRABBY
+ db 36, ZUBAT
+ db 27, GOLBAT
+ db 28, KINGLER
+ db 24, SEEL
+ db 29, KRABBY
+ db 36, GOLBAT
+ db 31, SLOWPOKE
+ db 31, SLOWBRO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/SeafoamIslandsB3F.asm b/data/wild/maps/SeafoamIslandsB3F.asm
index 1706f520..f6bd5f9a 100644
--- a/data/wild/maps/SeafoamIslandsB3F.asm
+++ b/data/wild/maps/SeafoamIslandsB3F.asm
@@ -1,29 +1,26 @@
SeafoamIslandsB3FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 31, SLOWPOKE
- db 31, SEEL
- db 33, SLOWPOKE
- db 33, SEEL
- db 29, HORSEA
- db 31, SHELLDER
- db 31, HORSEA
- db 29, SHELLDER
- db 39, SEADRA
-ENDC
-IF DEF(_BLUE)
- db 31, PSYDUCK
- db 31, SEEL
- db 33, PSYDUCK
- db 33, SEEL
+ db 27, GOLBAT
+ db 36, ZUBAT
db 29, KRABBY
- db 31, STARYU
+ db 27, ZUBAT
+ db 30, KINGLER
+ db 26, SEEL
db 31, KRABBY
- db 29, STARYU
- db 39, KINGLER
-ENDC
- db 37, DEWGONG
+ db 30, SEEL
+ db 28, DEWGONG
+ db 32, DEWGONG
end_grass_wildmons
- def_water_wildmons 0 ; encounter rate
+ def_water_wildmons 5 ; encounter rate
+ db 25, TENTACOOL
+ db 30, TENTACOOL
+ db 20, TENTACOOL
+ db 30, STARYU
+ db 35, TENTACOOL
+ db 30, STARYU
+ db 40, TENTACOOL
+ db 30, STARYU
+ db 30, STARYU
+ db 30, STARYU
end_water_wildmons
diff --git a/data/wild/maps/SeafoamIslandsB4F.asm b/data/wild/maps/SeafoamIslandsB4F.asm
index fd1d7cb9..7417cde9 100644
--- a/data/wild/maps/SeafoamIslandsB4F.asm
+++ b/data/wild/maps/SeafoamIslandsB4F.asm
@@ -1,29 +1,26 @@
SeafoamIslandsB4FWildMons:
def_grass_wildmons 10 ; encounter rate
-IF DEF(_RED)
- db 31, HORSEA
- db 31, SHELLDER
- db 33, HORSEA
- db 33, SHELLDER
- db 29, SLOWPOKE
- db 31, SEEL
- db 31, SLOWPOKE
- db 29, SEEL
- db 39, SLOWBRO
-ENDC
-IF DEF(_BLUE)
- db 31, KRABBY
- db 31, STARYU
- db 33, KRABBY
- db 33, STARYU
- db 29, PSYDUCK
- db 31, SEEL
- db 31, PSYDUCK
- db 29, SEEL
- db 39, GOLDUCK
-ENDC
- db 32, GOLBAT
+ db 36, GOLBAT
+ db 36, ZUBAT
+ db 30, KRABBY
+ db 32, KINGLER
+ db 28, SEEL
+ db 32, SEEL
+ db 27, GOLBAT
+ db 45, ZUBAT
+ db 30, DEWGONG
+ db 34, DEWGONG
end_grass_wildmons
- def_water_wildmons 0 ; encounter rate
+ def_water_wildmons 5 ; encounter rate
+ db 25, TENTACOOL
+ db 30, TENTACOOL
+ db 20, TENTACOOL
+ db 30, STARYU
+ db 35, TENTACOOL
+ db 30, STARYU
+ db 40, TENTACOOL
+ db 30, STARYU
+ db 30, STARYU
+ db 30, STARYU
end_water_wildmons
diff --git a/data/wild/maps/VictoryRoad1F.asm b/data/wild/maps/VictoryRoad1F.asm
index 055b61bc..a02b2be5 100644
--- a/data/wild/maps/VictoryRoad1F.asm
+++ b/data/wild/maps/VictoryRoad1F.asm
@@ -1,15 +1,15 @@
VictoryRoad1FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 24, MACHOP
db 26, GEODUDE
- db 22, ZUBAT
- db 36, ONIX
- db 39, ONIX
- db 42, ONIX
+ db 31, GEODUDE
+ db 36, GEODUDE
+ db 39, ZUBAT
+ db 44, ZUBAT
+ db 41, GEODUDE
+ db 43, ONIX
+ db 45, ONIX
db 41, GRAVELER
- db 41, GOLBAT
- db 42, MACHOKE
- db 43, MAROWAK
+ db 47, GRAVELER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/VictoryRoad2F.asm b/data/wild/maps/VictoryRoad2F.asm
index 47fc4041..806b29ab 100644
--- a/data/wild/maps/VictoryRoad2F.asm
+++ b/data/wild/maps/VictoryRoad2F.asm
@@ -1,15 +1,15 @@
VictoryRoad2FWildMons:
def_grass_wildmons 10 ; encounter rate
- db 22, MACHOP
- db 24, GEODUDE
- db 26, ZUBAT
- db 36, ONIX
- db 39, ONIX
- db 42, ONIX
- db 41, MACHOKE
- db 40, GOLBAT
- db 40, MAROWAK
- db 43, GRAVELER
+ db 31, GEODUDE
+ db 36, GEODUDE
+ db 41, GEODUDE
+ db 44, ZUBAT
+ db 39, GOLBAT
+ db 44, GRAVELER
+ db 45, ONIX
+ db 47, ONIX
+ db 39, MACHOKE
+ db 42, MACHOKE
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/VictoryRoad3F.asm b/data/wild/maps/VictoryRoad3F.asm
index ae12d403..03d6bbf2 100644
--- a/data/wild/maps/VictoryRoad3F.asm
+++ b/data/wild/maps/VictoryRoad3F.asm
@@ -1,15 +1,15 @@
VictoryRoad3FWildMons:
def_grass_wildmons 15 ; encounter rate
- db 24, MACHOP
- db 26, GEODUDE
- db 22, ZUBAT
- db 42, ONIX
- db 40, VENOMOTH
- db 45, ONIX
- db 43, GRAVELER
- db 41, GOLBAT
+ db 36, GEODUDE
+ db 44, GOLBAT
+ db 41, GEODUDE
+ db 49, ONIX
+ db 46, GEODUDE
+ db 41, GRAVELER
db 42, MACHOKE
db 45, MACHOKE
+ db 47, GRAVELER
+ db 47, GRAVELER
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/maps/ViridianForest.asm b/data/wild/maps/ViridianForest.asm
index 82a63569..f959b1b0 100644
--- a/data/wild/maps/ViridianForest.asm
+++ b/data/wild/maps/ViridianForest.asm
@@ -1,27 +1,15 @@
ViridianForestWildMons:
- def_grass_wildmons 8 ; encounter rate
-IF DEF(_RED)
- db 4, WEEDLE
- db 5, KAKUNA
- db 3, WEEDLE
- db 5, WEEDLE
- db 4, KAKUNA
- db 6, KAKUNA
- db 4, METAPOD
+ def_grass_wildmons 25 ; encounter rate
db 3, CATERPIE
-ENDC
-IF DEF(_BLUE)
+ db 4, METAPOD
db 4, CATERPIE
- db 5, METAPOD
- db 3, CATERPIE
db 5, CATERPIE
- db 4, METAPOD
+ db 4, PIDGEY
+ db 6, PIDGEY
+ db 6, CATERPIE
db 6, METAPOD
- db 4, KAKUNA
- db 3, WEEDLE
-ENDC
- db 3, PIKACHU
- db 5, PIKACHU
+ db 8, PIDGEY
+ db 9, PIDGEOTTO
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
diff --git a/data/wild/super_rod.asm b/data/wild/super_rod.asm
index 20a52a6c..7b3b6407 100644
--- a/data/wild/super_rod.asm
+++ b/data/wild/super_rod.asm
@@ -1,101 +1,33 @@
-; super rod encounters
-SuperRodData:
- ; map, fishing group
- dbw PALLET_TOWN, .Group1
- dbw VIRIDIAN_CITY, .Group1
- dbw CERULEAN_CITY, .Group3
- dbw VERMILION_CITY, .Group4
- dbw CELADON_CITY, .Group5
- dbw FUCHSIA_CITY, .Group10
- dbw CINNABAR_ISLAND, .Group8
- dbw ROUTE_4, .Group3
- dbw ROUTE_6, .Group4
- dbw ROUTE_10, .Group5
- dbw ROUTE_11, .Group4
- dbw ROUTE_12, .Group7
- dbw ROUTE_13, .Group7
- dbw ROUTE_17, .Group7
- dbw ROUTE_18, .Group7
- dbw ROUTE_19, .Group8
- dbw ROUTE_20, .Group8
- dbw ROUTE_21, .Group8
- dbw ROUTE_22, .Group2
- dbw ROUTE_23, .Group9
- dbw ROUTE_24, .Group3
- dbw ROUTE_25, .Group3
- dbw CERULEAN_GYM, .Group3
- dbw VERMILION_DOCK, .Group4
- dbw SEAFOAM_ISLANDS_B3F, .Group8
- dbw SEAFOAM_ISLANDS_B4F, .Group8
- dbw SAFARI_ZONE_EAST, .Group6
- dbw SAFARI_ZONE_NORTH, .Group6
- dbw SAFARI_ZONE_WEST, .Group6
- dbw SAFARI_ZONE_CENTER, .Group6
- dbw CERULEAN_CAVE_2F, .Group9
- dbw CERULEAN_CAVE_B1F, .Group9
- dbw CERULEAN_CAVE_1F, .Group9
+SuperRodFishingSlots::
+ db PALLET_TOWN, STARYU, 10, TENTACOOL, 10, STARYU, 5, TENTACOOL, 20
+ db VIRIDIAN_CITY, POLIWAG, 5, POLIWAG, 10, POLIWAG, 15, POLIWAG, 10
+ db CERULEAN_CITY, GOLDEEN, 25, GOLDEEN, 30, SEAKING, 30, SEAKING, 40
+ db VERMILION_CITY, TENTACOOL, 15, TENTACOOL, 20, TENTACOOL, 10, HORSEA, 5
+ db CELADON_CITY, GOLDEEN, 5, GOLDEEN, 10, GOLDEEN, 15, GOLDEEN, 20
+ db FUCHSIA_CITY, MAGIKARP, 5, MAGIKARP, 10, MAGIKARP, 15, GYARADOS, 15
+ db CINNABAR_ISLAND, STARYU, 15, TENTACOOL, 15, STARYU, 10, TENTACOOL, 30
+ db ROUTE_4, GOLDEEN, 20, GOLDEEN, 25, GOLDEEN, 30, SEAKING, 30
+ db ROUTE_6, GOLDEEN, 5, GOLDEEN, 10, GOLDEEN, 15, GOLDEEN, 20
+ db ROUTE_24, GOLDEEN, 20, GOLDEEN, 25, GOLDEEN, 30, SEAKING, 30
+ db ROUTE_25, KRABBY, 10, KRABBY, 15, KINGLER, 15, KINGLER, 25
+ db ROUTE_10, KRABBY, 15, KRABBY, 20, HORSEA, 10, KINGLER, 25
+ db ROUTE_11, TENTACOOL, 15, TENTACOOL, 20, TENTACOOL, 10, HORSEA, 5
+ db ROUTE_12, HORSEA, 20, HORSEA, 25, SEADRA, 25, SEADRA, 35
+ db ROUTE_13, HORSEA, 15, HORSEA, 20, TENTACOOL, 10, SEADRA, 20
+ db ROUTE_17, TENTACOOL, 5, TENTACOOL, 15, SHELLDER, 25, SHELLDER, 35
+ db ROUTE_18, TENTACOOL, 15, SHELLDER, 20, SHELLDER, 30, SHELLDER, 40
+ db ROUTE_19, TENTACOOL, 15, STARYU, 20, TENTACOOL, 30, TENTACRUEL, 30
+ db ROUTE_20, TENTACOOL, 20, TENTACRUEL, 20, STARYU, 30, TENTACRUEL, 40
+ db ROUTE_21, TENTACOOL, 15, STARYU, 20, TENTACOOL, 30, TENTACRUEL, 30
+ db ROUTE_22, POLIWAG, 5, POLIWAG, 10, POLIWAG, 15, POLIWHIRL, 15
+ db ROUTE_23, POLIWAG, 25, POLIWAG, 30, POLIWHIRL, 30, POLIWHIRL, 40
+ db VERMILION_DOCK, TENTACOOL, 10, TENTACOOL, 15, STARYU, 15, SHELLDER, 10
+ db SAFARI_ZONE_CENTER, MAGIKARP, 5, MAGIKARP, 10, DRATINI, 10, DRAGONAIR, 15
+ db SAFARI_ZONE_EAST, MAGIKARP, 5, MAGIKARP, 10, MAGIKARP, 15, DRATINI, 15
+ db SAFARI_ZONE_NORTH, MAGIKARP, 5, MAGIKARP, 10, MAGIKARP, 15, DRATINI, 15
+ db SAFARI_ZONE_WEST, MAGIKARP, 5, MAGIKARP, 10, MAGIKARP, 15, DRATINI, 15
+ db SEAFOAM_ISLANDS_B3F, KRABBY, 25, STARYU, 20, KINGLER, 35, STARYU, 40
+ db SEAFOAM_ISLANDS_B4F, KRABBY, 25, STARYU, 20, KINGLER, 35, STARYU, 40
+ db CERULEAN_CAVE_1F, GOLDEEN, 25, SEAKING, 35, SEAKING, 45, SEAKING, 55
+ db CERULEAN_CAVE_B1F, GOLDEEN, 30, SEAKING, 40, SEAKING, 50, SEAKING, 60
db -1 ; end
-
-; fishing groups
-; number of monsters, followed by level/monster pairs
-
-.Group1:
- db 2
- db 15, TENTACOOL
- db 15, POLIWAG
-
-.Group2:
- db 2
- db 15, GOLDEEN
- db 15, POLIWAG
-
-.Group3:
- db 3
- db 15, PSYDUCK
- db 15, GOLDEEN
- db 15, KRABBY
-
-.Group4:
- db 2
- db 15, KRABBY
- db 15, SHELLDER
-
-.Group5:
- db 2
- db 23, POLIWHIRL
- db 15, SLOWPOKE
-
-.Group6:
- db 4
- db 15, DRATINI
- db 15, KRABBY
- db 15, PSYDUCK
- db 15, SLOWPOKE
-
-.Group7:
- db 4
- db 5, TENTACOOL
- db 15, KRABBY
- db 15, GOLDEEN
- db 15, MAGIKARP
-
-.Group8:
- db 4
- db 15, STARYU
- db 15, HORSEA
- db 15, SHELLDER
- db 15, GOLDEEN
-
-.Group9:
- db 4
- db 23, SLOWBRO
- db 23, SEAKING
- db 23, KINGLER
- db 23, SEADRA
-
-.Group10:
- db 4
- db 23, SEAKING
- db 15, KRABBY
- db 15, GOLDEEN
- db 15, MAGIKARP
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
new file mode 100644
index 00000000..fa1050fd
--- /dev/null
+++ b/docs/bugs_and_glitches.md
@@ -0,0 +1,63 @@
+# Bugs and Glitches
+
+These are sections of the original Pokémon Yellow game code that clearly do not work as intended or only work in limited circumstances.
+
+Fixes are written in the `diff` format. If you've used Git before, this should look familiar:
+
+```diff
+ this is some code
+-delete red - lines
++add green + lines
+```
+
+
+## Contents
+
+- [Options menu code fails to clear joypad state on initialization](#options-menu-code-fails-to-clear-joypad-state-on-initialization)
+- [Battle transitions fail to account for scripted battles](#battle-transitions-fail-to-account-for-scripted-battles)
+- [`wPikachuFollowCommandBuffer` can overflow](#wpikachufollowcommandbuffer-can-overflow)
+- [Unexpected Counter damage](#unexpected-counter-damage)
+
+
+## Options menu code fails to clear joypad state on initialization
+
+This bug (or feature!) results in all options being shifted left or right if the respective direction is pressed on the same frame the options menu is opened.
+The bug also exists in pokegold and pokecrystal.
+
+**Fix:** Update [engine/menus/options.asm](/engine/menus/options.asm)
+
+```diff
+ DisplayOptionMenu_:
++
++ call JoypadLowSensitivity
+ call InitOptionsMenu
+```
+
+
+## Battle transitions fail to account for scripted battles
+
+When Oak Catches Pikachu in the Pallet Town cutscenes you don't yet have any Pokemon in Party.
+The Battle Transitions code has no error handling for this and reads wPartyMon1HP from wRivalName+6.
+This means you can manipulate this first transition to be faster by choosing a default rival name or writing and deleting 6 characters in a custom rival name.
+A similar series of bugs appears to exist in pokecrystal.
+
+**Fix:** TBD in [engine/battle/battle_transitions.asm#L93](/engine/battle/battle_transitions.asm#L93)
+
+
+## `wPikachuFollowCommandBuffer` can overflow
+
+AppendPikachuFollowCommandToBuffer doesn't have any length checking for the buffer of Pikachu commands.
+This can be abused to write data into any address past d437, typically by putting pikachu to sleep in the Pewter Center with Jigglypuff.
+While in this state, walking down writes 01, up 02, left 03, and right 04.
+This bug is generally known as "Pikawalk."
+A typical use for this would be to force the in game time to 255:59.
+
+**Fix:** TBD in [engine/pikachu/pikachu_follow.asm#1165](/engine/pikachu/pikachu_follow.asm#1165)
+
+
+## Unexpected Counter damage
+
+Counter simply doubles the value of wDamage which can hold the last value of damage dealt whether it was from you, your opponent, a switched out opponent, or a player in another battle.
+This is because wDamage is used for both the player's damage and opponent's damage, and is not cleared out between switching or battles.
+
+**Fix:** TBD in [engine/battle/core.asm#L4960](/engine/battle/core.asm#L4960)
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 75713592..56db1979 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -15,6 +15,8 @@ DrawFrameBlock:
ld a, [wFBTileCounter]
inc a
ld [wFBTileCounter], a
+ ld a, $2
+ ld [wdef5], a
ld a, [wSubAnimTransform]
dec a
jr z, .flipHorizontalAndVertical ; SUBANIMTYPE_HVFLIP
@@ -46,6 +48,12 @@ DrawFrameBlock:
.finishCopying ; finish copying values to OAM (when subanimation not transformed)
add [hl] ; X offset
ld [de], a ; store X
+ cp 88
+ jr c, .asm_78056
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_78056
inc hl
inc de
ld a, [hli]
@@ -53,6 +61,9 @@ DrawFrameBlock:
ld [de], a ; store tile ID
inc de
ld a, [hli]
+ ld b, a
+ ld a, [wdef5]
+ or b
ld [de], a ; store flags
inc de
jp .nextTile
@@ -71,6 +82,12 @@ DrawFrameBlock:
ld a, 168
sub b ; flip X coordinate
ld [de], a ; store X
+ cp 88
+ jr c, .asm_78087
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_78087
inc hl
inc de
ld a, [hli]
@@ -90,7 +107,8 @@ DrawFrameBlock:
jr z, .storeFlags1
ld b, 0
.storeFlags1
- ld a, b
+ ld a, [wdef5]
+ or b
ld [de], a
inc de
jp .nextTile
@@ -107,6 +125,12 @@ DrawFrameBlock:
ld a, 168
sub b ; flip X coordinate
ld [de], a ; store X
+ cp 88
+ jr c, .asm_780c8
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_780c8
inc hl
inc de
ld a, [hli]
@@ -122,6 +146,9 @@ DrawFrameBlock:
.disableHorizontalFlip
res 5, a
.storeFlags2
+ ld b, a
+ ld a, [wdef5]
+ or b
ld [de], a
inc de
.nextTile
@@ -245,11 +272,13 @@ PlayAnimation:
push af
ld a, [wAnimPalette]
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
call LoadAnimationTileset
call LoadSubanimation
call PlaySubanimation
pop af
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
.nextAnimationCommand
pop hl
jr .animationLoop
@@ -366,12 +395,7 @@ AnimationTileset2:
INCBIN "gfx/battle/attack_anim_2.2bpp"
SlotMachineTiles2:
-IF DEF(_RED)
- INCBIN "gfx/slots/red_slots_2.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/slots/blue_slots_2.2bpp"
-ENDC
+ INCBIN "gfx/slots/slots_2.2bpp"
SlotMachineTiles2End:
MoveAnimation:
@@ -537,6 +561,8 @@ SetAnimationPalette:
ldh [rOBP0], a
ld a, $6c
ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
.notSGB
ld a, $e4
@@ -544,6 +570,28 @@ SetAnimationPalette:
ldh [rOBP0], a
ld a, $6c
ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+Func_78e98:
+ call SaveScreenTilesToBuffer2
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call ClearScreen
+ ld h, HIGH(vBGMap0)
+ call WriteLowerByteOfBGMapAndEnableBGTransfer
+ call Delay3
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call LoadScreenTilesFromBuffer2
+ ld h, HIGH(vBGMap1)
+
+WriteLowerByteOfBGMapAndEnableBGTransfer:
+ ld l, LOW(vBGMap0)
+ call BattleAnimCopyTileMapToVRAM
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
ret
PlaySubanimation:
@@ -659,6 +707,7 @@ DoBallTossSpecialEffects:
ldh a, [rOBP0]
xor %00111100 ; complement colors 1 and 2
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
.skipFlashingEffect
ld a, [wSubAnimCounter]
cp 11 ; is it the beginning of the subanimation?
@@ -948,6 +997,7 @@ AnimationFlashScreenLong:
cp $01 ; is it the end of the palettes?
jr z, .endOfPalettes
ldh [rBGP], a
+ call UpdateGBCPal_BGP
call FlashScreenLongDelay
jr .innerLoop
.endOfPalettes
@@ -1010,14 +1060,17 @@ AnimationFlashScreen:
push af ; save initial palette
ld a, %00011011 ; 0, 1, 2, 3 (inverted colors)
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
xor a ; white out background
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
pop af
ldh [rBGP], a ; restore initial palette
+ call UpdateGBCPal_BGP
ret
AnimationDarkScreenPalette:
@@ -1063,6 +1116,7 @@ SetAnimationBGPalette:
ld a, c
.next
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ret
ld b, $5
@@ -1107,15 +1161,30 @@ AnimationWaterDropletsEverywhere:
_AnimationWaterDroplets:
ld hl, wOAMBuffer
.loop
+ ld a, $1
+ ld [wdef5], a
ld a, [wBaseCoordY]
ld [hli], a ; Y
+ cp 40
+ jr c, .asm_792d7
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_792d7
ld a, [wBaseCoordX]
add 27
ld [wBaseCoordX], a
ld [hli], a ; X
+ cp 88
+ jr c, .asm_792ee
+ ld a, [wdef5]
+ add $2
+ and $3
+ ld [wdef5], a
+.asm_792ee
ld a, [wDropletTile]
ld [hli], a ; tile
- xor a
+ ld a, [wdef5]
ld [hli], a ; attribute
ld a, [wBaseCoordX]
cp 144
@@ -1258,16 +1327,30 @@ BattleAnimWriteOAMEntry:
; Y coordinate = e (increased by 8 each call, before the write to OAM)
; X coordinate = [wBaseCoordX]
; tile = d
-; attributes = 0
+; attributes = variable (depending on coords)
+ ld a, $1
+ ld [wdef5], a
ld a, e
add 8
ld e, a
ld [hli], a
+ cp 40
+ jr c, .asm_793d8
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_793d8
ld a, [wBaseCoordX]
ld [hli], a
+ cp 88
+ jr c, .asm_793e8
+ ld a, [wdef5]
+ add $2
+ ld [wdef5], a
+.asm_793e8
ld a, d
ld [hli], a
- xor a
+ ld a, [wdef5]
ld [hli], a
ret
@@ -1472,6 +1555,8 @@ AnimationSpiralBallsInward:
ld a, [hl]
cp $ff
jr z, .done
+ ld a, $2
+ ld [wdef5], a
ld a, [wSpiralBallsBaseY]
add [hl]
ld [de], a ; Y
@@ -1480,9 +1565,20 @@ AnimationSpiralBallsInward:
ld a, [wSpiralBallsBaseX]
add [hl]
ld [de], a ; X
+ cp 88
+ jr c, .asm_79524
+ ld a, $3
+ ld [wdef5], a
+.asm_79524
inc hl
inc de
inc de
+ ld a, [de]
+ and $f0
+ ld b, a
+ ld a, [wdef5]
+ or b
+ ld [de], a
inc de
dec c
jr nz, .innerLoop
@@ -1794,10 +1890,8 @@ _AnimationSlideMonOff:
.PlayerNextTile
ld a, [hl]
add 7
-; This is a bug. The lower right corner tile of the mon back pic is blanked
-; while the mon is sliding off the screen. It should compare with the max tile
-; plus one instead.
- cp $61
+; bugfix: compares against the max tile + 1 as opposed to the max tile
+ cp $62
ret c
ld a, " "
ret
@@ -1934,18 +2028,24 @@ AnimationSubstitute:
CopyMonsterSpriteData:
ld bc, 1 tiles
ld a, BANK(MonsterSprite)
- jp FarCopyData2
+ jp FarCopyData
HideSubstituteShowMonAnim:
ldh a, [hWhoseTurn]
and a
ld hl, wPlayerMonMinimized
+ ld de, wPlayerBattleStatus1
+ ld bc, wPlayerMoveNum
ld a, [wPlayerBattleStatus2]
jr z, .next1
ld hl, wEnemyMonMinimized
+ ld de, wEnemyBattleStatus1
+ ld bc, wEnemyMoveNum
ld a, [wEnemyBattleStatus2]
.next1
push hl
+ push de
+ push bc
; if the substitute broke, slide it down, else slide it offscreen horizontally
bit HAS_SUBSTITUTE_UP, a
jr nz, .substituteStillUp
@@ -1954,12 +2054,65 @@ HideSubstituteShowMonAnim:
.substituteStillUp
call AnimationSlideMonOff
.next2
+ pop bc
+ pop de
+ ld a, [de]
+ bit INVULNERABLE, a
pop hl
+ jr nz, .invulnerable
+ ld a, [bc]
+ cp FLY
+ jr z, .flyOrDig
+ cp DIG
+ jr z, .flyOrDig
+.invulnerable
ld a, [hl]
and a
jp nz, AnimationMinimizeMon
call AnimationFlashMonPic
jp AnimationShowMonPic
+.flyOrDig
+ ldh a, [hWhoseTurn]
+ and a
+ jr nz, .enemy
+ ld a, [wPlayerMonMinimized]
+ and a
+ jr nz, .monIsMinimized
+ ld a, [wBattleMonSpecies]
+ ld [wcf91], a
+ ld [wd0b5], a
+ call GetMonHeader
+ predef LoadMonBackPic
+ ret
+.enemy
+ ld a, [wEnemyMonMinimized]
+ and a
+ jr nz, .monIsMinimized
+ ld a, [wEnemyMonSpecies]
+ ld [wcf91], a
+ ld [wd0b5], a
+ call GetMonHeader
+ ld de, vFrontPic
+ jp LoadMonFrontSprite
+.monIsMinimized
+ ld hl, wTempPic
+ push hl
+ xor a
+ ld bc, 7 * 7 * $10
+ call FillMemory
+ pop hl
+ ld de, $194
+ add hl, de
+ ld de, MinimizedMonSprite
+ ld c, MinimizedMonSpriteEnd - MinimizedMonSprite
+.loop
+ ld a, [de]
+ ld [hli], a
+ ld [hli], a
+ inc de
+ dec c
+ jr nz, .loop
+ jp CopyTempPicToMonPic
ReshowSubstituteAnim:
call AnimationSlideMonOff
@@ -2027,6 +2180,23 @@ AnimationHideEnemyMonPic:
ldh [hAutoBGTransferEnabled], a
jp Delay3
+Func_79929:
+ ld hl, wPlayerMonMinimized
+ ldh a, [hWhoseTurn]
+ and a
+ jr z, .playerTurn
+ ld hl, wEnemyMonMinimized
+.playerTurn
+ ld a, [hl]
+ and a
+ jr z, .notMinimized
+ call AnimationMinimizeMon
+ ret
+.notMinimized
+ call AnimationFlashMonPic
+ call AnimationShowMonPic
+ ret
+
InitMultipleObjectsOAM:
; Writes c OAM entries with tile d.
; Sets their Y coordinates to sequential multiples of 8, starting from 0.
@@ -2048,6 +2218,8 @@ InitMultipleObjectsOAM:
jr nz, .loop
ret
+ ret ; unreferenced
+
AnimationHideMonPic:
; Hides the mon's sprite.
ldh a, [hWhoseTurn]
@@ -2270,17 +2442,13 @@ INCLUDE "data/tilemaps.asm"
AnimationLeavesFalling:
; Makes leaves float down from the top of the screen. This is used
; in Razor Leaf's animation.
- ldh a, [rOBP0]
- push af
ld a, [wAnimPalette]
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
ld d, $37 ; leaf tile
ld a, 3 ; number of leaves
ld [wNumFallingObjects], a
- call AnimationFallingObjects
- pop af
- ldh [rOBP0], a
- ret
+ jp AnimationFallingObjects
AnimationPetalsFalling:
; Makes lots of petals fall down from the top of the screen. It's used in
@@ -2335,6 +2503,8 @@ FallingObjects_UpdateOAMEntry:
; movement byte.
ld hl, wOAMBuffer
add hl, de
+ ld a, $1
+ ld [wdef5], a
ld a, [hl]
inc a
inc a
@@ -2343,6 +2513,12 @@ FallingObjects_UpdateOAMEntry:
ld a, 160 ; if Y >= 112, put it off-screen
.next
ld [hli], a ; Y
+ cp 40
+ jr c, .asm_79e51
+ ld a, [wdef5]
+ inc a
+ ld [wdef5], a
+.asm_79e51
ld a, [wFallingObjectMovementByte]
ld b, a
ld de, FallingObjects_DeltaXs
@@ -2359,6 +2535,13 @@ FallingObjects_UpdateOAMEntry:
ld a, [de]
add [hl]
ld [hli], a ; X
+ cp 88
+ jr c, .asm_79e75
+ ld a, [wdef5]
+ add $2
+ and $3
+ ld [wdef5], a
+.asm_79e75
inc hl
xor a ; no horizontal flip
jr .next2
@@ -2368,9 +2551,19 @@ FallingObjects_UpdateOAMEntry:
ld a, [hl]
sub b
ld [hli], a ; X
+ cp 88
+ jr c, .asm_79e5c
+ ld a, [wdef5]
+ add $2
+ and $3
+ ld [wdef5], a
+.asm_79e5c
inc hl
ld a, (1 << OAM_X_FLIP)
.next2
+ ld b, a
+ ld a, [wdef5]
+ or b
ld [hl], a ; attribute
ret
@@ -2455,6 +2648,14 @@ AnimationShakeEnemyHUD:
ld hl, vBGMap1 - $20 * 7
call BattleAnimCopyTileMapToVRAM
+; update BGMap attributes
+ ldh a, [hGBC]
+ and a
+ jr z, .notGBC
+ ld c, 13
+ farcall LoadBGMapAttributes
+.notGBC
+
; Move the window so that the row below the enemy HUD (in BG map 0) lines up
; with the top row of the window on the screen. This makes it so that the window
; covers everything below the enemy HD with a copy that looks just like what
@@ -2488,13 +2689,18 @@ AnimationShakeEnemyHUD:
ldh [hWY], a
ld hl, vBGMap1
call BattleAnimCopyTileMapToVRAM
+; update BGMap attributes
+ ldh a, [hGBC]
+ and a
+ jr z, .notGBC2
+ ld c, 11
+ farcall LoadBGMapAttributes
+.notGBC2
xor a
ldh [hWY], a
call SaveScreenTilesToBuffer1
ld hl, vBGMap0
call BattleAnimCopyTileMapToVRAM
- call ClearScreen
- call Delay3
call LoadScreenTilesFromBuffer1
ld hl, vBGMap1
jp BattleAnimCopyTileMapToVRAM
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 90e99f98..6d3a4f9c 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -163,6 +163,9 @@ BattleTransition_BlackScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
; for non-dungeon trainer battles
@@ -326,6 +329,7 @@ BattleTransition_FlashScreen_:
cp 1
jr z, .done
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 2
call DelayFrames
jr .loop
diff --git a/engine/battle/common_text.asm b/engine/battle/common_text.asm
index 0e270424..95c06bf5 100644
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -8,8 +8,20 @@ PrintBeginningBattleText:
cp POKEMON_TOWER_7F + 1
jr c, .pokemonTower
.notPokemonTower
+ ld a, [wBattleType]
+ cp BATTLE_TYPE_PIKACHU
+ jr nz, .notPikachuBattle
+ callfar IsPlayerPikachuAsleepInParty
+ ld e, $24
+ jr c, .asm_f4026
+ ld e, $a
+.asm_f4026
+ callfar PlayPikachuSoundClip
+ jr .continue
+.notPikachuBattle
ld a, [wEnemyMonSpecies2]
call PlayCry
+.continue
ld hl, WildMonAppearedText
ld a, [wMoveMissed]
and a
@@ -23,9 +35,13 @@ PrintBeginningBattleText:
call DelayFrames
ld hl, TrainerWantsToFightText
.wildBattle
+ ld a, [wBattleType]
+ and a
+ jr nz, .doNotDrawPokeballs
push hl
callfar DrawAllPokeballs
pop hl
+.doNotDrawPokeballs
call PrintText
jr .done
.pokemonTower
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index f325350f..48104833 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -67,6 +67,9 @@ SlidePlayerAndEnemySilhouettesOnScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
.slideSilhouettesLoop ; slide silhouettes of the player's pic and the enemy's pic onto the screen
ld h, b
ld l, $40
@@ -156,10 +159,16 @@ StartBattle:
call DelayFrames
call SaveScreenTilesToBuffer1
.checkAnyPartyAlive
+ ld a, [wBattleType]
+ cp BATTLE_TYPE_RUN
+ jp z, .specialBattle
+ cp BATTLE_TYPE_PIKACHU
+ jp z, .specialBattle
call AnyPartyAlive
ld a, d
and a
jp z, HandlePlayerBlackOut ; jump if no mon is alive
+.specialBattle
call LoadScreenTilesFromBuffer1
ld a, [wBattleType]
and a ; is it a normal battle?
@@ -893,6 +902,11 @@ ReplaceFaintedEnemyMon:
ld hl, wEnemyHPBarColor
ld e, $30
call GetBattleHealthBarColor
+ ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
callfar DrawEnemyPokeballs
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -958,9 +972,7 @@ TrainerDefeatedText:
PlayBattleVictoryMusic:
push af
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySoundWaitForCurrent
+ call StopAllMusic
ld c, BANK(Music_DefeatedTrainer)
pop af
call PlayMusic
@@ -1014,6 +1026,7 @@ RemoveFaintedPlayerMon:
ld a, $ff
ld [wLowHealthAlarm], a ;disable low health alarm
call WaitForSoundToFinish
+ xor a
.skipWaitForSound
; a is 0, so this zeroes the enemy's accumulated damage.
ld hl, wEnemyBideAccumulatedDamage
@@ -1038,10 +1051,36 @@ RemoveFaintedPlayerMon:
and a ; was this called by HandleEnemyMonFainted?
ret z ; if so, return
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .notPlayerPikachu
+ ld e, $3
+ callfar PlayPikachuSoundClip
+ jr .printText
+.notPlayerPikachu
ld a, [wBattleMonSpecies]
call PlayCry
+.printText
ld hl, PlayerMonFaintedText
- jp PrintText
+ call PrintText
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ ld a, [wBattleMonLevel]
+ ld b, a
+ ld a, [wEnemyMonLevel]
+ sub b ; enemylevel - playerlevel
+ ; are we stronger than the opposing pokemon?
+ jr c, .regularFaint ; if so, deduct happiness regularly
+
+ cp 30 ; is the enemy 30 levels greater than us?
+ jr nc, .carelessTrainer ; if so, punish the player for being careless, as they shouldn't be fighting a very high leveled trainer with such a level difference
+.regularFaint
+ callabd_ModifyPikachuHappiness PIKAHAPPY_FAINTED
+ ret
+.carelessTrainer
+ callabd_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER
+ ret
PlayerMonFaintedText:
text_far _PlayerMonFaintedText
@@ -1098,7 +1137,7 @@ ChooseNextMon:
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr nz, .notLinkBattle
- inc a ; 1
+ ld a, 1
ld [wActionResultOrTookBattleTurn], a
call LinkBattleExchangeData
.notLinkBattle
@@ -1498,6 +1537,8 @@ TryRunningFromBattle:
ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jp z, .canEscape ; jump if it's a safari battle
+ cp BATTLE_TYPE_RUN
+ jp z, .canEscape ; hurry, get away?
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jp z, .canEscape
@@ -1753,19 +1794,46 @@ SendOutMon:
call RunPaletteCommand
ld hl, wEnemyBattleStatus1
res USING_TRAPPING_MOVE, [hl]
+ callfar IsThisPartymonStarterPikachu
+ jr c, .starterPikachu
ld a, $1
ldh [hWhoseTurn], a
ld a, POOF_ANIM
call PlayMoveAnimation
hlcoord 4, 11
predef AnimateSendingOutMon
+ jr .playRegularCry
+.starterPikachu
+ xor a
+ ldh [hWhoseTurn], a
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ callfar StarterPikachuBattleEntranceAnimation
+ callfar IsPlayerPikachuAsleepInParty
+ ld e, $24
+ jr c, .asm_3cd81
+ ld e, $a
+.asm_3cd81
+ callfar PlayPikachuSoundClip
+ jr .done
+.playRegularCry
ld a, [wcf91]
call PlayCry
+.done
call PrintEmptyString
jp SaveScreenTilesToBuffer1
; show 2 stages of the player mon getting smaller before disappearing
AnimateRetreatingPlayerMon:
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu
+ pop bc
+ ld a, b
+ ld [wWhichPokemon], a
+ jr c, .starterPikachu
hlcoord 1, 5
lb bc, 7, 7
call ClearScreenArea
@@ -1789,10 +1857,17 @@ AnimateRetreatingPlayerMon:
call .clearScreenArea
ld a, $4c
ldcoord_a 5, 11
+ jr .clearScreenArea
+.starterPikachu
+ xor a
+ ldh [hWhoseTurn], a
+ callfar AnimationSlideMonOff
+ ret
.clearScreenArea
hlcoord 1, 5
lb bc, 7, 7
- jp ClearScreenArea
+ call ClearScreenArea
+ ret
; reads player's current mon's HP into wBattleMonHP
ReadPlayerMonCurHPAndStatus:
@@ -2013,40 +2088,52 @@ DisplayBattleMenu::
.menuselected
ld [wTextBoxID], a
call DisplayTextBoxID
- ; handle menu input if it's not the old man tutorial
+ ; handle menu input if it's not the old man tutorial or prof. oak pikachu battle
ld a, [wBattleType]
- dec a
- jp nz, .handleBattleMenuInput
-; the following happens for the old man tutorial
+ cp BATTLE_TYPE_OLD_MAN
+ jr z, .doSimulatedMenuInput
+ cp BATTLE_TYPE_PIKACHU
+ jr z, .doSimulatedMenuInput
+ jp .handleBattleMenuInput
+; the following happens for the old man tutorial and prof. oak pikachu battle
+.doSimulatedMenuInput
; Temporarily save the player name in wLinkEnemyTrainerName.
; Since wLinkEnemyTrainerName == wGrassRate, this affects wild encounters.
; The wGrassRate byte and following wGrassMons buffer are supposed
; to get overwritten when entering a map with wild Pokémon,
; but an oversight prevents this in Cinnabar and Route 21,
; so the infamous MissingNo. glitch can show up.
+ ; However, this has been fixed in Yellow.
ld hl, wPlayerName
ld de, wLinkEnemyTrainerName
ld bc, NAME_LENGTH
call CopyData
ld hl, .oldManName
+ ld a, [wBattleType]
+ dec a
+ jr z, .useOldManName
+ ld hl, .profOakName
+.useOldManName
ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyData
; the following simulates the keystrokes by drawing menus on screen
hlcoord 9, 14
ld [hl], "▶"
- ld c, 80
+ ld c, 20
call DelayFrames
ld [hl], " "
hlcoord 9, 16
ld [hl], "▶"
- ld c, 50
+ ld c, 20
call DelayFrames
ld [hl], "▷"
ld a, $2 ; select the "ITEM" menu
jp .upperLeftMenuItemWasNotSelected
.oldManName
db "OLD MAN@"
+.profOakName
+ db "PROF.OAK@"
.handleBattleMenuInput
ld a, [wBattleAndStartSavedMenuItem]
ld [wCurrentMenuItem], a
@@ -2129,6 +2216,9 @@ DisplayBattleMenu::
.AButtonPressed
call PlaceUnfilledArrowMenuCursor
ld a, [wBattleType]
+ cp BATTLE_TYPE_RUN
+ jr z, .handleUnusedBattle
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, [wCurrentMenuItem]
ld [wBattleAndStartSavedMenuItem], a
@@ -2160,7 +2250,18 @@ DisplayBattleMenu::
.throwSafariBallWasSelected
ld a, SAFARI_BALL
ld [wcf91], a
- jr UseBagItem
+ jp UseBagItem
+.handleUnusedBattle
+ ld a, [wCurrentMenuItem]
+ cp $3
+ jp z, BattleMenu_RunWasSelected
+ ld hl, .RunAwayText
+ call PrintText
+ jp DisplayBattleMenu
+
+.RunAwayText
+ text_far _RunAwayText
+ text_end
.upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected
cp $2
@@ -2197,18 +2298,22 @@ BagWasSelected:
call DrawHUDsAndHPBars
.next
ld a, [wBattleType]
- dec a ; is it the old man tutorial?
- jr nz, DisplayPlayerBag ; no, it is a normal battle
- ld hl, OldManItemList
+ cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial?
+ jr z, .simulatedInputBattle
+ cp BATTLE_TYPE_PIKACHU ; is it the prof oak battle with pikachu?
+ jr z, .simulatedInputBattle
+ jr DisplayPlayerBag
+.simulatedInputBattle
+ ld hl, SimulatedInputBattleItemList
ld a, l
ld [wListPointer], a
ld a, h
ld [wListPointer + 1], a
jr DisplayBagMenu
-OldManItemList:
+SimulatedInputBattleItemList:
db 1 ; # items
- db POKE_BALL, 50
+ db POKE_BALL, 1
db -1 ; end
DisplayPlayerBag:
@@ -2368,6 +2473,8 @@ PartyMenuOrRockOrRun:
predef StatusScreen
predef StatusScreen2
; now we need to reload the enemy mon pic
+ ld a, 1
+ ldh [hWhoseTurn], a
ld a, [wEnemyBattleStatus2]
bit HAS_SUBSTITUTE_UP, a ; does the enemy mon have a substitute?
ld hl, AnimationSubstitute
@@ -2487,8 +2594,7 @@ MoveSelectionMenu:
ld hl, wBattleMonMoves
call .loadmoves
hlcoord 4, 12
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
di ; out of pure coincidence, it is possible for vblank to occur between the di and ei
; so it is necessary to put the di ei block to not cause tearing
call TextBoxBorder
@@ -2506,8 +2612,7 @@ MoveSelectionMenu:
ld hl, wEnemyMonMoves
call .loadmoves
hlcoord 0, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
hlcoord 2, 8
call .writemoves
@@ -2521,8 +2626,7 @@ MoveSelectionMenu:
call AddNTimes
call .loadmoves
hlcoord 4, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
hlcoord 6, 8
call .writemoves
@@ -2536,8 +2640,6 @@ MoveSelectionMenu:
ld a, [wMoveMenuType]
cp $1
jr z, .selectedmoveknown
- ld a, $1
- jr nc, .selectedmoveknown
ld a, [wPlayerMoveListIndex]
inc a
.selectedmoveknown
@@ -2609,6 +2711,14 @@ SelectMenuItem:
jp nz, SelectMenuItem_CursorDown
bit BIT_SELECT, a
jp nz, SwapMovesInMenu
+IF DEF(_DEBUG)
+ bit BIT_START, a
+ jp nz, Func_3d4f5
+ bit BIT_D_RIGHT, a
+ jp nz, Func_3d529
+ bit BIT_D_LEFT, a
+ jp nz, Func_3d523
+ENDC
bit BIT_B_BUTTON, a
push af
xor a
@@ -2703,6 +2813,55 @@ SelectMenuItem_CursorDown:
ld [wCurrentMenuItem], a
jp SelectMenuItem
+Func_3d4f5:
+ bit 3, a
+ ld a, $0
+ jr nz, .asm_3d4fd
+ ld a, $1
+.asm_3d4fd
+ ldh [hWhoseTurn], a
+ call LoadScreenTilesFromBuffer1
+ call Func_3d536
+ ld a, [wTestBattlePlayerSelectedMove]
+ and a
+ jp z, MoveSelectionMenu
+ ld [wAnimationID], a
+ xor a
+ ld [wAnimationType], a
+ predef MoveAnimation
+ callfar Func_78e98
+ jp MoveSelectionMenu
+
+Func_3d523:
+ ld a, [wTestBattlePlayerSelectedMove]
+ dec a
+ jr asm_3d52d
+Func_3d529:
+ ld a, [wTestBattlePlayerSelectedMove]
+ inc a
+asm_3d52d:
+ ld [wTestBattlePlayerSelectedMove], a
+ call Func_3d536
+ jp MoveSelectionMenu
+
+Func_3d536:
+ hlcoord 10, 16
+ lb bc, 2, 10
+ call ClearScreenArea
+ hlcoord 10, 17
+ ld de, wTestBattlePlayerSelectedMove
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ ld a, [wTestBattlePlayerSelectedMove]
+ and a
+ ret z
+ cp STRUGGLE
+ ret nc
+ ld [wd11e], a
+ call GetMoveName
+ hlcoord 13, 17
+ jp PlaceString
+
AnyMoveToSelect:
; return z and Struggle as the selected move if all moves have 0 PP and/or are disabled
ld a, STRUGGLE
@@ -2736,7 +2895,10 @@ AnyMoveToSelect:
or c
jr .handleDisabledMovePPLoop
.allMovesChecked
- and a ; any PP left?
+; bugfix: only check PP value and not PP up bits
+; in case all other moves have no PP left and a move has a PP up used on it
+; and a non-PP up move is disabled
+ and $3f ; any PP left?
ret nz ; return if a move has PP left
.noMovesLeft
ld hl, NoMovesLeftText
@@ -2751,6 +2913,14 @@ NoMovesLeftText:
text_end
SwapMovesInMenu:
+IF DEF(_DEBUG)
+ ld a, [wFlags_D733]
+ bit BIT_TEST_BATTLE, a
+ jp nz, Func_3d4f5
+ENDC
+ ld a, [wPlayerBattleStatus3]
+ bit TRANSFORMED, a
+ jp nz, MoveSelectionMenu
ld a, [wMenuItemToSwap]
and a
jr z, .noMenuItemSelected
@@ -2830,8 +3000,7 @@ PrintMenuItem:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 0, 8
- ld b, 3
- ld c, 9
+ lb bc, 3, 9
call TextBoxBorder
ld a, [wPlayerDisabledMove]
and a
@@ -2898,7 +3067,7 @@ PrintMenuItem:
jp Delay3
DisabledText:
- db "disabled!@"
+ db "Disabled!@"
TypeText:
db "TYPE@"
@@ -4991,7 +5160,7 @@ AttackSubstitute:
ldh a, [hWhoseTurn]
xor $01
ldh [hWhoseTurn], a
- callfar HideSubstituteShowMonAnim ; animate the substitute breaking
+ callfar Func_79929 ; animate the substitute breaking
; flip the turn back to the way it was
ldh a, [hWhoseTurn]
xor $01
@@ -5322,6 +5491,17 @@ AIGetTypeEffectiveness:
inc hl
jr .loop
.done
+ ; 40% chance for Lorelei's Dewgong to ignore type effectiveness?
+ ld a, [wTrainerClass]
+ cp LORELEI
+ jr nz, .ok
+ ld a, [wEnemyMonSpecies]
+ cp DEWGONG
+ jr nz, .ok
+ call BattleRandom
+ cp $66 ; 40 percent
+ ret c
+.ok
ld a, [hl]
ld [wTypeEffectiveness], a ; store damage multiplier
ret
@@ -6302,13 +6482,17 @@ SwapPlayerAndEnemyLevels:
; (for use when scrolling the player sprite and enemy's silhouettes on screen)
LoadPlayerBackPic:
ld a, [wBattleType]
- dec a ; is it the old man tutorial?
- ld de, RedPicBack
- jr nz, .next
ld de, OldManPicBack
+ cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial?
+ jr z, .next
+ ld de, ProfOakPicBack
+ cp BATTLE_TYPE_PIKACHU ; is it the pikachu battle at the beginning of the game?
+ jr z, .next
+ ld de, RedPicBack
.next
ld a, BANK(RedPicBack)
ASSERT BANK(RedPicBack) == BANK(OldManPicBack)
+ ASSERT BANK(RedPicBack) == BANK(ProfOakPicBack)
call UncompressSpriteFromDE
predef ScaleSpriteByTwo
ld hl, wOAMBuffer
@@ -6331,6 +6515,8 @@ LoadPlayerBackPic:
ld [hli], a ; OAM tile number
inc a ; increment tile number
ldh [hOAMTile], a
+ ld a, $2
+ ld [hl], a
inc hl
dec c
jr nz, .innerLoop
@@ -6344,18 +6530,15 @@ LoadPlayerBackPic:
jr nz, .loop
ld de, vBackPic
call InterlaceMergeSpriteBuffers
- ld a, $a
- ld [MBC1SRamEnable], a
- xor a
- ld [MBC1SRamBank], a
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, vSprites
ld de, sSpriteBuffer1
ldh a, [hLoadedROMBank]
ld b, a
ld c, 7 * 7
call CopyVideoData
- xor a
- ld [MBC1SRamEnable], a
+ call PrepareRTCDataAndDisableSRAM
ld a, $31
ldh [hStartTileID], a
hlcoord 1, 5
@@ -6727,288 +6910,6 @@ HandleExplodingAnimation:
PlayMoveAnimation:
ld [wAnimationID], a
call Delay3
- predef_jump MoveAnimation
-
-InitBattle::
- ld a, [wCurOpponent]
- and a
- jr z, DetermineWildOpponent
-
-InitOpponent:
- ld a, [wCurOpponent]
- ld [wcf91], a
- ld [wEnemyMonSpecies2], a
- jr InitBattleCommon
-
-DetermineWildOpponent:
- ld a, [wd732]
- bit 1, a
- jr z, .asm_3ef2f
- ldh a, [hJoyHeld]
- bit 1, a ; B button pressed?
- ret nz
-.asm_3ef2f
- ld a, [wNumberOfNoRandomBattleStepsLeft]
- and a
- ret nz
- callfar TryDoWildEncounter
- ret nz
-InitBattleCommon:
- ld a, [wMapPalOffset]
- push af
- ld hl, wLetterPrintingDelayFlags
- ld a, [hl]
- push af
- res 1, [hl]
- callfar InitBattleVariables
- ld a, [wEnemyMonSpecies2]
- sub OPP_ID_OFFSET
- jp c, InitWildBattle
- ld [wTrainerClass], a
- call GetTrainerInformation
- callfar ReadTrainer
- call DoBattleTransitionAndInitBattleVariables
- call _LoadTrainerPic
- xor a
- ld [wEnemyMonSpecies2], a
- ldh [hStartTileID], a
- dec a
- ld [wAICount], a
- hlcoord 12, 0
- predef CopyUncompressedPicToTilemap
- ld a, $ff
- ld [wEnemyMonPartyPos], a
- ld a, $2
- ld [wIsInBattle], a
- jp _InitBattleCommon
-
-InitWildBattle:
- ld a, $1
- ld [wIsInBattle], a
- call LoadEnemyMonData
- call DoBattleTransitionAndInitBattleVariables
- ld a, [wCurOpponent]
- cp RESTLESS_SOUL
- jr z, .isGhost
- call IsGhostBattle
- jr nz, .isNoGhost
-.isGhost
- ld hl, wMonHSpriteDim
- ld a, $66
- ld [hli], a ; write sprite dimensions
- ld bc, GhostPic
- ld a, c
- ld [hli], a ; write front sprite pointer
- ld [hl], b
- ld hl, wEnemyMonNick ; set name to "GHOST"
- ld a, "G"
- ld [hli], a
- ld a, "H"
- ld [hli], a
- ld a, "O"
- ld [hli], a
- ld a, "S"
- ld [hli], a
- ld a, "T"
- ld [hli], a
- ld [hl], "@"
- ld a, [wcf91]
- push af
- ld a, MON_GHOST
- ld [wcf91], a
- ld de, vFrontPic
- call LoadMonFrontSprite ; load ghost sprite
- pop af
- ld [wcf91], a
- jr .spriteLoaded
-.isNoGhost
- ld de, vFrontPic
- call LoadMonFrontSprite ; load mon sprite
-.spriteLoaded
- xor a
- ld [wTrainerClass], a
- ldh [hStartTileID], a
- hlcoord 12, 0
- predef CopyUncompressedPicToTilemap
-
-; common code that executes after init battle code specific to trainer or wild battles
-_InitBattleCommon:
- ld b, SET_PAL_BATTLE_BLACK
- call RunPaletteCommand
- call SlidePlayerAndEnemySilhouettesOnScreen
- xor a
- ldh [hAutoBGTransferEnabled], a
- ld hl, .emptyString
- call PrintText
- call SaveScreenTilesToBuffer1
- call ClearScreen
- ld a, $98
- ldh [hAutoBGTransferDest + 1], a
- ld a, $1
- ldh [hAutoBGTransferEnabled], a
- call Delay3
- ld a, $9c
- ldh [hAutoBGTransferDest + 1], a
- call LoadScreenTilesFromBuffer1
- hlcoord 9, 7
- lb bc, 5, 10
- call ClearScreenArea
- hlcoord 1, 0
- lb bc, 4, 10
- call ClearScreenArea
- call ClearSprites
- ld a, [wIsInBattle]
- dec a ; is it a wild battle?
- call z, DrawEnemyHUDAndHPBar ; draw enemy HUD and HP bar if it's a wild battle
- call StartBattle
- callfar EndOfBattle
- pop af
- ld [wLetterPrintingDelayFlags], a
- pop af
- ld [wMapPalOffset], a
- ld a, [wSavedTileAnimations]
- ldh [hTileAnimations], a
- scf
- ret
-.emptyString
- db "@"
-
-_LoadTrainerPic:
-; wd033-wd034 contain pointer to pic
- ld a, [wTrainerPicPointer]
- ld e, a
- ld a, [wTrainerPicPointer + 1]
- ld d, a ; de contains pointer to trainer pic
- ld a, [wLinkState]
- and a
- ld a, BANK("Pics 6") ; this is where all the trainer pics are (not counting Red's)
- jr z, .loadSprite
- ld a, BANK(RedPicFront)
-.loadSprite
- call UncompressSpriteFromDE
- ld de, vFrontPic
- ld a, $77
- ld c, a
- jp LoadUncompressedSpriteData
-
-; unreferenced
-ResetCryModifiers:
- xor a
- ld [wFrequencyModifier], a
- ld [wTempoModifier], a
- jp PlaySound
-
-; animates the mon "growing" out of the pokeball
-AnimateSendingOutMon:
- ld a, [wPredefHL]
- ld h, a
- ld a, [wPredefHL + 1]
- ld l, a
- ldh a, [hStartTileID]
- ldh [hBaseTileID], a
- ld b, $4c
- ld a, [wIsInBattle]
- and a
- jr z, .notInBattle
- add b
- ld [hl], a
- call Delay3
- ld bc, -(SCREEN_WIDTH * 2 + 1)
- add hl, bc
- ld a, 1
- ld [wDownscaledMonSize], a
- lb bc, 3, 3
- predef CopyDownscaledMonTiles
- ld c, 4
- call DelayFrames
- ld bc, -(SCREEN_WIDTH * 2 + 1)
- add hl, bc
- xor a
- ld [wDownscaledMonSize], a
- lb bc, 5, 5
- predef CopyDownscaledMonTiles
- ld c, 5
- call DelayFrames
- ld bc, -(SCREEN_WIDTH * 2 + 1)
- jr .next
-.notInBattle
- ld bc, -(SCREEN_WIDTH * 6 + 3)
-.next
- add hl, bc
- ldh a, [hBaseTileID]
- add $31
- jr CopyUncompressedPicToHL
-
-CopyUncompressedPicToTilemap:
- ld a, [wPredefHL]
- ld h, a
- ld a, [wPredefHL + 1]
- ld l, a
- ldh a, [hStartTileID]
-CopyUncompressedPicToHL::
- lb bc, 7, 7
- ld de, SCREEN_WIDTH
- push af
- ld a, [wSpriteFlipped]
- and a
- jr nz, .flipped
- pop af
-.loop
- push bc
- push hl
-.innerLoop
- ld [hl], a
- add hl, de
- inc a
- dec c
- jr nz, .innerLoop
- pop hl
- inc hl
- pop bc
- dec b
- jr nz, .loop
- ret
-
-.flipped
- push bc
- ld b, 0
- dec c
- add hl, bc
- pop bc
- pop af
-.flippedLoop
- push bc
- push hl
-.flippedInnerLoop
- ld [hl], a
- add hl, de
- inc a
- dec c
- jr nz, .flippedInnerLoop
- pop hl
- dec hl
- pop bc
- dec b
- jr nz, .flippedLoop
+ predef MoveAnimation
+ callfar Func_78e98
ret
-
-LoadMonBackPic:
-; Assumes the monster's attributes have
-; been loaded with GetMonHeader.
- ld a, [wBattleMonSpecies2]
- ld [wcf91], a
- hlcoord 1, 5
- ld b, 7
- ld c, 8
- call ClearScreenArea
- ld hl, wMonHBackSprite - wMonHeader
- call UncompressMonSprite
- predef ScaleSpriteByTwo
- ld de, vBackPic
- call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite
- ld hl, vSprites
- ld de, vBackPic
- ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied
- ldh a, [hLoadedROMBank]
- ld b, a
- jp CopyVideoData
diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm
index 097a0fcc..6aed1d0a 100644
--- a/engine/battle/draw_hud_pokeball_gfx.asm
+++ b/engine/battle/draw_hud_pokeball_gfx.asm
@@ -27,6 +27,8 @@ SetupOwnPartyPokeballs:
ld [hl], a
ld a, 8
ld [wHUDPokeballGfxOffsetX], a
+ xor a
+ ld [wdef5], a
ld hl, wOAMBuffer
jp WritePokeballOAMData
@@ -41,6 +43,8 @@ SetupEnemyPartyPokeballs:
ld [hl], $20
ld a, -8
ld [wHUDPokeballGfxOffsetX], a
+ ld a, $1
+ ld [wdef5], a
ld hl, wOAMBuffer + PARTY_LENGTH * 4
jp WritePokeballOAMData
@@ -104,7 +108,7 @@ WritePokeballOAMData:
ld [hli], a
ld a, [de]
ld [hli], a
- xor a
+ ld a, [wdef5]
ld [hli], a
ld a, [wBaseCoordX]
ld b, a
@@ -174,6 +178,8 @@ SetupPlayerAndEnemyPokeballs:
ld [hl], $40
ld a, 8
ld [wHUDPokeballGfxOffsetX], a
+ xor a
+ ld [wdef5], a
ld hl, wOAMBuffer
call WritePokeballOAMData
ld hl, wEnemyMons
@@ -183,6 +189,8 @@ SetupPlayerAndEnemyPokeballs:
ld a, $50
ld [hli], a
ld [hl], $68
+ ld a, $1
+ ld [wdef5], a
ld hl, wOAMBuffer + $18
jp WritePokeballOAMData
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index 067c096e..6f860cd2 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -60,6 +60,16 @@ SleepEffect:
call BattleRandom
and $7
jr z, .setSleepCounter
+ ld b, a
+ ld a, [wUnknownSerialFlag_d499]
+ and a
+ jr z, .asm_3f1ba ; XXX stadium stuff?
+ ld a, b
+ and $3
+ jr z, .setSleepCounter
+ ld b, a
+.asm_3f1ba
+ ld a, b
ld [de], a
call PlayCurrentMoveAnimation2
ld hl, FellAsleepText
@@ -211,6 +221,16 @@ FreezeBurnParalyzeEffect:
cp b ; do target type 2 and move type match?
ret z ; return if they match
ld a, [wPlayerMoveEffect]
+ cp UNUSED_EFFECT_23 ; more stadium stuff
+ jr nz, .asm_3f2c7
+ ld a, [wUnknownSerialFlag_d499]
+ and a
+ ld a, FREEZE_SIDE_EFFECT
+ ld b, 30 percent + 1
+ jr z, .regular_effectiveness
+ ld b, 10 percent + 1
+ jr .regular_effectiveness
+.asm_3f2c7
cp PARALYZE_SIDE_EFFECT1 + 1
ld b, 10 percent + 1
jr c, .regular_effectiveness
@@ -264,6 +284,16 @@ FreezeBurnParalyzeEffect:
cp b
ret z
ld a, [wEnemyMoveEffect]
+ cp UNUSED_EFFECT_23 ; more stadium stuff
+ jr nz, .asm_3f341
+ ld a, [wUnknownSerialFlag_d499]
+ and a
+ ld a, FREEZE_SIDE_EFFECT
+ ld b, 30 percent + 1
+ jr z, .regular_effectiveness2
+ ld b, 10 percent + 1
+ jr .regular_effectiveness2
+.asm_3f341
cp PARALYZE_SIDE_EFFECT1 + 1
ld b, 10 percent + 1
jr c, .regular_effectiveness2
@@ -285,17 +315,23 @@ FreezeBurnParalyzeEffect:
ld a, 1 << PAR
ld [wBattleMonStatus], a
call QuarterSpeedDueToParalysis
+ ld a, ANIM_C7
+ call PlayBattleAnimation2
jp PrintMayNotAttackText
.burn2
ld a, 1 << BRN
ld [wBattleMonStatus], a
call HalveAttackDueToBurn
+ ld a, ANIM_C7
+ call PlayBattleAnimation2
ld hl, BurnedText
jp PrintText
.freeze2
; hyper beam bits aren't reseted for opponent's side
ld a, 1 << FRZ
ld [wBattleMonStatus], a
+ ld a, ANIM_C7
+ call PlayBattleAnimation2
ld hl, FrozenText
jp PrintText
@@ -474,9 +510,9 @@ UpdateStatDone:
bit HAS_SUBSTITUTE_UP, [hl]
push af
push bc
+ push de
ld hl, HideSubstituteShowMonAnim
ld b, BANK(HideSubstituteShowMonAnim)
- push de
call nz, Bankswitch
pop de
.notMinimize
@@ -977,6 +1013,9 @@ FlinchSideEffect:
ld hl, wPlayerBattleStatus1
ld de, wEnemyMoveEffect
.flinchSideEffect
+ ld a, [wLinkState]
+ cp LINK_STATE_BATTLING
+ call z, ClearHyperBeam
ld a, [de]
cp FLINCH_SIDE_EFFECT1
ld b, $1a ; ~10% chance of flinch
@@ -1018,10 +1057,27 @@ ChargeEffect:
set INVULNERABLE, [hl] ; mon is now invulnerable to typical attacks (fly/dig)
ld b, ANIM_C0
.notDigOrFly
+ push de
+ push bc
+ inc hl ; battle status 2
+ push hl
+ ld a, [hl]
+ bit HAS_SUBSTITUTE_UP, a
+ ld hl, HideSubstituteShowMonAnim
+ ld b, BANK(HideSubstituteShowMonAnim)
+ call nz, Bankswitch
+ pop hl
+ pop bc
xor a
ld [wAnimationType], a
ld a, b
call PlayBattleAnimation
+ ld a, [hl]
+ bit HAS_SUBSTITUTE_UP, a
+ ld hl, ReshowSubstituteAnim
+ ld b, BANK(ReshowSubstituteAnim)
+ call nz, Bankswitch
+ pop de
ld a, [de]
ld [wChargeMoveNum], a
ld hl, ChargeMoveEffectText
@@ -1491,6 +1547,7 @@ PlayBattleAnimationGotID:
push de
push bc
predef MoveAnimation
+ callfar Func_78e98
pop bc
pop de
pop hl
diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm
index bd4a1901..e64f54e7 100644
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -10,6 +10,8 @@ EndOfBattle:
ld a, [wEnemyMonStatus]
ld [hl], a
call ClearScreen
+ ld b, SET_PAL_OVERWORLD
+ call RunPaletteCommand
callfar DisplayLinkBattleVersusTextBox
ld a, [wBattleResult]
cp $1
@@ -43,6 +45,8 @@ EndOfBattle:
xor a
ld [wForceEvolution], a
predef EvolutionAfterBattle
+ ld d, $82
+ callfar UpdatePikachuMoodAfterBattle
.resetVariables
xor a
ld [wLowHealthAlarm], a ;disable low health alarm
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index 0eab6e08..61fbdfa3 100644
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -43,7 +43,7 @@ GainExperience:
inc de
jr .nextBaseStat
.maxStatExp ; if the upper byte also overflowed, then we have hit the max stat exp
- ld a, $ff
+ dec a ; ld a, $ff; a is 0 from previous check
ld [de], a
inc de
ld [de], a
@@ -233,13 +233,19 @@ GainExperience:
.recalcStatChanges
xor a ; battle mon
ld [wCalculateWhoseStats], a
- callfar CalculateModifiedStats
- callfar ApplyBurnAndParalysisPenaltiesToPlayer
- callfar ApplyBadgeStatBoosts
- callfar DrawPlayerHUDAndHPBar
- callfar PrintEmptyString
+ ld hl, CalculateModifiedStats
+ call CallBattleCore
+ ld hl, ApplyBurnAndParalysisPenaltiesToPlayer
+ call CallBattleCore
+ ld hl, ApplyBadgeStatBoosts
+ call CallBattleCore
+ ld hl, DrawPlayerHUDAndHPBar
+ call CallBattleCore
+ ld hl, PrintEmptyString
+ call CallBattleCore
call SaveScreenTilesToBuffer1
.printGrewLevelText
+ callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
ld hl, GrewLevelText
call PrintText
xor a ; PLAYER_PARTY_DATA
@@ -339,6 +345,10 @@ BoostExp:
ldh [hQuotient + 2], a
ret
+CallBattleCore:
+ ld b, BANK(BattleCore)
+ jp Bankswitch
+
GainedText:
text_far _GainedText
text_asm
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 9c1ad96f..fd21b29e 100644
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -2,6 +2,7 @@ MarowakAnim:
; animate the ghost being unveiled as a Marowak
ld a, $e4
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
hlcoord 12, 0
@@ -27,6 +28,7 @@ MarowakAnim:
sla a
sla a
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
jr nz, .fadeOutGhostLoop
call ClearSprites
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
@@ -40,6 +42,7 @@ MarowakAnim:
srl b
rra
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
ld a, b
and a
jr nz, .fadeInMarowakLoop
@@ -74,7 +77,7 @@ CopyMonPicFromBGToSpriteVRAM:
ld [hli], a
ld a, d
ld [hli], a
- ld a, OAM_OBP1
+ ld a, OAM_OBP1 | OAM_HIGH_PALS
ld [hli], a
inc d
dec c
diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm
new file mode 100644
index 00000000..680befda
--- /dev/null
+++ b/engine/battle/init_battle.asm
@@ -0,0 +1,283 @@
+InitBattle::
+ ld a, [wCurOpponent]
+ and a
+ jr z, DetermineWildOpponent
+
+InitOpponent:
+ ld a, [wCurOpponent]
+ ld [wcf91], a
+ ld [wEnemyMonSpecies2], a
+ jr InitBattleCommon
+
+DetermineWildOpponent:
+ ld a, [wd732]
+ bit 1, a
+ jr z, .asm_3ef2f
+ ldh a, [hJoyHeld]
+ bit 1, a ; B button pressed?
+ ret nz
+.asm_3ef2f
+ ld a, [wNumberOfNoRandomBattleStepsLeft]
+ and a
+ ret nz
+ callfar TryDoWildEncounter
+ ret nz
+InitBattleCommon:
+ ld a, [wMapPalOffset]
+ push af
+ ld hl, wLetterPrintingDelayFlags
+ ld a, [hl]
+ push af
+ res 1, [hl]
+ call InitBattleVariables
+ ld a, [wEnemyMonSpecies2]
+ sub OPP_ID_OFFSET
+ jp c, InitWildBattle
+ ld [wTrainerClass], a
+ call GetTrainerInformation
+ callfar ReadTrainer
+ callfar DoBattleTransitionAndInitBattleVariables
+ call _LoadTrainerPic
+ xor a
+ ld [wEnemyMonSpecies2], a
+ ldh [hStartTileID], a
+ dec a
+ ld [wAICount], a
+ hlcoord 12, 0
+ predef CopyUncompressedPicToTilemap
+ ld a, $ff
+ ld [wEnemyMonPartyPos], a
+ ld a, $2
+ ld [wIsInBattle], a
+
+; Is this a major story battle?
+ ld a, [wLoneAttackNo]
+ and a
+ jp z, _InitBattleCommon
+ callabd_ModifyPikachuHappiness PIKAHAPPY_GYMLEADER ; useless since already in bank3d
+ jp _InitBattleCommon
+
+InitWildBattle:
+ ld a, $1
+ ld [wIsInBattle], a
+ callfar LoadEnemyMonData
+ callfar DoBattleTransitionAndInitBattleVariables
+ ld a, [wCurOpponent]
+ cp RESTLESS_SOUL
+ jr z, .isGhost
+ callfar IsGhostBattle
+ jr nz, .isNoGhost
+.isGhost
+ ld hl, wMonHSpriteDim
+ ld a, $66
+ ld [hli], a ; write sprite dimensions
+ ld bc, GhostPic
+ ld a, c
+ ld [hli], a ; write front sprite pointer
+ ld [hl], b
+ ld hl, wEnemyMonNick ; set name to "GHOST"
+ ld a, "G"
+ ld [hli], a
+ ld a, "H"
+ ld [hli], a
+ ld a, "O"
+ ld [hli], a
+ ld a, "S"
+ ld [hli], a
+ ld a, "T"
+ ld [hli], a
+ ld [hl], "@"
+ ld a, [wcf91]
+ push af
+ ld a, MON_GHOST
+ ld [wcf91], a
+ ld de, vFrontPic
+ call LoadMonFrontSprite ; load ghost sprite
+ pop af
+ ld [wcf91], a
+ jr .spriteLoaded
+.isNoGhost
+ ld de, vFrontPic
+ call LoadMonFrontSprite ; load mon sprite
+.spriteLoaded
+ xor a
+ ld [wTrainerClass], a
+ ldh [hStartTileID], a
+ hlcoord 12, 0
+ predef CopyUncompressedPicToTilemap
+
+; common code that executes after init battle code specific to trainer or wild battles
+_InitBattleCommon:
+ ld b, SET_PAL_BATTLE_BLACK
+ call RunPaletteCommand
+ callfar SlidePlayerAndEnemySilhouettesOnScreen
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ld hl, .emptyString
+ call PrintText
+ call SaveScreenTilesToBuffer1
+ call ClearScreen
+ ld a, $98
+ ldh [hAutoBGTransferDest + 1], a
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ ld a, $9c
+ ldh [hAutoBGTransferDest + 1], a
+ call LoadScreenTilesFromBuffer1
+ hlcoord 9, 7
+ lb bc, 5, 10
+ call ClearScreenArea
+ hlcoord 1, 0
+ lb bc, 4, 10
+ call ClearScreenArea
+ call ClearSprites
+ ld a, [wIsInBattle]
+ dec a ; is it a wild battle?
+ ld hl, DrawEnemyHUDAndHPBar
+ ld b, BANK(DrawEnemyHUDAndHPBar)
+ call z, Bankswitch ; draw enemy HUD and HP bar if it's a wild battle
+ callfar StartBattle
+ callfar EndOfBattle
+ pop af
+ ld [wLetterPrintingDelayFlags], a
+ pop af
+ ld [wMapPalOffset], a
+ ld a, [wSavedTileAnimations]
+ ldh [hTileAnimations], a
+ scf
+ ret
+.emptyString
+ db "@"
+
+_LoadTrainerPic:
+; wd033-wd034 contain pointer to pic
+ ld a, [wTrainerPicPointer]
+ ld e, a
+ ld a, [wTrainerPicPointer + 1]
+ ld d, a ; de contains pointer to trainer pic
+ ld a, [wLinkState]
+ and a
+ ld a, BANK("Pics 6") ; this is where all the trainer pics are (not counting Red's)
+ jr z, .loadSprite
+ ld a, BANK(RedPicFront)
+.loadSprite
+ call UncompressSpriteFromDE
+ ld de, vFrontPic
+ ld a, $77
+ ld c, a
+ jp LoadUncompressedSpriteData
+
+LoadMonBackPic:
+; Assumes the monster's attributes have
+; been loaded with GetMonHeader.
+ ld a, [wBattleMonSpecies2]
+ ld [wcf91], a
+ hlcoord 1, 5
+ lb bc, 7, 8
+ call ClearScreenArea
+ ld hl, wMonHBackSprite - wMonHeader
+ call UncompressMonSprite
+ predef ScaleSpriteByTwo
+ ld de, vBackPic
+ call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite
+ ld hl, vSprites
+ ld de, vBackPic
+ ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied
+ ldh a, [hLoadedROMBank]
+ ld b, a
+ jp CopyVideoData
+
+; animates the mon "growing" out of the pokeball
+AnimateSendingOutMon:
+ ld a, [wPredefHL]
+ ld h, a
+ ld a, [wPredefHL + 1]
+ ld l, a
+ ldh a, [hStartTileID]
+ ldh [hBaseTileID], a
+ ld b, $4c
+ ld a, [wIsInBattle]
+ and a
+ jr z, .notInBattle
+ add b
+ ld [hl], a
+ call Delay3
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
+ add hl, bc
+ ld a, 1
+ ld [wDownscaledMonSize], a
+ lb bc, 3, 3
+ predef CopyDownscaledMonTiles
+ ld c, 4
+ call DelayFrames
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
+ add hl, bc
+ xor a
+ ld [wDownscaledMonSize], a
+ lb bc, 5, 5
+ predef CopyDownscaledMonTiles
+ ld c, 5
+ call DelayFrames
+ ld bc, -(SCREEN_WIDTH * 2 + 1)
+ jr .next
+.notInBattle
+ ld bc, -(SCREEN_WIDTH * 6 + 3)
+.next
+ add hl, bc
+ ldh a, [hBaseTileID]
+ add $31
+ jr CopyUncompressedPicToHL
+
+CopyUncompressedPicToTilemap:
+ ld a, [wPredefHL]
+ ld h, a
+ ld a, [wPredefHL + 1]
+ ld l, a
+ ldh a, [hStartTileID]
+CopyUncompressedPicToHL::
+ lb bc, 7, 7
+ ld de, SCREEN_WIDTH
+ push af
+ ld a, [wSpriteFlipped]
+ and a
+ jr nz, .flipped
+ pop af
+.loop
+ push bc
+ push hl
+.innerLoop
+ ld [hl], a
+ add hl, de
+ inc a
+ dec c
+ jr nz, .innerLoop
+ pop hl
+ inc hl
+ pop bc
+ dec b
+ jr nz, .loop
+ ret
+
+.flipped
+ push bc
+ ld b, 0
+ dec c
+ add hl, bc
+ pop bc
+ pop af
+.flippedLoop
+ push bc
+ push hl
+.flippedInnerLoop
+ ld [hl], a
+ add hl, de
+ inc a
+ dec c
+ jr nz, .flippedInnerLoop
+ pop hl
+ dec hl
+ pop bc
+ dec b
+ jr nz, .flippedLoop
+ ret
diff --git a/engine/battle/link_battle_versus_text.asm b/engine/battle/link_battle_versus_text.asm
index 29c11356..e55a0672 100644
--- a/engine/battle/link_battle_versus_text.asm
+++ b/engine/battle/link_battle_versus_text.asm
@@ -2,8 +2,7 @@
DisplayLinkBattleVersusTextBox:
call LoadTextBoxTilePatterns
hlcoord 3, 4
- ld b, 7
- ld c, 12
+ lb bc, 7, 12
call TextBoxBorder
hlcoord 4, 5
ld de, wPlayerName
diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm
index 524ec161..df9145f2 100644
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -101,22 +101,3 @@ InitList:
ld a, b
ld [wItemPrices + 1], a
ret
-
-; get species of mon e in list [wMonDataLocation] for LoadMonData
-GetMonSpecies:
- ld hl, wPartySpecies
- ld a, [wMonDataLocation]
- and a
- jr z, .getSpecies
- dec a
- jr z, .enemyParty
- ld hl, wBoxSpecies
- jr .getSpecies
-.enemyParty
- ld hl, wEnemyPartySpecies
-.getSpecies
- ld d, 0
- add hl, de
- ld a, [hl]
- ld [wcf91], a
- ret
diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm
index 56dda7f4..af47ae1b 100644
--- a/engine/battle/move_effects/transform.asm
+++ b/engine/battle/move_effects/transform.asm
@@ -100,18 +100,11 @@ TransformEffect_:
and a
jr z, .lessThanFourMoves
ld a, $5
- ld [de], a
- inc de
- dec b
- jr nz, .copyPPLoop
- jr .copyStats
.lessThanFourMoves
-; 0 PP for blank moves
- xor a
ld [de], a
inc de
dec b
- jr nz, .lessThanFourMoves
+ jr nz, .copyPPLoop
.copyStats
; original (unmodified) stats and stat mods
pop hl
diff --git a/engine/battle/pikachu_entrance_anim.asm b/engine/battle/pikachu_entrance_anim.asm
new file mode 100644
index 00000000..8af65cee
--- /dev/null
+++ b/engine/battle/pikachu_entrance_anim.asm
@@ -0,0 +1,47 @@
+StarterPikachuBattleEntranceAnimation:
+ hlcoord 0, 5
+ ld c, 0
+.loop1
+ inc c
+ ld a, c
+ cp 9
+ ret z
+ ld d, 7 * 13
+ push bc
+ push hl
+.loop2
+ call .PlaceColumn
+ dec hl
+ ld a, d
+ sub 7
+ ld d, a
+ dec c
+ jr nz, .loop2
+ ld c, 2
+ call DelayFrames
+ pop hl
+ pop bc
+ inc hl
+ jr .loop1
+
+.PlaceColumn:
+ push hl
+ push de
+ push bc
+ ld e, 7
+.loop3
+ ld a, d
+ cp 7 * 7
+ jr nc, .okay
+ ld a, $7f
+.okay
+ ld [hl], a
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ inc d
+ dec e
+ jr nz, .loop3
+ pop bc
+ pop de
+ pop hl
+ ret
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index a9e09a30..8fa323b5 100644
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -15,8 +15,8 @@ ReadTrainer:
ld [hl], a
; get the pointer to trainer data for this class
- ld a, [wCurOpponent]
- sub OPP_ID_OFFSET + 1 ; convert value from pokemon to trainer
+ ld a, [wTrainerClass] ; get trainer class
+ dec a
add a
ld hl, TrainerDataPointers
ld c, a
@@ -53,7 +53,7 @@ ReadTrainer:
.LoopTrainerData
ld a, [hli]
and a ; have we reached the end of the trainer data?
- jr z, .FinishUp
+ jp z, .AddAdditionalMoveData
ld [wcf91], a ; write species somewhere (XXX why?)
ld a, ENEMY_PARTY_DATA
ld [wMonDataLocation], a
@@ -68,7 +68,7 @@ ReadTrainer:
; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move
ld a, [hli]
and a ; have we reached the end of the trainer data?
- jr z, .AddLoneMove
+ jr z, .AddAdditionalMoveData
ld [wCurEnemyLVL], a
ld a, [hli]
ld [wcf91], a
@@ -78,69 +78,48 @@ ReadTrainer:
call AddPartyMon
pop hl
jr .SpecialTrainer
-.AddLoneMove
-; does the trainer have a single monster with a different move?
- ld a, [wLoneAttackNo] ; Brock is 01, Misty is 02, Erika is 04, etc
+.AddAdditionalMoveData
+; does the trainer have additional move data?
+ ld a, [wTrainerClass]
+ ld b, a
+ ld a, [wTrainerNo]
+ ld c, a
+ ld hl, SpecialTrainerMoves
+.loopAdditionalMoveData
+ ld a, [hli]
+ cp $ff
+ jr z, .FinishUp
+ cp b
+ jr nz, .asm_39c46
+ ld a, [hli]
+ cp c
+ jr nz, .asm_39c46
+ ld d, h
+ ld e, l
+.writeAdditionalMoveDataLoop
+ ld a, [de]
+ inc de
and a
- jr z, .AddTeamMove
+ jp z, .FinishUp
+ dec a
+ ld hl, wEnemyMon1Moves
+ ld bc, wEnemyMon2 - wEnemyMon1
+ call AddNTimes
+ ld a, [de]
+ inc de
dec a
- add a
ld c, a
ld b, 0
- ld hl, LoneMoves
add hl, bc
+ ld a, [de]
+ inc de
+ ld [hl], a
+ jr .writeAdditionalMoveDataLoop
+.asm_39c46
ld a, [hli]
- ld d, [hl]
- ld hl, wEnemyMon1Moves + 2
- ld bc, wEnemyMon2 - wEnemyMon1
- call AddNTimes
- ld [hl], d
- jr .FinishUp
-.AddTeamMove
-; check if our trainer's team has special moves
-
-; get trainer class number
- ld a, [wCurOpponent]
- sub OPP_ID_OFFSET
- ld b, a
- ld hl, TeamMoves
-
-; iterate through entries in TeamMoves, checking each for our trainer class
-.IterateTeamMoves
- ld a, [hli]
- cp b
- jr z, .GiveTeamMoves ; is there a match?
- inc hl ; if not, go to the next entry
- inc a
- jr nz, .IterateTeamMoves
-
-; no matches found. is this trainer champion rival?
- ld a, b
- cp RIVAL3
- jr z, .ChampionRival
- jr .FinishUp ; nope
-.GiveTeamMoves
- ld a, [hl]
- ld [wEnemyMon5Moves + 2], a
- jr .FinishUp
-.ChampionRival ; give moves to his team
-
-; pidgeot
- ld a, SKY_ATTACK
- ld [wEnemyMon1Moves + 2], a
-
-; starter
- ld a, [wRivalStarter]
- cp STARTER3
- ld b, MEGA_DRAIN
- jr z, .GiveStarterMove
- cp STARTER1
- ld b, FIRE_BLAST
- jr z, .GiveStarterMove
- ld b, BLIZZARD ; must be squirtle
-.GiveStarterMove
- ld a, b
- ld [wEnemyMon6Moves + 2], a
+ and a
+ jr nz, .asm_39c46
+ jr .loopAdditionalMoveData
.FinishUp
; clear wAmountMoneyWon addresses
xor a
diff --git a/engine/battle/scale_sprites.asm b/engine/battle/scale_sprites.asm
index 8b8942e6..38ebff21 100644
--- a/engine/battle/scale_sprites.asm
+++ b/engine/battle/scale_sprites.asm
@@ -2,6 +2,13 @@
; assumes that input sprite chunks are 4x4 tiles, and the rightmost and bottommost 4 pixels will be ignored
; resulting in a 7*7 tile output sprite chunk
ScaleSpriteByTwo:
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
+ call .ScaleSpriteByTwo
+ call PrepareRTCDataAndDisableSRAM
+ ret
+
+.ScaleSpriteByTwo:
ld de, sSpriteBuffer1 + (4*4*8) - 5 ; last byte of input data, last 4 rows already skipped
ld hl, sSpriteBuffer0 + SPRITEBUFFERSIZE - 1 ; end of destination buffer
call ScaleLastSpriteColumnByTwo ; last tile column is special case
diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm
index 0117a057..3efbeeda 100644
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -288,13 +288,19 @@ INCLUDE "data/trainers/special_moves.asm"
INCLUDE "data/trainers/parties.asm"
TrainerAI:
- and a
ld a, [wIsInBattle]
dec a
- ret z ; if not a trainer, we're done here
+ jr z, .done ; if not a trainer, we're done here
ld a, [wLinkState]
cp LINK_STATE_BATTLING
- ret z ; if in a link battle, we're done as well
+ jr z, .done ; if in a link battle, we're done as well
+ ld a, [wEnemyBattleStatus1]
+ and 1 << CHARGING_UP | 1 << THRASHING_ABOUT | 1 << STORING_ENERGY
+ jr nz, .done ; don't follow trainer ai if opponent is in a locked state
+ ld a, [wEnemyBattleStatus2]
+ and 1 << USING_RAGE
+ jr nz, .done ; don't follow trainer ai if opponent is locked in rage
+ ; note that this doesn't check for hyper beam recharge which can cause problems
ld a, [wTrainerClass] ; what trainer class is this?
dec a
ld c, a
@@ -305,7 +311,7 @@ TrainerAI:
add hl, bc
ld a, [wAICount]
and a
- ret z ; if no AI uses left, we're done here
+ jr z, .done ; if no AI uses left, we're done here
inc hl
inc a
jr nz, .getpointer
@@ -318,6 +324,9 @@ TrainerAI:
ld l, a
call Random
jp hl
+.done
+ and a
+ ret
INCLUDE "data/trainers/ai_pointers.asm"
@@ -377,22 +386,22 @@ ErikaAI:
jp AIUseSuperPotion
KogaAI:
- cp 25 percent + 1
+ cp 13 percent - 1
ret nc
jp AIUseXAttack
BlaineAI:
cp 25 percent + 1
ret nc
+ ld a, 10
+ call AICheckIfHPBelowFraction
+ ret nc
jp AIUseSuperPotion
SabrinaAI:
cp 25 percent + 1
ret nc
- ld a, 10
- call AICheckIfHPBelowFraction
- ret nc
- jp AIUseHyperPotion
+ jp AIUseXDefend
Rival2AI:
cp 13 percent - 1
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 8c9c1529..d16c6515 100644
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -24,8 +24,9 @@ TryDoWildEncounter:
ld [wRepelRemainingSteps], a
.next
; determine if wild pokemon can appear in the half-block we're standing in
-; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
- hlcoord 9, 9
+; is the bottom left tile (8,9) of the half-block we're standing in a grass/water tile?
+; note that by using the bottom left tile, this prevents the "left-shore" tiles from generating grass encounters
+ hlcoord 8, 9
ld c, [hl]
ld a, [wGrassTile]
cp c
@@ -68,8 +69,6 @@ TryDoWildEncounter:
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
ld hl, wWaterMons
-; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
-; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
.gotWildEncounterType
ld b, 0
add hl, bc
diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm
index 02280db0..4d31265b 100644
--- a/engine/debug/debug_menu.asm
+++ b/engine/debug/debug_menu.asm
@@ -18,8 +18,7 @@ IF DEF(_DEBUG)
call RunDefaultPaletteCommand
hlcoord 5, 6
- ld b, 3
- ld c, 9
+ lb bc, 3, 9
call TextBoxBorder
hlcoord 7, 7
@@ -46,7 +45,8 @@ IF DEF(_DEBUG)
call HandleMenuInput
bit BIT_B_BUTTON, a
- jp nz, DisplayTitleScreen
+ ld hl, DisplayTitleScreen
+ ret nz
ld a, [wCurrentMenuItem]
and a ; FIGHT?
@@ -55,7 +55,8 @@ IF DEF(_DEBUG)
; DEBUG
ld hl, wd732
set 1, [hl]
- jp StartNewGameDebug
+ ld hl, StartNewGameDebug
+ ret
DebugPlayerName:
db "Tom@"
@@ -66,13 +67,10 @@ DebugRivalName:
DebugMenuOptions:
db "FIGHT"
next "DEBUG@"
-ELSE
- ret
-ENDC
TestBattle:
-.loop
- call GBPalNormal
+ ld a, 1
+ ldh [hJoy7], a
; Don't mess around
; with obedience.
@@ -82,34 +80,1569 @@ TestBattle:
ld hl, wFlags_D733
set BIT_TEST_BATTLE, [hl]
- ; Reset the party.
+ ld hl, wNumBagItems
+ ld de, Data_feded
+.loop
+ ld a, [de]
+ cp -1
+ jr z, .done
+ inc de
+ ld [wcf91], a
+ ld a, [de]
+ inc de
+ ld [wItemQuantity], a
+ push de
+ call AddItemToInventory
+ pop de
+ jr .loop
+.done
+ call LoadHpBarAndStatusTilePatterns
+ call ClearScreen
+ call ClearSprites
+ hlcoord 0, 0
+ lb bc, 1, 18
+ call TextBoxBorder
+ hlcoord 6, 1
+ ld de, Text_fed18
+ call PlaceString
+ hlcoord 4, 4
+ ld de, Text_fed21
+ call PlaceString
+ hlcoord 1, 6
+ ld de, Text_fed30
+ call PlaceString
+ xor a
+ ld [wWhichPokemon], a
+ ld [wEnemyMon], a
+ ld [wEnemyMonLevel], a
+ ld [wTrainerClass], a
+ ld [wGrassMons + 1], a
+ ld b, a
+ ld c, a
+ ld hl, wEnemyPartySpecies
+ call Func_fe809
ld hl, wPartyCount
+ call Func_fe809
+ ld de, wPartySpecies
+ hlcoord 4, 6
+ ; fallthrough
+Func_fe7ca:
+ push hl
+ push bc
+ dec hl
+ ld a, "▶"
+ ld [hl], a
+ ld bc, 11
+ add hl, bc
+ ld a, " "
+ ld [hl], a
+ push de
+ pop de
+ pop bc
+ pop hl
+ ; fallthrough
+Func_fe7db:
+ push bc
+ push de
+ call JoypadLowSensitivity
+ pop de
+ pop bc
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_fe812
+ bit BIT_B_BUTTON, a
+ jp nz, Func_fe850
+ bit BIT_SELECT, a
+ jp nz, DebugMenu
+ bit BIT_START, a
+ jp nz, Func_fe97f
+ bit BIT_D_RIGHT, a
+ jp nz, Func_fe8a1
+ bit BIT_D_UP, a
+ jp nz, Func_fe85d
+ bit BIT_D_DOWN, a
+ jp nz, Func_fe880
+ jr Func_fe7db
+
+Func_fe809:
xor a
ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ret
+
+Func_fe812:
+ inc b
+ ld a, b
+ cp NUM_POKEMON_INDEXES + 1
+ jr c, Func_fe81a
+ xor a
+ ld b, a
+ ; fallthrough
+Func_fe81a:
+ ld [de], a
+ ld [wd11e], a
+ push bc
+ push hl
+ push de
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ inc hl
+ push hl
+ ld de, Text_fed9c
+ call PlaceString
+ ld bc, hSavedMapTextPtr
+ add hl, bc
+ ld de, Text_fed9c
+ call PlaceString
+ pop hl
+ ld a, [wd11e]
+ and a
+ jr nz, .asm_fe845
+ ld de, Text_feda2
+ jr .asm_fe848
+.asm_fe845
+ call GetMonName
+.asm_fe848
+ call PlaceString
+ pop de
+ pop hl
+ pop bc
+ jr Func_fe7db
+
+Func_fe850:
+ dec b
+ ld a, b
+ cp OPP_ID_OFFSET + 1
+ jp c, Func_fe81a
+ ld a, NUM_POKEMON_INDEXES
+ ld b, a
+ jp Func_fe81a
+
+Func_fe85d:
+ ld a, [wWhichPokemon]
+ dec a
+ cp -1
+ jp z, Func_fe7db
+ ld [wWhichPokemon], a
+ dec de
+ dec hl
+ ld a, " "
+ ld [hl], a
+ push bc
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ pop bc
+ ld a, "▶"
+ ld [hl], a
+ inc hl
+ push hl
+ call Func_fe964
+ pop hl
+ jp Func_fe7db
+
+Func_fe880:
+ ld a, [wWhichPokemon]
+ inc a
+ cp 6
+ jp nc, Func_fe7db
+ ld [wWhichPokemon], a
+ inc de
+ dec hl
+ ld a, " "
+ ld [hl], a
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ ld a, "▶"
+ ld [hl], a
+ inc hl
+ push hl
+ call Func_fe964
+ pop hl
+ jp Func_fe7db
+
+Func_fe8a1:
+ push hl
+ push bc
+ dec hl
+ ld a, " "
+ ld [hl], a
+ ld bc, 11
+ add hl, bc
+ ld a, "▶"
+ ld [hl], a
+ pop bc
+ pop hl
+ ; fallthrough
+Func_fe8b0:
+ push bc
+ push de
+ call JoypadLowSensitivity
+ pop de
+ pop bc
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_fe8d9
+ bit BIT_B_BUTTON, a
+ jp nz, Func_fe902
+ bit BIT_START, a
+ jp nz, Func_fe97f
+ bit BIT_D_LEFT, a
+ jp nz, Func_fe7ca
+ bit BIT_D_UP, a
+ jp nz, Func_fe912
+ bit BIT_D_DOWN, a
+ jp nz, Func_fe93b
+ jr Func_fe8b0
+
+Func_fe8d9:
+ inc c
+ ld a, c
+ cp MAX_LEVEL + 1
+ jr c, Func_fe8e2
+ ld a, 1
+ ld c, a
+ ; fallthrough
+Func_fe8e2:
+ ld a, [wWhichPokemon]
+ push de
+ ld de, wEnemyPartySpecies
+ add e
+ ld e, a
+ jr nc, .asm_fe8ee
+ inc d
+.asm_fe8ee
+ ld a, c
+ ld [de], a
+ push bc
+ push hl
+ ld bc, 11
+ add hl, bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ pop hl
+ pop bc
+ pop de
+ jp Func_fe8b0
+
+Func_fe902:
+ dec c
+ ld a, c
+ cp MAX_LEVEL + 1
+ jr nc, .asm_fe90c
+ and a
+ jp nz, Func_fe8e2
+.asm_fe90c
+ ld a, MAX_LEVEL
+ ld c, a
+ jp Func_fe8e2
+
+Func_fe912:
+ ld a, [wWhichPokemon]
dec a
+ cp -1
+ jp z, Func_fe8b0
+ ld [wWhichPokemon], a
+ dec de
+ push hl
+ ld bc, 10
+ add hl, bc
+ ld a, " "
+ ld [hl], a
+ pop hl
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ push hl
+ ld bc, 10
+ add hl, bc
+ ld a, "▶"
+ ld [hl], a
+ call Func_fe964
+ pop hl
+ jp Func_fe8b0
+
+Func_fe93b:
+ ld a, [wWhichPokemon]
+ inc a
+ cp 6
+ jp nc, Func_fe8b0
+ ld [wWhichPokemon], a
+ inc de
+ push hl
+ ld bc, 10
+ add hl, bc
+ ld a, " "
ld [hl], a
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ push hl
+ ld bc, 10
+ add hl, bc
+ ld a, "▶"
+ ld [hl], a
+ call Func_fe964
+ pop hl
+ jp Func_fe8b0
+
+Func_fe964:
+ ld hl, wPartySpecies
+ ld a, [wWhichPokemon]
+ add l
+ ld l, a
+ jr nc, .asm_fe96f
+ inc h
+.asm_fe96f
+ ld a, [hl]
+ ld b, a
+ ld hl, wEnemyPartySpecies
+ ld a, [wWhichPokemon]
+ add l
+ ld l, a
+ jr nc, .asm_fe97c
+ inc h
+.asm_fe97c
+ ld a, [hl]
+ ld c, a
+ ret
- ; Give the player a
- ; level 20 Rhydon.
- ld a, RHYDON
+Func_fe97f:
+ ld hl, wPartyCount
+ ld de, wEnemyPartyCount
+ xor a
+ ld [hl], a
+ inc hl
+ ld a, [hli]
+ ld b, a
+ ld c, 6
+ xor a
+ ld [wIsInBattle], a
+.asm_fe990
+ ld a, b
ld [wcf91], a
- ld a, 20
+ ld a, [hl]
+ ld b, a
+ inc de
+ ld a, [de]
+ and a
+ jr z, .asm_fe9ab
ld [wCurEnemyLVL], a
xor a
ld [wMonDataLocation], a
- ld [wCurMap], a
+ ld a, [wcf91]
+ and a
+ jr z, .asm_fe9ab
call AddPartyMon
+.asm_fe9ab
+ inc hl
+ dec c
+ jr nz, .asm_fe990
+ ld b, 7
+ ld hl, wPartySpecies
+ ld de, wEnemyPartyCount
+.asm_fe9b7
+ inc de
+ dec b
+ jp z, TestBattle
+ ld a, [hli]
+ and a
+ jr z, .asm_fe9b7
+ ld a, [de]
+ and a
+ jr z, .asm_fe9b7
+ hlcoord 0, 3
+ lb bc, 15, 20
+ call ClearScreenArea
+ hlcoord 0, 3
+ lb bc, 15, 20
+ call ClearScreenArea
+ hlcoord 0, 3
+ lb bc, 15, 20
+ call ClearScreenArea
+ ld c, 20
+ call DelayFrames
+ ld a, 1
+ ld [wIsInBattle], a
+ ld de, Text_feda8
+ ld a, [wGrassMons + 1]
+ cp MAX_LEVEL + 1
+ jr c, .asm_fe9fb
+ ld a, 2
+ ld [wIsInBattle], a
+ ld de, Text_fedb2
+.asm_fe9fb
+ hlcoord 1, 4
+ call PlaceString
+ hlcoord 1, 6
+ ld de, Text_fedbc
+ call PlaceString
+ ld a, [wEnemyMon]
+ ld b, a
+ ld a, [wIsInBattle]
+ dec a
+ jr z, .asm_fea40
+ ld a, [wTrainerClass]
+ ld [wd11e], a
+ ld b, a
+ ld de, wd11e
+ hlcoord 1, 8
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ hlcoord 5, 8
+ ld de, Text_fede2
+ call PlaceString
+ call GetTrainerName
+ hlcoord 5, 8
+ ld de, wTrainerName
+ call PlaceString
+ pop bc
+ jr .asm_fea65
+.asm_fea40
+ ld a, b
+ and a
+ jr z, .asm_fea65
+ ld de, wd11e
+ ld [de], a
+ hlcoord 1, 8
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ hlcoord 5, 8
+ ld de, Text_fede2
+ call PlaceString
+ call GetMonName
+ hlcoord 5, 8
+ call PlaceString
+ pop bc
+.asm_fea65
+ ld a, [wEnemyMonLevel]
+ ld c, a
+ ld de, wd11e
+ ld [de], a
+ hlcoord 16, 8
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ pop bc
+ ; fallthrough
+Func_fea78:
+ ld a, " "
+ ldcoord_a 0, 8
+ ldcoord_a 15, 8
+ ld a, "▶"
+ ldcoord_a 0, 4
+ ; fallthrough
+Func_fea85:
+ push bc
+ call JoypadLowSensitivity
+ pop bc
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_fea9d
+ bit BIT_START, a
+ jp nz, Func_fec10
+ bit BIT_D_DOWN, a
+ jp nz, Func_feae4
+ jr Func_fea85
- ; Fight against a
- ; level 20 Rhydon.
- ld a, RHYDON
- ld [wCurOpponent], a
+Func_fea9d:
+ hlcoord 1, 8
+ ld de, Text_fedcf
+ call PlaceString
+ hlcoord 5, 7
+ ld de, Text_fede2
+ call PlaceString
+ xor a
+ ld b, a
+ ld c, a
+ ld a, [wIsInBattle]
+ dec a
+ jr nz, .asm_feace
+ ld a, 2
+ ld [wIsInBattle], a
+ ld a, " "
+ ldcoord_a 4, 3
+ hlcoord 1, 4
+ ld de, Text_fedb2
+ call PlaceString
+ jp Func_fea85
+.asm_feace
+ ld a, 1
+ ld [wIsInBattle], a
+ ld a, " "
+ ldcoord_a 1, 3
+ hlcoord 1, 4
+ ld de, Text_feda8
+ call PlaceString
+ jp Func_fea85
+
+Func_feae4:
+ ld a, "▶"
+ ldcoord_a 0, 8
+ ld a, " "
+ ldcoord_a 15, 8
+ ldcoord_a 0, 4
+ ; fallthrough
+Func_feaf1:
+ push bc
+ call JoypadLowSensitivity
+ pop bc
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_feb13
+ bit BIT_B_BUTTON, a
+ jp nz, Func_feb82
+ bit BIT_START, a
+ jp nz, Func_fec10
+ bit BIT_D_RIGHT, a
+ jp nz, Func_febba
+ bit BIT_D_UP, a
+ jp nz, Func_fea78
+ jr Func_feaf1
+Func_feb13:
+ push bc
+ hlcoord 5, 7
+ ld de, Text_fede2
+ call PlaceString
+ hlcoord 5, 8
+ ld de, Text_fede2
+ call PlaceString
+ pop bc
+ ld a, [wIsInBattle]
+ dec a
+ jr z, Func_feb35.asm_feb5c
+ inc b
+ ld a, b
+ cp 48
+ jr c, Func_feb35
+ ld b, 1
+ ; fallthrough
+Func_feb35:
+ ld a, b
+ ld [wd11e], a
+ ld de, wd11e
+ hlcoord 1, 8
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ ld a, [wd11e]
+ ld [wTrainerClass], a
+ call GetTrainerName
+ hlcoord 5, 8
+ ld de, wTrainerName
+ call PlaceString
+ pop bc
+ jp Func_feaf1
+.asm_feb5c
+ inc b
+ ld a, b
+ cp NUM_POKEMON_INDEXES + 1
+ jr c, Func_feb64
+ ld b, 1
+ ; fallthrough
+Func_feb64:
+ ld a, b
+ ld [wd11e], a
+ ld de, wd11e
+ hlcoord 1, 8
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ call GetMonName
+ hlcoord 5, 8
+ call PlaceString
+ pop bc
+ jp Func_feaf1
+
+Func_feb82:
+ push bc
+ hlcoord 5, 7
+ ld de, Text_fede2
+ call PlaceString
+ hlcoord 5, 8
+ ld de, Text_fede2
+ call PlaceString
+ pop bc
+ ld a, [wIsInBattle]
+ dec a
+ jr z, .asm_febab
+ dec b
+ ld a, b
+ cp 48
+ jr nc, .asm_feba6
+ and a
+ jp nz, Func_feb35
+.asm_feba6
+ ld b, 47
+ jp Func_feb35
+.asm_febab
+ dec b
+ ld a, b
+ cp NUM_POKEMON_INDEXES + 1
+ jr nc, .asm_febb5
+ and a
+ jp nz, Func_feb64
+.asm_febb5
+ ld b, NUM_POKEMON_INDEXES
+ jp Func_feb64
+
+Func_febba:
+ ld a, " "
+ ldcoord_a 0, 8
+ ld a, "▶"
+ ldcoord_a 15, 8
+ ; fallthrough
+Func_febc4:
+ push bc
+ call JoypadLowSensitivity
+ pop bc
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_febe6
+ bit BIT_B_BUTTON, a
+ jp nz, Func_fec01
+ bit BIT_START, a
+ jp nz, Func_fec10
+ bit BIT_D_LEFT, a
+ jp nz, Func_feae4
+ bit BIT_D_UP, a
+ jp nz, Func_fea78
+ jr Func_febc4
+
+Func_febe6:
+ inc c
+ ld a, c
+ cp MAX_LEVEL + 1
+ jr c, Func_febee
+ ld c, 1
+Func_febee:
+ hlcoord 16, 8
+ ld a, c
+ ld de, wCurEnemyLVL
+ ld [de], a
+ push bc
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ pop bc
+ jp Func_febc4
+
+Func_fec01:
+ dec c
+ ld a, c
+ cp MAX_LEVEL + 1
+ jr nc, .asm_fec0b
+ and a
+ jp nz, Func_febee
+.asm_fec0b
+ ld c, MAX_LEVEL
+ jp Func_febee
+
+Func_fec10:
+ ld a, b
+ and a
+ jp z, Func_fea78
+ ld a, c
+ and a
+ jp z, Func_fea78
+ ld a, [wIsInBattle]
+ dec a
+ jr z, .asm_fec28
+ ld a, b
+ add OPP_ID_OFFSET
+ ld b, a
+ ld a, c
+ ld [wTrainerNo], a
+.asm_fec28
+ ld a, c
+ ld [wCurEnemyLVL], a
+ ld a, b
+ ld [wCurOpponent], a
+ xor a
+ ld [wd72d], a
predef InitOpponent
+ xor a
+ ld [wNumRunAttempts], a
+ ld hl, wPlayerStatsToDouble
+ ld bc, wEnemyStatsToDouble - wPlayerStatsToDouble
+ call FillMemory
+ ld hl, wEnemyStatsToDouble
+ ld bc, wPlayerNumAttacksLeft - wEnemyStatsToDouble
+ call FillMemory
+ call LoadFontTilePatterns
+ call ClearScreen
+ call ClearSprites
+ ld a, %11100100
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ hlcoord 0, 0
+ lb bc, 1, 18
+ call TextBoxBorder
+ hlcoord 6, 1
+ ld de, Text_fed18
+ call PlaceString
+ hlcoord 4, 4
+ ld de, Text_fed21
+ call PlaceString
+ hlcoord 1, 6
+ ld de, Text_fed30
+ call PlaceString
+ ld de, wPartyCount
+ xor a
+ ld [de], a
+ ld [wWhichPokemon], a
+ inc de
+ hlcoord 4, 6
+ push de
+ push hl
+ ; fallthrough
+Func_fec9b:
+ ld a, [wWhichPokemon]
+ ld de, wPartySpecies
+ add e
+ ld e, a
+ jr nc, .asm_feca6
+ inc d
+.asm_feca6
+ ld a, [de]
+ cp -1
+ jp z, Func_fed01
+ ld [wd11e], a
+ push hl
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ inc hl
+ ld de, Text_fed9c
+ call PlaceString
+ call GetMonName
+ call PlaceString
+ pop hl
+ push hl
+ ld bc, 11
+ add hl, bc
+ push hl
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMon1Level
+ ld bc, wPartyMon2 - wPartyMon1
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld a, [de]
+ ld [wCurEnemyLVL], a
+ pop hl
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ ld a, [wWhichPokemon]
+ ld de, wEnemyPartySpecies
+ add e
+ ld e, a
+ jr nc, .asm_fecee
+ inc d
+.asm_fecee
+ ld a, [wCurEnemyLVL]
+ ld [de], a
+ pop hl
+ ld a, [wWhichPokemon]
+ inc a
+ ld [wWhichPokemon], a
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ jp Func_fec9b
+
+Func_fed01:
+ pop hl
+ pop de
+ ld a, [wPartyMon1]
+ ld b, a
+ ld a, [wPartyMon1Level]
+ ld c, a
+ xor a
+ ld [wWhichPokemon], a
+ jp Func_fe7ca
+
+Text_fed12:
+ db "けんしろう@" ; "KENSHIROU@"
+
+Text_fed18:
+ db "テスト ファイト@" ; "FIGHT TEST@"
+
+Text_fed21:
+ db "№. なまえ レべル@" ; "№. NAME LEVEL@"
+
+Text_fed30:
+ db "1.▶000 ーーーーー 000"
+ next "2. 000 ーーーーー 000"
+ next "3. 000 ーーーーー 000"
+ next "4. 000 ーーーーー 000"
+ next "5. 000 ーーーーー 000"
+ next "6. 000 ーーーーー 000@"
+
+Text_fed9c:
+ db " @"
+
+Text_feda2:
+ db "ーーーーー@"
+
+Text_feda8:
+ db "ワイルドモンスター@" ; "WILD #MON@"
+
+Text_fedb2:
+ db "ディーラー @" ; "TRAINER @"
+
+Text_fedbc:
+ db "№. なまえ レべル" ; "№. NAME LABEL"
+ next ""
+Text_fedcf:
+ db "000 ーーーーーーーーーー 000@"
+
+Text_fede2:
+ db " @"
+
+Data_feded:
+ db GREAT_BALL, 99
+ db POKE_BALL, 99
+ db ANTIDOTE, 99
+ db FULL_RESTORE, 99
+ db MAX_POTION, 99
+ db HYPER_POTION, 99
+ db SUPER_POTION, 99
+ db POTION, 99
+ db -1 ; end
+
+Func_fedfe:
+ ld a, [wBoxCount]
+ cp 30
+ jp nc, Func_ff1ad
+ call ClearScreen
+ call UpdateSprites
+ ld a, [wLetterPrintingDelayFlags]
+ push af
+ xor a
+ ld [wLetterPrintingDelayFlags], a
+ ld hl, wEnemyMonOT
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ inc a
+ ldh [hJoy7], a
+ ld [wcf91], a
+ ld [wCurEnemyLVL], a
+ ; fallthrough
+Func_fee23:
+ hlcoord 0, 3
+ ld [hl], " "
+ hlcoord 0, 1
+ ld [hl], "▶"
+ call Func_fee60
+.asm_fee30
+ call DelayFrame
+ call JoypadLowSensitivity
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_fee49
+ bit BIT_B_BUTTON, a
+ jp nz, Func_fee56
+ bit BIT_D_DOWN, a
+ jp nz, Func_fee96
+ jr .asm_fee30
+
+Func_fee49:
+ ld hl, wcf91
+ inc [hl]
+ ld a, [hl]
+ cp NUM_POKEMON + 1
+ jr c, Func_fee23
+ ld [hl], DEX_BULBASAUR
+ jr Func_fee23
+
+Func_fee56:
+ ld hl, wcf91
+ dec [hl]
+ jr nz, Func_fee23
+ ld [hl], DEX_MEW
+ jr Func_fee23
+
+Func_fee60:
+ hlcoord 1, 0
+ lb bc, 2, 9
+ call ClearScreenArea
+ hlcoord 1, 1
+ ld de, wcf91
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ inc hl
+ push hl
+ ld a, [wcf91]
+ ld [wd11e], a
+ callfar PokedexToIndex
+ call GetMonName
+ pop hl
+ call PlaceString
+ ld a, [wd11e]
+ ld [wd0b5], a
+ call GetMonHeader
+ ret
+
+Func_fee96:
+ hlcoord 0, 1
+ ld [hl], " "
+ hlcoord 0, 3
+ ld [hl], "▶"
+ hlcoord 0, 5
+ ld [hl], " "
+ call Func_feee2
+ call Func_feeef
+.asm_feeab
+ call DelayFrame
+ call JoypadLowSensitivity
+ ld hl, wCurEnemyLVL
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_feed1
+ bit BIT_B_BUTTON, a
+ jp nz, Func_feedb
+ bit BIT_START, a
+ jp nz, Func_ff12c
+ bit BIT_D_UP, a
+ jp nz, Func_fee23
+ bit BIT_D_DOWN, a
+ jp nz, Func_fef60
+ jr .asm_feeab
+
+Func_feed1:
+ inc [hl]
+ ld a, [hl]
+ cp MAX_LEVEL + 1
+ jr c, Func_fee96
+ ld [hl], 1
+ jr Func_fee96
+
+Func_feedb:
+ dec [hl]
+ jr nz, Func_fee96
+ ld [hl], MAX_LEVEL
+ jr Func_fee96
- ; When the battle ends,
- ; do it all again.
+Func_feee2:
+ hlcoord 1, 3
+ ld de, wCurEnemyLVL
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ ret
+
+Func_feeef:
+ hlcoord 1, 4
+ lb bc, 8, 11
+ call ClearScreenArea
+ ld a, [wcf91]
+ push af
+ ld [wd11e], a
+ ld hl, BaseStats + 15
+ dec a
+ ld bc, BASE_DATA_SIZE
+ call AddNTimes
+ ld de, wMoves
+ ld bc, NUM_MOVES
+ ld a, BANK(BaseStats)
+ call FarCopyData
+ callfar PokedexToIndex
+ ld a, [wd11e]
+ ld [wcf91], a
+ xor a
+ ld [wChangeMonPicEnemyTurnSpecies], a
+ ld de, wMoves
+ predef WriteMonMoves
+ hlcoord 1, 5
+ ld de, wMoves
+ ld b, NUM_MOVES
+.asm_fef36
+ ld a, [de]
+ inc de
+ and a
+ jr z, .asm_fef5b
+ push de
+ push bc
+ push hl
+ ld [wd11e], a
+ ld de, wd11e
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ inc hl
+ call GetMoveName
+ call PlaceString
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ pop bc
+ pop de
+ dec b
+ jr nz, .asm_fef36
+.asm_fef5b
+ pop af
+ ld [wcf91], a
+ ret
+
+Func_fef60:
+ ld de, wMoves
+ hlcoord 0, 5
+ ld b, 1
+ ; fallthrough
+Func_fef68:
+ call Func_fefc5
+.asm_fef6b
+ call DelayFrame
+ push de
+ push bc
+ call JoypadLowSensitivity
+ pop bc
+ pop de
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_fef92
+ bit BIT_B_BUTTON, a
+ jp nz, Func_fef9e
+ bit BIT_START, a
+ jp nz, Func_ff12c
+ bit BIT_D_UP, a
+ jp nz, Func_fefa8
+ bit BIT_D_DOWN, a
+ jp nz, Func_fefb5
+ jr .asm_fef6b
+
+Func_fef92:
+ ld a, [de]
+ inc a
+ ld [de], a
+ cp NUM_ATTACKS
+ jr c, Func_fef68
ld a, 1
- ld [wUpdateSpritesEnabled], a
- ldh [hAutoBGTransferEnabled], a
- jr .loop
+ ld [de], a
+ jr Func_fef68
+
+Func_fef9e:
+ ld a, [de]
+ dec a
+ ld [de], a
+ jr nz, Func_fef68
+ ld a, NUM_ATTACKS - 1
+ ld [de], a
+ jr Func_fef68
+
+Func_fefa8:
+ dec de
+ dec b
+ jp z, Func_fee96
+ push bc
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ pop bc
+ jr Func_fef68
+
+Func_fefb5:
+ inc de
+ inc b
+ ld a, b
+ cp 5
+ jp z, Func_ff03b
+ push bc
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ pop bc
+ jr Func_fef68
+
+Func_fefc5:
+ push hl
+ push de
+ push bc
+ push hl
+ push de
+ ld bc, hSpriteMapYCoord
+ add hl, bc
+ lb bc, 2, 11
+ call ClearScreenArea
+ pop de
+ pop hl
+ push hl
+ ld [hl], "▶"
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ ld [hl], " "
+ ld bc, SCREEN_WIDTH * 4
+ add hl, bc
+ ld [hl], " "
+ pop hl
+ inc hl
+ ld a, [de]
+ ld de, wd11e
+ ld [de], a
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ ld a, [wd11e]
+ and a
+ jr z, .asm_ff002
+ call Func_ff006
+ inc hl
+ call GetMoveName
+ call PlaceString
+.asm_ff002
+ pop bc
+ pop de
+ pop hl
+ ret
+
+Func_ff006:
+ ld a, [wcf91]
+ push af
+ ld a, [wd11e]
+ push af
+ push hl
+ ld a, [wcf91]
+ ld [wd11e], a
+ callfar PokedexToIndex
+ ld a, [wd11e]
+ ld [wcf91], a
+ pop hl
+ pop af
+ ld [wd11e], a
+ push hl
+ callfar Func_3b079
+ pop hl
+ jr c, .asm_ff036
+ ld [hl], "×"
+.asm_ff036
+ pop af
+ ld [wcf91], a
+ ret
+
+Func_ff03b:
+ ld de, wEnemyMonOT
+ hlcoord 0, 13
+ ld b, 1
+ ; fallthrough
+Func_ff043:
+ call Func_ff09e
+.asm_ff046
+ call DelayFrame
+ push de
+ push bc
+ call JoypadLowSensitivity
+ pop bc
+ pop de
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_ff06d
+ bit BIT_B_BUTTON, a
+ jp nz, Func_ff072
+ bit BIT_START, a
+ jp nz, Func_ff12c
+ bit BIT_D_UP, a
+ jp nz, Func_ff077
+ bit BIT_D_DOWN, a
+ jp nz, Func_ff08f
+ jr .asm_ff046
+
+Func_ff06d:
+ ld a, [de]
+ inc a
+ ld [de], a
+ jr Func_ff043
+
+Func_ff072:
+ ld a, [de]
+ dec a
+ ld [de], a
+ jr Func_ff043
+
+Func_ff077:
+ dec de
+ dec b
+ jp z, Func_ff084
+ push bc
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ pop bc
+ jr Func_ff043
+
+Func_ff084:
+ ld de, wMoves + 3
+ hlcoord 0, 11
+ ld b, NUM_MOVES
+ jp Func_fef68
+
+Func_ff08f:
+ ld a, b
+ cp 3
+ jr z, Func_ff043
+ inc b
+ inc de
+ push bc
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ pop bc
+ jr Func_ff043
+
+Func_ff09e:
+ push hl
+ push de
+ push bc
+ push hl
+ ld [hl], "▶"
+ ld bc, hMovingBGTilesCounter1
+ add hl, bc
+ ld [hl], " "
+ ld bc, SCREEN_WIDTH * 4
+ add hl, bc
+ ld [hl], " "
+ pop hl
+ inc hl
+ ld a, [de]
+ ld de, wd11e
+ ld [de], a
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ call Func_ff0c4
+ pop bc
+ pop de
+ pop hl
+ ret
+
+Func_ff0c4:
+ hlcoord 12, 0
+ lb bc, 18, 8
+ call ClearScreenArea
+ hlcoord 13, 1
+ ld de, Text_ff113
+ call PlaceString
+ ld b, 10
+ ld hl, wLoadedMonHPExp
+ ld a, [wEnemyMonOT + 2]
+.asm_ff0de
+ ld [hli], a
+ dec b
+ jr nz, .asm_ff0de
+ ld a, [wEnemyMonOT]
+ ld [hli], a
+ ld a, [wEnemyMonOT + 1]
+ ld [hl], a
+ ld hl, wLoadedMonExp + 2
+ ld de, wLoadedMonStats
+ ld b, 1
+ call CalcStats
+ hlcoord 17, 1
+ ld de, wLoadedMonStats
+ ld b, 5
+.asm_ff0fd
+ push bc
+ push de
+ push hl
+ lb bc, LEADING_ZEROES | 2, 3
+ call PrintNumber
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ pop de
+ inc de
+ inc de
+ pop bc
+ dec b
+ jr nz, .asm_ff0fd
+ ret
+
+Text_ff113:
+ db "たいりき" ; hp
+ next "こうげき" ; attack
+ next "ぼうぎょ" ; defense
+ next "すばやさ" ; speed
+ next "とくしゅ@" ; special
+
+Func_ff12c:
+ ld a, [wCurEnemyLVL]
+ ld [wEnemyMonLevel], a
+ ld a, [wcf91]
+ ld [wd11e], a
+ callfar PokedexToIndex
+ ld a, [wd11e]
+ ld [wcf91], a
+ ld [wd0b5], a
+ call GetMonHeader
+ ld hl, wEnemyMon
+ ld a, [wcf91]
+ ld [hli], a
+ ld a, [wLoadedMonStats]
+ ld [hli], a
+ ld a, [wLoadedMonStats + 1]
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld a, [wMonHTypes]
+ ld [hli], a
+ ld a, [wMonHType2]
+ ld [hli], a
+ ld a, [wMonHCatchRate]
+ ld [hli], a
+ ld a, [wMoves]
+ ld [hli], a
+ ld a, [wMoves + 1]
+ ld [hli], a
+ ld a, [wMoves + 2]
+ ld [hli], a
+ ld a, [wMoves + 3]
+ ld [hl], a
+ ld hl, wEnemyMonPP
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld a, [wEnemyMonOT]
+ ld [wEnemyMonDVs], a
+ ld a, [wEnemyMonOT + 1]
+ ld [wEnemyMonDVs + 1], a
+ callfar SendNewMonToBox
+ ld b, 10
+ ld hl, wBoxMon1HPExp
+ ld a, [wEnemyMonOT + 2]
+.asm_ff19e
+ ld [hli], a
+ dec b
+ jr nz, .asm_ff19e
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ pop af
+ ld [wLetterPrintingDelayFlags], a
+ jr Func_ff1b3
+Func_ff1ad:
+ ld hl, Text_ff1b4
+ call PrintText
+Func_ff1b3:
+ ret
+
+Text_ff1b4:
+ text_far _BoxFullDebugText
+ text_end
+
+Func_ff1b9:
+ ld a, 1
+ ldh [hJoy7], a
+ ld a, 2
+ ld [wCurEnemyLVL], a
+ ld hl, Text_ff290
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, Func_ff286
+ ld hl, Text_ff28f
+ call PrintText
+ callfar EmptyAllSRAMBoxes
+ ld hl, wBoxCount
+ xor a
+ ld [hli], a
+ dec a
+ ld [hl], a
+ ; fallthrough
+Func_ff1e7:
+ hlcoord 2, 13
+ ld [hl], "゙"
+ hlcoord 1, 14
+ ld [hl], "レ"
+ inc hl
+ ld [hl], "へ"
+ inc hl
+ ld [hl], "ル"
+ inc hl
+ inc hl
+ ld de, wCurEnemyLVL
+ lb bc, LEADING_ZEROES | 1, 3
+ call PrintNumber
+ call DelayFrame
+ call JoypadLowSensitivity
+ ldh a, [hJoy5]
+ bit BIT_A_BUTTON, a
+ jp nz, Func_ff21b
+ bit BIT_B_BUTTON, a
+ jp nz, Func_ff227
+ bit BIT_START, a
+ jp nz, Func_ff236
+ jr Func_ff1e7
+
+Func_ff21b:
+ ld a, [wCurEnemyLVL]
+ inc a
+ cp MAX_LEVEL + 1
+ jr c, Func_ff231
+ ld a, 2
+ jr Func_ff231
+Func_ff227:
+ ld a, [wCurEnemyLVL]
+ dec a
+ cp 2
+ jr nc, Func_ff231
+ ld a, MAX_LEVEL
+Func_ff231:
+ ld [wCurEnemyLVL], a
+ jr Func_ff1e7
+
+Func_ff236:
+ ld c, 0
+ ld d, 0
+.asm_ff23a
+ push bc
+ push de
+ call Func_ff295
+ ld hl, wChangeMonPicEnemyTurnSpecies
+ inc [hl]
+ pop de
+ pop bc
+ ld b, 30
+.asm_ff247
+ inc c
+ push bc
+ push de
+ ld a, c
+ ld [wd11e], a
+ callfar PokedexToIndex
+ ld a, [wd11e]
+ ld [wEnemyMonSpecies2], a
+ ld [wcf91], a
+ xor a
+ ld [wEnemyBattleStatus3], a
+ callfar LoadEnemyMonData
+ ld a, [wEnemyMonSpecies2]
+ ld [wcf91], a
+ callfar SendNewMonToBox
+ pop de
+ pop bc
+ ld a, c
+ cp NUM_POKEMON
+ jr z, Func_ff286
+ dec b
+ jr nz, .asm_ff247
+ inc d
+ jr .asm_ff23a
+ ; fallthrough
+Func_ff286:
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ xor a
+ ldh [hJoy7], a
+ ret
+
+Text_ff28f:
+ text_end
+
+Text_ff290:
+ text_far _BoxWillBeClearedText
+ text_end
+
+Func_ff295:
+ push de
+ ld a, SFX_SAVE
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
+ call Func_ff2d1
+ ld e, l
+ ld d, h
+ ld hl, wBoxCount
+ call Func_ff2f3
+ pop de
+ ld a, d
+ set 7, a
+ ld [wCurrentBoxNum], a
+ push de
+ call Func_ff2d1
+ ld de, wBoxCount
+ call Func_ff2f3
+ ld a, [wLetterPrintingDelayFlags]
+ push af
+ ld a, 1
+ ld [wLetterPrintingDelayFlags], a
+ callfar SaveSAVtoSRAM
+ pop af
+ ld [wLetterPrintingDelayFlags], a
+ pop de
+ ret
+
+Func_ff2d1:
+ ld hl, Data_ff2eb
+ ld a, [wCurrentBoxNum]
+ and %01111111
+ cp 4
+ ld b, 2
+ jr c, .asm_ff2e2
+ inc b
+ and 3
+.asm_ff2e2
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ret
+
+Data_ff2eb:
+ dw sBox1
+ dw sBox2
+ dw sBox3
+ dw sBox4
+
+Func_ff2f3:
+ push hl
+ call Func_ff316
+ ld a, b
+ ld [MBC1SRamBank], a
+ ld bc, sBox2 - sBox1
+ call CopyData
+ pop hl
+ xor a
+ ld [hli], a
+ dec a
+ ld [hl], a
+ ld hl, sBox1
+ ld bc, sBox5 - sBox1 + 1
+ call Func_ff32a
+ ld [sBox5], a
+ call Func_ff321
+ ret
+
+Func_ff316:
+ ld a, 1
+ ld [MBC1SRamBankingMode], a
+ ld a, SRAM_ENABLE
+ ld [MBC1SRamEnable], a
+ ret
+
+Func_ff321:
+ ld a, 0
+ ld [MBC1SRamBankingMode], a
+ ld [MBC1SRamEnable], a
+ ret
+
+Func_ff32a:
+ ld d, 0
+.asm_ff32c
+ ld a, [hli]
+ add d
+ ld d, a
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_ff32c
+ ld a, d
+ cpl
+ ret
+ELSE
+ ret
+ENDC
diff --git a/engine/debug/debug_party.asm b/engine/debug/debug_party.asm
index 17baa7ef..67a27710 100644
--- a/engine/debug/debug_party.asm
+++ b/engine/debug/debug_party.asm
@@ -1,13 +1,6 @@
-; This function is a debugging feature to give the player Tsunekazu Ishihara's
-; favorite Pokemon. This is indicated by the overpowered Exeggutor, which
-; Ishihara (president of Creatures Inc.) said was his favorite Pokemon in an ABC
-; interview on February 8, 2000.
-; "Exeggutor is my favorite. That's because I was always using this character
-; while I was debugging the program."
-; http://www.ign.com/articles/2000/02/09/abc-news-pokamon-chat-transcript
-
-SetIshiharaTeam:
- ld de, IshiharaTeam
+; not IshiharaTeam
+SetDebugTeam:
+ ld de, DebugTeam
.loop
ld a, [de]
cp -1
@@ -20,19 +13,11 @@ SetIshiharaTeam:
call AddPartyMon
jr .loop
-IshiharaTeam:
- db EXEGGUTOR, 90
-IF DEF(_DEBUG)
- db MEW, 5
-ELSE
- db MEW, 20
-ENDC
- db JOLTEON, 56
- db DUGTRIO, 56
- db ARTICUNO, 57
-IF DEF(_DEBUG)
- db PIKACHU, 5
-ENDC
+DebugTeam:
+ db SNORLAX, 80
+ db PERSIAN, 80
+ db JIGGLYPUFF, 15
+ db STARTER_PIKACHU, 5
db -1 ; end
DebugStart:
@@ -49,9 +34,14 @@ IF DEF(_DEBUG)
ld a, $ff ^ (1 << BIT_EARTHBADGE)
ld [wObtainedBadges], a
- call SetIshiharaTeam
+ call SetDebugTeam
+
+ ; Pikachu gets Surf.
+ ld a, SURF
+ ld hl, wPartyMon4Moves + 2
+ ld [hl], a
- ; Exeggutor gets four HM moves.
+ ; Snorlax gets four HM moves.
ld hl, wPartyMon1Moves
ld a, FLY
ld [hli], a
@@ -61,38 +51,6 @@ IF DEF(_DEBUG)
ld [hli], a
ld a, STRENGTH
ld [hl], a
- ld hl, wPartyMon1PP
- ld a, 15
- ld [hli], a
- ld a, 30
- ld [hli], a
- ld a, 15
- ld [hli], a
- ld [hl], a
-
- ; Jolteon gets Thunderbolt.
- ld hl, wPartyMon3Moves + 3
- ld a, THUNDERBOLT
- ld [hl], a
- ld hl, wPartyMon3PP + 3
- ld a, 15
- ld [hl], a
-
- ; Articuno gets Fly.
- ld hl, wPartyMon5Moves
- ld a, FLY
- ld [hl], a
- ld hl, wPartyMon5PP
- ld a, 15
- ld [hl], a
-
- ; Pikachu gets Surf.
- ld hl, wPartyMon6Moves + 2
- ld a, SURF
- ld [hl], a
- ld hl, wPartyMon6PP + 2
- ld a, 15
- ld [hl], a
; Get some debug items.
ld hl, wNumBagItems
@@ -117,13 +75,20 @@ IF DEF(_DEBUG)
call DebugSetPokedexEntries
SetEvent EVENT_GOT_POKEDEX
- ; Rival chose Squirtle,
- ; Player chose Charmander.
+ ; Rival chose Jolteon.
ld hl, wRivalStarter
- ld a, STARTER2
+ ld a, RIVAL_STARTER_JOLTEON
+ ld [hli], a
+ ld a, NUM_POKEMON
+ ld [hli], a ; hl = wUnknownDebugByte
+ ld a, STARTER_PIKACHU
+ ld [hl], a ; hl = wPlayerStarter
+
+ ; Give max money.
+ ld hl, wPlayerMoney
+ ld a, $99
+ ld [hli], a
ld [hli], a
- inc hl ; hl = wPlayerStarter
- ld a, STARTER1
ld [hl], a
ret
@@ -139,20 +104,55 @@ DebugSetPokedexEntries:
ret
DebugItemsList:
+ db MASTER_BALL, 99
+ db TOWN_MAP, 1
db BICYCLE, 1
db FULL_RESTORE, 99
- db FULL_HEAL, 99
db ESCAPE_ROPE, 99
db RARE_CANDY, 99
- db MASTER_BALL, 99
- db TOWN_MAP, 1
db SECRET_KEY, 1
db CARD_KEY, 1
+ db FULL_HEAL, 99
+ db REVIVE, 99
+ db FRESH_WATER, 99
db S_S_TICKET, 1
db LIFT_KEY, 1
+ db PP_UP, 99
db -1 ; end
DebugUnusedList:
+ db OLD_AMBER, 1
+ db DOME_FOSSIL, 1
+ db HELIX_FOSSIL, 1
+ db X_ACCURACY, 99
+ db DIRE_HIT, 99
+ db FRESH_WATER, 1
+ db S_S_TICKET, 1
+ db GOLD_TEETH, 1
+ db COIN_CASE, 1
+ db SILPH_SCOPE, 1
+ db POKE_FLUTE, 1
+ db LIFT_KEY, 1
+ db ETHER, 99
+ db MAX_ETHER, 99
+ db ELIXER, 99
+ db MAX_ELIXER, 99
+ db TM_RAZOR_WIND, 10
+ db TM_HORN_DRILL, 10
+ db TM_TAKE_DOWN, 10
+ db TM_BLIZZARD, 10
+ db TM_HYPER_BEAM, 10
+ db TM_SOLARBEAM, 10
+ db TM_DRAGON_RAGE, 10
+ db TM_MIMIC, 10
+ db TM_BIDE, 10
+ db TM_METRONOME, 10
+ db TM_SELFDESTRUCT, 10
+ db TM_SWIFT, 10
+ db TM_SOFTBOILED, 10
+ db TM_DREAM_EATER, 10
+ db TM_REST, 10
+ db TM_SUBSTITUTE, 10
db -1 ; end
ELSE
ret
diff --git a/engine/events/black_out.asm b/engine/events/black_out.asm
index 16d2081f..6d3d91b8 100644
--- a/engine/events/black_out.asm
+++ b/engine/events/black_out.asm
@@ -1,6 +1,8 @@
ResetStatusAndHalveMoneyOnBlackout::
; Reset player status on blackout.
xor a
+ ld [wd435], a
+ xor a ; gamefreak copypasting functions (double xor a)
ld [wBattleResult], a
ld [wWalkBikeSurfState], a
ld [wIsInBattle], a
diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm
index b052d3e2..10de5ed2 100644
--- a/engine/events/card_key.asm
+++ b/engine/events/card_key.asm
@@ -8,7 +8,7 @@ PrintCardKeyText:
ret z
cp b
jr nz, .silphCoMapListLoop
- predef GetTileAndCoordsInFrontOfPlayer
+; does not check for tile in front of player. This might be buggy.
ld a, [wTileInFrontOfPlayer]
cp $18
jr z, .cardKeyDoorInFrontOfPlayer
@@ -25,12 +25,12 @@ PrintCardKeyText:
ld b, CARD_KEY
call IsItemInBag
jr z, .noCardKey
- call GetCoordsInFrontOfPlayer
- push de
+ xor a
+ ld [wPlayerMovingDirection], a
tx_pre_id CardKeySuccessText
ldh [hSpriteIndexOrTextID], a
call PrintPredefTextID
- pop de
+ call GetCoordsInFrontOfPlayer
srl d
ld a, d
ld b, a
diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm
index 91541f09..a5a007fa 100644
--- a/engine/events/diploma.asm
+++ b/engine/events/diploma.asm
@@ -1,5 +1,3 @@
-CIRCLE_TILE_ID EQU $70
-
DisplayDiploma::
call SaveScreenTilesToBuffer2
call GBPalWhiteOutWithDelay3
@@ -8,109 +6,12 @@ DisplayDiploma::
ld [wUpdateSpritesEnabled], a
ld hl, wd730
set 6, [hl]
- call DisableLCD
- ld hl, CircleTile
- ld de, vChars2 tile CIRCLE_TILE_ID
- ld bc, $10
- ld a, BANK(CircleTile)
- call FarCopyData2
- hlcoord 0, 0
- lb bc, 16, 18
- predef Diploma_TextBoxBorder
- ld hl, DiplomaTextPointersAndCoords
- ld c, $5
-.asm_56715
- push bc
- ld a, [hli]
- ld e, a
- ld a, [hli]
- ld d, a
- ld a, [hli]
- push hl
- ld h, [hl]
- ld l, a
- call PlaceString
- pop hl
- inc hl
- pop bc
- dec c
- jr nz, .asm_56715
- hlcoord 10, 4
- ld de, wPlayerName
- call PlaceString
- farcall DrawPlayerCharacter
-
-; Move the player 33 pixels right and set the priority bit so he appears
-; behind the background layer.
- ld hl, wOAMBuffer + $01
- lb bc, $80, $28
-.adjustPlayerGfxLoop
- ld a, [hl] ; X
- add 33
- ld [hli], a
- inc hl
- ld a, b
- ld [hli], a ; attributes
- inc hl
- dec c
- jr nz, .adjustPlayerGfxLoop
-
- call EnableLCD
- farcall LoadTrainerInfoTextBoxTiles
- ld b, SET_PAL_GENERIC
- call RunPaletteCommand
- call Delay3
- call GBPalNormal
- ld a, $90
- ldh [rOBP0], a
+ callfar _DisplayDiploma
call WaitForTextScrollButtonPress
ld hl, wd730
res 6, [hl]
call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
call RestoreScreenTilesAndReloadTilePatterns
call Delay3
jp GBPalNormal
-
-UnusedPlayerNameLengthFunc:
-; Unused function that does a calculation involving the length of the player's
-; name.
- ld hl, wPlayerName
- lb bc, $ff, $00
-.loop
- ld a, [hli]
- cp "@"
- ret z
- dec c
- jr .loop
-
-diploma_text: MACRO
- dw \3
- dwcoord \1, \2
-ENDM
-
-DiplomaTextPointersAndCoords:
- ; x, y, text
- diploma_text 5, 2, DiplomaText
- diploma_text 3, 4, DiplomaPlayer
- diploma_text 15, 4, DiplomaEmptyText
- diploma_text 2, 6, DiplomaCongrats
- diploma_text 9, 16, DiplomaGameFreak
-
-DiplomaText:
- db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
-
-DiplomaPlayer:
- db "Player@"
-
-DiplomaEmptyText:
- db "@"
-
-DiplomaCongrats:
- db "Congrats! This"
- next "diploma certifies"
- next "that you have"
- next "completed your"
- next "#DEX.@"
-
-DiplomaGameFreak:
- db "GAME FREAK@"
diff --git a/engine/events/diploma2.asm b/engine/events/diploma2.asm
new file mode 100644
index 00000000..75ac104a
--- /dev/null
+++ b/engine/events/diploma2.asm
@@ -0,0 +1,171 @@
+CIRCLE_TILE_ID EQU $10
+
+_DisplayDiploma:
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ ld de, SurfingPikachu3Graphics
+ ld hl, vChars2
+ lb bc, BANK(SurfingPikachu3Graphics), (SurfingPikachu3GraphicsEnd - SurfingPikachu3Graphics) / $10
+ call CopyVideoData
+
+ hlcoord 0, 0
+ call Func_e9bdf
+
+ hlcoord 0, 0
+ call Func_e9beb
+
+ hlcoord 19, 0
+ call Func_e9beb
+
+ ld a, $00
+ hlcoord 0, 0
+ ld [hl], a
+ hlcoord 19, 0
+ ld [hl], a
+
+ ld de, String_e9a73
+ hlcoord 5, 2
+ call PlaceString
+
+ ld de, String_e9a7d
+ hlcoord 3, 4
+ call PlaceString
+
+ ld de, wPlayerName
+ hlcoord 10, 4
+ call PlaceString
+
+ ld de, String_e9a84
+ hlcoord 2, 6
+ call PlaceString
+
+ ld de, String_e9ac8
+ hlcoord 9, 16
+ call PlaceString
+
+ ld b, SET_PAL_GENERIC
+ call RunPaletteCommand
+ ld a, $01
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ call GBPalNormal
+ ret
+
+String_e9a73:
+ db CIRCLE_TILE_ID, "Diploma", CIRCLE_TILE_ID, "@"
+
+String_e9a7d:
+ db "Player@"
+
+String_e9a84:
+ db "Congrats! This"
+ next "diploma certifies"
+ next "that you have"
+ next "completed your"
+ next "#DEX.@"
+
+String_e9ac8:
+ db "GAME FREAK@"
+
+Func_e9ad3:
+ call ClearScreen
+ hlcoord 0, 17
+ call Func_e9bdf
+ hlcoord 0, 0
+ call Func_e9beb
+ hlcoord 19, 0
+ call Func_e9beb
+ ld a, $00
+ hlcoord 0, 17
+ ld [hl], a
+ hlcoord 19, 17
+ ld [hl], a
+ ld de, Tilemap_e9b3e
+ hlcoord 6, 2
+ lb bc, 10, 12
+ call Diploma_Surfing_CopyBox
+ ld de, Tilemap_e9bb6
+ hlcoord 5, 13
+ lb bc, 1, 11
+ call Diploma_Surfing_CopyBox
+ ld de, String_e9bd5
+ hlcoord 2, 15
+ call PlaceString
+ hlcoord 12, 15
+ ld de, wPlayTimeHours
+ lb bc, $40 | 1, 3
+ call PrintNumber
+ ld [hl], $16
+ inc hl
+ ld de, wPlayTimeMinutes
+ lb bc, $80 | 1, 2
+ call PrintNumber
+ ld a, [wNumSetBits]
+ cp 151
+ ret nz
+ ld de, TileMap_e9bc1
+ hlcoord 2, 0
+ lb bc, 4, 5
+ call Diploma_Surfing_CopyBox
+ ret
+
+Tilemap_e9b3e:
+ db $7f, $7f, $7f, $1a, $1b, $7f, $7f, $7f, $7f, $7f
+ db $7f, $7f, $7f, $7f, $7f, $1c, $1d, $1e, $1f, $20
+ db $7f, $21, $22, $23, $7f, $24, $25, $26, $27, $28
+ db $29, $2a, $2b, $2c, $2d, $2e, $2f, $30, $31, $32
+ db $33, $34, $35, $36, $37, $38, $39, $3a, $3b, $3c
+ db $7f, $3d, $3e, $3f, $40, $41, $42, $43, $29, $44
+ db $45, $46, $47, $48, $49, $4a, $4b, $29, $29, $4c
+ db $4d, $4e, $4f, $50, $51, $52, $53, $54, $55, $56
+ db $57, $58, $59, $7f, $7f, $7f, $5a, $5b, $5c, $5d
+ db $5e, $5f, $60, $61, $62, $7f, $7f, $7f, $7f, $63
+ db $64, $65, $66, $67, $68, $7f, $7f, $7f, $7f, $7f
+ db $7f, $69, $6a, $6b, $6c, $6d, $6e, $7f, $7f, $7f
+
+Tilemap_e9bb6:
+ db $05
+ db $06
+ db $07
+ db $08
+ db $09
+ db $0a
+ db $0b
+ db $0c
+ db $0d
+ db $0e
+ db $0f
+
+TileMap_e9bc1:
+ db $70, $71, $7f, $72, $7f
+ db $73, $74, $75, $76, $77
+ db $7f, $78, $11, $12, $13
+ db $7f, $7f, $14, $15, $7f
+
+String_e9bd5: db "PLAY TIME@"
+
+Func_e9bdf:
+ ld c, 10
+.asm_e9be1
+ ld [hl], $02
+ inc hl
+ ld [hl], $01
+ inc hl
+ dec c
+ jr nz, .asm_e9be1
+ ret
+
+Func_e9beb:
+ ld c, 9
+ ld de, SCREEN_WIDTH
+.asm_e9bed
+ ld [hl], $04
+ add hl, de
+ ld [hl], $03
+ add hl, de
+ dec c
+ jr nz, .asm_e9bed
+ ret
+
+SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu/surfing_pikachu_3.2bpp"
+SurfingPikachu3GraphicsEnd:
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 8e871456..004893a0 100644
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -1,6 +1,12 @@
DisplayElevatorFloorMenu:
+ ld hl, wd730
+ ld a, [hl]
+ push af
+ set 6, [hl]
ld hl, WhichFloorText
call PrintText
+ pop af
+ ld [wd730], a
ld hl, wItemList
ld a, l
ld [wListPointer], a
diff --git a/engine/events/evolve_trade.asm b/engine/events/evolve_trade.asm
deleted file mode 100644
index 56069fac..00000000
--- a/engine/events/evolve_trade.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-EvolveTradeMon:
-; Verify the TradeMon's species name before
-; attempting to initiate a trade evolution.
-
-; The names of the trade evolutions in Blue (JP)
-; are checked. In that version, TradeMons that
-; can evolve are Graveler and Haunter.
-
-; In localization, this check was translated
-; before monster names were finalized.
-; Then, Haunter's name was "Spectre".
-; Since its name no longer starts with
-; "SP", it is prevented from evolving.
-
-; This may have been why Red/Green's trades
-; were used instead, where none can evolve.
-
-; This was fixed in Yellow.
-
- ld a, [wInGameTradeReceiveMonName]
-
- ; GRAVELER
- cp "G"
- jr z, .ok
-
- ; "SPECTRE" (HAUNTER)
- cp "S"
- ret nz
- ld a, [wInGameTradeReceiveMonName + 1]
- cp "P"
- ret nz
-
-.ok
- ld a, [wPartyCount]
- dec a
- ld [wWhichPokemon], a
- ld a, $1
- ld [wForceEvolution], a
- ld a, LINK_STATE_TRADING
- ld [wLinkState], a
- callfar TryEvolvingMon
- xor a ; LINK_STATE_NONE
- ld [wLinkState], a
- jp PlayDefaultMusic
diff --git a/engine/events/give_pokemon.asm b/engine/events/give_pokemon.asm
index 14dcea42..a65f65cc 100644
--- a/engine/events/give_pokemon.asm
+++ b/engine/events/give_pokemon.asm
@@ -44,6 +44,8 @@ _GivePokemon::
ret
.addToParty
call SetPokedexOwnedFlag
+ ld hl, UnknownTerminator_f6794
+ call PrintText
call AddPartyMon
ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
@@ -68,6 +70,9 @@ SetPokedexOwnedFlag:
ld hl, GotMonText
jp PrintText
+UnknownTerminator_f6794:
+ text_end
+
GotMonText:
text_far _GotMonText
sound_get_item_1
diff --git a/engine/events/hidden_items.asm b/engine/events/hidden_items.asm
index 97bb0b71..63b95bcf 100644
--- a/engine/events/hidden_items.asm
+++ b/engine/events/hidden_items.asm
@@ -9,7 +9,7 @@ HiddenItems:
predef FlagActionPredef
ld a, c
and a
- ret nz
+ jr nz, .itemAlreadyFound
call EnableAutoTextBoxDrawing
ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
@@ -18,6 +18,11 @@ HiddenItems:
call GetItemName
tx_pre_jump FoundHiddenItemText
+.itemAlreadyFound
+ ld a, $ff
+ ldh [hItemAlreadyFound], a
+ ret
+
INCLUDE "data/events/hidden_item_coords.asm"
FoundHiddenItemText::
@@ -54,7 +59,7 @@ HiddenCoins:
predef GetQuantityOfItemInBag
ld a, b
and a
- ret z
+ jr z, .doNotPickUpCoins
ld hl, HiddenCoinCoords
call FindHiddenItemOrCoinsIndex
ld [wHiddenItemOrCoinsIndex], a
@@ -65,7 +70,7 @@ HiddenCoins:
predef FlagActionPredef
ld a, c
and a
- ret nz
+ jr nz, .doNotPickUpCoins
xor a
ldh [hUnusedCoinsByte], a
ldh [hCoins], a
@@ -79,6 +84,12 @@ HiddenCoins:
cp 40
jr z, .bcd20 ; should be bcd40
jr .bcd100
+
+.doNotPickUpCoins
+ ld a, $ff
+ ldh [hItemAlreadyFound], a
+ ret
+
.bcd10
ld a, $10
ldh [hCoins + 1], a
diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm
index a73596b4..bdbaff7e 100644
--- a/engine/events/hidden_objects/bills_house_pc.asm
+++ b/engine/events/hidden_objects/bills_house_pc.asm
@@ -52,9 +52,7 @@ BillsHouseInitiatedText::
text_far _BillsHouseInitiatedText
text_promptbutton
text_asm
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, 16
call DelayFrames
ld a, SFX_SWITCH
@@ -85,8 +83,7 @@ BillsHousePokemonList::
ld hl, wd730
set 6, [hl]
hlcoord 0, 0
- ld b, 10
- ld c, 9
+ lb bc, 10, 9
call TextBoxBorder
hlcoord 2, 2
ld de, BillsMonListText
diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
index e2ae7fbe..da550c76 100644
--- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm
+++ b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
@@ -9,6 +9,8 @@ CinnabarGymQuiz::
text_asm
xor a
ld [wOpponentAfterWrongAnswer], a
+ ld hl, wd475
+ res 7, [hl]
ld a, [wHiddenObjectFunctionArgument]
push af
and $f
@@ -17,7 +19,12 @@ CinnabarGymQuiz::
and $f0
swap a
ldh [hGymGateAnswer], a
+ ldh a, [hGymGateIndex]
ld hl, CinnabarGymQuizIntroText
+ cp 1
+ jr z, .onFirstQuestion
+ ld hl, CinnabarGymQuizShortIntroText
+.onFirstQuestion
call PrintText
ldh a, [hGymGateIndex]
dec a
@@ -35,10 +42,18 @@ CinnabarGymQuiz::
call CinnabarGymQuiz_1ea92
jp TextScriptEnd
+CinnabarGymQuizDummyIntroText:
+ text_far _CinnabarGymQuizDummyIntroText
+ text_end
+
CinnabarGymQuizIntroText:
text_far _CinnabarGymQuizIntroText
text_end
+CinnabarGymQuizShortIntroText:
+ text_far _CinnabarGymQuizShortIntroText
+ text_end
+
CinnabarQuizQuestions:
dw CinnabarQuizQuestionsText1
dw CinnabarQuizQuestionsText2
@@ -71,10 +86,6 @@ CinnabarQuizQuestionsText6:
text_far _CinnabarQuizQuestionsText6
text_end
-CinnabarGymGateFlagAction:
- EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
- predef_jump FlagActionPredef
-
CinnabarGymQuiz_1ea92:
call YesNoChoice
ldh a, [hGymGateAnswer]
@@ -114,6 +125,8 @@ CinnabarGymQuiz_1ea92:
ldh a, [hGymGateIndex]
add $2
ld [wOpponentAfterWrongAnswer], a
+ ld hl, wd475
+ set 7, [hl]
ret
CinnabarGymQuizCorrectText:
@@ -140,6 +153,10 @@ CinnabarGymQuizIncorrectText:
text_far _CinnabarGymQuizIncorrectText
text_end
+CinnabarGymGateFlagAction:
+ EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
+ predef_jump FlagActionPredef
+
UpdateCinnabarGymGateTileBlocks_::
; Update the overworld map with open floor blocks or locked gate blocks
; depending on event flags.
@@ -177,10 +194,11 @@ UpdateCinnabarGymGateTileBlocks_::
.next
pop bc
ld [wNewTileBlockID], a
- predef ReplaceTileBlock
+ call CinnabarGym_ReplaceTileBlock
ld hl, hGymGateIndex
dec [hl]
jr nz, .loop
+ callfar RedrawMapView
ret
gym_gate_coord: MACRO
@@ -198,3 +216,31 @@ CinnabarGymGateCoords:
gym_gate_coord 3, 8, VERTICAL_GATE_BLOCK
gym_gate_coord 2, 6, HORIZONTAL_GATE_BLOCK
gym_gate_coord 2, 3, HORIZONTAL_GATE_BLOCK
+
+
+CinnabarGym_ReplaceTileBlock:
+; basically a copy of the first half of ReplaceTileBlock
+; before checking if it is necessary to redraw the map view
+ ld hl, wOverworldMap
+ ld a, [wCurMapWidth]
+ add $6
+ ld e, a
+ ld d, $0
+ add hl, de
+ add hl, de
+ add hl, de
+ ld e, $3
+ add hl, de
+ ld e, a
+ ld a, b
+ and a
+ jr z, .addX
+.addWidthYTimesLoop
+ add hl, de
+ dec b
+ jr nz, .addWidthYTimesLoop
+.addX
+ add hl, bc
+ ld a, [wNewTileBlockID]
+ ld [hl], a
+ ret
diff --git a/engine/events/hidden_objects/fanclub_pictures.asm b/engine/events/hidden_objects/fanclub_pictures.asm
new file mode 100644
index 00000000..30bc72c7
--- /dev/null
+++ b/engine/events/hidden_objects/fanclub_pictures.asm
@@ -0,0 +1,23 @@
+FanClubPicture1:
+ ld a, RAPIDASH
+ ld [wcf91], a
+ call DisplayMonFrontSpriteInBox
+ call EnableAutoTextBoxDrawing
+ tx_pre FanClubPicture1Text
+ ret
+
+FanClubPicture1Text::
+ text_far _FanClubPicture1Text
+ text_end
+
+FanClubPicture2:
+ ld a, FEAROW
+ ld [wcf91], a
+ call DisplayMonFrontSpriteInBox
+ call EnableAutoTextBoxDrawing
+ tx_pre FanClubPicture2Text
+ ret
+
+FanClubPicture2Text::
+ text_far _FanClubPicture2Text
+ text_end
diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm
index 27714981..539f2c3f 100644
--- a/engine/events/hidden_objects/museum_fossils.asm
+++ b/engine/events/hidden_objects/museum_fossils.asm
@@ -21,32 +21,3 @@ KabutopsFossil:
KabutopsFossilText::
text_far _KabutopsFossilText
text_end
-
-DisplayMonFrontSpriteInBox:
-; Displays a pokemon's front sprite in a pop-up window.
-; [wcf91] = pokemon internal id number
- ld a, 1
- ldh [hAutoBGTransferEnabled], a
- call Delay3
- xor a
- ldh [hWY], a
- call SaveScreenTilesToBuffer1
- ld a, MON_SPRITE_POPUP
- ld [wTextBoxID], a
- call DisplayTextBoxID
- call UpdateSprites
- ld a, [wcf91]
- ld [wd0b5], a
- call GetMonHeader
- ld de, vChars1 tile $31
- call LoadMonFrontSprite
- ld a, $80
- ldh [hStartTileID], a
- hlcoord 10, 11
- predef AnimateSendingOutMon
- call WaitForTextScrollButtonPress
- call LoadScreenTilesFromBuffer1
- call Delay3
- ld a, $90
- ldh [hWY], a
- ret
diff --git a/engine/events/hidden_objects/museum_fossils2.asm b/engine/events/hidden_objects/museum_fossils2.asm
new file mode 100644
index 00000000..fce0f03a
--- /dev/null
+++ b/engine/events/hidden_objects/museum_fossils2.asm
@@ -0,0 +1,28 @@
+DisplayMonFrontSpriteInBox:
+; Displays a pokemon's front sprite in a pop-up window.
+; [wcf91] = pokemon internal id number
+ ld a, 1
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ xor a
+ ldh [hWY], a
+ call SaveScreenTilesToBuffer1
+ ld a, MON_SPRITE_POPUP
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ call UpdateSprites
+ ld a, [wcf91]
+ ld [wd0b5], a
+ call GetMonHeader
+ ld de, vChars1 + $310
+ call LoadMonFrontSprite
+ ld a, $80
+ ldh [hStartTileID], a
+ hlcoord 10, 11
+ predef AnimateSendingOutMon
+ call WaitForTextScrollButtonPress
+ call LoadScreenTilesFromBuffer1
+ call Delay3
+ ld a, $90
+ ldh [hWY], a
+ ret
diff --git a/engine/events/hidden_objects/oaks_lab_email.asm b/engine/events/hidden_objects/oaks_lab_email.asm
index b66babe0..bd4c66d7 100644
--- a/engine/events/hidden_objects/oaks_lab_email.asm
+++ b/engine/events/hidden_objects/oaks_lab_email.asm
@@ -3,7 +3,8 @@ DisplayOakLabEmailText:
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
- tx_pre_jump OakLabEmailText
+ tx_pre OakLabEmailText
+ ret
OakLabEmailText::
text_far _OakLabEmailText
diff --git a/engine/events/hidden_objects/route_15_binoculars.asm b/engine/events/hidden_objects/route_15_binoculars.asm
index ce047c2f..9734e833 100644
--- a/engine/events/hidden_objects/route_15_binoculars.asm
+++ b/engine/events/hidden_objects/route_15_binoculars.asm
@@ -7,7 +7,10 @@ Route15GateLeftBinoculars:
ld a, ARTICUNO
ld [wcf91], a
call PlayCry
- jp DisplayMonFrontSpriteInBox
+ call DisplayMonFrontSpriteInBox
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ret
Route15UpstairsBinocularsText::
text_far _Route15UpstairsBinocularsText
diff --git a/engine/events/hidden_objects/safari_game.asm b/engine/events/hidden_objects/safari_game.asm
index ac07e2f3..5a267346 100644
--- a/engine/events/hidden_objects/safari_game.asm
+++ b/engine/events/hidden_objects/safari_game.asm
@@ -31,8 +31,7 @@ SafariZoneGameOver:
call EnableAutoTextBoxDrawing
xor a
ld [wAudioFadeOutControl], a
- dec a ; SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ld c, BANK(SFX_Safari_Zone_PA)
ld a, SFX_SAFARI_ZONE_PA
call PlayMusic
diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm
index de4700d4..eb927292 100644
--- a/engine/events/hidden_objects/school_blackboard.asm
+++ b/engine/events/hidden_objects/school_blackboard.asm
@@ -27,8 +27,7 @@ LinkCableHelp::
ld hl, wd730
set 6, [hl]
hlcoord 0, 0
- ld b, 8
- ld c, 13
+ lb bc, 8, 13
call TextBoxBorder
hlcoord 2, 2
ld de, HowToLinkText
diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm
index c2bfed06..21dd3ee0 100644
--- a/engine/events/hidden_objects/vermilion_gym_trash.asm
+++ b/engine/events/hidden_objects/vermilion_gym_trash.asm
@@ -33,53 +33,17 @@ GymTrashScript:
.openFirstLock
; Next can is trying for the second switch.
SetEvent EVENT_1ST_LOCK_OPENED
-
- ld hl, GymTrashCans
- ld a, [wGymTrashCanIndex]
- ; * 5
- ld b, a
- add a
- add a
- add b
-
- ld d, 0
- ld e, a
- add hl, de
- ld a, [hli]
-
-; There is a bug in this code. It should calculate a value in the range [0, 3]
-; but if the mask and random number don't have any 1 bits in common, then
-; the result of the AND will be 0. When 1 is subtracted from that, the value
-; will become $ff. This will result in 255 being added to hl, which will cause
-; hl to point to one of the zero bytes that pad the end of the ROM bank.
-; Trash can 0 was intended to be able to have the second lock only when the
-; first lock was in trash can 1 or 3. However, due to this bug, trash can 0 can
-; have the second lock regardless of which trash can had the first lock.
-
- ldh [hGymTrashCanRandNumMask], a
- push hl
- call Random
- swap a
- ld b, a
- ldh a, [hGymTrashCanRandNumMask]
- and b
- dec a
- pop hl
-
- ld d, 0
- ld e, a
- add hl, de
- ld a, [hl]
- and $f
- ld [wSecondLockTrashCanIndex], a
-
+ callfar Yellow_SampleSecondTrashCan
tx_pre_id VermilionGymTrashSuccessText1
jr .done
.trySecondLock
- ld a, [wSecondLockTrashCanIndex]
- ld b, a
ld a, [wGymTrashCanIndex]
+ ld b, a
+ ld a, [wSecondLockTrashCanIndex]
+ cp b
+ jr z, .openSecondLock
+ ld a, [wSecondLockTrashCanIndex + 1]
cp b
jr z, .openSecondLock
@@ -107,25 +71,26 @@ GymTrashScript:
GymTrashCans:
; byte 0: mask for random number
; bytes 1-4: indices of the trash cans that can have the second lock
-; (but see the comment above explaining a bug regarding this)
; Note that the mask is simply the number of valid trash can indices that
-; follow. The remaining bytes are filled with 0 to pad the length of each entry
+; follow. The remaining bytes are filled with -1 to pad the length of each entry
; to 5 bytes.
- db 2, 1, 3, 0, 0 ; 0
- db 3, 0, 2, 4, 0 ; 1
- db 2, 1, 5, 0, 0 ; 2
- db 3, 0, 4, 6, 0 ; 3
+; This is functionally replaced with GymTrashCans3a but was never removed from source.
+
+ db 2, 1, 3, -1, -1 ; 0
+ db 3, 0, 2, 4, -1 ; 1
+ db 2, 1, 5, -1, -1 ; 2
+ db 3, 0, 4, 6, -1 ; 3
db 4, 1, 3, 5, 7 ; 4
- db 3, 2, 4, 8, 0 ; 5
- db 3, 3, 7, 9, 0 ; 6
+ db 3, 2, 4, 8, -1 ; 5
+ db 3, 3, 7, 9, -1 ; 6
db 4, 4, 6, 8, 10 ; 7
- db 3, 5, 7, 11, 0 ; 8
- db 3, 6, 10, 12, 0 ; 9
+ db 3, 5, 7, 11, -1 ; 8
+ db 3, 6, 10, 12, -1 ; 9
db 4, 7, 9, 11, 13 ; 10
- db 3, 8, 10, 14, 0 ; 11
- db 2, 9, 13, 0, 0 ; 12
- db 3, 10, 12, 14, 0 ; 13
- db 2, 11, 13, 0, 0 ; 14
+ db 3, 8, 10, 14, -1 ; 11
+ db 2, 9, 13, -1, -1 ; 12
+ db 3, 10, 12, 14, -1 ; 13
+ db 2, 11, 13, -1, -1 ; 14
VermilionGymTrashSuccessText1::
text_far _VermilionGymTrashSuccessText1
diff --git a/engine/events/hidden_objects/vermilion_gym_trash2.asm b/engine/events/hidden_objects/vermilion_gym_trash2.asm
new file mode 100644
index 00000000..1bc0590b
--- /dev/null
+++ b/engine/events/hidden_objects/vermilion_gym_trash2.asm
@@ -0,0 +1,108 @@
+TrashCanRandom:
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call JumpToAddress
+ ld e, a
+ ld d, 0
+ ret
+
+.Jumptable:
+ dw .zero
+ dw .one
+ dw .two
+ dw .three
+ dw .four
+
+.zero
+.one
+ ld a, 0
+ ret
+
+.two
+ call Random
+ and $1
+ ret
+
+.three ; should return to a, instead returns to b
+ call Random
+ swap a
+ cp 1 * $ff / 3
+ ld b, 0
+ ret c
+ cp 2 * $ff / 3
+ ld b, 1
+ ret c
+ ld b, 2
+ ret
+
+.four
+ call Random
+ and $3
+ ret
+
+Yellow_SampleSecondTrashCan:
+ ld hl, GymTrashCans3c
+ ld a, [wGymTrashCanIndex]
+ ld c, a
+ ld b, 0
+ ld a, 9
+ call AddNTimes
+ call AddNTimes ; ????
+ ld a, [hli]
+ ldh [hGymTrashCanRandNumMask], a
+ ld e, a
+ push hl
+ call TrashCanRandom
+ pop hl
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld [wSecondLockTrashCanIndex], a
+ ld a, [hl]
+ ld [wSecondLockTrashCanIndex + 1], a
+ ret
+
+GymTrashCans3c:
+; First byte: number of trashcan entries
+; Following four byte pairs: indices for the second trash can.
+; BUG: Rows that have 3 trashcan entries are sampled incorrectly.
+; The sampling occurs by taking a random number and seeing which
+; third of the range 0-255 the number falls in. However, it returns
+; that value to the wrong register, so the result is never used.
+; Instead of using an offset in [0,1,2], the offset is instead
+; in the full range 0-255. This results in truly random behavior.
+ db 4
+ db 1,3, 3,1, 1,-1, 3,-1
+ db 3
+ db 0,2, 2,4, 4,0, -1,-1
+ db 4
+ db 1,5, 5,1, 1,-1, 5,-1
+ db 3
+ db 0,4, 4,6, 6,0, -1,-1
+ db 4
+ db 1,3, 3,1, 5,5, 7,7
+ db 3
+ db 2,4, 4,8, 8,2, -1,-1
+ db 3
+ db 3,7, 7,9, 9,3, -1,-1
+ db 4
+ db 4,8, 6,10, 8,4, 10,6
+ db 3
+ db 5,7, 7,11, 11,5, -1,-1
+ db 3
+ db 6,10, 10,12, 12,6, -1,-1
+ db 4
+ db 7,9, 9,7, 11,13, 13,11
+ db 3
+ db 8,10, 10,14, 14,8, -1,-1
+ db 4
+ db 9,13, 13,9, 9,-1, 13,-1
+ db 3
+ db 10,12, 12,14, 14,10, -1,-1
+ db 4
+ db 11,13, 13,11, 11,-1, 13,-1
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index c6951615..a0a23dfa 100644
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -3,13 +3,8 @@ DoInGameTradeDialogue:
call SaveScreenTilesToBuffer2
ld hl, TradeMons
ld a, [wWhichTrade]
- ld b, a
- swap a
- sub b
- sub b
- ld c, a
- ld b, 0
- add hl, bc
+ ld bc, $e
+ call AddNTimes
ld a, [hli]
ld [wInGameTradeGiveMonSpecies], a
ld a, [hli]
@@ -35,18 +30,15 @@ DoInGameTradeDialogue:
ld a, [wInGameTradeReceiveMonSpecies]
ld de, wInGameTradeReceiveMonName
call InGameTrade_GetMonName
- ld hl, wCompletedInGameTradeFlags
- ld a, [wWhichTrade]
- ld c, a
+ ld a, $4
+ ld [wInGameTradeTextPointerTableIndex], a
ld b, FLAG_TEST
- predef FlagActionPredef
+ call InGameTrade_FlagActionPredef
ld a, c
and a
- ld a, $4
- ld [wInGameTradeTextPointerTableIndex], a
jr nz, .printText
; if the trade hasn't been done yet
- xor a
+ ld a, $0
ld [wInGameTradeTextPointerTableIndex], a
call .printText
ld a, $1
@@ -109,11 +101,8 @@ InGameTrade_DoTrade:
call AddNTimes
ld a, [hl]
ld [wCurEnemyLVL], a
- ld hl, wCompletedInGameTradeFlags
- ld a, [wWhichTrade]
- ld c, a
ld b, FLAG_SET
- predef FlagActionPredef
+ call InGameTrade_FlagActionPredef
ld hl, ConnectCableText
call PrintText
ld a, [wWhichPokemon]
@@ -137,7 +126,7 @@ InGameTrade_DoTrade:
ld [wMonDataLocation], a
call AddPartyMon
call InGameTrade_CopyDataToReceivedMon
- callfar EvolveTradeMon
+ call InGameTrade_CheckForTradeEvo
call ClearScreen
call InGameTrade_RestoreScreen
farcall RedrawMapView
@@ -229,6 +218,37 @@ InGameTrade_GetReceivedMonPointer:
ld d, h
ret
+InGameTrade_FlagActionPredef:
+ ld hl, wCompletedInGameTradeFlags
+ ld a, [wWhichTrade]
+ ld c, a
+ predef_jump FlagActionPredef
+
+InGameTrade_CheckForTradeEvo:
+ ld a, [wInGameTradeReceiveMonSpecies]
+ cp KADABRA
+ jr z, .tradeEvo
+ cp GRAVELER
+ jr z, .tradeEvo
+ cp MACHOKE
+ jr z, .tradeEvo
+ cp HAUNTER
+ jr z, .tradeEvo
+ ret
+
+.tradeEvo
+ ld a, [wPartyCount]
+ dec a
+ ld [wWhichPokemon], a
+ ld a, $1
+ ld [wForceEvolution], a
+ ld a, LINK_STATE_TRADING
+ ld [wLinkState], a
+ callfar EvolveTradeMon
+ xor a ; LINK_STATE_NONE
+ ld [wLinkState], a
+ jp PlayDefaultMusic
+
InGameTrade_TrainerString:
db "<TRAINER>@@@@@@@@@@"
diff --git a/engine/events/pikachu_happiness.asm b/engine/events/pikachu_happiness.asm
new file mode 100644
index 00000000..0d79e32b
--- /dev/null
+++ b/engine/events/pikachu_happiness.asm
@@ -0,0 +1,118 @@
+ModifyPikachuHappiness::
+ ld a, d
+ cp PIKAHAPPY_GYMLEADER
+ jr z, .checkanywhereinparty
+ cp PIKAHAPPY_WALKING
+ jr z, .checkanywhereinparty
+ push de
+ callfar IsThisPartymonStarterPikachu_Party
+ pop de
+ ret nc
+ jr .proceed
+
+.checkanywhereinparty
+ push de
+ callfar IsStarterPikachuInOurParty
+ pop de
+ ret nc
+
+.proceed
+ push de
+ ; Divide [wPikachuHappiness] by 100. Hold the integer part in e.
+ ld e, $0
+ ld a, [wPikachuHappiness]
+ cp 100
+ jr c, .wPikachuHappiness_div_100
+ inc e
+ cp 200
+ jr c, .wPikachuHappiness_div_100
+ inc e
+.wPikachuHappiness_div_100
+ ; Get the (d, e) entry from HappinessChangeTable.
+ ld c, d
+ dec c
+ ld b, $0
+ ld hl, HappinessChangeTable
+ add hl, bc
+ add hl, bc
+ add hl, bc
+ ld d, $0
+ add hl, de
+ ld a, [hl]
+ ; If [hl] is positive, take min(0xff, [hl] + [wPikachuHappiness]).
+ ; If [hl] is negative, take max(0x00, [hl] + [wPikachuHappiness]).
+ ; Inexplicably, we're using 100 as the threshold for comparison.
+ cp 100
+ ld a, [wPikachuHappiness]
+ jr nc, .negative
+ add [hl]
+ jr nc, .okay
+ ld a, -1
+ jr .okay
+
+.negative
+ add [hl]
+ jr c, .okay
+ xor a
+.okay
+ ld [wPikachuHappiness], a
+
+ ; Restore d and get the d'th entry in PikachuMoods.
+ pop de
+ dec d
+ ld hl, PikachuMoods
+ ld e, d
+ ld d, $0
+ add hl, de
+ ld a, [hl]
+ ld b, a
+ ; Modify Pikachu's mood
+ cp $80
+ jr z, .done
+ ld a, [wPikachuMood]
+ jr c, .decreased
+ cp b
+ jr nc, .done
+ ld a, [wd49c]
+ and a
+ jr nz, .done
+ jr .update_mood
+
+.decreased
+ cp b
+ jr c, .done
+.update_mood
+ ld a, b
+ ld [wPikachuMood], a
+.done
+ ret
+
+HappinessChangeTable:
+ ; Increase
+ db 5, 3, 2 ; Gained a level
+ db 5, 3, 2 ; HP restore
+ db 1, 1, 0 ; Used X item
+ db 3, 2, 1 ; Challenged Gym Leader
+ db 1, 1, 0 ; Teach TM/HM
+ db 2, 1, 1 ; Walking around
+ ; Decrease
+ db -3, -3, -5 ; Deposited
+ db -1, -1, -1 ; Fainted in battle
+ db -5, -5, -10 ; Fainted due to Poison outside of battle
+ db -5, -5, -10 ; Fainted to opponent at least 30 levels higher
+ db -10, -10, -20 ; Traded away
+
+PikachuMoods:
+ ; Increase
+ db $8a ; Gained a level
+ db $83 ; HP restore
+ db $80 ; Teach TM/HM
+ db $80 ; Challenged Gym Leader
+ db $94 ; Unknown (d = 5)
+ db $80 ; Unknown (d = 6)
+ ; Decrease
+ db $62 ; Deposited
+ db $6c ; Fainted
+ db $62 ; Unknown (d = 9)
+ db $6c ; Unknown (d = 10)
+ db $00 ; Unknown (d = 11)
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index 8bb756b5..9f3ad391 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -2,13 +2,20 @@ ApplyOutOfBattlePoisonDamage:
ld a, [wd730]
add a
jp c, .noBlackOut ; no black out if joypad states are being simulated
+ ld a, [wd492]
+ bit 7, a
+ jp nz, .noBlackOut
+ ld a, [wd72e]
+ bit 6, a
+ jp nz, .noBlackOut
ld a, [wPartyCount]
and a
jp z, .noBlackOut
call IncrementDayCareMonExp
+ call Func_c4c7
ld a, [wStepCounter]
and $3 ; is the counter a multiple of 4?
- jp nz, .noBlackOut ; only apply poison damage every fourth step
+ jp nz, .skipPoisonEffectAndSound ; only apply poison damage every fourth step
ld [wWhichPokemon], a
ld hl, wPartyMon1Status
ld de, wPartySpecies
@@ -54,6 +61,12 @@ ApplyOutOfBattlePoisonDamage:
ld a, TEXT_MON_FAINTED
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .curMonNotPlayerPikachu
+ ld e, $3
+ callfar PlayPikachuSoundClip
+ calladb_ModifyPikachuHappiness PIKAHAPPY_PSNFNT
+.curMonNotPlayerPikachu
pop de
pop hl
.nextMon
@@ -110,3 +123,29 @@ ApplyOutOfBattlePoisonDamage:
.done
ld [wOutOfBattleBlackout], a
ret
+
+Func_c4c7:
+ ld a, [wStepCounter]
+ and a
+ jr nz, .asm_c4de
+ call Random
+ and $1
+ jr z, .asm_c4de
+ calladb_ModifyPikachuHappiness $6
+.asm_c4de
+ ld hl, wPikachuMood
+ ld a, [hl]
+ cp $80
+ jr z, .asm_c4ef
+ jr c, .asm_c4ea
+ dec a
+ dec a
+.asm_c4ea
+ inc a
+ ld [hl], a
+ cp $80
+ ret nz
+.asm_c4ef
+ xor a
+ ld [wd49c], a
+ ret
diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm
index 97dbcd53..e007030a 100644
--- a/engine/events/pokecenter.asm
+++ b/engine/events/pokecenter.asm
@@ -1,4 +1,13 @@
DisplayPokemonCenterDialogue_::
+ ld a, [wCurMap]
+ cp PEWTER_POKECENTER
+ jr nz, .regularCenter
+ call CheckPikachuFollowingPlayer
+ jr z, .regularCenter
+ ld hl, LooksContentText ; if pikachu is sleeping, don't heal
+ call PrintText
+ ret
+.regularCenter
call SaveScreenTilesToBuffer1 ; save screen
ld hl, PokemonCenterWelcomeText
call PrintText
@@ -11,18 +20,36 @@ DisplayPokemonCenterDialogue_::
call PrintText
.skipShallWeHealYourPokemon
call YesNoChoicePokeCenter ; yes/no menu
+ call UpdateSprites
ld a, [wCurrentMenuItem]
and a
- jr nz, .declinedHealing ; if the player chose No
+ jp nz, .declinedHealing ; if the player chose No
call SetLastBlackoutMap
- call LoadScreenTilesFromBuffer1 ; restore screen
+ callfar IsStarterPikachuInOurParty
+ jr nc, .notHealingPlayerPikachu
+ call CheckPikachuFollowingPlayer
+ jr nz, .notHealingPlayerPikachu
+ call LoadCurrentMapView
+ call Delay3
+ call UpdateSprites
+ callfar PikachuWalksToNurseJoy ; todo
+.notHealingPlayerPikachu
ld hl, NeedYourPokemonText
call PrintText
- ld a, $18
- ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine
- call Delay3
- predef HealParty
+ ld c, 64
+ call DelayFrames
+ call CheckPikachuFollowingPlayer
+ jr nz, .playerPikachuNotOnScreen
+ call DisablePikachuOverworldSpriteDrawing
+ callfar IsStarterPikachuInOurParty
+ call c, Func_6eaa
+.playerPikachuNotOnScreen
+ lb bc, 1, 8
+ call Func_6ebb
+ ld c, 30
+ call DelayFrames
farcall AnimateHealingMachine ; do the healing machine animation
+ predef HealParty
xor a
ld [wAudioFadeOutControl], a
ld a, [wAudioSavedROMBank]
@@ -31,19 +58,69 @@ DisplayPokemonCenterDialogue_::
ld [wLastMusicSoundID], a
ld [wNewSoundID], a
call PlaySound
+ call CheckPikachuFollowingPlayer
+ jr nz, .doNotReturnPikachu
+ callfar IsStarterPikachuInOurParty
+ call c, Func_6eaa
+ ld a, $5
+ ld [wPikachuSpawnState], a
+ call EnablePikachuOverworldSpriteDrawing
+.doNotReturnPikachu
+ lb bc, 1, 0
+ call Func_6ebb
ld hl, PokemonFightingFitText
call PrintText
- ld a, $14
- ld [wSprite01StateData1ImageIndex], a ; make the nurse bow
- ld c, a
+ callfar IsStarterPikachuInOurParty
+ jr nc, .notInParty
+ lb bc, 15, 0
+ call Func_6ebb
+.notInParty
+ call LoadCurrentMapView
+ call Delay3
+ call UpdateSprites
+ callfar ReloadWalkingTilePatterns
+ ld a, $1
+ ldh [hSpriteIndex], a
+ ld a, $1
+ ldh [hSpriteImageIndex], a
+ call SpriteFunc_34a1
+ ld c, 40
call DelayFrames
+ call UpdateSprites
+ call LoadFontTilePatterns
jr .done
.declinedHealing
call LoadScreenTilesFromBuffer1 ; restore screen
.done
ld hl, PokemonCenterFarewellText
call PrintText
- jp UpdateSprites
+ call UpdateSprites
+ ret
+
+Func_6eaa:
+ ld a, $1
+ ldh [hSpriteIndex], a
+ ld a, $4
+ ldh [hSpriteImageIndex], a
+ call SpriteFunc_34a1
+ ld c, 64
+ call DelayFrames
+ ret
+
+Func_6ebb:
+ ld a, b
+ ldh [hSpriteIndex], a
+ ld a, c
+ ldh [hSpriteImageIndex], a
+ push bc
+ call SetSpriteFacingDirectionAndDelay
+ pop bc
+ ld a, b
+ ldh [hSpriteIndex], a
+ ld a, c
+ ldh [hSpriteImageIndex], a
+ call SpriteFunc_34a1
+ ret
PokemonCenterWelcomeText:
text_far _PokemonCenterWelcomeText
@@ -66,3 +143,7 @@ PokemonCenterFarewellText:
text_pause
text_far _PokemonCenterFarewellText
text_end
+
+LooksContentText:
+ text_far _LooksContentText
+ text_end
diff --git a/engine/events/pokecenter_chansey.asm b/engine/events/pokecenter_chansey.asm
new file mode 100644
index 00000000..d7c3a95b
--- /dev/null
+++ b/engine/events/pokecenter_chansey.asm
@@ -0,0 +1,11 @@
+PokecenterChanseyText::
+ ld hl, NurseChanseyText
+ call PrintText
+ ld a, CHANSEY
+ call PlayCry
+ call WaitForSoundToFinish
+ ret
+
+NurseChanseyText:
+ text_far _NurseChanseyText
+ text_end
diff --git a/engine/events/pokedex_rating.asm b/engine/events/pokedex_rating.asm
index c61253b7..1086257a 100644
--- a/engine/events/pokedex_rating.asm
+++ b/engine/events/pokedex_rating.asm
@@ -26,7 +26,7 @@ DisplayDexRating:
CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING
jr nz, .hallOfFame
push hl
- ld hl, PokedexRatingText_441cc
+ ld hl, DexCompletionText
call PrintText
pop hl
call PrintText
@@ -51,88 +51,88 @@ DisplayDexRating:
ld [de], a
ret
-PokedexRatingText_441cc:
- text_far _OaksLabText_441cc
+DexCompletionText:
+ text_far _DexCompletionText
text_end
DexRatingsTable:
- dbw 10, PokedexRatingText_44201
- dbw 20, PokedexRatingText_44206
- dbw 30, PokedexRatingText_4420b
- dbw 40, PokedexRatingText_44210
- dbw 50, PokedexRatingText_44215
- dbw 60, PokedexRatingText_4421a
- dbw 70, PokedexRatingText_4421f
- dbw 80, PokedexRatingText_44224
- dbw 90, PokedexRatingText_44229
- dbw 100, PokedexRatingText_4422e
- dbw 110, PokedexRatingText_44233
- dbw 120, PokedexRatingText_44238
- dbw 130, PokedexRatingText_4423d
- dbw 140, PokedexRatingText_44242
- dbw 150, PokedexRatingText_44247
- dbw NUM_POKEMON + 1, PokedexRatingText_4424c
+ dbw 10, DexRatingText_Own0To9
+ dbw 20, DexRatingText_Own10To19
+ dbw 30, DexRatingText_Own20To29
+ dbw 40, DexRatingText_Own30To39
+ dbw 50, DexRatingText_Own40To49
+ dbw 60, DexRatingText_Own50To59
+ dbw 70, DexRatingText_Own60To69
+ dbw 80, DexRatingText_Own70To79
+ dbw 90, DexRatingText_Own80To89
+ dbw 100, DexRatingText_Own90To99
+ dbw 110, DexRatingText_Own100To109
+ dbw 120, DexRatingText_Own110To119
+ dbw 130, DexRatingText_Own120To129
+ dbw 140, DexRatingText_Own130To139
+ dbw 150, DexRatingText_Own140To149
+ dbw NUM_POKEMON + 1, DexRatingText_Own150To151
-PokedexRatingText_44201:
- text_far _OaksLabText_44201
+DexRatingText_Own0To9:
+ text_far _DexRatingText_Own0To9
text_end
-PokedexRatingText_44206:
- text_far _OaksLabText_44206
+DexRatingText_Own10To19:
+ text_far _DexRatingText_Own10To19
text_end
-PokedexRatingText_4420b:
- text_far _OaksLabText_4420b
+DexRatingText_Own20To29:
+ text_far _DexRatingText_Own20To29
text_end
-PokedexRatingText_44210:
- text_far _OaksLabText_44210
+DexRatingText_Own30To39:
+ text_far _DexRatingText_Own30To39
text_end
-PokedexRatingText_44215:
- text_far _OaksLabText_44215
+DexRatingText_Own40To49:
+ text_far _DexRatingText_Own40To49
text_end
-PokedexRatingText_4421a:
- text_far _OaksLabText_4421a
+DexRatingText_Own50To59:
+ text_far _DexRatingText_Own50To59
text_end
-PokedexRatingText_4421f:
- text_far _OaksLabText_4421f
+DexRatingText_Own60To69:
+ text_far _DexRatingText_Own60To69
text_end
-PokedexRatingText_44224:
- text_far _OaksLabText_44224
+DexRatingText_Own70To79:
+ text_far _DexRatingText_Own70To79
text_end
-PokedexRatingText_44229:
- text_far _OaksLabText_44229
+DexRatingText_Own80To89:
+ text_far _DexRatingText_Own80To89
text_end
-PokedexRatingText_4422e:
- text_far _OaksLabText_4422e
+DexRatingText_Own90To99:
+ text_far _DexRatingText_Own90To99
text_end
-PokedexRatingText_44233:
- text_far _OaksLabText_44233
+DexRatingText_Own100To109:
+ text_far _DexRatingText_Own100To109
text_end
-PokedexRatingText_44238:
- text_far _OaksLabText_44238
+DexRatingText_Own110To119:
+ text_far _DexRatingText_Own110To119
text_end
-PokedexRatingText_4423d:
- text_far _OaksLabText_4423d
+DexRatingText_Own120To129:
+ text_far _DexRatingText_Own120To129
text_end
-PokedexRatingText_44242:
- text_far _OaksLabText_44242
+DexRatingText_Own130To139:
+ text_far _DexRatingText_Own130To139
text_end
-PokedexRatingText_44247:
- text_far _OaksLabText_44247
+DexRatingText_Own140To149:
+ text_far _DexRatingText_Own140To149
text_end
-PokedexRatingText_4424c:
- text_far _OaksLabText_4424c
+DexRatingText_Own150To151:
+ text_far _DexRatingText_Own150To151
text_end
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index d9320fe7..87244119 100644
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -23,8 +23,7 @@ CeladonPrizeMenu::
ld [wTopMenuItemX], a
call PrintPrizePrice
hlcoord 0, 2
- ld b, 8
- ld c, 16
+ lb bc, 8, 16
call TextBoxBorder
call GetPrizeMenuId
call UpdateSprites
@@ -143,12 +142,14 @@ GetPrizeMenuId:
ld c, (1 << 7 | 2)
jp PrintBCDNumber
+NoThanksText:
+ db "NO THANKS@"
+
INCLUDE "data/events/prizes.asm"
PrintPrizePrice:
hlcoord 11, 0
- ld b, 1
- ld c, 7
+ lb bc, 1, 7
call TextBoxBorder
call UpdateSprites
hlcoord 12, 0
diff --git a/engine/events/try_pikachu_movement.asm b/engine/events/try_pikachu_movement.asm
new file mode 100644
index 00000000..70cf65b4
--- /dev/null
+++ b/engine/events/try_pikachu_movement.asm
@@ -0,0 +1,27 @@
+TryApplyPikachuMovementData::
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ ld a, [wWalkBikeSurfState]
+ and a
+ ret nz
+ push hl
+ push bc
+ callfar GetPikachuFacingDirectionAndReturnToE
+ pop bc
+ pop hl
+ ld a, b
+ cp e
+ ret nz
+ push hl
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ callfar LoadPikachuShadowIntoVRAM
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop hl
+ call ApplyPikachuMovementData
+ callfar RefreshPikachuFollow
+ ret
diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm
index a67f1c07..6ff6a5e4 100644
--- a/engine/events/vending_machine.asm
+++ b/engine/events/vending_machine.asm
@@ -18,8 +18,7 @@ VendingMachineMenu::
ld hl, wd730
set 6, [hl]
hlcoord 0, 3
- ld b, 8
- ld c, 12
+ lb bc, 8, 12
call TextBoxBorder
call UpdateSprites
hlcoord 2, 5
diff --git a/engine/gfx/animated_objects.asm b/engine/gfx/animated_objects.asm
new file mode 100644
index 00000000..971af6b5
--- /dev/null
+++ b/engine/gfx/animated_objects.asm
@@ -0,0 +1,394 @@
+ClearObjectAnimationBuffers:
+ ld hl, wAnimatedObjectsData
+ ld bc, wAnimatedObjectsDataEnd - wAnimatedObjectsData
+ xor a
+ call FillMemory
+ ret
+
+RunObjectAnimations:
+ ld hl, wAnimatedObjectDataStructs
+ ld e, 10
+.loop
+ ld a, [hl]
+ and a
+ jr z, .next
+ ld c, l
+ ld b, h
+ push hl
+ push de
+ call ExecuteCurrentAnimatedObjectCallback
+ call UpdateCurrentAnimatedObjectFrame
+ pop de
+ pop hl
+ jr c, .quit
+.next
+ ld bc, $10
+ add hl, bc
+ dec e
+ jr nz, .loop
+ ld a, [wCurrentAnimatedObjectOAMBufferOffset]
+ ld l, a
+ ld h, HIGH(wOAMBuffer)
+.deinit_unused_oam_loop
+ ld a, l
+ cp LOW(wOAMBufferEnd)
+ jr nc, .quit
+ xor a
+ ld [hli], a
+ jr .deinit_unused_oam_loop
+
+.quit
+ ret
+
+SpawnAnimatedObject:
+ push de
+ push af
+ ld hl, wAnimatedObjectDataStructs
+ ld e, 10
+.loop
+ ld a, [hl]
+ and a
+ jr z, .init
+ ld bc, $10
+ add hl, bc
+ dec e
+ jr nz, .loop
+ pop af
+ pop de
+ scf
+ ret
+
+.init
+ pop af
+ ld c, l
+ ld b, h
+ ld hl, wNumLoadedAnimatedObjects
+ inc [hl]
+ ld e, a
+ ld d, $0
+ ld a, [wAnimatedObjectSpawnStateDataPointer]
+ ld l, a
+ ld a, [wAnimatedObjectSpawnStateDataPointer + 1]
+ ld h, a
+ add hl, de
+ add hl, de
+ add hl, de
+ ld e, l
+ ld d, h
+ ld hl, $0
+ add hl, bc
+ ld a, [wNumLoadedAnimatedObjects]
+ ld [hli], a
+ ld a, [de]
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ inc de
+ xor a
+ ld [hli], a
+ pop de
+ ld hl, $4
+ add hl, bc
+ ld a, e
+ ld [hli], a
+ ld a, d
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ dec a
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ret
+
+MaskCurrentAnimatedObjectStruct:
+ ld hl, $0
+ add hl, bc
+ ld [hl], $0
+ ret
+
+MaskAllAnimatedObjectStructs:
+ ld hl, wAnimatedObjectDataStructs
+ ld e, 10
+.loop
+ ld [hl], $0
+ ld bc, $10
+ add hl, bc
+ dec e
+ jr nz, .loop
+ ret
+
+UpdateCurrentAnimatedObjectFrame:
+ xor a
+ ld [wCurAnimatedObjectOAMAttributes], a
+ ld hl, $3
+ add hl, bc
+ ld a, [hli]
+ ld [wCurrentAnimatedObjectVTileOffset], a
+ ld a, [hli]
+ ld [wCurrentAnimatedObjectXCoord], a
+ ld a, [hli]
+ ld [wCurrentAnimatedObjectYCoord], a
+ ld a, [hli]
+ ld [wCurrentAnimatedObjectXOffset], a
+ ld a, [hl]
+ ld [wCurrentAnimatedObjectYOffset], a
+ call UpdateDurationTimerAndFrameStateForCurrentAnimatedObject
+ cp $fd
+ jr z, .finish
+ cp $fc
+ jr z, .delete_animation
+ call GetCurrentAnimatedObjectOAMDataPointer
+ ld a, [wCurrentAnimatedObjectVTileOffset]
+ add [hl]
+ ld [wCurrentAnimatedObjectVTileOffset], a
+ inc hl
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ push bc
+ ld a, [wCurrentAnimatedObjectOAMBufferOffset]
+ ld e, a
+ ld d, HIGH(wOAMBuffer)
+ ld a, [hli]
+ ld c, a
+.loop
+ ld a, [wCurrentAnimatedObjectYCoord]
+ ld b, a
+ ld a, [wCurrentAnimatedObjectYOffset]
+ add b
+ ld b, a
+ ld a, [wAnimatedObjectGlobalYOffset]
+ add b
+ ld b, a
+ call GetCurrentAnimatedObjectTileYCoordinate
+ add b
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [wCurrentAnimatedObjectXCoord]
+ ld b, a
+ ld a, [wCurrentAnimatedObjectXOffset]
+ add b
+ ld b, a
+ ld a, [wAnimatedObjectGlobalXOffset]
+ add b
+ ld b, a
+ call GetCurrentAnimatedObjectTileXCoordinate
+ add b
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [wCurrentAnimatedObjectVTileOffset]
+ add [hl]
+ ld [de], a
+ inc hl
+ inc de
+ call SetCurrentAnimatedObjectOAMAttributes
+ ld b, a
+ ld a, [wc634]
+ cp $7
+ ld a, b
+ jr z, .skip_load
+ ld [de], a
+.skip_load
+ inc hl
+ inc de
+ ld a, e
+ ld [wCurrentAnimatedObjectOAMBufferOffset], a
+ cp LOW(wOAMBufferEnd)
+ jr nc, .oam_is_full
+ dec c
+ jr nz, .loop
+ pop bc
+ jr .finish
+
+.delete_animation
+ call MaskCurrentAnimatedObjectStruct
+.finish
+ and a
+ ret
+
+.oam_is_full
+ pop bc
+ scf
+ ret
+
+GetCurrentAnimatedObjectTileYCoordinate:
+ push hl
+ ld a, [hl]
+ ld hl, wCurAnimatedObjectOAMAttributes
+ bit 6, [hl]
+ jr z, .no_flip
+ add $8
+ xor $ff
+ inc a
+.no_flip
+ pop hl
+ ret
+
+GetCurrentAnimatedObjectTileXCoordinate:
+ push hl
+ ld a, [hl]
+ ld hl, wCurAnimatedObjectOAMAttributes
+ bit 5, [hl]
+ jr z, .no_flip
+ add $8
+ xor $ff
+ inc a
+.no_flip
+ pop hl
+ ret
+
+SetCurrentAnimatedObjectOAMAttributes:
+ ld a, [wCurAnimatedObjectOAMAttributes]
+ ld b, a
+ ld a, [hl]
+ xor b
+ and $e0
+ ld b, a
+ ld a, [hl]
+ and $10
+ or b
+ bit 4, a
+ ret z
+ or $4
+ ret
+
+GetCurrentAnimatedObjectOAMDataPointer:
+ ld e, a
+ ld d, $0
+ ld a, [wAnimatedObjectOAMDataPointer]
+ ld l, a
+ ld a, [wAnimatedObjectOAMDataPointer + 1]
+ ld h, a
+ add hl, de
+ add hl, de
+ add hl, de
+ ret
+
+SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters:
+ ld hl, $1
+ add hl, bc
+ ld [hl], a
+ ld hl, $8
+ add hl, bc
+ ld [hl], $0
+ ld hl, $9
+ add hl, bc
+ ld [hl], $0
+ ld hl, $a
+ add hl, bc
+ ld [hl], $ff
+ ret
+
+UpdateDurationTimerAndFrameStateForCurrentAnimatedObject:
+.loop
+ ld hl, $8
+ add hl, bc
+ ld a, [hl]
+ and a
+ jr z, .next_frame
+ dec [hl]
+ call GetPointerToCurrentAnimatedObjectFrameScript
+ ld a, [hli]
+ push af
+ jr .finish
+
+.next_frame
+ ld hl, $a
+ add hl, bc
+ inc [hl]
+ call GetPointerToCurrentAnimatedObjectFrameScript
+ ld a, [hli]
+ cp $fe
+ jr z, .restart_anim
+ cp $ff
+ jr z, .hold_last_frame_state
+ push af
+ ld a, [hl]
+ push hl
+ and $3f
+ ld hl, $9
+ add hl, bc
+ add [hl]
+ ld hl, $8
+ add hl, bc
+ ld [hl], a
+ pop hl
+.finish
+ ld a, [hl]
+ and $c0
+ srl a
+ ld [wCurAnimatedObjectOAMAttributes], a
+ pop af
+ ret
+
+.hold_last_frame_state
+ xor a
+ ld hl, $8
+ add hl, bc
+ ld [hl], a
+ ld hl, $a
+ add hl, bc
+ dec [hl]
+ dec [hl]
+ jr .loop
+
+.restart_anim
+ xor a
+ ld hl, $8
+ add hl, bc
+ ld [hl], a
+ dec a
+ ld hl, $a
+ add hl, bc
+ ld [hl], a
+ jr .loop
+
+GetPointerToCurrentAnimatedObjectFrameScript:
+ ld hl, $1
+ add hl, bc
+ ld e, [hl]
+ ld d, $0
+ ld a, [wAnimatedObjectFramesDataPointer]
+ ld l, a
+ ld a, [wAnimatedObjectFramesDataPointer + 1]
+ ld h, a
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld hl, $a
+ add hl, bc
+ ld l, [hl]
+ ld h, $0
+ add hl, hl
+ add hl, de
+ ret
+
+ExecuteCurrentAnimatedObjectCallback:
+ ld hl, $2
+ add hl, bc
+ ld e, [hl]
+ ld d, $0
+ ld a, [wAnimatedObjectJumptablePointer]
+ ld l, a
+ ld a, [wAnimatedObjectJumptablePointer + 1]
+ ld h, a
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
diff --git a/engine/gfx/bg_map_attributes.asm b/engine/gfx/bg_map_attributes.asm
new file mode 100644
index 00000000..55313846
--- /dev/null
+++ b/engine/gfx/bg_map_attributes.asm
@@ -0,0 +1,217 @@
+LoadBGMapAttributes::
+ ld hl, BGMapAttributesPointers
+ ld a, c ; c = which packet
+ push af ; save for later (to determine if we're handling the trainer card or party menu)
+ dec a ; read this code as:
+ add a ; dec a
+ ld e, a ; add a
+ xor a ; ld e, a
+ ld d, a ; ld d, 0
+ add hl, de ; add hl, de
+ ld a, [hli] ; ld a, [hli]
+ ld e, a ; ld h, [hl]
+ ld a, [hl] ; ld l, a
+ ld h, a
+ ld a, e
+ ld l, a
+
+ di
+ ld a, $1
+ ldh [rVBK], a
+ push hl
+ ld a, [hl]
+ ld c, a ; save attribute count for later
+ ld de, $10
+ add hl, de
+ ld a, h
+ ldh [rHDMA1], a
+ ld a, l
+ ldh [rHDMA2], a
+ ld de, vBGMap0
+ ld a, d
+ ldh [rHDMA3], a
+ ld a, e
+ ldh [rHDMA4], a
+
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK ; is LCD off?
+ jr z, .lcdOff ; if off, transfer immediately
+; wait for VBlank if LCD is on
+.waitForVBlankLoop1
+ ldh a, [rLY]
+ cp $90
+ jr nz, .waitForVBlankLoop1
+.waitForAccessibleVRAMLoop1
+ ldh a, [rSTAT]
+ and %10 ; are we in HBlank or VBlank?
+ jr nz, .waitForAccessibleVRAMLoop1 ; loop until we're in a safe period to transfer to VRAM
+.lcdOff
+ ld a, c ; number of BG attributes to transfer, plus 1 times 16
+ ldh [rHDMA5], a ; initiate transfer
+ call Func_3082 ; update audio so it doesn't "lag"
+ pop hl
+ ld a, [hli]
+ ld c, a ; number of BG attributes to transfer, plus 1 times 16
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a ; offset of the attributes
+ add hl, de ; hl = new pointer
+ ld a, h
+ ldh [rHDMA1], a
+ ld a, l
+ ldh [rHDMA2], a
+ ld de, vBGMap1 ; copy to vBGMap1
+ ld a, d
+ ldh [rHDMA3], a
+ ld a, e
+ ldh [rHDMA4], a
+; LCD check again
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK ; is LCD off?
+ jr z, .lcdOff2 ; if off, transfer immediately
+; wait for VBlank if LCD is on
+.waitForVBlankLoop2
+ ldh a, [rLY]
+ cp $90
+ jr nz, .waitForVBlankLoop2
+.waitForAccessibleVRAMLoop2
+ ldh a, [rSTAT]
+ and %10 ; are we in HBlank or VBlank?
+ jr nz, .waitForAccessibleVRAMLoop2 ; loop until we're in a safe period to transfer to VRAM
+.lcdOff2
+ ld a, c
+ ldh [rHDMA5], a
+ pop af
+ dec a
+ dec a
+ dec a
+ dec a
+ jr nz, .checkIfHandlingPartyMenu
+ call HandleBadgeFaceAttributes
+ jr .done
+.checkIfHandlingPartyMenu
+ dec a
+ call z, HandlePartyHPBarAttributes
+.done
+ call Func_3082
+ ldh a, [rIF]
+ res VBLANK, a
+ ldh [rIF], a
+ xor a
+ ldh [rVBK], a
+ ei
+ ret
+
+BGMapAttributesPointers:
+ dw BGMapAttributes_Unknown1
+ dw BGMapAttributes_Unknown2
+ dw BGMapAttributes_GameFreakIntro
+ dw BGMapAttributes_TrainerCard
+ dw BGMapAttributes_PartyMenu
+ dw BGMapAttributes_NidorinoIntro
+ dw BGMapAttributes_TitleScreen
+ dw BGMapAttributes_Slots
+ dw BGMapAttributes_Pokedex
+ dw BGMapAttributes_StatusScreen
+ dw BGMapAttributes_Battle
+ dw BGMapAttributes_WholeScreen
+ dw BGMapAttributes_Unknown13
+
+HandleBadgeFaceAttributes:
+; zero out the attributes if the player doesn't have the respective badge
+; BOULDERBADGE
+ ld hl, vBGMap1 + $183
+ ld de, wTrainerCardBadgeAttributes + 6 * 0
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; CASCADEBADGE
+ ld hl, vBGMap1 + $187
+ ld de, wTrainerCardBadgeAttributes + 6 * 1
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; THUNDERBADGE
+ ld hl, vBGMap1 + $18b
+ ld de, wTrainerCardBadgeAttributes + 6 * 2
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; RAINBOWBADGE
+ ld hl, vBGMap1 + $18f
+ ld de, wTrainerCardBadgeAttributes + 6 * 3
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; SOULBADGE
+ ld hl, vBGMap1 + $1e3
+ ld de, wTrainerCardBadgeAttributes + 6 * 6
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; MARSHBADGE
+ ld hl, vBGMap1 + $1e7
+ ld de, wTrainerCardBadgeAttributes + 6 * 7
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; VOLCANOBADGE
+ ld hl, vBGMap1 + $1eb
+ ld de, wTrainerCardBadgeAttributes + 6 * 8
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+; EARTHBADGE
+ ld hl, vBGMap1 + $1ef
+ ld de, wTrainerCardBadgeAttributes + 6 * 9
+ ld a, [de]
+ and a
+ call z, ZeroOutCurrentBadgeAttributes
+ ret
+
+ZeroOutCurrentBadgeAttributes:
+ push hl
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ld bc, $1f
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ ret
+
+HandlePartyHPBarAttributes:
+; hp bars require 3 (green, orange, red) colours, when there are only 2 "free" colours per palette
+; therefore, we must transfer individual bg attributes where the locations of the hp bars are in vram
+ ld hl, vBGMap1 + $25 ; location of start of the HP bar in vram
+ ld de, wPartyHPBarAttributes
+ ld c, PARTY_LENGTH
+.loop
+ push bc
+ push hl
+ ld a, [de]
+ and $3 ; 4 possible palettes
+REPT 7 ; hp bar length in tiles
+ ld [hli], a
+ENDR
+ pop hl
+ ld bc, $40 ; get 2nd party location
+ add hl, bc
+ push hl
+
+ push de ; (inefficiently) copy de to hl
+ pop hl
+
+ ld bc, $6
+ add hl, bc ; get the next palette
+
+ push hl
+ pop de ; copy back to de
+
+ pop hl
+ pop bc
+ dec c
+ jr nz, .loop
+ ret
diff --git a/engine/gfx/hp_bar.asm b/engine/gfx/hp_bar.asm
index e4de0b95..fcbf1a29 100644
--- a/engine/gfx/hp_bar.asm
+++ b/engine/gfx/hp_bar.asm
@@ -213,13 +213,11 @@ UpdateHPBar_PrintHPNumber:
ld a, [wHPBarOldHP + 1]
ld [wHPBarTempHP], a
push hl
+ ld de, $15
ldh a, [hUILayoutFlags]
bit 0, a
- jr z, .asm_fb15
+ jr z, .next
ld de, $9
- jr .next
-.asm_fb15
- ld de, $15
.next
add hl, de
push hl
diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm
index 16409640..6e2cf0ba 100644
--- a/engine/gfx/mon_icons.asm
+++ b/engine/gfx/mon_icons.asm
@@ -91,7 +91,7 @@ PartyMonSpeeds:
LoadMonPartySpriteGfx:
; Load mon party sprite tile patterns into VRAM during V-blank.
ld hl, MonPartySpritePointers
- ld a, $1c
+ ld a, $1e
LoadAnimSpriteGfx:
; Load animated sprite tile patterns into VRAM during V-blank. hl is the address
@@ -130,7 +130,7 @@ LoadMonPartySpriteGfxWithLCDDisabled:
; LCD.
call DisableLCD
ld hl, MonPartySpritePointers
- ld a, $1c
+ ld a, $1e
ld bc, $0
.loop
push af
@@ -151,7 +151,7 @@ LoadMonPartySpriteGfxWithLCDDisabled:
inc hl
ld d, [hl]
pop hl
- call FarCopyData2
+ call FarCopyData
pop hl
pop bc
ld a, $6
@@ -170,6 +170,8 @@ WriteMonPartySpriteOAMByPartyIndex:
push de
push bc
ldh a, [hPartyMonIndex]
+ cp $ff
+ jr z, .asm_7191f
ld hl, wPartySpecies
ld e, a
ld d, 0
@@ -183,6 +185,16 @@ WriteMonPartySpriteOAMByPartyIndex:
pop hl
ret
+.asm_7191f
+ ld hl, wOAMBuffer
+ ld de, wMonPartySpritesSavedOAM
+ ld bc, $60
+ call CopyData
+ pop bc
+ pop de
+ pop hl
+ ret
+
WriteMonPartySpriteOAMBySpecies:
; Write OAM blocks for the party sprite of the species in
; [wMonPartySpriteSpecies].
@@ -204,7 +216,7 @@ UnusedPartyMonSpriteFunction:
ld hl, vSprites tile $00
call .LoadTilePatterns
pop af
- add $54
+ add $5A
ld hl, vSprites tile $04
call .LoadTilePatterns
xor a
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index a43c66ba..b480c6d0 100644
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -30,11 +30,17 @@ SetPal_Battle:
ld de, wPalPacket
ld bc, $10
call CopyData
- ld a, [wPlayerBattleStatus3]
ld hl, wBattleMonSpecies
+ ld a, [hl]
+ and a
+ jr z, .asm_71ef9
+ ld hl, wPartyMon1
+ ld a, [wPlayerMonNumber]
+ ld bc, wPartyMon2 - wPartyMon1
+ call AddNTimes
+.asm_71ef9
call DeterminePaletteID
ld b, a
- ld a, [wEnemyBattleStatus3]
ld hl, wEnemyMonSpecies2
call DeterminePaletteID
ld c, a
@@ -155,6 +161,10 @@ SetPal_Overworld:
jr z, .Lorelei
cp BRUNOS_ROOM
jr z, .caveOrBruno
+ cp TRADE_CENTER
+ jr z, .trade_center_colosseum
+ cp COLOSSEUM
+ jr z, .trade_center_colosseum
.normalDungeonOrBuilding
ld a, [wLastMap] ; town or route that current dungeon or building is located
.townOrRoute
@@ -178,6 +188,9 @@ SetPal_Overworld:
.Lorelei
xor a
jr .town
+.trade_center_colosseum
+ ld a, PAL_GREYMON - 1
+ jr .town
; used when a Pokemon is the only thing on the screen
; such as evolution, trading and the Hall of Fame
@@ -240,6 +253,16 @@ SetPal_TrainerCard:
ld de, wTrainerCardBlkPacket
ret
+SendUnknownPalPacket_7205d::
+ ld hl, UnknownPalPacket_72811
+ ld de, BlkPacket_WholeScreen
+ ret
+
+SendUnknownPalPacket_72064::
+ ld hl, UnknownPalPacket_72821
+ ld de, UnknownPacket_72751
+ ret
+
SetPalFunctions:
; entries correspond to SET_PAL_* constants
dw SetPal_BattleBlack
@@ -256,6 +279,8 @@ SetPalFunctions:
dw SetPal_PokemonWholeScreen
dw SetPal_GameFreakIntro
dw SetPal_TrainerCard
+ dw SendUnknownPalPacket_7205d
+ dw SendUnknownPalPacket_72064
; The length of the blk data of each badge on the Trainer Card.
; The Rainbow Badge has 3 entries because of its many colors.
@@ -270,9 +295,6 @@ BadgeBlkDataLengths:
db 6 ; Earth Badge
DeterminePaletteID:
- bit TRANSFORMED, a ; a is battle status 3
- ld a, PAL_GREYMON ; if the mon has used Transform, use Ditto's palette
- ret nz
ld a, [hl]
DeterminePaletteIDOutOfBattle:
ld [wd11e], a
@@ -290,6 +312,132 @@ DeterminePaletteIDOutOfBattle:
ld a, [hl]
ret
+YellowIntroPaletteAction::
+ ld a, e
+ and a
+ jr nz, .asm_720bd
+ ld hl, PalPacket_Generic
+ ldh a, [hGBC]
+ and a
+ jp z, SendSGBPacket
+ jp InitGBCPalettes
+
+.asm_720bd
+ ld hl, UnknownPalPacket_72811
+ ldh a, [hGBC]
+ and a
+ jp z, SendSGBPacket
+ call InitGBCPalettes
+ ld hl, PalPacket_Generic
+ inc hl
+ ld a, [hli]
+ call GetGBCBasePalAddress
+ ld a, e
+ ld [wGBCBasePalPointers + 2], a
+ ld a, d
+ ld [wGBCBasePalPointers + 2 + 1], a
+ xor a ; CONVERT_BGP
+ call DMGPalToGBCPal
+ ld a, 1
+ call TransferCurBGPData
+ ret
+
+LoadOverworldPikachuFrontpicPalettes::
+ ld hl, PalPacket_Empty
+ ld de, wPalPacket
+ ld bc, $10
+ call CopyData
+ call GetPal_Pikachu
+ ld hl, wPartyMenuBlkPacket
+ ld [hl], a
+ ld hl, wPartyMenuBlkPacket + 2
+ ld a, $26
+ ld [hl], a
+ ld hl, wPalPacket
+ ldh a, [hGBC]
+ and a
+ jr nz, .cgb_1
+ call SendSGBPacket
+ jr .okay_1
+
+.cgb_1
+ call InitGBCPalettes
+.okay_1
+ ld hl, BlkPacket_WholeScreen
+ ld de, wPalPacket
+ ld bc, $10
+ call CopyData
+ ld hl, wPartyMenuBlkPacket + 2
+ ld a, $5
+ ld [hli], a
+ ld a, $7
+ ld [hli], a
+ ld a, $6
+ ld [hli], a
+ ld a, $b
+ ld [hli], a
+ ld a, $a
+ ld [hl], a
+ ld hl, wPalPacket
+ ldh a, [hGBC]
+ and a
+ jr nz, .cgb_2
+ call SendSGBPacket
+ jr .okay_2
+
+.cgb_2
+ call InitGBCPalettes
+.okay_2
+ ret
+
+GetPal_Pikachu::
+; similar to SetPal_Overworld
+ ld a, [wCurMapTileset]
+ cp CEMETERY
+ jr z, .PokemonTowerOrAgatha
+ cp CAVERN
+ jr z, .caveOrBruno
+ ld a, [wCurMap]
+ cp REDS_HOUSE_1F
+ jr c, .townOrRoute
+ cp CERULEAN_CAVE_2F
+ jr c, .normalDungeonOrBuilding
+ cp NAME_RATERS_HOUSE
+ jr c, .caveOrBruno
+ cp LORELEIS_ROOM
+ jr z, .Lorelei
+ cp BRUNOS_ROOM
+ jr z, .caveOrBruno
+ cp TRADE_CENTER
+ jr z, .battleOrTradeCenter
+ cp COLOSSEUM
+ jr z, .battleOrTradeCenter
+.normalDungeonOrBuilding
+ ld a, [wLastMap] ; town or route that current dungeon or building is located
+.townOrRoute
+ cp SAFFRON_CITY + 1
+ jr c, .town
+ ld a, PAL_ROUTE - 1
+.town
+ inc a ; a town's pallete ID is its map ID + 1
+ ret
+
+.PokemonTowerOrAgatha
+ ld a, PAL_GREYMON - 1
+ jr .town
+
+.caveOrBruno
+ ld a, PAL_CAVE - 1
+ jr .town
+
+.Lorelei
+ xor a ; PAL_PALLET - 1
+ jr .town
+
+.battleOrTradeCenter
+ ld a, PAL_GREYMON - 1
+ jr .town
+
InitPartyMenuBlkPacket:
ld hl, BlkPacket_PartyMenu
ld de, wPartyMenuBlkPacket
@@ -325,6 +473,14 @@ UpdatePartyMenuBlkPacket:
ret
SendSGBPacket:
+ ld a, 1
+ ldh [hDisableJoypadPolling], a ; don't poll joypad while sending packet
+ call _SendSGBPacket
+ xor a
+ ldh [hDisableJoypadPolling], a
+ ret
+
+_SendSGBPacket:
;check number of packets
ld a, [hl]
and $07
@@ -334,9 +490,6 @@ SendSGBPacket:
.loop2
; save B for later use
push bc
-; disable ReadJoypad to prevent it from interfering with sending the packet
- ld a, 1
- ldh [hDisableJoypadPolling], a
; send RESET signal (P14=LOW, P15=LOW)
xor a
ldh [rJOYP], a
@@ -377,8 +530,6 @@ SendSGBPacket:
; set P14=HIGH,P15=HIGH
ld a, $30
ldh [rJOYP], a
- xor a
- ldh [hDisableJoypadPolling], a
; wait for about 70000 cycles
call Wait7000
; restore (previously pushed) number of packets
@@ -393,14 +544,17 @@ LoadSGB:
xor a
ld [wOnSGB], a
call CheckSGB
- ret nc
- ld a, 1
- ld [wOnSGB], a
- ld a, [wGBC]
+ jr c, .onSGB
+ ldh a, [hGBC]
and a
- jr z, .notGBC
+ jr z, .onDMG
+ ld a, $1
+ ld [wOnSGB], a
+.onDMG
ret
-.notGBC
+.onSGB
+ ld a, $1
+ ld [wOnSGB], a
di
call PrepareSuperNintendoVRAMTransfer
ei
@@ -443,23 +597,19 @@ PrepareSuperNintendoVRAMTransfer:
.packetPointers
; Only the first packet is needed.
dw MaskEnFreezePacket
- dw DataSnd_72548
- dw DataSnd_72558
- dw DataSnd_72568
- dw DataSnd_72578
- dw DataSnd_72588
- dw DataSnd_72598
- dw DataSnd_725a8
- dw DataSnd_725b8
+ dw DataSnd_728a1
+ dw DataSnd_728b1
+ dw DataSnd_728c1
+ dw DataSnd_728d1
+ dw DataSnd_728e1
+ dw DataSnd_728f1
+ dw DataSnd_72901
+ dw DataSnd_72911
CheckSGB:
; Returns whether the game is running on an SGB in carry.
ld hl, MltReq2Packet
- di
call SendSGBPacket
- ld a, 1
- ldh [hDisableJoypadPolling], a
- ei
call Wait7000
ldh a, [rJOYP]
and $3
@@ -515,6 +665,7 @@ CopyGfxToSuperNintendoVRAM:
call DisableLCD
ld a, $e4
ldh [rBGP], a
+ call _UpdateGBCPal_BGP_CheckDMG
ld de, vChars1
ld a, [wCopyingSGBTileData]
and a
@@ -545,6 +696,7 @@ CopyGfxToSuperNintendoVRAM:
call SendSGBPacket
xor a
ldh [rBGP], a
+ call _UpdateGBCPal_BGP_CheckDMG
ei
ret
@@ -562,13 +714,17 @@ Wait7000:
ret
SendSGBPackets:
- ld a, [wGBC]
+ ldh a, [hGBC]
and a
jr z, .notGBC
push de
call InitGBCPalettes
pop hl
- call EmptyFunc3
+ call InitGBCPalettes
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ ret z
+ call Delay3
ret
.notGBC
push de
@@ -577,30 +733,349 @@ SendSGBPackets:
jp SendSGBPacket
InitGBCPalettes:
- ld a, $80 ; index 0 with auto-increment
- ldh [rBGPI], a
- inc hl
- ld c, $20
-.loop
- ld a, [hli]
+ ld a, [hl]
+ and $f8
+ cp $20
+ jp z, TranslatePalPacketToBGMapAttributes
+
inc hl
+
+index = 0
+
+ REPT NUM_ACTIVE_PALS
+ IF index > 0
+ pop hl
+ ENDC
+
+ ld a, [hli]
+ inc hl
+
+ IF index < NUM_ACTIVE_PALS - 1
+ push hl
+ ENDC
+
+ call GetGBCBasePalAddress
+ ld a, e
+ ld [wGBCBasePalPointers + index * 2], a
+ ld a, d
+ ld [wGBCBasePalPointers + index * 2 + 1], a
+
+ xor a ; CONVERT_BGP
+ call DMGPalToGBCPal
+ ld a, index
+ call TransferCurBGPData
+
+ ld a, CONVERT_OBP0
+ call DMGPalToGBCPal
+ ld a, index
+ call TransferCurOBPData
+
+ ld a, CONVERT_OBP1
+ call DMGPalToGBCPal
+ ld a, index + 4
+ call TransferCurOBPData
+
+index = index + 1
+ ENDR
+
+ ret
+
+GetGBCBasePalAddress::
+; Input: a = palette ID
+; Output: de = palette address
+ push hl
+ ld l, a
+ xor a
+ ld h, a
+ add hl, hl
+ add hl, hl
+ add hl, hl
+ ld de, GBCBasePalettes
+ add hl, de
+ ld a, l
+ ld e, a
+ ld a, h
+ ld d, a
+ pop hl
+ ret
+
+DMGPalToGBCPal::
+; Populate wGBCPal with colors from a base palette, selected using one of the
+; DMG palette registers.
+; Input:
+; a = which DMG palette register
+; de = address of GBC base palette
+ and a
+ jr nz, .notBGP
+ ldh a, [rBGP]
+ ld [wLastBGP], a
+ jr .convert
+.notBGP
+ dec a
+ jr nz, .notOBP0
+ ldh a, [rOBP0]
+ ld [wLastOBP0], a
+ jr .convert
+.notOBP0
+ ldh a, [rOBP1]
+ ld [wLastOBP1], a
+.convert
+color_index = 0
+ REPT NUM_PAL_COLORS
+ ld b, a
+ and %11
+ call .GetColorAddress
+ ld a, [hli]
+ ld [wGBCPal + color_index * 2], a
+ ld a, [hl]
+ ld [wGBCPal + color_index * 2 + 1], a
+
+ IF color_index < NUM_PAL_COLORS - 1
+ ld a, b
+ rrca
+ rrca
+ ENDC
+
+color_index = color_index + 1
+ ENDR
+ ret
+
+.GetColorAddress:
add a
+ ld l, a
+ xor a
+ ld h, a
+ add hl, de
+ ret
+
+TransferCurBGPData::
+ push de
+ add a
+ add a
+ add a
+ or $80 ; auto-increment
+ ldh [rBGPI], a
+ ld de, rBGPD
+ ld hl, wGBCPal
+ ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr nz, .lcdEnabled
+ REPT NUM_PAL_COLORS
+ call TransferPalColorLCDDisabled
+ ENDR
+ jr .done
+.lcdEnabled
+ REPT NUM_PAL_COLORS
+ call TransferPalColorLCDEnabled
+ ENDR
+.done
+ pop de
+ ret
+
+BufferBGPPal::
+; Copy wGBCPal to palette a in wBGPPalsBuffer.
+ push de
add a
add a
- ld de, SuperPalettes
- add e
- jr nc, .noCarry
- inc d
-.noCarry
+ add a
+ ld l, a
+ xor a
+ ld h, a
+ ld de, wBGPPalsBuffer
+ add hl, de
+ ld de, wGBCPal
+ ld c, PALETTE_SIZE
+.loop
ld a, [de]
- ldh [rBGPD], a
+ ld [hli], a
+ inc de
dec c
jr nz, .loop
+ pop de
ret
-EmptyFunc3:
+TransferBGPPals::
+; Transfer the buffered BG palettes.
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr z, .lcdDisabled
+ di
+.waitLoop
+ ldh a, [rLY]
+ cp 144
+ jr c, .waitLoop
+.lcdDisabled
+ call .DoTransfer
+ ei
ret
+.DoTransfer:
+ xor a
+ or $80 ; auto-increment
+ ldh [rBGPI], a
+ ld de, rBGPD
+ ld hl, wBGPPalsBuffer
+ ld c, 4 * PALETTE_SIZE
+.loop
+ ld a, [hli]
+ ld [de], a
+ dec c
+ jr nz, .loop
+ ret
+
+TransferCurOBPData:
+ push de
+ add a
+ add a
+ add a
+ or $80 ; auto-increment
+ ldh [rOBPI], a
+ ld de, rOBPD
+ ld hl, wGBCPal
+ ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
+ ldh a, [rLCDC]
+ and rLCDC_ENABLE_MASK
+ jr nz, .lcdEnabled
+ REPT NUM_PAL_COLORS
+ call TransferPalColorLCDDisabled
+ ENDR
+ jr .done
+.lcdEnabled
+ REPT NUM_PAL_COLORS
+ call TransferPalColorLCDEnabled
+ ENDR
+.done
+ pop de
+ ret
+
+TransferPalColorLCDEnabled:
+; Transfer a palette color while the LCD is enabled.
+
+; In case we're already in H-blank or V-blank, wait for it to end. This is a
+; precaution so that the transfer doesn't extend past the blanking period.
+ ldh a, [rSTAT]
+ and b
+ jr z, TransferPalColorLCDEnabled
+
+; Wait for H-blank or V-blank to begin.
+.notInBlankingPeriod
+ ldh a, [rSTAT]
+ and b
+ jr nz, .notInBlankingPeriod
+; fall through
+
+TransferPalColorLCDDisabled:
+; Transfer a palette color while the LCD is disabled.
+ ld a, [hli]
+ ld [de], a
+ ld a, [hli]
+ ld [de], a
+ ret
+
+_UpdateGBCPal_BGP_CheckDMG::
+ ldh a, [hGBC]
+ and a
+ ret z
+; fall through
+
+_UpdateGBCPal_BGP::
+index = 0
+
+ REPT NUM_ACTIVE_PALS
+ ld a, [wGBCBasePalPointers + index * 2]
+ ld e, a
+ ld a, [wGBCBasePalPointers + index * 2 + 1]
+ ld d, a
+ xor a ; CONVERT_BGP
+ call DMGPalToGBCPal
+ ld a, index
+ call BufferBGPPal
+
+index = index + 1
+ ENDR
+
+ call TransferBGPPals
+ ret
+
+_UpdateGBCPal_OBP::
+index = 0
+
+ REPT NUM_ACTIVE_PALS
+ ld a, [wGBCBasePalPointers + index * 2]
+ ld e, a
+ ld a, [wGBCBasePalPointers + index * 2 + 1]
+ ld d, a
+ ld a, c
+ call DMGPalToGBCPal
+ ld a, c
+ dec a
+ rlca
+ rlca
+
+ IF index > 0
+ IF index == 1
+ inc a
+ ELSE
+ add index
+ ENDC
+ ENDC
+
+ call TransferCurOBPData
+
+index = index + 1
+ ENDR
+
+ ret
+
+TranslatePalPacketToBGMapAttributes::
+; translate the SGB pal packets into something usable for the GBC
+ push hl
+ pop de
+ ld hl, PalPacketPointers
+ ld a, [hli]
+ ld c, a
+.loop
+ ld a, e
+.innerLoop
+ cp [hl]
+ jr z, .checkHighByte
+ inc hl
+ inc hl
+ dec c
+ jr nz, .innerLoop
+ ret
+.checkHighByte
+; the low byte of pointer matched, so check the high byte
+ inc hl
+ ld a, d
+ cp [hl]
+ jr z, .foundMatchingPointer
+ inc hl
+ dec c
+ jr nz, .loop
+ ret
+.foundMatchingPointer
+ farcall LoadBGMapAttributes
+ ret
+
+PalPacketPointers::
+ db (palPacketPointersEnd - palPacketPointers) / 2
+palPacketPointers:
+ dw BlkPacket_WholeScreen
+ dw BlkPacket_Battle
+ dw BlkPacket_StatusScreen
+ dw BlkPacket_Pokedex
+ dw BlkPacket_Slots
+ dw BlkPacket_Titlescreen
+ dw BlkPacket_NidorinoIntro
+ dw wPartyMenuBlkPacket
+ dw wTrainerCardBlkPacket
+ dw BlkPacket_GameFreakIntro
+ dw wPalPacket
+ dw UnknownPacket_72751
+palPacketPointersEnd:
+
CopySGBBorderTiles:
; SGB tile data is stored in a 4BPP planar format.
; Each tile is 32 bytes. The first 16 bytes contain bit planes 1 and 2, while
diff --git a/engine/gfx/screen_effects.asm b/engine/gfx/screen_effects.asm
index c7a68734..973a951a 100644
--- a/engine/gfx/screen_effects.asm
+++ b/engine/gfx/screen_effects.asm
@@ -1,14 +1,16 @@
-; b = new color for BG color 0 (usually white) for 4 frames
+; inverts the BGP for 4 (6 on CGB due to lag) frames
ChangeBGPalColor0_4Frames:
- call GetPredefRegisters
+ call GetPredefRegisters ; leftover of red/blue, has no use here
ldh a, [rBGP]
- or b
+ xor $ff
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 4
call DelayFrames
ldh a, [rBGP]
- and %11111100
+ xor $ff
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ret
PredefShakeScreenVertically:
diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm
index b3c07ecd..3ffd995f 100644
--- a/engine/gfx/sprite_oam.asm
+++ b/engine/gfx/sprite_oam.asm
@@ -1,6 +1,8 @@
PrepareOAMData::
; Determine OAM data for currently visible
; sprites and write it to wOAMBuffer.
+; Yellow code has been changed to use registers more efficiently
+; as well as tweaking the code to show gbc palettes
ld a, [wUpdateSpritesEnabled]
dec a
@@ -18,9 +20,9 @@ PrepareOAMData::
.spriteLoop
ldh [hSpriteOffset2], a
- ld d, HIGH(wSpriteStateData1)
- ldh a, [hSpriteOffset2]
ld e, a
+ ld d, HIGH(wSpriteStateData1)
+
ld a, [de] ; [x#SPRITESTATEDATA1_PICTUREID]
and a
jp z, .nextSprite
@@ -40,16 +42,22 @@ PrepareOAMData::
jr c, .usefacing
; unchanging
- and $f
- add $10 ; skip to the second half of the table which doesn't account for facing direction
+ ld a, $0
jr .next
.usefacing
and $f
.next
+; read the entry from the table
+ ld c, a
+ ld b, 0
+ ld hl, SpriteFacingAndAnimationTable
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
ld l, a
-
; get sprite priority
push de
inc d
@@ -61,65 +69,46 @@ PrepareOAMData::
ldh [hSpritePriority], a ; temp store sprite priority
pop de
-; read the entry from the table
- ld h, 0
- ld bc, SpriteFacingAndAnimationTable
- add hl, hl
- add hl, hl
- add hl, bc
- ld a, [hli]
- ld c, a
- ld a, [hli]
- ld b, a
- ld a, [hli]
- ld h, [hl]
- ld l, a
call GetSpriteScreenXY
ldh a, [hOAMBufferOffset]
+ add [hl]
+ cp $a0
+ jr z, .hidden
+ jr nc, .asm_4a41
+.hidden
+ call Func_4a7b
+ ld [wd5cd], a
+ ldh a, [hOAMBufferOffset]
+
ld e, a
ld d, HIGH(wOAMBuffer)
.tileLoop
+ ld a, [hli]
+ ld c, a
+.loop
ldh a, [hSpriteScreenY] ; temp for sprite Y position
add $10 ; Y=16 is top of screen (Y=0 is invisible)
add [hl] ; add Y offset from table
ld [de], a ; write new sprite OAM Y position
inc hl
+ inc e
ldh a, [hSpriteScreenX] ; temp for sprite X position
add $8 ; X=8 is left of screen (X=0 is invisible)
add [hl] ; add X offset from table
+ ld [de], a
+ inc hl
inc e
- ld [de], a ; write new sprite OAM X position
- inc e
- ld a, [bc] ; read pattern number offset (accommodates orientation (offset 0,4 or 8) and animation (offset 0 or $80))
- inc bc
- push bc
+ ld a, [wd5cd]
+ add [hl]
+ cp $80
+ jr c, .asm_4a1c
ld b, a
-
- ld a, [wd5cd] ; temp copy of [x#SPRITESTATEDATA1_IMAGEINDEX]
- swap a ; high nybble determines sprite used (0 is always player sprite, next are some npcs)
- and $f
-
- ; Sprites $a and $b have one face (and therefore 4 tiles instead of 12).
- ; As a result, sprite $b's tile offset is less than normal.
- cp $b
- jr nz, .notFourTileSprite
- ld a, $a * 12 + 4
- jr .next2
-
-.notFourTileSprite
- ; a *= 12
- sla a
- sla a
- ld c, a
- sla a
- add c
-
-.next2
- add b ; add the tile offset from the table (based on frame and facing direction)
- pop bc
+ ldh a, [hPikachuSpriteVRAMOffset]
+ add b
+.asm_4a1c
ld [de], a ; tile id
inc hl
inc e
@@ -129,15 +118,19 @@ PrepareOAMData::
ldh a, [hSpritePriority]
or [hl]
.skipPriority
- inc hl
+ and $f0
+ bit OAM_OBP_NUM, a
+ jr z, .spriteusesOBP0
+ or OAM_HIGH_PALS
+.spriteusesOBP0
ld [de], a
+ inc hl
inc e
- bit 0, a ; OAMFLAG_ENDOFDATA
- jr z, .tileLoop
+ dec c
+ jr nz, .loop
ld a, e
ldh [hOAMBufferOffset], a
-
.nextSprite
ldh a, [hSpriteOffset2]
add $10
@@ -145,26 +138,31 @@ PrepareOAMData::
jp nz, .spriteLoop
; Clear unused OAM.
- ldh a, [hOAMBufferOffset]
- ld l, a
- ld h, HIGH(wOAMBuffer)
- ld de, $4
- ld b, $a0
+.asm_4a41
ld a, [wd736]
bit 6, a ; jumping down ledge or fishing animation?
- ld a, $a0
+ ld c, $a0
jr z, .clear
; Don't clear the last 4 entries because they are used for the shadow in the
; jumping down ledge animation and the rod in the fishing animation.
- ld a, $90
+ ld c, $90
.clear
- cp l
- ret z
+ ldh a, [hOAMBufferOffset]
+ cp c
+ ret nc
+ ld l, a
+ ld h, HIGH(wOAMBuffer)
+ ld a, c
+ ld de, $4 ; entry size
+ ld b, $a0
+.clearLoop
ld [hl], b
add hl, de
- jr .clear
+ cp l
+ jr nz, .clearLoop
+ ret
GetSpriteScreenXY:
inc e
@@ -187,3 +185,48 @@ GetSpriteScreenXY:
and $f0
ld [de], a ; [x#SPRITESTATEDATA1_XADJUSTED]
ret
+
+Func_4a7b:
+ push bc
+ ld a, [wd5cd] ; temp copy of [x#SPRITESTATEDATA1_IMAGEINDEX]
+ swap a ; high nybble determines sprite used (0 is always player sprite, next are some npcs)
+ and $f
+
+ ; Sprites $a and $b have one face (and therefore 4 tiles instead of 12).
+ ; As a result, sprite $b's tile offset is less than normal.
+ cp $b
+ jr nz, .notFourTileSprite
+ ld a, $a * 12 + 4 ; $7c
+ jr .done
+
+.notFourTileSprite
+ ; a *= 12
+ add a
+ add a
+ ld c, a
+ add a
+ add c
+.done
+ pop bc
+ ret
+
+INCLUDE "engine/gfx/oam_dma.asm"
+
+_IsTilePassable::
+ ld hl, wTilesetCollisionPtr ; pointer to list of passable tiles
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a ; hl now points to passable tiles
+.loop
+ ld a, [hli]
+ cp $ff
+ jr z, .tileNotPassable
+ cp c
+ jr nz, .loop
+ xor a
+ ret
+.tileNotPassable
+ scf
+ ret
+
+INCLUDE "data/tilesets/collision_tile_ids.asm"
diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm
index ec1cfd0f..e28edc6c 100644
--- a/engine/items/inventory.asm
+++ b/engine/items/inventory.asm
@@ -34,6 +34,7 @@ AddItemToInventory_::
cp b ; does the current item in the table match the item being added?
jp z, .increaseItemQuantity ; if so, increase the item's quantity
inc hl
+.addAnotherStackOfItem
ld a, [hl]
cp $ff ; is it the end of the table?
jr nz, .notAtEndOfInventory
@@ -73,7 +74,7 @@ AddItemToInventory_::
; if so, store 99 in the current slot and store the rest in a new slot
ld a, 99
ld [hli], a
- jp .notAtEndOfInventory
+ jp .addAnotherStackOfItem
.increaseItemQuantityFailed
pop hl
and a
@@ -101,7 +102,7 @@ RemoveItemFromInventory_::
push hl
inc hl
ld a, [wWhichPokemon] ; index (within the inventory) of the item being removed
- sla a
+ add a
add l
ld l, a
jr nc, .noCarry
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index 8114db2b..7a499e28 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -114,7 +114,9 @@ ItemUseBall:
; If this is for the old man battle, skip checking if the party & box are full.
ld a, [wBattleType]
- dec a
+ cp BATTLE_TYPE_OLD_MAN
+ jr z, .canUseBall
+ cp BATTLE_TYPE_PIKACHU
jr z, .canUseBall
ld a, [wPartyCount] ; is party full?
@@ -153,16 +155,26 @@ ItemUseBall:
jp z, .setAnimData
ld a, [wBattleType]
- dec a
- jr nz, .notOldManBattle
+ cp BATTLE_TYPE_OLD_MAN
+ jr z, .oldManBattle
+ cp BATTLE_TYPE_PIKACHU
+ jr z, .oldManBattle ; pikachu battle technically old man battle
+ jr .notOldManBattle
.oldManBattle
ld hl, wGrassRate
ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno. glitch)
+ ld a, [wBattleType]
+ cp BATTLE_TYPE_OLD_MAN
+ jp nz, .captured
+ ld a, $1
+ ld [wCapturedMonSpecies], a
+ CheckEvent EVENT_02F
+ ld b, $63
+ jp nz, .setAnimData
jp .captured
-
.notOldManBattle
; If the player is fighting the ghost Marowak, set the value that indicates the
; Pokémon can't be caught and skip the capture calculations.
@@ -281,6 +293,7 @@ ItemUseBall:
inc a
.skip2
+
; Let W = ((MaxHP * 255) / BallFactor) / max(HP / 4, 1). Calculate W.
ldh [hDivisor], a
ld b, 4
@@ -348,6 +361,7 @@ ItemUseBall:
jr z, .skip4
.skip4
+
; Let Y = (CatchRate * 100) / BallFactor2. Calculate Y.
ld a, b
ldh [hDivisor], a
@@ -512,9 +526,10 @@ ItemUseBall:
ld [wcf91], a
ld [wd11e], a
ld a, [wBattleType]
- dec a ; is this the old man battle?
- jr z, .oldManCaughtMon ; if so, don't give the player the caught Pokémon
-
+ cp BATTLE_TYPE_OLD_MAN ; is this the old man battle?
+ jp z, .oldManCaughtMon ; if so, don't give the player the caught Pokémon
+ cp BATTLE_TYPE_PIKACHU
+ jr z, .oldManCaughtMon ; same with Pikachu battle
ld hl, ItemUseBallText05
call PrintText
@@ -546,12 +561,18 @@ ItemUseBall:
predef ShowPokedexData
.skipShowingPokedexData
+ ld a, $1
+ ld [wd49c], a
+ ld a, $85
+ ld [wPikachuMood], a
ld a, [wPartyCount]
cp PARTY_LENGTH ; is party full?
jr z, .sendToBox
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
call ClearSprites
+ ld hl, .emptyString
+ call PrintText
call AddPartyMon
jr .done
@@ -584,6 +605,9 @@ ItemUseBall:
ld [wItemQuantity], a
jp RemoveItemFromInventory
+.emptyString
+ db "@"
+
ItemUseBallText00:
;"It dodged the thrown ball!"
;"This pokemon can't be caught"
@@ -649,21 +673,28 @@ ItemUseBicycle:
call ItemUseReloadOverworldData
xor a
ld [wWalkBikeSurfState], a ; change player state to walking
+ ld a, $00
+ ld [wPikachuSpawnState], a
call PlayDefaultMusic ; play walking music
ld hl, GotOffBicycleText
- jr .printText
+ jp PrintText
+
.tryToGetOnBike
call IsBikeRidingAllowed
jp nc, NoCyclingAllowedHere
call ItemUseReloadOverworldData
xor a ; no keys pressed
ldh [hJoyHeld], a ; current joypad state
- inc a
+ ld a, $1
ld [wWalkBikeSurfState], a ; change player state to bicycling
- ld hl, GotOnBicycleText
call PlayDefaultMusic ; play bike riding music
-.printText
- jp PrintText
+ xor a
+ ld [wWalkBikeSurfState], a
+ ld hl, GotOnBicycleText
+ call PrintText
+ ld a, $1
+ ld [wWalkBikeSurfState], a
+ ret
; used for Surf out-of-battle effect
ItemUseSurfboard:
@@ -673,7 +704,7 @@ ItemUseSurfboard:
jr z, .tryToStopSurfing
.tryToSurf
call IsNextTileShoreOrWater
- jp c, SurfingAttemptFailed
+ jp nc, SurfingAttemptFailed
ld hl, TilePairCollisionsWater
call CheckForTilePairCollisions
jp c, SurfingAttemptFailed
@@ -686,6 +717,7 @@ ItemUseSurfboard:
call PlayDefaultMusic ; play surfing music
ld hl, SurfingGotOnText
jp PrintText
+
.tryToStopSurfing
xor a
ldh [hSpriteIndexOrTextID], a
@@ -698,23 +730,20 @@ ItemUseSurfboard:
ld hl, TilePairCollisionsWater
call CheckForTilePairCollisions
jr c, .cannotStopSurfing
- ld hl, wTilesetCollisionPtr ; pointer to list of passable tiles
- ld a, [hli]
- ld h, [hl]
- ld l, a ; hl now points to passable tiles
- ld a, [wTileInFrontOfPlayer] ; tile in front of the player
- ld b, a
-.passableTileLoop
- ld a, [hli]
- cp b
- jr z, .stopSurfing
- cp $ff
- jr nz, .passableTileLoop
+ ld a, [wTileInFrontOfPlayer]
+ ld c, a
+ call IsTilePassable
+ jr nc, .stopSurfing
.cannotStopSurfing
ld hl, SurfingNoPlaceToGetOffText
jp PrintText
+
.stopSurfing
call .makePlayerMoveForward
+ ld a, $3
+ ld [wPikachuSpawnState], a
+ ld hl, wPikachuOverworldStateFlags
+ set 5, [hl]
ld hl, wd730
set 7, [hl]
xor a
@@ -722,7 +751,9 @@ ItemUseSurfboard:
dec a
ld [wJoyIgnore], a
call PlayDefaultMusic ; play walking music
+ call GBPalWhiteOutWithDelay3
jp LoadWalkingPlayerSpriteGraphics
+
; uses a simulated button press to make the player move forward
.makePlayerMoveForward
ld a, [wPlayerDirection] ; direction the player is going
@@ -770,25 +801,43 @@ ItemUseEvoStone:
ld a, $ff
ld [wUpdateSpritesEnabled], a
call DisplayPartyMenu
+ ld a, [wcf91]
+ ld [wLoadedMon], a
pop bc
jr c, .canceledItemUse
ld a, b
ld [wcf91], a
- ld a, $01
- ld [wForceEvolution], a
+ call Func_d85d
+ jr nc, .noEffect
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .notPlayerPikachu
+ ld e, $1b
+ callfar PlayPikachuSoundClip
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMonNicks
+ call GetPartyMonName
+ ld hl, RefusingText
+ call PrintText
+ ld a, $4
+ ld [wd49c], a
+ ld a, $82
+ ld [wPikachuMood], a
+ jr .canceledItemUse
+
+.notPlayerPikachu
ld a, SFX_HEAL_AILMENT
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
+ ld a, $01
+ ld [wForceEvolution], a
callfar TryEvolvingMon ; try to evolve pokemon
- ld a, [wEvolutionOccurred]
- and a
- jr z, .noEffect
pop af
ld [wWhichPokemon], a
ld hl, wNumBagItems
ld a, 1 ; remove 1 stone
ld [wItemQuantity], a
jp RemoveItemFromInventory
+
.noEffect
call ItemUseNoEffect
.canceledItemUse
@@ -797,6 +846,55 @@ ItemUseEvoStone:
pop af
ret
+Func_d85d:
+ ld hl, EvosMovesPointerTable
+ ld a, [wLoadedMon]
+ dec a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld de, wcd6d
+ ld a, BANK(TryEvolvingMon)
+ ld bc, $2
+ call FarCopyData
+ ld hl, wcd6d
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, wcd6d
+ ld a, BANK(TryEvolvingMon)
+ ld bc, 13
+ call FarCopyData
+ ld hl, wcd6d
+.loop
+ ld a, [hli]
+ and a
+ jr z, .cannotEvolveWithUsedStone
+ inc hl
+ inc hl
+ cp EV_ITEM
+ jr nz, .loop
+ dec hl
+ dec hl
+ ld b, [hl]
+ ld a, [wcf91]
+ inc hl
+ inc hl
+ inc hl
+ cp b
+ jr nz, .loop
+ scf
+ ret
+
+.cannotEvolveWithUsedStone
+ and a
+ ret
+
+RefusingText:
+ text_far _RefusingText
+ text_end
+
ItemUseVitamin:
ld a, [wIsInBattle]
and a
@@ -805,7 +903,7 @@ ItemUseVitamin:
ItemUseMedicine:
ld a, [wPartyCount]
and a
- jp z, .emptyParty
+ jp z, Func_e4bf
ld a, [wWhichPokemon]
push af
ld a, [wcf91]
@@ -820,15 +918,6 @@ ItemUseMedicine:
; if using softboiled
call GoBackToPartyMenu
jr .getPartyMonDataAddress
-.emptyParty
- ld hl, .emptyPartyText
- xor a
- ld [wActionResultOrTookBattleTurn], a ; item use failed
- jp PrintText
-.emptyPartyText
- text "You don't have"
- line "any #MON!"
- prompt
.notUsingSoftboiled
call DisplayPartyMenu
.getPartyMonDataAddress
@@ -844,6 +933,16 @@ ItemUseMedicine:
ld e, a
ld [wd0b5], a
pop af
+ push af
+ cp $28
+ jr nc, .asm_d906
+ push hl
+ push de
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDITEM
+ pop de
+ pop hl
+.asm_d906
+ pop af
ld [wcf91], a
pop af
ld [wWhichPokemon], a
@@ -911,6 +1010,7 @@ ItemUseMedicine:
call CopyData ; copy party stats to in-battle stat data
predef DoubleOrHalveSelectedStats
jp .doneHealing
+
.healHP
inc hl ; hl = address of current HP
ld a, [hli]
@@ -928,7 +1028,22 @@ ItemUseMedicine:
cp MAX_REVIVE
jr z, .updateInBattleFaintedData
jp .healingItemNoEffect
+
.updateInBattleFaintedData
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wUsedItemOnWhichPokemon]
+ ld [wWhichPokemon], a
+ push hl
+ push de
+ push bc
+ callfar RespawnOverworldPikachu
+ pop bc
+ pop de
+ pop hl
+ pop af
+ ld [wWhichPokemon], a
+
ld a, [wIsInBattle]
and a
jr z, .compareCurrentHPToMaxHP
@@ -953,6 +1068,7 @@ ItemUseMedicine:
pop de
pop hl
jr .compareCurrentHPToMaxHP
+
.notFainted
ld a, [wcf91]
cp REVIVE
@@ -988,6 +1104,7 @@ ItemUseMedicine:
dec hl
dec hl
jp .cureStatusAilment
+
.notFullHP ; if the pokemon's current HP doesn't equal its max HP
xor a
ld [wLowHealthAlarm], a ;disable low health alarm
@@ -1072,6 +1189,7 @@ ItemUseMedicine:
pop af
ld [hl], a
jr .addHealAmount
+
.notUsingSoftboiled2
ld a, [wcf91]
cp SODA_POP
@@ -1126,6 +1244,7 @@ ItemUseMedicine:
cp MAX_REVIVE
jr z, .setCurrentHPToMaxHp ; if using a Max Revive
jr .updateInBattleData
+
.setCurrentHPToHalfMaxHP
dec hl
dec de
@@ -1140,6 +1259,7 @@ ItemUseMedicine:
ld [wHPBarNewHP], a
dec de
jr .doneHealingPartyHP
+
.setCurrentHPToMaxHp
ld a, [hli]
ld [de], a
@@ -1183,9 +1303,11 @@ ItemUseMedicine:
dec d
jr nz, .calculateHPBarCoordsLoop
jr .doneHealing
+
.healingItemNoEffect
call ItemUseNoEffect
jp .done
+
.doneHealing
ld a, [wPseudoItemID]
and a ; using Softboiled?
@@ -1220,6 +1342,7 @@ ItemUseMedicine:
ld a, POTION_MSG
ld [wPartyMenuTypeOrMessageID], a
jr .showHealingItemMessage
+
.playStatusAilmentCuringSound
ld a, SFX_HEAL_AILMENT
call PlaySoundWaitForCurrent
@@ -1236,6 +1359,7 @@ ItemUseMedicine:
call DelayFrames
call WaitForTextScrollButtonPress
jr .done
+
.canceledItemUse
xor a
ld [wActionResultOrTookBattleTurn], a ; item use failed
@@ -1251,6 +1375,7 @@ ItemUseMedicine:
and a
ret nz
jp ReloadMapData
+
.useVitamin
push hl
ld a, [hl]
@@ -1306,6 +1431,7 @@ ItemUseMedicine:
cp b
jr nz, .statNameInnerLoop
jr .statNameLoop
+
.gotStatName
ld de, wcf4b
ld bc, 10
@@ -1315,11 +1441,13 @@ ItemUseMedicine:
ld hl, VitaminStatRoseText
call PrintText
jp RemoveUsedItem
+
.vitaminNoEffect
pop hl
ld hl, VitaminNoEffectText
call PrintText
jp GBPalWhiteOut
+
.recalculateStats
ld bc, wPartyMon1Stats - wPartyMon1
add hl, bc
@@ -1406,9 +1534,19 @@ ItemUseMedicine:
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
predef LearnMoveFromLevelUp ; learn level up move, if any
+
xor a
ld [wForceEvolution], a
- callfar TryEvolvingMon ; evolve pokemon, if appropriate
+ callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wUsedItemOnWhichPokemon]
+ ld [wWhichPokemon], a
+ callfar RespawnOverworldPikachu ; evolve pokemon, if appropriate
+ pop af
+ ld [wWhichPokemon], a
+
+ callfar TryEvolvingMon
ld a, $01
ld [wUpdateSpritesEnabled], a
pop af
@@ -1490,6 +1628,10 @@ ItemUseEscapeRope:
ld a, [wCurMap]
cp AGATHAS_ROOM
jr z, .notUsable
+ cp BILLS_HOUSE
+ jr z, .notUsable
+ cp POKEMON_FAN_CLUB
+ jr z, .notUsable
ld a, [wCurMapTileset]
ld b, a
ld hl, EscapeRopeTilesets
@@ -1502,6 +1644,7 @@ ItemUseEscapeRope:
ld hl, wd732
set 3, [hl]
set 6, [hl]
+ call Func_1510
ld hl, wd72e
res 4, [hl]
ResetEvent EVENT_IN_SAFARI_ZONE
@@ -1518,6 +1661,7 @@ ItemUseEscapeRope:
ld c, 30
call DelayFrames
jp RemoveUsedItem
+
.notUsable
jp ItemUseNotTime
@@ -1541,6 +1685,7 @@ ItemUseXAccuracy:
jp z, ItemUseNotTime
ld hl, wPlayerBattleStatus2
set USING_X_ACCURACY, [hl] ; X Accuracy bit
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM
jp PrintItemUseTextAndRemoveItem
; This function is bugged and never works. It always jumps to ItemUseNotTime.
@@ -1554,11 +1699,13 @@ ItemUseCardKey:
jr nz, .next0
ld hl, CardKeyTable1
jr .next1
+
.next0
cp $24
jr nz, .next2
ld hl, CardKeyTable2
jr .next1
+
.next2
cp $5e
jp nz, ItemUseNotTime
@@ -1581,6 +1728,7 @@ ItemUseCardKey:
ld a, [hl]
ld [wUnusedD71F], a
jr .done
+
.nextEntry1
inc hl
.nextEntry2
@@ -1588,6 +1736,7 @@ ItemUseCardKey:
.nextEntry3
inc hl
jr .loop
+
.done
ld hl, ItemUseText00
call PrintText
@@ -1609,6 +1758,15 @@ ItemUseGuardSpec:
ld a, [wIsInBattle]
and a
jp z, ItemUseNotTime
+
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM
+ pop af
+ ld [wWhichPokemon], a
+
ld hl, wPlayerBattleStatus2
set PROTECTED_BY_MIST, [hl] ; Mist bit
jp PrintItemUseTextAndRemoveItem
@@ -1625,6 +1783,15 @@ ItemUseDireHit:
ld a, [wIsInBattle]
and a
jp z, ItemUseNotTime
+
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM
+ pop af
+ ld [wWhichPokemon], a
+
ld hl, wPlayerBattleStatus2
set GETTING_PUMPED, [hl] ; Focus Energy bit
jp PrintItemUseTextAndRemoveItem
@@ -1637,6 +1804,7 @@ ItemUseXStat:
ld a, 2
ld [wActionResultOrTookBattleTurn], a ; item not used
ret
+
.inBattle
ld hl, wPlayerMoveNum
ld a, [hli]
@@ -1655,6 +1823,15 @@ ItemUseXStat:
xor a
ldh [hWhoseTurn], a ; set turn to player's turn
farcall StatModifierUpEffect ; do stat increase move
+
+ ld a, [wWhichPokemon]
+ push af
+ ld a, [wPlayerMonNumber]
+ ld [wWhichPokemon], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM
+ pop af
+ ld [wWhichPokemon], a
+
pop hl
pop af
ld [hld], a ; restore [wPlayerMoveEffect]
@@ -1672,31 +1849,48 @@ ItemUsePokeflute:
cp ROUTE_12
jr nz, .notRoute12
CheckEvent EVENT_BEAT_ROUTE12_SNORLAX
- jr nz, .noSnorlaxToWakeUp
+ jr nz, .noSnorlaxOrPikachuToWakeUp
; if the player hasn't beaten Route 12 Snorlax
ld hl, Route12SnorlaxFluteCoords
call ArePlayerCoordsInArray
- jr nc, .noSnorlaxToWakeUp
+ jr nc, .noSnorlaxOrPikachuToWakeUp
ld hl, PlayedFluteHadEffectText
call PrintText
SetEvent EVENT_FIGHT_ROUTE12_SNORLAX
ret
+
.notRoute12
cp ROUTE_16
- jr nz, .noSnorlaxToWakeUp
+ jr nz, .notRoute16
CheckEvent EVENT_BEAT_ROUTE16_SNORLAX
- jr nz, .noSnorlaxToWakeUp
+ jr nz, .noSnorlaxOrPikachuToWakeUp
; if the player hasn't beaten Route 16 Snorlax
ld hl, Route16SnorlaxFluteCoords
call ArePlayerCoordsInArray
- jr nc, .noSnorlaxToWakeUp
+ jr nc, .noSnorlaxOrPikachuToWakeUp
ld hl, PlayedFluteHadEffectText
call PrintText
SetEvent EVENT_FIGHT_ROUTE16_SNORLAX
ret
-.noSnorlaxToWakeUp
+
+.notRoute16
+ cp PEWTER_POKECENTER
+ jr nz, .noSnorlaxOrPikachuToWakeUp
+ call CheckPikachuFollowingPlayer
+ jr z, .noSnorlaxOrPikachuToWakeUp
+ callfar IsPikachuRightNextToPlayer
+ jr nc, .noSnorlaxOrPikachuToWakeUp
+ ld hl, PlayedFluteHadEffectText
+ call PrintText
+ call ItemUseReloadOverworldData
+ ldpikaemotion e, PikachuEmotion26
+ callfar PlaySpecificPikachuEmotion
+ ret
+
+.noSnorlaxOrPikachuToWakeUp
ld hl, PlayedFluteNoEffectText
jp PrintText
+
.inBattle
xor a
ld [wWereAnyMonsAsleep], a
@@ -1716,8 +1910,15 @@ ItemUsePokeflute:
ld [hl], a
ld hl, wEnemyMonStatus
ld a, [hl]
+ ld c, a
and b ; remove Sleep status
ld [hl], a
+ ld a, c
+ and SLP
+ jr z, .asm_e063
+ ld a, $1
+ ld [wWereAnyMonsAsleep], a
+.asm_e063
call LoadScreenTilesFromBuffer2 ; restore saved screen
ld a, [wWereAnyMonsAsleep]
and a ; were any pokemon asleep before playing the flute?
@@ -1793,8 +1994,7 @@ PlayedFluteHadEffectText:
and a
jr nz, .done
; play out-of-battle pokeflute music
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ld a, SFX_POKEFLUTE
ld c, BANK(SFX_Pokeflute)
call PlayMusic
@@ -1855,13 +2055,28 @@ INCLUDE "data/wild/good_rod.asm"
ItemUseSuperRod:
call FishingInit
jp c, ItemUseNotTime
- call ReadSuperRodData
- ld a, e
+ callfar ReadSuperRodData
+ ld c, e
+ ld b, d
+ ld a, $2
+ ld [wRodResponse], a
+ ld a, c
+ and a ; are there fish in the map?
+ jr z, DoNotGenerateFishingEncounter ; if not, do not generate an encounter
+ ld a, $1
+ ld [wRodResponse], a
+ call Random
+ and $1
+ jr nz, RodResponse
+ xor a
+ ld [wRodResponse], a
+ jr DoNotGenerateFishingEncounter
+
RodResponse:
ld [wRodResponse], a
dec a ; is there a bite?
- jr nz, .next
+ jr nz, DoNotGenerateFishingEncounter
; if yes, store level and species data
ld a, 1
ld [wMoveMissed], a
@@ -1870,7 +2085,7 @@ RodResponse:
ld a, c ; species
ld [wCurOpponent], a
-.next
+DoNotGenerateFishingEncounter:
ld hl, wWalkBikeSurfState
ld a, [hl] ; store the value in a
push af
@@ -1890,22 +2105,28 @@ FishingInit:
jr z, .notInBattle
scf ; can't fish during battle
ret
+
.notInBattle
call IsNextTileShoreOrWater
- ret c
+ jr nc, .cannotFish
ld a, [wWalkBikeSurfState]
cp 2 ; Surfing?
- jr z, .surfing
+ jr z, .cannotFish
call ItemUseReloadOverworldData
ld hl, ItemUseText00
call PrintText
ld a, SFX_HEAL_AILMENT
call PlaySound
+ ld a, $2
+ ld [wd49c], a
+ ld a, $81
+ ld [wPikachuMood], a
ld c, 80
call DelayFrames
and a
ret
-.surfing
+
+.cannotFish
scf ; can't fish when surfing
ret
@@ -1958,7 +2179,23 @@ ItemUsePPRestore:
call DisplayPartyMenu
jr nc, .chooseMove
jp .itemNotUsed
+
.chooseMove
+ ld a, [wIsInBattle]
+ and a
+ jr z, .usePPItem
+ ld a, [wWhichPokemon]
+ ld b, a
+ ld a, [wPlayerMonNumber]
+ cp b
+ jr nz, .usePPItem
+ ld a, [wPlayerBattleStatus3]
+ bit TRANSFORMED, a
+ jr z, .usePPItem
+ call ItemUseNotTime
+ jp .itemNotUsed
+
+.usePPItem
ld a, [wPPRestoreItem]
cp ELIXER
jp nc, .useElixir ; if Elixir or Max Elixir
@@ -1998,6 +2235,7 @@ ItemUsePPRestore:
ld hl, PPMaxedOutText
call PrintText
jr .chooseMove
+
.PPNotMaxedOut
ld a, [hl]
add 1 << 6 ; increase PP Up count by 1
@@ -2005,6 +2243,8 @@ ItemUsePPRestore:
ld a, 1 ; 1 PP Up used
ld [wd11e], a
call RestoreBonusPP ; add the bonus PP to current PP
+ ld a, SFX_HEAL_AILMENT
+ call PlaySound
ld hl, PPIncreasedText
call PrintText
.done
@@ -2013,6 +2253,7 @@ ItemUsePPRestore:
call GBPalWhiteOut
call RunDefaultPaletteCommand
jp RemoveUsedItem
+
.afterRestoringPP ; after using a (Max) Ether/Elixir
ld a, [wWhichPokemon]
ld b, a
@@ -2031,10 +2272,12 @@ ItemUsePPRestore:
ld hl, PPRestoredText
call PrintText
jr .done
+
.useEther
call .restorePP
jr nz, .afterRestoringPP
jp .noEffect
+
; unsets zero flag if PP was restored, sets zero flag if not
; however, this is bugged for Max Ethers and Max Elixirs (see below)
.restorePP
@@ -2069,6 +2312,7 @@ ItemUsePPRestore:
add b
ld [hl], a
ret
+
.fullyRestorePP
ld a, [hl] ; move PP
; Note that this code has a bug. It doesn't mask out the upper two bits, which
@@ -2078,6 +2322,7 @@ ItemUsePPRestore:
cp b ; does current PP equal max PP?
ret z
jr .storeNewAmount
+
.useElixir
; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER
ld hl, wPPRestoreItem
@@ -2181,6 +2426,7 @@ ItemUseTMHM:
ld a, 2
ld [wActionResultOrTookBattleTurn], a ; item not used
ret
+
.useMachine
ld a, [wWhichPokemon]
push af
@@ -2226,10 +2472,13 @@ ItemUseTMHM:
ld hl, MonCannotLearnMachineMoveText
call PrintText
jr .chooseMon
+
.checkIfAlreadyLearnedMove
callfar CheckIfMoveIsKnown ; check if the pokemon already knows the move
jr c, .chooseMon
predef LearnMove ; teach move
+ ld a, [wWhichPokemon]
+ ld d, a
pop af
ld [wcf91], a
pop af
@@ -2237,6 +2486,28 @@ ItemUseTMHM:
ld a, b
and a
ret z
+
+ ld a, [wWhichPokemon]
+ push af
+ ld a, d
+ ld [wWhichPokemon], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_USEDTMHM
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .notTeachingThunderboltOrThunderToPikachu
+ ld a, [wcf91]
+ cp TM_THUNDERBOLT ; are we teaching thunderbolt to the player pikachu?
+ jr z, .teachingThunderboltOrThunderToPlayerPikachu
+ cp TM_THUNDER ; are we teaching thunder then?
+ jr nz, .notTeachingThunderboltOrThunderToPikachu
+.teachingThunderboltOrThunderToPlayerPikachu
+ ld a, $5
+ ld [wd49c], a
+ ld a, $85
+ ld [wPikachuMood], a
+.notTeachingThunderboltOrThunderToPikachu
+ pop af
+ ld [wWhichPokemon], a
+
ld a, [wcf91]
call IsItemHM
ret c
@@ -2283,6 +2554,12 @@ ItemUseNotYoursToUse:
ld hl, ItemUseNotYoursToUseText
jr ItemUseFailed
+Func_e4bf:
+ ld a, $2
+ ld [wActionResultOrTookBattleTurn], a
+ ld hl, DontHavePokemonText
+ jp PrintText
+
ThrowBallAtTrainerMon:
call RunDefaultPaletteCommand
call LoadScreenTilesFromBuffer1 ; restore saved screen
@@ -2344,6 +2621,10 @@ BoxFullCannotThrowBallText:
text_far _BoxFullCannotThrowBallText
text_end
+DontHavePokemonText:
+ text_far _DontHavePokemonText
+ text_end
+
ItemUseText00:
text_far _ItemUseText001
text_low
@@ -2478,6 +2759,7 @@ GetMaxPP:
.sourceWithOneMon
call GetSelectedMoveOffset2
jr .next
+
.sourceWithMultipleMon
call GetSelectedMoveOffset
.next
@@ -2579,6 +2861,7 @@ TossItem_::
pop hl
and a
ret
+
.tooImportantToToss
push hl
ld hl, TooImportantToTossText
@@ -2646,7 +2929,7 @@ SendNewMonToBox:
ld a, [wcf91]
ld [wd0b5], a
ld c, a
-.asm_e7b1
+.asm_e6f5
inc de
ld a, [de]
ld b, a
@@ -2654,13 +2937,13 @@ SendNewMonToBox:
ld c, b
ld [de], a
cp $ff
- jr nz, .asm_e7b1
+ jr nz, .asm_e6f5
call GetMonHeader
ld hl, wBoxMonOT
ld bc, NAME_LENGTH
ld a, [wBoxCount]
dec a
- jr z, .asm_e7ee
+ jr z, .asm_e732
dec a
call AddNTimes
push hl
@@ -2672,7 +2955,7 @@ SendNewMonToBox:
ld a, [wBoxCount]
dec a
ld b, a
-.asm_e7db
+.asm_e71f
push bc
push hl
ld bc, NAME_LENGTH
@@ -2684,15 +2967,15 @@ SendNewMonToBox:
add hl, bc
pop bc
dec b
- jr nz, .asm_e7db
-.asm_e7ee
+ jr nz, .asm_e71f
+.asm_e732
ld hl, wPlayerName
ld de, wBoxMonOT
ld bc, NAME_LENGTH
call CopyData
ld a, [wBoxCount]
dec a
- jr z, .asm_e82a
+ jr z, .asm_e76e
ld hl, wBoxMonNicks
ld bc, NAME_LENGTH
dec a
@@ -2706,7 +2989,7 @@ SendNewMonToBox:
ld a, [wBoxCount]
dec a
ld b, a
-.asm_e817
+.asm_e75b
push bc
push hl
ld bc, NAME_LENGTH
@@ -2718,15 +3001,15 @@ SendNewMonToBox:
add hl, bc
pop bc
dec b
- jr nz, .asm_e817
-.asm_e82a
+ jr nz, .asm_e75b
+.asm_e76e
ld hl, wBoxMonNicks
ld a, NAME_MON_SCREEN
ld [wNamingScreenType], a
predef AskName
ld a, [wBoxCount]
dec a
- jr z, .asm_e867
+ jr z, .asm_e7ab
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1
dec a
@@ -2740,7 +3023,7 @@ SendNewMonToBox:
ld a, [wBoxCount]
dec a
ld b, a
-.asm_e854
+.asm_e798
push bc
push hl
ld bc, wBoxMon2 - wBoxMon1
@@ -2752,8 +3035,8 @@ SendNewMonToBox:
add hl, bc
pop bc
dec b
- jr nz, .asm_e854
-.asm_e867
+ jr nz, .asm_e798
+.asm_e7ab
ld a, [wEnemyMonLevel]
ld [wEnemyMonBoxLevel], a
ld hl, wEnemyMon
@@ -2783,11 +3066,11 @@ SendNewMonToBox:
inc de
xor a
ld b, NUM_STATS * 2
-.asm_e89f
+.asm_e7e3
ld [de], a
inc de
dec b
- jr nz, .asm_e89f
+ jr nz, .asm_e7e3
ld hl, wEnemyMonDVs
ld a, [hli]
ld [de], a
@@ -2796,89 +3079,52 @@ SendNewMonToBox:
ld [de], a
ld hl, wEnemyMonPP
ld b, NUM_MOVES
-.asm_e8b1
+.asm_e7f5
ld a, [hli]
inc de
ld [de], a
dec b
- jr nz, .asm_e8b1
+ jr nz, .asm_e7f5
+ ld a, [wcf91]
+ cp KADABRA
+ jr nz, .notKadabra
+ ld a, TWISTEDSPOON_GSC
+ ld [wBoxMon1CatchRate], a
+.notKadabra
ret
; checks if the tile in front of the player is a shore or water tile
; used for surfing and fishing
; unsets carry if it is, sets carry if not
-IsNextTileShoreOrWater:
+IsNextTileShoreOrWater::
ld a, [wCurMapTileset]
ld hl, WaterTilesets
ld de, 1
- call IsInArray
- jr nc, .notShoreOrWater
+ call IsInArray ; does the current map allow surfing?
+ ret nc ; if not, return
+ ld hl, WaterTile
ld a, [wCurMapTileset]
cp SHIP_PORT ; Vermilion Dock tileset
- ld a, [wTileInFrontOfPlayer] ; tile in front of player
jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset
- cp $48 ; eastern shore tile in Safari Zone
- jr z, .shoreOrWater
- cp $32 ; usual eastern shore tile
- jr z, .shoreOrWater
+ cp GYM ; eastern shore tile in Safari Zone
+ jr z, .skipShoreTiles
+ cp DOJO ; usual eastern shore tile
+ jr z, .skipShoreTiles
+ ld hl, ShoreTiles
.skipShoreTiles
- cp $14 ; water tile
- jr z, .shoreOrWater
-.notShoreOrWater
- scf
- ret
-.shoreOrWater
- and a
- ret
-
-INCLUDE "data/tilesets/water_tilesets.asm"
-
-ReadSuperRodData:
-; return e = 2 if no fish on this map
-; return e = 1 if a bite, bc = level,species
-; return e = 0 if no bite
- ld a, [wCurMap]
- ld de, 3 ; each fishing group is three bytes wide
- ld hl, SuperRodData
+ ld a, [wTileInFrontOfPlayer]
+ ld de, $1
call IsInArray
- jr c, .ReadFishingGroup
- ld e, $2 ; $2 if no fishing groups found
ret
-.ReadFishingGroup
-; hl points to the fishing group entry in the index
- inc hl ; skip map id
-
- ; read fishing group address
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
- ld b, [hl] ; how many mons in group
- inc hl ; point to data
- ld e, $0 ; no bite yet
-
-.RandomLoop
- call Random
- srl a
- ret c ; 50% chance of no battle
-
- and %11 ; 2-bit random number
- cp b
- jr nc, .RandomLoop ; if a is greater than the number of mons, regenerate
-
- ; get the mon
- add a
- ld c, a
- ld b, $0
- add hl, bc
- ld b, [hl] ; level
- inc hl
- ld c, [hl] ; species
- ld e, $1 ; $1 if there's a bite
- ret
+INCLUDE "data/tilesets/water_tilesets.asm"
-INCLUDE "data/wild/super_rod.asm"
+; shore tiles
+ShoreTiles:
+ db $48, $32
+WaterTile:
+ db $14
+ db $ff ; terminator
; reloads map view and processes sprite data
; for items that cause the overworld to be displayed
diff --git a/engine/items/super_rod.asm b/engine/items/super_rod.asm
new file mode 100644
index 00000000..db82f5fb
--- /dev/null
+++ b/engine/items/super_rod.asm
@@ -0,0 +1,41 @@
+ReadSuperRodData:
+ ld a, [wCurMap]
+ ld c, a
+ ld hl, SuperRodFishingSlots
+.loop
+ ld a, [hli]
+ cp $ff
+ jr z, .notfound
+ cp c
+ jr z, .found
+ ld de, $8
+ add hl, de
+ jr .loop
+.found
+ call GenerateRandomFishingEncounter
+ ret
+.notfound
+ ld de, $0
+ ret
+
+GenerateRandomFishingEncounter:
+ call Random
+ cp $66
+ jr c, .asm_f5ed6
+ inc hl
+ inc hl
+ cp $b2
+ jr c, .asm_f5ed6
+ inc hl
+ inc hl
+ cp $e5
+ jr c, .asm_f5ed6
+ inc hl
+ inc hl
+.asm_f5ed6
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ret
+
+INCLUDE "data/wild/super_rod.asm"
diff --git a/engine/items/tms.asm b/engine/items/tms.asm
index ea7fbcad..40030675 100644
--- a/engine/items/tms.asm
+++ b/engine/items/tms.asm
@@ -11,6 +11,8 @@ CanLearnTM:
ld hl, TechnicalMachines
.findTMloop
ld a, [hli]
+ cp -1 ; reached terminator?
+ jr z, .done
cp b
jr z, .TMfoundLoop
inc c
@@ -19,6 +21,10 @@ CanLearnTM:
pop hl
ld b, FLAG_TEST
predef_jump FlagActionPredef
+.done
+ pop hl
+ ld c, 0
+ ret
; converts TM/HM number in wd11e into move number
; HMs start at 51
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index a12c0c8a..700be30c 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -105,6 +105,13 @@ DisplayTownMap:
ld [wWhichTownMapLocation], a
jp .townMapLoop
+Func_70f87: ; unreferenced
+ ldh a, [hJoy5]
+ and D_DOWN | D_UP
+ ret z
+ callfar PlayPikachuSoundClip
+ ret
+
INCLUDE "data/maps/town_map_order.asm"
TownMapCursor:
@@ -139,11 +146,14 @@ MonsNestText:
LoadTownMap_Fly::
call ClearSprites
call LoadTownMap
+ ld a, $1
+ ldh [hJoy7], a
call LoadPlayerSpriteGraphics
call LoadFontTilePatterns
ld de, BirdSprite
+ ld b, BANK(BirdSprite)
+ ld c, 12
ld hl, vSprites tile $04
- lb bc, BANK(BirdSprite), 12
call CopyVideoData
ld de, TownMapUpArrow
ld hl, vChars1 tile $6d
@@ -181,7 +191,7 @@ LoadTownMap_Fly::
ld c, 15
call DelayFrames
hlcoord 18, 0
- ld [hl], "▲"
+ ld [hl], "▶"
hlcoord 19, 0
ld [hl], "▼"
pop hl
@@ -215,6 +225,7 @@ LoadTownMap_Fly::
.pressedB
xor a
ld [wTownMapSpriteBlinkingEnabled], a
+ ldh [hJoy7], a
call GBPalWhiteOutWithDelay3
pop hl
pop af
@@ -281,15 +292,14 @@ LoadTownMap:
call ClearScreen
call UpdateSprites
hlcoord 0, 0
- ld b, $12
- ld c, $12
+ lb bc, $12, $12
call TextBoxBorder
call DisableLCD
ld hl, WorldMapTileGraphics
ld de, vChars2 tile $60
ld bc, WorldMapTileGraphicsEnd - WorldMapTileGraphics
ld a, BANK(WorldMapTileGraphics)
- call FarCopyData2
+ call FarCopyData
ld hl, MonNestIcon
ld de, vSprites tile $04
ld bc, MonNestIconEnd - MonNestIcon
@@ -398,8 +408,7 @@ DisplayWildLocations:
jr nz, .drawPlayerSprite
; if no OAM entries were written, print area unknown text
hlcoord 1, 7
- ld b, 2
- ld c, 15
+ lb bc, 2, 15
call TextBoxBorder
hlcoord 2, 9
ld de, AreaUnknownText
diff --git a/engine/joypad.asm b/engine/joypad.asm
index 87f92635..d50eea08 100644
--- a/engine/joypad.asm
+++ b/engine/joypad.asm
@@ -1,12 +1,46 @@
+ReadJoypad_::
+; Poll joypad input.
+; Unlike the hardware register, button
+; presses are indicated by a set bit.
+ ldh a, [hDisableJoypadPolling]
+ and a
+ ret nz
+
+ ld a, 1 << 5 ; select direction keys
+
+ ldh [rJOYP], a
+ ldh a, [rJOYP]
+ ldh a, [rJOYP]
+ cpl
+ and %1111
+ swap a
+ ld b, a
+
+ ld a, 1 << 4 ; select button keys
+ ldh [rJOYP], a
+REPT 6
+ ldh a, [rJOYP]
+ENDR
+ cpl
+ and %1111
+ or b
+
+ ldh [hJoyInput], a
+
+ ld a, 1 << 4 + 1 << 5 ; deselect keys
+ ldh [rJOYP], a
+ ret
+
_Joypad::
; hJoyReleased: (hJoyLast ^ hJoyInput) & hJoyLast
; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput
ldh a, [hJoyInput]
+ ld b, a
+ and A_BUTTON + B_BUTTON + SELECT + START + D_UP
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
jp z, TrySoftReset
- ld b, a
ldh a, [hJoyLast]
ld e, a
xor b
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm
index f3bf3b5d..f9728f47 100644
--- a/engine/link/cable_club.asm
+++ b/engine/link/cable_club.asm
@@ -10,8 +10,7 @@ CableClub_DoBattleOrTrade:
call LoadHpBarAndStatusTilePatterns
call LoadTrainerInfoTextBoxTiles
hlcoord 3, 8
- ld b, 2
- ld c, 12
+ lb bc, 2, 12
call CableClub_TextBoxBorder
hlcoord 4, 10
ld de, PleaseWaitString
@@ -119,6 +118,7 @@ CableClub_DoBattleOrTradeAgain:
ldh [rSC], a
.skipSendingTwoZeroBytes
call Delay3
+ call StopAllMusic
ld a, (1 << SERIAL)
ldh [rIE], a
ld hl, wSerialRandomNumberListBlock
@@ -139,8 +139,6 @@ CableClub_DoBattleOrTradeAgain:
call Serial_ExchangeBytes
ld a, (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
ldh [rIE], a
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
jr z, .skipCopyingRandomNumberList ; the list generated by the gameboy clocking the connection is used by both gameboys
@@ -261,8 +259,7 @@ CableClub_DoBattleOrTradeAgain:
ld [wUnusedCF8D + 1], a
xor a
ld [wTradeCenterPointerTableIndex], a
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ldh a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ld c, 66
@@ -278,9 +275,17 @@ CableClub_DoBattleOrTradeAgain:
ld [wCurOpponent], a
call ClearScreen
call Delay3
+ ld b, $9
+ call RunPaletteCommand
ld hl, wOptions
res 7, [hl]
+ ld a, [wLetterPrintingDelayFlags]
+ push af
+ xor a
+ ld [wLetterPrintingDelayFlags], a
predef InitOpponent
+ pop af
+ ld [wLetterPrintingDelayFlags], a
predef HealParty
jp ReturnToCableClubRoom
.trading
@@ -308,6 +313,9 @@ CallCurrentTradeCenterFunction:
TradeCenter_SelectMon:
call ClearScreen
+ call Delay3
+ ld b, $9
+ call RunPaletteCommand
call LoadTrainerInfoTextBoxTiles
call TradeCenter_DrawPartyLists
call TradeCenter_DrawCancelBox
@@ -465,8 +473,7 @@ TradeCenter_SelectMon:
.displayStatsTradeMenu
push af
hlcoord 0, 14
- ld b, 2
- ld c, 18
+ lb bc, 2, 18
call CableClub_TextBoxBorder
hlcoord 2, 16
ld de, .statsTrade
@@ -601,8 +608,7 @@ TradeCenter_DrawCancelBox:
ld bc, 2 * SCREEN_WIDTH + 9
call FillMemory
hlcoord 0, 15
- ld b, 1
- ld c, 9
+ lb bc, 1, 9
call CableClub_TextBoxBorder
hlcoord 2, 16
ld de, CancelTextString
@@ -624,6 +630,9 @@ TradeCenter_DisplayStats:
ld [wWhichPokemon], a
predef StatusScreen
predef StatusScreen2
+ call Delay3
+ ld b, $9
+ call RunPaletteCommand
call GBPalNormal
call LoadTrainerInfoTextBoxTiles
call TradeCenter_DrawPartyLists
@@ -631,12 +640,10 @@ TradeCenter_DisplayStats:
TradeCenter_DrawPartyLists:
hlcoord 0, 0
- ld b, 6
- ld c, 18
+ lb bc, 6, 18
call CableClub_TextBoxBorder
hlcoord 0, 8
- ld b, 6
- ld c, 18
+ lb bc, 6, 18
call CableClub_TextBoxBorder
hlcoord 5, 0
ld de, wPlayerName
@@ -685,8 +692,7 @@ TradeCenter_Trade:
ld [wMenuWatchMovingOutOfBounds], a
ld [wMenuJoypadPollCount], a
hlcoord 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
ld a, [wTradingWhichPlayerMon]
ld hl, wPartySpecies
@@ -727,8 +733,7 @@ TradeCenter_Trade:
ld a, $1
ld [wSerialExchangeNybbleSendData], a
hlcoord 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
hlcoord 1, 14
ld de, TradeCanceled
@@ -744,8 +749,7 @@ TradeCenter_Trade:
jr nz, .doTrade
; if the other person cancelled
hlcoord 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
hlcoord 1, 14
ld de, TradeCanceled
@@ -792,6 +796,7 @@ TradeCenter_Trade:
add hl, bc
ld a, [hl]
ld [wTradedPlayerMonSpecies], a
+ callabd_ModifyPikachuHappiness PIKAHAPPY_TRADE
xor a
ld [wRemoveMonFromBox], a
call RemovePokemon
@@ -851,9 +856,11 @@ TradeCenter_Trade:
call Serial_PrintWaitingTextAndSyncAndExchangeNybble
ld c, 40
call DelayFrames
+ call Delay3
+ ld b, $9
+ call RunPaletteCommand
hlcoord 0, 12
- ld b, 4
- ld c, 18
+ lb bc, 4, 18
call CableClub_TextBoxBorder
hlcoord 1, 14
ld de, TradeCompleted
diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm
index 594adf08..4d0a0a8a 100644
--- a/engine/link/cable_club_npc.asm
+++ b/engine/link/cable_club_npc.asm
@@ -1,9 +1,12 @@
CableClubNPC::
ld hl, CableClubNPCWelcomeText
call PrintText
+ call CheckPikachuFollowingPlayer
+ jr nz, .asm_7048
CheckEvent EVENT_GOT_POKEDEX
jp nz, .receivedPokedex
; if the player hasn't received the pokedex
+.asm_7048
ld c, 60
call DelayFrames
ld hl, CableClubNPCMakingPreparationsText
@@ -107,7 +110,61 @@ CableClubNPC::
xor a
ld [hld], a
ld [hl], a
- jpfar LinkMenu
+ ld a, [wLetterPrintingDelayFlags]
+ push af
+ callfar LinkMenu
+ pop af
+ ld [wLetterPrintingDelayFlags], a
+ ret
+
+; seems to be similar of Serial_SyncAndExchangeNybble
+Serial_SyncAndExchangeNybbleDouble:
+ ld a, $ff
+ ld [wSerialExchangeNybbleReceiveData], a
+.loop
+ call Serial_ExchangeNybble
+ call DelayFrame
+ push hl
+ ld hl, wUnknownSerialCounter + 1
+ dec [hl]
+ jr nz, .next
+ dec hl
+ dec [hl]
+ jr nz, .next
+ pop hl
+ jr .setUnknownSerialCounterToFFFF
+.next
+ pop hl
+ ld a, [wSerialExchangeNybbleReceiveData]
+ inc a
+ jr z, .loop
+ call DelayFrame
+ ld a, $ff
+ ld [wSerialExchangeNybbleReceiveData], a
+ call Serial_ExchangeNybble
+ ld a, [wSerialExchangeNybbleReceiveData]
+ inc a
+ jr z, .loop
+ ld b, 10
+.syncLoop1
+ call DelayFrame
+ call Serial_ExchangeNybble
+ dec b
+ jr nz, .syncLoop1
+ ld b, 10
+.syncLoop2
+ call DelayFrame
+ call Serial_SendZeroByte
+ dec b
+ jr nz, .syncLoop2
+ ld a, [wSerialExchangeNybbleReceiveData]
+ ld [wSerialSyncAndExchangeNybbleReceiveData], a
+ ret
+.setUnknownSerialCounterToFFFF
+ ld a, $ff
+ ld [wUnknownSerialCounter], a
+ ld [wUnknownSerialCounter + 1], a
+ ret
CableClubNPCAreaReservedFor2FriendsLinkedByCableText:
text_far _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
diff --git a/engine/link/print_waiting_text.asm b/engine/link/print_waiting_text.asm
index 1a16e2f2..a07967fd 100644
--- a/engine/link/print_waiting_text.asm
+++ b/engine/link/print_waiting_text.asm
@@ -1,7 +1,6 @@
PrintWaitingText::
hlcoord 3, 10
- ld b, 1
- ld c, 11
+ lb bc, 1, 11
ld a, [wIsInBattle]
and a
jr z, .trade
diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm
index 6ce76e7f..17f290b4 100644
--- a/engine/menus/display_text_id_init.asm
+++ b/engine/menus/display_text_id_init.asm
@@ -14,19 +14,16 @@ DisplayTextIDInit::
CheckEvent EVENT_GOT_POKEDEX
; start menu with pokedex
hlcoord 10, 0
- ld b, $0e
- ld c, $08
+ lb bc, 14, 8
jr nz, .drawTextBoxBorder
; start menu without pokedex
hlcoord 10, 0
- ld b, $0c
- ld c, $08
+ lb bc, 12, 8
jr .drawTextBoxBorder
; if text ID is not 0 (i.e. not the start menu) then do a standard dialogue text box
.notStartMenu
hlcoord 0, 12
- ld b, $04
- ld c, $12
+ lb bc, 4, 18
.drawTextBoxBorder
call TextBoxBorder
.skipDrawingTextBoxBorder
diff --git a/engine/menus/draw_start_menu.asm b/engine/menus/draw_start_menu.asm
index 00d385bc..7ca75ecb 100644
--- a/engine/menus/draw_start_menu.asm
+++ b/engine/menus/draw_start_menu.asm
@@ -3,13 +3,11 @@ DrawStartMenu::
CheckEvent EVENT_GOT_POKEDEX
; menu with pokedex
hlcoord 10, 0
- ld b, $0e
- ld c, $08
+ lb bc, 14, 8
jr nz, .drawTextBoxBorder
; shorter menu if the player doesn't have the pokedex
hlcoord 10, 0
- ld b, $0c
- ld c, $08
+ lb bc, 12, 8
.drawTextBoxBorder
call TextBoxBorder
ld a, D_DOWN | D_UP | START | B_BUTTON | A_BUTTON
@@ -63,7 +61,7 @@ StartMenuPokedexText:
db "POKéDEX@"
StartMenuPokemonText:
- db "POKéMON@"
+ db "#MON@"
StartMenuItemText:
db "ITEM@"
diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm
index 533454ad..882565ca 100644
--- a/engine/menus/league_pc.asm
+++ b/engine/menus/league_pc.asm
@@ -100,8 +100,7 @@ LeaguePCShowMon:
call LoadFrontSpriteByMonIndex
call GBPalNormal
hlcoord 0, 13
- ld b, 2
- ld c, $12
+ lb bc, 2, 18
call TextBoxBorder
hlcoord 1, 15
ld de, HallOfFameNoText
@@ -110,7 +109,7 @@ LeaguePCShowMon:
ld de, wHoFTeamNo
lb bc, 1, 3
call PrintNumber
- farjp HoFDisplayMonInfo
+ farjp Func_7033f
HallOfFameNoText:
db "HALL OF FAME No @"
diff --git a/engine/menus/link_menu.asm b/engine/menus/link_menu.asm
new file mode 100644
index 00000000..2f2db573
--- /dev/null
+++ b/engine/menus/link_menu.asm
@@ -0,0 +1,910 @@
+Func_f531b::
+ ld c, $14
+ call DelayFrames
+ ld a, $1
+ ld [wBuffer], a
+ xor a
+ ld [wUnknownSerialFlag_d499], a
+ coord hl, 0, 0
+ lb bc, 4, 5
+ call TextBoxBorder
+ ld de, Text_f5791
+ coord hl, 1, 2
+ call PlaceString
+ coord hl, 8, 0
+ lb bc, 8, 10
+ call TextBoxBorder
+ coord hl, 10, 2
+ ld de, Text_f579c
+ call PlaceString
+ coord hl, 0, 10
+ lb bc, 6, 18
+ call TextBoxBorder
+ call UpdateSprites
+ xor a
+ ld [wUnusedCD37], a
+ ld [wd72d], a
+ ld [wd11e], a
+ ld hl, wTopMenuItemY
+ ld a, $2
+ ld [hli], a
+ ld a, $9
+ ld [hli], a
+ xor a
+ ld [hli], a
+ inc hl
+ ld a, $3
+ ld [hli], a
+ ld a, $3
+ ld [hli], a
+ xor a
+ ld [hl], a
+.asm_f5377
+ call Func_f56bd
+ call HandleMenuInput
+ and $3
+ add a
+ add a
+ ld b, a
+ ld a, [wCurrentMenuItem]
+ cp $3
+ jr nz, .asm_f5390
+ bit 2, b
+ jr z, .asm_f5390
+ dec a
+ ld b, $8
+.asm_f5390
+ add b
+ add $c0
+ ld [wLinkMenuSelectionSendBuffer], a
+ ld [wLinkMenuSelectionSendBuffer+1], a
+.asm_f5399
+ ld hl, wLinkMenuSelectionSendBuffer
+ ld a, [hl]
+ ldh [hSerialSendData], a
+ call Serial_ExchangeByte
+ push af
+ ld hl, wLinkMenuSelectionSendBuffer
+ ld a, [hl]
+ ldh [hSerialSendData], a
+ call Serial_ExchangeByte
+ pop bc
+ cp b
+ jr nz, .asm_f5399
+ and $f0
+ cp $c0
+ jr nz, .asm_f5399
+ ld a, b
+ and $c
+ jr nz, .asm_f53c4
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and $c
+ jr z, .asm_f5377
+ jr .asm_f53df
+.asm_f53c4
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and $c
+ jr z, .asm_f53d1
+ ldh a, [hSerialConnectionStatus]
+ cp $2
+ jr z, .asm_f53df
+.asm_f53d1
+ ld a, $1
+ ld [wd11e], a
+ ld a, b
+ ld [wLinkMenuSelectionSendBuffer], a
+ and $3
+ ld [wCurrentMenuItem], a
+.asm_f53df
+ call DelayFrame
+ call DelayFrame
+ ld hl, wLinkMenuSelectionSendBuffer
+ ld a, [hl]
+ ldh [hSerialSendData], a
+ call Serial_ExchangeByte
+ call Serial_ExchangeByte
+ ld b, $14
+.loop
+ call DelayFrame
+ call Serial_SendZeroByte
+ dec b
+ jr nz, .loop
+ ld b, " "
+ ld c, " "
+ ld d, " "
+ ld e, "▷"
+ ld a, [wLinkMenuSelectionSendBuffer]
+ bit 3, a
+ jr nz, .asm_f541a
+ ld b, e
+ ld e, c
+ ld a, [wCurrentMenuItem]
+ and a
+ jr z, .asm_f541a
+ ld c, b
+ ld b, d
+ dec a
+ jr z, .asm_f541a
+ ld d, c
+ ld c, b
+.asm_f541a
+ ld a, b
+ ldcoord_a 9, 2
+ ld a, c
+ ldcoord_a 9, 4
+ ld a, d
+ ldcoord_a 9, 6
+ ld a, e
+ ldcoord_a 9, 8
+ ld c, 40
+ call DelayFrames
+ ld a, [wLinkMenuSelectionSendBuffer]
+ bit 3, a
+ jr nz, asm_f547f
+ ld a, [wCurrentMenuItem]
+ cp $3
+ jr z, asm_f547f
+ inc a
+ ld [wUnknownSerialFlag_d499], a
+ ld a, [wCurrentMenuItem]
+ ld hl, PointerTable_f5488
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, .returnaddress
+ push de
+ jp hl
+.returnaddress
+ ld [wLinkMenuSelectionSendBuffer], a
+ xor a
+ ld [wUnknownSerialCounter], a
+ ld [wUnknownSerialCounter+1], a
+ call Serial_SyncAndExchangeNybble
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and a
+ jr nz, asm_f547c
+ ld a, [wLinkMenuSelectionReceiveBuffer]
+ and a
+ jr nz, Func_f5476
+ xor a
+ ld [wUnknownSerialCounter], a
+ ld [wUnknownSerialCounter+1], a
+ and a
+ ret
+
+Func_f5476::
+ ld hl, ColosseumIneligibleText
+ call PrintText
+asm_f547c::
+ jp Func_f531b
+
+asm_f547f::
+ xor a
+ ld [wUnknownSerialCounter], a
+ ld [wUnknownSerialCounter+1], a
+ scf
+ ret
+
+PointerTable_f5488::
+ dw PokeCup
+ dw PikaCup
+ dw PetitCup
+
+PokeCup::
+ ld hl, wPartyCount
+ ld a, [hli]
+ cp $3
+ jp nz, NotThreeMonsInParty
+ ld b, $3
+.loop
+ ld a, [hli]
+ cp MEW
+ jp z, MewInParty
+ dec b
+ jr nz, .loop
+ dec hl
+ dec hl
+ cp [hl] ; is third mon second mon?
+ jp z, DuplicateSpecies
+ dec hl ; wPartySpecies
+ cp [hl] ; is third mon first mon?
+ jp z, DuplicateSpecies
+ ld a, [hli]
+ cp [hl] ; is first mon second mon?
+ jp z, DuplicateSpecies
+ ld a, [wPartyMon1Level]
+ cp 56
+ jp nc, LevelAbove55
+ cp 50
+ jp c, LevelUnder50
+ ld b, a
+ ld a, [wPartyMon2Level]
+ cp 56
+ jp nc, LevelAbove55
+ cp 50
+ jp c, LevelUnder50
+ ld c, a
+ ld a, [wPartyMon3Level]
+ cp 56
+ jp nc, LevelAbove55
+ cp 50
+ jp c, LevelUnder50
+ add b
+ add c
+ cp 156
+ jp nc, CombinedLevelsGreaterThan155
+ xor a
+ ret
+
+PikaCup::
+ ld hl, wPartyCount
+ ld a, [hli]
+ cp $3
+ jp nz, NotThreeMonsInParty
+ ld b, $3
+.loop
+ ld a, [hli] ; wPartySpecies
+ cp MEW
+ jp z, MewInParty
+ dec b
+ jr nz, .loop
+ dec hl
+ dec hl
+ cp [hl] ; is third mon second mon?
+ jp z, DuplicateSpecies
+ dec hl ; wPartySpecies
+ cp [hl] ; is third mon first mon?
+ jp z, DuplicateSpecies
+ ld a, [hli]
+ cp [hl] ; is first mon second mon?
+ jp z, DuplicateSpecies
+ ld a, [wPartyMon1Level]
+ cp 21
+ jp nc, LevelAbove20
+ cp 15
+ jp c, LevelUnder15
+ ld b, a
+ ld a, [wPartyMon2Level]
+ cp 21
+ jp nc, LevelAbove20
+ cp 15
+ jp c, LevelUnder15
+ ld c, a
+ ld a, [wPartyMon3Level]
+ cp 21
+ jp nc, LevelAbove20
+ cp 15
+ jp c, LevelUnder15
+ add b
+ add c
+ cp 51
+ jp nc, CombinedLevelsAbove50
+ xor a
+ ret
+
+PetitCup::
+ ld hl, wPartyCount
+ ld a, [hli]
+ cp $3
+ jp nz, NotThreeMonsInParty
+ ld b, $3
+.loop
+ ld a, [hli]
+ cp MEW
+ jp z, MewInParty
+ dec b
+ jr nz, .loop
+ dec hl
+ dec hl
+ cp [hl] ; is third mon second mon?
+ jp z, DuplicateSpecies
+ dec hl ; wPartySpecies
+ cp [hl] ; is third mon first mon?
+ jp z, DuplicateSpecies
+ ld a, [hli]
+ cp [hl] ; is first mon second mon?
+ jp z, DuplicateSpecies
+ dec hl
+ ld a, [hl]
+ ld [wcf91], a
+ push hl
+ callfar Func_3b10f
+ pop hl
+ jp c, asm_f56ad
+ inc hl
+ ld a, [hl]
+ ld [wcf91], a
+ push hl
+ callfar Func_3b10f
+ pop hl
+ jp c, asm_f56ad
+ inc hl
+ ld a, [hl]
+ ld [wcf91], a
+ push hl
+ callfar Func_3b10f
+ pop hl
+ jp c, asm_f56ad
+ dec hl
+ dec hl
+ ld b, $3
+.bigloop
+ ld a, [hli]
+ push hl
+ push bc
+ push af
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, PokedexEntryPointers
+ add hl, bc
+ add hl, bc
+ ld de, wcd6d
+ ld bc, $2
+ ld a, BANK(PokedexEntryPointers)
+ call FarCopyData
+ ld hl, wcd6d
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, wcd6d
+ ld bc, $14
+ ld a, BANK(PokedexEntryPointers)
+ call FarCopyData
+ ld hl, wcd6d
+.loop2
+ ld a, [hli]
+ cp "@"
+ jr nz, .loop2
+ ld a, [hli]
+ cp $7
+ jp nc, asm_f5689
+ add a
+ add a
+ ld b, a
+ add a
+ add b
+ ld b, a
+ ld a, [hli]
+ add b
+ cp $51
+ jp nc, asm_f5689
+ ld a, [hli]
+ sub $b9
+ ld a, [hl]
+ sbc $1
+ jp nc, asm_f569b
+ pop af
+ pop bc
+ pop hl
+ dec b
+ jr nz, .bigloop
+ ld a, [wPartyMon1Level]
+ cp 31
+ jp nc, LevelAbove30
+ cp 25
+ jp c, LevelUnder25
+ ld b, a
+ ld a, [wPartyMon2Level]
+ cp 31
+ jp nc, LevelAbove30
+ cp 25
+ jp c, LevelUnder25
+ ld c, a
+ ld a, [wPartyMon3Level]
+ cp 31
+ jp nc, LevelAbove30
+ cp 25
+ jp c, LevelUnder25
+ add b
+ add c
+ cp 81
+ jp nc, CombinedLevelsAbove80
+ xor a
+ ret
+
+NotThreeMonsInParty::
+ ld hl, Colosseum3MonsText
+ call PrintText
+ ld a, $1
+ ret
+
+MewInParty::
+ ld hl, ColosseumMewText
+ call PrintText
+ ld a, $2
+ ret
+
+DuplicateSpecies::
+ ld hl, ColosseumDifferentMonsText
+ call PrintText
+ ld a, $3
+ ret
+
+LevelAbove55::
+ ld hl, ColosseumMaxL55Text
+ call PrintText
+ ld a, $4
+ ret
+
+LevelUnder50::
+ ld hl, ColosseumMinL50Text
+ call PrintText
+ ld a, $5
+ ret
+
+CombinedLevelsGreaterThan155::
+ ld hl, ColosseumTotalL155Text
+ call PrintText
+ ld a, $6
+ ret
+
+LevelAbove30::
+ ld hl, ColosseumMaxL30Text
+ call PrintText
+ ld a, $7
+ ret
+
+LevelUnder25::
+ ld hl, ColosseumMinL25Text
+ call PrintText
+ ld a, $8
+ ret
+
+CombinedLevelsAbove80::
+ ld hl, ColosseumTotalL80Text
+ call PrintText
+ ld a, $9
+ ret
+
+LevelAbove20::
+ ld hl, ColosseumMaxL20Text
+ call PrintText
+ ld a, $a
+ ret
+
+LevelUnder15::
+ ld hl, ColosseumMinL15Text
+ call PrintText
+ ld a, $b
+ ret
+
+CombinedLevelsAbove50::
+ ld hl, ColosseumTotalL50Text
+ call PrintText
+ ld a, $c
+ ret
+
+asm_f5689::
+ pop af
+ pop bc
+ pop hl
+ ld [wd11e], a
+ call GetMonName
+ ld hl, ColosseumHeightText
+ call PrintText
+ ld a, $d
+ ret
+
+asm_f569b::
+ pop af
+ pop bc
+ pop hl
+ ld [wd11e], a
+ call GetMonName
+ ld hl, ColosseumWeightText
+ call PrintText
+ ld a, $e
+ ret
+
+asm_f56ad::
+ ld a, [hl]
+ ld [wd11e], a
+ call GetMonName
+ ld hl, ColosseumEvolvedText
+ call PrintText
+ ld a, $f
+ ret
+
+Func_f56bd::
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ coord hl, 1, 11
+ lb bc, 6, 18
+ call ClearScreenArea
+ ld a, [wCurrentMenuItem]
+ cp $3
+ jr nc, .asm_f56e6
+ ld hl, PointerTable_f56ee
+ ld a, [wCurrentMenuItem]
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld d, h
+ ld e, l
+ coord hl, 1, 12
+ call PlaceString
+.asm_f56e6
+ call Delay3
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ ret
+
+PointerTable_f56ee::
+ dw Text_f56f4
+ dw Text_f5728
+ dw Text_f575b
+
+Text_f56f4::
+ db "LVs of 3<PKMN>:50-55"
+ next "Sum of LVs:155 MAX"
+ next "MEW can't attend.@"
+
+Text_f5728::
+ db "LVs of 3<PKMN>:15-20"
+ next "Sum of LVs:50 MAX"
+ next "MEW can't attend.@"
+
+Text_f575b::
+ db "3 Basic <PKMN>.LV25-30"
+ next "Sum of LVs:80 MAX"
+ next "6’8” and 44lb MAX@"
+
+Text_f5791::
+ db "View"
+ next "Rules@"
+
+Text_f579c::
+ db "# Cup"
+ next "Pika Cup"
+ next "Petit Cup"
+ next "CANCEL@"
+
+Colosseum3MonsText::
+ text_far _Colosseum3MonsText
+ text_end
+
+ColosseumMewText::
+ text_far _ColosseumMewText
+ text_end
+
+ColosseumDifferentMonsText::
+ text_far _ColosseumDifferentMonsText
+ text_end
+
+ColosseumMaxL55Text::
+ text_far _ColosseumMaxL55Text
+ text_end
+
+ColosseumMinL50Text::
+ text_far _ColosseumMinL50Text
+ text_end
+
+ColosseumTotalL155Text::
+ text_far _ColosseumTotalL155Text
+ text_end
+
+ColosseumMaxL30Text::
+ text_far _ColosseumMaxL30Text
+ text_end
+
+ColosseumMinL25Text::
+ text_far _ColosseumMinL25Text
+ text_end
+
+ColosseumTotalL80Text::
+ text_far _ColosseumTotalL80Text
+ text_end
+
+ColosseumMaxL20Text::
+ text_far _ColosseumMaxL20Text
+ text_end
+
+ColosseumMinL15Text::
+ text_far _ColosseumMinL15Text
+ text_end
+
+ColosseumTotalL50Text::
+ text_far _ColosseumTotalL50Text
+ text_end
+
+ColosseumHeightText::
+ text_far _ColosseumHeightText
+ text_end
+
+ColosseumWeightText::
+ text_far _ColosseumWeightText
+ text_end
+
+ColosseumEvolvedText::
+ text_far _ColosseumEvolvedText
+ text_end
+
+ColosseumIneligibleText::
+ text_far _ColosseumIneligibleText
+ text_end
+
+LinkMenu:
+ xor a
+ ld [wLetterPrintingDelayFlags], a
+ ld hl, wd72e
+ set 6, [hl]
+ ld hl, TextTerminator_f5a16
+ call PrintText
+ call SaveScreenTilesToBuffer1
+ ld hl, ColosseumWhereToText
+ call PrintText
+ hlcoord 5, 3
+ lb bc, 8, 13
+ call TextBoxBorder
+ call UpdateSprites
+ hlcoord 7, 5
+ ld de, TradeCenterText
+ call PlaceString
+ xor a
+ ld [wUnusedCD37], a
+ ld [wd72d], a
+ ld [wd11e], a
+ ld hl, wTopMenuItemY
+ ld a, $5
+ ld [hli], a
+ ld a, $6
+ ld [hli], a
+ xor a
+ ld [hli], a
+ inc hl
+ ld a, $3
+ ld [hli], a
+ ld [hli], a
+ xor a
+ ld [hl], a
+.waitForInputLoop
+ call HandleMenuInput
+ and A_BUTTON | B_BUTTON
+ add a
+ add a
+ ld b, a
+ ld a, [wCurrentMenuItem]
+ cp $3
+ jr nz, .asm_f586b
+ bit 2, b
+ jr z, .asm_f586b
+ dec a
+ ld b, $8
+.asm_f586b
+ add b
+ add $d0
+ ld [wLinkMenuSelectionSendBuffer], a
+ ld [wLinkMenuSelectionSendBuffer + 1], a
+.exchangeMenuSelectionLoop
+ call Serial_ExchangeLinkMenuSelection
+ ld a, [wLinkMenuSelectionReceiveBuffer]
+ ld b, a
+ and $f0
+ cp $d0
+ jr z, .asm_f5c7d
+ ld a, [wLinkMenuSelectionReceiveBuffer + 1]
+ ld b, a
+ and $f0
+ cp $d0
+ jr nz, .exchangeMenuSelectionLoop
+.asm_f5c7d
+ ld a, b
+ and $c ; did the enemy press A or B?
+ jr nz, .enemyPressedAOrB
+; the enemy didn't press A or B
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and $c ; did the player press A or B?
+ jr z, .waitForInputLoop ; if neither the player nor the enemy pressed A or B, try again
+ jr .doneChoosingMenuSelection ; if the player pressed A or B but the enemy didn't, use the player's selection
+.enemyPressedAOrB
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and $c ; did the player press A or B?
+ jr z, .useEnemyMenuSelection ; if the enemy pressed A or B but the player didn't, use the enemy's selection
+; the enemy and the player both pressed A or B
+; The gameboy that is clocking the connection wins.
+ ldh a, [hSerialConnectionStatus]
+ cp USING_INTERNAL_CLOCK
+ jr z, .doneChoosingMenuSelection
+.useEnemyMenuSelection
+ ld a, $1
+ ld [wd11e], a
+ ld a, b
+ ld [wLinkMenuSelectionSendBuffer], a
+ and $3
+ ld [wCurrentMenuItem], a ; wCurrentMenuItem
+.doneChoosingMenuSelection
+ ldh a, [hSerialConnectionStatus]
+ cp USING_INTERNAL_CLOCK
+ jr nz, .skipStartingTransfer
+ call DelayFrame
+ call DelayFrame
+ ld a, START_TRANSFER_INTERNAL_CLOCK
+ ldh [rSC], a
+.skipStartingTransfer
+ ld b, " "
+ ld c, " "
+ ld d, " "
+ ld e, "▷"
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and (B_BUTTON << 2) ; was B button pressed?
+ jr nz, .updateCursorPosition
+; A button was pressed
+ ld a, [wCurrentMenuItem]
+ cp $2
+ jp z, .asm_f5963
+ ld b, e
+ ld e, c
+ ld a, [wCurrentMenuItem]
+ and a
+ jr z, .updateCursorPosition
+ ld c, b
+ ld b, d
+ dec a
+ jr z, .updateCursorPosition
+ ld d, c
+ ld c, b
+.updateCursorPosition
+ call Func_f59ec
+ call LoadScreenTilesFromBuffer1
+ ld a, [wLinkMenuSelectionSendBuffer]
+ and (B_BUTTON << 2) ; was B button pressed?
+ jr nz, .choseCancel ; cancel if B pressed
+ ld a, [wCurrentMenuItem]
+ cp $2
+ jr z, .choseCancel
+ xor a
+ ld [wWalkBikeSurfState], a ; start walking
+ ld a, [wCurrentMenuItem]
+ and a
+ ld a, COLOSSEUM
+ jr nz, .next
+ ld a, TRADE_CENTER
+.next
+ ld [wd72d], a
+ ld hl, ColosseumPleaseWaitText
+ call PrintText
+ ld c, 50
+ call DelayFrames
+ ld hl, wd732
+ res 1, [hl]
+ ld a, [wDefaultMap]
+ ld [wDestinationMap], a
+ callfar SpecialWarpIn
+ ld c, 20
+ call DelayFrames
+ xor a
+ ld [wMenuJoypadPollCount], a
+ ld [wSerialExchangeNybbleSendData], a
+ inc a ; LINK_STATE_IN_CABLE_CLUB
+ ld [wLinkState], a
+ ld [wEnteringCableClub], a
+ jpfar SpecialEnterMap
+.choseCancel
+ xor a
+ ld [wMenuJoypadPollCount], a
+ call Delay3
+ callfar CloseLinkConnection
+ ld hl, ColosseumCanceledText
+ call PrintText
+ ld hl, wd72e
+ res 6, [hl]
+ ret
+
+.asm_f5963
+ ld a, [wd11e]
+ and a
+ jr nz, .asm_f5974
+ ld b, " "
+ ld c, " "
+ ld d, "▷"
+ ld e, " "
+ call Func_f59ec
+.asm_f5974
+ xor a
+ ld [wBuffer], a
+ ld a, $ff
+ ld [wSerialExchangeNybbleReceiveData], a
+ ld a, $b
+ ld [wLinkMenuSelectionSendBuffer], a
+ ld b, $78
+.loop
+ ldh a, [hSerialConnectionStatus]
+ cp $2
+ call z, DelayFrame
+ dec b
+ jr z, .asm_f59b2
+ call Serial_ExchangeNybble
+ call DelayFrame
+ ld a, [wSerialExchangeNybbleReceiveData]
+ inc a
+ jr z, .loop
+ ld b, $f
+.loop2
+ call DelayFrame
+ call Serial_ExchangeNybble
+ dec b
+ jr nz, .loop2
+ ld b, $f
+.loop3
+ call DelayFrame
+ call Serial_SendZeroByte
+ dec b
+ jr nz, .loop3
+ jr .asm_f59d6
+
+.asm_f59b2
+ xor a
+ ld [wUnknownSerialCounter], a
+ ld [wUnknownSerialCounter+1], a
+ ld a, [wd11e]
+ and a
+ jr z, .asm_f59cd
+ ld b, " "
+ ld c, " "
+ ld d, " "
+ ld e, "▷"
+ call Func_f59ec
+ jp .choseCancel
+
+.asm_f59cd
+ ld hl, ColosseumVersionText
+ call PrintText
+ jp .choseCancel
+
+.asm_f59d6
+ ld b, " "
+ ld c, " "
+ ld d, "▷"
+ ld e, " "
+ call Func_f59ec
+ call Func_f531b
+ jp c, .choseCancel
+ ld a, $f0
+ jp .next
+
+Func_f59ec::
+ ld a, b
+ ldcoord_a 6, 5
+ ld a, c
+ ldcoord_a 6, 7
+ ld a, d
+ ldcoord_a 6, 9
+ ld a, e
+ ldcoord_a 6, 11
+ ld c, 40
+ call DelayFrames
+ ret
+
+ColosseumWhereToText:
+ text_far _ColosseumWhereToText
+ text_end
+
+ColosseumPleaseWaitText:
+ text_far _ColosseumPleaseWaitText
+ text_end
+
+ColosseumCanceledText:
+ text_far _ColosseumCanceledText
+ text_end
+
+ColosseumVersionText:
+ text_far _ColosseumVersionText
+ text_end
+
+TextTerminator_f5a16:
+ text_end
+
+TradeCenterText:
+ db "TRADE CENTER"
+ next "COLOSSEUM"
+ next "COLOSSEUM2"
+ next "CANCEL@"
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 95404cce..7d81d2f6 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -34,8 +34,7 @@ MainMenu:
jr z, .noSaveFile
; there's a save file
hlcoord 0, 0
- ld b, 6
- ld c, 13
+ lb bc, 6, 13
call TextBoxBorder
hlcoord 2, 2
ld de, ContinueText
@@ -43,8 +42,7 @@ MainMenu:
jr .next2
.noSaveFile
hlcoord 0, 0
- ld b, 4
- ld c, 13
+ lb bc, 4, 13
call TextBoxBorder
hlcoord 2, 2
ld de, NewGameText
@@ -129,179 +127,21 @@ InitOptions:
ld [wLetterPrintingDelayFlags], a
ld a, 3 ; medium speed
ld [wOptions], a
+ ld a, 64 ; audio?
+ ld [wPrinterSettings], a
ret
-LinkMenu:
- xor a
- ld [wLetterPrintingDelayFlags], a
- ld hl, wd72e
- set 6, [hl]
- ld hl, LinkMenuEmptyText
- call PrintText
- call SaveScreenTilesToBuffer1
- ld hl, WhereWouldYouLikeText
- call PrintText
- hlcoord 5, 5
- ld b, $6
- ld c, $d
- call TextBoxBorder
- call UpdateSprites
- hlcoord 7, 7
- ld de, CableClubOptionsText
- call PlaceString
- xor a
- ld [wUnusedCD37], a
- ld [wd72d], a
- ld hl, wTopMenuItemY
- ld a, $7
- ld [hli], a
- ld a, $6
- ld [hli], a
- xor a
- ld [hli], a
- inc hl
- ld a, $2
- ld [hli], a
- inc a
- ; ld a, A_BUTTON | B_BUTTON
- ld [hli], a ; wMenuWatchedKeys
- xor a
- ld [hl], a
-.waitForInputLoop
- call HandleMenuInput
- and A_BUTTON | B_BUTTON
- add a
- add a
- ld b, a
- ld a, [wCurrentMenuItem]
- add b
- add $d0
- ld [wLinkMenuSelectionSendBuffer], a
- ld [wLinkMenuSelectionSendBuffer + 1], a
-.exchangeMenuSelectionLoop
- call Serial_ExchangeLinkMenuSelection
- ld a, [wLinkMenuSelectionReceiveBuffer]
- ld b, a
- and $f0
- cp $d0
- jr z, .asm_5c7d
- ld a, [wLinkMenuSelectionReceiveBuffer + 1]
- ld b, a
- and $f0
- cp $d0
- jr nz, .exchangeMenuSelectionLoop
-.asm_5c7d
- ld a, b
- and $c ; did the enemy press A or B?
- jr nz, .enemyPressedAOrB
-; the enemy didn't press A or B
- ld a, [wLinkMenuSelectionSendBuffer]
- and $c ; did the player press A or B?
- jr z, .waitForInputLoop ; if neither the player nor the enemy pressed A or B, try again
- jr .doneChoosingMenuSelection ; if the player pressed A or B but the enemy didn't, use the player's selection
-.enemyPressedAOrB
- ld a, [wLinkMenuSelectionSendBuffer]
- and $c ; did the player press A or B?
- jr z, .useEnemyMenuSelection ; if the enemy pressed A or B but the player didn't, use the enemy's selection
-; the enemy and the player both pressed A or B
-; The gameboy that is clocking the connection wins.
- ldh a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr z, .doneChoosingMenuSelection
-.useEnemyMenuSelection
- ld a, b
- ld [wLinkMenuSelectionSendBuffer], a
- and $3
- ld [wCurrentMenuItem], a
-.doneChoosingMenuSelection
- ldh a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr nz, .skipStartingTransfer
- call DelayFrame
- call DelayFrame
- ld a, START_TRANSFER_INTERNAL_CLOCK
- ldh [rSC], a
-.skipStartingTransfer
- ld b, " "
- ld c, " "
- ld d, "▷"
- ld a, [wLinkMenuSelectionSendBuffer]
- and (B_BUTTON << 2) ; was B button pressed?
- jr nz, .updateCursorPosition
-; A button was pressed
- ld a, [wCurrentMenuItem]
- cp $2
- jr z, .updateCursorPosition
- ld c, d
- ld d, b
- dec a
- jr z, .updateCursorPosition
- ld b, c
- ld c, d
-.updateCursorPosition
- ld a, b
- ldcoord_a 6, 7
- ld a, c
- ldcoord_a 6, 9
- ld a, d
- ldcoord_a 6, 11
- ld c, 40
- call DelayFrames
- call LoadScreenTilesFromBuffer1
- ld a, [wLinkMenuSelectionSendBuffer]
- and (B_BUTTON << 2) ; was B button pressed?
- jr nz, .choseCancel ; cancel if B pressed
- ld a, [wCurrentMenuItem]
- cp $2
- jr z, .choseCancel
- xor a
- ld [wWalkBikeSurfState], a ; start walking
- ld a, [wCurrentMenuItem]
- and a
- ld a, COLOSSEUM
- jr nz, .next
- ld a, TRADE_CENTER
-.next
- ld [wd72d], a
- ld hl, PleaseWaitText
+Func_5cc1:
+; unused?
+ ld a, $6d
+ cp $80
+ ret c ; will always be executed
+ ld hl, NotEnoughMemoryText
call PrintText
- ld c, 50
- call DelayFrames
- ld hl, wd732
- res 1, [hl]
- ld a, [wDefaultMap]
- ld [wDestinationMap], a
- call SpecialWarpIn
- ld c, 20
- call DelayFrames
- xor a
- ld [wMenuJoypadPollCount], a
- ld [wSerialExchangeNybbleSendData], a
- inc a ; LINK_STATE_IN_CABLE_CLUB
- ld [wLinkState], a
- ld [wEnteringCableClub], a
- jr SpecialEnterMap
-.choseCancel
- xor a
- ld [wMenuJoypadPollCount], a
- call Delay3
- call CloseLinkConnection
- ld hl, LinkCanceledText
- call PrintText
- ld hl, wd72e
- res 6, [hl]
ret
-WhereWouldYouLikeText:
- text_far _WhereWouldYouLikeText
- text_end
-
-PleaseWaitText:
- text_far _PleaseWaitText
- text_end
-
-LinkCanceledText:
- text_far _LinkCanceledText
+NotEnoughMemoryText:
+ text_far _NotEnoughMemoryText
text_end
StartNewGame:
@@ -309,6 +149,8 @@ StartNewGame:
res 1, [hl]
StartNewGameDebug:
call OakSpeech
+ ld a, $8
+ ld [wPlayerMovingDirection], a
ld c, 20
call DelayFrames
@@ -324,6 +166,7 @@ SpecialEnterMap::
call ResetPlayerSpriteData
ld c, 20
call DelayFrames
+ call Func_5cc1
ld a, [wEnteringCableClub]
and a
ret nz
@@ -338,17 +181,11 @@ NewGameText:
db "NEW GAME"
next "OPTION@"
-CableClubOptionsText:
- db "TRADE CENTER"
- next "COLOSSEUM"
- next "CANCEL@"
-
DisplayContinueGameInfo:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 4, 7
- ld b, 8
- ld c, 14
+ lb bc, 8, 14
call TextBoxBorder
hlcoord 5, 9
ld de, SaveScreenInfoText
@@ -371,8 +208,7 @@ PrintSaveScreenText:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 4, 0
- ld b, $8
- ld c, $e
+ lb bc, 8, 14
call TextBoxBorder
call LoadTextBoxTilePatterns
call UpdateSprites
@@ -430,259 +266,8 @@ SaveScreenInfoText:
next "TIME@"
DisplayOptionMenu:
- hlcoord 0, 0
- ld b, 3
- ld c, 18
- call TextBoxBorder
- hlcoord 0, 5
- ld b, 3
- ld c, 18
- call TextBoxBorder
- hlcoord 0, 10
- ld b, 3
- ld c, 18
- call TextBoxBorder
- hlcoord 1, 1
- ld de, TextSpeedOptionText
- call PlaceString
- hlcoord 1, 6
- ld de, BattleAnimationOptionText
- call PlaceString
- hlcoord 1, 11
- ld de, BattleStyleOptionText
- call PlaceString
- hlcoord 2, 16
- ld de, OptionMenuCancelText
- call PlaceString
- xor a
- ld [wCurrentMenuItem], a
- ld [wLastMenuItem], a
- inc a
- ld [wLetterPrintingDelayFlags], a
- ld [wOptionsCancelCursorX], a
- ld a, 3 ; text speed cursor Y coordinate
- ld [wTopMenuItemY], a
- call SetCursorPositionsFromOptions
- ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
- ld [wTopMenuItemX], a
- ld a, $01
- ldh [hAutoBGTransferEnabled], a ; enable auto background transfer
- call Delay3
-.loop
- call PlaceMenuCursor
- call SetOptionsFromCursorPositions
-.getJoypadStateLoop
- call JoypadLowSensitivity
- ldh a, [hJoy5]
- ld b, a
- and A_BUTTON | B_BUTTON | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ; any key besides select pressed?
- jr z, .getJoypadStateLoop
- bit 1, b ; B button pressed?
- jr nz, .exitMenu
- bit 3, b ; Start button pressed?
- jr nz, .exitMenu
- bit 0, b ; A button pressed?
- jr z, .checkDirectionKeys
- ld a, [wTopMenuItemY]
- cp 16 ; is the cursor on Cancel?
- jr nz, .loop
-.exitMenu
- ld a, SFX_PRESS_AB
- call PlaySound
+ callfar DisplayOptionMenu_
ret
-.eraseOldMenuCursor
- ld [wTopMenuItemX], a
- call EraseMenuCursor
- jp .loop
-.checkDirectionKeys
- ld a, [wTopMenuItemY]
- bit 7, b ; Down pressed?
- jr nz, .downPressed
- bit 6, b ; Up pressed?
- jr nz, .upPressed
- cp 8 ; cursor in Battle Animation section?
- jr z, .cursorInBattleAnimation
- cp 13 ; cursor in Battle Style section?
- jr z, .cursorInBattleStyle
- cp 16 ; cursor on Cancel?
- jr z, .loop
-.cursorInTextSpeed
- bit 5, b ; Left pressed?
- jp nz, .pressedLeftInTextSpeed
- jp .pressedRightInTextSpeed
-.downPressed
- cp 16
- ld b, -13
- ld hl, wOptionsTextSpeedCursorX
- jr z, .updateMenuVariables
- ld b, 5
- cp 3
- inc hl
- jr z, .updateMenuVariables
- cp 8
- inc hl
- jr z, .updateMenuVariables
- ld b, 3
- inc hl
- jr .updateMenuVariables
-.upPressed
- cp 8
- ld b, -5
- ld hl, wOptionsTextSpeedCursorX
- jr z, .updateMenuVariables
- cp 13
- inc hl
- jr z, .updateMenuVariables
- cp 16
- ld b, -3
- inc hl
- jr z, .updateMenuVariables
- ld b, 13
- inc hl
-.updateMenuVariables
- add b
- ld [wTopMenuItemY], a
- ld a, [hl]
- ld [wTopMenuItemX], a
- call PlaceUnfilledArrowMenuCursor
- jp .loop
-.cursorInBattleAnimation
- ld a, [wOptionsBattleAnimCursorX] ; battle animation cursor X coordinate
- xor $0b ; toggle between 1 and 10
- ld [wOptionsBattleAnimCursorX], a
- jp .eraseOldMenuCursor
-.cursorInBattleStyle
- ld a, [wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
- xor $0b ; toggle between 1 and 10
- ld [wOptionsBattleStyleCursorX], a
- jp .eraseOldMenuCursor
-.pressedLeftInTextSpeed
- ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
- cp 1
- jr z, .updateTextSpeedXCoord
- cp 7
- jr nz, .fromSlowToMedium
- sub 6
- jr .updateTextSpeedXCoord
-.fromSlowToMedium
- sub 7
- jr .updateTextSpeedXCoord
-.pressedRightInTextSpeed
- ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
- cp 14
- jr z, .updateTextSpeedXCoord
- cp 7
- jr nz, .fromFastToMedium
- add 7
- jr .updateTextSpeedXCoord
-.fromFastToMedium
- add 6
-.updateTextSpeedXCoord
- ld [wOptionsTextSpeedCursorX], a ; text speed cursor X coordinate
- jp .eraseOldMenuCursor
-
-TextSpeedOptionText:
- db "TEXT SPEED"
- next " FAST MEDIUM SLOW@"
-
-BattleAnimationOptionText:
- db "BATTLE ANIMATION"
- next " ON OFF@"
-
-BattleStyleOptionText:
- db "BATTLE STYLE"
- next " SHIFT SET@"
-
-OptionMenuCancelText:
- db "CANCEL@"
-
-; sets the options variable according to the current placement of the menu cursors in the options menu
-SetOptionsFromCursorPositions:
- ld hl, TextSpeedOptionData
- ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
- ld c, a
-.loop
- ld a, [hli]
- cp c
- jr z, .textSpeedMatchFound
- inc hl
- jr .loop
-.textSpeedMatchFound
- ld a, [hl]
- ld d, a
- ld a, [wOptionsBattleAnimCursorX] ; battle animation cursor X coordinate
- dec a
- jr z, .battleAnimationOn
-.battleAnimationOff
- set 7, d
- jr .checkBattleStyle
-.battleAnimationOn
- res 7, d
-.checkBattleStyle
- ld a, [wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
- dec a
- jr z, .battleStyleShift
-.battleStyleSet
- set 6, d
- jr .storeOptions
-.battleStyleShift
- res 6, d
-.storeOptions
- ld a, d
- ld [wOptions], a
- ret
-
-; reads the options variable and places menu cursors in the correct positions within the options menu
-SetCursorPositionsFromOptions:
- ld hl, TextSpeedOptionData + 1
- ld a, [wOptions]
- ld c, a
- and $3f
- push bc
- ld de, 2
- call IsInArray
- pop bc
- dec hl
- ld a, [hl]
- ld [wOptionsTextSpeedCursorX], a ; text speed cursor X coordinate
- hlcoord 0, 3
- call .placeUnfilledRightArrow
- sla c
- ld a, 1 ; On
- jr nc, .storeBattleAnimationCursorX
- ld a, 10 ; Off
-.storeBattleAnimationCursorX
- ld [wOptionsBattleAnimCursorX], a ; battle animation cursor X coordinate
- hlcoord 0, 8
- call .placeUnfilledRightArrow
- sla c
- ld a, 1
- jr nc, .storeBattleStyleCursorX
- ld a, 10
-.storeBattleStyleCursorX
- ld [wOptionsBattleStyleCursorX], a ; battle style cursor X coordinate
- hlcoord 0, 13
- call .placeUnfilledRightArrow
-; cursor in front of Cancel
- hlcoord 0, 16
- ld a, 1
-.placeUnfilledRightArrow
- ld e, a
- ld d, 0
- add hl, de
- ld [hl], "▷"
- ret
-
-; table that indicates how the 3 text speed options affect frame delays
-; Format:
-; 00: X coordinate of menu cursor
-; 01: delay after printing a letter (in frames)
-TextSpeedOptionData:
- db 14, 5 ; Slow
- db 7, 3 ; Medium
- db 1, 1 ; Fast
- db 7 ; default X coordinate (Medium)
- db -1 ; end
CheckForPlayerNameInSRAM:
; Check if the player name data in SRAM has a string terminator character
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index 9347212e..553c47d0 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -5,8 +5,7 @@ AskName:
ld a, [wIsInBattle]
dec a
hlcoord 0, 0
- ld b, 4
- ld c, 11
+ lb bc, 4, 11
call z, ClearScreenArea ; only if in wild battle
ld a, [wcf91]
ld [wd11e], a
@@ -94,8 +93,7 @@ DisplayNamingScreen:
call LoadEDTile
farcall LoadMonPartySpriteGfx
hlcoord 0, 4
- ld b, 9
- ld c, 18
+ lb bc, 9, 18
call TextBoxBorder
call PrintNamingText
ld a, 3
@@ -324,12 +322,28 @@ DisplayNamingScreen:
jp EraseMenuCursor
LoadEDTile:
+; In Red/Blue, the bank for the ED_tile was defined incorrectly as bank0
+; Luckily, the MBC3 treats loading $0 into $2000-$2fff range as loading bank1 into $4000-$7fff range
+; Because Yellow uses the MBC5, loading $0 into $2000 - $2fff range will load bank0 instead of bank1 and thus incorrectly load the tile
+; Instead of defining the correct bank, GameFreak decided to simply copy the ED_Tile in the function during HBlank
ld de, ED_Tile
ld hl, vFont tile $70
- ld bc, (ED_TileEnd - ED_Tile) / $8
- ; to fix the graphical bug on poor emulators
- ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8
- jp CopyVideoDataDouble
+ ld c, $4 ; number of copies needed
+.waitForHBlankLoop
+ ldh a, [rSTAT]
+ and %10 ; in HBlank?
+ jr nz, .waitForHBlankLoop
+ ld a, [de]
+ ld [hli], a
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ ld [hli], a
+ inc de
+ dec c
+ jr nz, .waitForHBlankLoop
+ ret
ED_Tile:
INCBIN "gfx/font/ED.1bpp"
diff --git a/engine/menus/options.asm b/engine/menus/options.asm
new file mode 100644
index 00000000..110bef2a
--- /dev/null
+++ b/engine/menus/options.asm
@@ -0,0 +1,443 @@
+DisplayOptionMenu_:
+ call InitOptionsMenu
+.optionMenuLoop
+ call JoypadLowSensitivity
+ ldh a, [hJoy5]
+ and START | B_BUTTON
+ jr nz, .exitOptionMenu
+ call OptionsControl
+ jr c, .dpadDelay
+ call GetOptionPointer
+ jr c, .exitOptionMenu
+.dpadDelay
+ call OptionsMenu_UpdateCursorPosition
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ jr .optionMenuLoop
+.exitOptionMenu
+ ret
+
+GetOptionPointer:
+ ld a, [wOptionsCursorLocation]
+ ld e, a
+ ld d, $0
+ ld hl, OptionMenuJumpTable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl ; jump to the function for the current highlighted option
+
+OptionMenuJumpTable:
+ dw OptionsMenu_TextSpeed
+ dw OptionsMenu_BattleAnimations
+ dw OptionsMenu_BattleStyle
+ dw OptionsMenu_SpeakerSettings
+ dw OptionsMenu_GBPrinterBrightness
+ dw OptionsMenu_Dummy
+ dw OptionsMenu_Dummy
+ dw OptionsMenu_Cancel
+
+OptionsMenu_TextSpeed:
+ call GetTextSpeed
+ ldh a, [hJoy5]
+ bit 4, a ; right
+ jr nz, .pressedRight
+ bit 5, a
+ jr nz, .pressedLeft
+ jr .asm_41ce0
+.pressedRight
+ ld a, c
+ cp $2
+ jr c, .asm_41cca
+ ld c, $ff
+.asm_41cca
+ inc c
+ ld a, e
+ jr .asm_41cd6
+.pressedLeft
+ ld a, c
+ and a
+ jr nz, .asm_41cd4
+ ld c, $3
+.asm_41cd4
+ dec c
+ ld a, d
+.asm_41cd6
+ ld b, a
+ ld a, [wOptions]
+ and $f0
+ or b
+ ld [wOptions], a
+.asm_41ce0
+ ld b, $0
+ ld hl, TextSpeedStringsPointerTable
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 14, 2
+ call PlaceString
+ and a
+ ret
+
+TextSpeedStringsPointerTable:
+ dw FastText
+ dw MidText
+ dw SlowText
+
+FastText:
+ db "FAST@"
+MidText:
+ db "MID @"
+SlowText:
+ db "SLOW@"
+
+GetTextSpeed:
+ ld a, [wOptions]
+ and $f
+ cp $5
+ jr z, .slowTextOption
+ cp $1
+ jr z, .fastTextOption
+; mid text option
+ ld c, $1
+ lb de, 1, 5
+ ret
+.slowTextOption
+ ld c, $2
+ lb de, 3, 1
+ ret
+.fastTextOption
+ ld c, $0
+ lb de, 5, 3
+ ret
+
+OptionsMenu_BattleAnimations:
+ ldh a, [hJoy5]
+ and D_RIGHT | D_LEFT
+ jr nz, .asm_41d33
+ ld a, [wOptions]
+ and $80 ; mask other bits
+ jr .asm_41d3b
+.asm_41d33
+ ld a, [wOptions]
+ xor $80
+ ld [wOptions], a
+.asm_41d3b
+ ld bc, $0
+ sla a
+ rl c
+ ld hl, AnimationOptionStringsPointerTable
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 14, 4
+ call PlaceString
+ and a
+ ret
+
+AnimationOptionStringsPointerTable:
+ dw AnimationOnText
+ dw AnimationOffText
+
+AnimationOnText:
+ db "ON @"
+AnimationOffText:
+ db "OFF@"
+
+OptionsMenu_BattleStyle:
+ ldh a, [hJoy5]
+ and D_LEFT | D_RIGHT
+ jr nz, .asm_41d6b
+ ld a, [wOptions]
+ and $40 ; mask other bits
+ jr .asm_41d73
+.asm_41d6b
+ ld a, [wOptions]
+ xor $40
+ ld [wOptions], a
+.asm_41d73
+ ld bc, $0
+ sla a
+ sla a
+ rl c
+ ld hl, BattleStyleOptionStringsPointerTable
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 14, 6
+ call PlaceString
+ and a
+ ret
+
+BattleStyleOptionStringsPointerTable:
+ dw BattleStyleShiftText
+ dw BattleStyleSetText
+
+BattleStyleShiftText:
+ db "SHIFT@"
+BattleStyleSetText:
+ db "SET @"
+
+OptionsMenu_SpeakerSettings:
+ ld a, [wOptions]
+ and $30
+ swap a
+ ld c, a
+ ldh a, [hJoy5]
+ bit 4, a
+ jr nz, .pressedRight
+ bit 5, a
+ jr nz, .pressedLeft
+ jr .asm_41dca
+.pressedRight
+ ld a, c
+ inc a
+ and $3
+ jr .asm_41dba
+.pressedLeft
+ ld a, c
+ dec a
+ and $3
+.asm_41dba
+ ld c, a
+ swap a
+ ld b, a
+ xor a
+ ldh [rNR51], a
+ ld a, [wOptions]
+ and $cf
+ or b
+ ld [wOptions], a
+.asm_41dca
+ ld b, $0
+ ld hl, SpeakerOptionStringsPointerTable
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 8, 8
+ call PlaceString
+ and a
+ ret
+
+SpeakerOptionStringsPointerTable:
+ dw MonoSoundText
+ dw Earphone1SoundText
+ dw Earphone2SoundText
+ dw Earphone3SoundText
+
+MonoSoundText:
+ db "MONO @"
+Earphone1SoundText:
+ db "EARPHONE1@"
+Earphone2SoundText:
+ db "EARPHONE2@"
+Earphone3SoundText:
+ db "EARPHONE3@"
+
+OptionsMenu_GBPrinterBrightness:
+ call Func_41e7b
+ ldh a, [hJoy5]
+ bit 4, a
+ jr nz, .pressedRight
+ bit 5, a
+ jr nz, .pressedLeft
+ jr .asm_41e32
+.pressedRight
+ ld a, c
+ cp $4
+ jr c, .asm_41e22
+ ld c, $ff
+.asm_41e22
+ inc c
+ ld a, e
+ jr .asm_41e2e
+.pressedLeft
+ ld a, c
+ and a
+ jr nz, .asm_41e2c
+ ld c, $5
+.asm_41e2c
+ dec c
+ ld a, d
+.asm_41e2e
+ ld b, a
+ ld [wPrinterSettings], a
+.asm_41e32
+ ld b, $0
+ ld hl, GBPrinterOptionStringsPointerTable
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 8, 10
+ call PlaceString
+ and a
+ ret
+
+GBPrinterOptionStringsPointerTable:
+ dw LightestPrintText
+ dw LighterPrintText
+ dw NormalPrintText
+ dw DarkerPrintText
+ dw DarkestPrintText
+
+LightestPrintText:
+ db "LIGHTEST@"
+LighterPrintText:
+ db "LIGHTER @"
+NormalPrintText:
+ db "NORMAL @"
+DarkerPrintText:
+ db "DARKER @"
+DarkestPrintText:
+ db "DARKEST @"
+
+Func_41e7b:
+ ld a, [wPrinterSettings]
+ and a
+ jr z, .asm_41e93
+ cp $20
+ jr z, .asm_41e99
+ cp $60
+ jr z, .asm_41e9f
+ cp $7f
+ jr z, .asm_41ea5
+ ld c, $2
+ lb de, $20, $60
+ ret
+.asm_41e93
+ ld c, $0
+ lb de, $7f, $20
+ ret
+.asm_41e99
+ ld c, $1
+ lb de, $0, $40
+ ret
+.asm_41e9f
+ ld c, $3
+ lb de, $40, $7f
+ ret
+.asm_41ea5
+ ld c, $4
+ lb de, $60, $0
+ ret
+
+OptionsMenu_Dummy:
+ and a
+ ret
+
+OptionsMenu_Cancel:
+ ldh a, [hJoy5]
+ and A_BUTTON
+ jr nz, .pressedCancel
+ and a
+ ret
+.pressedCancel
+ scf
+ ret
+
+OptionsControl:
+ ld hl, wOptionsCursorLocation
+ ldh a, [hJoy5]
+ cp D_DOWN
+ jr z, .pressedDown
+ cp D_UP
+ jr z, .pressedUp
+ and a
+ ret
+.pressedDown
+ ld a, [hl]
+ cp $7
+ jr nz, .doNotWrapAround
+ ld [hl], $0
+ scf
+ ret
+.doNotWrapAround
+ cp $4
+ jr c, .regularIncrement
+ ld [hl], $6
+.regularIncrement
+ inc [hl]
+ scf
+ ret
+.pressedUp
+ ld a, [hl]
+ cp $7
+ jr nz, .doNotMoveCursorToPrintOption
+ ld [hl], $4
+ scf
+ ret
+.doNotMoveCursorToPrintOption
+ and a
+ jr nz, .regularDecrement
+ ld [hl], $8
+.regularDecrement
+ dec [hl]
+ scf
+ ret
+
+OptionsMenu_UpdateCursorPosition:
+ hlcoord 1, 1
+ ld de, SCREEN_WIDTH
+ ld c, 16
+.loop
+ ld [hl], " "
+ add hl, de
+ dec c
+ jr nz, .loop
+ hlcoord 1, 2
+ ld bc, SCREEN_WIDTH * 2
+ ld a, [wOptionsCursorLocation]
+ call AddNTimes
+ ld [hl], "▶"
+ ret
+
+InitOptionsMenu:
+ hlcoord 0, 0
+ lb bc, SCREEN_HEIGHT - 2, SCREEN_WIDTH - 2
+ call TextBoxBorder
+ hlcoord 2, 2
+ ld de, AllOptionsText
+ call PlaceString
+ hlcoord 2, 16
+ ld de, OptionMenuCancelText
+ call PlaceString
+ xor a
+ ld [wOptionsCursorLocation], a
+ ld c, 5 ; the number of options to loop through
+.loop
+ push bc
+ call GetOptionPointer ; updates the next option
+ pop bc
+ ld hl, wOptionsCursorLocation
+ inc [hl] ; moves the cursor for the highlighted option
+ dec c
+ jr nz, .loop
+ xor a
+ ld [wOptionsCursorLocation], a
+ inc a
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ ret
+
+AllOptionsText:
+ db "TEXT SPEED :"
+ next "ANIMATION :"
+ next "BATTLESTYLE:"
+ next "SOUND:"
+ next "PRINT:@"
+
+OptionMenuCancelText:
+ db "CANCEL@"
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index f77beb26..c64ce70a 100644
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -30,9 +30,17 @@ RedrawPartyMenu_::
call GetPartyMonName
pop hl
call PlaceString ; print the pokemon's name
- farcall WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon
ldh a, [hPartyMonIndex]
ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .regularMon
+ call CheckPikachuFollowingPlayer
+ jr z, .regularMon
+ ld a, $ff
+ ldh [hPartyMonIndex], a
+.regularMon
+ farcall WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon
+ ld a, [wWhichPokemon]
inc a
ldh [hPartyMonIndex], a
call LoadMonData
@@ -90,8 +98,8 @@ RedrawPartyMenu_::
jr nz, .placeMoveLearnabilityString
ld de, .notAbleToLearnMoveText
.placeMoveLearnabilityString
- ld bc, 20 + 9 ; down 1 row and right 9 columns
push hl
+ ld bc, 20 + 9 ; down 1 row and right 9 columns
add hl, bc
call PlaceString
pop hl
@@ -157,9 +165,9 @@ RedrawPartyMenu_::
; if it does match
ld de, .ableToEvolveText
.placeEvolutionStoneString
- ld bc, 20 + 9 ; down 1 row and right 9 columns
pop hl
push hl
+ ld bc, 20 + 9 ; down 1 row and right 9 columns
add hl, bc
call PlaceString
pop hl
diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm
index 5461be51..1fac030b 100644
--- a/engine/menus/players_pc.asm
+++ b/engine/menus/players_pc.asm
@@ -1,6 +1,4 @@
PlayerPC::
- ld hl, wd730
- set 6, [hl]
ld a, ITEM_NAME
ld [wNameListType], a
call SaveScreenTilesToBuffer1
@@ -17,14 +15,15 @@ PlayerPC::
call PrintText
PlayerPCMenu:
+ ld hl, wd730
+ set 6, [hl]
ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a
ld hl, wFlags_0xcd60
set 5, [hl]
call LoadScreenTilesFromBuffer2
hlcoord 0, 0
- ld b, $8
- ld c, $e
+ lb bc, 8, 14
call TextBoxBorder
call UpdateSprites
hlcoord 2, 2
diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm
index 2af8d714..7b1a204a 100644
--- a/engine/menus/pokedex.asm
+++ b/engine/menus/pokedex.asm
@@ -12,9 +12,10 @@ ShowPokedexMenu:
ld [wd11e], a
ldh [hJoy7], a
.setUpGraphics
+ callfar LoadPokedexTilePatterns
+.loop
ld b, SET_PAL_GENERIC
call RunPaletteCommand
- callfar LoadPokedexTilePatterns
.doPokemonListMenu
ld hl, wTopMenuItemY
ld a, 3
@@ -43,12 +44,15 @@ ShowPokedexMenu:
call GBPalWhiteOutWithDelay3
call RunDefaultPaletteCommand
jp ReloadMapData
+
.goToSideMenu
call HandlePokedexSideMenu
dec b
jr z, .exitPokedex ; if the player chose Quit
dec b
jr z, .doPokemonListMenu ; if pokemon not seen or player pressed B button
+ dec b
+ jr z, .loop
jp .setUpGraphics ; if pokemon data or area was shown
; handles the menu on the lower right in the pokedex screen
@@ -79,20 +83,21 @@ HandlePokedexSideMenu:
jr z, .exitSideMenu
call PokedexToIndex
ld hl, wTopMenuItemY
- ld a, 10
+ ld a, 8
ld [hli], a ; top menu item Y
ld a, 15
ld [hli], a ; top menu item X
xor a
ld [hli], a ; current menu item ID
inc hl
- ld a, 3
+ ld a, 4
ld [hli], a ; max menu item ID
- ;ld a, A_BUTTON | B_BUTTON
+ ld a, A_BUTTON | B_BUTTON
ld [hli], a ; menu watched keys (A button and B button)
xor a
ld [hli], a ; old menu item ID
ld [wMenuWatchMovingOutOfBounds], a
+ ldh [hJoy7], a
.handleMenuInput
call HandleMenuInput
bit 1, a ; was the B button pressed?
@@ -105,6 +110,8 @@ HandlePokedexSideMenu:
jr z, .choseCry
dec a
jr z, .choseArea
+ dec a
+ jr z, .chosePrint
.choseQuit
ld b, 1
.exitSideMenu
@@ -118,6 +125,8 @@ HandlePokedexSideMenu:
ld [wLastMenuItem], a
pop af
ld [wCurrentMenuItem], a
+ ld a, $1
+ ldh [hJoy7], a
push bc
hlcoord 0, 3
ld de, 20
@@ -128,9 +137,9 @@ HandlePokedexSideMenu:
.buttonBPressed
push bc
- hlcoord 15, 10
+ hlcoord 15, 8
ld de, 20
- lb bc, " ", 7
+ lb bc, " ", 9
call DrawTileLine ; cover up the menu cursor in the side menu
pop bc
jr .exitSideMenu
@@ -152,13 +161,105 @@ HandlePokedexSideMenu:
ld b, 0
jr .exitSideMenu
+.chosePrint
+ ldh a, [hTileAnimations]
+ push af
+ xor a
+ ldh [hTileAnimations], a
+ ld a, [wd11e]
+ ld [wcf91], a
+ callfar PrintPokedexEntry
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call ClearScreen
+ pop af
+ ldh [hTileAnimations], a
+ ld b, $3
+ jr .exitSideMenu
+
; handles the list of pokemon on the left of the pokedex screen
; sets carry flag if player presses A, unsets carry flag if player presses B
HandlePokedexListMenu:
+ call Pokedex_DrawInterface
+.loop
+ call Pokedex_PlacePokemonList
+ call GBPalNormal
+ call HandleMenuInput
+ bit BIT_B_BUTTON, a ; was the B button pressed?
+ jp nz, .buttonBPressed
+ bit BIT_A_BUTTON, a ; was the A button pressed?
+ jp nz, .buttonAPressed
+.checkIfUpPressed
+ bit BIT_D_UP, a ; was Up pressed?
+ jr z, .checkIfDownPressed
+.upPressed ; scroll up one row
+ ld a, [wListScrollOffset]
+ and a
+ jp z, .loop
+ dec a
+ ld [wListScrollOffset], a
+ jp .loop
+
+.checkIfDownPressed
+ bit BIT_D_DOWN, a ; was Down pressed?
+ jr z, .checkIfRightPressed
+.downPressed ; scroll down one row
+ ld a, [wDexMaxSeenMon]
+ cp 7
+ jp c, .loop ; can't if the list is shorter than 7
+ sub 7
+ ld b, a
+ ld a, [wListScrollOffset]
+ cp b
+ jp z, .loop
+ inc a
+ ld [wListScrollOffset], a
+ jp .loop
+
+.checkIfRightPressed
+ bit BIT_D_RIGHT, a ; was Right pressed?
+ jr z, .checkIfLeftPressed
+.rightPressed ; scroll down 7 rows
+ ld a, [wDexMaxSeenMon]
+ cp 7
+ jp c, .loop ; can't if the list is shorter than 7
+ sub 6
+ ld b, a
+ ld a, [wListScrollOffset]
+ add 7
+ ld [wListScrollOffset], a
+ cp b
+ jp c, .loop
+ dec b
+ ld a, b
+ ld [wListScrollOffset], a
+ jp .loop
+
+.checkIfLeftPressed ; scroll up 7 rows
+ bit BIT_D_LEFT, a ; was Left pressed?
+ jr z, .buttonAPressed
+.leftPressed
+ ld a, [wListScrollOffset]
+ sub 7
+ ld [wListScrollOffset], a
+ jp nc, .loop
+ xor a
+ ld [wListScrollOffset], a
+ jp .loop
+
+.buttonAPressed
+ scf
+ ret
+
+.buttonBPressed
+ and a
+ ret
+
+Pokedex_DrawInterface:
xor a
ldh [hAutoBGTransferEnabled], a
; draw the horizontal line separating the seen and owned amounts from the menu
- hlcoord 15, 8
+ hlcoord 15, 6
ld a, "─"
ld [hli], a
ld [hli], a
@@ -175,26 +276,26 @@ HandlePokedexListMenu:
ld b, wPokedexSeenEnd - wPokedexSeen
call CountSetBits
ld de, wNumSetBits
- hlcoord 16, 3
+ hlcoord 16, 2
lb bc, 1, 3
call PrintNumber ; print number of seen pokemon
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld de, wNumSetBits
- hlcoord 16, 6
+ hlcoord 16, 5
lb bc, 1, 3
call PrintNumber ; print number of owned pokemon
- hlcoord 16, 2
+ hlcoord 16, 1
ld de, PokedexSeenText
call PlaceString
- hlcoord 16, 5
+ hlcoord 16, 4
ld de, PokedexOwnText
call PlaceString
hlcoord 1, 1
ld de, PokedexContentsText
call PlaceString
- hlcoord 16, 10
+ hlcoord 16, 8
ld de, PokedexMenuItemsText
call PlaceString
; find the highest pokedex number among the pokemon the player has seen
@@ -214,7 +315,37 @@ HandlePokedexListMenu:
.storeMaxSeenPokemon
ld a, b
ld [wDexMaxSeenMon], a
+ ret
+
+DrawPokedexVerticalLine:
+ ld c, 9 ; height of line
+ ld de, SCREEN_WIDTH ; width of screen
+ ld a, $71 ; vertical line tile
.loop
+ ld [hl], a
+ add hl, de
+ xor 1 ; toggle between vertical line tile and box tile
+ dec c
+ jr nz, .loop
+ ret
+
+PokedexSeenText:
+ db "SEEN@"
+
+PokedexOwnText:
+ db "OWN@"
+
+PokedexContentsText:
+ db "CONTENTS@"
+
+PokedexMenuItemsText:
+ db "DATA"
+ next "CRY"
+ next "AREA"
+ next "PRNT"
+ next "QUIT@"
+
+Pokedex_PlacePokemonList:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 4, 2
@@ -282,98 +413,8 @@ HandlePokedexListMenu:
ld a, 01
ldh [hAutoBGTransferEnabled], a
call Delay3
- call GBPalNormal
- call HandleMenuInput
- bit 1, a ; was the B button pressed?
- jp nz, .buttonBPressed
-.checkIfUpPressed
- bit 6, a ; was Up pressed?
- jr z, .checkIfDownPressed
-.upPressed ; scroll up one row
- ld a, [wListScrollOffset]
- and a
- jp z, .loop
- dec a
- ld [wListScrollOffset], a
- jp .loop
-.checkIfDownPressed
- bit 7, a ; was Down pressed?
- jr z, .checkIfRightPressed
-.downPressed ; scroll down one row
- ld a, [wDexMaxSeenMon]
- cp 7
- jp c, .loop ; can't if the list is shorter than 7
- sub 7
- ld b, a
- ld a, [wListScrollOffset]
- cp b
- jp z, .loop
- inc a
- ld [wListScrollOffset], a
- jp .loop
-.checkIfRightPressed
- bit 4, a ; was Right pressed?
- jr z, .checkIfLeftPressed
-.rightPressed ; scroll down 7 rows
- ld a, [wDexMaxSeenMon]
- cp 7
- jp c, .loop ; can't if the list is shorter than 7
- sub 6
- ld b, a
- ld a, [wListScrollOffset]
- add 7
- ld [wListScrollOffset], a
- cp b
- jp c, .loop
- dec b
- ld a, b
- ld [wListScrollOffset], a
- jp .loop
-.checkIfLeftPressed ; scroll up 7 rows
- bit 5, a ; was Left pressed?
- jr z, .buttonAPressed
-.leftPressed
- ld a, [wListScrollOffset]
- sub 7
- ld [wListScrollOffset], a
- jp nc, .loop
- xor a
- ld [wListScrollOffset], a
- jp .loop
-.buttonAPressed
- scf
- ret
-.buttonBPressed
- and a
- ret
-
-DrawPokedexVerticalLine:
- ld c, 9 ; height of line
- ld de, SCREEN_WIDTH
- ld a, $71 ; vertical line tile
-.loop
- ld [hl], a
- add hl, de
- xor 1 ; toggle between vertical line tile and box tile
- dec c
- jr nz, .loop
ret
-PokedexSeenText:
- db "SEEN@"
-
-PokedexOwnText:
- db "OWN@"
-
-PokedexContentsText:
- db "CONTENTS@"
-
-PokedexMenuItemsText:
- db "DATA"
- next "CRY"
- next "AREA"
- next "QUIT@"
-
; tests if a pokemon's bit is set in the seen or owned pokemon bit fields
; INPUT:
; [wd11e] = pokedex number
@@ -401,8 +442,11 @@ ShowPokedexDataInternal:
set 1, [hl]
ld a, $33 ; 3/7 volume
ldh [rNR50], a
+ ldh a, [hTileAnimations]
+ push af
+ xor a
+ ldh [hTileAnimations], a
call GBPalWhiteOut ; zero all palettes
- call ClearScreen
ld a, [wd11e] ; pokemon ID
ld [wcf91], a
push af
@@ -410,10 +454,42 @@ ShowPokedexDataInternal:
call RunPaletteCommand
pop af
ld [wd11e], a
- ldh a, [hTileAnimations]
- push af
- xor a
+ call DrawDexEntryOnScreen
+ call c, Pokedex_PrintFlavorTextAtRow11
+.waitForButtonPress
+ call JoypadLowSensitivity
+ ldh a, [hJoy5]
+ and A_BUTTON | B_BUTTON
+ jr z, .waitForButtonPress
+ pop af
ldh [hTileAnimations], a
+ call GBPalWhiteOut
+ call ClearScreen
+ call RunDefaultPaletteCommand
+ call LoadTextBoxTilePatterns
+ call GBPalNormal
+ ld hl, wd72c
+ res 1, [hl]
+ ld a, $77 ; max volume
+ ldh [rNR50], a
+ ret
+
+HeightWeightText:
+ db "HT ?′??″"
+ next "WT ???lb@"
+
+; XXX does anything point to this?
+PokeText:
+ db "#@"
+
+; horizontal line that divides the pokedex text description from the rest of the data
+PokedexDataDividerLine:
+ db $68, $69, $6B, $69, $6B, $69, $6B, $69, $6B, $6B
+ db $6B, $6B, $69, $6B, $69, $6B, $69, $6B, $69, $6A
+ db "@"
+
+DrawDexEntryOnScreen:
+ call ClearScreen
hlcoord 0, 0
ld de, 1
@@ -512,7 +588,8 @@ ShowPokedexDataInternal:
ld a, c
and a
- jp z, .waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description
+ ret z ; if the pokemon has not been owned, don't print the height, weight, or description
+
inc de ; de = address of feet (height)
ld a, [de] ; reads feet, but a is overwritten without being used
hlcoord 12, 6
@@ -565,43 +642,48 @@ ShowPokedexDataInternal:
ldh [hDexWeight], a ; restore original value of [hDexWeight]
pop hl
inc hl ; hl = address of pokedex description text
+ scf
+ ret
+
+Pokedex_PrintFlavorTextAtRow11:
bccoord 1, 11
+Pokedex_PrintFlavorTextAtBC:
ld a, %10
ldh [hClearLetterPrintingDelayFlags], a
call TextCommandProcessor ; print pokedex description text
xor a
ldh [hClearLetterPrintingDelayFlags], a
-.waitForButtonPress
- call JoypadLowSensitivity
- ldh a, [hJoy5]
- and A_BUTTON | B_BUTTON
- jr z, .waitForButtonPress
- pop af
- ldh [hTileAnimations], a
- call GBPalWhiteOut
- call ClearScreen
- call RunDefaultPaletteCommand
- call LoadTextBoxTilePatterns
- call GBPalNormal
- ld hl, wd72c
- res 1, [hl]
- ld a, $77 ; max volume
- ldh [rNR50], a
ret
-HeightWeightText:
- db "HT ?′??″"
- next "WT ???lb@"
-
-; XXX does anything point to this?
-PokeText:
- db "#@"
-
-; horizontal line that divides the pokedex text description from the rest of the data
-PokedexDataDividerLine:
- db $68, $69, $6B, $69, $6B, $69, $6B, $69, $6B, $6B
- db $6B, $6B, $69, $6B, $69, $6B, $69, $6B, $69, $6A
- db "@"
+Pokedex_PrepareDexEntryForPrinting:
+ hlcoord 0, 0
+ ld de, SCREEN_WIDTH
+ lb bc, $66, $d
+ call DrawTileLine
+ hlcoord 19, 0
+ ld b, $67
+ call DrawTileLine
+ hlcoord 0, 13
+ ld de, $1
+ lb bc, $6f, SCREEN_WIDTH
+ call DrawTileLine
+ ld a, $6c
+ ldcoord_a 0, 13
+ ld a, $6e
+ ldcoord_a 19, 13
+ ld a, [wPrinterPokedexEntryTextPointer]
+ ld l, a
+ ld a, [wPrinterPokedexEntryTextPointer + 1]
+ ld h, a
+ bccoord 1, 1
+ ldh a, [hUILayoutFlags]
+ set 3, a
+ ldh [hUILayoutFlags], a
+ call Pokedex_PrintFlavorTextAtBC
+ ldh a, [hUILayoutFlags]
+ res 3, a
+ ldh [hUILayoutFlags], a
+ ret
; draws a line of tiles
; INPUT:
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index 07eb5acb..aab29b20 100644
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -32,10 +32,8 @@ FileDataDestroyedText:
text_end
LoadSAV0:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, sPlayerName ; hero name located in SRAM
ld bc, sMainDataCheckSum - sPlayerName ; but here checks the full SAV
@@ -79,10 +77,8 @@ LoadSAV0:
jp SAVGoodChecksum
LoadSAV1:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, sPlayerName ; hero name located in SRAM
ld bc, sMainDataCheckSum - sPlayerName ; but here checks the full SAV
@@ -99,10 +95,8 @@ LoadSAV1:
jp SAVGoodChecksum
LoadSAV2:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, sPlayerName ; hero name located in SRAM
ld bc, sMainDataCheckSum - sPlayerName ; but here checks the full SAV
@@ -126,9 +120,7 @@ SAVBadCheckSum:
scf
SAVGoodChecksum:
- ld a, $0
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
LoadSAVIgnoreBadCheckSum:
@@ -139,12 +131,16 @@ LoadSAVIgnoreBadCheckSum:
SaveSAV:
farcall PrintSaveScreenText
+ ld c, 10
+ call DelayFrames
ld hl, WouldYouLikeToSaveText
call SaveSAVConfirm
and a ;|0 = Yes|1 = No|
ret nz
+ ld c, 10
+ call DelayFrames
ld a, [wSaveFileStatus]
- dec a
+ cp $1
jr z, .save
call SAVCheckRandomID
jr z, .save
@@ -154,24 +150,20 @@ SaveSAV:
ret nz
.save
call SaveSAVtoSRAM
- hlcoord 1, 13
- lb bc, 4, 18
- call ClearScreenArea
- hlcoord 1, 14
- ld de, NowSavingString
- call PlaceString
- ld c, 120
+ ld hl, SavingText
+ call PrintText
+ ld c, 128
call DelayFrames
ld hl, GameSavedText
call PrintText
+ ld c, 10
+ call DelayFrames
ld a, SFX_SAVE
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
ld c, 30
- jp DelayFrames
-
-NowSavingString:
- db "Now saving...@"
+ call DelayFrames
+ ret
SaveSAVConfirm:
call PrintText
@@ -187,6 +179,10 @@ WouldYouLikeToSaveText:
text_far _WouldYouLikeToSaveText
text_end
+SavingText:
+ text_far _SavingText
+ text_end
+
GameSavedText:
text_far _GameSavedText
text_end
@@ -196,10 +192,8 @@ OlderFileWillBeErasedText:
text_end
SaveSAVtoSRAM0:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, wPlayerName
ld de, sPlayerName
@@ -223,17 +217,13 @@ SaveSAVtoSRAM0:
ld bc, sMainDataCheckSum - sPlayerName
call SAVCheckSum
ld [sMainDataCheckSum], a
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
SaveSAVtoSRAM1:
; stored pokémon
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, wBoxDataStart
ld de, sCurBoxData
@@ -243,16 +233,12 @@ SaveSAVtoSRAM1:
ld bc, sMainDataCheckSum - sPlayerName
call SAVCheckSum
ld [sMainDataCheckSum], a
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
SaveSAVtoSRAM2:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $1
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld hl, wPartyDataStart
ld de, sPartyData
@@ -262,13 +248,18 @@ SaveSAVtoSRAM2:
ld de, sMainData
ld bc, wPokedexSeenEnd - wPokedexOwned
call CopyData
+ ld hl, wPikachuHappiness
+ ld de, sMainData + $179
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hl]
+ ld [de], a
ld hl, sPlayerName
ld bc, sMainDataCheckSum - sPlayerName
call SAVCheckSum
ld [sMainDataCheckSum], a
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
SaveSAVtoSRAM::
@@ -358,6 +349,9 @@ ChangeBox::
res 1, [hl]
bit 1, a ; pressed b
ret nz
+ ld a, $b6
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
call GetBoxSRAMLocation
ld e, l
ld d, h
@@ -380,9 +374,6 @@ ChangeBox::
call SaveSAVtoSRAM
ld hl, wChangeBoxSavedMapTextPointer
call SetMapTextPointer
- ld a, SFX_SAVE
- call PlaySoundWaitForCurrent
- call WaitForSoundToFinish
ret
WhenYouChangeBoxText:
@@ -392,10 +383,7 @@ WhenYouChangeBoxText:
CopyBoxToOrFromSRAM:
; copy an entire box from hl to de with b as the SRAM bank
push hl
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- ld a, $1
- ld [MBC1SRamBankingMode], a
+ call EnableSRAMAndLatchClockData
ld a, b
ld [MBC1SRamBank], a
ld bc, wBoxDataEnd - wBoxDataStart
@@ -413,9 +401,7 @@ CopyBoxToOrFromSRAM:
call SAVCheckSum
ld [sBank2AllBoxesChecksum], a ; sBank3AllBoxesChecksum
call CalcIndividualBoxCheckSums
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
DisplayChangeBoxMenu:
@@ -436,14 +422,12 @@ DisplayChangeBoxMenu:
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
hlcoord 0, 0
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
ld hl, ChooseABoxText
call PrintText
hlcoord 11, 0
- ld b, 12
- ld c, 7
+ lb bc, 12, 7
call TextBoxBorder
ld hl, hUILayoutFlags
set 2, [hl]
@@ -513,19 +497,14 @@ BoxNoText:
EmptyAllSRAMBoxes:
; marks all boxes in SRAM as empty (initialisation for the first time the
; player changes the box)
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- ld a, $1
- ld [MBC1SRamBankingMode], a
+ call EnableSRAMAndLatchClockData
ld a, 2
ld [MBC1SRamBank], a
call EmptySRAMBoxesInBank
ld a, 3
ld [MBC1SRamBank], a
call EmptySRAMBoxesInBank
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
EmptySRAMBoxesInBank:
@@ -559,19 +538,14 @@ EmptySRAMBox:
GetMonCountsForAllBoxes:
ld hl, wBoxMonCounts
push hl
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- ld a, $1
- ld [MBC1SRamBankingMode], a
+ call EnableSRAMAndLatchClockData
ld a, $2
ld [MBC1SRamBank], a
call GetMonCountsForBoxesInBank
ld a, $3
ld [MBC1SRamBank], a
call GetMonCountsForBoxesInBank
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
pop hl
; copy the count for the current box from WRAM
@@ -604,10 +578,8 @@ SAVCheckRandomID:
; checks if Sav file is the same by checking player's name 1st letter
; and the two random numbers generated at game beginning
; (which are stored at wPlayerID)s
- ld a, $0a
- ld [MBC1SRamEnable], a
+ call EnableSRAMAndLatchClockData
ld a, $01
- ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
ld a, [sPlayerName]
and a
@@ -670,34 +642,23 @@ LoadHallOfFameTeams:
; fallthrough
HallOfFame_Copy:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- ld a, $1
- ld [MBC1SRamBankingMode], a
+ call EnableSRAMAndLatchClockData
xor a
ld [MBC1SRamBank], a
call CopyData
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ call DisableSRAMAndPrepareClockData
ret
ClearSAV:
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- ld a, $1
- ld [MBC1SRamBankingMode], a
- xor a
- call PadSRAM_FF
- ld a, $1
- call PadSRAM_FF
- ld a, $2
- call PadSRAM_FF
- ld a, $3
+ call EnableSRAMAndLatchClockData
+ ld a, $4
+.loop
+ dec a
+ push af
call PadSRAM_FF
- xor a
- ld [MBC1SRamBankingMode], a
- ld [MBC1SRamEnable], a
+ pop af
+ jr nz, .loop
+ call DisableSRAMAndPrepareClockData
ret
PadSRAM_FF:
@@ -706,3 +667,16 @@ PadSRAM_FF:
ld bc, SRAM_End - SRAM_Begin
ld a, $ff
jp FillMemory
+
+EnableSRAMAndLatchClockData:
+ ld a, $1
+ ld [MBC1SRamBankingMode], a
+ ld a, SRAM_ENABLE
+ ld [MBC1SRamEnable], a
+ ret
+
+DisableSRAMAndPrepareClockData:
+ ld a, SRAM_DISABLE
+ ld [MBC1SRamBankingMode], a
+ ld [MBC1SRamEnable], a
+ ret
diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm
index c0448121..05a1fa56 100644
--- a/engine/menus/start_sub_menus.asm
+++ b/engine/menus/start_sub_menus.asm
@@ -144,11 +144,14 @@ StartMenu_Pokemon::
call ChooseFlyDestination
ld a, [wd732]
bit 3, a ; did the player decide to fly?
- jp nz, .goBackToMap
+ jr nz, .asm_5d4c
call LoadFontTilePatterns
ld hl, wd72e
set 1, [hl]
jp StartMenu_Pokemon
+.asm_5d4c
+ call Func_1510
+ jp .goBackToMap
.cut
bit BIT_CASCADEBADGE, a
jp z, .newBadgeRequired
@@ -165,15 +168,28 @@ StartMenu_Pokemon::
bit 1, [hl]
res 1, [hl]
jp z, .loop
+ ld a, [wcf91]
+ cp STARTER_PIKACHU
+ jr z, .surfingPikachu
+ ld a, $1
+ jr .continue
+.surfingPikachu
+ ld a, $2
+.continue
+ ld [wd473], a
ld a, SURFBOARD
ld [wcf91], a
ld [wPseudoItemID], a
call UseItem
ld a, [wActionResultOrTookBattleTurn]
and a
- jp z, .loop
+ jr z, .reloadNormalSprite
call GBPalWhiteOutWithDelay3
jp .goBackToMap
+.reloadNormalSprite
+ xor a
+ ld [wd473], a
+ jp .loop
.strength
bit BIT_RAINBOWBADGE, a
jp z, .newBadgeRequired
@@ -217,6 +233,7 @@ StartMenu_Pokemon::
ld hl, wd732
set 3, [hl]
set 6, [hl]
+ call Func_1510
ld hl, wd72e
set 1, [hl]
res 4, [hl]
@@ -307,11 +324,11 @@ StartMenu_Item::
call PrintText
jr .exitMenu
.notInCableClubRoom
- ld bc, wNumBagItems
+ ; store item bag pointer in wListPointer (for DisplayListMenuID)
ld hl, wListPointer
- ld a, c
- ld [hli], a
- ld [hl], b ; store item bag pointer in wListPointer (for DisplayListMenuID)
+ ld [hl], LOW(wNumBagItems)
+ inc hl
+ ld [hl], HIGH(wNumBagItems)
xor a
ld [wPrintItemPrices], a
ld a, ITEMLISTMENU
@@ -469,10 +486,11 @@ StartMenu_TrainerInfo::
call LoadScreenTilesFromBuffer2 ; restore saved screen
call RunDefaultPaletteCommand
call ReloadMapData
+ farcall DrawStartMenu ; XXX what difference does this make?
call LoadGBPal
pop af
ldh [hTileAnimations], a
- jp RedisplayStartMenu
+ jp RedisplayStartMenu_DoNotDrawStartMenu
; loads tile patterns and draws everything except for gym leader faces / badges
DrawTrainerInfo:
@@ -506,7 +524,7 @@ DrawTrainerInfo:
ld de, vChars2 tile $20
ld bc, 8 * 8 tiles
ld a, BANK(GymLeaderFaceAndBadgeTileGraphics)
- call FarCopyData2
+ call FarCopyData
ld hl, TextBoxGraphics
ld de, 13 tiles
add hl, de ; hl = colon tile pattern
@@ -514,7 +532,7 @@ DrawTrainerInfo:
ld bc, 1 tiles
ld a, BANK(TextBoxGraphics)
push bc
- call FarCopyData2
+ call FarCopyData
pop bc
ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern
ld de, vChars1 tile $57
@@ -566,7 +584,7 @@ DrawTrainerInfo:
TrainerInfo_FarCopyData:
ld a, BANK(TrainerInfoTextBoxTileGraphics)
- jp FarCopyData2
+ jp FarCopyData
TrainerInfo_NameMoneyTimeText:
db "NAME/"
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index 5253ec48..7a315af2 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -134,8 +134,7 @@ DisplayMoneyBox:
ld [wTextBoxID], a
call DisplayTextBoxID
hlcoord 13, 1
- ld b, 1
- ld c, 6
+ lb bc, 1, 6
call ClearScreenArea
hlcoord 12, 1
ld de, wPlayerMoney
@@ -277,36 +276,10 @@ DisplayTwoOptionMenu:
pop hl
add hl, bc
call PlaceString
- ld hl, wd730
- res 6, [hl] ; turn on the printing delay
- ld a, [wTwoOptionMenuID]
- cp NO_YES_MENU
- jr nz, .notNoYesMenu
-; No/Yes menu
-; this menu type ignores the B button
-; it only seems to be used when confirming the deletion of a save file
- xor a
- ld [wTwoOptionMenuID], a
- ld a, [wFlags_0xcd60]
- push af
- push hl
- ld hl, wFlags_0xcd60
- bit 5, [hl]
- set 5, [hl] ; don't play sound when A or B is pressed in menu
- pop hl
-.noYesMenuInputLoop
- call HandleMenuInput
- bit 1, a ; A button pressed?
- jr nz, .noYesMenuInputLoop ; try again if A was not pressed
- pop af
- pop hl
- ld [wFlags_0xcd60], a
- ld a, SFX_PRESS_AB
- call PlaySound
- jr .pressedAButton
-.notNoYesMenu
xor a
ld [wTwoOptionMenuID], a
+ ld hl, wd730
+ res 6, [hl] ; turn on the printing delay
call HandleMenuInput
pop hl
bit 1, a ; A button pressed?
@@ -395,8 +368,7 @@ DisplayFieldMoveMonMenu:
; no field moves
hlcoord 11, 11
- ld b, 5
- ld c, 7
+ lb bc, 5, 7
call TextBoxBorder
call UpdateSprites
ld a, 12
diff --git a/engine/menus/unused_input.asm b/engine/menus/unused_input.asm
new file mode 100644
index 00000000..ad5c36df
--- /dev/null
+++ b/engine/menus/unused_input.asm
@@ -0,0 +1,129 @@
+HandleMenuInputDuplicate: ; unreferenced
+ xor a
+ ld [wPartyMenuAnimMonEnabled], a
+
+HandleMenuInputPokemonSelectionDuplicate: ; unreferenced
+ ldh a, [hDownArrowBlinkCount1]
+ push af
+ ldh a, [hDownArrowBlinkCount2]
+ push af ; save existing values on stack
+ xor a
+ ldh [hDownArrowBlinkCount1], a ; blinking down arrow timing value 1
+ ld a, 6
+ ldh [hDownArrowBlinkCount2], a ; blinking down arrow timing value 2
+.loop1
+ xor a
+ ld [wAnimCounter], a ; counter for pokemon shaking animation
+ call PlaceMenuCursorDuplicate
+ call JoypadLowSensitivity
+ ldh a, [hJoy5]
+ and a ; was a key pressed?
+ jr nz, .keyPressed
+ pop af
+ ldh [hDownArrowBlinkCount2], a
+ pop af
+ ldh [hDownArrowBlinkCount1], a ; restore previous values
+ xor a
+ ld [wMenuWrappingEnabled], a ; disable menu wrapping
+ ret
+.keyPressed
+ xor a
+ ld [wCheckFor180DegreeTurn], a
+ ldh a, [hJoy5]
+ ld b, a
+ bit 6, a ; pressed Up key?
+ jr z, .checkIfDownPressed
+.upPressed
+ ld a, [wCurrentMenuItem] ; selected menu item
+ and a ; already at the top of the menu?
+ jr z, .checkOtherKeys
+.notAtTop
+ dec a
+ ld [wCurrentMenuItem], a ; move selected menu item up one space
+ jr .checkOtherKeys
+.checkIfDownPressed
+ bit 7, a
+ jr z, .checkOtherKeys
+.downPressed
+ ld a, [wCurrentMenuItem]
+ inc a
+ ld c, a
+ ld a, [wMaxMenuItem]
+ cp c
+ jr c, .checkOtherKeys
+ ld a, c
+ ld [wCurrentMenuItem], a
+.checkOtherKeys
+ ld a, [wMenuWatchedKeys]
+ and b ; does the menu care about any of the pressed keys?
+ jp z, .loop1
+.checkIfAButtonOrBButtonPressed
+ ldh a, [hJoy5]
+ and A_BUTTON | B_BUTTON
+ jr z, .skipPlayingSound
+.AButtonOrBButtonPressed
+ ld a, SFX_PRESS_AB
+ call PlaySound ; play sound
+.skipPlayingSound
+ pop af
+ ldh [hDownArrowBlinkCount2], a
+ pop af
+ ldh [hDownArrowBlinkCount1], a ; restore previous values
+ ldh a, [hJoy5]
+ ret
+
+PlaceMenuCursorDuplicate:
+ ld a, [wTopMenuItemY]
+ and a
+ jr z, .asm_f5ac0
+ hlcoord 0, 0
+ ld bc, SCREEN_WIDTH
+.loop
+ add hl, bc
+ dec a
+ jr nz, .loop
+.asm_f5ac0
+ ld a, [wTopMenuItemX]
+ ld b, $0
+ ld c, a
+ add hl, bc
+ push hl
+ ld a, [wLastMenuItem]
+ and a
+ jr z, .asm_f5ad5
+ ld bc, $28
+.loop2
+ add hl, bc
+ dec a
+ jr nz, .loop2
+.asm_f5ad5
+ ld a, [hl]
+ cp "▶"
+ jr nz, .asm_f5ade
+ ld a, [wTileBehindCursor]
+ ld [hl], a
+.asm_f5ade
+ pop hl
+ ld a, [wCurrentMenuItem]
+ and a
+ jr z, .asm_f5aec
+ ld bc, $28
+.loop3
+ add hl, bc
+ dec a
+ jr nz, .loop3
+.asm_f5aec
+ ld a, [hl]
+ cp "▶"
+ jr z, .asm_f5af4
+ ld [wTileBehindCursor], a
+.asm_f5af4
+ ld a, "▶"
+ ld [hl], a
+ ld a, l
+ ld [wMenuCursorLocation], a
+ ld a, h
+ ld [wMenuCursorLocation + 1], a
+ ld a, [wCurrentMenuItem]
+ ld [wLastMenuItem], a
+ ret
diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm
new file mode 100644
index 00000000..e554b14a
--- /dev/null
+++ b/engine/minigame/surfing_pikachu.asm
@@ -0,0 +1,2863 @@
+SurfingPikachuMinigame::
+ call SurfingPikachuMinigame_BlankPals
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ ldh a, [hTileAnimations]
+ push af
+ xor a
+ ldh [hTileAnimations], a
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $f
+ ldh [rIE], a
+ ld a, $8
+ ldh [rSTAT], a
+ ldh a, [hAutoBGTransferDest + 1]
+ push af
+ ld a, $98
+ ldh [hAutoBGTransferDest + 1], a
+ call SurfingPikachuMinigameIntro
+ call SurfingPikachuLoop
+ xor a
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ call ClearObjectAnimationBuffers
+ call ClearSprites
+ xor a
+ ldh [hLCDCPointer], a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ld a, $90
+ ldh [hWY], a
+ call DelayFrame
+ pop af
+ ldh [hAutoBGTransferDest + 1], a
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ xor a
+ ldh [rSTAT], a
+ call RunDefaultPaletteCommand
+ call ReloadMapAfterSurfingMinigame
+ call PlayDefaultMusic
+ call GBPalNormal
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop af
+ ldh [hTileAnimations], a
+ ret
+
+SurfingPikachuLoop:
+ call SurfingPikachuMinigame_LoadGFXAndLayout
+ call DelayFrame
+ ld b, $e
+ call RunPaletteCommand
+.loop
+ ld a, [wSurfingMinigameRoutineNumber]
+ bit 7, a
+ ret nz
+ call SurfingPikachu_GetJoypad_3FrameBuffer
+ call SurfingPikachu_CheckPressedSelect
+ ret nz
+ call RunSurfingMinigameRoutine
+ ld a, $3c
+ ld [wCurrentAnimatedObjectOAMBufferOffset], a
+ call RunObjectAnimations
+ call SurfingMinigame_MoveClouds
+ call .DelayFrame
+ call SurfingMinigame_UpdateMusicTempo
+ jr .loop
+
+.DelayFrame:
+ call DelayFrame
+ ret
+
+SurfingPikachu_CheckPressedSelect:
+ ld hl, wd492
+ bit 1, [hl]
+ ret z
+ ldh a, [hJoyPressed]
+ and SELECT
+ ret
+
+Func_f80b7:
+ ldh a, [hJoyPressed]
+ and START
+ ret z
+ ld hl, wc5e2
+ ld a, [hl]
+ xor $1
+ ld [hl], a
+ ret
+
+SurfingMinigame_UpdateMusicTempo:
+ ld a, [wc634]
+ and a
+ ret z
+
+ ; check that all channels are on their last frame of note delay
+ ld hl, wChannelNoteDelayCounters
+ ld a, $1
+ cp [hl]
+ ret nz
+ inc hl
+ cp [hl]
+ ret nz
+ inc hl
+ cp [hl]
+ ret nz
+
+ ; de = ([wSurfingMinigamePikachuSpeed] & 0x3f) * 2
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld e, a
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ and $3
+ ld d, a
+ sla e
+ rl d
+ ld e, d
+ ld d, $0
+ ld hl, .Tempos
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld [wMusicTempo + 1], a
+ ld a, [hl]
+ ld [wMusicTempo], a
+ ret
+
+.Tempos:
+ dw 117
+ dw 109
+ dw 101
+ dw 93
+ dw 85
+
+SurfingMinigame_ResetMusicTempo:
+ ld hl, wChannelNoteDelayCounters
+ ld a, $1
+ cp [hl]
+ ret nz
+ inc hl
+ cp [hl]
+ ret nz
+ inc hl
+ cp [hl]
+ ret nz
+ ld a, 117
+ ld [wMusicTempo + 1], a
+ xor a
+ ld [wMusicTempo], a
+ ret
+
+SurfingPikachuMinigame_LoadGFXAndLayout:
+ call SurfingPikachu_ClearTileMap
+ call ClearSprites
+ call DisableLCD
+ ld hl, wSurfingMinigameData
+ ld bc, wSurfingMinigameDataEnd - wSurfingMinigameData
+ xor a
+ call FillMemory
+ ld hl, wLYOverrides
+ ld bc, wLYOverridesBufferEnd - wLYOverrides
+ xor a
+ call FillMemory
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call ClearObjectAnimationBuffers
+
+ ld hl, SurfingPikachu1Graphics1
+ ld de, $9000
+ ld bc, $500
+ ld a, BANK(SurfingPikachu1Graphics1)
+ call FarCopyData
+
+ ld hl, SurfingPikachu1Graphics2
+ ld de, $8000
+ ld bc, $1000
+ ld a, BANK(SurfingPikachu1Graphics2)
+ call FarCopyData
+
+ ld a, LOW(SurfingPikachuSpawnStateDataPointer)
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, HIGH(SurfingPikachuSpawnStateDataPointer)
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+
+ ld a, LOW(SurfingPikachuObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, HIGH(SurfingPikachuObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer + 1], a
+
+ ld a, LOW(SurfingPikachuOAMData)
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, HIGH(SurfingPikachuOAMData)
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+
+ ld a, LOW(SurfingPikachuFrames)
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, HIGH(SurfingPikachuFrames)
+ ld [wAnimatedObjectFramesDataPointer + 1], a
+
+ ld hl, vBGMap0
+ ld bc, $80 tiles
+ ld a, $0
+ call FillMemory
+
+ ld hl, $98c0
+ ld bc, $18 tiles
+ ld a, $b
+ call FillMemory
+
+ ld a, $1
+ lb de, $74, $58
+ call SpawnAnimatedObject
+
+ ld a, $74
+ ld [wSurfingMinigamePikachuObjectHeight], a
+
+ call SurfingMinigame_InitScanlineOverrides
+
+ xor a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ld a, $7e
+ ldh [hWY], a
+ ld a, rSCY - $ff00
+ ldh [hLCDCPointer], a
+ ld a, $40
+ ld [wSurfingMinigamePikachuSpeed], a
+ xor a
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ xor a
+ ld [wSurfingMinigamePikachuHP], a
+ ld a, $60
+ ld [wSurfingMinigamePikachuHP + 1], a
+ ld hl, wSurfingMinigameWaveHeight
+ ld bc, $14
+ ld a, $74
+ call FillMemory
+ call Func_f81ff
+ call Func_f8256
+ ld a, $e3
+ ldh [rLCDC], a
+ call SurfingPikachuMinigame_SetBGPals
+ ld a, $e4
+ ldh [rOBP0], a
+ ld a, $e0
+ ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+SurfingPikachuMinigame_SetBGPals:
+ ld a, [wOnSGB]
+ and a
+ jr nz, .sgb
+ ld a, $d0
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ ret
+
+.sgb
+ ld a, $e4
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ ret
+
+Func_f81ff:
+ ld hl, wSpriteDataEnd
+ ld de, Unkn_f8249
+ ld b, $97
+ ld c, $80
+ ld a, $4
+ call Func_f8233
+ ld de, Unkn_f8248
+ ld b, $96
+ ld c, $50
+ ld a, $1
+ call Func_f8233
+ ld de, Unkn_f824d
+ ld b, $14
+ ld c, $20
+ ld a, $5
+ call Func_f8233
+ ld de, Unkn_f8252
+ ld b, $20
+ ld c, $80
+ ld a, $4
+ call Func_f8233
+ ret
+
+Func_f8233:
+.asm_f8233
+ push af
+ ld [hl], b
+ inc hl
+ ld [hl], c
+ inc hl
+ ld a, [de]
+ ld [hl], a
+ inc hl
+ ld [hl], $0
+ inc hl
+ ld a, c
+ add $8
+ ld c, a
+ inc de
+ pop af
+ dec a
+ jr nz, .asm_f8233
+ ret
+
+Unkn_f8248:
+ db $fe
+
+Unkn_f8249:
+ db $d0
+ db $d0
+ db $d0
+ db $d0
+
+Unkn_f824d:
+ db $ec
+ db $ed
+ db $ed
+ db $ee
+ db $ef
+
+Unkn_f8252:
+ db $ec
+ db $ed
+ db $ee
+ db $ef
+
+Func_f8256:
+ ld de, $9c21
+ ld hl, Unkn_f8279
+ ld c, $9
+.asm_f825e
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .asm_f825e
+ ld hl, $9c01
+ ld [hl], $15
+ ld hl, $9c02
+ ld [hl], $16
+ ld hl, $9c2c
+ ld [hl], $1b
+ ld hl, $9c2d
+ ld [hl], $1c
+ ret
+
+Unkn_f8279:
+ db $17
+ db $18
+ db $19
+ db $19
+ db $19
+ db $19
+ db $19
+ db $19
+ db $19
+
+RunSurfingMinigameRoutine:
+ ld a, [wSurfingMinigameRoutineNumber]
+ ld e, a
+ ld d, $0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.Jumptable:
+ dw SurfingMinigameRoutine_SpawnPikachu ; 0
+ dw SurfingMinigame_RunGame ; 1
+ dw Func_f8324 ; 2
+ dw Func_f835c ; 3
+ dw SurfingMinigame_DrawResultsScreenAndWait ; 4
+ dw SurfingMinigame_WriteHPLeftAndWait ; 5
+ dw SurfingMinigame_WriteRadnessAndWait ; 6
+ dw SurfingMinigame_WriteTotalAndWait ; 7
+ dw SurfingMinigame_AddRemainingHPToTotalAndWait ; 8
+ dw SurfingMinigame_AddRadnessToTotalAndWait ; 9
+ dw SurfingMinigame_WaitLast ; a
+ dw SurfingMinigame_ExitOnPressA ; b
+ dw SurfingMinigame_GameOver ; c
+
+SurfingMinigameRoutine_SpawnPikachu:
+ ld a, $2
+ lb de, $48, $e0
+ call SpawnAnimatedObject
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ld a, $1
+ ld [wc634], a
+ ret
+
+SurfingMinigame_RunGame:
+ ld a, [wc5e5]
+ cp $18
+ jr nc, .asm_f82e8
+ ld hl, wSurfingMinigamePikachuHP
+ ld a, [hli]
+ or [hl]
+ and a
+ jr z, .dead
+ call Random
+ ld [wc5d5], a
+ call SurfingMinigame_UpdateLYOverrides
+ call SurfingMinigame_SetPikachuHeight
+ call SurfingMinigame_ReadBGMapBuffer
+ call SurfingMinigame_ScrollAndGenerateBGMap
+ call SurfingMinigame_UpdatePikachuDistance
+ call SurfingMinigame_Deduct1HP
+ call SurfingMinigame_DrawHP
+ ret
+
+.asm_f82e8
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ xor a
+ ld [wc634], a
+ ld a, 192
+ ld [wSurfingMinigameRoutineDelay], a
+ ret
+
+.dead
+ ld a, $1
+ ld [wc630], a
+ ld a, $c
+ ld [wSurfingMinigameRoutineNumber], a
+ ld a, $80
+ ld [wc631], a
+ ld a, $b
+ lb de, $88, $58
+ call SpawnAnimatedObject
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], $80
+ ld hl, ANIM_OBJ_FIELD_B
+ add hl, bc
+ ld [hl], $80
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], $30
+ xor a
+ ld [wc634], a
+ ret
+
+Func_f8324:
+ call SurfingMinigame_RunDelayTimer
+ jr c, .done_delay
+ xor a
+ ld [wc5d5], a
+ call SurfingMinigame_UpdateLYOverrides
+ call SurfingMinigame_SetPikachuHeight
+ call SurfingMinigame_ReadBGMapBuffer
+ call Func_f8c97
+ call SurfingMinigame_ResetMusicTempo
+ ret
+
+.done_delay
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ld a, $90
+ ldh [hSCX], a
+ ld a, $72
+ ld [wSurfingMinigameWaveFunctionNumber], a
+ ld a, $4
+ ld [wc5d2], a
+ xor a
+ ldh [hLCDCPointer], a
+ ld [wSurfingMinigameSCX], a
+ ld [wSurfingMinigameSCX2], a
+ ld [wSurfingMinigameSCXHi], a
+ ret
+
+Func_f835c:
+ ldh a, [hSCX]
+ and a
+ jr z, .asm_f837b
+ call SurfingMinigame_UpdateLYOverrides
+ call SurfingMinigame_SetPikachuHeight
+ call SurfingMinigame_ReadBGMapBuffer
+ ldh a, [hSCX]
+ dec a
+ dec a
+ dec a
+ dec a
+ ldh [hSCX], a
+ ld a, $e0
+ ld [wSurfingMinigameXOffset], a
+ call SurfingMinigame_GenerateBGMap
+ ret
+
+.asm_f837b
+ xor a
+ ld [wSurfingMinigamePikachuSpeed], a
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ld a, $5
+ ld [wc5d2], a
+ ret
+
+SurfingMinigame_DrawResultsScreenAndWait:
+ call SurfingMinigame_DrawResultsScreen
+ ld a, 32
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_WriteHPLeftAndWait:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ call SurfingMinigame_WriteHPLeft
+ ld a, 64
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_WriteRadnessAndWait:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ call SurfingMinigame_WriteRadness
+ ld a, 64
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_WriteTotalAndWait:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ call SurfingMinigame_WriteTotal
+ ld a, 64
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_AddRemainingHPToTotalAndWait:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ call SurfingMinigame_AddRemainingHPToTotal
+ push af
+ call SurfingMinigame_BCDPrintTotalScore
+ pop af
+ ret nc
+ ld a, 64
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_AddRadnessToTotalAndWait:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ call SurfingMinigame_AddRadnessToTotal
+ push af
+ call SurfingMinigame_BCDPrintTotalScore
+ pop af
+ ret nc
+ ld a, 128
+ ld [wSurfingMinigameRoutineDelay], a
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ call DidPlayerGetAHighScore
+ ret nc
+ call SurfingMinigame_PrintTextHiScore
+ ld a, $6
+ ld [wc5d2], a
+ ret
+
+SurfingMinigame_WaitLast:
+ call SurfingMinigame_RunDelayTimer
+ ret nc
+ ld hl, wSurfingMinigameRoutineNumber
+ inc [hl]
+ ret
+
+SurfingMinigame_ExitOnPressA:
+ call SurfingMinigame_UpdateLYOverrides
+ ldh a, [hJoyPressed]
+ and A_BUTTON
+ ret z
+ ld hl, wSurfingMinigameRoutineNumber
+ set 7, [hl]
+ ret
+
+SurfingMinigame_GameOver:
+ call SurfingMinigame_UpdateLYOverrides
+ call SurfingMinigame_SetPikachuHeight
+ call SurfingMinigame_ReadBGMapBuffer
+ call SurfingMinigame_ScrollAndGenerateBGMap
+ call SurfingMinigame_ResetMusicTempo
+ ld hl, wc631
+ ld a, [hl]
+ and a
+ jr z, .wait_press_a
+ dec [hl]
+ ret
+
+.wait_press_a
+ ldh a, [hJoyPressed]
+ and A_BUTTON
+ ret z
+ ld hl, wSurfingMinigameRoutineNumber
+ set 7, [hl]
+ ret
+
+SurfingMinigame_RunDelayTimer:
+ ld hl, wSurfingMinigameRoutineDelay
+ ld a, [hl]
+ and a
+ jr z, .set_carry
+ dec [hl]
+ and a
+ ret
+
+.set_carry
+ scf
+ ret
+
+SurfingMinigame_UpdatePikachuDistance:
+ ld a, [wc5e5 + 1]
+ ld h, a
+ ld a, [wc5e5 + 2]
+ ld l, a
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld e, a
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ ld d, a
+ add hl, de
+ ld a, h
+ ld [wc5e5 + 1], a
+ ld a, l
+ ld [wc5e5 + 2], a
+ ret nc
+ ld hl, wc5e5
+ inc [hl]
+ ld hl, wOAMBuffer + 4 * 4 + 1
+ dec [hl]
+ dec [hl]
+ ret
+
+SurfingMinigameAnimatedObjectFn_Pikachu:
+ ld a, [wc5d2]
+ ld e, a
+ ld d, $0
+ ld hl, Jumptable_f847f
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+Jumptable_f847f:
+ dw Func_f848d
+ dw SurfingMinigame_ScoreCurrentWave
+ dw Func_f8516
+ dw Func_f8545
+ dw Func_f8561
+ dw Func_f856d
+ dw Func_f8579
+
+Func_f848d:
+ ld a, [wc630]
+ and a
+ jr nz, .asm_f84d2
+ call Func_f87b5
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], a
+ call Func_f871e
+ jr c, .splash
+ call Func_f8742
+ call SurfingMinigame_SpeedUpPikachu
+ ret
+
+.splash
+ call Func_f8742
+ ld a, $1 ; on a wave
+ ld [wc5d2], a
+ xor a
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], a
+ ld hl, ANIM_OBJ_FIELD_D
+ add hl, bc
+ ld [hl], a
+ ld hl, ANIM_OBJ_FIELD_E
+ add hl, bc
+ ld [hl], a
+ ld [wSurfingMinigameRadnessMeter], a
+ ld [wSurfingMinigameTrickFlags], a
+ xor a
+ ld [wChannelSoundIDs + Ch8], a
+ ld a, SFX_SURFING_JUMP
+ call PlaySound
+ ret
+
+.asm_f84d2
+ xor a
+ ld [wSurfingMinigamePikachuSpeed], a
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ ld a, $4
+ ld [wc5d2], a
+ call Func_f8742
+ ret
+
+SurfingMinigame_ScoreCurrentWave:
+ call SurfingMinigame_DPadAction
+ call SurfingMinigame_UpdatePikachuHeight
+ ret nc
+ call SurfingMinigame_TileInteraction
+ jr c, .splash
+ call SurfingMinigame_CalculateAndAddRadnessFromStunt
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], $0
+ ld a, $2
+ ld [wc5d2], a
+ ret
+
+.splash
+ ld a, $3
+ ld [wc5d2], a
+ ld a, $60
+ ld [wc5e1], a
+ ld a, $10
+ call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters
+ xor a
+ ld [wChannelSoundIDs + Ch8], a
+ ld a, SFX_SURFING_CRASH
+ call PlaySound
+ ret
+
+Func_f8516:
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld a, [hl]
+ cp $20
+ jr nc, .asm_f8539
+ inc [hl]
+ inc [hl]
+ inc [hl]
+ inc [hl]
+ ld d, $4
+ call SurfingPikachu_Sine
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], a
+ call Func_f87b5
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], a
+ ret
+
+.asm_f8539
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], $0
+ ld a, $0
+ ld [wc5d2], a
+ ret
+
+Func_f8545:
+ ld hl, wc5e1
+ ld a, [hl]
+ and a
+ jr z, .asm_f8556
+ dec [hl]
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], a
+ ret
+
+.asm_f8556
+ ld a, $0
+ ld [wc5d2], a
+ ld a, $4
+ call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters
+ ret
+
+Func_f8561:
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], a
+ call Func_f8742
+ ret
+
+Func_f856d:
+ ld a, $f
+ call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], $0
+ ret
+
+Func_f8579:
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ inc [hl]
+ and $3f
+ cp $20
+ jr c, .asm_f8591
+ ld d, $10
+ call SurfingPikachu_Sine
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], a
+ ret
+
+.asm_f8591
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], $0
+ ret
+
+SurfingMinigame_DPadAction:
+ ld de, hJoy5
+ ld a, [de]
+ and D_LEFT
+ jr nz, .d_left
+ ld a, [de]
+ and D_RIGHT
+ jr nz, .d_right
+ ret
+
+.d_left
+ ld hl, ANIM_OBJ_FIELD_E
+ add hl, bc
+ ld [hl], $0
+ ld hl, ANIM_OBJ_FIELD_D
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ cp $b
+ jr c, .d_left_skip
+ call .StartTrick
+ ld hl, wSurfingMinigameTrickFlags
+ set 0, [hl]
+.d_left_skip
+ ld hl, ANIM_OBJ_FRAME_SET
+ add hl, bc
+ ld a, [hl]
+ cp $e
+ jr nc, .d_left_reset
+ inc [hl]
+ ret
+
+.d_left_reset
+ ld [hl], $1
+ ret
+
+.d_right
+ ld hl, ANIM_OBJ_FIELD_D
+ add hl, bc
+ ld [hl], $0
+ ld hl, ANIM_OBJ_FIELD_E
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ cp $d
+ jr c, .d_right_skip
+ call .StartTrick
+ ld hl, wSurfingMinigameTrickFlags
+ set 1, [hl]
+.d_right_skip
+ ld hl, ANIM_OBJ_FRAME_SET
+ add hl, bc
+ ld a, [hl]
+ cp $1
+ jr z, .d_right_reset
+ dec [hl]
+ ret
+
+.d_right_reset
+ ld [hl], $e
+ ret
+
+.StartTrick:
+ call SurfingMinigame_IncreaseRadnessMeter
+ xor a
+ ld hl, ANIM_OBJ_FIELD_D
+ add hl, bc
+ ld [hl], a
+ ld hl, ANIM_OBJ_FIELD_E
+ add hl, bc
+ ld [hl], a
+ ld a, SFX_SURFING_FLIP
+ call PlaySound
+ ret
+
+SurfingMinigame_TileInteraction:
+ ld hl, ANIM_OBJ_FRAME_SET
+ add hl, bc
+ ld a, [wSurfingMinigameBGMapReadBuffer]
+ cp $6
+ jr z, .tile_06
+ cp $14
+ jr z, .tile_14
+ cp $12
+ jr z, .tile_12
+ cp $7
+ jr z, .tile_07
+ ld a, [hl]
+ cp $1
+ jp z, .action_0
+ cp $2
+ jr z, .action_1
+ cp $3
+ jr z, .action_2
+ cp $4
+ jr z, .action_3
+ cp $5
+ jr z, .action_2
+ cp $6
+ jr z, .action_1
+ cp $7
+ jr z, .action_0
+ jr .action_0
+
+.tile_06
+ ld a, [hl]
+ cp $1
+ jr z, .action_0
+ cp $2
+ jr z, .action_0
+ cp $3
+ jr z, .action_0
+ cp $4
+ jr z, .action_1
+ cp $5
+ jr z, .action_2
+ cp $6
+ jr z, .action_3
+ cp $7
+ jr z, .action_2
+ jr .action_0
+
+.tile_07
+ ld a, [hl]
+ cp $1
+ jr z, .action_2
+ cp $2
+ jr z, .action_3
+ cp $3
+ jr z, .action_2
+ cp $4
+ jr z, .action_1
+ cp $5
+ jr z, .action_0
+ cp $6
+ jr z, .action_0
+ cp $7
+ jr z, .action_0
+ jr .action_0
+
+.tile_12
+.tile_14
+ ld a, [hl]
+ cp $1
+ jr z, .action_0
+ cp $2
+ jr z, .action_1
+ cp $3
+ jr z, .action_2
+ cp $4
+ jr z, .action_3
+ cp $5
+ jr z, .action_3
+ cp $6
+ jr z, .action_2
+ cp $7
+ jr z, .action_1
+ jr .action_0
+
+.action_1
+ call SufingMinigame_ReduceSpeedBy128
+ jr .action_3
+
+.action_2
+ call SufingMinigame_ReduceSpeedBy64
+.action_3
+ xor a
+ ld [wChannelSoundIDs + Ch8], a
+ ld a, SFX_SURFING_LAND
+ call PlaySound
+ and a
+ ret
+
+.action_0
+ ld a, $40
+ ld [wSurfingMinigamePikachuSpeed], a
+ xor a
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ scf
+ ret
+
+SurfingMinigame_SpeedUpPikachu:
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ cp $2
+ ret nc
+ ld h, a
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld l, a
+ ld de, $2
+ add hl, de
+ ld a, h
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ ld a, l
+ ld [wSurfingMinigamePikachuSpeed], a
+ ret
+
+SufingMinigame_ReduceSpeedBy64:
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ and a
+ jr nz, .go
+ ld a, [wSurfingMinigamePikachuSpeed]
+ cp $40
+ jr nc, .go
+ xor a
+ ld [wSurfingMinigamePikachuSpeed], a
+ ret
+
+.go
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ ld h, a
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld l, a
+ ld de, -$40
+ add hl, de
+ ld a, h
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ ld a, l
+ ld [wSurfingMinigamePikachuSpeed], a
+ ret
+
+SufingMinigame_ReduceSpeedBy128:
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ and a
+ jr nz, .go
+ ld a, [wSurfingMinigamePikachuSpeed]
+ cp $80
+ jr nc, .go
+ xor a
+ ld [wSurfingMinigamePikachuSpeed], a
+ ret
+
+.go
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ ld h, a
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld l, a
+ ld de, -$80
+ add hl, de
+ ld a, h
+ ld [wSurfingMinigamePikachuSpeed + 1], a
+ ld a, l
+ ld [wSurfingMinigamePikachuSpeed], a
+ ret
+
+Func_f871e:
+ ldh a, [hSCX]
+ and $7
+ cp $3
+ jr c, .asm_f8740
+ cp $5
+ jr nc, .asm_f8740
+ ld a, [wSurfingMinigameBGMapReadBuffer]
+ cp $14
+ jr nz, .asm_f8740
+ call SufingMinigame_GetSpeedDividedBy32
+ cp $a
+ jr c, .asm_f8740
+ ld [wc5ec], a
+ call Func_f9284
+ scf
+ ret
+
+.asm_f8740
+ and a
+ ret
+
+Func_f8742:
+ ldh a, [hSCX]
+ and $7
+ cp $3
+ ret c
+ cp $5
+ ret nc
+ ld a, [wSurfingMinigameBGMapReadBuffer]
+ cp $6
+ jr z, .asm_f8766
+ cp $14
+ jr z, .asm_f8766
+ cp $7
+ jr z, .asm_f876a
+ call Func_f8778
+ ld a, $4
+ ld hl, ANIM_OBJ_FRAME_SET
+ add hl, bc
+ ld [hl], a
+ ret
+
+.asm_f8766
+ ld a, $6
+ jr .asm_f876c
+
+.asm_f876a
+ ld a, $2
+.asm_f876c
+ ld e, a
+ ld a, [wc5de]
+ dec a
+ add e
+ ld hl, ANIM_OBJ_FRAME_SET
+ add hl, bc
+ ld [hl], a
+ ret
+
+Func_f8778:
+ ld hl, wc5e0
+ ld a, [hl]
+ inc [hl]
+ and $7
+ ret nz
+ ld a, [wc5df]
+ and a
+ jr z, .asm_f8796
+ ld a, [wc5de]
+ and a
+ jr z, .asm_f8791
+ dec a
+ ld [wc5de], a
+ ret
+
+.asm_f8791
+ xor a
+ ld [wc5df], a
+ ret
+
+.asm_f8796
+ ld a, [wc5de]
+ cp $2
+ jr z, .asm_f87a2
+ inc a
+ ld [wc5de], a
+ ret
+
+.asm_f87a2
+ ld a, $1
+ ld [wc5df], a
+ ret
+
+SufingMinigame_GetSpeedDividedBy32:
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld l, a
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ ld h, a
+ add hl, hl
+ add hl, hl
+ add hl, hl
+ ld a, h
+ ret
+
+Func_f87b5:
+ ld hl, wc5eb
+ ld a, [hl]
+ inc [hl]
+ and $3
+ ret nz
+ call .GetYCoord
+ ld d, a
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld e, [hl]
+ ld a, $a
+ push bc
+ call SpawnAnimatedObject
+ pop bc
+ ret
+
+.GetYCoord:
+ ldh a, [hSCX]
+ and $8
+ jr nz, .get_height_plus_9
+ ld hl, wSurfingMinigameWaveHeight + 8
+ jr .got_hl
+
+.get_height_plus_9
+ ld hl, wSurfingMinigameWaveHeight + 9
+.got_hl
+ ld a, [wSurfingMinigameBGMapReadBuffer + 1]
+ cp $6
+ jr z, .six_or_twenty
+ cp $14
+ jr z, .six_or_twenty
+ cp $7
+ jr z, .seven
+ ld a, [hl]
+ ret
+
+.six_or_twenty
+ ldh a, [hSCX]
+ and $7
+ ld e, a
+ ld a, [hl]
+ sub e
+ ret
+
+.seven
+ ldh a, [hSCX]
+ and $7
+ add [hl]
+ ret
+
+Func_f87fb:
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld a, [hl]
+ cp $58
+ ret z
+ add $4
+ ld [hl], a
+ ret
+
+Func_f8807: ; unreferenced
+ call MaskCurrentAnimatedObjectStruct
+ ret
+
+SurfingMinigameAnimatedObjectFn_FlippingPika:
+ ld hl, ANIM_OBJ_FIELD_B
+ add hl, bc
+ ld a, [hl]
+ and a
+ ret z
+ dec [hl]
+ dec [hl]
+ ld d, a
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ call SurfingPikachu_Sine
+ cp $80
+ jr nc, .positive
+ xor $ff
+ inc a
+.positive
+ ld hl, ANIM_OBJ_Y_OFFSET
+ add hl, bc
+ ld [hl], a
+ ret
+
+SurfingMinigameAnimatedObjectFn_IntroAnimationPikachu:
+ ld hl, ANIM_OBJ_FIELD_B
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ and $1
+ ret z
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld a, [hl]
+ cp $c0
+ jr z, .done
+ inc [hl]
+ ret
+
+.done
+ ld a, $1
+ ld [wSurfingMinigameIntroAnimationFinished], a
+ call MaskCurrentAnimatedObjectStruct
+ ret
+
+SurfingMinigame_MoveClouds:
+ ld a, [wc635]
+ ld e, a
+ ld d, $0
+ ld a, [wSurfingMinigamePikachuSpeed]
+ ld l, a
+ ld a, [wSurfingMinigamePikachuSpeed + 1]
+ ld h, a
+ add hl, de
+ ld a, l
+ ld [wc635], a
+ ld d, h
+ ld hl, wOAMBuffer + 5 * 4 + 1
+ ld e, $9
+.loop
+ ld a, [hl]
+ add d
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ dec e
+ jr nz, .loop
+ ret
+
+SurfingMinigame_ReadBGMapBuffer:
+ ld a, [wSurfingMinigameBGMapReadBuffer] ; ???
+ ldh a, [hSCX]
+ add $48
+ ld e, a
+ srl e
+ srl e
+ srl e
+ ld d, $0
+ ld hl, vBGMap0
+ add hl, de
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ srl a
+ srl a
+ srl a
+ ld c, a
+.loop
+ ld a, c
+ and a
+ jr z, .copy
+ dec c
+ ld de, $20
+ add hl, de
+ ld a, h
+ and $3
+ or $98
+ ld h, a
+ jr .loop
+
+.copy
+ ld de, wSurfingMinigameBGMapReadBuffer
+ ld a, e
+ ldh [hVBlankCopyDest], a
+ ld a, d
+ ldh [hVBlankCopyDest + 1], a
+ ld a, l
+ ldh [hVBlankCopySource], a
+ ld a, h
+ ldh [hVBlankCopySource + 1], a
+ ld a, 16 / $10
+ ldh [hVBlankCopySize], a
+ ret
+
+SurfingMinigame_SetPikachuHeight:
+ ldh a, [hSCX]
+ and $8
+ jr nz, .asm_f88b9
+ ld hl, wSurfingMinigameWaveHeight + 7
+ jr .asm_f88bc
+
+.asm_f88b9
+ ld hl, wSurfingMinigameWaveHeight + 8
+.asm_f88bc
+ ld a, [wSurfingMinigameBGMapReadBuffer]
+ cp $6
+ jr z, .asm_f88d0
+ cp $14
+ jr z, .asm_f88d0
+ cp $7
+ jr z, .asm_f88db
+ ld a, [hl]
+ ld [wSurfingMinigamePikachuObjectHeight], a
+ ret
+
+.asm_f88d0
+ ldh a, [hSCX]
+ and $7
+ ld e, a
+ ld a, [hl]
+ sub e
+ ld [wSurfingMinigamePikachuObjectHeight], a
+ ret
+
+.asm_f88db
+ ldh a, [hSCX]
+ and $7
+ add [hl]
+ ld [wSurfingMinigamePikachuObjectHeight], a
+ ret
+
+SurfingMinigame_Deduct1HP:
+ ld hl, wSurfingMinigamePikachuHP
+ ld e, $99
+ call .BCD_Deduct
+ ret nc
+ inc hl
+ ld e, $99
+.BCD_Deduct:
+ ld a, [hl]
+ and a
+ jr z, .roll_over
+ sub $1
+ daa
+ ld [hl], a
+ and a
+ ret
+
+.roll_over
+ ld [hl], e
+ scf
+ ret
+
+SurfingMinigame_DrawHP:
+ ld de, wSurfingMinigamePikachuHP + 1
+ ld hl, wOAMBuffer + 0 * 4 + 2
+ ld a, [de]
+ call .PlaceBCDNumber
+ ld hl, wOAMBuffer + 2 * 4 + 2
+ ld a, [de]
+.PlaceBCDNumber:
+ ld c, a
+ swap a
+ and $f
+ add $d0
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ ld a, c
+ and $f
+ add $d0
+ ld [hl], a
+ dec de
+ ret
+
+SurfingMinigame_DrawResultsScreen:
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ xor a
+ call FillMemory
+ ld hl, .BeachTilemap
+ decoord 0, 6
+ ld bc, .BeachTilemapEnd - .BeachTilemap
+ call CopyData
+ call .PlaceTextbox
+ ld hl, wOAMBuffer + 5 * 4 + 1
+ ld bc, 9 * 4
+ xor a
+ call FillMemory
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ ret
+
+.BeachTilemap:
+INCBIN "gfx/surfing_pikachu/unknown_f8946.map"
+.BeachTilemapEnd:
+
+.PlaceTextbox:
+ hlcoord 1, 1
+ lb de, $3b, $3c
+ ld a, $40
+ call .place_row
+ hlcoord 1, 2
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 3
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 4
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 5
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 6
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 7
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 8
+ lb de, $3f, $3f
+ ld a, $ff
+ call .place_row
+ hlcoord 1, 9
+ lb de, $3d, $3e
+ ld a, $40
+ call .place_row
+ ret
+
+.place_row:
+ ld [hl], d
+ inc hl
+ ld c, $10
+.loop
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ ld [hl], e
+ ret
+
+SurfingMinigame_PrintTextHiScore:
+ ld hl, .Hi_Score
+ decoord 6, 8
+ ld bc, $9
+ call CopyData
+ ret
+
+.Hi_Score:
+ db $20,$2e,$2f,$30,$31,$2c,$32,$23,$33 ; Hi-Score!!
+
+SurfingMinigame_WriteHPLeft:
+ ld hl, .HP_Left
+ decoord 2, 2
+ ld bc, $7
+ call CopyData
+ call SurfingMinigame_BCDPrintHPLeft
+ ret
+
+.HP_Left:
+ db $20,$21,$ff,$22,$23,$24,$25 ; HP Left
+
+SurfingMinigame_AddRemainingHPToTotal:
+ ld c, 99
+.loop
+ push bc
+ ld hl, wSurfingMinigamePikachuHP
+ ld a, [hli]
+ or [hl]
+ and a
+ jr z, .dead
+ call SurfingMinigame_Deduct1HP
+ ld e, $1
+ call SurfingMinigame_AddPointsToTotal
+ pop bc
+ dec c
+ jr nz, .loop
+ ld a, SFX_PRESS_AB
+ call PlaySound
+ and a
+ ret
+
+.dead
+ pop bc
+ scf
+ ret
+
+SurfingMinigame_BCDPrintHPLeft:
+ hlcoord 10, 2
+ ld de, wSurfingMinigamePikachuHP + 1
+ ld a, [de]
+ call SurfingPikachu_PlaceBCDNumber
+ inc hl
+ ld a, [de]
+ call SurfingPikachu_PlaceBCDNumber
+ inc hl
+ inc hl
+ ld [hl], $21 ; P
+ inc hl
+ ld [hl], $25 ; t
+ inc hl
+ ld [hl], $26 ; s
+ ret
+
+SurfingMinigame_WriteRadness:
+ ld hl, .Radness
+ decoord 2, 4
+ ld bc, $7
+ call CopyData
+ call SurfingMinigame_BCDPrintRadness
+ ret
+
+.Radness:
+ db $27,$28,$29,$2a,$23,$26,$26 ; Radness
+
+SurfingMinigame_AddRadnessToTotal:
+ ld c, 99
+.loop
+ push bc
+ ld hl, wSurfingMinigameRadnessScore
+ ld a, [hli]
+ ld e, a
+ or [hl]
+ jr z, .done
+ ld d, [hl]
+ ld a, e
+ sub $1
+ daa
+ ld e, a
+ ld a, d
+ sbc $0
+ daa
+ ld [hld], a
+ ld [hl], e
+ ld e, $1
+ call SurfingMinigame_AddPointsToTotal
+ pop bc
+ dec c
+ jr nz, .loop
+ ld a, SFX_PRESS_AB
+ call PlaySound
+ and a
+ ret
+
+.done
+ pop bc
+ scf
+ ret
+
+SurfingMinigame_BCDPrintRadness:
+ ld a, [wSurfingMinigameRadnessScore + 1]
+ hlcoord 10, 4
+ call SurfingPikachu_PlaceBCDNumber
+ ld a, [wSurfingMinigameRadnessScore]
+ hlcoord 12, 4
+ call SurfingPikachu_PlaceBCDNumber
+ inc hl
+ inc hl
+ ld [hl], $21 ; P
+ inc hl
+ ld [hl], $25 ; t
+ inc hl
+ ld [hl], $26 ; s
+ ret
+
+SurfingMinigame_AddPointsToTotal:
+ ld a, [wSurfingMinigameTotalScore]
+ add e
+ daa
+ ld [wSurfingMinigameTotalScore], a
+ ld a, [wSurfingMinigameTotalScore + 1]
+ adc $0
+ daa
+ ld [wSurfingMinigameTotalScore + 1], a
+ ret nc
+ ld a, $99
+ ld [wSurfingMinigameTotalScore], a
+ ld [wSurfingMinigameTotalScore + 1], a
+ ret
+
+SurfingMinigame_BCDPrintTotalScore:
+ ld a, [wSurfingMinigameTotalScore + 1]
+ hlcoord 10, 6
+ call SurfingPikachu_PlaceBCDNumber
+ ld a, [wSurfingMinigameTotalScore]
+ hlcoord 12, 6
+ call SurfingPikachu_PlaceBCDNumber
+ inc hl
+ inc hl
+ ld [hl], $21 ; P
+ inc hl
+ ld [hl], $25 ; t
+ inc hl
+ ld [hl], $26 ; s
+ ret
+
+SurfingMinigame_WriteTotal:
+ ld hl, .Total
+ decoord 2, 6
+ ld bc, $5
+ call CopyData
+ call SurfingMinigame_BCDPrintRadness
+ call SurfingMinigame_BCDPrintTotalScore
+ ret
+
+.Total:
+ db $2b,$2c,$25,$28,$2d ; Total
+
+DidPlayerGetAHighScore:
+ ld hl, wSurfingMinigameHiScore + 1
+ ld a, [wSurfingMinigameTotalScore + 1]
+ cp [hl]
+ jr c, .not_high_score
+ jr nz, .high_score
+ dec hl
+ ld a, [wSurfingMinigameTotalScore]
+ cp [hl]
+ jr c, .not_high_score
+ jr nz, .high_score
+.not_high_score
+ call WaitForSoundToFinish
+ ldpikacry e, PikachuCry28
+ call SurfingMinigame_PlayPikaCryIfSurfingPikaInParty
+ and a
+ ret
+
+.high_score
+ ld a, [wSurfingMinigameTotalScore]
+ ld [wSurfingMinigameHiScore], a
+ ld a, [wSurfingMinigameTotalScore + 1]
+ ld [wSurfingMinigameHiScore + 1], a
+ call WaitForSoundToFinish
+ ldpikacry e, PikachuCry34
+ call SurfingMinigame_PlayPikaCryIfSurfingPikaInParty
+ ld a, SFX_GET_ITEM2_4_2
+ call PlaySound
+ scf
+ ret
+
+SurfingMinigame_PlayPikaCryIfSurfingPikaInParty:
+ push de
+ callfar IsSurfingPikachuInThePlayersParty
+ pop de
+ ret nc
+ callfar PlayPikachuSoundClip
+ ret
+
+SurfingMinigame_IncreaseRadnessMeter:
+ ld a, [wSurfingMinigameRadnessMeter]
+ inc a
+ cp $4
+ jr c, .cap
+ ld a, $3
+.cap
+ ld [wSurfingMinigameRadnessMeter], a
+ ret
+
+SurfingMinigame_CalculateAndAddRadnessFromStunt:
+ ; Compute the amount of radness points from the
+ ; current trick based on the number of
+ ; consecutive flips
+ ; Single flip: +0050
+ ; 2 of the same flip: +0150
+ ; 3 or more of the same flip: +0350
+ ; 2 different flips: +0180
+ ; 3 or more different flips: +0500
+ ld a, [wSurfingMinigameRadnessMeter]
+ and a
+ ret z
+ ld a, [wSurfingMinigameTrickFlags]
+ and $3
+ cp $3 ; did a combination of front and back flips
+ jr z, .mixed_chain
+ ld a, [wSurfingMinigameRadnessMeter]
+ ld d, a
+ ld e, $1
+ ld a, $0
+.get_amount_of_radness
+ add e
+ sla e
+ dec d
+ jr nz, .get_amount_of_radness
+.add_radness_50_at_a_time
+ push af
+ ld e, $50
+ call SurfingMinigame_AddRadness
+ pop af
+ dec a
+ jr nz, .add_radness_50_at_a_time
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld a, [hl]
+ sub $10
+ ld d, a
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld e, [hl]
+ ld a, [wSurfingMinigameRadnessMeter]
+ add $3
+ push bc
+ call SpawnAnimatedObject
+ pop bc
+ ret
+
+.mixed_chain
+ ld a, [wSurfingMinigameRadnessMeter]
+ cp $3
+ jr c, .add_180_radness_points
+ ld a, 10
+.add_500_radness_50_at_a_time
+ push af
+ ld e, $50
+ call SurfingMinigame_AddRadness
+ pop af
+ dec a
+ jr nz, .add_500_radness_50_at_a_time
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld a, [hl]
+ sub $10
+ ld d, a
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld e, [hl]
+ ld a, $9
+ push bc
+ call SpawnAnimatedObject
+ pop bc
+ ret
+
+.add_180_radness_points
+ ld e, $50
+ call SurfingMinigame_AddRadness
+ ld e, $50
+ call SurfingMinigame_AddRadness
+ ld e, $50
+ call SurfingMinigame_AddRadness
+ ld e, $30
+ call SurfingMinigame_AddRadness
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld a, [hl]
+ sub $10
+ ld d, a
+ ld hl, ANIM_OBJ_X_COORD
+ add hl, bc
+ ld e, [hl]
+ ld a, $8
+ push bc
+ call SpawnAnimatedObject
+ pop bc
+ ret
+
+SurfingMinigame_AddRadness:
+ ld a, [wSurfingMinigameRadnessScore]
+ add e
+ daa
+ ld [wSurfingMinigameRadnessScore], a
+ ld a, [wSurfingMinigameRadnessScore + 1]
+ adc $0
+ daa
+ ld [wSurfingMinigameRadnessScore + 1], a
+ ret nc
+ ld a, $99
+ ld [wSurfingMinigameRadnessScore], a
+ ld [wSurfingMinigameRadnessScore + 1], a
+ ret
+
+Func_f8c97:
+ ld a, $a0
+ ld [wSurfingMinigameXOffset], a
+ ldh a, [hSCX]
+ ld h, a
+ ld a, [wSurfingMinigameSCX]
+ ld l, a
+ ld de, $900
+ add hl, de
+ ld a, l
+ ld [wSurfingMinigameSCX], a
+ ld a, h
+ ldh [hSCX], a
+ jr SurfingMinigame_GenerateBGMap
+
+SurfingMinigame_ScrollAndGenerateBGMap:
+ ld a, $a0
+ ld [wSurfingMinigameXOffset], a
+ ldh a, [hSCX]
+ ld h, a
+ ld a, [wSurfingMinigameSCX]
+ ld l, a
+ ld de, $180
+ add hl, de
+ ld a, l
+ ld [wSurfingMinigameSCX], a
+ ld a, h
+ ldh [hSCX], a
+SurfingMinigame_GenerateBGMap:
+ ld hl, wSurfingMinigameSCX2
+ ldh a, [hSCX]
+ cp [hl]
+ ret z
+ ld [hl], a
+ and $f0
+ ld hl, wSurfingMinigameSCXHi
+ cp [hl]
+ ret z
+ ld [hl], a
+ call SurfingMinigame_GetWaveDataPointers
+ ; b and c contain the height of the next wave to appear
+ ; on screen, in number of pixels from the top of the screen
+ ld a, b
+ ld [wSurfingMinigameWaveHeightBuffer], a
+ ld a, c
+ ld [wSurfingMinigameWaveHeightBuffer + 1], a
+ push de
+ ld hl, wSurfingMinigameWaveHeight
+ ld de, wSurfingMinigameWaveHeight + 2
+ ld c, SCREEN_WIDTH - 2
+.copy_loop
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .copy_loop
+ ld a, [wSurfingMinigameWaveHeightBuffer]
+ ld [hli], a
+ ld a, [wSurfingMinigameWaveHeightBuffer + 1]
+ ld [hl], a
+ pop de
+ ld hl, wRedrawRowOrColumnSrcTiles
+ ld c, $8
+.loop
+ ld a, [de]
+ call .CopyRedrawSrcTiles
+ inc de
+ dec c
+ jr nz, .loop
+ ld a, [wSurfingMinigameXOffset]
+ ld e, a
+ ldh a, [hSCX]
+ add e
+ and $f0
+ srl a
+ srl a
+ srl a
+ ld e, a
+ ld d, $0
+ ld hl, vBGMap0
+ add hl, de
+ ld a, l
+ ldh [hRedrawRowOrColumnDest], a
+ ld a, h
+ ldh [hRedrawRowOrColumnDest + 1], a
+ ld a, $1
+ ldh [hRedrawRowOrColumnMode], a
+ ret
+
+.CopyRedrawSrcTiles:
+ push de
+ push hl
+ ld l, a
+ ld h, $0
+ ld de, Unkn_f96e5
+ add hl, hl
+ add hl, hl
+ add hl, de
+ ld e, l
+ ld d, h
+ pop hl
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ pop de
+ ret
+
+SurfingMinigame_GetWaveDataPointers:
+ ld a, [wSurfingMinigameWaveFunctionNumber]
+ ld e, a
+ ld d, $0
+ ld hl, Jumptable_f8d53
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+Jumptable_f8d53:
+ dw SurfingMinigameWaveFunction_NoWave ; 00
+
+ dw Func_f8f28 ; 01
+ dw Func_f8f31 ; 02
+ dw Func_f8f3a ; 03
+ dw Func_f8f43 ; 04
+ dw Func_f8e7d ; 05
+ dw Func_f8f4c ; 06
+ dw Func_f8f55 ; 07
+ dw Func_f8f5e ; 08
+ dw Func_f8e7d ; 09
+ dw Func_f8e7d ; 0a
+ dw Func_f8e7d ; 0b
+ dw Func_f8e7d ; 0c
+ dw Func_f8f94 ; 0d
+
+ dw Func_f8ec5 ; 0e
+ dw Func_f8ece ; 0f
+ dw Func_f8ed7 ; 10
+ dw Func_f8ee0 ; 11
+ dw Func_f8ee9 ; 12
+ dw Func_f8ef2 ; 13
+ dw Func_f8e7d ; 14
+ dw Func_f8e7d ; 15
+ dw Func_f8e7d ; 16
+ dw Func_f8e7d ; 17
+ dw Func_f8e7d ; 18
+ dw Func_f8f94 ; 19
+
+ dw Func_f8efb ; 1a
+ dw Func_f8f04 ; 1b
+ dw Func_f8f0d ; 1c
+ dw Func_f8f16 ; 1d
+ dw Func_f8f1f ; 1e
+ dw Func_f8efb ; 1f
+ dw Func_f8f04 ; 20
+ dw Func_f8f0d ; 21
+ dw Func_f8f16 ; 22
+ dw Func_f8f1f ; 23
+ dw Func_f8e7d ; 24
+ dw Func_f8e7d ; 25
+ dw Func_f8e7d ; 26
+ dw Func_f8e7d ; 27
+ dw Func_f8f94 ; 28
+
+ dw Func_f8f28 ; 29
+ dw Func_f8f31 ; 2a
+ dw Func_f8f3a ; 2b
+ dw Func_f8f43 ; 2c
+ dw Func_f8e7d ; 2d
+ dw Func_f8e7d ; 2e
+ dw Func_f8e7d ; 2f
+ dw Func_f8e7d ; 30
+ dw Func_f8f94 ; 31
+
+ dw Func_f8f4c ; 32
+ dw Func_f8f55 ; 33
+ dw Func_f8f5e ; 34
+ dw Func_f8f4c ; 35
+ dw Func_f8f55 ; 36
+ dw Func_f8f5e ; 37
+ dw Func_f8f4c ; 38
+ dw Func_f8f55 ; 39
+ dw Func_f8f5e ; 3a
+ dw Func_f8e7d ; 3b
+ dw Func_f8e7d ; 3c
+ dw Func_f8e7d ; 3d
+ dw Func_f8e7d ; 3e
+ dw Func_f8f94 ; 3f
+
+ dw Func_f8f67 ; 40
+ dw Func_f8f70 ; 41
+ dw Func_f8efb ; 42
+ dw Func_f8f04 ; 43
+ dw Func_f8f0d ; 44
+ dw Func_f8f16 ; 45
+ dw Func_f8f1f ; 46
+ dw Func_f8f67 ; 47
+ dw Func_f8f70 ; 48
+ dw Func_f8e7d ; 49
+ dw Func_f8e7d ; 4a
+ dw Func_f8e7d ; 4b
+ dw Func_f8f94 ; 4c
+
+ dw Func_f8ec5 ; 4d
+ dw Func_f8ece ; 4e
+ dw Func_f8ed7 ; 4f
+ dw Func_f8ee0 ; 50
+ dw Func_f8ee9 ; 51
+ dw Func_f8ef2 ; 52
+ dw Func_f8e7d ; 53
+ dw Func_f8f67 ; 54
+ dw Func_f8f70 ; 55
+ dw Func_f8f67 ; 56
+ dw Func_f8f70 ; 57
+ dw Func_f8e7d ; 58
+ dw Func_f8e7d ; 59
+ dw Func_f8e7d ; 5a
+ dw Func_f8f94 ; 5b
+
+ dw Func_f8efb ; 5c
+ dw Func_f8f04 ; 5d
+ dw Func_f8f0d ; 5e
+ dw Func_f8f16 ; 5f
+ dw Func_f8f1f ; 60
+ dw Func_f8f28 ; 61
+ dw Func_f8f31 ; 62
+ dw Func_f8f3a ; 63
+ dw Func_f8f43 ; 64
+ dw Func_f8e7d ; 65
+ dw Func_f8e7d ; 66
+ dw Func_f8e7d ; 67
+ dw Func_f8e7d ; 68
+ dw Func_f8f94 ; 69
+
+ dw Func_f8e86 ; 6a
+ dw Func_f8e8f ; 6b
+ dw Func_f8e98 ; 6c
+ dw Func_f8ea1 ; 6d
+ dw Func_f8eaa ; 6e
+ dw Func_f8eb3 ; 6f
+ dw Func_f8ebc ; 70
+ dw Func_f8f9d ; 71
+
+ dw Func_f8e7d ; 72
+ dw Func_f8f79 ; 73
+ dw Func_f8f82 ; 74
+ dw Func_f8f82 ; 75
+ dw Func_f8f82 ; 76
+ dw Func_f8f82 ; 77
+ dw Func_f8f82 ; 78
+ dw Func_f8f82 ; 79
+ dw Func_f8f82 ; 7a
+ dw Func_f8f8b ; 7b
+
+SurfingMinigameWaveFunction_NoWave:
+ ld a, [wc5e5]
+ cp $16
+ jr c, .check_param
+ jr z, .big_kahuna
+ jr nc, .got_wave
+.big_kahuna
+ ld a, $6a
+ jr .got_next_fn
+
+.check_param
+ ld a, [wc5d5]
+ and a
+ jr z, .got_wave
+ dec a
+ and $7
+ ld e, a
+ ld d, $0
+ ld hl, Unkn_f8e75
+ add hl, de
+ ld a, [hl]
+.got_next_fn
+ ld [wSurfingMinigameWaveFunctionNumber], a
+.got_wave
+ lb bc, $74, $74
+ ld de, Unkn_f973d
+ ret
+
+Unkn_f8e75:
+ db $01,$0e,$1a,$29,$32,$40,$4d,$5c
+
+Func_f8e7d:
+ lb bc, $74, $74
+ ld de, Unkn_f973d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8e86:
+ lb bc, $74, $6c
+ ld de, Unkn_f9745
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8e8f:
+ lb bc, $64, $5c
+ ld de, Unkn_f974d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8e98:
+ lb bc, $54, $4c
+ ld de, Unkn_f9755
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ea1:
+ lb bc, $44, $44
+ ld de, Unkn_f975d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8eaa:
+ lb bc, $44, $4c
+ ld de, Unkn_f9765
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8eb3:
+ lb bc, $54, $5c
+ ld de, Unkn_f976d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ebc:
+ lb bc, $64, $6c
+ ld de, Unkn_f9775
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ec5:
+ lb bc, $74, $6c
+ ld de, Unkn_f977d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ece:
+ lb bc, $64, $5c
+ ld de, Unkn_f9785
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ed7:
+ lb bc, $54, $4c
+ ld de, Unkn_f978d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ee0:
+ lb bc, $4c, $4c
+ ld de, Unkn_f9795
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ee9:
+ lb bc, $54, $5c
+ ld de, Unkn_f979d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8ef2:
+ lb bc, $64, $6c
+ ld de, Unkn_f97a5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8efb:
+ lb bc, $74, $6c
+ ld de, Unkn_f97ad
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f04:
+ lb bc, $64, $5c
+ ld de, Unkn_f97b5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f0d:
+ lb bc, $54, $54
+ ld de, Unkn_f97bd
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f16:
+ lb bc, $54, $5c
+ ld de, Unkn_f97c5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f1f:
+ lb bc, $64, $6c
+ ld de, Unkn_f97cd
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f28:
+ lb bc, $74, $6c
+ ld de, Unkn_f97d5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f31:
+ lb bc, $64, $5c
+ ld de, Unkn_f97dd
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f3a:
+ lb bc, $5c, $5c
+ ld de, Unkn_f97e5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f43:
+ lb bc, $64, $6c
+ ld de, Unkn_f97ed
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f4c:
+ lb bc, $74, $6c
+ ld de, Unkn_f97f5
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f55:
+ lb bc, $64, $64
+ ld de, Unkn_f97fd
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f5e:
+ lb bc, $64, $6c
+ ld de, Unkn_f9805
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f67:
+ lb bc, $74, $6c
+ ld de, Unkn_f980d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f70:
+ lb bc, $6c, $6c
+ ld de, Unkn_f9815
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f79:
+ lb bc, $74, $74
+ ld de, Unkn_f981d
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f82:
+ lb bc, $74, $74
+ ld de, Unkn_f9825
+ jp SurfingMinigameWaveFunction_GoToNextWaveFunction
+
+Func_f8f8b:
+ lb bc, $74, $74
+ ld de, Unkn_f9825
+ jp SurfingMinigameWaveFunction_ResetWaveFunction
+
+Func_f8f94:
+ lb bc, $74, $74
+ ld de, Unkn_f973d
+ jp SurfingMinigameWaveFunction_ResetWaveFunction
+
+Func_f8f9d:
+ lb bc, $74, $74
+ ld de, Unkn_f973d
+ ret
+
+Func_f8fa4: ; unused
+ inc a
+ ld [wSurfingMinigameWaveFunctionNumber], a
+ ret
+
+SurfingMinigameWaveFunction_GoToNextWaveFunction:
+ ld hl, wSurfingMinigameWaveFunctionNumber
+ inc [hl]
+ ret
+
+SurfingMinigameWaveFunction_ResetWaveFunction:
+ xor a
+ ld [wSurfingMinigameWaveFunctionNumber], a
+ ret
+
+SurfingPikachuMinigameIntro:
+ call SurfingPikachu_ClearTileMap
+ call ClearSprites
+ call DisableLCD
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call ClearObjectAnimationBuffers
+ ld hl, SurfingPikachu1Graphics3
+ ld de, $8800
+ ld bc, $900
+ ld a, BANK(SurfingPikachu1Graphics3)
+ call FarCopyData
+ ld a, LOW(SurfingPikachuSpawnStateDataPointer)
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, HIGH(SurfingPikachuSpawnStateDataPointer)
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+ ld a, LOW(SurfingPikachuObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, HIGH(SurfingPikachuObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer + 1], a
+ ld a, LOW(SurfingPikachuOAMData)
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, HIGH(SurfingPikachuOAMData)
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+ ld a, LOW(SurfingPikachuFrames)
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, HIGH(SurfingPikachuFrames)
+ ld [wAnimatedObjectFramesDataPointer + 1], a
+ ld a, $c
+ lb de, $74, $58
+ call SpawnAnimatedObject
+ call DrawSurfingPikachuMinigameIntroBackground
+ xor a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ld a, $90
+ ldh [hWY], a
+ ld b, $f
+ call RunPaletteCommand
+ ld a, $e3
+ ldh [rLCDC], a
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ call SurfingPikachuMinigame_SetBGPals
+ ld a, $e4
+ ldh [rOBP0], a
+ ld a, $e0
+ ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ call DelayFrame
+ ld a, MUSIC_SURFING_PIKACHU
+ ld c, BANK(Music_SurfingPikachu)
+ call PlayMusic
+ xor a
+ ld [wSurfingMinigameIntroAnimationFinished], a
+.loop
+ ld a, [wSurfingMinigameIntroAnimationFinished]
+ and a
+ ret nz
+ ld a, $0
+ ld [wCurrentAnimatedObjectOAMBufferOffset], a
+ call RunObjectAnimations
+ call DelayFrame
+ jr .loop
+
+DrawSurfingPikachuMinigameIntroBackground:
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld a, $ff
+ call FillMemory
+ ld hl, Tilemap_f90bc
+ decoord 0, 6
+ ld bc, 12 * SCREEN_WIDTH
+ call CopyData
+ ld de, Tilemap_f91c8
+ hlcoord 4, 0
+ lb bc, 6, 12
+ call .CopyBox
+ hlcoord 3, 7
+ lb bc, 3, 15
+ call .FillBoxWithFF
+ ld hl, Tilemap_f91ac
+ decoord 3, 7
+ ld bc, 15
+ call CopyData
+ ld hl, Tilemap_f91bb
+ decoord 4, 9
+ ld bc, 13
+ call CopyData
+ ret
+
+.CopyBox:
+.copy_row
+ push bc
+ push hl
+.copy_col
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .copy_col
+ ld bc, SCREEN_WIDTH
+ pop hl
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .copy_row
+ ret
+
+.FillBoxWithFF:
+.fill_row
+ push bc
+ push hl
+.fill_col
+ ld [hl], $ff
+ inc hl
+ dec c
+ jr nz, .fill_col
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .fill_row
+ ret
+
+Tilemap_f90bc: INCBIN "gfx/surfing_pikachu/unknown_f90bc.map"
+Tilemap_f91ac: INCBIN "gfx/surfing_pikachu/unknown_f91ac.map"
+Tilemap_f91bb: INCBIN "gfx/surfing_pikachu/unknown_f91bb.map"
+Tilemap_f91c8: INCBIN "gfx/surfing_pikachu/unknown_f91c8.map"
+
+SurfingMinigame_UpdateLYOverrides:
+ ld hl, wLYOverrides + $10
+ ld de, wLYOverrides + $11
+ ld c, $80
+ ld a, [hl]
+ push af
+.loop
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ pop af
+ ld [hl], a
+ ret
+
+SurfingMinigame_InitScanlineOverrides:
+ ld hl, wLYOverrides
+ ld bc, wLYOverridesEnd - wLYOverrides
+ ld de, $0
+.loop
+ ld a, e
+ and $1f
+ ld e, a
+ push hl
+ ld hl, SurfingMinigame_LYOverridesInitialSineWave
+ add hl, de
+ ld a, [hl]
+ pop hl
+ ld [hli], a
+ inc e
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ ret
+
+SurfingPikachu_GetJoypad_3FrameBuffer:
+ call Joypad
+ ldh a, [hFrameCounter]
+ and a
+ jr nz, .delayed
+ ldh a, [hJoyHeld]
+ ldh [hJoy5], a
+ ld a, $2
+ ldh [hFrameCounter], a
+ ret
+
+.delayed
+ xor a
+ ldh [hJoy5], a
+ ret
+
+SurfingPikachuMinigame_BlankPals:
+ xor a
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+SurfingPikachuMinigame_NormalPals:
+ ld a, $e4
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ld a, $e0
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+SurfingPikachu_ClearTileMap:
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ xor a
+ call FillMemory
+ ret
+
+Func_f9284:
+ xor a
+ ld [wc5ed], a
+ ld [wc5ee], a
+ ret
+
+SurfingMinigame_UpdatePikachuHeight:
+ ld a, [wc5ed]
+ and a
+ jr nz, .positive
+ ld a, [wc5ec]
+ ld d, a
+ ld a, [wc5ee]
+ or d
+ jr z, .done
+ ld a, [wc5ee]
+ ld e, a
+ ld hl, -$80
+ add hl, de
+ ld a, l
+ ld [wc5ee], a
+ ld a, h
+ ld [wc5ec], a
+
+ ; -(4 * a ** 2)
+ ld e, a
+ ld d, $0
+ call SurfingMinigame_NTimesDE
+ ld e, l
+ ld d, h
+ ld a, $4
+ call SurfingMinigame_NTimesDE
+ ld a, l
+ xor $ff
+ inc a
+ ld l, a
+ ld a, h
+ xor $ff
+ ld h, a
+
+ push hl
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld d, [hl]
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld e, [hl]
+ pop hl
+
+ add hl, de
+ ld e, l
+ ld d, h
+
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], d
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], e
+ and a
+ ret
+
+.done
+ ld a, $1
+ ld [wc5ed], a
+ and a
+ ret
+
+.positive
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld e, a
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld a, [hl]
+ cp $90
+ jr nc, .okay
+ cp e
+ jr nc, .reset
+.okay
+ ld a, [wc5ec]
+ ld d, a
+ ld a, [wc5ee]
+ ld e, a
+ ld hl, $80
+ add hl, de
+ ld a, l
+ ld [wc5ee], a
+ ld a, h
+ ld [wc5ec], a
+
+ ; 4 * a ** 2
+ ld e, a
+ ld d, $0
+ call SurfingMinigame_NTimesDE
+ ld e, l
+ ld d, h
+ ld a, $4
+ call SurfingMinigame_NTimesDE
+
+ push hl
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld d, [hl]
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld e, [hl]
+ pop hl
+
+ add hl, de
+ ld e, l
+ ld d, h
+
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld [hl], d
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], e
+ and a
+ ret
+
+.reset
+ ld hl, ANIM_OBJ_Y_COORD
+ add hl, bc
+ ld a, [wSurfingMinigamePikachuObjectHeight]
+ ld [hl], a
+ ld hl, ANIM_OBJ_FIELD_C
+ add hl, bc
+ ld [hl], $0
+ scf
+ ret
+
+SurfingMinigame_NTimesDE:
+ ld hl, $0
+.loop
+ srl a
+ jr nc, .no_add
+ add hl, de
+.no_add
+ sla e
+ rl d
+ and a
+ jr nz, .loop
+ ret
+
+SurfingPikachu_PlaceBCDNumber:
+ ld c, a
+ swap a
+ and $f
+ add $d0
+ ld [hli], a
+ ld a, c
+ and $f
+ add $d0
+ ld [hl], a
+ dec de
+ ret
+
+SurfingPikachu_Cosine: ; cosine
+ add $10
+SurfingPikachu_Sine: ; sine
+ and $3f
+ cp $20
+ jr nc, .positive
+ call .GetSine
+ ld a, h
+ ret
+
+.positive
+ and $1f
+ call .GetSine
+ ld a, h
+ xor $ff
+ inc a
+ ret
+
+.GetSine:
+ ld e, a
+ ld a, d
+ ld d, $0
+ ld hl, .SineWave
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld hl, $0
+.loop
+ srl a
+ jr nc, .no_add
+ add hl, de
+.no_add
+ sla e
+ rl d
+ and a
+ jr nz, .loop
+ ret
+
+.SineWave:
+ sine_table 32
+
+SurfingPikachuSpawnStateDataPointer:
+ db $00, $00, $00 ; 0
+ db $04, $01, $00 ; 1
+ db $11, $02, $00 ; 2
+ db $12, $02, $00 ; 3
+ db $15, $00, $00 ; 4
+ db $16, $00, $00 ; 5
+ db $17, $00, $00 ; 6
+ db $18, $00, $00 ; 7
+ db $19, $00, $00 ; 8
+ db $1a, $00, $00 ; 9
+ db $14, $00, $00 ; a
+ db $13, $03, $00 ; b
+ db $1b, $04, $00 ; c
+
+SurfingPikachuObjectJumptable:
+ dw SurfingMinigameAnimatedObjectFn_nop ; 0
+ dw SurfingMinigameAnimatedObjectFn_Pikachu ; 1
+ dw Func_f87fb ; 2
+ dw SurfingMinigameAnimatedObjectFn_FlippingPika ; 3
+ dw SurfingMinigameAnimatedObjectFn_IntroAnimationPikachu ; 4
+
+SurfingMinigameAnimatedObjectFn_nop:
+ ret
+
+INCLUDE "data/sprite_anims/surfing_pikachu_frames.asm"
+INCLUDE "data/sprite_anims/surfing_pikachu_oam.asm"
+
+SurfingMinigame_LYOverridesInitialSineWave:
+; a sine wave with amplitude 2
+ db 0, 0, 0, 1, 1, 1, 1, 2
+ db 2, 2, 1, 1, 1, 1, 0, 0
+ db 0, 0, 0, -1, -1, -1, -1, -2
+ db -2, -2, -1, -1, -1, -1, 0, 0
+
+Unkn_f96e5:
+ db $00, $00, $00, $00 ; 00
+ db $0b, $0b, $0b, $0b ; 01
+ db $0b, $02, $02, $06 ; 02
+ db $03, $0b, $07, $03 ; 03
+ db $06, $06, $06, $06 ; 04
+ db $07, $07, $07, $07 ; 05
+ db $06, $04, $04, $08 ; 06
+ db $05, $07, $08, $05 ; 07
+ db $0b, $0b, $11, $12 ; 08
+ db $0b, $0b, $13, $03 ; 09
+ db $14, $12, $04, $08 ; 0a
+ db $13, $07, $08, $05 ; 0b
+ db $06, $14, $06, $14 ; 0c
+ db $13, $07, $13, $07 ; 0d
+ db $08, $08, $08, $08 ; 0e
+ db $14, $12, $14, $12 ; 0f
+ db $0b, $11, $02, $14 ; 10
+ db $06, $14, $06, $14 ; 11
+ db $0c, $0c, $0d, $0d ; 12
+ db $0d, $0d, $0d, $0d ; 13
+ db $0e, $0f, $10, $0b ; 14
+ db $12, $13, $12, $13 ; 15
+
+Unkn_f973d:
+ db $00, $00, $00, $01, $01, $01, $01, $01
+Unkn_f9745:
+ db $00, $00, $00, $01, $01, $02, $04, $06
+Unkn_f974d:
+ db $00, $00, $00, $01, $02, $04, $06, $0e
+Unkn_f9755:
+ db $00, $00, $00, $10, $11, $06, $0e, $0e
+Unkn_f975d:
+ db $00, $00, $00, $15, $15, $0e, $0e, $0e
+Unkn_f9765:
+ db $00, $00, $00, $03, $05, $07, $0e, $0e
+Unkn_f976d:
+ db $00, $00, $00, $01, $03, $05, $07, $0e
+Unkn_f9775:
+ db $00, $00, $00, $01, $01, $03, $05, $07
+Unkn_f977d:
+ db $00, $00, $00, $01, $01, $02, $04, $06
+Unkn_f9785:
+ db $00, $00, $00, $01, $02, $04, $06, $0e
+Unkn_f978d:
+ db $00, $00, $00, $08, $0f, $0a, $0e, $0e
+Unkn_f9795:
+ db $00, $00, $00, $09, $0d, $0b, $0e, $0e
+Unkn_f979d:
+ db $00, $00, $00, $01, $03, $05, $07, $0e
+Unkn_f97a5:
+ db $00, $00, $00, $01, $01, $03, $05, $07
+Unkn_f97ad:
+ db $00, $00, $00, $01, $01, $02, $04, $06
+Unkn_f97b5:
+ db $00, $00, $00, $01, $10, $11, $06, $0e
+Unkn_f97bd:
+ db $00, $00, $00, $01, $15, $15, $0e, $0e
+Unkn_f97c5:
+ db $00, $00, $00, $01, $03, $05, $07, $0e
+Unkn_f97cd:
+ db $00, $00, $00, $01, $01, $03, $05, $07
+Unkn_f97d5:
+ db $00, $00, $00, $01, $01, $02, $04, $06
+Unkn_f97dd:
+ db $00, $00, $00, $01, $08, $0f, $0a, $0e
+Unkn_f97e5:
+ db $00, $00, $00, $01, $09, $0d, $0b, $0e
+Unkn_f97ed:
+ db $00, $00, $00, $01, $01, $03, $05, $07
+Unkn_f97f5:
+ db $00, $00, $00, $01, $01, $10, $11, $06
+Unkn_f97fd:
+ db $00, $00, $00, $01, $01, $15, $15, $0e
+Unkn_f9805:
+ db $00, $00, $00, $01, $01, $03, $05, $07
+Unkn_f980d:
+ db $00, $00, $00, $01, $01, $08, $0f, $0a
+Unkn_f9815:
+ db $00, $00, $00, $01, $01, $09, $0d, $0b
+Unkn_f981d:
+ db $00, $00, $00, $14, $14, $14, $14, $14
+Unkn_f9825:
+ db $00, $00, $00, $12, $13, $13, $13, $13
diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm
index 0410de21..938579f3 100644
--- a/engine/movie/credits.asm
+++ b/engine/movie/credits.asm
@@ -1,140 +1,130 @@
HallOfFamePC:
- farcall AnimateHallOfFame
+ callfar AnimateHallOfFame
call ClearScreen
ld c, 100
call DelayFrames
+
call DisableLCD
- ld hl, vFont
- ld bc, ($80 tiles) / 2
- call ZeroMemory
- ld hl, vChars2 tile $60
- ld bc, ($20 tiles) / 2
- call ZeroMemory
- ld hl, vChars2 tile $7e
- ld bc, 1 tiles
- ld a, $ff ; solid black
- call FillMemory
+ ld a, $a7
+ ldh [rWX], a
+ xor a
+ ldh [rSCX], a
+ ldh [rSCY], a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ldh [hWY], a
+ ldh [rWY], a
+ call CreditsLoadFont
hlcoord 0, 0
call FillFourRowsWithBlack
hlcoord 0, 14
call FillFourRowsWithBlack
ld a, %11000000
ldh [rBGP], a
+ call UpdateGBCPal_BGP
call EnableLCD
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySoundWaitForCurrent
+ call StopAllMusic
+ ld hl, vBGMap1
+ call CreditsCopyTileMapToVRAM
+ ld hl, vBGMap0
+ call CreditsCopyTileMapToVRAM
ld c, BANK(Music_Credits)
ld a, MUSIC_CREDITS
call PlayMusic
ld c, 128
call DelayFrames
xor a
- ld [wUnusedCD3D], a ; not read
+ ld [wHoFMonSpecies], a
ld [wNumCreditsMonsDisplayed], a
jp Credits
FadeInCreditsText:
+ ld a, 1
+ ldh [hAutoBGTransferEnabled], a
ld hl, HoFGBPalettes
ld b, 4
.loop
ld a, [hli]
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 5
call DelayFrames
dec b
jr nz, .loop
ret
+HoFGBPalettes:
+ db %11000000
+ db %11010000
+ db %11100000
+ db %11110000
+
DisplayCreditsMon:
+ ld hl, vBGMap1
+ call CreditsCopyTileMapToVRAM
xor a
ldh [hAutoBGTransferEnabled], a
- call SaveScreenTilesToBuffer1
+ ld hl, rLCDC
+ set 3, [hl]
+ call SaveScreenTilesToBuffer2
call FillMiddleOfScreenWithWhite
-
- ; display the next monster from CreditsMons
- ld hl, wNumCreditsMonsDisplayed
- ld c, [hl] ; how many monsters have we displayed so far?
- inc [hl]
- ld b, 0
- ld hl, CreditsMons
- add hl, bc ; go that far in the list of monsters and get the next one
- ld a, [hl]
- ld [wcf91], a
- ld [wd0b5], a
- hlcoord 8, 6
- call GetMonHeader
- call LoadFrontSpriteByMonIndex
- ld hl, vBGMap0 + $c
+ call GetNextCreditsMon
+ ld hl, vBGMap0 + 12
call CreditsCopyTileMapToVRAM
xor a
ldh [hAutoBGTransferEnabled], a
- call LoadScreenTilesFromBuffer1
+ call LoadScreenTilesFromBuffer2DisableBGTransfer
ld hl, vBGMap0
call CreditsCopyTileMapToVRAM
- ld a, $A7
- ldh [rWX], a
- ld hl, vBGMap1
- call CreditsCopyTileMapToVRAM
- call FillMiddleOfScreenWithWhite
ld a, %11111100 ; make the mon a black silhouette
ldh [rBGP], a
-
-; scroll the mon left by one tile 7 times
- ld bc, 7
-.scrollLoop1
+ call UpdateGBCPal_BGP
+ ld hl, rLCDC
+ res 3, [hl]
+ ld a, 1
+ ldh [hAutoBGTransferEnabled], a
+ ld b, 0
+ ld c, 10
call ScrollCreditsMonLeft
- dec c
- jr nz, .scrollLoop1
-
-; scroll the mon left by one tile 20 times
-; This time, we have to move the window left too in order to hide the text that
-; is wrapping around to the right side of the screen.
- ld c, 20
-.scrollLoop2
+ call FillLeftHalfOfScreenWithWhite
+ ld c, 10
+ call ScrollCreditsMonLeft
+ call FillRightHalfOfScreenWithWhite
+ ld c, 8
call ScrollCreditsMonLeft
- ldh a, [rWX]
- sub 8
- ldh [rWX], a
- dec c
- jr nz, .scrollLoop2
-
- xor a
- ldh [hWY], a
ld a, %11000000
ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ xor a
+ ldh [hSCX], a
ret
-INCLUDE "data/credits/credits_mons.asm"
-
ScrollCreditsMonLeft:
- ld h, b
- ld l, $20
- call ScrollCreditsMonLeft_SetSCX
- ld h, $0
- ld l, $70
- call ScrollCreditsMonLeft_SetSCX
ld a, b
- add $8
+ ldh [hSCX], a
+ add 8
ld b, a
+ call DelayFrame
+ dec c
+ jr nz, ScrollCreditsMonLeft
ret
-ScrollCreditsMonLeft_SetSCX:
- ldh a, [rLY]
- cp l
- jr nz, ScrollCreditsMonLeft_SetSCX
- ld a, h
- ldh [rSCX], a
-.loop
- ldh a, [rLY]
- cp h
- jr z, .loop
+GetNextCreditsMon:
+ ld hl, wNumCreditsMonsDisplayed
+ ld c, [hl]
+ inc [hl]
+ ld b, 0
+ ld hl, CreditsMons
+ add hl, bc
+ ld a, [hl]
+ ld [wcf91], a
+ ld [wd0b5], a
+ hlcoord 8, 6
+ call GetMonHeader
+ call LoadFrontSpriteByMonIndex
ret
-HoFGBPalettes:
- db %11000000
- db %11010000
- db %11100000
- db %11110000
+INCLUDE "data/credits/credits_mons.asm"
CreditsCopyTileMapToVRAM:
ld a, l
@@ -145,6 +135,23 @@ CreditsCopyTileMapToVRAM:
ldh [hAutoBGTransferEnabled], a
jp Delay3
+CreditsLoadFont:
+ call LoadFontTilePatterns
+ ld hl, vChars1
+ ld bc, ($80 tiles) / 2
+ call ZeroMemory
+
+ call LoadTextBoxTilePatterns
+ ld hl, vChars2 tile $60
+ ld bc, ($20 tiles) / 2
+ call ZeroMemory
+
+ ld hl, vChars2 tile $7e
+ ld bc, 1 tiles
+ ld a, $ff ; solid black
+ call FillMemory
+ ret
+
ZeroMemory:
; zero bc bytes at hl
ld [hl], 0
@@ -167,7 +174,40 @@ FillMiddleOfScreenWithWhite:
ld a, " "
jp FillMemory
-Credits:
+FillLeftHalfOfScreenWithWhite:
+ hlcoord 0, 4
+ push bc
+ call FillHalfOfScreenWithWhite
+ pop bc
+ ret
+
+FillRightHalfOfScreenWithWhite:
+ hlcoord 10, 4
+ push bc
+ call FillHalfOfScreenWithWhite
+ pop bc
+ ret
+
+FillHalfOfScreenWithWhite:
+ ld b, 10
+ ld c, 10
+ ld a, " "
+.loop
+ push bc
+ push hl
+.innerLoop
+ ld [hli], a
+ dec c
+ jr nz, .innerLoop
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .loop
+ ret
+
+Credits: ; Roll credits
ld de, CreditsOrder
push de
.nextCreditsScreen
@@ -192,58 +232,47 @@ Credits:
jr z, .showCopyrightText
cp CRED_THE_END
jr z, .showTheEnd
- push hl
- push hl
- ld hl, CreditsTextPointers
- add a
- ld c, a
- ld b, 0
- add hl, bc
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld a, [de]
- inc de
- ld c, a
- ld b, -1
- pop hl
- add hl, bc
- call PlaceString
- pop hl
- ld bc, SCREEN_WIDTH * 2
- add hl, bc
+ call PlaceCreditsText
pop de
jr .nextCreditsCommand
+
+.showCopyrightText
+ farcall LoadCopyrightTiles
+ pop de
+ jr .nextCreditsCommand
+
+
.fadeInTextAndShowMon
call FadeInCreditsText
- ld c, 90
+ ld c, 102
jr .next1
+
.showTextAndShowMon
- ld c, 110
+ ld c, 122
.next1
call DelayFrames
call DisplayCreditsMon
jr .nextCreditsScreen
+
.fadeInText
call FadeInCreditsText
- ld c, 120
+ ld c, 132
jr .next2
+
.showText
- ld c, 140
+ ld c, 152
.next2
call DelayFrames
jr .nextCreditsScreen
-.showCopyrightText
- push de
- farcall LoadCopyrightTiles
- pop de
- pop de
- jr .nextCreditsCommand
.showTheEnd
- ld c, 16
+ call ShowTheEndGFX
+ pop de
+ ret
+
+ShowTheEndGFX:
+ ld c, 24
call DelayFrames
call FillMiddleOfScreenWithWhite
- pop de
ld de, TheEndGfx
ld hl, vChars2 tile $60
lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10
@@ -258,8 +287,31 @@ Credits:
TheEndTextString:
; "T H E E N D"
- db $60," ",$62," ",$64," ",$64," ",$66," ",$68,"@"
- db $61," ",$63," ",$65," ",$65," ",$67," ",$69,"@"
+ db $60, " ", $62, " ", $64, " ", $64, " ", $66, " ", $68, "@"
+ db $61, " ", $63, " ", $65, " ", $65, " ", $67, " ", $69, "@"
+
+PlaceCreditsText:
+ push hl
+ push hl
+ ld hl, CreditsTextPointers
+ ld c, a
+ ld b, 0
+ add hl, bc
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ pop hl
+ ld a, [de]
+ inc de
+ ld c, a
+ ld b, -1
+ add hl, bc
+ call PlaceString
+ pop hl
+ ld bc, SCREEN_WIDTH * 2
+ add hl, bc
+ ret
INCLUDE "data/credits/credits_order.asm"
diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm
index 77840556..2cf841c8 100644
--- a/engine/movie/evolution.asm
+++ b/engine/movie/evolution.asm
@@ -9,9 +9,7 @@ EvolveMon:
xor a
ld [wLowHealthAlarm], a
ld [wChannelSoundIDs + Ch5], a
- dec a ; SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, $1
ldh [hAutoBGTransferEnabled], a
ld a, SFX_TINK
@@ -67,9 +65,7 @@ EvolveMon:
ld a, [wEvoNewSpecies]
.done
ld [wWholeScreenPaletteMonSpecies], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, [wWholeScreenPaletteMonSpecies]
call PlayCry
ld c, 0
diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm
index d37d95f8..db3ab617 100644
--- a/engine/movie/hall_of_fame.asm
+++ b/engine/movie/hall_of_fame.asm
@@ -58,8 +58,7 @@ AnimateHallOfFame:
ld c, 80
call DelayFrames
hlcoord 2, 13
- ld b, 3
- ld c, 14
+ lb bc, 3, 14
call TextBoxBorder
hlcoord 4, 15
ld de, HallOfFameText
@@ -77,7 +76,7 @@ AnimateHallOfFame:
ld bc, HOF_MON
call AddNTimes
ld [hl], $ff
- call SaveHallOfFameTeams
+ callfar SaveHallOfFameTeams ; useless since in same bank
xor a
ld [wHoFMonSpecies], a
inc a
@@ -122,6 +121,7 @@ HoFShowMonOrPlayer:
call RunPaletteCommand
ld a, %11100100
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, $31 ; back pic
call HoFLoadMonPlayerPicTileIDs
ld d, $a0
@@ -154,12 +154,27 @@ HoFDisplayAndRecordMonInfo:
ld hl, wPartyMonNicks
call GetPartyMonName
call HoFDisplayMonInfo
+ ld a, [wHoFPartyMonIndex]
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_70336
+ ld e, $22
+ callfar PlayPikachuSoundClip
+ jr .asm_7033c
+.asm_70336
+ ld a, [wHoFMonSpecies]
+ call PlayCry
+.asm_7033c
jp HoFRecordMonInfo
+Func_7033f:
+ call HoFDisplayMonInfo
+ ld a, [wHoFMonSpecies]
+ jp PlayCry
+
HoFDisplayMonInfo:
hlcoord 0, 2
- ld b, 9
- ld c, 10
+ lb bc, 9, 10
call TextBoxBorder
hlcoord 2, 6
ld de, HoFMonInfoText
@@ -174,8 +189,7 @@ HoFDisplayMonInfo:
ld [wd0b5], a
hlcoord 3, 9
predef PrintMonType
- ld a, [wHoFMonSpecies]
- jp PlayCry
+ ret
HoFMonInfoText:
db "LEVEL/"
@@ -186,10 +200,13 @@ HoFLoadPlayerPics:
ld de, RedPicFront
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, sSpriteBuffer1
ld de, sSpriteBuffer0
ld bc, $310
call CopyData
+ call PrepareRTCDataAndDisableSRAM
ld de, vFrontPic
call InterlaceMergeSpriteBuffers
ld de, RedPicBack
@@ -210,12 +227,10 @@ HoFDisplayPlayerStats:
SetEvent EVENT_HALL_OF_FAME_DEX_RATING
predef DisplayDexRating
hlcoord 0, 4
- ld b, 6
- ld c, 10
+ lb bc, 6, 10
call TextBoxBorder
hlcoord 5, 0
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
hlcoord 7, 2
ld de, wPlayerName
diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm
index 9813d67c..a9774ff9 100644
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -11,8 +11,7 @@ PlayIntro:
inc a
ldh [hAutoBGTransferEnabled], a
call PlayShootingStar
- call PlayIntroScene
- call GBFadeOutToWhite
+ callfar PlayIntroScene
xor a
ldh [hSCX], a
ldh [hAutoBGTransferEnabled], a
@@ -20,162 +19,6 @@ PlayIntro:
call DelayFrame
ret
-PlayIntroScene:
- ld b, SET_PAL_NIDORINO_INTRO
- call RunPaletteCommand
- ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
- ldh [rBGP], a
- ldh [rOBP0], a
- ldh [rOBP1], a
- xor a
- ldh [hSCX], a
- ld b, TILEMAP_GENGAR_INTRO_1
- call IntroCopyTiles
- ld a, 0
- ld [wBaseCoordX], a
- ld a, 80
- ld [wBaseCoordY], a
- lb bc, 6, 6
- call InitIntroNidorinoOAM
- lb de, 80 / 2, MOVE_NIDORINO_RIGHT
- call IntroMoveMon
- ret c
-
-; hip
- ld a, SFX_INTRO_HIP
- call PlaySound
- xor a
- ld [wIntroNidorinoBaseTile], a
- ld de, IntroNidorinoAnimation1
- call AnimateIntroNidorino
-; hop
- ld a, SFX_INTRO_HOP
- call PlaySound
- ld de, IntroNidorinoAnimation2
- call AnimateIntroNidorino
- ld c, 10
- call CheckForUserInterruption
- ret c
-
-; hip
- ld a, SFX_INTRO_HIP
- call PlaySound
- ld de, IntroNidorinoAnimation1
- call AnimateIntroNidorino
-; hop
- ld a, SFX_INTRO_HOP
- call PlaySound
- ld de, IntroNidorinoAnimation2
- call AnimateIntroNidorino
- ld c, 30
- call CheckForUserInterruption
- ret c
-
-; raise
- ld b, TILEMAP_GENGAR_INTRO_2
- call IntroCopyTiles
- ld a, SFX_INTRO_RAISE
- call PlaySound
- lb de, 8 / 2, MOVE_GENGAR_LEFT
- call IntroMoveMon
- ld c, 30
- call CheckForUserInterruption
- ret c
-
-; slash
- ld b, TILEMAP_GENGAR_INTRO_3
- call IntroCopyTiles
- ld a, SFX_INTRO_CRASH
- call PlaySound
- lb de, 16 / 2, MOVE_GENGAR_RIGHT
- call IntroMoveMon
-; hip
- ld a, SFX_INTRO_HIP
- call PlaySound
- ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE
- ld [wIntroNidorinoBaseTile], a
- ld de, IntroNidorinoAnimation3
- call AnimateIntroNidorino
- ld c, 30
- call CheckForUserInterruption
- ret c
-
- lb de, 8 / 2, MOVE_GENGAR_LEFT
- call IntroMoveMon
- ld b, TILEMAP_GENGAR_INTRO_1
- call IntroCopyTiles
- ld c, 60
- call CheckForUserInterruption
- ret c
-
-; hip
- ld a, SFX_INTRO_HIP
- call PlaySound
- xor a
- ld [wIntroNidorinoBaseTile], a
- ld de, IntroNidorinoAnimation4
- call AnimateIntroNidorino
-; hop
- ld a, SFX_INTRO_HOP
- call PlaySound
- ld de, IntroNidorinoAnimation5
- call AnimateIntroNidorino
- ld c, 20
- call CheckForUserInterruption
- ret c
-
- ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / LEN_2BPP_TILE
- ld [wIntroNidorinoBaseTile], a
- ld de, IntroNidorinoAnimation6
- call AnimateIntroNidorino
- ld c, 30
- call CheckForUserInterruption
- ret c
-
-; lunge
- ld a, SFX_INTRO_LUNGE
- call PlaySound
- ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / LEN_2BPP_TILE
- ld [wIntroNidorinoBaseTile], a
- ld de, IntroNidorinoAnimation7
- jp AnimateIntroNidorino
-
-AnimateIntroNidorino:
- ld a, [de]
- cp ANIMATION_END
- ret z
- ld [wBaseCoordY], a
- inc de
- ld a, [de]
- ld [wBaseCoordX], a
- push de
- ld c, 6 * 6
- call UpdateIntroNidorinoOAM
- ld c, 5
- call DelayFrames
- pop de
- inc de
- jr AnimateIntroNidorino
-
-UpdateIntroNidorinoOAM:
- ld hl, wOAMBuffer
- ld a, [wIntroNidorinoBaseTile]
- ld d, a
-.loop
- ld a, [wBaseCoordY]
- add [hl]
- ld [hli], a ; Y
- ld a, [wBaseCoordX]
- add [hl]
- ld [hli], a ; X
- ld a, d
- ld [hli], a ; tile
- inc hl
- inc d
- dec c
- jr nz, .loop
- ret
-
InitIntroNidorinoOAM:
ld hl, wOAMBuffer
ld d, 0
@@ -232,83 +75,17 @@ IntroPlaceBlackTiles:
jr nz, .loop
ret
-IntroMoveMon:
-; d = number of times to move the mon (2 pixels each time)
- ld a, e
- cp MOVE_NIDORINO_RIGHT
- jr z, .moveNidorinoRight
- cp MOVE_GENGAR_LEFT
- jr z, .moveGengarLeft
-; move Gengar right
- ldh a, [hSCX]
- dec a
- dec a
- jr .next
-.moveNidorinoRight
- push de
- ld a, 2
- ld [wBaseCoordX], a
- xor a
- ld [wBaseCoordY], a
- ld c, 6 * 6
- call UpdateIntroNidorinoOAM
- pop de
-.moveGengarLeft
- ldh a, [hSCX]
- inc a
- inc a
-.next
- ldh [hSCX], a
- push de
- ld c, 2
- call CheckForUserInterruption
- pop de
- ret c
- dec d
- jr nz, IntroMoveMon
- ret
-
-IntroCopyTiles:
- hlcoord 13, 7
-
CopyTileIDsFromList_ZeroBaseTileID:
ld c, 0
predef_jump CopyTileIDsFromList
-PlayMoveSoundB:
-; unused
- predef GetMoveSoundB
- ld a, b
- jp PlaySound
-
-LoadIntroGraphics:
- ld hl, FightIntroBackMon
- ld de, vChars2
- ld bc, FightIntroBackMonEnd - FightIntroBackMon
- ld a, BANK(FightIntroBackMon)
- call FarCopyData2
- ld hl, GameFreakIntro
- ld de, vChars2 + (FightIntroBackMonEnd - FightIntroBackMon)
- ld bc, GameFreakIntroEnd - GameFreakIntro
- ld a, BANK(GameFreakIntro)
- call FarCopyData2
- ld hl, GameFreakIntro
- ld de, vChars1
- ld bc, GameFreakIntroEnd - GameFreakIntro
- ld a, BANK(GameFreakIntro)
- call FarCopyData2
- ld hl, FightIntroFrontMon
- ld de, vChars0
- ld bc, FightIntroFrontMonEnd - FightIntroFrontMon
- ld a, BANK(FightIntroFrontMon)
- jp FarCopyData2
-
PlayShootingStar:
ld b, SET_PAL_GAME_FREAK_INTRO
call RunPaletteCommand
farcall LoadCopyrightAndTextBoxTiles
ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 180
call DelayFrames
call ClearScreen
@@ -316,7 +93,27 @@ PlayShootingStar:
xor a
ld [wCurOpponent], a
call IntroDrawBlackBars
- call LoadIntroGraphics
+; write the black and white tiles
+ ld hl, vChars2
+ ld bc, $10
+ xor a
+ call FillMemory
+ ld hl, vChars2 + $10
+ ld bc, $10
+ ld a, $ff
+ call FillMemory
+; copy gamefreak logo and others
+ ld hl, GameFreakIntro
+ ld de, vChars2 + $600
+ ld bc, GameFreakIntroEnd - GameFreakIntro
+ ld a, BANK(GameFreakIntro)
+ call FarCopyData
+ ld hl, GameFreakIntro
+ ld de, vChars1
+ ld bc, GameFreakIntroEnd - GameFreakIntro
+ ld a, BANK(GameFreakIntro)
+ call FarCopyData
+
call EnableLCD
ld hl, rLCDC
res 5, [hl]
@@ -330,12 +127,6 @@ PlayShootingStar:
ld c, 40
call DelayFrames
.next
- ld a, BANK(Music_IntroBattle)
- ld [wAudioROMBank], a
- ld [wAudioSavedROMBank], a
- ld a, MUSIC_INTRO_BATTLE
- ld [wNewSoundID], a
- call PlaySound
call IntroClearMiddleOfScreen
call ClearSprites
jp Delay3
@@ -359,108 +150,8 @@ IntroDrawBlackBars:
EmptyFunc2:
ret
-IntroNidorinoAnimation0:
- db 0, 0
- db ANIMATION_END
-
-IntroNidorinoAnimation1:
-; This is a sequence of pixel movements for part of the Nidorino animation. This
-; list describes how Nidorino should hop.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db -2, 2
- db -1, 2
- db 1, 2
- db 2, 2
- db ANIMATION_END
-
-IntroNidorinoAnimation2:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db -2, -2
- db -1, -2
- db 1, -2
- db 2, -2
- db ANIMATION_END
-
-IntroNidorinoAnimation3:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db -12, 6
- db -8, 6
- db 8, 6
- db 12, 6
- db ANIMATION_END
-
-IntroNidorinoAnimation4:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db -8, -4
- db -4, -4
- db 4, -4
- db 8, -4
- db ANIMATION_END
-
-IntroNidorinoAnimation5:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db -8, 4
- db -4, 4
- db 4, 4
- db 8, 4
- db ANIMATION_END
-
-IntroNidorinoAnimation6:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db 0, 0
- db 2, 0
- db 2, 0
- db 0, 0
- db ANIMATION_END
-
-IntroNidorinoAnimation7:
-; This is a sequence of pixel movements for part of the Nidorino animation.
-; First byte is y movement, second byte is x movement
- db -8, -16
- db -7, -14
- db -6, -12
- db -4, -10
- db ANIMATION_END
-
GameFreakIntro:
INCBIN "gfx/splash/gamefreak_presents.2bpp"
INCBIN "gfx/splash/gamefreak_logo.2bpp"
ds 16, $00 ; blank tile
GameFreakIntroEnd:
-
-FightIntroBackMon:
- INCBIN "gfx/intro/gengar.2bpp"
- ds 16, $00 ; blank tile
-FightIntroBackMonEnd:
-
-IF DEF(_RED)
-FightIntroFrontMon:
- INCBIN "gfx/intro/red_nidorino_1.2bpp"
-FightIntroFrontMon2:
- INCBIN "gfx/intro/red_nidorino_2.2bpp"
-FightIntroFrontMon3:
- INCBIN "gfx/intro/red_nidorino_3.2bpp"
-ENDC
-
-IF DEF(_BLUE)
-FightIntroFrontMon:
- INCBIN "gfx/intro/blue_jigglypuff_1.2bpp"
-FightIntroFrontMon2:
- INCBIN "gfx/intro/blue_jigglypuff_2.2bpp"
-FightIntroFrontMon3:
- INCBIN "gfx/intro/blue_jigglypuff_3.2bpp"
-ENDC
-
-FightIntroFrontMonEnd:
-
- ds 16, $00 ; blank tile
diff --git a/engine/movie/intro_yellow.asm b/engine/movie/intro_yellow.asm
new file mode 100644
index 00000000..8a2e6f4c
--- /dev/null
+++ b/engine/movie/intro_yellow.asm
@@ -0,0 +1,1085 @@
+PlayIntroScene:
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $f
+ ldh [rIE], a
+ ld a, $8
+ ldh [rSTAT], a
+ call InitYellowIntroGFXAndMusic
+ call DelayFrame
+.loop
+ ld a, [wYellowIntroCurrentScene]
+ bit 7, a
+ jr nz, .go_to_title_screen
+ call JoypadLowSensitivity
+ ldh a, [hJoyPressed]
+ and A_BUTTON | B_BUTTON | START
+ jr nz, .go_to_title_screen
+ call Func_f98fc
+ ld a, $0
+ ld [wCurrentAnimatedObjectOAMBufferOffset], a
+ call RunObjectAnimations
+ ld a, [wYellowIntroCurrentScene]
+ cp $7
+ call z, Func_f98a2
+ cp $b
+ call z, Func_f98cb
+ call DelayFrame
+ jr .loop
+
+.go_to_title_screen
+ call YellowIntro_BlankPalettes
+ xor a
+ ldh [hLCDCPointer], a
+ call DelayFrame
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ ld a, $90
+ ldh [hWY], a
+ call ClearObjectAnimationBuffers
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ xor a
+ call Bank3E_FillMemory
+ call YellowIntro_BlankOAMBuffer
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ret
+
+Func_f98a2:
+ ld a, [wOAMBuffer + 8 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 8 * 4 + 3], a
+ ld a, [wOAMBuffer + 14 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 14 * 4 + 3], a
+ ld a, [wOAMBuffer + 16 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 16 * 4 + 3], a
+ ld a, [wOAMBuffer + 18 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 18 * 4 + 3], a
+ ld a, [wOAMBuffer + 19 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 19 * 4 + 3], a
+ ret
+
+Func_f98cb:
+ ld a, [wOAMBuffer + 18 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 18 * 4 + 3], a
+ ld a, [wOAMBuffer + 19 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 19 * 4 + 3], a
+ ld a, [wOAMBuffer + 20 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 20 * 4 + 3], a
+ ld a, [wOAMBuffer + 25 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 25 * 4 + 3], a
+ ld a, [wOAMBuffer + 26 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 26 * 4 + 3], a
+ ld a, [wOAMBuffer + 28 * 4 + 3]
+ or $1
+ ld [wOAMBuffer + 28 * 4 + 3], a
+ ret
+
+Func_f98fc:
+ ld a, [wYellowIntroCurrentScene]
+ ld hl, Jumptable_f9906
+ call Func_fa06e
+ jp hl
+
+Jumptable_f9906:
+ dw YellowIntroScene0 ; running pika 1
+ dw YellowIntroScene1 ; wait last
+ dw YellowIntroScene2 ; pikachu kick
+ dw YellowIntroScene3 ; wait last
+ dw YellowIntroScene4 ; running pika 2
+ dw YellowIntroScene5 ; wait last
+ dw YellowIntroScene6 ; surfing pika
+ dw YellowIntroScene7 ; wait last
+ dw YellowIntroScene8 ; running pika 3
+ dw YellowIntroScene9 ; wait last
+ dw YellowIntroScene10 ; flying pika
+ dw YellowIntroScene11 ; wait last
+ dw YellowIntroScene12 ; pika close up
+ dw YellowIntroScene13 ; wait last
+ dw YellowIntroScene14 ; pika thunderbolt
+ dw YellowIntroScene15 ; wait last
+ dw YellowIntroScene16 ; fade to white
+ dw YellowIntroScene17 ; wait and quit
+
+YellowIntro_NextScene:
+ ld hl, wYellowIntroCurrentScene
+ inc [hl]
+ ret
+
+YellowIntroScene0:
+ xor a
+ ldh [hLCDCPointer], a
+ lb de, $58, $58
+ ld a, $1
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ xor a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ld a, $90
+ ldh [hWY], a
+ ld a, $e4
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ld a, $c4
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ld a, 130
+ ld [wYellowIntroSceneTimer], a
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene1:
+ call YellowIntro_CheckFrameTimerDecrement
+ ret nc
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene2:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $8
+ call UpdateMusicCTimes
+ xor a
+ ldh [hLCDCPointer], a
+ ld hl, vBGMap0
+ ld bc, $400
+ xor a
+ call Bank3E_FillMemory
+ call YellowIntroScene2_PlaceGraphic
+ lb de, $58, $b8 ; overloaded
+ ld a, $4 ; overloaded
+ call LoadYellowIntroFlyingSpeedBars
+ ld a, $1
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor128Frames
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene2_PlaceGraphic:
+ ld hl, $98d4 ; (20, 6)
+ ld de, $20
+ ld b, $6
+ ld a, $90
+.row
+ ld c, $6
+ push af
+ push hl
+.col
+ ld [hli], a
+ inc a
+ dec c
+ jr nz, .col
+ pop hl
+ add hl, de
+ pop af
+ add $10
+ dec b
+ jr nz, .row
+ ldh a, [hGBC]
+ and a
+ jr z, .dmg_sgb
+ ; We can actually set palettes!
+ ld hl, $98d4 ; (20, 6)
+ ld de, $20
+ ld b, $6
+ ld a, $1
+ ldh [rVBK], a
+.attr_row
+ ld c, $6
+ push hl
+.attr_col
+ ld [hli], a
+ dec c
+ jr nz, .attr_col
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .attr_row
+ xor a
+ ldh [rVBK], a
+.dmg_sgb
+ ret
+
+LoadYellowIntroFlyingSpeedBars:
+ ld hl, YellowIntroFlyingSpeedBarData
+ ld a, $8
+.loop
+; Spawn object $8 at indicated coordinates with indicated speeds
+ push af
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ inc hl
+ ld a, [hli]
+ push hl
+ push af
+ ld a, $8
+ call SpawnAnimatedObject
+ pop af
+ ld hl, $b
+ add hl, bc
+ ld [hl], a
+ pop hl
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+YellowIntroFlyingSpeedBarData:
+ ; y, x, speed
+ db $d0, $20, $02
+ db $f0, $30, $04
+ db $d0, $40, $06
+ db $c0, $50, $08
+ db $e0, $60, $08
+ db $c0, $70, $06
+ db $e0, $80, $04
+ db $f0, $90, $02
+
+YellowIntroScene3:
+ call YellowIntro_CheckFrameTimerDecrement
+ jr c, .expired
+ ldh a, [hSCX]
+ cp $68
+ ret z
+ add $4
+ ldh [hSCX], a
+ ret
+
+.expired
+ call MaskAllAnimatedObjectStructs
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene4:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ ldh a, [hGBC]
+ and a
+ jr z, .dmg_sgb
+ ; We can actually set palettes!
+ ld hl, $98d4
+ ld de, $20
+ ld b, $6
+ ld a, $1
+ ldh [rVBK], a
+ xor a
+.attr_row
+ ld c, $6
+ push hl
+.attr_col
+ ld [hli], a
+ dec c
+ jr nz, .attr_col
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .attr_row
+ xor a
+ ldh [rVBK], a
+.dmg_sgb
+ xor a
+ ldh [hLCDCPointer], a
+ call Func_f9e5f
+ lb de, $58, $58
+ ld a, $2
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ xor a
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor128Frames
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene5:
+ call YellowIntro_CheckFrameTimerDecrement
+ ret nc
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene6:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ ld a, LOW(rSCY)
+ ldh [hLCDCPointer], a
+ call YellowIntro_Copy8BitSineWave
+ ld hl, vBGMap0
+ ld bc, $60
+ xor a
+ call Bank3E_FillMemory
+ ld hl, $9860
+ ld c, $10
+ ld a, $20
+.asm_f9a8b
+ ld [hli], a
+ inc a
+ ld [hli], a
+ dec a
+ dec c
+ jr nz, .asm_f9a8b
+ ld hl, $9880
+ ld bc, $300
+ ld a, $10
+ call Bank3E_FillMemory
+ lb de, $40, $f8
+ ld a, $5
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ ld a, $1
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor88Frames
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene7:
+ call YellowIntro_CheckFrameTimerDecrement
+ jr c, .expired
+ ld hl, hSCX
+ inc [hl]
+ inc [hl]
+ ld hl, wLYOverridesBuffer
+ ld de, wLYOverridesBuffer + 1
+ ld a, [hl]
+ push af
+ ld c, $ff
+.shift_loop
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .shift_loop
+ pop af
+ ld [hl], a
+ call Request7TileTransferFromC810ToC710
+ ret
+
+.expired
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene8:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ xor a
+ ldh [hLCDCPointer], a
+ call Func_f9e5f
+ lb de, $58, $58
+ ld a, $3
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ xor a
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor128Frames
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene9:
+ call YellowIntro_CheckFrameTimerDecrement
+ ret nc
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene10:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ xor a
+ ldh [hLCDCPointer], a
+ ld hl, vBGMap0
+ ld bc, $400
+ xor a
+ call Bank3E_FillMemory
+ ld hl, vBGMap0
+ ld bc, $100
+ ld a, $2
+ call Bank3E_FillMemory
+ ld hl, $9900
+ ld de, Unkn_f9b6e
+ lb bc, 6, 20
+ call .FillBGMapBox
+ ld hl, $988c
+ ld de, Unkn_f9be6
+ lb bc, 3, 4
+ call .FillBGMapBox
+ ld hl, $98e3
+ ld de, Unkn_f9bf2
+ lb bc, 2, 2
+ call .FillBGMapBox
+ lb de, $98, $58
+ ld a, $6
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ ld a, $1
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor128Frames
+ call YellowIntro_NextScene
+ ret
+
+.FillBGMapBox:
+.fill_row
+ push bc
+ push hl
+.fill_col
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .fill_col
+ pop hl
+ ld bc, $20
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .fill_row
+ ret
+
+Unkn_f9b6e: INCBIN "gfx/intro/unknown_f9b6e.map"
+Unkn_f9be6: INCBIN "gfx/intro/unknown_f9be6.map"
+Unkn_f9bf2: INCBIN "gfx/intro/unknown_f9bf2.map"
+
+YellowIntroScene11:
+ call YellowIntro_CheckFrameTimerDecrement
+ jr c, .expired
+ ld a, [wYellowIntroSceneTimer]
+ and $7
+ ret nz
+ ld a, [wYellowIntroSceneTimer]
+ and $8
+ sla a
+ sla a
+ sla a
+ ld e, a
+ ld d, $0
+ ld hl, YellowIntroCloudGFX
+ add hl, de
+ ld a, l
+ ldh [hVBlankCopySource], a
+ ld a, h
+ ldh [hVBlankCopySource + 1], a
+ xor a
+ ldh [hVBlankCopyDest], a
+ ld a, $96
+ ldh [hVBlankCopyDest + 1], a
+ ld a, $4
+ ldh [hVBlankCopySize], a
+ ret
+
+.expired
+ call YellowIntro_MaskCurrentAnimatedObjectStruct
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroCloudGFX: INCBIN "gfx/intro/clouds.2bpp"
+
+YellowIntroScene12:
+ call YellowIntro_BlankPalsDelay2AndDisableLCD
+ ld c, $5
+ call UpdateMusicCTimes
+ xor a
+ ldh [hLCDCPointer], a
+ ld hl, vBGMap0
+ ld bc, $80
+ ld a, $1
+ call Bank3E_FillMemory
+ ld hl, $9880
+ ld bc, $140
+ xor a
+ call Bank3E_FillMemory
+ ld hl, $99c0
+ ld bc, $80
+ ld a, $1
+ call Bank3E_FillMemory
+
+ ; paste 8x12 graphic into vBGMap0 at (5, 6) starting at tile 4, skipping 4 vtiles at the end of each row
+ ld hl, $98c5
+ ld de, $20
+ ld a, $4
+ ld b, 8
+.row
+ ld c, 12
+ push hl
+.col
+ ld [hli], a
+ inc a
+ dec c
+ jr nz, .col
+ pop hl
+ add hl, de
+ add $4
+ dec b
+ jr nz, .row
+
+ ld hl, $98c4 ; (4, 6)
+ ld [hl], $3
+ ld hl, $98e4 ; (4, 7)
+ ld [hl], $74
+ ld hl, $99a5 ; (5, 5)
+ ld [hl], $0
+ lb de, $60, $58
+ ld a, $9
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ xor a
+ call Func_f9e9a
+ call YellowIntro_SetTimerFor128Frames
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene13:
+ call YellowIntro_CheckFrameTimerDecrement
+ ret nc
+ lb de, $68, $58
+ ld a, $a
+ call SpawnAnimatedObject
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroScene14:
+ ld de, YellowIntroPalSequence_f9dd6
+ call YellowIntro_LoadDMGPalAndIncrementCounter
+ jr c, .expired
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ and $f0
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+.expired
+ call MaskAllAnimatedObjectStructs
+ call YellowIntro_BlankOAMBuffer
+ ld hl, wTileMap
+ ld bc, $50
+ ld a, $1
+ call Bank3E_FillMemory
+ hlcoord 0, 4
+ ld bc, CopyVideoDataAlternate
+ xor a
+ call Bank3E_FillMemory
+ hlcoord 0, 14
+ ld bc, $50
+ ld a, $1
+ call Bank3E_FillMemory
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ld a, $e4
+ ldh [rOBP0], a
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ lb de, $58, $58
+ ld a, $7
+ call YellowIntro_SpawnAnimatedObjectAndSavePointer
+ call YellowIntro_NextScene
+ ld a, $28
+ ld [wYellowIntroSceneTimer], a
+ ret
+
+YellowIntroScene15:
+ call YellowIntro_CheckFrameTimerDecrement
+ jr c, .expired
+ ld a, [wYellowIntroSceneTimer]
+ and $3
+ ret nz
+ ldh a, [rOBP0]
+ xor $ff
+ ldh [rOBP0], a
+ ldh a, [rBGP]
+ xor $3
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ ret
+
+.expired
+ xor a
+ ldh [hLCDCPointer], a
+ ld a, $e4
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call YellowIntro_NextScene
+YellowIntroScene16:
+ ld de, YellowIntroPalSequence_f9e0a
+ call YellowIntro_LoadDMGPalAndIncrementCounter
+ jr c, .expired
+ ldh [rOBP0], a
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ ret
+
+.expired
+ call YellowIntro_NextScene
+ ret
+
+YellowIntroPalSequence_f9dd6:
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $e4
+ db $e4, $c0, $c0, $ff
+
+YellowIntroPalSequence_f9e0a:
+ db $e4, $90, $90, $40
+ db $40, $00, $00, $ff
+
+YellowIntroScene17:
+ ld c, 64
+ call DelayFrames
+ ld hl, wYellowIntroCurrentScene
+ set 7, [hl]
+ ret
+
+YellowIntro_SpawnAnimatedObjectAndSavePointer:
+ call SpawnAnimatedObject
+ ld a, c
+ ld [wYellowIntroAnimatedObjectStructPointer], a
+ ld a, b
+ ld [wYellowIntroAnimatedObjectStructPointer + 1], a
+ ret
+
+YellowIntro_MaskCurrentAnimatedObjectStruct:
+ ld a, [wYellowIntroAnimatedObjectStructPointer]
+ ld c, a
+ ld a, [wYellowIntroAnimatedObjectStructPointer + 1]
+ ld b, a
+ call MaskCurrentAnimatedObjectStruct
+ ret
+
+YellowIntro_SetTimerFor128Frames:
+ ld a, 128
+ ld [wYellowIntroSceneTimer], a
+ ret
+
+YellowIntro_SetTimerFor88Frames:
+ ld a, 88
+ ld [wYellowIntroSceneTimer], a
+ ret
+
+YellowIntro_CheckFrameTimerDecrement:
+ ld hl, wYellowIntroSceneTimer
+ ld a, [hl]
+ and a
+ jr z, .asm_f9e4b
+ dec [hl]
+ and a
+ ret
+
+.asm_f9e4b
+ scf
+ ret
+
+YellowIntro_LoadDMGPalAndIncrementCounter:
+ ld hl, wYellowIntroSceneTimer
+ ld a, [hl]
+ inc [hl]
+ ld l, a
+ ld h, $0
+ add hl, de
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_f9e5d
+ and a
+ ret
+
+.asm_f9e5d
+ scf
+ ret
+
+Func_f9e5f:
+ ld hl, vBGMap0
+ ld bc, $80
+ ld a, $1
+ call Bank3E_FillMemory
+ ld hl, $9880
+ ld bc, $140
+ xor a
+ call Bank3E_FillMemory
+ ld hl, $99c0
+ ld bc, $80
+ ld a, $1
+ call Bank3E_FillMemory
+ ret
+
+YellowIntro_BlankPalsDelay2AndDisableLCD:
+ xor a
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ call DelayFrame
+ call DelayFrame
+ call DisableLCD
+ ret
+
+Func_f9e9a:
+ ld e, a
+ callfar YellowIntroPaletteAction
+ xor a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ld a, $90
+ ldh [hWY], a
+ ld a, $e3
+ ldh [rLCDC], a
+ ld a, $e4
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ld a, $e0
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+YellowIntro_Copy8BitSineWave:
+ ; Copy this sine wave into wLYOverridesBuffer 8 times (end just before wc900)
+ ld de, wLYOverridesBuffer
+ ld a, $8
+.loop
+ push af
+ ld hl, .SineWave
+ ld bc, .SineWaveEnd - .SineWave
+ call Bank3E_CopyData
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+.SineWave:
+; a sine wave with amplitude 4
+ db 0, 0, 1, 2, 2, 3, 3, 3
+ db 4, 3, 3, 3, 2, 2, 1, 0
+ db 0, 0, -1, -2, -2, -3, -3, -3
+ db -4, -3, -3, -3, -2, -2, -1, 0
+.SineWaveEnd:
+
+Request7TileTransferFromC810ToC710:
+ ld a, $10
+ ldh [hVBlankCopySource], a
+ ld a, HIGH(wLYOverridesBuffer)
+ ldh [hVBlankCopySource + 1], a
+ ld a, $10
+ ldh [hVBlankCopyDest], a
+ ld a, HIGH(wLYOverrides)
+ ldh [hVBlankCopyDest + 1], a
+ ld a, $7
+ ldh [hVBlankCopySize], a
+ ret
+
+InitYellowIntroGFXAndMusic:
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ldh [hSCX], a
+ ldh [hSCY], a
+ ldh [hAutoBGTransferDest], a
+ ld a, $98
+ ldh [hAutoBGTransferDest + 1], a
+ call YellowIntro_BlankTileMap
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld a, $1
+ call Bank3E_FillMemory
+ hlcoord 0, 4
+ ld bc, CopyVideoDataAlternate
+ xor a
+ call Bank3E_FillMemory
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ld de, YellowIntroGraphics2
+ ld hl, vChars0
+ lb bc, BANK(YellowIntroGraphics2), (YellowIntroGraphics2End - YellowIntroGraphics2 - $10) / $10
+ call CopyVideoData
+ ld de, YellowIntroGraphics1
+ ld hl, vChars2
+ lb bc, BANK(YellowIntroGraphics1), (YellowIntroGraphics1End - YellowIntroGraphics1) / $10
+ call CopyVideoData
+ call ClearObjectAnimationBuffers
+ call LoadYellowIntroObjectAnimationDataPointers
+ ld b, $8
+ call RunPaletteCommand
+ xor a
+ ld hl, wYellowIntroCurrentScene
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld a, MUSIC_YELLOW_INTRO
+ ld c, BANK(Music_YellowIntro)
+ call PlayMusic
+ ret
+
+LoadYellowIntroObjectAnimationDataPointers:
+ ld a, LOW(YellowIntro_AnimatedObjectSpawnStateData)
+ ld [wAnimatedObjectSpawnStateDataPointer], a
+ ld a, HIGH(YellowIntro_AnimatedObjectSpawnStateData)
+ ld [wAnimatedObjectSpawnStateDataPointer + 1], a
+ ld a, LOW(YellowIntro_AnimatedObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer], a
+ ld a, HIGH(YellowIntro_AnimatedObjectJumptable)
+ ld [wAnimatedObjectJumptablePointer + 1], a
+ ld a, LOW(YellowIntro_AnimatedObjectOAMData)
+ ld [wAnimatedObjectOAMDataPointer], a
+ ld a, HIGH(YellowIntro_AnimatedObjectOAMData)
+ ld [wAnimatedObjectOAMDataPointer + 1], a
+ ld a, LOW(YellowIntro_AnimatedObjectFramesData)
+ ld [wAnimatedObjectFramesDataPointer], a
+ ld a, HIGH(YellowIntro_AnimatedObjectFramesData)
+ ld [wAnimatedObjectFramesDataPointer + 1], a
+ ret
+
+YellowIntro_BlankTileMap:
+ ld hl, wTileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld a, $7f
+ call Bank3E_FillMemory
+ ret
+
+Bank3E_CopyData:
+.loop
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ ret
+
+Bank3E_FillMemory:
+ push de
+ ld e, a
+.loop
+ ld a, e
+ ld [hli], a
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ pop de
+ ret
+
+YellowIntro_BlankOAMBuffer:
+ ld hl, wOAMBuffer
+ ld bc, wOAMBufferEnd - wOAMBuffer
+ xor a
+ call Bank3E_FillMemory
+ ret
+
+YellowIntro_BlankPalettes:
+ xor a
+ ldh [rBGP], a
+ ldh [rOBP0], a
+ ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
+ ret
+
+YellowIntro_AnimatedObjectSpawnStateData:
+ db $00, $00, $00
+ db $01, $01, $00
+ db $02, $01, $00
+ db $03, $01, $00
+ db $04, $02, $00
+ db $05, $03, $00
+ db $06, $04, $00
+ db $07, $01, $00
+ db $08, $05, $00
+ db $09, $01, $00
+ db $0a, $01, $00
+
+YellowIntro_AnimatedObjectJumptable:
+ dw Func_fa007
+ dw Func_fa007
+ dw Func_fa008
+ dw Func_fa014
+ dw Func_fa02b
+ dw Func_fa062
+
+Func_fa007:
+ ret
+
+Func_fa008:
+ ld hl, $4
+ add hl, bc
+ ld a, [hl]
+ cp $58
+ ret z
+ sub $4
+ ld [hl], a
+ ret
+
+Func_fa014:
+ ld hl, $4
+ add hl, bc
+ ld a, [hl]
+ cp $58
+ jr z, .asm_fa020
+ add $4
+ ld [hl], a
+.asm_fa020
+ ld hl, $5
+ add hl, bc
+ cp $58
+ ret z
+ add $1
+ ld [hl], a
+ ret
+
+Func_fa02b:
+ ld hl, $b
+ add hl, bc
+ ld e, [hl]
+ ld d, $0
+ ld hl, Jumptable_fa03b
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+Jumptable_fa03b:
+ dw Func_fa03f
+ dw Func_fa051
+
+Func_fa03f:
+ ld hl, $5
+ add hl, bc
+ ld a, [hl]
+ cp $58
+ jr z, .asm_fa04c
+ sub $2
+ ld [hl], a
+ ret
+
+.asm_fa04c
+ ld hl, $b
+ add hl, bc
+ inc [hl]
+Func_fa051:
+ ld hl, $c
+ add hl, bc
+ ld a, [hl]
+ inc [hl]
+ ld d, $8
+ call Func_fa079
+ ld hl, $7
+ add hl, bc
+ ld [hl], a
+ ret
+
+Func_fa062:
+ ld hl, $b
+ add hl, bc
+ ld a, [hl]
+ ld hl, $4
+ add hl, bc
+ add [hl]
+ ld [hl], a
+ ret
+
+Func_fa06e:
+ ld e, a
+ ld d, $0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ret
+
+Func_fa077: ; cosine
+ add $10
+Func_fa079:
+ and $3f
+ cp $20
+ jr nc, .asm_fa084
+ call Func_fa08e
+ ld a, h
+ ret
+
+.asm_fa084
+ and $1f
+ call Func_fa08e
+ ld a, h
+ xor $ff
+ inc a
+ ret
+
+Func_fa08e:
+ ld e, a
+ ld a, d
+ ld d, $0
+ ld hl, Unkn_fa0aa
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld hl, $0
+.asm_fa09d
+ srl a
+ jr nc, .asm_fa0a2
+ add hl, de
+.asm_fa0a2
+ sla e
+ rl d
+ and a
+ jr nz, .asm_fa09d
+ ret
+
+Unkn_fa0aa:
+ sine_table 32
+
+INCLUDE "data/sprite_anims/intro_frames.asm"
+INCLUDE "data/sprite_anims/intro_oam.asm"
+
+INCLUDE "gfx/yellow_intro.asm"
diff --git a/engine/movie/oak_speech/clear_save.asm b/engine/movie/oak_speech/clear_save.asm
index d5c04e6e..2dd5f4a7 100644
--- a/engine/movie/oak_speech/clear_save.asm
+++ b/engine/movie/oak_speech/clear_save.asm
@@ -5,6 +5,8 @@ DoClearSaveDialogue:
call LoadTextBoxTilePatterns
ld hl, ClearSaveDataText
call PrintText
+ ld a, B_BUTTON
+ ld [wJoyIgnore], a
hlcoord 14, 7
lb bc, 8, 15
ld a, NO_YES_MENU
@@ -12,6 +14,8 @@ DoClearSaveDialogue:
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call DisplayTextBoxID
+ ld a, 0
+ ld [wJoyIgnore], a
ld a, [wCurrentMenuItem]
and a
jp z, Init
diff --git a/engine/movie/oak_speech/init_player_data.asm b/engine/movie/oak_speech/init_player_data.asm
index f722ebff..ca7f203d 100644
--- a/engine/movie/oak_speech/init_player_data.asm
+++ b/engine/movie/oak_speech/init_player_data.asm
@@ -12,6 +12,11 @@ InitPlayerData2:
ld a, $ff
ld [wUnusedD71B], a
+ ld a, 90 ; initialize happiness to 90
+ ld [wPikachuHappiness], a
+ ld a, $80
+ ld [wPikachuMood], a ; initialize mood
+
ld hl, wPartyCount
call InitializeEmptyList
ld hl, wBoxCount
diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm
index 93cdfaab..2ed61fda 100644
--- a/engine/movie/oak_speech/oak_speech.asm
+++ b/engine/movie/oak_speech/oak_speech.asm
@@ -5,6 +5,8 @@ SetDefaultNames:
push af
ld a, [wd732]
push af
+ ld a, [wPrinterSettings]
+ push af
ld hl, wPlayerName
ld bc, wBoxDataEnd - wPlayerName
xor a
@@ -13,6 +15,12 @@ SetDefaultNames:
ld bc, wSpriteDataEnd - wSpriteDataStart
xor a
call FillMemory
+ xor a
+ ld [wSurfingMinigameHiScore], a
+ ld [wSurfingMinigameHiScore + 1], a
+ ld [wSurfingMinigameHiScore + 2], a
+ pop af
+ ld [wPrinterSettings], a
pop af
ld [wd732], a
pop af
@@ -29,11 +37,11 @@ SetDefaultNames:
ld hl, SonyText
ld de, wRivalName
ld bc, NAME_LENGTH
- jp CopyData
+ call CopyData ; rip optimizations
+ ret
OakSpeech:
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic ; stop music
ld a, BANK(Music_Routes2)
ld c, a
ld a, MUSIC_ROUTES2
@@ -64,7 +72,7 @@ OakSpeech:
call PrintText
call GBFadeOutToWhite
call ClearScreen
- ld a, NIDORINO
+ ld a, STARTER_PIKACHU
ld [wd0b5], a
ld [wcf91], a
call GetMonHeader
@@ -109,13 +117,13 @@ OakSpeech:
ld a, SFX_SHRINK
call PlaySound
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld c, 4
call DelayFrames
- ld de, RedSprite
ld hl, vSprites
- lb bc, BANK(RedSprite), $0C
+ ld de, RedSprite
+ ld b, BANK(RedSprite)
+ ld c, $0C
call CopyVideoData
ld de, ShrinkPic1
lb bc, BANK(ShrinkPic1), $00
@@ -133,17 +141,13 @@ OakSpeech:
ld [wAudioSavedROMBank], a
ld a, 10
ld [wAudioFadeOutControl], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld c, 20
call DelayFrames
hlcoord 6, 5
- ld b, 7
- ld c, 7
+ lb bc, 7, 7
call ClearScreenArea
call LoadTextBoxTilePatterns
ld a, 1
@@ -151,13 +155,15 @@ OakSpeech:
ld c, 50
call DelayFrames
call GBFadeOutToWhite
- jp ClearScreen
+ call ClearScreen ; rip more tail-end optimizations
+ ret
+
OakSpeechText1:
text_far _OakSpeechText1
text_end
OakSpeechText2:
text_far _OakSpeechText2A
- sound_cry_nidorina
+ sound_cry_pikachu
text_far _OakSpeechText2B
text_end
IntroducePlayerText:
@@ -176,6 +182,7 @@ FadeInIntroPic:
.next
ld a, [hli]
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 10
call DelayFrames
dec b
@@ -197,6 +204,7 @@ MovePicLeft:
ld a, %11100100
ldh [rBGP], a
+ call UpdateGBCPal_BGP
.next
call DelayFrame
ldh a, [rWX]
@@ -215,10 +223,13 @@ IntroDisplayPicCenteredOrUpperRight:
push bc
ld a, b
call UncompressSpriteFromDE
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, sSpriteBuffer1
ld de, sSpriteBuffer0
ld bc, $310
call CopyData
+ call PrepareRTCDataAndDisableSRAM
ld de, vFrontPic
call InterlaceMergeSpriteBuffers
pop bc
diff --git a/engine/movie/oak_speech/oak_speech2.asm b/engine/movie/oak_speech/oak_speech2.asm
index 84df7968..dc6f0bdc 100644
--- a/engine/movie/oak_speech/oak_speech2.asm
+++ b/engine/movie/oak_speech/oak_speech2.asm
@@ -108,6 +108,7 @@ OakSpeechSlidePicCommon:
.loop
xor a
ldh [hAutoBGTransferEnabled], a
+ ldh [hAutoBGTransferPortion], a
ldh a, [hSlideDirection]
and a
jr nz, .slideLeft
@@ -129,8 +130,8 @@ OakSpeechSlidePicCommon:
; If sliding left, we need to zero the last tile in the pic (there is no need
; to take a corresponding action when sliding right because hl initially points
; to a 0 tile in that case).
- xor a
dec hl
+ xor a
ld [hl], a
.next3
ld a, 1
@@ -162,8 +163,7 @@ OakSpeechSlidePicCommon:
DisplayIntroNameTextBox:
push de
hlcoord 0, 0
- ld b, $a
- ld c, $9
+ lb bc, 10, 9
call TextBoxBorder
hlcoord 3, 0
ld de, .namestring
diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm
index eede8ccb..0b14dcaa 100644
--- a/engine/movie/splash.asm
+++ b/engine/movie/splash.asm
@@ -3,9 +3,11 @@ LoadShootingStarGraphics:
ldh [rOBP0], a
ld a, $a4
ldh [rOBP1], a
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld de, AnimationTileset2 tile 3 ; star tile (top left quadrant)
ld hl, vChars1 tile $20
- lb bc, BANK(AnimationTileset2), 1
+ lb bc, BANK(AnimationTileset2), $01
call CopyVideoData
ld de, AnimationTileset2 tile 19 ; star tile (bottom left quadrant)
ld hl, vChars1 tile $21
@@ -75,6 +77,7 @@ AnimateShootingStar:
ld hl, rOBP0
rrc [hl]
rrc [hl]
+ call UpdateGBCPal_OBP0
ld c, 10
call CheckForUserInterruption
ret c
@@ -118,6 +121,15 @@ AnimateShootingStar:
ld [hli], a ; X
inc de
inc hl
+ push bc
+ ld a, [de]
+ ld b, a
+ ld a, [hl]
+ and $f0
+ or b
+ ld [hl], a
+ inc de
+ pop bc
inc hl
dec c
jr nz, .smallStarsInnerLoop
@@ -162,24 +174,32 @@ SmallStarsWaveCoordsPointerTable:
SmallStarsWave1Coords:
db $68, $30
- db $68, $40
+ db $05, $68
+ db $40, $05
db $68, $58
- db $68, $78
+ db $04, $68
+ db $78, $07
SmallStarsWave2Coords:
db $68, $38
- db $68, $48
+ db $05, $68
+ db $48, $06
db $68, $60
- db $68, $70
+ db $04, $68
+ db $70, $07
SmallStarsWave3Coords:
db $68, $34
- db $68, $4C
+ db $05, $68
+ db $4c, $06
db $68, $54
- db $68, $64
+ db $06, $68
+ db $64, $07
SmallStarsWave4Coords:
- db $68, $3C
- db $68, $5C
- db $68, $6C
- db $68, $74
+ db $68, $3c
+ db $05, $68
+ db $5c, $04
+ db $68, $6c
+ db $07, $68
+ db $74, $07
SmallStarsEmptyWave:
db -1 ; end
@@ -200,7 +220,7 @@ MoveDownSmallStars:
ldh a, [rOBP1]
xor %10100000
ldh [rOBP1], a
-
+ call UpdateGBCPal_OBP1
ld c, 3
call CheckForUserInterruption
ret c
@@ -228,10 +248,10 @@ GameFreakLogoOAMData:
GameFreakLogoOAMDataEnd:
GameFreakShootingStarOAMData:
- dbsprite 20, 0, 0, 0, $a0, OAM_OBP1
- dbsprite 21, 0, 0, 0, $a0, OAM_OBP1 | OAM_HFLIP
- dbsprite 20, 1, 0, 0, $a1, OAM_OBP1
- dbsprite 21, 1, 0, 0, $a1, OAM_OBP1 | OAM_HFLIP
+ dbsprite 20, 0, 0, 0, $a0, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 21, 0, 0, 0, $a0, OAM_OBP1 | OAM_HIGH_PALS | OAM_HFLIP
+ dbsprite 20, 1, 0, 0, $a1, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 21, 1, 0, 0, $a1, OAM_OBP1 | OAM_HIGH_PALS | OAM_HFLIP
GameFreakShootingStarOAMDataEnd:
FallingStar:
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 8f97f8fa..dfe057f3 100644
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -1,8 +1,3 @@
-; copy text of fixed length NAME_LENGTH (like player name, rival name, mon names, ...)
-CopyFixedLengthText:
- ld bc, NAME_LENGTH
- jp CopyData
-
SetDefaultNamesBeforeTitlescreen::
ld hl, NintenText
ld de, wPlayerName
@@ -35,98 +30,34 @@ DisplayTitleScreen:
call ClearScreen
call DisableLCD
call LoadFontTilePatterns
+; todo: fix hl pointers
ld hl, NintendoCopyrightLogoGraphics
- ld de, vTitleLogo2 tile 16
+ ld de, vTitleLogo tile $60
ld bc, 5 tiles
ld a, BANK(NintendoCopyrightLogoGraphics)
- call FarCopyData2
+ call FarCopyData
+ ld hl, NineTile
+ ld de, vTitleLogo tile $6e
+ ld bc, 1 tiles
+ ld a, BANK(NineTile)
+ call FarCopyData
ld hl, GamefreakLogoGraphics
- ld de, vTitleLogo2 tile (16 + 5)
+ ld de, vTitleLogo tile $65
ld bc, 9 tiles
ld a, BANK(GamefreakLogoGraphics)
- call FarCopyData2
- ld hl, PokemonLogoGraphics
- ld de, vTitleLogo
- ld bc, $60 tiles
- ld a, BANK(PokemonLogoGraphics)
- call FarCopyData2 ; first chunk
- ld hl, PokemonLogoGraphics tile $60
- ld de, vTitleLogo2
- ld bc, $10 tiles
- ld a, BANK(PokemonLogoGraphics)
- call FarCopyData2 ; second chunk
- ld hl, Version_GFX
- ld de, vChars2 tile $60 + (10 tiles - (Version_GFXEnd - Version_GFX) * 2) / 2
- ld bc, Version_GFXEnd - Version_GFX
- ld a, BANK(Version_GFX)
- call FarCopyDataDouble
- call ClearBothBGMaps
-
-; place tiles for pokemon logo (except for the last row)
- hlcoord 2, 1
- ld a, $80
- ld de, SCREEN_WIDTH
- ld c, 6
-.pokemonLogoTileLoop
- ld b, $10
- push hl
-.pokemonLogoTileRowLoop ; place tiles for one row
- ld [hli], a
- inc a
- dec b
- jr nz, .pokemonLogoTileRowLoop
- pop hl
- add hl, de
- dec c
- jr nz, .pokemonLogoTileLoop
-
-; place tiles for the last row of the pokemon logo
- hlcoord 2, 7
- ld a, $31
- ld b, $10
-.pokemonLogoLastTileRowLoop
- ld [hli], a
- inc a
- dec b
- jr nz, .pokemonLogoLastTileRowLoop
-
- call DrawPlayerCharacter
-
-; put a pokeball in the player's hand
- ld hl, wOAMBuffer + $28
- ld a, $74
- ld [hl], a
-
-; place tiles for title screen copyright
- hlcoord 2, 17
- ld de, .tileScreenCopyrightTiles
- ld b, $10
-.tileScreenCopyrightTilesLoop
- ld a, [de]
- ld [hli], a
- inc de
- dec b
- jr nz, .tileScreenCopyrightTilesLoop
-
- jr .next
-
-.tileScreenCopyrightTiles
- db $41,$42,$43,$42,$44,$42,$45,$46,$47,$48,$49,$4A,$4B,$4C,$4D,$4E ; ©'95.'96.'98 GAME FREAK inc.
-
-.next
+ call FarCopyData
+ callfar LoadYellowTitleScreenGFX
+ ld hl, vBGMap0
+ ld bc, (vBGMap1 tile $40) - vBGMap0
+ ld a, " "
+ call FillMemory
+ callfar TitleScreen_PlacePokemonLogo
+ call FillSpriteBuffer0WithAA
+ call .WriteCopyrightTiles
call SaveScreenTilesToBuffer2
call LoadScreenTilesFromBuffer2
call EnableLCD
-
-IF DEF(_RED)
- ld a, STARTER1 ; which Pokemon to show first on the title screen
-ENDC
-IF DEF(_BLUE)
- ld a, STARTER2 ; which Pokemon to show first on the title screen
-ENDC
- ld [wTitleMonSpecies], a
- call LoadTitleMonSprite
-
+ callfar TitleScreen_PlacePikachu
ld a, HIGH(vBGMap0 + $300)
call TitleScreenCopyTileMapToVRAM
call SaveScreenTilesToBuffer1
@@ -138,8 +69,9 @@ ENDC
ld b, SET_PAL_TITLE_SCREEN
call RunPaletteCommand
call GBPalNormal
- ld a, %11100100
+ ld a, %11100000
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
; make pokemon logo bounce up and down
ld bc, hSCY ; background scroll Y
@@ -181,6 +113,21 @@ ENDC
jr nz, .ScrollTitleScreenPokemonLogo
ret
+; place tiles for title screen copyright
+.WriteCopyrightTiles
+ hlcoord 2, 17
+ ld de, .tileScreenCopyrightTiles
+.titleScreenCopyrightTilesLoop
+ ld a, [de]
+ inc de
+ cp $ff
+ ret z
+ ld [hli], a
+ jr .titleScreenCopyrightTilesLoop
+
+.tileScreenCopyrightTiles
+ db $e0,$e1,$e2,$e3,$e1,$e2,$ee,$e5,$e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ff ; ©1995-1999 GAME FREAK inc.
+
.finishedBouncingPokemonLogo
call LoadScreenTilesFromBuffer1
ld c, 36
@@ -189,52 +136,46 @@ ENDC
call PlaySound
; scroll game version in from the right
- call PrintGameVersionOnTitleScreen
+ callfar TitleScreen_PlacePikaSpeechBubble
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
- ld d, 144
-.scrollTitleScreenGameVersionLoop
- ld h, d
- ld l, 64
- call ScrollTitleScreenGameVersion
- ld h, 0
- ld l, 80
- call ScrollTitleScreenGameVersion
- ld a, d
- add 4
- ld d, a
- and a
- jr nz, .scrollTitleScreenGameVersionLoop
-
- ld a, HIGH(vBGMap1)
- call TitleScreenCopyTileMapToVRAM
- call LoadScreenTilesFromBuffer2
- call PrintGameVersionOnTitleScreen
call Delay3
+ ld e, 0
+ call TitleScreen_PlayPikachuPCM
call WaitForSoundToFinish
+ call StopAllMusic
ld a, MUSIC_TITLE_SCREEN
ld [wNewSoundID], a
call PlaySound
+.loop
xor a
ld [wUnusedCC5B], a
+ ld [wTitleScreenScene], a
+ ld [wTitleScreenScene + 1], a
+ ld [wTitleScreenScene + 2], a
+ ld [wTitleScreenScene + 3], a
+ ld a, $f
+ ld [wTitleScreenScene + 4], a
+.titleScreenLoop
+ call IncrementResetCounter
+ jp c, .doTitlescreenReset
+ call DelayFrame
+ call JoypadLowSensitivity
+ ldh a, [hJoyHeld]
+ cp D_UP | SELECT | B_BUTTON
+ jr z, .go_to_main_menu
+IF DEF(_DEBUG)
+ and A_BUTTON | SELECT | START
+ELSE
+ and A_BUTTON | START
+ENDC
+ jr nz, .go_to_main_menu
+ call DoTitleScreenFunction
+ jr .titleScreenLoop
-; Keep scrolling in new mons indefinitely until the user performs input.
-.awaitUserInterruptionLoop
- ld c, 200
- call CheckForUserInterruption
- jr c, .finishedWaiting
- call TitleScreenScrollInMon
- ld c, 1
- call CheckForUserInterruption
- jr c, .finishedWaiting
- farcall TitleScreenAnimateBallIfStarterOut
- call TitleScreenPickNewMon
- jr .awaitUserInterruptionLoop
-
-.finishedWaiting
- ld a, [wTitleMonSpecies]
- call PlayCry
- call WaitForSoundToFinish
+.go_to_main_menu
+ ld e, $a
+ call TitleScreen_PlayPikachuPCM
call GBPalWhiteOutWithDelay3
call ClearSprites
xor a
@@ -256,112 +197,46 @@ ENDC
IF DEF(_DEBUG)
ld a, b
bit BIT_SELECT, a
- jp nz, DebugMenu
-ENDC
+ jp z, MainMenu
+ callfar DebugMenu
+ jp hl
+ELSE
jp MainMenu
+ENDC
-.doClearSaveDialogue
- farjp DoClearSaveDialogue
-
-TitleScreenPickNewMon:
- ld a, HIGH(vBGMap0)
- call TitleScreenCopyTileMapToVRAM
-
-.loop
-; Keep looping until a mon different from the current one is picked.
- call Random
- and $f
- ld c, a
- ld b, 0
- ld hl, TitleMons
- add hl, bc
- ld a, [hl]
- ld hl, wTitleMonSpecies
-
-; Can't be the same as before.
- cp [hl]
- jr z, .loop
-
- ld [hl], a
- call LoadTitleMonSprite
-
- ld a, $90
- ldh [hWY], a
- ld d, 1 ; scroll out
- farcall TitleScroll
- ret
-
-TitleScreenScrollInMon:
- ld d, 0 ; scroll in
- farcall TitleScroll
- xor a
- ldh [hWY], a
- ret
-
-ScrollTitleScreenGameVersion:
-.wait
- ldh a, [rLY]
- cp l
- jr nz, .wait
-
- ld a, h
- ldh [rSCX], a
-
-.wait2
- ldh a, [rLY]
- cp h
- jr z, .wait2
- ret
+.asm_42f0
+; unreferenced
+ callfar PrinterDebug
+ jp .loop
-DrawPlayerCharacter:
- ld hl, PlayerCharacterTitleGraphics
- ld de, vSprites
- ld bc, PlayerCharacterTitleGraphicsEnd - PlayerCharacterTitleGraphics
- ld a, BANK(PlayerCharacterTitleGraphics)
- call FarCopyData2
- call ClearSprites
- xor a
- ld [wPlayerCharacterOAMTile], a
- ld hl, wOAMBuffer
- lb de, $60, $5a
- ld b, 7
-.loop
- push de
- ld c, 5
-.innerLoop
- ld a, d
- ld [hli], a ; Y
- ld a, e
- ld [hli], a ; X
- add 8
- ld e, a
- ld a, [wPlayerCharacterOAMTile]
- ld [hli], a ; tile
+.asm_42fb
+; unreferenced
+ ld a, [wTitleScreenScene + 4]
inc a
- ld [wPlayerCharacterOAMTile], a
- inc hl
- dec c
- jr nz, .innerLoop
- pop de
- ld a, 8
- add d
- ld d, a
- dec b
- jr nz, .loop
- ret
+ cp $2a
+ jr c, .asm_4305
+ ld a, $f
+.asm_4305
+ ld [wTitleScreenScene + 4], a
+ ld e, a
+ callfar PlayPikachuSoundClip
+ xor a
+ ld [wTitleScreenScene + 2], a
+ ld [wTitleScreenScene + 3], a
+ jp .titleScreenLoop
+
+.doTitlescreenReset
+ ld [wAudioFadeOutControl], a
+ call StopAllMusic
+.audioFadeLoop
+ ld a, [wAudioFadeOutControl]
+ and a
+ jr nz, .audioFadeLoop
+ jp Init
-ClearBothBGMaps:
- ld hl, vBGMap0
- ld bc, $400 * 2
- ld a, " "
- jp FillMemory
+.doClearSaveDialogue
+ farjp DoClearSaveDialogue
-LoadTitleMonSprite:
- ld [wcf91], a
- ld [wd0b5], a
- hlcoord 5, 10
- call GetMonHeader
- jp LoadFrontSpriteByMonIndex
TitleScreenCopyTileMapToVRAM:
ldh [hAutoBGTransferDest + 1], a
@@ -376,34 +251,132 @@ LoadCopyrightAndTextBoxTiles:
LoadCopyrightTiles:
ld de, NintendoCopyrightLogoGraphics
ld hl, vChars2 tile $60
- lb bc, BANK(NintendoCopyrightLogoGraphics), (GamefreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10
+ lb bc, BANK(NintendoCopyrightLogoGraphics), (TextBoxGraphics + $10 - NintendoCopyrightLogoGraphics) / $10 ; bug: overflows into text box graphics and copies the "A" tile
call CopyVideoData
hlcoord 2, 7
ld de, CopyrightTextString
jp PlaceString
CopyrightTextString:
- db $60,$61,$62,$61,$63,$61,$64,$7F,$65,$66,$67,$68,$69,$6A ; ©'95.'96.'98 Nintendo
- next $60,$61,$62,$61,$63,$61,$64,$7F,$6B,$6C,$6D,$6E,$6F,$70,$71,$72 ; ©'95.'96.'98 Creatures inc.
- next $60,$61,$62,$61,$63,$61,$64,$7F,$73,$74,$75,$76,$77,$78,$79,$7A,$7B ; ©'95.'96.'98 GAME FREAK inc.
+ db $60,$61,$62,$63,$61,$62,$7c,$7f,$65,$66,$67,$68,$69,$6a ; ©1995-1999 Nintendo
+ next $60,$61,$62,$63,$61,$62,$7c,$7f,$6b,$6c,$6d,$6e,$6f,$70,$71,$72 ; ©1995-1999 Creatures inc.
+ next $60,$61,$62,$63,$61,$62,$7c,$7f,$73,$74,$75,$76,$77,$78,$79,$7a,$7b ; ©1995-1999 GAME FREAK inc.
db "@"
-INCLUDE "data/pokemon/title_mons.asm"
+TitleScreen_PlayPikachuPCM:
+ callfar PlayPikachuSoundClip
+ ret
-; prints version text (red, blue)
-PrintGameVersionOnTitleScreen:
- hlcoord 7, 8
- ld de, VersionOnTitleScreenText
- jp PlaceString
+DoTitleScreenFunction:
+ call .CheckTimer
+ ld a, [wTitleScreenScene]
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+
+.Jumptable:
+ dw .Nop
+ dw .BlinkHalf
+ dw .BlinkWait
+ dw .BlinkWait
+ dw .BlinkClosed
+ dw .BlinkWait
+ dw .BlinkWait
+ dw .BlinkHalf
+ dw .BlinkWait
+ dw .BlinkWait
+ dw .BlinkOpen
+ dw .GoBackToStart
+
+.GoBackToStart:
+ xor a
+ ld [wTitleScreenScene], a
+.Nop
+ ret
-; these point to special tiles specifically loaded for that purpose and are not usual text
-VersionOnTitleScreenText:
-IF DEF(_RED)
- db $60,$61,$7F,$65,$66,$67,$68,$69,"@" ; "Red Version"
-ENDC
-IF DEF(_BLUE)
- db $61,$62,$63,$64,$65,$66,$67,$68,"@" ; "Blue Version"
-ENDC
+.BlinkOpen:
+ ld e, 0
+ jr .LoadBlinkFrame
+
+.BlinkHalf:
+ ld e, 4
+ jr .LoadBlinkFrame
+
+.BlinkClosed:
+ ld e, 8
+.LoadBlinkFrame:
+ ld hl, wOAMBuffer + 2
+ ld c, 8
+.loop
+ ld a, [hl]
+ and $f3
+ or e
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ dec c
+ jr nz, .loop
+.BlinkWait:
+ ld hl, wTitleScreenScene
+ inc [hl]
+ ret
+
+.CheckTimer:
+ ld hl, wTitleScreenTimer
+ ld a, [hl]
+ inc [hl]
+ and a
+ jr z, .restart
+ cp $80
+ jr z, .restart
+ cp $90
+ ret nz
+.restart
+ ld a, $1
+ ld [wTitleScreenScene], a
+ ret
+
+; copy text of fixed length NAME_LENGTH (like player name, rival name, mon names, ...)
+CopyFixedLengthText:
+ ld bc, NAME_LENGTH
+ jp CopyData
NintenText: db "NINTEN@"
SonyText: db "SONY@"
+
+IncrementResetCounter:
+ ld hl, wTitleScreenScene + 2
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ inc de
+ ld a, d
+ cp $c
+ jr z, .doReset
+ ld [hl], d
+ dec hl
+ ld [hl], e
+ and a
+ ret
+
+.doReset
+ scf
+ ret
+
+FillSpriteBuffer0WithAA:
+ xor a
+ call SwitchSRAMBankAndLatchClockData
+ ld hl, sSpriteBuffer0
+ ld bc, $20
+ ld a, $aa
+ call FillMemory
+ call PrepareRTCDataAndDisableSRAM
+ ret
diff --git a/engine/movie/title2.asm b/engine/movie/title_rb.asm
index 315cf6b5..597684df 100644
--- a/engine/movie/title2.asm
+++ b/engine/movie/title_rb.asm
@@ -1,3 +1,5 @@
+; Leftover of Red/Blue. Seemingly unused
+
TitleScroll_WaitBall:
; Wait around for the TitleBall animation to play out.
; hi: speed
@@ -89,12 +91,12 @@ TitleBallYTable:
TitleScreenAnimateBallIfStarterOut:
; Animate the TitleBall if a starter just got scrolled out.
- ld a, [wTitleMonSpecies]
- cp STARTER1
+ ld a, [wTitleScreenScene]
+ cp CHARMANDER ; starter 1
jr z, .ok
- cp STARTER2
+ cp SQUIRTLE ; starter 2
jr z, .ok
- cp STARTER3
+ cp BULBASAUR ; starter 3
ret nz
.ok
ld e, 1 ; animate titleball
diff --git a/engine/movie/title_yellow.asm b/engine/movie/title_yellow.asm
new file mode 100644
index 00000000..c70b87f9
--- /dev/null
+++ b/engine/movie/title_yellow.asm
@@ -0,0 +1,109 @@
+LoadYellowTitleScreenGFX:
+ ld hl, PokemonLogoGraphics
+ ld de, vChars2
+ ld bc, PokemonLogoGraphicsEnd - PokemonLogoGraphics
+ ld a, BANK(PokemonLogoGraphics)
+ call FarCopyData
+ ld hl, PokemonLogoCornerGraphics
+ ld de, vChars1 tile $7d
+ ld bc, PokemonLogoCornerGraphicsEnd - PokemonLogoCornerGraphics
+ ld a, BANK(PokemonLogoCornerGraphics)
+ call FarCopyData
+ ld hl, TitlePikachuBGGraphics
+ ld de, vChars1
+ ld bc, TitlePikachuBGGraphicsEnd - TitlePikachuBGGraphics
+ ld a, BANK(TitlePikachuBGGraphics)
+ call FarCopyData
+ ld hl, TitlePikachuOBGraphics
+ ld de, vChars1 tile $70
+ ld bc, TitlePikachuOBGraphicsEnd - TitlePikachuOBGraphics
+ ld a, BANK(TitlePikachuOBGraphics)
+ call FarCopyData
+ ret
+
+TitleScreen_PlacePokemonLogo:
+ hlcoord 2, 1
+ ld de, TitleScreenPokemonLogoTilemap
+ lb bc, 7, 16
+ call Bank3D_CopyBox
+ ret
+
+TitleScreen_PlacePikaSpeechBubble:
+ hlcoord 6, 4
+ ld de, TitleScreenPikaBubbleTilemap
+ lb bc, 4, 7
+ call Bank3D_CopyBox
+ hlcoord 9, 8
+ ld [hl], $64
+ inc hl
+ ld [hl], $65
+ ret
+
+TitleScreen_PlacePikachu:
+ hlcoord 4, 8
+ ld de, TitleScreenPikachuTilemap
+ lb bc, 9, 12
+ call Bank3D_CopyBox
+ hlcoord 16, 10
+ ld [hl], $96
+ hlcoord 16, 11
+ ld [hl], $9d
+ hlcoord 16, 12
+ ld [hl], $a7
+ hlcoord 16, 13
+ ld [hl], $b1
+ ld hl, TitleScreenPikachuEyesOAMData
+ ld de, wOAMBuffer
+ ld bc, $20
+ call CopyData
+ ret
+
+TitleScreenPikachuEyesOAMData:
+ db $60, $40, $f1, $22
+ db $60, $48, $f0, $22
+ db $68, $40, $f3, $22
+ db $68, $48, $f2, $22
+ db $60, $60, $f0, $02
+ db $60, $68, $f1, $02
+ db $68, $60, $f2, $02
+ db $68, $68, $f3, $02
+
+Bank3D_CopyBox:
+; copy cxb (xy) screen area from de to hl
+.row
+ push bc
+ push hl
+.col
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .col
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .row
+ ret
+
+TitleScreenPokemonLogoTilemap: ; 16x7
+ INCBIN "gfx/title/pokemon_logo.tilemap"
+
+Pointer_f4669: ; unreferenced
+ db $47, $48, $49, $4a, $4b, $4c, $4d, $4e, $4f, $5f
+
+TitleScreenPikaBubbleTilemap: ; 7x4
+ INCBIN "gfx/title/pika_bubble.tilemap"
+
+TitleScreenPikachuTilemap: ; 12x9
+ INCBIN "gfx/title/pikachu.tilemap"
+
+PokemonLogoGraphics: INCBIN "gfx/title/pokemon_logo.2bpp"
+PokemonLogoGraphicsEnd:
+PokemonLogoCornerGraphics: INCBIN "gfx/title/pokemon_logo_corner.2bpp"
+PokemonLogoCornerGraphicsEnd:
+TitlePikachuBGGraphics: INCBIN "gfx/title/pikachu_bg.2bpp"
+TitlePikachuBGGraphicsEnd:
+TitlePikachuOBGraphics: INCBIN "gfx/title/pikachu_ob.2bpp"
+TitlePikachuOBGraphicsEnd:
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index bb06f231..7be100e0 100644
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -20,12 +20,13 @@ ExternalClockTradeAnim:
TradeAnimCommon:
ld a, [wOptions]
push af
+ and %110000 ; preserve speaker options
+ ld [wOptions], a
ldh a, [hSCY]
push af
ldh a, [hSCX]
push af
xor a
- ld [wOptions], a
ldh [hSCY], a
ldh [hSCX], a
push de
@@ -160,12 +161,12 @@ LoadTradingGFXAndMonNames:
ld de, vChars2 tile $31
ld bc, TradingAnimationGraphicsEnd - TradingAnimationGraphics
ld a, BANK(TradingAnimationGraphics)
- call FarCopyData2
+ call FarCopyData
ld hl, TradingAnimationGraphics2
ld de, vSprites tile $7c
ld bc, TradingAnimationGraphics2End - TradingAnimationGraphics2
ld a, BANK(TradingAnimationGraphics2)
- call FarCopyData2
+ call FarCopyData
ld hl, vBGMap0
ld bc, $800
ld a, " "
@@ -182,6 +183,7 @@ LoadTradingGFXAndMonNames:
ld a, $f0 ; SGB OBP0
.next
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
call EnableLCD
xor a
ldh [hAutoBGTransferEnabled], a
@@ -199,6 +201,7 @@ LoadTradingGFXAndMonNames:
Trade_LoadMonPartySpriteGfx:
ld a, %11010000
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
farjp LoadMonPartySpriteGfx
Trade_SwapNames:
@@ -233,8 +236,7 @@ Trade_ShowPlayerMon:
xor a
ldh [hAutoBGTransferEnabled], a
hlcoord 4, 0
- ld b, 6
- ld c, 10
+ lb bc, 6, 10
call TextBoxBorder
call Trade_PrintPlayerMonInfoText
ld b, HIGH(vBGMap0)
@@ -303,6 +305,7 @@ Trade_AnimateBallEnteringLinkCable:
call DelayFrames
ld a, %11100100
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
xor a
ld [wLinkCableAnimBulgeToggle], a
lb bc, $20, $60
@@ -354,8 +357,7 @@ Trade_ShowEnemyMon:
call Trade_ShowAnimation
call Trade_ShowClearedWindow
hlcoord 4, 10
- ld b, 6
- ld c, 10
+ lb bc, 6, 10
call TextBoxBorder
call Trade_PrintEnemyMonInfoText
call Trade_CopyTileMapToVRAM
@@ -382,6 +384,7 @@ Trade_AnimLeftToRight:
ld [wTradedMonMovingRight], a
ld a, %11100100
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
ld a, $54
ld [wBaseCoordX], a
ld a, $1c
@@ -446,6 +449,8 @@ Trade_InitGameboyTransferGfx:
ld a, $1
ldh [hAutoBGTransferEnabled], a
call ClearScreen
+ ld b, SET_PAL_GENERIC
+ call RunPaletteCommand
xor a
ldh [hAutoBGTransferEnabled], a
call Trade_LoadMonPartySpriteGfx
@@ -479,8 +484,7 @@ Trade_DrawLeftGameboy:
; draw text box with player name below gameboy pic
hlcoord 4, 12
- ld b, 2
- ld c, 7
+ lb bc, 2, 7
call TextBoxBorder
hlcoord 5, 14
ld de, wPlayerName
@@ -526,8 +530,7 @@ Trade_DrawRightGameboy:
; draw text box with enemy name above link cable
hlcoord 6, 0
- ld b, 2
- ld c, 7
+ lb bc, 2, 7
call TextBoxBorder
hlcoord 7, 2
ld de, wLinkEnemyTrainerName
@@ -599,6 +602,7 @@ Trade_AnimCircledMon:
ldh a, [rBGP]
xor $3c ; make link cable flash
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld hl, wOAMBuffer + $02
ld de, $4
ld c, $14
@@ -620,7 +624,7 @@ Trade_WriteCircledMonOAM:
Trade_AddOffsetsToOAMCoords:
ld hl, wOAMBuffer
- ld c, $14
+ ld c, $14 ; SCREEN_WIDTH?
.loop
ld a, [wBaseCoordY]
add [hl]
diff --git a/engine/overworld/advance_player_sprite.asm b/engine/overworld/advance_player_sprite.asm
new file mode 100644
index 00000000..4ebdac84
--- /dev/null
+++ b/engine/overworld/advance_player_sprite.asm
@@ -0,0 +1,244 @@
+_AdvancePlayerSprite::
+ ld a, [wSpritePlayerStateData1YStepVector]
+ ld b, a
+ ld a, [wSpritePlayerStateData1XStepVector]
+ ld c, a
+ ld hl, wWalkCounter ; walking animation counter
+ dec [hl]
+ jr nz, .afterUpdateMapCoords
+; if it's the end of the animation, update the player's map coordinates
+ ld hl, wPikachuOverworldStateFlags
+ res 5, [hl]
+ ld a, [wYCoord]
+ add b
+ ld [wYCoord], a
+ ld a, [wXCoord]
+ add c
+ ld [wXCoord], a
+.afterUpdateMapCoords
+ ld a, [wWalkCounter] ; walking animation counter
+ cp $07
+ jp nz, .scrollBackgroundAndSprites
+; if this is the first iteration of the animation
+ ld a, c
+ cp $01
+ jr nz, .checkIfMovingWest
+; moving east
+ ld a, [wMapViewVRAMPointer]
+ ld e, a
+ and $e0
+ ld d, a
+ ld a, e
+ add $02
+ and $1f
+ or d
+ ld [wMapViewVRAMPointer], a
+ jr .adjustXCoordWithinBlock
+.checkIfMovingWest
+ cp $ff
+ jr nz, .checkIfMovingSouth
+; moving west
+ ld a, [wMapViewVRAMPointer]
+ ld e, a
+ and $e0
+ ld d, a
+ ld a, e
+ sub $02
+ and $1f
+ or d
+ ld [wMapViewVRAMPointer], a
+ jr .adjustXCoordWithinBlock
+.checkIfMovingSouth
+ ld a, b
+ cp $01
+ jr nz, .checkIfMovingNorth
+; moving south
+ ld a, [wMapViewVRAMPointer]
+ add $40
+ ld [wMapViewVRAMPointer], a
+ jr nc, .adjustXCoordWithinBlock
+ ld a, [wMapViewVRAMPointer + 1]
+ inc a
+ and $03
+ or $98
+ ld [wMapViewVRAMPointer + 1], a
+ jr .adjustXCoordWithinBlock
+.checkIfMovingNorth
+ cp $ff
+ jr nz, .adjustXCoordWithinBlock
+; moving north
+ ld a, [wMapViewVRAMPointer]
+ sub $40
+ ld [wMapViewVRAMPointer], a
+ jr nc, .adjustXCoordWithinBlock
+ ld a, [wMapViewVRAMPointer + 1]
+ dec a
+ and $03
+ or $98
+ ld [wMapViewVRAMPointer + 1], a
+.adjustXCoordWithinBlock
+ ld a, c
+ and a
+ jr z, .pointlessJump ; mistake?
+.pointlessJump
+ ld hl, wXBlockCoord
+ ld a, [hl]
+ add c
+ ld [hl], a
+ cp $02
+ jr nz, .checkForMoveToWestBlock
+; moved into the tile block to the east
+ xor a
+ ld [hl], a
+ ld hl, wXOffsetSinceLastSpecialWarp
+ inc [hl]
+ ld de, wCurrentTileBlockMapViewPointer
+ call MoveTileBlockMapPointerEast
+ jr .updateMapView
+.checkForMoveToWestBlock
+ cp $ff
+ jr nz, .adjustYCoordWithinBlock
+; moved into the tile block to the west
+ ld a, $01
+ ld [hl], a
+ ld hl, wXOffsetSinceLastSpecialWarp
+ dec [hl]
+ ld de, wCurrentTileBlockMapViewPointer
+ call MoveTileBlockMapPointerWest
+ jr .updateMapView
+.adjustYCoordWithinBlock
+ ld hl, wYBlockCoord
+ ld a, [hl]
+ add b
+ ld [hl], a
+ cp $02
+ jr nz, .checkForMoveToNorthBlock
+; moved into the tile block to the south
+ xor a
+ ld [hl], a
+ ld hl, wYOffsetSinceLastSpecialWarp
+ inc [hl]
+ ld de, wCurrentTileBlockMapViewPointer
+ ld a, [wCurMapWidth]
+ call MoveTileBlockMapPointerSouth
+ jr .updateMapView
+.checkForMoveToNorthBlock
+ cp $ff
+ jr nz, .updateMapView
+; moved into the tile block to the north
+ ld a, $01
+ ld [hl], a
+ ld hl, wYOffsetSinceLastSpecialWarp
+ dec [hl]
+ ld de, wCurrentTileBlockMapViewPointer
+ ld a, [wCurMapWidth]
+ call MoveTileBlockMapPointerNorth
+.updateMapView
+ call LoadCurrentMapView
+ ld a, [wSpritePlayerStateData1YStepVector]
+ cp $01
+ jr nz, .checkIfMovingNorth2
+; if moving south
+ call ScheduleSouthRowRedraw
+ jr .scrollBackgroundAndSprites
+.checkIfMovingNorth2
+ cp $ff
+ jr nz, .checkIfMovingEast2
+; if moving north
+ call ScheduleNorthRowRedraw
+ jr .scrollBackgroundAndSprites
+.checkIfMovingEast2
+ ld a, [wSpritePlayerStateData1XStepVector]
+ cp $01
+ jr nz, .checkIfMovingWest2
+; if moving east
+ call ScheduleEastColumnRedraw
+ jr .scrollBackgroundAndSprites
+.checkIfMovingWest2
+ cp $ff
+ jr nz, .scrollBackgroundAndSprites
+; if moving west
+ call ScheduleWestColumnRedraw
+.scrollBackgroundAndSprites
+ ld a, [wSpritePlayerStateData1YStepVector]
+ add a
+ ld b, a
+ ld a, [wSpritePlayerStateData1XStepVector]
+ add a
+ ld c, a
+; shift all the sprites in the direction opposite of the player's motion
+; so that the player appears to move relative to them
+ ld hl, wSprite01StateData1YPixels
+ ld e, 15
+.spriteShiftLoop
+ ld a, [hl]
+ sub b
+ ld [hli], a
+ inc l
+ ld a, [hl]
+ sub c
+ ld [hl], a
+ ld a, $0e
+ add l
+ ld l, a
+ dec e
+ jr nz, .spriteShiftLoop
+.done
+ ldh a, [hSCY]
+ add b
+ ldh [hSCY], a ; update background scroll Y
+ ldh a, [hSCX]
+ add c
+ ldh [hSCX], a ; update background scroll X
+ ret
+
+; the following four functions are used to move the pointer to the upper left
+; corner of the tile block map in the direction of motion
+
+MoveTileBlockMapPointerEast::
+ ld a, [de]
+ add $01
+ ld [de], a
+ ret nc
+ inc de
+ ld a, [de]
+ inc a
+ ld [de], a
+ ret
+
+MoveTileBlockMapPointerWest::
+ ld a, [de]
+ sub $01
+ ld [de], a
+ ret nc
+ inc de
+ ld a, [de]
+ dec a
+ ld [de], a
+ ret
+
+MoveTileBlockMapPointerSouth::
+ add MAP_BORDER * 2
+ ld b, a
+ ld a, [de]
+ add b
+ ld [de], a
+ ret nc
+ inc de
+ ld a, [de]
+ inc a
+ ld [de], a
+ ret
+
+MoveTileBlockMapPointerNorth::
+ add MAP_BORDER * 2
+ ld b, a
+ ld a, [de]
+ sub b
+ ld [de], a
+ ret nc
+ inc de
+ ld a, [de]
+ dec a
+ ld [de], a
+ ret
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm
index 9c078f08..a68da55f 100644
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -37,8 +37,8 @@ _EndNPCMovementScript::
res 1, [hl]
xor a
ld [wNPCMovementScriptSpriteOffset], a
- ld [wNPCMovementScriptPointerTableNum], a
ld [wNPCMovementScriptFunctionNum], a
+ ld [wNPCMovementScriptPointerTableNum], a
ld [wWastedByteCD3A], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
@@ -79,6 +79,10 @@ PalletMovementScript_OakMoveLeft:
ld a, $3
ld [wNPCMovementScriptFunctionNum], a
.done
+ ld a, BANK(Music_MuseumGuy)
+ ld c, a
+ ld a, MUSIC_MUSEUM_GUY
+ call PlayMusic
ld hl, wFlags_D733
set 1, [hl]
ld a, $fc
@@ -127,8 +131,9 @@ PalletMovementScript_WalkToLab:
ld [wNPCMovementScriptFunctionNum], a
ret
+
RLEList_ProfOakWalkToLab:
- db NPC_MOVEMENT_DOWN, 5
+ db NPC_MOVEMENT_DOWN, 6 ; differs from red
db NPC_MOVEMENT_LEFT, 1
db NPC_MOVEMENT_DOWN, 5
db NPC_MOVEMENT_RIGHT, 3
@@ -141,7 +146,7 @@ RLEList_PlayerWalkToLab:
db D_RIGHT, 3
db D_DOWN, 5
db D_LEFT, 1
- db D_DOWN, 6
+ db D_DOWN, 7 ; differs from red
db -1 ; end
PalletMovementScript_Done:
@@ -163,11 +168,9 @@ PewterMuseumGuyMovementScriptPointerTable::
PewterMovementScript_WalkToMuseum:
ld a, BANK(Music_MuseumGuy)
- ld [wAudioROMBank], a
- ld [wAudioSavedROMBank], a
+ ld c, a
ld a, MUSIC_MUSEUM_GUY
- ld [wNewSoundID], a
- call PlaySound
+ call PlayMusic
ld a, [wSpriteIndex]
swap a
ld [wNPCMovementScriptSpriteOffset], a
@@ -179,7 +182,7 @@ PewterMovementScript_WalkToMuseum:
ld [wSimulatedJoypadStatesIndex], a
xor a
ld [wWhichPewterGuy], a
- predef PewterGuys
+ call PewterGuys
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterMuseumGuy
call DecodeRLEList
@@ -219,11 +222,9 @@ PewterGymGuyMovementScriptPointerTable::
PewterMovementScript_WalkToGym:
ld a, BANK(Music_MuseumGuy)
- ld [wAudioROMBank], a
- ld [wAudioSavedROMBank], a
+ ld c, a
ld a, MUSIC_MUSEUM_GUY
- ld [wNewSoundID], a
- call PlaySound
+ call PlayMusic
ld a, [wSpriteIndex]
swap a
ld [wNPCMovementScriptSpriteOffset], a
@@ -236,7 +237,7 @@ PewterMovementScript_WalkToGym:
ld [wSimulatedJoypadStatesIndex], a
ld a, 1
ld [wWhichPewterGuy], a
- predef PewterGuys
+ call PewterGuys
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterGymGuy
call DecodeRLEList
@@ -266,27 +267,4 @@ RLEList_PewterGymGuy:
db NPC_MOVEMENT_RIGHT, 3
db -1 ; end
-FreezeEnemyTrainerSprite::
- ld a, [wCurMap]
- cp POKEMON_TOWER_7F
- ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
- ld hl, RivalIDs
- ld a, [wEngagedTrainerClass]
- ld b, a
-.loop
- ld a, [hli]
- cp -1
- jr z, .notRival
- cp b
- ret z ; the rival leaves after battling, so don't freeze him
- jr .loop
-.notRival
- ld a, [wSpriteIndex]
- ldh [hSpriteIndex], a
- jp SetSpriteMovementBytesToFF
-
-RivalIDs:
- db OPP_RIVAL1
- db OPP_RIVAL2
- db OPP_RIVAL3
- db -1 ; end
+INCLUDE "engine/events/pewter_guys.asm"
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 6a92ccc0..564ad65a 100644
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -76,6 +76,7 @@ InitCutAnimOAM:
ld [wWhichAnimationOffsets], a
ld a, %11100100
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
ld a, [wCutTile]
cp $52
jr z, .grass
@@ -123,8 +124,8 @@ WriteCutOrBoulderDustAnimationOAMBlock:
jp WriteOAMBlock
CutOrBoulderDustAnimationTilesAndAttributes:
- dbsprite 2, -1, 0, 4, $fd, OAM_OBP1
- dbsprite 2, -1, 0, 6, $ff, OAM_OBP1
+ dbsprite 2, -1, 4, 4, $fd, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 2, -1, 4, 6, $ff, OAM_OBP1 | OAM_HIGH_PALS
GetCutOrBoulderDustAnimationOffsets:
ld hl, wSpritePlayerStateData1YPixels
diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm
index 3d4a5905..1f691eef 100644
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -18,6 +18,7 @@ AnimCut:
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
call DelayFrame
pop bc
dec c
@@ -68,6 +69,7 @@ AnimCutGrass_UpdateOAMEntries:
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
call DelayFrame
pop bc
dec c
diff --git a/engine/overworld/dungeon_warps.asm b/engine/overworld/dungeon_warps.asm
new file mode 100644
index 00000000..7641c688
--- /dev/null
+++ b/engine/overworld/dungeon_warps.asm
@@ -0,0 +1,15 @@
+IsPlayerOnDungeonWarp::
+ xor a
+ ld [wWhichDungeonWarp], a
+ ld a, [wd72d]
+ bit 4, a
+ ret nz
+ call ArePlayerCoordsInArray
+ ret nc
+ ld a, [wCoordIndex]
+ ld [wWhichDungeonWarp], a
+ ld hl, wd72d
+ set 4, [hl]
+ ld hl, wd732
+ set 4, [hl]
+ ret
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index bb291567..ed016107 100644
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -7,6 +7,7 @@ AnimateBoulderDust:
ld [wUpdateSpritesEnabled], a
ld a, %11100100
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
call LoadSmokeTileFourTimes
farcall WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
@@ -21,6 +22,7 @@ AnimateBoulderDust:
ldh a, [rOBP1]
xor %01100100
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
call Delay3
pop bc
dec c
diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm
index fa404602..b873ffad 100644
--- a/engine/overworld/elevator.asm
+++ b/engine/overworld/elevator.asm
@@ -4,8 +4,7 @@ ShakeElevator::
ld de, SCREEN_HEIGHT * $20
call ShakeElevatorRedrawRow
call Delay3
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ldh a, [hSCY]
ld d, a
ld e, $1
@@ -27,8 +26,7 @@ ShakeElevator::
jr nz, .shakeLoop
ld a, d
ldh [hSCY], a
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ld c, BANK(SFX_Safari_Zone_PA)
ld a, SFX_SAFARI_ZONE_PA
call PlayMusic
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 5a41c226..3ad714e9 100644
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -1,13 +1,16 @@
EmotionBubble:
ld a, [wWhichEmotionBubble]
+ and $f
+ swap a
ld c, a
ld b, 0
- ld hl, EmotionBubblesPointerTable
+ ld hl, EmotionBubbles
+ add hl, bc ; each emotion bubble is 16 bytes, so calculate the offset directly instead of with a pointer table
add hl, bc
add hl, bc
- ld e, [hl]
- inc hl
- ld d, [hl]
+ add hl, bc
+ ld e, l
+ ld d, h
ld hl, vChars1 tile $78
lb bc, BANK(EmotionBubbles), 4
call CopyVideoData
@@ -59,13 +62,9 @@ EmotionBubble:
pop af
ld [wUpdateSpritesEnabled], a
call DelayFrame
- jp UpdateSprites
+ call UpdateSprites
+ ret
-EmotionBubblesPointerTable:
-; entries correspond to *_BUBBLE constants
- dw ShockEmote
- dw QuestionEmote
- dw HappyEmote
EmotionBubblesOAM:
dbsprite 0, -1, 0, 0, $f9, 0
@@ -75,3 +74,8 @@ EmotionBubbles:
ShockEmote: INCBIN "gfx/emotes/shock.2bpp"
QuestionEmote: INCBIN "gfx/emotes/question.2bpp"
HappyEmote: INCBIN "gfx/emotes/happy.2bpp"
+SkullEmote: INCBIN "gfx/emotes/skull.2bpp"
+HeartEmote: INCBIN "gfx/emotes/heart.2bpp"
+BoltEmote: INCBIN "gfx/emotes/bolt.2bpp"
+ZzzEmote: INCBIN "gfx/emotes/zzz.2bpp"
+FishEmote: INCBIN "gfx/emotes/fish.2bpp"
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 63c8f9ea..451ea001 100644
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -12,14 +12,13 @@ AnimateHealingMachine:
push af
ld a, $e0
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
ld hl, wOAMBuffer + $84
ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.waitLoop
ld a, [wAudioFadeOutControl]
and a ; is fade-out finished?
@@ -38,9 +37,7 @@ AnimateHealingMachine:
cp BANK("Audio Engine 3")
ld [wAudioSavedROMBank], a
jr nz, .next
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.next
@@ -57,6 +54,7 @@ AnimateHealingMachine:
call DelayFrames
pop af
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
pop hl
pop af
ld [hl], a
@@ -67,14 +65,14 @@ PokeCenterFlashingMonitorAndHealBall:
PokeCenterOAMData:
; heal machine monitor
- dbsprite 6, 4, 4, 4, $7c, OAM_OBP1
+ dbsprite 6, 4, 4, 4, $7c, OAM_OBP1 | OAM_HIGH_PALS
; poke balls 1-6
- dbsprite 6, 5, 0, 3, $7d, OAM_OBP1
- dbsprite 7, 5, 0, 3, $7d, OAM_OBP1 | OAM_HFLIP
- dbsprite 6, 6, 0, 0, $7d, OAM_OBP1
- dbsprite 7, 6, 0, 0, $7d, OAM_OBP1 | OAM_HFLIP
- dbsprite 6, 6, 0, 5, $7d, OAM_OBP1
- dbsprite 7, 6, 0, 5, $7d, OAM_OBP1 | OAM_HFLIP
+ dbsprite 6, 5, 0, 3, $7d, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 7, 5, 0, 3, $7d, OAM_OBP1 | OAM_HIGH_PALS | OAM_HFLIP
+ dbsprite 6, 6, 0, 0, $7d, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 7, 6, 0, 0, $7d, OAM_OBP1 | OAM_HIGH_PALS | OAM_HFLIP
+ dbsprite 6, 6, 0, 5, $7d, OAM_OBP1 | OAM_HIGH_PALS
+ dbsprite 7, 6, 0, 5, $7d, OAM_OBP1 | OAM_HIGH_PALS | OAM_HFLIP
; d = value to xor with palette
FlashSprite8Times:
@@ -83,6 +81,7 @@ FlashSprite8Times:
ldh a, [rOBP1]
xor d
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
ld c, 10
call DelayFrames
dec b
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index 855328e7..84108986 100644
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -1,19 +1,3 @@
-IsPlayerOnDungeonWarp::
- xor a
- ld [wWhichDungeonWarp], a
- ld a, [wd72d]
- bit 4, a
- ret nz
- call ArePlayerCoordsInArray
- ret nc
- ld a, [wCoordIndex]
- ld [wWhichDungeonWarp], a
- ld hl, wd72d
- set 4, [hl]
- ld hl, wd732
- set 4, [hl]
- ret
-
; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
CheckForHiddenObject::
ld hl, hItemAlreadyFound
@@ -22,22 +6,12 @@ CheckForHiddenObject::
ld [hli], a ; [hSavedMapTextPtr]
ld [hli], a ; [hSavedMapTextPtr + 1]
ld [hl], a ; [hDidntFindAnyHiddenObject]
- ld de, $0
ld hl, HiddenObjectMaps
-.hiddenMapLoop
- ld a, [hli]
- ld b, a
- cp $ff
- jr z, .noMatch
+ ld de, 3
ld a, [wCurMap]
- cp b
- jr z, .foundMatchingMap
- inc de
- inc de
- jr .hiddenMapLoop
-.foundMatchingMap
- ld hl, HiddenObjectPointers
- add hl, de
+ call IsInArray
+ jr nc, .noMatch
+ inc hl
ld a, [hli]
ld h, [hl]
ld l, a
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index f01ae5ef..9925c528 100644
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -61,10 +61,13 @@ LoadHoppingShadowOAM:
ld de, LedgeHoppingShadow
lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8
call CopyVideoDataDouble
- ld a, $9
- lb bc, $54, $48 ; b, c = y, x coordinates of shadow
- ld de, LedgeHoppingShadowOAM
- call WriteOAMBlock
+ ld hl, LedgeHoppingShadowOAM
+ ld de, wOAMBuffer + 36 * 4
+ ld bc, LedgeHoppingShadowOAMEnd - LedgeHoppingShadowOAM
+ call CopyData
+ ld a, $a0
+ ld [wOAMBuffer + 38 * 4], a
+ ld [wOAMBuffer + 39 * 4], a
ret
LedgeHoppingShadow:
@@ -72,5 +75,6 @@ LedgeHoppingShadow:
LedgeHoppingShadowEnd:
LedgeHoppingShadowOAM:
- dbsprite 2, -1, 0, 7, $ff, OAM_HFLIP
- dbsprite 8, -1, 0, 7, $ff, OAM_HFLIP | OAM_VFLIP
+ dbsprite 9, 11, 0, 0, $ff, 0
+ dbsprite 10, 11, 0, 0, $ff, OAM_HFLIP
+LedgeHoppingShadowOAMEnd:
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index fa3a37dc..c0fb4863 100644
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -8,247 +8,13 @@
; wSpriteStateData2 sprite slot, respectively, within loops. The X is the loop index.
; If there is an inner loop, Y is the inner loop index, i.e. y#SPRITESTATEDATA1_* and
; y#SPRITESTATEDATA2_* denote fields of the sprite slots iterated over in the inner loop.
-InitMapSprites::
+_InitMapSprites::
call InitOutsideMapSprites
ret c ; return if the map is an outside map (already handled by above call)
; if the map is an inside map (i.e. mapID >= $25)
- ld hl, wSpritePlayerStateData1PictureID
- ld de, wSpritePlayerStateData2PictureID
-; Loop to copy picture IDs from [x#SPRITESTATEDATA1_PICTUREID]
-; to [x#SPRITESTATEDATA2_PICTUREID] for LoadMapSpriteTilePatterns.
-.copyPictureIDLoop
- ld a, [hl] ; a = [x#SPRITESTATEDATA1_PICTUREID]
- ld [de], a ; [x#SPRITESTATEDATA2_PICTUREID] = a
- ld a, $10
- add e
- ld e, a
- ld a, $10
- add l
- ld l, a
- jr nz, .copyPictureIDLoop
-
-; This is used for both inside and outside maps, since it is called by
-; InitOutsideMapSprites.
-; Loads tile pattern data for sprites into VRAM.
-LoadMapSpriteTilePatterns:
- ld a, [wNumSprites]
- and a ; are there any sprites?
- jr nz, .spritesExist
- ret
-.spritesExist
- ld c, a ; c = [wNumSprites]
- ld b, $10 ; number of sprite slots
- ld hl, wSpritePlayerStateData2PictureID
- xor a
- ldh [hFourTileSpriteCount], a
-; Loop to copy picture IDs from [x#SPRITESTATEDATA2_PICTUREID]
-; to [x#SPRITESTATEDATA2_IMAGEBASEOFFSET].
-.copyPictureIDLoop
- ld a, [hli] ; a = [x#SPRITESTATEDATA2_PICTUREID]
- ld [hld], a ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET] = a
- ld a, l
- add $10
- ld l, a
- dec b
- jr nz, .copyPictureIDLoop
- ld hl, wSprite01StateData2ImageBaseOffset
-.loadTilePatternLoop
- ld de, wSprite01StateData2PictureID
-; Check if the current picture ID has already had its tile patterns loaded.
-; This done by looping through the previous sprite slots and seeing if any of
-; their picture ID's match that of the current sprite slot.
-.checkIfAlreadyLoadedLoop
- ld a, e
- and $f0
- ld b, a ; b = offset of the wSpriteStateData2 sprite slot being checked against
- ld a, l
- and $f0 ; a = offset of current wSpriteStateData2 sprite slot
- cp b ; done checking all previous sprite slots?
- jr z, .notAlreadyLoaded
- ld a, [de] ; picture ID of the wSpriteStateData2 sprite slot being checked against
- cp [hl] ; do the picture ID's match?
- jp z, .alreadyLoaded
- ld a, e
- add $10
- ld e, a
- jr .checkIfAlreadyLoadedLoop
-.notAlreadyLoaded
- ld de, wSpritePlayerStateData2ImageBaseOffset
- ld b, $01
-; loop to find the highest tile pattern VRAM slot (among the first 10 slots) used by a previous sprite slot
-; this is done in order to find the first free VRAM slot available
-.findNextVRAMSlotLoop
- ld a, e
- add $10
- ld e, a
- ld a, l
- cp e ; reached current slot?
- jr z, .foundNextVRAMSlot
- ld a, [de] ; y#SPRITESTATEDATA2_IMAGEBASEOFFSET
- cp 11 ; is it one of the first 10 slots?
- jr nc, .findNextVRAMSlotLoop
- cp b ; compare the slot being checked to the current max
- jr c, .findNextVRAMSlotLoop ; if the slot being checked is less than the current max
-; if the slot being checked is greater than or equal to the current max
- ld b, a ; store new max VRAM slot
- jr .findNextVRAMSlotLoop
-.foundNextVRAMSlot
- inc b ; increment previous max value to get next VRAM tile pattern slot
- ld a, b ; a = next VRAM tile pattern slot
- push af
- ld a, [hl] ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
- ld b, a ; b = current sprite picture ID
- cp FIRST_STILL_SPRITE ; is it a 4-tile sprite?
- jr c, .notFourTileSprite
- pop af
- ldh a, [hFourTileSpriteCount]
- add 11
- jr .storeVRAMSlot
-.notFourTileSprite
- pop af
-.storeVRAMSlot
- ld [hl], a ; store VRAM slot at [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
- ldh [hVRAMSlot], a ; used to determine if it's 4-tile sprite later
- ld a, b ; a = current sprite picture ID
- dec a
- add a
- add a
- push bc
- push hl
- ld hl, SpriteSheetPointerTable
- jr nc, .noCarry
- inc h
-.noCarry
- add l
- ld l, a
- jr nc, .noCarry2
- inc h
-.noCarry2
- push hl
- call ReadSpriteSheetData
- push af
- push de
- push bc
- ld hl, vNPCSprites ; VRAM base address
- ld bc, 12 tiles ; number of bytes per VRAM slot
- ldh a, [hVRAMSlot]
- cp 11 ; is it a 4-tile sprite?
- jr nc, .fourTileSpriteVRAMAddr
- ld d, a
- dec d
-; hl = vSprites + [hVRAMSlot] * 12 tiles
-.calculateVRAMAddrLoop
- add hl, bc
- dec d
- jr nz, .calculateVRAMAddrLoop
- jr .loadStillTilePattern
-.fourTileSpriteVRAMAddr
- ld hl, vSprites tile $7c ; address for second 4-tile sprite
- ldh a, [hFourTileSpriteCount]
- and a
- jr nz, .loadStillTilePattern
-; if it's the first 4-tile sprite
- ld hl, vSprites tile $78 ; address for first 4-tile sprite
- inc a
- ldh [hFourTileSpriteCount], a
-.loadStillTilePattern
- pop bc
- pop de
- pop af
- push hl
- push hl
- ld h, d
- ld l, e
- pop de
- ld b, a
- ld a, [wFontLoaded]
- bit 0, a ; reloading upper half of tile patterns after displaying text?
- jr nz, .skipFirstLoad ; if so, skip loading data into the lower half
- ld a, b
- ld b, 0
- call FarCopyData2 ; load tile pattern data for sprite when standing still
-.skipFirstLoad
- pop de
- pop hl
- ldh a, [hVRAMSlot]
- cp 11 ; is it a 4-tile sprite?
- jr nc, .skipSecondLoad ; if so, there is no second block
- push de
- call ReadSpriteSheetData
- push af
- ld a, $c0
- add e
- ld e, a
- jr nc, .noCarry3
- inc d
-.noCarry3
- ld a, [wFontLoaded]
- bit 0, a ; reloading upper half of tile patterns after displaying text?
- jr nz, .loadWhileLCDOn
- pop af
- pop hl
- set 3, h ; add $800 to hl
- push hl
- ld h, d
- ld l, e
- pop de
- call FarCopyData2 ; load tile pattern data for sprite when walking
- jr .skipSecondLoad
-; When reloading the upper half of tile patterns after displaying text, the LCD
-; will be on, so CopyVideoData (which writes to VRAM only during V-blank) must
-; be used instead of FarCopyData2.
-.loadWhileLCDOn
- pop af
- pop hl
- set 3, h ; add $800 to hl
- ld b, a
- swap c
- call CopyVideoData ; load tile pattern data for sprite when walking
-.skipSecondLoad
- pop hl
- pop bc
- jr .nextSpriteSlot
-.alreadyLoaded ; if the current picture ID has already had its tile patterns loaded
- inc de
- ld a, [de] ; a = [y#SPRITESTATEDATA2_IMAGEBASEOFFSET]
- ld [hl], a ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET] = a
-.nextSpriteSlot
- ld a, l
- add $10
- ld l, a
- dec c
- jp nz, .loadTilePatternLoop
- ld hl, wSpritePlayerStateData2PictureID
- ld b, $10
-; the pictures IDs stored at [x#SPRITESTATEDATA2_PICTUREID] are no longer needed,
-; so zero them
-.zeroStoredPictureIDLoop
- xor a
- ld [hl], a ; [x#SPRITESTATEDATA2_PICTUREID]
- ld a, $10
- add l
- ld l, a
- dec b
- jr nz, .zeroStoredPictureIDLoop
- ret
-
-; reads data from SpriteSheetPointerTable
-; INPUT:
-; hl = address of sprite sheet entry
-; OUTPUT:
-; de = pointer to sprite sheet
-; bc = length in bytes
-; a = ROM bank
-ReadSpriteSheetData:
- ld a, [hli]
- ld e, a
- ld a, [hli]
- ld d, a
- ld a, [hli]
- ld c, a
- xor a
- ld b, a
- ld a, [hli]
+ call LoadSpriteSetFromMapHeader
+ call LoadMapSpriteTilePatterns
+ call Func_14150
ret
; Loads sprite set for outside maps (cities and routes) and sets VRAM slots.
@@ -257,15 +23,8 @@ InitOutsideMapSprites:
ld a, [wCurMap]
cp FIRST_INDOOR_MAP ; is the map a city or a route?
ret nc ; if not, return
- ld hl, MapSpriteSets
- add l
- ld l, a
- jr nc, .noCarry
- inc h
-.noCarry
- ld a, [hl] ; a = spriteSetID
- cp $f0 ; does the map have 2 sprite sets?
- call nc, GetSplitMapSpriteSetID ; if so, choose the appropriate one
+ call GetSplitMapSpriteSetID
+; if so, choose the appropriate one
ld b, a ; b = spriteSetID
ld a, [wFontLoaded]
bit 0, a ; reloading upper half of tile patterns after displaying text?
@@ -277,120 +36,285 @@ InitOutsideMapSprites:
ld a, b
ld [wSpriteSetID], a
dec a
- ld b, a
- sla a
ld c, a
- sla a
- sla a
- add c
- add b ; a = (spriteSetID - 1) * 11
- ld de, SpriteSets
-; add a to de to get offset of sprite set
- add e
- ld e, a
- jr nc, .noCarry2
- inc d
-.noCarry2
- ld hl, wSpritePlayerStateData2PictureID
- ld a, SPRITE_RED
- ld [hl], a
- ld bc, wSpriteSet
-; Load the sprite set into RAM.
-; This loop also fills [x#SPRITESTATEDATA2_PICTUREID] where X is from $0 to $A
-; with picture IDs. This is done so that LoadMapSpriteTilePatterns will
-; load tile patterns for all sprite pictures in the sprite set.
-.loadSpriteSetLoop
- ld a, $10
- add l
- ld l, a
- ld a, [de] ; sprite picture ID from sprite set
- ld [hl], a ; [x#SPRITESTATEDATA2_PICTUREID]
- ld [bc], a
- inc de
- inc bc
- ld a, l
- cp $bd ; reached 11th sprite slot?
- jr nz, .loadSpriteSetLoop
- ld b, 4 ; 4 remaining sprite slots
-.zeroRemainingSlotsLoop ; loop to zero the picture ID's of the remaining sprite slots
- ld a, $10
- add l
- ld l, a
- xor a
- ld [hl], a ; [x#SPRITESTATEDATA2_PICTUREID]
- dec b
- jr nz, .zeroRemainingSlotsLoop
- ld a, [wNumSprites]
- push af ; save number of sprites
- ld a, 11 ; 11 sprites in sprite set
- ld [wNumSprites], a
+ ld b, 0
+ ld a, (wSpriteSetID - wSpriteSet)
+ ld hl, SpriteSets
+ call AddNTimes ; get sprite set offset
+ ld de, wSpriteSet
+ ld bc, (wSpriteSetID - wSpriteSet)
+ call CopyData ; copy it to wSpriteSet
call LoadMapSpriteTilePatterns
- pop af
- ld [wNumSprites], a ; restore number of sprites
- ld hl, wSprite01StateData2ImageBaseOffset
- ld b, $0f
-; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the
-; order of the map's sprite set, not the order of the actual sprites loaded
-; for the current map. So, they are not needed and are zeroed by this loop.
-.zeroVRAMSlotsLoop
- xor a
- ld [hl], a ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
- ld a, $10
- add l
- ld l, a
- dec b
- jr nz, .zeroVRAMSlotsLoop
.skipLoadingSpriteSet
- ld hl, wSprite01StateData1
+ call Func_14150
+ scf
+ ret
+
+LoadSpriteSetFromMapHeader:
; This loop stores the correct VRAM tile pattern slots according the sprite
; data from the map's header. Since the VRAM tile pattern slots are filled in
; the order of the sprite set, in order to find the VRAM tile pattern slot
; for a sprite slot, the picture ID for the sprite is looked up within the
-; sprite set. The index of the picture ID within the sprite set plus one
-; (since the Red sprite always has the first VRAM tile pattern slot) is the
-; VRAM tile pattern slot.
+; sprite set. The index of the picture ID within the sprite set plus two
+; (since the Red sprite always has the first VRAM tile pattern slot and the
+; Pikachu sprite reserves the second slot) is the VRAM tile pattern slot.
+ ld hl, wSpriteSet
+ ld bc, (wSpriteSetID - wSpriteSet)
+ xor a
+ call FillMemory
+ ld a, SPRITE_PIKACHU ; load Pikachu separately
+ ld [wSpriteSet], a
+ ld hl, wSprite01StateData1
+ ld a, 14
.storeVRAMSlotsLoop
- ld c, 0
+ push af
ld a, [hl] ; [x#SPRITESTATEDATA1_PICTUREID] (zero if sprite slot is not used)
and a ; is the sprite slot used?
- jr z, .skipGettingPictureIndex ; if the sprite slot is not used
- ld b, a ; b = picture ID
+ jr z, .continue ; if the sprite slot is not used
+ ld c, a
+ call CheckForFourTileSprite ; is this a four tile sprite?
+ jr nc, .isFourTileSprite
+; loop through the space reserved for four tile picture IDs
+ ld de, wSpriteSet + 9
+ ld b, 2
+ call CheckIfPictureIDAlreadyLoaded
+ jr .continue
+
+.isFourTileSprite
+; loop through the space reserved for regular picture IDs
ld de, wSpriteSet
-; Loop to find the index of the sprite's picture ID within the sprite set.
-.getPictureIndexLoop
- inc c
+ ld b, 9
+ call CheckIfPictureIDAlreadyLoaded
+.continue
+ ld de, wSprite02StateData1 - wSprite01StateData1
+ add hl, de
+ pop af
+ dec a
+ jr nz, .storeVRAMSlotsLoop
+ ret
+
+CheckIfPictureIDAlreadyLoaded:
+; Check if the current picture ID has already had its tile patterns loaded.
+; This done by looping through the previous sprite slots and seeing if any of
+; their picture ID's match that of the current sprite slot.
+.loop
ld a, [de]
+ and a ; is sprite set slot not taken up yet?
+ jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached
+ ; the end of data for the last sprite set
+
+ cp c ; is the tile pattern already loaded?
+ ret z ; don't redundantly load
+ dec b ; have we reached the end of the sprite set?
+ jr z, .spriteNotAlreadyLoaded ; if so, we're done here
inc de
- cp b ; does the picture ID match?
- jr nz, .getPictureIndexLoop
- inc c
-.skipGettingPictureIndex
- push hl
- inc h
- ld a, $0e
- add l
- ld l, a
- ld a, c ; a = VRAM slot (zero if sprite slot is not used)
- ld [hl], a ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
- pop hl
- ld a, $10
- add l
+ jr .loop
+
+.spriteSlotNotTaken
+ ld a, c
+ ld [de], a
+ ret
+.spriteNotAlreadyLoaded
+ scf
+ ret
+
+CheckForFourTileSprite:
+; Checks for a sprite added in yellow
+; Returns no carry if the sprite is Pikachu, as its sprite is handled separately
+; Else, returns carry if the sprite uses 4 tiles
+ cp SPRITE_PIKACHU ; is this the Pikachu Sprite?
+ ret z ; return if yes
+
+ cp FIRST_STILL_SPRITE ; is this a four tile sprite?
+ jr nc, .notYellowSprite ; set carry if yes
+; regular sprite
+ and a
+ ret
+
+.notYellowSprite
+ scf
+ ret
+
+LoadMapSpriteTilePatterns:
+ ld a, 0
+.loop
+ ldh [hVRAMSlot], a
+ cp 9
+ jr nc, .fourTileSprite
+ call LoadStillTilePattern
+ call LoadWalkingTilePattern
+ jr .continue
+
+.fourTileSprite
+ call LoadStillTilePattern
+.continue
+ ldh a, [hVRAMSlot]
+ inc a
+ cp 11
+ jr nz, .loop
+ ret
+
+ReloadWalkingTilePatterns:
+ xor a
+.loop
+ ldh [hVRAMSlot], a
+ cp 9
+ jr nc, .fourTileSprite
+ call LoadWalkingTilePattern
+.fourTileSprite
+ ldh a, [hVRAMSlot]
+ inc a
+ cp 11
+ jr nz, .loop
+ ret
+
+LoadStillTilePattern:
+ ld a, [wFontLoaded]
+ bit 0, a ; reloading upper half of tile patterns after displaying text?
+ ret nz ; if so, skip loading data into the lower half
+ call ReadSpriteSheetData
+ ret nc
+ call GetSpriteVRAMAddress
+ call CopyVideoDataAlternate ; new yellow function
+ ret
+
+LoadWalkingTilePattern:
+ call ReadSpriteSheetData
+ ret nc
+ ld hl, $c0
+ add hl, de
+ ld d, h
+ ld e, l
+ call GetSpriteVRAMAddress
+ set 3, h ; add $800 to hl
+ call CopyVideoDataAlternate
+ ret
+
+GetSpriteVRAMAddress:
+ push bc
+ ldh a, [hVRAMSlot]
+ ld c, a
+ ld b, 0
+ ld hl, SpriteVRAMAddresses
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
ld l, a
+ pop bc
+ ret
+
+SpriteVRAMAddresses:
+; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM
+; slot and adding the result to $8000 (the VRAM base address).
+ dw vChars0 + $0c0
+ dw vChars0 + $180
+ dw vChars0 + $240
+ dw vChars0 + $300
+ dw vChars0 + $3c0
+ dw vChars0 + $480
+ dw vChars0 + $540
+ dw vChars0 + $600
+ dw vChars0 + $6c0
+ dw vChars0 + $780 ; 4-tile sprites
+ dw vChars0 + $7c0 ; 4-tile sprites
+
+ReadSpriteSheetData:
+ ldh a, [hVRAMSlot]
+ ld e, a
+ ld d, 0
+ ld hl, wSpriteSet
+ add hl, de
+ ld a, [hl]
and a
- jr nz, .storeVRAMSlotsLoop
+ ret z
+
+ dec a
+ ld l, a
+ ld h, 0
+ add hl, hl
+ add hl, hl
+ ld de, SpriteSheetPointerTable
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ inc hl
+ ld c, [hl]
+ swap c ; get the number of tiles, not the raw byte length
+ ; this is because of the use of CopyVideoDataAlternate
+ inc hl
+ ld b, [hl]
+ inc hl
scf
ret
+Func_14150:
+ ld a, $1
+ ld [wSpritePlayerStateData2ImageBaseOffset], a ; vram slot for player
+ ld a, $2
+ ld [wSpritePikachuStateData2ImageBaseOffset], a ; vram slot for Pikachu
+ ld a, $e
+ ld hl, wSprite01StateData1
+.loop
+ ldh [hVRAMSlot], a ; store current sprite set slot as a counter
+ ld a, [hl] ; [x#SPRITESTATEDATA1_PICTUREID]
+ and a ; is the sprite unused?
+ jr z, .spriteUnused
+ call Func_14179
+ push hl
+ ld de, (wSpritePlayerStateData2ImageBaseOffset) - (wSpriteStateData1) ; $10e
+ add hl, de ; [x#SPRITESTATEDATA2_IMAGEBASEOFFSET]
+ ld [hl], a ; write offset
+ pop hl
+.spriteUnused
+ ld de, wSprite02StateData1 - wSprite01StateData1
+ add hl, de
+ ldh a, [hVRAMSlot]
+ dec a
+ jr nz, .loop
+ ret
+
+Func_14179:
+ push de
+ push bc
+ ld c, a ; c = picture ID
+ ld b, 11
+ ld de, wSpriteSet
+.findSpriteImageBaseOffsetLoop
+ ld a, [de] ; a = sprite set picture ID
+ cp c ; have we found a match?
+ jr z, .foundSpritePictureID ; if so, get the sprite image base offset and return
+ inc de
+ dec b ; have we looped through all entries in wSpriteSet?
+ jr nz, .findSpriteImageBaseOffsetLoop ; continue looping if not
+ ld a, $1 ; assume slot one if this ever happens
+ jr .done
+.foundSpritePictureID
+ ld a, 13
+ sub b ; get sprite image base offset
+.done
+ pop bc
+ pop de
+ ret
+
+GetSplitMapSpriteSetID:
+ ld e, a
+ ld d, 0
+ ld hl, MapSpriteSets
+ add hl, de
+ ld a, [hl] ; a = spriteSetID
+ cp $f0 ; does the map have 2 sprite sets?
+ ret c
; Chooses the correct sprite set ID depending on the player's position within
; the map for maps with two sprite sets.
-GetSplitMapSpriteSetID:
cp $f8
jr z, .route20
ld hl, SplitMapSpriteSets
and $0f
dec a
- sla a
- sla a
+ add a
+ add a
add l
ld l, a
jr nc, .noCarry
diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm
index 31fdc257..bcaa731b 100644
--- a/engine/overworld/missable_objects.asm
+++ b/engine/overworld/missable_objects.asm
@@ -15,20 +15,13 @@ MarkTownVisitedAndLoadMissableObjects::
add hl, bc
ld a, [hli] ; load missable objects pointer in hl
ld h, [hl]
- ; fall through
-
-LoadMissableObjects:
ld l, a
push hl
- ld de, MissableObjects ; calculate difference between out pointer and the base pointer
ld a, l
- sub e
- jr nc, .asm_f13c
- dec h
-.asm_f13c
+ sub LOW(MissableObjects) ; calculate difference between out pointer and the base pointer
ld l, a
ld a, h
- sub d
+ sbc HIGH(MissableObjects)
ld h, a
ld a, h
ldh [hDividend], a
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index 2fb8c384..dadf2194 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -22,7 +22,13 @@ UpdatePlayerSprite:
ld [wSpritePlayerStateData1ImageIndex], a
ret
.lowerLeftTileIsMapTile
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
call DetectCollisionBetweenSprites
+ pop af
+ ld [wUpdateSpritesEnabled], a
ld h, HIGH(wSpriteStateData1)
ld a, [wWalkCounter]
and a
@@ -48,42 +54,24 @@ UpdatePlayerSprite:
jr z, .notMoving
ld a, SPRITE_FACING_RIGHT
jr .next
+.next
+ ld [wSpritePlayerStateData1FacingDirection], a ; facing direction
+ ld a, [wFontLoaded]
+ bit 0, a
+ jr z, .moving
.notMoving
; zero the animation counters
xor a
ld [wSpritePlayerStateData1IntraAnimFrameCounter], a
ld [wSpritePlayerStateData1AnimFrameCounter], a
- jr .calcImageIndex
-.next
- ld [wSpritePlayerStateData1FacingDirection], a
- ld a, [wFontLoaded]
- bit 0, a
- jr nz, .notMoving
+ call Func_4e32
+ jr .skipSpriteAnim
.moving
ld a, [wd736]
bit 7, a ; is the player sprite spinning due to a spin tile?
jr nz, .skipSpriteAnim
- ldh a, [hCurrentSpriteOffset]
- add $7
- ld l, a
- ld a, [hl]
- inc a
- ld [hl], a
- cp 4
- jr nz, .calcImageIndex
- xor a
- ld [hl], a
- inc hl
- ld a, [hl]
- inc a
- and $3
- ld [hl], a
-.calcImageIndex
- ld a, [wSpritePlayerStateData1AnimFrameCounter]
- ld b, a
- ld a, [wSpritePlayerStateData1FacingDirection]
- add b
- ld [wSpritePlayerStateData1ImageIndex], a
+ call Func_5274
+ call Func_4e32
.skipSpriteAnim
; If the player is standing on a grass tile, make the player's sprite have
; lower priority than the background so that it's partially obscured by the
@@ -100,15 +88,12 @@ UpdatePlayerSprite:
ld [wSpritePlayerStateData2GrassPriority], a
ret
-UnusedReadSpriteDataFunction:
- push bc
- push af
- ldh a, [hCurrentSpriteOffset]
- ld c, a
- pop af
- add c
- ld l, a
- pop bc
+Func_4e32:
+ ld a, [wSpritePlayerStateData1AnimFrameCounter]
+ ld b, a
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ add b
+ ld [wSpritePlayerStateData1ImageIndex], a
ret
UpdateNPCSprite:
@@ -146,6 +131,8 @@ UpdateNPCSprite:
jp z, UpdateSpriteMovementDelay ; [x#SPRITESTATEDATA1_MOVEMENTSTATUS] == 2
cp $3
jp z, UpdateSpriteInWalkingAnimation ; [x#SPRITESTATEDATA1_MOVEMENTSTATUS] == 3
+ cp $4
+ jp z, Func_5357
ld a, [wWalkCounter]
and a
ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability)
@@ -156,9 +143,9 @@ UpdateNPCSprite:
ld l, a
ld a, [hl] ; x#SPRITESTATEDATA2_MOVEMENTBYTE1
inc a
- jr z, .randomMovement ; value STAY
+ jp z, .randomMovement ; value STAY
inc a
- jr z, .randomMovement ; value WALK
+ jp z, .randomMovement ; value WALK
; scripted movement
dec a
ld [hl], a ; increment movement byte 1 (movement data index)
@@ -183,12 +170,18 @@ UpdateNPCSprite:
ret
.next
cp WALK
- jr nz, .determineDirection
+ jr nz, .asm_4ecb
; current NPC movement data is WALK ($fe). this seems buggy
ld [hl], $1 ; set movement byte 1 to $1
ld de, wNPCMovementDirections
call LoadDEPlusA ; a = [wNPCMovementDirections + $fe] (?)
- jr .determineDirection
+.asm_4ecb
+ push af
+ call Func_5288
+ pop bc
+ ld a, b
+ jr nc, .determineDirection
+ ret
.randomMovement
call GetTileSpriteStandsOn
call Random
@@ -263,34 +256,14 @@ ChangeFacingDirection:
; set carry on failure, clears carry on success
TryWalking:
push hl
- ld h, HIGH(wSpriteStateData1)
- ldh a, [hCurrentSpriteOffset]
- add $9
- ld l, a
- ld [hl], c ; x#SPRITESTATEDATA1_FACINGDIRECTION
- ldh a, [hCurrentSpriteOffset]
- add $3
- ld l, a
- ld [hl], d ; x#SPRITESTATEDATA1_YSTEPVECTOR
- inc l
- inc l
- ld [hl], e ; x#SPRITESTATEDATA1_XSTEPVECTOR
+ call Func_5337
pop hl
push de
- ld c, [hl] ; read tile to walk onto
+ ld c, [hl]
call CanWalkOntoTile
pop de
ret c ; cannot walk there (reinitialization of delay values already done)
- ld h, HIGH(wSpriteStateData2)
- ldh a, [hCurrentSpriteOffset]
- add $4
- ld l, a
- ld a, [hl] ; x#SPRITESTATEDATA2_MAPY
- add d
- ld [hli], a ; update Y position
- ld a, [hl] ; x#SPRITESTATEDATA2_MAPX
- add e
- ld [hl], a ; update X position
+ call Func_5349
ldh a, [hCurrentSpriteOffset]
ld l, a
ld [hl], $10 ; [x#SPRITESTATEDATA2_WALKANIMATIONCOUNTER] = 16
@@ -301,22 +274,7 @@ TryWalking:
; update the walking animation parameters for a sprite that is currently walking
UpdateSpriteInWalkingAnimation:
- ldh a, [hCurrentSpriteOffset]
- add $7
- ld l, a
- ld a, [hl] ; x#SPRITESTATEDATA1_INTRAANIMFRAMECOUNTER
- inc a
- ld [hl], a ; [x#SPRITESTATEDATA1_INTRAANIMFRAMECOUNTER]++
- cp $4
- jr nz, .noNextAnimationFrame
- xor a
- ld [hl], a ; [x#SPRITESTATEDATA1_INTRAANIMFRAMECOUNTER] = 0
- inc l
- ld a, [hl] ; x#SPRITESTATEDATA1_ANIMFRAMECOUNTER
- inc a
- and $3
- ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step)
-.noNextAnimationFrame
+ call Func_5274
ldh a, [hCurrentSpriteOffset]
add $3
ld l, a
@@ -448,6 +406,7 @@ InitializeSpriteStatus:
ld a, $8
ld [hli], a ; [x#SPRITESTATEDATA2_YDISPLACEMENT] = 8
ld [hl], a ; [x#SPRITESTATEDATA2_XDISPLACEMENT] = 8
+ call InitializeSpriteScreenPosition ; could have done fallthrough here
ret
; calculates the sprite's screen position from its map position and the player position
@@ -460,7 +419,7 @@ InitializeSpriteScreenPosition:
ld b, a
ld a, [hl] ; x#SPRITESTATEDATA2_MAPY
sub b ; relative to player position
- swap a ; * 16
+ call Func_5033
sub $4 ; - 4
dec h
ld [hli], a ; [x#SPRITESTATEDATA1_YPIXELS]
@@ -469,11 +428,23 @@ InitializeSpriteScreenPosition:
ld b, a
ld a, [hli] ; x#SPRITESTATEDATA2_MAPX
sub b ; relative to player position
- swap a ; * 16
+ call Func_5033
dec h
ld [hl], a ; [x#SPRITESTATEDATA1_XPIXELS]
ret
+Func_5033:
+ jr nc, .asm_503c
+ cpl
+ inc a
+ swap a
+ cpl
+ inc a
+ ret
+.asm_503c
+ swap a
+ ret
+
; tests if sprite is off screen or otherwise unable to do anything
CheckSpriteAvailability:
predef IsObjectHidden
@@ -593,16 +564,8 @@ CanWalkOntoTile:
and a
ret
.notScripted
- ld a, [wTilesetCollisionPtr]
- ld l, a
- ld a, [wTilesetCollisionPtr+1]
- ld h, a
-.tilePassableLoop
- ld a, [hli]
- cp $ff
- jr z, .impassable
- cp c
- jr nz, .tilePassableLoop
+ call _IsTilePassable
+ jr c, .impassable
ld h, HIGH(wSpriteStateData2)
ldh a, [hCurrentSpriteOffset]
add $6
@@ -626,7 +589,13 @@ CanWalkOntoTile:
jr nc, .impassable ; don't walk off screen
push de
push bc
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
call DetectCollisionBetweenSprites
+ pop af
+ ld [wUpdateSpritesEnabled], a
pop bc
pop de
ld h, HIGH(wSpriteStateData1)
@@ -649,8 +618,9 @@ CanWalkOntoTile:
; stuck whenever they walked upwards 5 steps
; on the other hand, the amount a sprite can walk out to the
; right of bottom is not limited (until the counter overflows)
+ ; this was fixed in Yellow
cp $5
- jr c, .impassable ; if [x#SPRITESTATEDATA2_YDISPLACEMENT]+d < 5, don't go
+ ;jr c, .impassable ; if [x#SPRITESTATEDATA2_YDISPLACEMENT]+d < 5, don't go
jr .checkHorizontal
.upwards
sub $1
@@ -704,7 +674,7 @@ GetTileSpriteStandsOn:
ld l, a
ld a, [hli] ; x#SPRITESTATEDATA1_YPIXELS
add $4 ; align to 2*2 tile blocks (Y position is always off 4 pixels to the top)
- and $f0 ; in case object is currently moving
+ and $f8 ; in case object is currently moving (XXX why changed to $f8?)
srl a ; screen Y tile * 4
ld c, a
ld b, $0
@@ -870,20 +840,235 @@ AnimScriptedNPCMovement:
ret
AdvanceScriptedNPCAnimFrameCounter:
+ call Func_5274
+ ld h, HIGH(wSpriteStateData1)
ldh a, [hCurrentSpriteOffset]
- add $7
+ add $8
ld l, a
ld a, [hl] ; intra-animation frame counter
+ and $3
+ ldh [hSpriteAnimFrameCounter], a
+ ret
+
+Func_5274:
+ ldh a, [hCurrentSpriteOffset]
+ add $7
+ ld l, a
+ ld h, HIGH(wSpriteStateData1)
+ ld a, [hl] ; x#SPRITESTATEDATA1_INTRAANIMFRAMECOUNTER
inc a
- ld [hl], a
- cp 4
+ and $3
+ ld [hl], a ; [x#SPRITESTATEDATA1_INTRAANIMFRAMECOUNTER]++
ret nz
- xor a
- ld [hl], a ; reset intra-animation frame counter
inc l
- ld a, [hl] ; animation frame counter
+ ld a, [hl] ; x#SPRITESTATEDATA1_ANIMFRAMECOUNTER
inc a
and $3
+ ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step)
+ ret
+
+Func_5288:
+; nice lookup table
+; a is supposedly [wNPCMovementDirections + $fe]
+ cp $5
+ jr z, .asm_52af
+ cp $4
+ jr z, .asm_52aa
+ cp $6
+ jr z, .asm_52b4
+ cp $7
+ jr z, .asm_52b9
+ cp $11
+ jr z, .asm_52c3
+ cp $12
+ jr z, .asm_52be
+ cp $13
+ jr z, .asm_52c8
+ cp $14
+ jr z, .asm_52cd
+ xor a
+ ret
+; set 1?
+.asm_52aa
+ call Func_531f
+ jr .asm_52e6
+.asm_52af
+ call Func_5325
+ jr .asm_52e6
+.asm_52b4
+ call Func_5331
+ jr .asm_52e6
+.asm_52b9
+ call Func_532b
+ jr .asm_52e6
+; set 2?
+.asm_52be
+ call Func_531f
+ jr .asm_52fa
+.asm_52c3
+ call Func_5325
+ jr .asm_52fa
+.asm_52c8
+ call Func_5331
+ jr .asm_52fa
+.asm_52cd
+ call Func_532b
+ jr .asm_52fa
+; set 3? (unused)
+.asm_52d2
+ call Func_531f
+ jr .asm_530b
+.asm_52d7
+ call Func_5325
+ jr .asm_530b
+.asm_52dc
+ call Func_5331
+ jr .asm_530b
+.asm_52e1
+ call Func_532b
+ jr .asm_530b
+
+.asm_52e6
+ call Func_5337
+ call Func_5349
+ ldh a, [hCurrentSpriteOffset]
+ ld l, a
+ ld [hl], $8
+ dec h
+ inc l
+ ld [hl], $4
+ call UpdateSpriteImage
+ scf
+ ret
+
+.asm_52fa
+ call Func_5337
+ ldh a, [hCurrentSpriteOffset]
+ ld l, a
+ ld [hl], $8
+ dec h
+ inc l
+ ld [hl], $3
+ call UpdateSpriteImage
+ scf
+ ret
+
+.asm_530b
+ call Func_5337
+ call Func_5349
+ ldh a, [hCurrentSpriteOffset]
+ ld l, a
+ ld [hl], $8
+ dec h
+ inc l
+ ld [hl], $3
+ call UpdateSpriteImage
+ scf
+ ret
+
+Func_531f:
+ lb de, 1, 0
+ ld c, SPRITE_FACING_DOWN
+ ret
+
+Func_5325:
+ lb de, -1, 0
+ ld c, SPRITE_FACING_UP
+ ret
+
+Func_532b:
+ lb de, 0, 1
+ ld c, SPRITE_FACING_RIGHT
+ ret
+
+Func_5331:
+ lb de, 0, -1
+ ld c, SPRITE_FACING_LEFT
+ ret
+
+Func_5337:
+ ldh a, [hCurrentSpriteOffset]
+ add $9
+ ld l, a
+ ld h, HIGH(wSpriteStateData1)
+ ld [hl], c ; x#SPRITESTATEDATA1_FACINGDIRECTION
+ ldh a, [hCurrentSpriteOffset]
+ add $3
+ ld l, a
+ ld [hl], d ; x#SPRITESTATEDATA1_YSTEPVECTOR
+ inc l
+ inc l
+ ld [hl], e ; x#SPRITESTATEDATA1_XSTEPVECTOR
+ ret
+
+Func_5349:
+ ld h, HIGH(wSpriteStateData2)
+ ldh a, [hCurrentSpriteOffset]
+ add $4
+ ld l, a
+ ld a, [hl] ; x#SPRITESTATEDATA2_MAPY
+ add d
+ ld [hli], a ; update Y position
+ ld a, [hl] ; x#SPRITESTATEDATA2_MAPX
+ add e
+ ld [hl], a ; update X position
+ ret
+
+Func_5357:
+ call Func_5274
+ ldh a, [hCurrentSpriteOffset]
+ add $3
+ ld l, a
+ ld h, HIGH(wSpriteStateData1)
+ ld a, [hli]
+ add a
+ ld b, a
+ ld a, [hl]
+ add b
+ ld [hli], a
+ ld a, [hli]
+ add a
+ ld b, a
+ ld a, [hl]
+ add b
+ ld [hl], a
+ ldh a, [hCurrentSpriteOffset]
+ ld l, a
+ ld h, HIGH(wSpriteStateData2)
+ dec [hl]
+ ret nz
+ ld a, $6
+ add l
+ ld l, a
+ ld a, [hl]
+ cp $fe
+ jr nc, .asm_5386
+ ldh a, [hCurrentSpriteOffset]
+ inc a
+ ld l, a
+ ld h, HIGH(wSpriteStateData1)
+ ld [hl], $1
+ ret
+.asm_5386
+ call Random
+ ldh a, [hCurrentSpriteOffset]
+ add $8
+ ld l, a
+ ld h, HIGH(wSpriteStateData2)
+ ldh a, [hRandomAdd]
+ and $7f
+ ld [hl], a
+ dec h
+ ldh a, [hCurrentSpriteOffset]
+ inc a
+ ld l, a
+ ld [hl], $2
+ inc l
+ inc l
+ xor a
+ ld b, [hl]
+ ld [hli], a
+ inc l
+ ld c, [hl]
ld [hl], a
- ldh [hSpriteAnimFrameCounter], a
ret
diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm
new file mode 100644
index 00000000..2ced9da6
--- /dev/null
+++ b/engine/overworld/npc_movement_2.asm
@@ -0,0 +1,24 @@
+FreezeEnemyTrainerSprite::
+ ld a, [wCurMap]
+ cp POKEMON_TOWER_7F
+ ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
+ ld hl, RivalIDs
+ ld a, [wEngagedTrainerClass]
+ ld b, a
+.loop
+ ld a, [hli]
+ cp -1
+ jr z, .notRival
+ cp b
+ ret z ; the rival leaves after battling, so don't freeze him
+ jr .loop
+.notRival
+ ld a, [wSpriteIndex]
+ ldh [hSpriteIndex], a
+ jp SetSpriteMovementBytesToFF
+
+RivalIDs:
+ db OPP_RIVAL1
+ db OPP_RIVAL2
+ db OPP_RIVAL3
+ db -1 ; end
diff --git a/engine/overworld/pathfinding.asm b/engine/overworld/pathfinding.asm
index 1925dbbc..a824d337 100644
--- a/engine/overworld/pathfinding.asm
+++ b/engine/overworld/pathfinding.asm
@@ -14,22 +14,22 @@ FindPathToPlayer:
call CalcDifference
ld d, a
and a
- jr nz, .asm_f8da
+ jr nz, .asm_f76a
ldh a, [hFindPathFlags]
set 0, a ; current end of path matches the player's Y coordinate
ldh [hFindPathFlags], a
-.asm_f8da
+.asm_f76a
ldh a, [hFindPathXProgress]
ld b, a
ldh a, [hNPCPlayerXDistance] ; X distance in steps
call CalcDifference
ld e, a
and a
- jr nz, .asm_f8ec
+ jr nz, .asm_f77c
ldh a, [hFindPathFlags]
set 1, a ; current end of path matches the player's X coordinate
ldh [hFindPathFlags], a
-.asm_f8ec
+.asm_f77c
ldh a, [hFindPathFlags]
cp $3 ; has the end of the path reached the player's position?
jr z, .done
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index c458a013..5056c0b2 100644
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -13,8 +13,8 @@ EnterMapAnim::
call PlaySound
ld hl, wd732
bit 4, [hl] ; used dungeon warp?
- res 4, [hl]
pop hl
+ ;res 4, [hl]
jr nz, .dungeonWarpAnimation
call PlayerSpinWhileMovingDown
ld a, SFX_TELEPORT_ENTER_2
@@ -34,21 +34,22 @@ EnterMapAnim::
ld [hl], $ff ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
call PlayerSpinInPlace
+ ld a, $1
+ ld [wPikachuSpawnState], a
.restoreDefaultMusic
call PlayDefaultMusic
.done
+ call Func_151d
jp RestoreFacingDirectionAndYScreenPos
.dungeonWarpAnimation
ld c, 50
call DelayFrames
call PlayerSpinWhileMovingDown
+ ld a, $0
+ ld [wPikachuSpawnState], a
jr .done
.flyAnimation
pop hl
- ld de, BirdSprite
- ld hl, vNPCSprites
- lb bc, BANK(BirdSprite), $0c
- call CopyVideoData
call LoadBirdSpriteGraphics
ld a, SFX_FLY
call PlaySound
@@ -61,6 +62,8 @@ EnterMapAnim::
ld de, FlyAnimationEnterScreenCoords
call DoFlyAnimation
call LoadPlayerSpriteGraphics
+ ld a, $1
+ ld [wPikachuSpawnState], a
jr .restoreDefaultMusic
FlyAnimationEnterScreenCoords:
@@ -90,7 +93,9 @@ PlayerSpinWhileMovingDown:
ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
jp PlayerSpinWhileMovingUpOrDown
+
_LeaveMapAnim::
+ call Func_1510
call InitFacingDirectionList
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@@ -249,12 +254,14 @@ DoFlyAnimation:
LoadBirdSpriteGraphics:
ld de, BirdSprite
+ ld b, BANK(BirdSprite)
+ ld c, $c
ld hl, vNPCSprites
- lb bc, BANK(BirdSprite), 12
call CopyVideoData
ld de, BirdSprite tile 12 ; moving animation sprite
+ ld b, BANK(BirdSprite)
+ ld c, 12
ld hl, vNPCSprites2
- lb bc, BANK(BirdSprite), 12
jp CopyVideoData
InitFacingDirectionList:
@@ -380,9 +387,10 @@ FishingAnim:
call DelayFrames
ld hl, wd736
set 6, [hl] ; reserve the last 4 OAM entries
+ ld hl, vNPCSprites
ld de, RedSprite
- ld hl, vNPCSprites tile $00
- lb bc, BANK(RedSprite), 12
+ ld b, BANK(RedSprite)
+ ld c, 12
call CopyVideoData
ld a, $4
ld hl, RedFishingTiles
diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm
index 70326754..c966c128 100644
--- a/engine/overworld/player_state.asm
+++ b/engine/overworld/player_state.asm
@@ -70,7 +70,8 @@ CheckForceBikeOrSurf::
ld a, $1
ld [wWalkBikeSurfState], a
ld [wWalkBikeSurfStateCopy], a
- jp ForceBikeOrSurf
+ call ForceBikeOrSurf
+ ret
.incorrectMap
inc hl
.incorrectY
@@ -80,7 +81,8 @@ CheckForceBikeOrSurf::
ld a, $2
ld [wWalkBikeSurfState], a
ld [wWalkBikeSurfStateCopy], a
- jp ForceBikeOrSurf
+ call ForceBikeOrSurf
+ ret
INCLUDE "data/maps/force_bike_surf.asm"
@@ -101,10 +103,10 @@ IsPlayerFacingEdgeOfMap::
ld b, a
ld a, [wXCoord]
ld c, a
- ld de, .asm_c41e
+ ld de, .returnaddress
push de
jp hl
-.asm_c41e
+.returnaddress
pop bc
pop de
pop hl
@@ -224,8 +226,7 @@ PrintSafariZoneSteps::
cp CERULEAN_CAVE_2F
ret nc
hlcoord 0, 0
- ld b, 3
- ld c, 7
+ lb bc, 3, 7
call TextBoxBorder
hlcoord 1, 1
ld de, wSafariSteps
@@ -239,11 +240,11 @@ PrintSafariZoneSteps::
call PlaceString
ld a, [wNumSafariBalls]
cp 10
- jr nc, .asm_c56d
+ jr nc, .numSafariBallsTwoDigits
hlcoord 5, 3
ld a, " "
ld [hl], a
-.asm_c56d
+.numSafariBallsTwoDigits
hlcoord 6, 3
ld de, wNumSafariBalls
lb bc, 1, 2
@@ -345,16 +346,8 @@ GetTileTwoStepsInFrontOfPlayer:
CheckForCollisionWhenPushingBoulder:
call GetTileTwoStepsInFrontOfPlayer
- ld hl, wTilesetCollisionPtr
- ld a, [hli]
- ld h, [hl]
- ld l, a
-.loop
- ld a, [hli]
- cp $ff
- jr z, .done ; if the tile two steps ahead is not passable
- cp c
- jr nz, .loop
+ call IsTilePassable
+ jr c, .done
ld hl, TilePairCollisionsLand
call CheckForTilePairCollisions2
ld a, $ff
diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm
index a8e532d3..09911ca3 100644
--- a/engine/overworld/push_boulder.asm
+++ b/engine/overworld/push_boulder.asm
@@ -2,6 +2,8 @@ TryPushingBoulder::
ld a, [wd728]
bit 0, a ; using Strength?
ret z
+Func_f0a7:
+; where LoadMissableObjects predef points to now
ld a, [wFlags_0xcd60]
bit 1, a ; has boulder dust animation from previous push played yet?
ret nz
diff --git a/engine/overworld/specific_script_flags.asm b/engine/overworld/specific_script_flags.asm
new file mode 100644
index 00000000..b59aa9d0
--- /dev/null
+++ b/engine/overworld/specific_script_flags.asm
@@ -0,0 +1,25 @@
+SetMapSpecificScriptFlagsOnMapReload::
+ ld a, [wCurMap]
+ cp VERMILION_GYM
+ jr z, .vermilion_gym
+ ld c, a
+ ld hl, Bit5Maps
+.search_loop
+ ld a, [hli]
+ cp c
+ jr z, .in_list
+ cp $ff
+ jr nz, .search_loop
+ ret
+
+.vermilion_gym
+ ld hl, wCurrentMapScriptFlags
+ set 6, [hl]
+ ret
+
+.in_list
+ ld hl, wCurrentMapScriptFlags
+ set 5, [hl]
+ ret
+
+INCLUDE "data/maps/bit_5_maps.asm"
diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm
index dc57d5b9..b29dc108 100644
--- a/engine/overworld/sprite_collisions.asm
+++ b/engine/overworld/sprite_collisions.asm
@@ -1,5 +1,5 @@
_UpdateSprites::
- ld h, $c1
+ ld h, HIGH(wSpriteStateData1)
inc h
ld a, SPRITESTATEDATA2_IMAGEBASEOFFSET
.spriteLoop
@@ -24,9 +24,12 @@ _UpdateSprites::
jr nz, .spriteLoop
ret
.updateCurrentSprite
- cp $1
- jp nz, UpdateNonPlayerSprite
- jp UpdatePlayerSprite
+ ldh a, [hCurrentSpriteOffset]
+ and a
+ jp z, UpdatePlayerSprite
+ cp $f0 ; pikachu
+ jp z, SpawnPikachu
+ ld a, [hl]
UpdateNonPlayerSprite:
dec a
@@ -52,11 +55,10 @@ UpdateNonPlayerSprite:
; The reason that 4 is added below to the coordinate is to make it align with a
; multiple of $10 to make comparisons easier.
DetectCollisionBetweenSprites:
- nop
+ ; nop
ld h, HIGH(wSpriteStateData1)
ldh a, [hCurrentSpriteOffset]
- add LOW(wSpriteStateData1)
ld l, a
ld a, [hl] ; a = [i#SPRITESTATEDATA1_PICTUREID] (0 if slot is unused)
@@ -271,6 +273,17 @@ DetectCollisionBetweenSprites:
jr nc, .next ; go to next sprite if distance is still positive after both adjustments
.collision
+ ld a, l
+ and $f0 ; collision with pikachu?
+ jr nz, .asm_4cd9
+ xor a
+ ld [wd434], a
+ ldh a, [hFF8F]
+ cp $f
+ jr nz, .asm_4cd9
+ call Func_4d0a
+ jr .asm_4cef
+.asm_4cd9
ldh a, [hFF91] ; a = 7 or 9 depending on sprite i's delta X
ld b, a
ldh a, [hFF90] ; a = 7 or 9 depending on sprite i's delta Y
@@ -296,6 +309,7 @@ DetectCollisionBetweenSprites:
; to indicate which sprite the collision occurred with
inc l
inc l
+.asm_4cef
ldh a, [hFF8F] ; a = loop counter
ld de, SpriteCollisionBitTable
add a
@@ -324,6 +338,26 @@ DetectCollisionBetweenSprites:
; c = 0 if delta X/Y is 0
; c = 7 if delta X/Y is 1
; c = 9 if delta X/Y is -1
+Func_4d0a:
+ ldh a, [hFF91]
+ ld b, a
+ ldh a, [hFF90]
+ inc l
+ cp b
+ jr c, .asm_4d17
+ ld b, %1100
+ jr .asm_4d19
+.asm_4d17
+ ld b, %11
+.asm_4d19
+ ld a, c
+ and b
+ ld [wd434], a
+ ld a, c
+ inc l
+ inc l
+ ret
+
SetSpriteCollisionValues:
and a
ld b, 0
diff --git a/engine/overworld/tilesets.asm b/engine/overworld/tilesets.asm
index fa5cf626..21101e7b 100644
--- a/engine/overworld/tilesets.asm
+++ b/engine/overworld/tilesets.asm
@@ -5,23 +5,14 @@ LoadTilesetHeader:
ld a, [wCurMapTileset]
add a
add a
- ld b, a
- add a
- add b ; a = tileset * 12
- jr nc, .noCarry
- inc d
-.noCarry
ld e, a
ld hl, Tilesets
add hl, de
+ add hl, de
+ add hl, de
ld de, wTilesetBank
- ld c, $b
-.copyTilesetHeaderLoop
- ld a, [hli]
- ld [de], a
- inc de
- dec c
- jr nz, .copyTilesetHeaderLoop
+ ld bc, $b
+ call CopyData
ld a, [hl]
ldh [hTileAnimations], a
xor a
@@ -35,13 +26,13 @@ LoadTilesetHeader:
call IsInArray
pop de
pop hl
- jr c, .asm_c797
+ jr c, .notDungeonTileset
ld a, [wCurMapTileset]
ld b, a
ldh a, [hPreviousTileset]
cp b
jr z, .done
-.asm_c797
+.notDungeonTileset
ld a, [wDestinationWarpID]
cp $ff
jr z, .done
diff --git a/engine/overworld/turn_sprite.asm b/engine/overworld/turn_sprite.asm
deleted file mode 100644
index 7b34a03a..00000000
--- a/engine/overworld/turn_sprite.asm
+++ /dev/null
@@ -1,25 +0,0 @@
-UpdateSpriteFacingOffsetAndDelayMovement::
- ld h, HIGH(wSpriteStateData2)
- ldh a, [hCurrentSpriteOffset]
- add $8
- ld l, a
- ld a, $7f ; maximum movement delay
- ld [hl], a ; x#SPRITESTATEDATA2_MOVEMENTDELAY
- dec h ; HIGH(wSpriteStateData1)
- ldh a, [hCurrentSpriteOffset]
- add $9
- ld l, a
- ld a, [hld] ; x#SPRITESTATEDATA1_FACINGDIRECTION
- ld b, a
- xor a
- ld [hld], a
- ld [hl], a ; x#SPRITESTATEDATA1_ANIMFRAMECOUNTER
- ldh a, [hCurrentSpriteOffset]
- add SPRITESTATEDATA1_IMAGEINDEX
- ld l, a
- ld a, [hl] ; x#SPRITESTATEDATA1_IMAGEINDEX
- or b ; or in the facing direction
- ld [hld], a
- ld a, $2 ; delayed movement status
- ld [hl], a ; x#SPRITESTATEDATA1_MOVEMENTSTATUS
- ret
diff --git a/engine/overworld/unused_load_missable_object_data.asm b/engine/overworld/unused_load_missable_object_data.asm
new file mode 100644
index 00000000..5888b091
--- /dev/null
+++ b/engine/overworld/unused_load_missable_object_data.asm
@@ -0,0 +1,46 @@
+Func_f0a54: ; unreferenced
+ ret
+
+LoadMissableObjectData::
+; farcalled by an unreferenced function
+ ld hl, .MissableObjectsMaps
+.loop
+ ld a, [hli]
+ cp -1
+ ret z
+ ld b, a
+ ld a, [wCurMap]
+ cp b
+ jr z, .found
+ inc hl
+ inc hl
+ inc hl
+ jr .loop
+
+.found
+ ld a, [hli]
+ ld c, a
+ ld b, 0
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, wMissableObjectList
+ call CopyData
+ ret
+
+missable_object_map: MACRO
+ db \1
+ db \3 - \2
+ dw \2
+ENDM
+
+.MissableObjectsMaps:
+ missable_object_map BLUES_HOUSE, .BluesHouse, .BluesHouseEnd
+ db -1 ; end
+
+.BluesHouse:
+ db 1, HS_DAISY_SITTING_COPY
+ db 2, HS_DAISY_WALKING_COPY
+ db 3, HS_TOWN_MAP_COPY
+ db -1 ; end
+.BluesHouseEnd:
diff --git a/engine/pikachu/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm
new file mode 100644
index 00000000..6647c4cc
--- /dev/null
+++ b/engine/pikachu/pikachu_emotions.asm
@@ -0,0 +1,477 @@
+IsPlayerTalkingToPikachu::
+ ld a, [wd436]
+ and a
+ ret z
+ ldh a, [hSpriteIndexOrTextID]
+ cp $f
+ ret nz
+ call InitializePikachuTextID
+ xor a
+ ldh [hSpriteIndexOrTextID], a
+ ld [wd436], a
+ ret
+
+InitializePikachuTextID::
+ ld a, TEXT_PIKACHU_ANIM ; display
+ ldh [hSpriteIndexOrTextID], a
+ xor a
+ ld [wPlayerMovingDirection], a
+ ld a, $1
+ ld [wAutoTextBoxDrawingControl], a
+ call DisplayTextID
+ xor a
+ ld [wAutoTextBoxDrawingControl], a
+ ret
+
+DoStarterPikachuEmotions:
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+.loop
+ ld a, [de]
+ inc de
+ cp $ff
+ jr z, .done
+ ld c, a
+ ld b, 0
+ ld hl, StarterPikachuEmotionsJumptable
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call JumpToAddress
+ jr .loop
+
+.done
+ ret
+
+StarterPikachuEmotionsJumptable:
+ dw StarterPikachuEmotionCommand_nop ; 0
+ dw StarterPikachuEmotionCommand_text ; 1
+ dw StarterPikachuEmotionCommand_pcm ; 2
+ dw StarterPikachuEmotionCommand_emote ; 3
+ dw StarterPikachuEmotionCommand_movement ; 4
+ dw StarterPikachuEmotionCommand_pikapic ; 5
+ dw StarterPikachuEmotionCommand_subcmd ; 6
+ dw StarterPikachuEmotionCommand_delay ; 7
+ dw StarterPikachuEmotionCommand_nop2 ; 8
+ dw StarterPikachuEmotionCommand_9 ; 9
+ dw StarterPikachuEmotionCommand_nop3 ; a
+
+StarterPikachuEmotionCommand_nop:
+StarterPikachuEmotionCommand_nop3:
+ ret
+
+StarterPikachuEmotionCommand_text:
+ ld a, [de]
+ ld l, a
+ inc de
+ ld a, [de]
+ ld h, a
+ inc de
+ push de
+ call PrintText
+ pop de
+ ret
+
+StarterPikachuEmotionCommand_pcm:
+ ld a, [de]
+ inc de
+ push de
+ ld e, a
+ nop
+ call PlayPikachuSoundClip_
+ pop de
+ ret
+
+PlayPikachuSoundClip_:
+ cp $ff
+ ret z
+ callfar PlayPikachuSoundClip
+ ret
+
+StarterPikachuEmotionCommand_emote:
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ ld a, [de]
+ inc de
+ push de
+ call ShowPikachuEmoteBubble
+ pop de
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ ret
+
+ShowPikachuEmoteBubble:
+ ld [wWhichEmotionBubble], a
+ ld a, $f ; Pikachu
+ ld [wEmotionBubbleSpriteIndex], a
+ predef EmotionBubble
+ ret
+
+StarterPikachuEmotionCommand_movement:
+ ld a, [de]
+ inc de
+ ld l, a
+ ld a, [de]
+ inc de
+ ld h, a
+ push de
+ ld b, BANK(DoStarterPikachuEmotions)
+ call ApplyPikachuMovementData_
+ pop de
+ ret
+
+StarterPikachuEmotionCommand_delay:
+ ld a, [de]
+ inc de
+ push de
+ ld c, a
+ call DelayFrames
+ pop de
+ ret
+
+StarterPikachuEmotionCommand_subcmd:
+ ld a, [de]
+ inc de
+ push de
+ ld e, a
+ ld d, 0
+ ld hl, .Subcommands
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call JumpToAddress
+ pop de
+ ret
+
+.Subcommands:
+ dw LoadPikachuSpriteIntoVRAM
+ dw LoadFontTilePatterns
+ dw Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3
+ dw WaitForTextScrollButtonPress
+ dw PikachuPewterPokecenterCheck
+ dw PikachuFanClubCheck
+ dw PikachuBillsHouseCheck
+
+StarterPikachuEmotionCommand_nop2:
+IF DEF(_DEBUG)
+ push hl
+ ld hl, wd732
+ bit 1, [hl]
+ pop hl
+ ret z
+ push de
+ ld d, a
+ ld a, [wCurMap]
+ cp REDS_HOUSE_2F
+ ld a, d
+ pop de
+ ret nz
+ push de
+ call Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3
+ call LoadFontTilePatterns
+ ld hl, ExpressionText
+ call PrintText
+ call Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3
+ pop de
+ ret
+
+ExpressionText:
+ text_far _ExpressionText
+ text_end
+ELSE
+ ret
+ENDC
+
+StarterPikachuEmotionCommand_9:
+ push de
+ call StarterPikachuEmotionCommand_turnawayfromplayer
+ call UpdateSprites
+ pop de
+ ret
+
+StarterPikachuEmotionCommand_turnawayfromplayer:
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ xor $4
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+DeletedFunction_fcffb:
+; Inexplicably empty.
+REPT 5
+ nop
+ENDR
+IF DEF(_DEBUG)
+ push hl
+ ld hl, wd732
+ bit 1, [hl]
+ pop hl
+ ret z
+ push de
+ ld d, a
+ ld a, [wCurMap]
+ cp REDS_HOUSE_2F
+ ld a, d
+ pop de
+ ret nz
+ ld a, [wExpressionNumber]
+ inc a
+ cp (PikachuEmotion33_id - PikachuEmotionTable) / 2
+ jr c, .valid
+ ldpikaemotion a, PikachuEmotion1
+.valid
+ ld [wExpressionNumber], a
+ ret
+
+HallOfFamePCForever:
+ callfar HallOfFamePC
+ call WaitForTextScrollButtonPress
+ jr HallOfFamePCForever
+ELSE
+ ret
+ENDC
+
+PlaySpecificPikachuEmotion:
+ ld a, e
+ jr load_expression
+
+TalkToPikachu::
+ call MapSpecificPikachuExpression
+ jr c, load_expression
+ call GetPikaPicAnimationScriptIndex
+ call DeletedFunction_fcffb
+load_expression:
+ ld [wExpressionNumber], a
+ ld hl, PikachuEmotionTable
+ call DoStarterPikachuEmotions
+ ret
+
+pikaemotion_def: MACRO
+\1_id:
+ dw \1
+ENDM
+
+PikachuEmotionTable:
+ pikaemotion_def PikachuEmotion0
+ pikaemotion_def PikachuEmotion1
+ pikaemotion_def PikachuEmotion2
+ pikaemotion_def PikachuEmotion3
+ pikaemotion_def PikachuEmotion4
+ pikaemotion_def PikachuEmotion5
+ pikaemotion_def PikachuEmotion6
+ pikaemotion_def PikachuEmotion7
+ pikaemotion_def PikachuEmotion8
+ pikaemotion_def PikachuEmotion9
+ pikaemotion_def PikachuEmotion10
+ pikaemotion_def PikachuEmotion11
+ pikaemotion_def PikachuEmotion12
+ pikaemotion_def PikachuEmotion13
+ pikaemotion_def PikachuEmotion14
+ pikaemotion_def PikachuEmotion15
+ pikaemotion_def PikachuEmotion16
+ pikaemotion_def PikachuEmotion17
+ pikaemotion_def PikachuEmotion18
+ pikaemotion_def PikachuEmotion19
+ pikaemotion_def PikachuEmotion20
+ pikaemotion_def PikachuEmotion21 ; used a fishing rod
+ pikaemotion_def PikachuEmotion22
+ pikaemotion_def PikachuEmotion23
+ pikaemotion_def PikachuEmotion24
+ pikaemotion_def PikachuEmotion25
+ pikaemotion_def PikachuEmotion26 ; wake up pikachu in pewter pokemon center
+ pikaemotion_def PikachuEmotion27
+ pikaemotion_def PikachuEmotion28
+ pikaemotion_def PikachuEmotion29
+ pikaemotion_def PikachuEmotion30
+ pikaemotion_def PikachuEmotion31
+ pikaemotion_def PikachuEmotion32
+ pikaemotion_def PikachuEmotion33
+
+PikachuEmotion33:
+ db $ff
+
+MapSpecificPikachuExpression:
+ ld a, [wCurMap]
+ cp POKEMON_FAN_CLUB
+ jr nz, .notFanClub
+ ld hl, wd492
+ bit 7, [hl]
+ ldpikaemotion a, PikachuEmotion29
+ jr z, .play_emotion
+ call CheckPikachuFollowingPlayer
+ ldpikaemotion a, PikachuEmotion30
+ jr nz, .play_emotion
+ jr .check_pikachu_status
+
+.notFanClub
+ ld a, [wCurMap]
+ cp PEWTER_POKECENTER
+ jr nz, .notPewterPokecenter
+ call CheckPikachuFollowingPlayer
+ ldpikaemotion a, PikachuEmotion26
+ jr nz, .play_emotion
+ jr .check_pikachu_status
+
+.notPewterPokecenter
+ callfar Func_f24ae
+ ld a, e
+ cp $ff
+ jr nz, .play_emotion
+ jr .check_pikachu_status ; useless
+
+.check_pikachu_status
+ call IsPlayerPikachuAsleepInParty
+ ldpikaemotion a, PikachuEmotion11
+ jr c, .play_emotion
+ callfar CheckPikachuFaintedOrStatused ; same bank
+ ldpikaemotion a, PikachuEmotion28
+ jr c, .play_emotion
+ ld a, [wCurMap]
+ cp POKEMON_TOWER_1F
+ jr c, .notInLavenderTower
+ cp POKEMON_TOWER_7F + 1
+ ldpikaemotion a, PikachuEmotion22
+ jr c, .play_emotion
+.notInLavenderTower
+ ld a, [wd49c]
+ and a
+ jr z, .mood_based_emotion
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, .Emotions
+ add hl, bc
+ ld a, [hl]
+ jr .play_emotion
+
+.mood_based_emotion
+ and a
+ ret
+
+.play_emotion
+ scf
+ ret
+
+.Emotions:
+ dpikaemotion PikachuEmotion18
+ dpikaemotion PikachuEmotion21
+ dpikaemotion PikachuEmotion23
+ dpikaemotion PikachuEmotion24
+ dpikaemotion PikachuEmotion25
+
+IsPlayerPikachuAsleepInParty:
+ xor a
+ ld [wWhichPokemon], a
+.loop
+ ld a, [wWhichPokemon]
+ ld c, a
+ ld b, 0
+ ld hl, wPartySpecies
+ add hl, bc
+ ld a, [hl]
+ cp $ff
+ jr z, .done
+ cp STARTER_PIKACHU
+ jr nz, .curMonNotStarterPikachu
+ callfar IsThisPartymonStarterPikachu
+ jr nc, .curMonNotStarterPikachu
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMon1Status
+ ld bc, wPartyMon2 - wPartyMon1
+ call AddNTimes
+ ld a, [hl]
+ and SLP
+ jr z, .done
+ jr .curMonSleepingPikachu
+
+.curMonNotStarterPikachu
+ ld a, [wWhichPokemon]
+ cp PARTY_LENGTH - 1
+ jr z, .done
+ inc a
+ ld [wWhichPokemon], a
+ jr .loop
+
+.curMonSleepingPikachu
+ scf
+ ret
+
+.done
+ and a
+ ret
+
+INCLUDE "data/pikachu/pikachu_emotions.asm"
+
+PikachuWalksToNurseJoy:
+ ld a, $40
+ ldh [hPikachuSpriteVRAMOffset], a
+ call LoadPikachuSpriteIntoVRAM
+ call .GetMovementData
+ and a
+ jr z, .skip
+ call ApplyPikachuMovementData
+.skip
+ xor a
+ ldh [hPikachuSpriteVRAMOffset], a
+ ret
+
+.GetMovementData:
+ ld a, [wSpritePikachuStateData2MapY]
+ ld e, a
+ ld a, [wSpritePikachuStateData2MapX]
+ ld d, a
+ ld a, [wYCoord]
+ add 4
+ cp e
+ jr z, .pikachu_at_same_y_as_player
+ jr nc, .pikachu_above_player
+ ld hl, .PikaMovementData1
+ ld a, 1
+ ret
+
+.pikachu_above_player
+ xor a
+ ret
+
+.pikachu_at_same_y_as_player
+ ld a, [wXCoord]
+ add 4
+ cp d
+ jr c, .pikachu_to_right_of_player
+ ld hl, .PikaMovementData2
+ ld a, 2
+ ret
+
+.pikachu_to_right_of_player
+ ld hl, .PikaMovementData3
+ ld a, 3
+ ret
+
+.PikaMovementData1:
+ db $00 ; init
+ db $36 ; look up
+ db $2b ; walk up left
+ db $34 ; hop up right
+ db $3f ; ret
+
+.PikaMovementData2:
+ db $00 ; init
+ db $36 ; look up
+ db $34 ; hop up right
+ db $3f ; ret
+
+.PikaMovementData3:
+ db $00 ; init
+ db $36 ; look up
+ db $33 ; hop up left
+ db $3f ; ret
diff --git a/engine/pikachu/pikachu_follow.asm b/engine/pikachu/pikachu_follow.asm
new file mode 100644
index 00000000..9575c341
--- /dev/null
+++ b/engine/pikachu/pikachu_follow.asm
@@ -0,0 +1,1578 @@
+ShouldPikachuSpawn::
+; possibly to test if pika should be out?
+ ld a, [wPikachuOverworldStateFlags]
+ bit 5, a
+ jr nz, .hide
+ ld a, [wPikachuOverworldStateFlags]
+ bit 7, a
+ jr nz, .hide
+ call IsStarterPikachuInOurParty
+ jr nc, .hide
+ ld a, [wWalkBikeSurfState]
+ and a
+ jr nz, .hide
+ scf
+ ret
+
+.hide
+ and a
+ ret
+
+SchedulePikachuSpawnForAfterText::
+ ld hl, wPikachuOverworldStateFlags
+ bit 4, [hl]
+ res 4, [hl]
+ jr nz, .normal_spawn_state
+ call EnablePikachuFollowingPlayer
+ call ClearPikachuSpriteStateData
+ ld a, $ff
+ ld [wSpritePikachuStateData1ImageIndex], a
+ call ClearPikachuFollowCommandBuffer
+ call CalculatePikachuFacingDirection
+ ret
+
+.normal_spawn_state
+ call CalculatePikachuPlacementCoords
+ xor a
+ ld [wPikachuSpawnState], a
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+ClearPikachuSpriteStateData::
+ ld hl, wSpritePikachuStateData1PictureID
+ call .clear
+ ld hl, wSpritePikachuStateData2
+.clear
+ ld bc, $10
+ xor a
+ call FillMemory
+ ret
+
+CalculatePikachuSpawnCoordsAndFacing::
+ call CalculatePikachuPlacementCoords
+ call CalculatePikachuFacingDirection
+ xor a
+ ld [wPikachuSpawnState], a
+ ret
+
+CalculatePikachuPlacementCoords::
+ ld bc, wSpritePikachuStateData1PictureID
+ ld a, [wYCoord]
+ add $4
+ ld e, a
+ ld a, [wXCoord]
+ add $4
+ ld d, a
+ ld a, [wPikachuSpawnState]
+ and a
+ jr z, .load_coords
+ cp $1
+ jr z, .right_of_player
+ cp $2
+ jr z, .check_player_facing2
+ cp $3
+ jr z, .load_coords
+ cp $4
+ jr z, .below_player
+ cp $5
+ jr z, .above_player
+ cp $6
+ jr z, .left_of_player
+ cp $7
+ jr z, .check_player_facing
+ jr .right_of_player
+
+.check_player_facing
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a ; SPRITE_FACING_DOWN
+ jr z, .below_player
+ cp SPRITE_FACING_UP
+ jr z, .above_player
+ cp SPRITE_FACING_LEFT
+ jr z, .left_of_player
+ cp SPRITE_FACING_RIGHT
+ jr z, .right_of_player
+.check_player_facing2
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a
+ jr nz, .check_up
+ dec e
+ jr .load_coords
+
+.check_up
+ cp SPRITE_FACING_UP
+ jr nz, .check_left
+ inc e
+ jr .load_coords
+
+.check_left
+ cp SPRITE_FACING_LEFT
+ jr nz, .left_of_player_2
+ inc d
+ jr .load_coords
+
+.left_of_player_2
+ dec d
+ jr .load_coords
+
+.right_of_player
+ inc d
+ jr .load_coords
+
+.left_of_player
+ dec d
+ jr .load_coords
+
+.below_player
+ inc e
+ jr .load_coords
+
+.above_player
+ dec e
+ jr .load_coords ; useless jr
+.load_coords
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
+ add hl, bc
+ ld [hl], e
+ inc hl
+ ld [hl], d
+ inc hl
+ ld [hl], $fe
+ push hl
+ ld hl, wd472
+ set 5, [hl]
+ pop hl
+ ret
+
+CalculatePikachuFacingDirection::
+ ld a, $49
+ ld [wSpritePikachuStateData1PictureID], a
+ ld a, $ff
+ ld [wSpritePikachuStateData1ImageIndex], a
+ ld a, [wPikachuSpawnState]
+ and a
+ jr z, .copy_player_facing
+ cp $1
+ jr z, .copy_player_facing
+ cp $3
+ jr z, .force_facing_down
+ cp $4
+ jr z, .copy_player_facing
+ cp $6
+ jr z, .copy_player_facing
+ cp $7
+ jr z, .face_the_other_way
+ call ComputePikachuFacingDirection
+ ret
+
+.copy_player_facing
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+.force_facing_down
+ ld a, SPRITE_FACING_DOWN
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+.face_the_other_way
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ xor $4
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+SetPikachuSpawnOutside::
+ ld a, [wCurMap]
+ cp OAKS_LAB
+ jr z, .oaks_lab
+ cp ROUTE_22_GATE
+ jr z, .route_22_gate
+ cp MT_MOON_B1F
+ jr z, .mt_moon_2
+ cp ROCK_TUNNEL_1F
+ jr z, .rock_tunnel_1
+ ld a, [wCurMap]
+ ld hl, Pointer_fc64b
+ call Pikachu_IsInArray ; similar to IsInArray, but not the same
+ jr c, .map_list_1
+ ld a, [wCurMap]
+ ld hl, Pointer_fc653
+ call Pikachu_IsInArray
+ jr nc, .not_map_list_2
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a
+ jr nz, .not_map_list_2
+ ld a, $3
+ jr .load
+
+.route_22_gate
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a
+ jr z, .rock_tunnel_1
+ jr .not_map_list_2
+
+.mt_moon_2
+ ld a, $3
+ jr .load
+
+.map_list_1
+ ld a, $4
+ jr .load
+
+.oaks_lab
+ ld a, $6
+ jr .load
+
+.not_map_list_2
+ ld a, $1
+ jr .load
+
+.rock_tunnel_1
+ ld a, $3
+.load
+ ld [wPikachuSpawnState], a
+ ret
+
+Pointer_fc64b::
+ db VICTORY_ROAD_2F
+ db ROUTE_7_GATE
+ db ROUTE_8_GATE
+ db ROUTE_16_GATE_1F
+ db ROUTE_18_GATE_1F
+ db ROUTE_15_GATE_1F
+ db ROUTE_11_GATE_1F
+ db $ff
+
+Pointer_fc653::
+ db VIRIDIAN_FOREST_NORTH_GATE
+ db CERULEAN_BADGE_HOUSE
+ db CERULEAN_TRASHED_HOUSE
+ db VERMILION_DOCK
+ db CELADON_MANSION_1F
+ db ROUTE_2_GATE
+ db FUCHSIA_GOOD_ROD_HOUSE
+ db $ff
+
+SetPikachuSpawnWarpPad::
+ ld a, [wCurMap]
+ cp VIRIDIAN_FOREST_NORTH_GATE
+ jr z, .viridian_forest_exit
+ cp VIRIDIAN_FOREST_SOUTH_GATE
+ jr z, .viridian_forest_entrance
+ ld a, [wCurMap]
+ ld hl, Pointer_fc68e
+ call Pikachu_IsInArray
+ jr c, .in_array
+ jr .not_in_array
+
+.viridian_forest_exit
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
+ jr z, .in_array
+ jr .not_in_array
+
+.viridian_forest_entrance
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a ; SPRITE_FACING_DOWN
+ jr z, .not_in_array
+ jr .in_array
+
+.not_in_array
+ ld a, $0
+ jr .load_spawn_state
+
+.in_array
+ ld a, $1
+.load_spawn_state
+ ld [wPikachuSpawnState], a
+ ret
+
+Pointer_fc68e::
+ db VIRIDIAN_FOREST
+ db SAFARI_ZONE_CENTER_REST_HOUSE
+ db SAFARI_ZONE_WEST_REST_HOUSE
+ db SAFARI_ZONE_EAST_REST_HOUSE
+ db SAFARI_ZONE_NORTH_REST_HOUSE
+ db SAFARI_ZONE_SECRET_HOUSE
+ db SILPH_CO_ELEVATOR
+ db CELADON_MART_ELEVATOR
+ db CINNABAR_LAB_TRADE_ROOM
+ db CINNABAR_LAB_METRONOME_ROOM
+ db CINNABAR_LAB_FOSSIL_ROOM
+ db $ff
+
+SetPikachuSpawnBackOutside::
+ ld a, [wCurMap]
+ cp ROUTE_22_GATE
+ jr z, .asm_fc6a7
+ cp ROUTE_2_GATE
+ jr z, .asm_fc6b0
+ jr .asm_fc6bd
+
+.asm_fc6a7
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
+ jr z, .asm_fc6b9
+ jr .asm_fc6bd
+
+.asm_fc6b0
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
+ jr z, .asm_fc6b9
+ jr .asm_fc6bd
+
+.asm_fc6b9
+ ld a, $1
+ jr .asm_fc6c1
+
+.asm_fc6bd
+ ld a, $3
+ jr .asm_fc6c1
+
+.asm_fc6c1
+ ld [wPikachuSpawnState], a
+ ret
+
+SetPikachuOverworldStateFlag2::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ set 2, [hl]
+ pop hl
+ ret
+
+ResetPikachuOverworldStateFlag2::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ res 2, [hl]
+ pop hl
+ ret
+
+SpawnPikachu_::
+ call ResetPikachuOverworldStateFlag2
+ call TrySpawnPikachu
+ ret nc
+
+ push bc
+ call WillPikachuSpawnOnTheScreen
+ pop bc
+ ret c
+
+ ld bc, wSpritePikachuStateData1
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ bit 7, [hl]
+ jp nz, Func_fc745
+ ld a, [wFontLoaded]
+ bit 0, a
+ jp nz, Func_fc76a
+ call CheckPikachuFollowingPlayer
+ jp nz, Func_fc76a
+ ld a, [hl]
+ and $7f
+ cp $a
+ jr c, .valid
+ xor a
+.valid
+ add a
+ ld e, a
+ ld d, 0
+ ld hl, PointerTable_fc710
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+PointerTable_fc710:
+ dw Func_fc793
+ dw Func_fc7aa
+ dw Func_fc803
+ dw asm_fc9c3
+ dw asm_fca1c
+ dw asm_fc9ee
+ dw asm_fc87f
+ dw asm_fc904
+ dw asm_fc937
+ dw asm_fc969
+ dw .nop
+
+.nop:
+ ret
+
+TrySpawnPikachu:
+ call ShouldPikachuSpawn
+ jr nc, .dont_spawn
+ ld a, [wSpritePikachuStateData1MovementStatus]
+ and a
+ jr nz, .already_spawned
+ push bc
+ push hl
+ call CalculatePikachuSpawnCoordsAndFacing
+ pop hl
+ pop bc
+.already_spawned
+ scf
+ ret
+
+.dont_spawn
+ ld hl, wSpritePikachuStateData1ImageIndex
+ ld [hl], $ff
+ dec hl
+ ld [hl], $0
+ xor a
+ ret
+
+Func_fc745:
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ res 7, [hl]
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+ call CheckPikachuFollowingPlayer
+ jr nz, .okay
+ ; Have Pikachu face in the opposite direction of you
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ xor $4
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+.okay
+ xor a
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ call UpdatePikachuWalkingSprite
+ ret
+
+Func_fc76a:
+ xor a
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ call UpdatePikachuWalkingSprite
+ call Func_fc82e
+ jr c, .skip
+ push bc
+ callfar InitializeSpriteScreenPosition
+ pop bc
+.skip
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $1
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $0
+ call RefreshPikachuFollow
+ ret
+
+Func_fc793:
+ call RefreshPikachuFollow
+ push bc
+ callfar InitializeSpriteScreenPosition
+ pop bc
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $ff
+ dec hl
+ ld [hl], $1
+ ret
+
+Func_fc7aa:
+ call Func_fcc92
+ jp c, Func_fc803
+ dec a
+ ld l, a
+ ld h, $0
+ add hl, hl
+ add hl, hl
+ ld de, Pointer_fc7e3
+ add hl, de
+ ld d, h
+ ld e, l
+ ld a, [de]
+ inc de
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+ ld a, [de]
+ inc de
+ ld hl, wSpritePikachuStateData1XStepVector - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+ dec hl
+ dec hl
+ ld a, [de]
+ ld [hl], a
+ inc de
+ ld a, [de]
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+ cp $4
+ jp z, Func_fca0a
+ call AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer
+ jp c, FastPikachuFollow
+ jp NormalPikachuFollow
+
+Pointer_fc7e3:
+ db 0, 0
+ db 1, 3
+ db 4, 0
+ db -1, 3
+ db 8, -1
+ db 0, 3
+ db 12, 1
+ db 0, 3
+ db 0, 0
+ db 1, 4
+ db 4, 0
+ db -1, 4
+ db 8, -1
+ db 0, 4
+ db 12, 1
+ db 0, 4
+
+Func_fc803:
+ call Func_fcae2
+ ret c
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ jr nz, .asm_fc823
+ push hl
+ call GetPikachuFollowCommand
+ pop hl
+ cp $5
+ jr nc, Func_fc842
+ ld [hl], $20
+ call Random
+ and $c
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+.asm_fc823
+ xor a
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ call UpdatePikachuWalkingSprite
+ ret
+
+Func_fc82e:
+ ld a, [wWalkCounter]
+ and a
+ ret z
+ scf
+ ret
+
+Func_fc835:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $10
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $1
+ ret
+
+Func_fc842:
+ ld hl, $0
+ push af
+ call Random
+ ldh a, [hRandomAdd]
+ and %11
+ ld e, a
+ ld d, $0
+ ld hl, PointerTable_fc85a
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop af
+ jp hl
+
+PointerTable_fc85a:
+ dw Func_fc862
+ dw Func_fc8f8
+ dw Func_fc92b
+ dw Func_fc95d
+
+Func_fc862:
+ dec a
+ add a
+ add a
+ and $c
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], a
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $6
+ xor a
+ ld [wd432], a
+ ld [wd433], a
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $11
+asm_fc87f:
+ ld a, [wd432]
+ ld e, a
+ ld a, [wd433]
+ ld d, a
+ call Func_fc82e
+ jr c, Func_fc8c7
+ call SetPikachuOverworldStateFlag2
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ sub e
+ ld e, a
+ inc hl
+ inc hl
+ ld a, [hl]
+ sub d
+ ld d, a
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ dec a
+ add a
+ add LOW(Pointer_fc8d6)
+ ld l, a
+ ld a, HIGH(Pointer_fc8d6)
+ adc 0
+ ld h, a
+ ld a, [hli]
+ ld [wd432], a
+ add e
+ ld e, a
+ ld a, [hl]
+ ld [wd433], a
+ add d
+ ld d, a
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], e
+ inc hl
+ inc hl
+ ld [hl], d
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ jp Func_fc835
+
+Func_fc8c7:
+ ld hl, wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ sub e
+ ld [hl], a
+ inc hl
+ inc hl
+ ld a, [hl]
+ sub d
+ ld [hl], a
+ jp Func_fc835
+
+Pointer_fc8d6:
+ db 0, 0
+ db -2, 1
+ db -4, 2
+ db -2, 3
+ db 0, 4
+ db -2, 3
+ db -4, 2
+ db -2, 1
+ db 0, 0
+ db -2, -1
+ db -4, -2
+ db -2, -3
+ db 0, -4
+ db -2, -3
+ db -4, -2
+ db -2, -1
+ db 0, 0
+
+Func_fc8f8:
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $7
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $30
+asm_fc904:
+ call Func_fc82e
+ jp c, Func_fc835
+ call SetPikachuOverworldStateFlag2
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ inc a
+ cp $8
+ ld [hl], a
+ jr nz, .asm_fc91f
+ xor a
+ ld [hli], a
+ ld a, [hl]
+ inc a
+ and %11
+ ld [hl], a
+.asm_fc91f
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ jp Func_fc835
+
+Func_fc92b:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $20
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $8
+asm_fc937:
+ call Func_fc82e
+ jp c, Func_fc835
+ call SetPikachuOverworldStateFlag2
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ inc a
+ cp $8
+ ld [hl], a
+ jr nz, .asm_fc951
+ xor a
+ ld [hli], a
+ ld a, [hl]
+ xor $1
+ ld [hl], a
+.asm_fc951
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ jp Func_fc835
+
+Func_fc95d:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $20
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $9
+asm_fc969:
+ call Func_fc82e
+ jp c, Func_fc835
+ call SetPikachuOverworldStateFlag2
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ inc a
+ cp $8
+ ld [hl], a
+ jr nz, .skip
+ xor a
+ ld [hl], a
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ call .TurnClockwise
+ ld [hl], a
+.skip
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ jp Func_fc835
+
+.TurnClockwise:
+ push hl
+ ld hl, .Facings
+ ld d, a
+.loop
+ ld a, [hli]
+ cp d
+ jr nz, .loop
+ ld a, [hl]
+ pop hl
+ ret
+
+.TurnCounterclockwise:
+ push hl
+ ld hl, .Facings_End
+ ld d, a
+.loop_
+ ld a, [hld]
+ cp d
+ jr nz, .loop_
+ ld a, [hl]
+ pop hl
+ ret
+
+.Facings:
+ db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT
+ db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT
+.Facings_End:
+
+NormalPikachuFollow:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $8
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $3
+ call AddPikachuStepVector
+asm_fc9c3:
+ call TryDoubleAddPikachuStepVectorToScreenPixelCoords
+ call GetPikachuWalkingAnimationSpeed
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ call ResetPikachuStepVector
+ call ComputePikachuFacingDirection
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $1
+ ret
+
+FastPikachuFollow:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $4
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $5
+ call AddPikachuStepVector
+asm_fc9ee:
+ call DoubleAddPikachuStepVectorToScreenPixelCoords
+ call GetPikachuWalkingAnimationSpeed
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ call ResetPikachuStepVector
+ call ComputePikachuFacingDirection
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $1
+ ret
+
+Func_fca0a:
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $8
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $4
+ call AddPikachuStepVector
+ call AddPikachuStepVector
+asm_fca1c:
+ call DoubleAddPikachuStepVectorToScreenPixelCoords
+ call GetPikachuWalkingAnimationSpeed
+ call UpdatePikachuWalkingSprite
+ ld hl, wSpritePikachuStateData2WalkAnimationCounter - wSpritePikachuStateData1
+ add hl, bc
+ dec [hl]
+ ret nz
+ call ResetPikachuStepVector
+ call ComputePikachuFacingDirection
+ ld hl, wSpritePikachuStateData1MovementStatus - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $1
+ ret
+
+AddPikachuStepVector:
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
+ add hl, bc
+ ld e, [hl]
+ inc hl
+ inc hl
+ ld d, [hl]
+ ld hl, wSpritePikachuStateData2MapY - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ add e
+ ld [hli], a
+ ld a, [hl]
+ add d
+ ld [hl], a
+ ret
+
+TryDoubleAddPikachuStepVectorToScreenPixelCoords:
+ ld a, [wWalkBikeSurfState]
+ cp $1 ; biking
+ jr nz, AddPikachuStepVectorToScreenPixelCoords
+ ld a, [wd736]
+ bit 6, a
+ jr nz, AddPikachuStepVectorToScreenPixelCoords
+DoubleAddPikachuStepVectorToScreenPixelCoords:
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hli]
+ add a
+ add a
+ add [hl]
+ ld [hli], a
+ ld a, [hli]
+ add a
+ add a
+ add [hl]
+ ld [hl], a
+ ret
+
+AddPikachuStepVectorToScreenPixelCoords:
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hli]
+ add a
+ add [hl]
+ ld [hli], a
+ ld a, [hli]
+ add a
+ add [hl]
+ ld [hli], a
+ ret
+
+ResetPikachuStepVector:
+ ld hl, wSpritePikachuStateData1YStepVector - wSpritePikachuStateData1
+ add hl, bc
+ xor a
+ ld [hli], a
+ inc hl
+ ld [hl], a
+ ret
+
+GetPikachuWalkingAnimationSpeed:
+ call ComparePikachuHappinessTo80
+ ld d, $2
+ jr nc, .happy
+ ld d, $5
+.happy
+ ld hl, wSpritePikachuStateData1IntraAnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ inc a
+ cp d
+ jr nz, .dont_reset
+ xor a
+.dont_reset
+ ld [hli], a
+ ret nz
+ ld a, [hl]
+ inc a
+ and $3
+ ld [hl], a
+ ret
+
+UpdatePikachuWalkingSprite:
+ ld a, [wPikachuOverworldStateFlags]
+ bit 3, a
+ jr nz, .uninitialized
+ ld hl, wSpritePikachuStateData2ImageBaseOffset - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ dec a
+ swap a
+ ld d, a
+ ld a, [wd736]
+ bit 7, a
+ jr nz, .copy_player
+ ld hl, wSpritePikachuStateData1FacingDirection - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [hl]
+ or d
+ ld d, a
+ ld a, [wFontLoaded]
+ bit 0, a
+ jr z, .normal_get_sprite_index
+ call Func_fcae2
+ ret c
+ jr .load_sprite_index
+
+.normal_get_sprite_index
+ ld hl, wSpritePikachuStateData1AnimFrameCounter - wSpritePikachuStateData1
+ add hl, bc
+ ld a, d
+ or [hl]
+ ld d, a
+.load_sprite_index
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], d
+ ret
+
+.uninitialized
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $ff
+ ret
+
+.copy_player
+ ld a, [wSpritePlayerStateData1ImageIndex]
+ and $f
+ or d
+ ld [wSpritePikachuStateData1ImageIndex], a
+ ret
+
+Func_fcae2:
+ ld hl, wSpritePikachuStateData2MapY - wSpritePikachuStateData1
+ add hl, bc
+ ld a, [wYCoord]
+ add $4
+ cp [hl]
+ jr nz, .on_screen
+ inc hl
+ ld a, [wXCoord]
+ add $4
+ cp [hl]
+ jr nz, .on_screen
+ ld hl, wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ add hl, bc
+ ld [hl], $ff
+ scf
+ ret
+
+.on_screen
+ and a
+ ret
+
+IsPikachuRightNextToPlayer:
+ push bc
+ push de
+ push hl
+ ld bc, wSpritePikachuStateData1PictureID
+ ld a, [wXCoord]
+ add $4
+ ld d, a
+ ld a, [wYCoord]
+ add $4
+ ld e, a
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ sub e
+ and a
+ jr z, .equal
+ cp $ff
+ jr z, .one_away
+ cp $1
+ jr z, .one_away
+ jr .bad
+
+.one_away
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ sub d
+ jr z, .good
+ jr .bad
+
+.equal
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ sub d
+ cp $ff
+ jr z, .good
+ cp $1
+ jr z, .good
+ and a
+ jr z, .good
+ jr .bad
+
+.good
+ pop hl
+ pop de
+ pop bc
+ scf
+ ret
+
+.bad
+ pop hl
+ pop de
+ pop bc
+ xor a
+ ret
+
+GetPikachuFacingDirectionAndReturnToE::
+ call GetPikachuFacingDirection
+ ld e, a
+ ret
+
+GetPikachuFacingDirection:
+ ld bc, wSpritePikachuStateData1PictureID
+ ld a, [wXCoord]
+ add $4
+ ld d, a
+ ld a, [wYCoord]
+ add $4
+ ld e, a
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ cp e
+ jr z, .asm_fcb71
+ jr nc, .asm_fcb6e
+ ld a, SPRITE_FACING_UP
+ ret
+
+.asm_fcb6e
+ ld a, SPRITE_FACING_DOWN
+ ret
+
+.asm_fcb71
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ cp d
+ jr z, .asm_fcb81
+ jr nc, .asm_fcb7e
+ ld a, SPRITE_FACING_LEFT
+ ret
+
+.asm_fcb7e
+ ld a, SPRITE_FACING_RIGHT
+ ret
+
+.asm_fcb81
+ ld a, $ff ; standing
+ ret
+
+ClearPikachuFollowCommandBuffer:
+ push bc
+ ld hl, wPikachuFollowCommandBufferSize
+ ld [hl], $ff
+ inc hl
+ ld bc, $10
+ xor a
+ call FillMemory
+ pop bc
+ ret
+
+AppendPikachuFollowCommandToBuffer:
+ ld hl, wPikachuFollowCommandBufferSize
+ inc [hl]
+ ld e, [hl]
+ ld d, 0
+ ld hl, wPikachuFollowCommandBuffer
+ add hl, de
+ ld [hl], a
+ ret
+
+RefreshPikachuFollow:
+ call ClearPikachuFollowCommandBuffer
+ call ComputePikachuFollowCommand
+ ret c
+ call AppendPikachuFollowCommandToBuffer
+ ret
+
+ComputePikachuFollowCommand:
+ ld bc, wSpritePikachuStateData1PictureID
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [wYCoord]
+ add $4
+ sub [hl]
+ jr z, .checkXCoord
+ jr c, .pikaAbovePlayer
+ call CheckAbsoluteValueLessThan2
+ jr c, .return1
+ ld a, $5
+ and a
+ ret
+
+.return1
+ ld a, $1
+ and a
+ ret
+
+.pikaAbovePlayer
+ call CheckAbsoluteValueLessThan2
+ jr c, .return2
+ ld a, $6
+ and a
+ ret
+
+.return2
+ ld a, $2
+ and a
+ ret
+
+.checkXCoord
+ ld hl, wSpritePlayerStateData2MapX - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [wXCoord]
+ add $4
+ sub [hl]
+ jr z, .pikachuOnTopOfPlayer
+ jr c, .pikaToLeftOfPlayer
+ call CheckAbsoluteValueLessThan2
+ jr c, .return4
+ ld a, $8
+ and a
+ ret
+
+.return4
+ ld a, $4
+ and a
+ ret
+
+.pikaToLeftOfPlayer
+ call CheckAbsoluteValueLessThan2
+ jr c, .return3
+ ld a, $7
+ and a
+ ret
+
+.return3
+ ld a, $3
+ and a
+ ret
+
+.pikachuOnTopOfPlayer
+ scf
+ ret
+
+CheckAbsoluteValueLessThan2:
+ jr nc, .positive
+ cpl
+ inc a
+.positive
+ cp $2
+ ret
+
+Func_fcc08::
+ call Func_fcc23
+ ret nc
+ ld a, [wd736]
+ bit 6, a
+ jr nz, .asm_fcc1b
+ call Func_fcc42
+ ret c
+ call AppendPikachuFollowCommandToBuffer
+ ret
+
+.asm_fcc1b
+ call Func_fcc64
+ ret c
+ call AppendPikachuFollowCommandToBuffer
+ ret
+
+Func_fcc23:
+ ld a, [wPikachuOverworldStateFlags]
+ bit 5, a
+ jr nz, .asm_fcc40
+ ld a, [wPikachuOverworldStateFlags]
+ bit 7, a
+ jr nz, .asm_fcc40
+ ld a, [wd472]
+ bit 7, a
+ jr z, .asm_fcc40
+ ld a, [wWalkBikeSurfState]
+ and a
+ jr nz, .asm_fcc40
+ scf
+ ret
+
+.asm_fcc40
+ and a
+ ret
+
+Func_fcc42:
+ xor a
+ ld a, [wPlayerDirection]
+ bit 3, a
+ jr nz, .asm_fcc58
+ bit 2, a
+ jr nz, .asm_fcc5b
+ bit 1, a
+ jr nz, .asm_fcc5e
+ bit 0, a
+ jr nz, .asm_fcc61
+ scf
+ ret
+
+.asm_fcc58
+ ld a, $2
+ ret
+
+.asm_fcc5b
+ ld a, $1
+ ret
+
+.asm_fcc5e
+ ld a, $3
+ ret
+
+.asm_fcc61
+ ld a, $4
+ ret
+
+Func_fcc64:
+ ld hl, wPikachuOverworldStateFlags
+ bit 6, [hl]
+ jr z, .asm_fcc6e
+ res 6, [hl]
+ ret
+
+.asm_fcc6e
+ set 6, [hl]
+ xor a
+ ld a, [wPlayerDirection]
+ bit 3, a
+ jr nz, .asm_fcc86
+ bit 2, a
+ jr nz, .asm_fcc89
+ bit 1, a
+ jr nz, .asm_fcc8c
+ bit 0, a
+ jr nz, .asm_fcc8f
+ scf
+ ret
+
+.asm_fcc86
+ ld a, $6
+ ret
+
+.asm_fcc89
+ ld a, $5
+ ret
+
+.asm_fcc8c
+ ld a, $7
+ ret
+
+.asm_fcc8f
+ ld a, $8
+ ret
+
+Func_fcc92:
+ ld hl, wPikachuFollowCommandBufferSize
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_fccb0
+ and a
+ jr z, .asm_fccb0
+ dec [hl]
+ ld e, a
+ ld d, 0
+ ld hl, wPikachuFollowCommandBuffer
+ add hl, de
+ inc e
+ ld a, $ff
+.asm_fcca8
+ ld d, [hl]
+ ldd [hl], a
+ ld a, d
+ dec e
+ jr nz, .asm_fcca8
+ and a
+ ret
+
+.asm_fccb0
+ scf
+ ret
+
+ComputePikachuFacingDirection::
+ call GetPikachuFollowCommandIfBufferSizeNonzero
+ and a
+ jr z, .check_y
+ dec a
+ and $3
+ add a
+ add a
+ jr .load
+
+.check_y
+ ld a, [wYCoord]
+ add $4
+ ld d, a
+ ld a, [wXCoord]
+ add $4
+ ld e, a
+ ld a, [wSpritePikachuStateData2MapY]
+ cp d
+ jr z, .check_x
+ ld a, SPRITE_FACING_DOWN
+ jr c, .load
+ ld a, SPRITE_FACING_UP
+ jr .load
+
+.check_x
+ ld a, [wSpritePikachuStateData2MapX]
+ cp e
+ jr z, .copy_from_player
+ ld a, SPRITE_FACING_RIGHT
+ jr c, .load
+ ld a, SPRITE_FACING_LEFT
+ jr .load
+
+.copy_from_player
+ ld a, [wSpritePlayerStateData1FacingDirection]
+.load
+ ld [wSpritePikachuStateData1FacingDirection], a
+ ret
+
+GetPikachuFollowCommand:
+ ld hl, wPikachuFollowCommandBufferSize
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_fccff
+ ld e, a
+ ld d, 0
+ ld hl, wPikachuFollowCommandBuffer
+ add hl, de
+ ld a, [hl]
+ ret
+
+.asm_fccff
+ xor a
+ ret
+
+GetPikachuFollowCommandIfBufferSizeNonzero:
+ ld hl, wPikachuFollowCommandBufferSize
+ ld a, [hl]
+ cp $ff
+ jr z, .default
+ and a
+ jr z, .default
+ ld e, a
+ ld d, 0
+ ld hl, wPikachuFollowCommandBuffer
+ add hl, de
+ ld a, [hl]
+ ret
+
+.default
+ xor a
+ ret
+
+AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer:
+ ld a, [wPikachuFollowCommandBufferSize]
+ cp $ff
+ ret z
+ cp $2
+ jr nc, .set_carry
+ and a
+ ret
+
+.set_carry
+ scf
+ ret
+
+WillPikachuSpawnOnTheScreen:
+ ld h, HIGH(wSpriteStateData2)
+ ldh a, [hCurrentSpriteOffset] ; If we're here, this can only be $f0
+ add wSpritePikachuStateData2MapY - wSpritePikachuStateData2
+ ld l, a
+ ld b, [hl]
+ ld a, [wYCoord]
+ cp b
+ jr z, .same_y
+ jr nc, .not_on_screen
+ add (SCREEN_HEIGHT / 2) - 1
+ cp b
+ jr c, .not_on_screen
+.same_y
+ inc l
+ ld b, [hl]
+ ld a, [wXCoord]
+ cp b
+ jr z, .same_x
+ jr nc, .not_on_screen
+ add (SCREEN_WIDTH / 2) - 1
+ cp b
+ jr c, .not_on_screen
+.same_x
+ call .GetNPCCurrentTile
+ ld d, $60
+ ld a, [hli]
+ ld e, a
+ cp d
+ jr nc, .not_on_screen
+ ld a, [hld]
+ cp d
+ jr nc, .not_on_screen
+ ld bc, -20
+ add hl, bc
+ ld a, [hli]
+ cp d
+ jr nc, .not_on_screen
+ ld a, [hl]
+ cp d
+ jr c, .on_screen
+.not_on_screen
+ ld h, HIGH(wSpriteStateData1)
+ ldh a, [hCurrentSpriteOffset]
+ add wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1
+ ld l, a
+ ld [hl], $ff
+ scf
+ jr .return
+
+.on_screen
+ ld h, HIGH(wSpriteStateData2)
+ ldh a, [hCurrentSpriteOffset]
+ add wSpritePikachuStateData2GrassPriority - wSpritePikachuStateData2
+ ld l, a
+ ld a, [wGrassTile]
+ cp e
+ ld a, $0
+ jr nz, .priority
+ ld a, $80
+.priority
+ ld [hl], a
+ and a
+.return
+ ret
+
+.GetNPCCurrentTile:
+ ld h, HIGH(wSpriteStateData1)
+ ldh a, [hCurrentSpriteOffset]
+ add wSpritePikachuStateData1YPixels - wSpritePikachuStateData1
+ ld l, a
+ ld a, [hli]
+ add $4
+ and $f0
+ srl a
+ ld c, a
+ ld b, $0
+ inc l
+ ld a, [hl]
+ add $2
+ srl a
+ srl a
+ srl a
+ add SCREEN_WIDTH
+ ld d, 0
+ ld e, a
+ ld hl, wTileMap
+REPT 5
+ add hl, bc
+ENDR
+ add hl, de
+ ret
+
+ComparePikachuHappinessTo80:
+; preserves a and bc
+ push bc
+ push af
+ ld a, [wPikachuHappiness]
+ cp 80
+ pop bc
+ ld a, b
+ pop bc
+ ret
diff --git a/engine/pikachu/pikachu_movement.asm b/engine/pikachu/pikachu_movement.asm
new file mode 100644
index 00000000..2ca7aa2f
--- /dev/null
+++ b/engine/pikachu/pikachu_movement.asm
@@ -0,0 +1,1048 @@
+ApplyPikachuMovementData_::
+ ld a, b
+ ld [wPikachuMovementScriptBank], a
+ ld a, l
+ ld [wPikachuMovementScriptAddress], a
+ ld a, h
+ ld [wPikachuMovementScriptAddress + 1], a
+ call .SwapSpriteStateData
+.loop
+ call LoadPikachuMovementCommandData
+ jr nc, .done
+ call ExecutePikachuMovementCommand
+ jr .loop
+
+.done
+ call .SwapSpriteStateData
+ call DelayFrame
+ ret
+
+.SwapSpriteStateData:
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ push hl
+ push de
+ push bc
+
+ ld hl, wSpritePlayerStateData1
+ ld de, wSpritePikachuStateData1
+ ld c, $10
+ call .SwapBytes
+
+ ld hl, wSpritePlayerStateData2
+ ld de, wSpritePikachuStateData2
+ ld c, $10
+ call .SwapBytes
+
+ pop bc
+ pop de
+ pop hl
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ ret
+
+.SwapBytes:
+ ld b, [hl]
+ ld a, [de]
+ ld [hli], a
+ ld a, b
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .SwapBytes
+ ret
+
+LoadPikachuMovementCommandData:
+ call GetPikachuMovementScriptByte
+ cp $3f
+ ret z
+ ld c, a
+ ld b, 0
+ ld hl, PikachuMovementDatabase
+ add hl, bc
+ add hl, bc
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld [wCurPikaMovementFunc1], a
+ ld a, [hli]
+ cp $80
+ jr nz, .no_param
+ call GetPikachuMovementScriptByte
+.no_param
+ ld [wCurPikaMovementParam1], a
+ ld a, [hli]
+ ld [wCurPikaMovementFunc2], a
+ ld a, [hli]
+ cp $80
+ jr nz, .no_param2
+ call GetPikachuMovementScriptByte
+.no_param2
+ ld [wCurPikaMovementParam2], a
+ xor a
+ ld [wd451], a
+ scf
+ ret
+
+ExecutePikachuMovementCommand:
+ xor a
+ ld [wPikachuMovementFlags], a
+ ld [wPikachuStepTimer], a
+ ld [wPikachuStepSubtimer], a
+ ld a, [wSpritePlayerStateData2GrassPriority]
+ push af
+.loop
+ ld bc, wSpritePlayerStateData1 ; Currently holds Pikachu's sprite state data
+ ld a, [wCurPikaMovementFunc1]
+ ld hl, PikaMovementFunc1Jumptable
+ call .JumpTable
+ ld a, [wCurPikaMovementFunc2]
+ ld hl, PikaMovementFunc2Jumptable
+ call .JumpTable
+ call GetCoordsForPikachuShadow
+ call AnimatePikachuShadow
+ call DelayFrame
+ call DelayFrame
+ ld hl, wPikachuMovementFlags
+ bit 7, [hl]
+ jr z, .loop
+ pop af
+ ld [wSpritePlayerStateData2GrassPriority], a
+ scf
+ ret
+
+.JumpTable:
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+GetCoordsForPikachuShadow:
+ ld hl, wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [wCurPikaMovementSpriteImageIdx]
+ ld [hl], a
+ ld a, [wPikaSpriteY]
+ ld d, a
+ ld a, [wPikachuMovementYOffset]
+ add d
+ ld hl, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
+ add hl, bc
+ ld [hl], a
+ ld a, [wPikaSpriteX]
+ ld d, a
+ ld a, [wPikachuMovementXOffset]
+ add d
+ ld hl, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
+ add hl, bc
+ ld [hl], a
+ ld hl, wPikachuMovementFlags
+ bit 6, [hl]
+ ret z
+ ld hl, wSpritePlayerStateData2GrassPriority - wSpritePlayerStateData1
+ add hl, bc
+ ld [hl], 0
+ ret
+
+AnimatePikachuShadow:
+ ld hl, wPikachuMovementFlags
+ bit 6, [hl]
+ res 6, [hl]
+ ld hl, wd736
+ res 6, [hl]
+ ret z
+ set 6, [hl]
+ call LoadPikachuShadowOAMData
+ ret
+
+PikachuMovementDatabase:
+ db $01, 1 - 1, $00, 1 - 1 ; $00 start
+
+ db $03, $80, $01, 1 - 1 ; $01
+ db $04, $80, $01, 1 - 1 ; $02
+ db $05, $80, $01, 1 - 1 ; $03
+ db $06, $80, $01, 1 - 1 ; $04
+ db $07, $80, $01, 1 - 1 ; $05
+ db $08, $80, $01, 1 - 1 ; $06
+ db $09, $80, $01, 1 - 1 ; $07
+ db $0a, $80, $01, 1 - 1 ; $08
+
+ db $03, $80, $06, 1 - 1 ; $09
+ db $04, $80, $06, 1 - 1 ; $0a
+ db $05, $80, $06, 1 - 1 ; $0b
+ db $06, $80, $06, 1 - 1 ; $0c
+ db $07, $80, $06, 1 - 1 ; $0d
+ db $08, $80, $06, 1 - 1 ; $0e
+ db $09, $80, $06, 1 - 1 ; $0f
+ db $0a, $80, $06, 1 - 1 ; $10
+
+ db $03, $80, $03, $80 ; $11
+ db $04, $80, $03, $80 ; $12
+ db $05, $80, $03, $80 ; $13
+ db $06, $80, $03, $80 ; $14
+ db $07, $80, $03, $80 ; $15
+ db $08, $80, $03, $80 ; $16
+ db $09, $80, $03, $80 ; $17
+ db $0a, $80, $03, $80 ; $18
+
+ db $03, $80, $07, $80 ; $19
+ db $04, $80, $07, $80 ; $1a
+ db $05, $80, $07, $80 ; $1b
+ db $06, $80, $07, $80 ; $1c
+
+ db $0b, (1 << 5) | 8 - 1, $02, 1 - 1 ; $1d step down
+ db $0c, (1 << 5) | 8 - 1, $02, 1 - 1 ; $1e step up
+ db $0d, (1 << 5) | 8 - 1, $02, 1 - 1 ; $1f step left
+ db $0e, (1 << 5) | 8 - 1, $02, 1 - 1 ; $20 step right
+ db $0f, (1 << 5) | 8 - 1, $02, 1 - 1 ; $21 step down left
+ db $10, (1 << 5) | 8 - 1, $02, 1 - 1 ; $22 step down right
+ db $11, (1 << 5) | 8 - 1, $02, 1 - 1 ; $23 step up left
+ db $12, (1 << 5) | 8 - 1, $02, 1 - 1 ; $24 step up right
+
+ db $0b, 16 - 1, $02, 1 - 1 ; $25 slide down
+ db $0c, 16 - 1, $02, 1 - 1 ; $26 slide up
+ db $0d, 16 - 1, $02, 1 - 1 ; $27 slide left
+ db $0e, 16 - 1, $02, 1 - 1 ; $28 slide right
+ db $0f, 16 - 1, $02, 1 - 1 ; $29 slide down left
+ db $10, 16 - 1, $02, 1 - 1 ; $2a slide down right
+ db $11, 16 - 1, $02, 1 - 1 ; $2b slide up left
+ db $12, 16 - 1, $02, 1 - 1 ; $2c slide up right
+
+ db $0b, 16 - 1, $08, (1 << 4) | 8 - 1 ; $2d hop down
+ db $0c, 16 - 1, $08, (1 << 4) | 8 - 1 ; $2e hop up
+ db $0d, 16 - 1, $08, (1 << 4) | 8 - 1 ; $2f hop left
+ db $0e, 16 - 1, $08, (1 << 4) | 8 - 1 ; $30 hop right
+ db $0f, 16 - 1, $08, (1 << 4) | 8 - 1 ; $31 hop down left
+ db $10, 16 - 1, $08, (1 << 4) | 8 - 1 ; $32 hop down right
+ db $11, 16 - 1, $08, (1 << 4) | 8 - 1 ; $33 hop up left
+ db $12, 16 - 1, $08, (1 << 4) | 8 - 1 ; $34 hop up right
+
+ db $13, 16 - 1, $06, 1 - 1 ; $35 look down
+ db $14, 16 - 1, $06, 1 - 1 ; $36 look up
+ db $15, 16 - 1, $06, 1 - 1 ; $37 look left
+ db $16, 16 - 1, $06, 1 - 1 ; $38 look right
+
+ db $02, $80, $04, 1 - 1 ; $39
+ db $02, $80, $05, 1 - 1 ; $3a
+ db $02, $80, $03, $80 ; $3b
+ db $02, $80, $07, $80 ; $3c
+ db $02, $80, $09, $80 ; $3d
+ db $02, $80, $06, 1 - 1 ; $3e
+
+PikaMovementFunc1Jumptable:
+ dw PikaMovementFunc1_EndCommand_ ; 00
+ dw PikaMovementFunc1_LoadPikachuCurrentPosition ; 01
+ dw PikaMovementFunc1_DelayFrames ; 02
+ dw PikaMovementFunc1_WalkInCurrentFacingDirection ; 03
+ dw PikaMovementFunc1_WalkInOppositeFacingDirection ; 04
+ dw PikaMovementFunc1_StepTurningCounterclockwise ; 05
+ dw PikaMovementFunc1_StepTurningClockwise ; 06
+ dw PikaMovementFunc1_StepForwardLeft ; 07
+ dw PikaMovementFunc1_StepForwardRight ; 08
+ dw PikaMovementFunc1_StepBackwardLeft ; 09
+ dw PikaMovementFunc1_StepBackwardRight ; 0a
+ dw PikaMovementFunc1_MoveDown ; 0b
+ dw PikaMovementFunc1_MoveUp ; 0c
+ dw PikaMovementFunc1_MoveLeft ; 0d
+ dw PikaMovementFunc1_MoveRight ; 0e
+ dw PikaMovementFunc1_MoveDownLeft ; 0f
+ dw PikaMovementFunc1_MoveDownRight ; 10
+ dw PikaMovementFunc1_MoveUpLeft ; 11
+ dw PikaMovementFunc1_MoveUpRight ; 12
+ dw PikaMovementFunc1_LookDown ; 13
+ dw PikaMovementFunc1_LookUp ; 14
+ dw PikaMovementFunc1_LookLeft ; 15
+ dw PikaMovementFunc1_LookRight ; 16
+ dw PikaMovementFunc1_EndCommand_ ; 17
+
+PikaMovementFunc1_EndCommand:
+ ld a, [wPikachuMovementFlags]
+ set 7, a
+ ld [wPikachuMovementFlags], a
+ ret
+
+PikaMovementFunc1_EndCommand_:
+ call PikaMovementFunc1_EndCommand
+ ret
+
+PikaMovementFunc1_LoadPikachuCurrentPosition:
+ ld hl, wSpritePlayerStateData1YPixels - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ ld [wPikaSpriteY], a
+ ld hl, wSpritePlayerStateData1XPixels - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ ld [wPikaSpriteX], a
+ xor a
+ ld [wPikachuMovementYOffset], a
+ ld [wPikachuMovementXOffset], a
+ call PikaMovementFunc1_EndCommand
+ ret
+
+PikaMovementFunc1_DelayFrames:
+ call CheckPikachuStepTimer1
+ ret nz
+ call PikaMovementFunc1_EndCommand
+ ret
+
+PikaMovementFunc1_WalkInCurrentFacingDirection:
+ call GetPikachuFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+PikaMovementFunc1_WalkInOppositeFacingDirection:
+ call GetPikachuFacing
+ xor %100
+ jr PikaMovementFunc1_ApplyStepVector
+
+PikaMovementFunc1_StepTurningCounterclockwise:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_RIGHT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_LEFT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_DOWN << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_UP << 2
+ db $ff
+
+PikaMovementFunc1_StepTurningClockwise:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_LEFT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_RIGHT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_UP << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_DOWN << 2
+ db $ff
+
+PikaMovementFunc1_StepForwardLeft:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_DOWN_RIGHT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_UP_LEFT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_DOWN_LEFT << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_UP_RIGHT << 2
+
+PikaMovementFunc1_StepForwardRight:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_DOWN_LEFT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_UP_RIGHT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_UP_LEFT << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_DOWN_RIGHT << 2
+
+PikaMovementFunc1_StepBackwardLeft:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_UP_RIGHT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_DOWN_LEFT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_DOWN_RIGHT << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_UP_LEFT << 2
+
+PikaMovementFunc1_StepBackwardRight:
+ call GetPikachuFacing
+ ld hl, .Data
+ call PikaMovementFunc1_GetNextFacing
+ jr PikaMovementFunc1_ApplyStepVector
+
+.Data:
+ db SPRITE_FACING_DOWN, PIKASTEPDIR_UP_LEFT << 2
+ db SPRITE_FACING_UP, PIKASTEPDIR_DOWN_RIGHT << 2
+ db SPRITE_FACING_LEFT, PIKASTEPDIR_UP_RIGHT << 2
+ db SPRITE_FACING_RIGHT, PIKASTEPDIR_DOWN_LEFT << 2
+
+PikaMovementFunc1_ApplyStepVector:
+ rrca
+ rrca
+ and $7
+ ld e, a
+ call GetPikachuStepVectorMagnitude
+ ld d, a
+ call UpdatePikachuPosition
+ call CheckPikachuStepTimer1
+ ret nz
+ call PikaMovementFunc1_EndCommand
+ ret
+
+PikaMovementFunc1_GetNextFacing:
+ push de
+ ld d, a
+.loop
+ ld a, [hli]
+ cp d
+ jr z, .found
+ inc hl
+ cp $ff
+ jr nz, .loop
+ pop de
+ ret
+
+.found
+ ld a, [hl]
+ pop de
+ scf
+ ret
+
+PikaMovementFunc1_MoveDown:
+ ld a, PIKASTEPDIR_DOWN
+ jr PikaMovementFunc1_ApplyFacingAndMove
+
+PikaMovementFunc1_MoveUp:
+ ld a, PIKASTEPDIR_UP
+ jr PikaMovementFunc1_ApplyFacingAndMove
+
+PikaMovementFunc1_MoveLeft:
+ ld a, PIKASTEPDIR_LEFT
+ jr PikaMovementFunc1_ApplyFacingAndMove
+
+PikaMovementFunc1_MoveRight:
+ ld a, PIKASTEPDIR_RIGHT
+ jr PikaMovementFunc1_ApplyFacingAndMove
+
+PikaMovementFunc1_MoveDownLeft:
+ ld e, PIKASTEPDIR_DOWN_LEFT
+ jr PikaMovementFunc1_MoveDiagonally
+
+PikaMovementFunc1_MoveDownRight:
+ ld e, PIKASTEPDIR_DOWN_RIGHT
+ jr PikaMovementFunc1_MoveDiagonally
+
+PikaMovementFunc1_MoveUpLeft:
+ ld e, PIKASTEPDIR_UP_LEFT
+ jr PikaMovementFunc1_MoveDiagonally
+
+PikaMovementFunc1_MoveUpRight:
+ ld e, PIKASTEPDIR_UP_RIGHT
+ jr PikaMovementFunc1_MoveDiagonally
+
+PikaMovementFunc1_ApplyFacingAndMove:
+ ld e, a
+ call SetPikachuFacing
+PikaMovementFunc1_MoveDiagonally:
+ call GetPikachuStepVectorMagnitude
+ ld d, a
+ push de
+ call UpdatePikachuPosition
+ pop de
+ call CheckPikachuStepTimer1
+ ret nz
+ ld a, e
+ call ApplyPikachuStepVector
+ call PikaMovementFunc1_EndCommand
+ ret
+
+PikaMovementFunc1_LookDown:
+ ld a, PIKASTEPDIR_DOWN
+ jr PikaMovementFunc1_ApplyFacing
+
+PikaMovementFunc1_LookUp:
+ ld a, PIKASTEPDIR_UP
+ jr PikaMovementFunc1_ApplyFacing
+
+PikaMovementFunc1_LookLeft:
+ ld a, PIKASTEPDIR_LEFT
+ jr PikaMovementFunc1_ApplyFacing
+
+PikaMovementFunc1_LookRight:
+ ld a, PIKASTEPDIR_RIGHT
+ jr PikaMovementFunc1_ApplyFacing
+
+PikaMovementFunc1_ApplyFacing:
+ call SetPikachuFacing
+ call PikaMovementFunc1_EndCommand
+ ret
+
+UpdatePikachuPosition:
+ push de
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop de
+ ld a, d
+ jp hl
+
+.Jumptable:
+ dw .Down
+ dw .Up
+ dw .Left
+ dw .Right
+ dw .DownLeft
+ dw .DownRight
+ dw .UpLeft
+ dw .UpRight
+
+.Down:
+ ld d, 0
+ ld e, a
+ jr .ApplyVector
+
+.Up:
+ ld d, 0
+ cpl
+ inc a
+ ld e, a
+ jr .ApplyVector
+
+.Left:
+ cpl
+ inc a
+ ld d, a
+ ld e, 0
+ jr .ApplyVector
+
+.Right:
+ ld d, a
+ ld e, 0
+ jr .ApplyVector
+
+.DownLeft:
+ ld e, a
+ cpl
+ inc a
+ ld d, a
+ jr .ApplyVector
+
+.DownRight:
+ ld e, a
+ ld d, a
+ jr .ApplyVector
+
+.UpLeft:
+ cpl
+ inc a
+ ld e, a
+ ld d, a
+ jr .ApplyVector
+
+.UpRight:
+ ld d, a
+ cpl
+ inc a
+ ld e, a
+ jr .ApplyVector
+
+.ApplyVector:
+ ld a, [wPikaSpriteX]
+ add d
+ ld [wPikaSpriteX], a
+ ld a, [wPikaSpriteY]
+ add e
+ ld [wPikaSpriteY], a
+ ret
+
+PikaMovementFunc2Jumptable:
+ dw PikaMovementFunc2_ResetFrameCounterAndFaceCurrent ; 0
+ dw PikaMovementFunc2_UpdateSpriteImageIdxWithPreviousImageIdxDirection ; 1
+ dw PikaMovementFunc2_UpdateSpriteImageIdxWithFacing ; 2
+ dw PikaMovementFunc2_TurnParameter ; 3
+ dw PikaMovementFunc2_TurnClockwise ; 4
+ dw PikaMovementFunc2_TurnCounterClockwise ; 5
+ dw PikaMovementFunc2_CopySpriteImageIdxDirectionToSpriteImageIdx ; 6
+ dw PikaMovementFunc2_UpdateJumpWithPreviousImageIdxDirection ; 7
+ dw PikaMovementFunc2_UpdateJumpWithFacing ; 8
+ dw PikaMovementFunc2_CopyFacingToJump ; 9
+ dw PikaMovementFunc2_nop ; 10
+
+PikaMovement_SetSpawnShadow:
+ ld hl, wPikachuMovementFlags
+ set 6, [hl]
+ ret
+
+PikaMovementFunc2_ResetFrameCounterAndFaceCurrent:
+ ld hl, wSpritePlayerStateData1IntraAnimFrameCounter - wSpritePlayerStateData1
+ add hl, bc
+ xor a
+ ld [hli], a
+ ld [hl], a
+ call PikaMovementFunc2_GetImageBaseOffset
+ ld d, a
+ call GetPikachuFacing
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ ret
+
+PikaMovementFunc2_nop:
+ ret
+
+PikaMovementFunc2_CopySpriteImageIdxDirectionToSpriteImageIdx:
+ call PikaMovementFunc2_GetImageBaseOffset
+ ld d, a
+ call PikaMovementFunc2_GetSpriteImageIdxDirection
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ ret
+
+PikaMovementFunc2_UpdateSpriteImageIdxWithFacing:
+ call PikaMovementFunc2_GetImageBaseOffset
+ ld d, a
+ call GetPikachuFacing
+ or d
+ ld d, a
+ jr PikaMovementFunc2_UpdateSpriteImageIdx
+
+PikaMovementFunc2_UpdateSpriteImageIdxWithPreviousImageIdxDirection:
+ call PikaMovementFunc2_GetImageBaseOffset
+ ld d, a
+ call PikaMovementFunc2_GetSpriteImageIdxDirection
+ or d
+ ld d, a
+PikaMovementFunc2_UpdateSpriteImageIdx:
+ ld hl, wSpritePlayerStateData1AnimFrameCounter - wSpritePlayerStateData1
+ add hl, bc
+ call CheckPikachuStepTimer2 ; does not preserve hl
+ jr nz, .skip
+ inc [hl]
+.skip
+ ld a, [hl]
+ rrca
+ rrca
+ and 3
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ ret
+
+PikaMovementFunc2_UpdateJumpWithFacing:
+ call GetPikachuFacing
+ ld d, a
+ jr PikaMovementFunc2_UpdateJump
+
+PikaMovementFunc2_UpdateJumpWithPreviousImageIdxDirection:
+ call PikaMovementFunc2_GetSpriteImageIdxDirection
+ ld d, a
+PikaMovementFunc2_UpdateJump:
+ call PikaMovementFunc2_GetImageBaseOffset
+ or d
+ ld d, a
+ call PikaMovementFunc2_Timer
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ call PikaMovementFunc_Sine
+ ld [wPikachuMovementYOffset], a
+ and a
+ ret z
+ call PikaMovement_SetSpawnShadow
+ ret
+
+PikaMovementFunc2_CopyFacingToJump:
+ call GetPikachuFacing
+ ld d, a
+ call PikaMovementFunc2_GetImageBaseOffset
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ call PikaMovementFunc_Sine
+ ld [wPikachuMovementYOffset], a
+ ret
+
+PikaMovementFunc2_TurnParameter:
+ ld a, [wCurPikaMovementParam2]
+ and $40
+ cp $40
+ jr z, PikaMovementFunc2_TurnClockwise
+ jr PikaMovementFunc2_TurnCounterClockwise
+
+PikaMovementFunc2_TurnClockwise:
+ call PikaMovementFunc2_GetSpriteImageIdxDirection
+ ld d, a
+ call CheckPikachuStepTimer2
+ jr nz, .skip
+ ld hl, Data_fd731
+.loop
+ ld a, [hli]
+ cp d
+ jr nz, .loop
+ ld d, [hl]
+.skip
+ call PikaMovementFunc2_GetImageBaseOffset
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ ret
+
+PikaMovementFunc2_TurnCounterClockwise:
+ call PikaMovementFunc2_GetSpriteImageIdxDirection
+ ld d, a
+ call CheckPikachuStepTimer2
+ jr nz, .skip
+ ld hl, Data_fd731End
+.loop
+ ld a, [hld]
+ cp d
+ jr nz, .loop
+ ld d, [hl]
+.skip
+ call PikaMovementFunc2_GetImageBaseOffset
+ or d
+ ld [wCurPikaMovementSpriteImageIdx], a
+ ret
+
+Data_fd731:
+ db SPRITE_FACING_DOWN
+ db SPRITE_FACING_LEFT
+ db SPRITE_FACING_UP
+ db SPRITE_FACING_RIGHT
+ db SPRITE_FACING_DOWN
+Data_fd731End:
+
+PikaMovementFunc2_Timer:
+ push hl
+ ld hl, wSpritePlayerStateData1IntraAnimFrameCounter - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ inc a
+ and $3
+ ld [hli], a
+ jr nz, .load_pop
+ ld a, [hl]
+ inc a
+ and $3
+ ld [hl], a
+.load_pop
+ ld a, [hl]
+ pop hl
+ ret
+
+PikaMovementFunc2_GetImageBaseOffset:
+ push hl
+ ld hl, wSpritePlayerStateData2ImageBaseOffset - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ dec a
+ swap a
+ pop hl
+ ret
+
+PikaMovementFunc2_GetSpriteImageIdxDirection:
+ push hl
+ ld hl, wSpritePlayerStateData1ImageIndex - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ and $c
+ pop hl
+ ret
+
+GetPikachuFacing:
+ push hl
+ ld hl, wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ and $c
+ pop hl
+ ret
+
+SetPikachuFacing:
+ push hl
+ ld hl, wSpritePlayerStateData1FacingDirection - wSpritePlayerStateData1
+ add hl, bc
+ add a
+ add a
+ and $c
+ ld [hl], a
+ pop hl
+ ret
+
+CheckPikachuStepTimer1:
+ ld hl, wPikachuStepTimer
+ inc [hl]
+ ld a, [wCurPikaMovementParam1]
+ and $1f
+ inc a
+ cp [hl]
+ ret nz
+ ld [hl], 0
+ ret
+
+GetPikachuStepVectorMagnitude:
+ ; *XX*****
+ ld a, [wCurPikaMovementParam1]
+ swap a
+ rrca
+ and $3
+ inc a
+ ret
+
+CheckPikachuStepTimer2:
+ ld hl, wPikachuStepSubtimer
+ inc [hl]
+ ld a, [wCurPikaMovementParam2]
+ and $f
+ inc a
+ cp [hl]
+ ret nz
+ ld [hl], 0
+ ret
+
+PikaMovementFunc_Sine:
+ call .GetArgument
+ ld a, [wPikachuStepSubtimer]
+ add e
+ ld [wPikachuStepSubtimer], a
+ add $20
+ ld e, a
+ push hl
+ push bc
+ call Sine_e
+ pop bc
+ pop hl
+ ret
+
+.GetArgument:
+ ld a, [wCurPikaMovementParam2]
+ and $f
+ inc a
+ ld d, a
+ ld a, [wCurPikaMovementParam2]
+ swap a
+ and $7
+ ld e, a
+ ld a, 1
+ jr z, .okay
+.loop
+ add a
+ dec e
+ jr nz, .loop
+.okay
+ ld e, a
+ ret
+
+ApplyPikachuStepVector:
+ push bc
+ ld c, a
+ ld b, 0
+ ld hl, .StepVectors
+ add hl, bc
+ add hl, bc
+ ld d, [hl]
+ inc hl
+ ld e, [hl]
+ pop bc
+ ld hl, wSpritePlayerStateData2MapY - wSpritePlayerStateData1
+ add hl, bc
+ ld a, [hl]
+ add e
+ ld [hli], a
+ ld a, [hl]
+ add d
+ ld [hl], a
+ ret
+
+.StepVectors:
+ db 0, 1
+ db 0, -1
+ db -1, 0
+ db 1, 0
+ db -1, 1
+ db 1, 1
+ db -1, -1
+ db 1, -1
+
+LoadPikachuShadowOAMData:
+ push bc
+ push de
+ push hl
+
+ ld bc, wOAMBuffer + 4 * 36
+ ld a, [wPikaSpriteY]
+ ld e, a
+ ld a, [wPikaSpriteX]
+ ld d, a
+ ld hl, .OAMData
+ call .LoadOAMData
+
+ pop hl
+ pop de
+ pop bc
+ ret
+
+.OAMData:
+ db 2
+ db $0c, $00, $ff, 0
+ db $0c, $08, $ff, 1 << OAM_X_FLIP
+
+.LoadOAMData:
+ ld a, e
+ add $10
+ ld e, a
+ ld a, d
+ add $8
+ ld d, a
+ ld a, [hli]
+.loop
+ push af
+ ld a, [hli]
+ add e
+ ld [bc], a
+ inc bc
+ ld a, [hli]
+ add d
+ ld [bc], a
+ inc bc
+ ld a, [hli]
+ ld [bc], a
+ inc bc
+ ld a, [hli]
+ ld [bc], a
+ inc bc
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+LoadPikachuShadowIntoVRAM::
+ ld hl, vNPCSprites2 + $7f * $10
+ ld de, LedgeHoppingShadowGFX_3F
+ lb bc, BANK(LedgeHoppingShadowGFX_3F), (LedgeHoppingShadowGFX_3FEnd - LedgeHoppingShadowGFX_3F) / 8
+ jp CopyVideoDataDoubleAlternate
+
+LedgeHoppingShadowGFX_3F:
+INCBIN "gfx/overworld/shadow.1bpp"
+LedgeHoppingShadowGFX_3FEnd:
+
+LoadPikachuBallIconIntoVRAM:
+ ld hl, vNPCSprites2 + $7e * $10
+ ld de, OverworldPikachuBallGFX
+ lb bc, BANK(OverworldPikachuBallGFX), 1
+ jp CopyVideoDataDoubleAlternate
+
+Func_fd851:
+ ld hl, vNPCSprites + $c * $10
+ ld a, 3
+.loop
+ push af
+ push hl
+ ld de, OverworldPikachuBallGFX
+ lb bc, BANK(OverworldPikachuBallGFX), 4
+ call CopyVideoDataAlternate
+ pop hl
+ ld de, 4 * $10
+ add hl, de
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+OverworldPikachuBallGFX:
+INCBIN "gfx/overworld/pikachu_ball.2bpp"
+
+LoadPikachuSpriteIntoVRAM:
+ ld de, PikachuSprite
+ lb bc, BANK(PikachuSprite), (SandshrewSprite - PikachuSprite) / 32
+ ld hl, vNPCSprites + $c * $10
+ push bc
+ call CopyVideoDataAlternate
+ ld de, PikachuSprite + $c * $10
+ ld hl, vNPCSprites2 + $c * $10
+ ldh a, [hPikachuSpriteVRAMOffset]
+ and a
+ jr z, .load
+ ld de, PikachuSprite + $c * $10
+ ld hl, vNPCSprites2 + $4c * $10
+.load
+ pop bc
+ call CopyVideoDataAlternate
+ call LoadPikachuShadowIntoVRAM
+ call LoadPikachuBallIconIntoVRAM
+ ret
+
+PikachuPewterPokecenterCheck:
+ ld a, [wCurMap]
+ cp PEWTER_POKECENTER
+ ret nz
+ call EnablePikachuFollowingPlayer
+ call StarterPikachuEmotionCommand_turnawayfromplayer
+ ret
+
+PikachuFanClubCheck:
+ ld a, [wCurMap]
+ cp POKEMON_FAN_CLUB
+ ret nz
+ call EnablePikachuFollowingPlayer
+ call StarterPikachuEmotionCommand_turnawayfromplayer
+ ret
+
+PikachuBillsHouseCheck:
+ ld a, [wCurMap]
+ cp BILLS_HOUSE
+ ret nz
+ call EnablePikachuFollowingPlayer
+ ret
+
+Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3:
+ call LoadCurrentMapView
+ call UpdateSprites
+ call Delay3
+ ret
+
+Cosine_e: ; cosine?
+ ld a, e
+ add $10
+ jr asm_fd908
+
+Sine_e: ; sine?
+ ld a, e
+asm_fd908:
+ and $3f
+ cp $20
+ jr nc, .asm_fd913
+ call GetSine
+ ld a, h
+ ret
+
+.asm_fd913
+ and $1f
+ call GetSine
+ ld a, h
+ cpl
+ inc a
+ ret
+
+GetSine:
+ ld e, a
+ ld a, d
+ ld d, 0
+ ld hl, SineWave_3f
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld hl, 0
+.asm_fd92b
+ srl a
+ jr nc, .asm_fd930
+ add hl, de
+.asm_fd930
+ sla e
+ rl d
+ and a
+ jr nz, .asm_fd92b
+ ret
+
+SineWave_3f:
+ sine_table 32
diff --git a/engine/pikachu/pikachu_pcm.asm b/engine/pikachu/pikachu_pcm.asm
new file mode 100644
index 00000000..5ef6fbc3
--- /dev/null
+++ b/engine/pikachu/pikachu_pcm.asm
@@ -0,0 +1,154 @@
+PlayPikachuSoundClip::
+ ld a, e
+ ld e, a
+ ld d, $0
+ ld hl, PikachuCriesPointerTable
+ add hl, de
+ add hl, de
+ add hl, de
+ ld b, [hl] ; bank of pikachu cry data
+ inc hl
+ ld a, [hli] ; cry data pointer
+ ld h, [hl]
+ ld l, a
+ ld c, $4
+.loop
+ dec c
+ jr z, .done_delay
+ call DelayFrame
+ jr .loop
+
+.done_delay
+ di
+ push bc
+ push hl
+ ld a, $80
+ ldh [rNR52], a
+ ld a, $77
+ ldh [rNR50], a
+ xor a
+ ldh [rNR30], a
+ ld hl, rWave_0 ; wave data
+ ld de, wRedrawRowOrColumnSrcTiles
+.saveWaveDataLoop
+ ld a, [hl]
+ ld [de], a
+ inc de
+ ld a, $ff
+ ld [hli], a
+ ld a, l
+ cp $40 ; end of wave data
+ jr nz, .saveWaveDataLoop
+ ld a, $80
+ ldh [rNR30], a
+ ldh a, [rNR51]
+ or $44
+ ldh [rNR51], a
+ ld a, $ff
+ ldh [rNR31], a
+ ld a, $20
+ ldh [rNR32], a
+ ld a, $ff
+ ldh [rNR33], a
+ ld a, $87
+ ldh [rNR34], a
+ pop hl
+ pop bc
+ call PlayPikachuPCM
+ xor a
+ ld [wc0f3], a
+ ld [wc0f3 + 1], a
+ ld a, $80
+ ldh [rNR52], a
+ xor a
+ ldh [rNR30], a
+ ld hl, rWave_0
+ ld de, wRedrawRowOrColumnSrcTiles
+.reloadWaveDataLoop
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, l
+ cp $40 ; end of wave data
+ jr nz, .reloadWaveDataLoop
+ ld a, $80
+ ldh [rNR30], a
+ ldh a, [rNR51]
+ and $bb
+ ldh [rNR51], a
+ xor a
+ ld [wChannelSoundIDs + Ch5], a
+ ld [wChannelSoundIDs + Ch6], a
+ ld [wChannelSoundIDs + Ch7], a
+ ld [wChannelSoundIDs + Ch8], a
+ ldh a, [hLoadedROMBank]
+ ei
+ ret
+
+PikachuCriesPointerTable::
+; format:
+; db bank
+; dw pointer to cry
+
+; bank 21
+ pikacry_def PikachuCry1
+ pikacry_def PikachuCry2
+ pikacry_def PikachuCry3
+ pikacry_def PikachuCry4
+
+; bank 22
+ pikacry_def PikachuCry5
+ pikacry_def PikachuCry6
+ pikacry_def PikachuCry7
+
+; bank 23
+ pikacry_def PikachuCry8
+ pikacry_def PikachuCry9
+ pikacry_def PikachuCry10
+
+; bank 24
+ pikacry_def PikachuCry11
+ pikacry_def PikachuCry12
+ pikacry_def PikachuCry13
+
+; bank 25
+ pikacry_def PikachuCry14
+ pikacry_def PikachuCry15
+
+; banks 31-34, in no particular order
+
+ pikacry_def PikachuCry16
+ pikacry_def PikachuCry17
+ pikacry_def PikachuCry18
+ pikacry_def PikachuCry19
+ pikacry_def PikachuCry20
+ pikacry_def PikachuCry21
+ pikacry_def PikachuCry22
+ pikacry_def PikachuCry23
+ pikacry_def PikachuCry24
+ pikacry_def PikachuCry25
+ pikacry_def PikachuCry26
+
+; bank 35
+ pikacry_def PikachuCry27
+ pikacry_def PikachuCry28
+ pikacry_def PikachuCry29
+ pikacry_def PikachuCry30
+ pikacry_def PikachuCry31
+
+; bank 36
+ pikacry_def PikachuCry32
+ pikacry_def PikachuCry33
+ pikacry_def PikachuCry34
+
+; bank 37
+ pikacry_def PikachuCry35
+ pikacry_def PikachuCry36
+
+; banks 36-38
+ pikacry_def PikachuCry37
+ pikacry_def PikachuCry38
+ pikacry_def PikachuCry39
+ pikacry_def PikachuCry40
+ pikacry_def PikachuCry41
+ pikacry_def PikachuCry42
diff --git a/engine/pikachu/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm
new file mode 100644
index 00000000..a5d9087f
--- /dev/null
+++ b/engine/pikachu/pikachu_pic_animation.asm
@@ -0,0 +1,852 @@
+GetPikaPicAnimationScriptIndex:
+ ld hl, PikachuMoodLookupTable
+ ld a, [wPikachuMood]
+ ld d, a
+.get_mood_param
+ ld a, [hli]
+ inc hl
+ cp d
+ jr c, .get_mood_param
+ dec hl
+ ld e, [hl]
+ ld hl, PikaPicAnimationScriptPointerLookupTable
+ ld a, [wPikachuHappiness]
+ ld d, a
+ ld bc, 6
+.get_happiness_param
+ ld a, [hl]
+ cp d
+ jr nc, .got_animation
+ add hl, bc
+ jr .get_happiness_param
+
+.got_animation
+ ld d, 0
+ add hl, de
+ ld a, [hl]
+ ret
+
+PikachuMoodLookupTable:
+; First byte: mood threshold
+; Second byte: column index in PikaPicAnimationScriptPointerLookupTable
+ db 40, 1
+ db 127, 2
+ db 128, 3
+ db 210, 4
+ db 255, 5
+
+PikaPicAnimationScriptPointerLookupTable:
+; First byte: happiness threshold
+; Remaining bytes: loaded based on Pikachu's mood
+ db 50
+ dpikapic PikaPicAnimScript14
+ dpikapic PikaPicAnimScript14
+ dpikapic PikaPicAnimScript6
+ dpikapic PikaPicAnimScript13
+ dpikapic PikaPicAnimScript13
+
+ db 100
+ dpikapic PikaPicAnimScript9
+ dpikapic PikaPicAnimScript9
+ dpikapic PikaPicAnimScript5
+ dpikapic PikaPicAnimScript12
+ dpikapic PikaPicAnimScript12
+
+ db 130
+ dpikapic PikaPicAnimScript3
+ dpikapic PikaPicAnimScript3
+ dpikapic PikaPicAnimScript1
+ dpikapic PikaPicAnimScript8
+ dpikapic PikaPicAnimScript8
+
+ db 160
+ dpikapic PikaPicAnimScript3
+ dpikapic PikaPicAnimScript3
+ dpikapic PikaPicAnimScript4
+ dpikapic PikaPicAnimScript15
+ dpikapic PikaPicAnimScript15
+
+ db 200
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript7
+ dpikapic PikaPicAnimScript2
+ dpikapic PikaPicAnimScript2
+
+ db 250
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript16
+ dpikapic PikaPicAnimScript10
+ dpikapic PikaPicAnimScript10
+
+ db 255
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript17
+ dpikapic PikaPicAnimScript19
+ dpikapic PikaPicAnimScript20
+ dpikapic PikaPicAnimScript20
+
+StarterPikachuEmotionCommand_pikapic:
+ ldh a, [hAutoBGTransferEnabled]
+ push af
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ld a, [de]
+ ld [wPikaPicAnimNumber], a
+ inc de
+ push de
+ call .RunPikapic
+ pop de
+ pop af
+ ldh [hAutoBGTransferEnabled], a
+ ret
+
+.RunPikapic:
+ call PlacePikapicTextBoxBorder
+ callfar LoadOverworldPikachuFrontpicPalettes
+ call ResetPikaPicAnimBuffer
+ call LoadCurrentPikaPicAnimScriptPointer
+ call ExecutePikaPicAnimScript
+ call PlacePikapicTextBoxBorder
+ call RunDefaultPaletteCommand
+ ret
+
+ResetPikaPicAnimBuffer:
+ ld hl, wCurPikaMovementData
+ ld bc, wCurPikaMovementDataEnd - wCurPikaMovementData
+ xor a
+ call FillMemory
+ ld hl, wPikaPicAnimObjectDataBufferSize
+ ld bc, wPikaPicAnimObjectDataBufferEnd - wPikaPicAnimObjectDataBufferSize
+ xor a
+ call FillMemory
+ call ClearPikaPicUsedGFXBuffer
+ ld hl, 100
+ ld a, l
+ ld [wPikaPicAnimTimer], a
+ ld a, h
+ ld [wPikaPicAnimTimer + 1], a
+ ld a, $7
+ ld [wPikaPicPikaDrawStartX], a
+ ld a, $6
+ ld [wPikaPicPikaDrawStartY], a
+ ret
+
+PlacePikapicTextBoxBorder:
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ hlcoord 6, 5
+ lb bc, 5, 5
+ call TextBoxBorder
+ call Delay3
+ call UpdateSprites
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ ret
+
+LoadCurrentPikaPicAnimScriptPointer:
+ ld a, [wPikaPicAnimNumber]
+ cp $1d
+ jr c, .valid
+ ld a, $0
+.valid
+ ld e, a
+ ld d, 0
+ ld hl, PikaPicAnimPointers
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call UpdatePikaPicAnimPointer
+ ret
+
+pikapic_def: MACRO
+\1_id:
+ dw \1
+ENDM
+
+PikaPicAnimPointers:
+ pikapic_def PikaPicAnimScript0 ; 00
+ pikapic_def PikaPicAnimScript1 ; 01
+ pikapic_def PikaPicAnimScript2 ; 02
+ pikapic_def PikaPicAnimScript3 ; 03
+ pikapic_def PikaPicAnimScript4 ; 04
+ pikapic_def PikaPicAnimScript5 ; 05
+ pikapic_def PikaPicAnimScript6 ; 06
+ pikapic_def PikaPicAnimScript7 ; 07
+ pikapic_def PikaPicAnimScript8 ; 08
+ pikapic_def PikaPicAnimScript9 ; 09
+ pikapic_def PikaPicAnimScript10 ; 0a
+ pikapic_def PikaPicAnimScript11 ; 0b
+ pikapic_def PikaPicAnimScript12 ; 0c
+ pikapic_def PikaPicAnimScript13 ; 0d
+ pikapic_def PikaPicAnimScript14 ; 0e
+ pikapic_def PikaPicAnimScript15 ; 0f
+ pikapic_def PikaPicAnimScript16 ; 10
+ pikapic_def PikaPicAnimScript17 ; 11
+ pikapic_def PikaPicAnimScript18 ; 12
+ pikapic_def PikaPicAnimScript19 ; 13
+ pikapic_def PikaPicAnimScript20 ; 14
+ pikapic_def PikaPicAnimScript21 ; 15
+ pikapic_def PikaPicAnimScript22 ; 16
+ pikapic_def PikaPicAnimScript23 ; 17
+ pikapic_def PikaPicAnimScript24 ; 18
+ pikapic_def PikaPicAnimScript25 ; 19
+ pikapic_def PikaPicAnimScript26 ; 1a
+ pikapic_def PikaPicAnimScript27 ; 1b
+ pikapic_def PikaPicAnimScript28 ; 1c
+ pikapic_def PikaPicAnimScript29 ; 1d
+
+ExecutePikaPicAnimScript:
+.loop
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call RunPikaPicAnimSetupScript
+ call DummyFunction_fdad5
+ call AnimateCurrentPikaPicAnimFrame
+ call DummyFunction_fdad5
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call PikaPicAnimTimerAndJoypad
+ and a
+ jr z, .loop
+ ret
+
+PikaPicAnimTimerAndJoypad:
+ call Delay3
+ call CheckPikaPicAnimTimer
+ and a
+ ret nz
+ call JoypadLowSensitivity
+ ldh a, [hJoyPressed]
+ and A_BUTTON | B_BUTTON
+ ret
+
+CheckPikaPicAnimTimer:
+ ld hl, wPikaPicAnimTimer
+ dec [hl]
+ jr nz, .not_done_yet
+ inc hl
+ ld a, [hl]
+ and a
+ jr z, .timer_expired
+ dec [hl]
+.not_done_yet
+ xor a
+ ret
+
+.timer_expired
+ ld a, $1
+ ret
+
+DummyFunction_fdad5:
+ ret
+
+AnimateCurrentPikaPicAnimFrame:
+ ld bc, wPikaPicAnimObjectDataBuffer
+ ld a, 4
+.loop
+ push af
+ push bc
+ ld hl, 0 ; struct index
+ add hl, bc
+ ld a, [hli]
+ and a
+ jr z, .skip
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectScriptIdx], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectFrameIdx], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectFrameTimer], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectVTileOffset], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectXOffset], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObjectYOffset], a
+ ld a, [hli]
+ ld [wCurPikaPicAnimObject + 6], a
+ push bc
+ call LoadPikaPicAnimObjectData
+ pop bc
+ ld hl, 1 ; script index
+ add hl, bc
+ ld a, [wCurPikaPicAnimObjectScriptIdx]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObjectFrameIdx]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObjectFrameTimer]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObjectVTileOffset]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObjectXOffset]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObjectYOffset]
+ ld [hli], a
+ ld a, [wCurPikaPicAnimObject + 6]
+ ld [hl], a
+.skip
+ pop bc
+ ld hl, 8
+ add hl, bc
+ ld b, h
+ ld c, l
+ pop af
+ dec a
+ jr nz, .loop
+ ret
+
+PikaPicAnimCommand_object:
+ ld hl, wPikaPicAnimObjectDataBuffer
+ ld de, 8
+ ld c, 4
+.loop
+ ld a, [hl]
+ and a
+ jr z, .found
+ add hl, de
+ dec c
+ jr nz, .loop
+ scf
+ ret
+
+.found
+ ld a, [wPikaPicAnimObjectDataBufferSize]
+ inc a
+ ld [wPikaPicAnimObjectDataBufferSize], a
+ ld [hli], a
+ call GetPikaPicAnimByte
+ ld [hli], a
+ call GetPikaPicAnimByte
+ ld [hl], a
+ xor a
+ ld [hli], a ; overloads
+ ld [hli], a
+ call GetPikaPicAnimByte
+ ld [hli], a
+ call GetPikaPicAnimByte
+ ld [hli], a
+ call GetPikaPicAnimByte
+ ld [hli], a
+ and a
+ ret
+
+PikaPicAnimCommand_deleteobject:
+ call GetPikaPicAnimByte
+ ld b, a
+ ld hl, wPikaPicAnimObjectDataBuffer
+ ld de, 8
+ ld c, 4
+.search
+ ld a, [hl]
+ cp b
+ jr z, .delete
+ add hl, de
+ dec c
+ jr nz, .search
+ scf
+ ret
+
+.delete
+ xor a
+ ld [hl], a
+ ret
+
+LoadPikaPicAnimObjectData:
+.loop
+ ld a, [wCurPikaPicAnimObjectScriptIdx]
+ cp $23
+ jr c, .valid
+ ld a, $4
+.valid
+ ld e, a
+ ld d, 0
+ ld hl, PikaPicAnimBGFramesPointers
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [wCurPikaPicAnimObjectFrameIdx]
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ cp $e0
+ jr z, .end
+ jr .init
+
+.end
+ xor a
+ ld [wCurPikaPicAnimObjectFrameIdx], a
+ ld [wCurPikaPicAnimObjectFrameTimer], a
+ jr .loop
+
+.init
+ push hl
+ call LoadCurPikaPicObjectTilemap
+ pop hl
+ ld a, [hl]
+ and a
+ jr z, .not_done ; lasts forever
+ ld a, [wCurPikaPicAnimObjectFrameTimer]
+ inc a
+ ld [wCurPikaPicAnimObjectFrameTimer], a
+ cp [hl]
+ jr nz, .not_done
+ xor a
+ ld [wCurPikaPicAnimObjectFrameTimer], a
+ ld a, [wCurPikaPicAnimObjectFrameIdx]
+ inc a
+ ld [wCurPikaPicAnimObjectFrameIdx], a
+.not_done
+ ret
+
+INCLUDE "data/pikachu/pikachu_pic_objects.asm"
+
+LoadCurPikaPicObjectTilemap:
+ and a
+ ret z
+ ld e, a
+ ld d, 0
+ ld hl, PikaPicTilemapPointers
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld a, [de]
+ ld c, a
+ inc de
+ ld a, [de]
+ ld b, a
+ inc de
+ push de
+ push bc
+ call .GetStartCoords
+ pop bc
+ pop de
+.row
+ push bc
+ push hl
+ ld a, [wCurPikaPicAnimObjectVTileOffset] ; tile id offset
+ ld c, a
+.col
+ ld a, [de]
+ inc de
+ cp $ff
+ jr z, .skip
+ add c
+ ld [hl], a
+.skip
+ inc hl
+ dec b
+ jr nz, .col
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec c
+ jr nz, .row
+ ret
+
+.GetStartCoords:
+ push bc
+ ld a, [wCurPikaPicAnimObjectYOffset] ; Y offset
+ ld b, a
+ ld a, [wPikaPicPikaDrawStartY]
+ add b
+ hlcoord 0, 0
+ ld bc, SCREEN_WIDTH
+ call AddNTimes
+ ld a, [wCurPikaPicAnimObjectXOffset] ; X offset
+ ld c, a
+ ld a, [wPikaPicPikaDrawStartX]
+ add c
+ ld c, a
+ ld b, 0
+ add hl, bc
+ pop bc
+ ret
+
+INCLUDE "data/pikachu/pikachu_pic_tilemaps.asm"
+
+LoadPikaPicAnimGFXHeader:
+ push hl
+ ld e, a
+ ld d, 0
+ ld hl, PikaPicAnimGFXHeaders
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ pop hl
+ ret
+
+RunPikaPicAnimSetupScript:
+ call .CheckAndAdvanceTimer
+ ret c
+ xor a
+ ld [wPikaPicAnimPointerSetupFinished], a
+.loop
+ call GetPikaPicAnimByte
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call JumpToAddress
+ ld a, [wPikaPicAnimPointerSetupFinished]
+ and a
+ jr z, .loop
+ ret
+
+.CheckAndAdvanceTimer:
+ ld a, [wPikaPicAnimDelay]
+ and a
+ ret z
+ dec a
+ ld [wPikaPicAnimDelay], a
+ scf
+ ret
+
+.Jumptable:
+ dw PikaPicAnimCommand_nop ; 00, 0 params
+ dw PikaPicAnimCommand_writebyte ; 01, 1 param
+ dw PikaPicAnimCommand_loadgfx ; 02, 1 param
+ dw PikaPicAnimCommand_object ; 03, 5 params
+ dw PikaPicAnimCommand_nop4 ; 04, 0 params
+ dw PikaPicAnimCommand_nop5 ; 05, 0 params
+ dw PikaPicAnimCommand_deleteobject ; 06, 1 param
+ dw PikaPicAnimCommand_nop7 ; 07, 0 params
+ dw PikaPicAnimCommand_nop8 ; 08, 0 params
+ dw PikaPicAnimCommand_jump ; 09, 1 dw param
+ dw PikaPicAnimCommand_setduration ; 0a, 1 dw param
+ dw PikaPicAnimCommand_cry ; 0b, 1 param
+ dw PikaPicAnimCommand_thunderbolt ; 0c, 0 params
+ dw PikaPicAnimCommand_run ; 0d, 0 params (ret)
+ dw PikaPicAnimCommand_ret ; 0e, 0 params (ret)
+
+PikaPicAnimCommand_nop:
+ ret
+
+PikaPicAnimCommand_ret:
+ ld a, 1
+ ld [wPikaPicAnimTimer], a
+ xor a
+ ld [wPikaPicAnimTimer + 1], a
+ jr PikaPicAnimCommand_run
+
+; XXX
+ ret
+
+PikaPicAnimCommand_setduration:
+ call GetPikaPicAnimByte
+ ld [wPikaPicAnimTimer], a
+ call GetPikaPicAnimByte
+ ld [wPikaPicAnimTimer + 1], a
+ ret
+
+PikaPicAnimCommand_run:
+ ld a, $ff
+ ld [wPikaPicAnimPointerSetupFinished], a
+ ret
+
+PikaPicAnimCommand_writebyte:
+ call GetPikaPicAnimByte
+ ld [wPikaPicAnimDelay], a
+ ret
+
+PikaPicAnimCommand_nop4:
+PikaPicAnimCommand_nop5:
+PikaPicAnimCommand_nop7:
+PikaPicAnimCommand_nop8:
+ ret
+
+PikaPicAnimCommand_jump:
+ call GetPikaPicAnimByte
+ ld l, a
+ call GetPikaPicAnimByte
+ ld h, a
+ call UpdatePikaPicAnimPointer
+ ret
+
+GetPikaPicAnimByte:
+ push hl
+ ld hl, wPikaPicAnimPointer
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [hli]
+ call UpdatePikaPicAnimPointer
+ pop hl
+ ret
+
+UpdatePikaPicAnimPointer:
+ push af
+ ld a, l
+ ld [wPikaPicAnimPointer], a
+ ld a, h
+ ld [wPikaPicAnimPointer + 1], a
+ pop af
+ ret
+
+PikaPicAnimCommand_loadgfx:
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ ldh a, [hAutoBGTransferEnabled]
+ push af
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ ldh a, [hTileAnimations]
+ push af
+ xor a
+ ldh [hTileAnimations], a
+ call GetPikaPicAnimByte
+ ld [wPikaPicAnimCurGraphicID], a
+ ld a, [wPikaPicAnimCurGraphicID]
+ call LoadPikaPicAnimGFXHeader
+ ld a, c
+ cp $ff
+ jr z, .compressed
+ call RequestPikaPicAnimGFX
+ jr .done
+
+.compressed
+ call DecompressRequestPikaPicAnimGFX
+.done
+ pop af
+ ldh [hTileAnimations], a
+ pop af
+ ldh [hAutoBGTransferEnabled], a
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ ret
+
+RequestPikaPicAnimGFX:
+ push de
+ ld a, [wPikaPicAnimCurGraphicID]
+ ld d, a
+ ld e, c
+ call CheckIfThereIsRoomForPikaPicAnimGFX
+ pop de
+ jr c, .failed
+ call GetPikaPicVRAMAddressForNewGFX
+ call CopyVideoDataAlternate
+ and a
+.failed
+ ret
+
+DecompressRequestPikaPicAnimGFX:
+ push de
+ ld a, [wPikaPicAnimCurGraphicID]
+ ld d, a
+ ld e, 5 * 5
+ call CheckIfThereIsRoomForPikaPicAnimGFX
+ pop de
+ jr c, .failed
+ ld a, b
+ call UncompressSpriteFromDE
+ ld a, BANK(sSpriteBuffer1)
+ call SwitchSRAMBankAndLatchClockData
+ ld hl, sSpriteBuffer1
+ ld de, sSpriteBuffer0
+ ld bc, SPRITEBUFFERSIZE * 2
+ call CopyData
+ call PrepareRTCDataAndDisableSRAM
+ ld a, [wPikaPicAnimCurGraphicID]
+ call LookUpTileOffsetForCurrentPikaPicAnimGFX
+ call GetPikaPicVRAMAddressForNewGFX
+ ld d, h
+ ld e, l
+ call InterlaceMergeSpriteBuffers
+.failed
+ ret
+
+ClearPikaPicUsedGFXBuffer:
+ ld hl, wPikaPicUsedGFXCount
+ ld bc, wPikaPicUsedGFXEnd - wPikaPicUsedGFXCount
+ xor a
+ call FillMemory
+ ret
+
+GetPikaPicVRAMAddressForNewGFX:
+ ld hl, vNPCSprites
+ push bc
+ ld b, a
+ and $f
+ swap a
+ ld c, a
+ ld a, b
+ and $f0
+ swap a
+ ld b, a
+ add hl, bc
+ pop bc
+ ret
+
+CheckIfThereIsRoomForPikaPicAnimGFX:
+; d: idx
+; e: size
+; FATAL: If the graphic has already been loaded, or if there are
+; already 8 graphics objects loaded, the game will execute arbitrary
+; code.
+ push bc
+ push hl
+ ld hl, wPikaPicUsedGFX
+ ld c, 8
+.loop
+ ld a, [hl]
+ and a
+ jr z, .empty
+ cp d
+ jr z, .found
+ inc hl
+ inc hl
+ dec c
+ jr nz, .loop
+ scf
+ ret ; execute hl, then bc
+
+.found
+ inc hl
+ ld a, [hl]
+ ret ; execute hl, then bc
+
+.empty
+ ld [hl], d
+ inc hl
+ ld a, [wPikaPicUsedGFXCount]
+ add $80
+ ld [hl], a
+ ld a, [wPikaPicUsedGFXCount]
+ add e
+ ld [wPikaPicUsedGFXCount], a
+ cp $80
+ jr z, .okay
+ jr nc, .failed
+.okay
+ ld a, [hl]
+ and a
+ jr .pop_ret
+
+.failed
+ scf
+.pop_ret
+ pop hl
+ pop bc
+ ret
+
+LookUpTileOffsetForCurrentPikaPicAnimGFX:
+ push bc
+ push hl
+ ld b, a
+ ld hl, wPikaPicUsedGFX
+ ld c, 8
+.loop
+ ld a, [hli]
+ cp b
+ jr z, .found
+ inc hl
+ dec c
+ jr nz, .loop
+ scf
+ jr .pop_ret
+
+.found
+ ld a, [hl]
+ and a
+.pop_ret
+ pop hl
+ pop bc
+ ret
+
+PikaPicAnimCommand_cry:
+ call GetPikaPicAnimByte
+ cp $ff
+ ret z
+ ld e, a
+ callfar PlayPikachuSoundClip
+ ret
+
+PikaPicAnimCommand_thunderbolt:
+ ld a, $1
+ ld [wMuteAudioAndPauseMusic], a
+ call DelayFrame
+ ld a, [wAudioROMBank]
+ push af
+ ld a, BANK(SFX_Battle_2F)
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ call .LoadAudio
+ call PlaySound
+ call .FlashScreen
+ call WaitForSoundToFinish
+ pop af
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ xor a
+ ld [wMuteAudioAndPauseMusic], a
+ ret
+
+.LoadAudio:
+ ld hl, MoveSoundTable
+ ld e, THUNDERBOLT
+ ld d, 0
+ add hl, de
+ add hl, de
+ add hl, de
+ ld a, BANK(MoveSoundTable)
+ call GetFarByte
+ ld b, a
+ inc hl
+ ld a, BANK(MoveSoundTable)
+ call GetFarByte
+ inc hl
+ ld [wFrequencyModifier], a
+ ld a, BANK(MoveSoundTable)
+ call GetFarByte
+ ld [wTempoModifier], a
+ ld a, b
+ ret
+
+.FlashScreen:
+ ld hl, PikaPicAnimThunderboltPals
+.loop
+ ld a, [hli]
+ cp $ff
+ ret z
+ ld c, a
+ ld b, [hl]
+ inc hl
+ push hl
+ call .UpdatePal
+ pop hl
+ jr .loop
+
+.UpdatePal:
+ ld a, b
+ ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ call DelayFrames
+ ret
+
+INCLUDE "data/pikachu/pikachu_pic_animation.asm"
diff --git a/engine/pikachu/pikachu_status.asm b/engine/pikachu/pikachu_status.asm
new file mode 100644
index 00000000..5fc92ead
--- /dev/null
+++ b/engine/pikachu/pikachu_status.asm
@@ -0,0 +1,258 @@
+IsStarterPikachuInOurParty::
+ ld hl, wPartySpecies
+ ld de, wPartyMon1OTID
+ ld bc, wPartyMonOT
+ push hl
+.loop
+ pop hl
+ ld a, [hli]
+ push hl
+ inc a
+ jr z, .noPlayerPikachu
+ cp STARTER_PIKACHU + 1
+ jr nz, .curMonNotPlayerPikachu
+ ld h, d
+ ld l, e
+ ld a, [wPlayerID]
+ cp [hl]
+ jr nz, .curMonNotPlayerPikachu
+ inc hl
+ ld a, [wPlayerID+1]
+ cp [hl]
+ jr nz, .curMonNotPlayerPikachu
+ push de
+ push bc
+ ld hl, wPlayerName
+ ld d, $6 ; possible player length - 1
+.nameCompareLoop
+ dec d
+ jr z, .sameOT
+ ld a, [bc]
+ inc bc
+ cp [hl]
+ inc hl
+ jr z, .nameCompareLoop
+ pop bc
+ pop de
+.curMonNotPlayerPikachu
+ ld hl, wPartyMon2 - wPartyMon1
+ add hl, de
+ ld d, h
+ ld e, l
+ ld hl, NAME_LENGTH
+ add hl, bc
+ ld b, h
+ ld c, l
+ jr .loop
+
+.sameOT
+ pop bc
+ pop de
+ ld h, d
+ ld l, e
+ ld bc, -NAME_LENGTH
+ add hl, bc
+ ld a, [hli]
+ or [hl]
+ jr z, .noPlayerPikachu ; XXX how is this determined?
+ pop hl
+ scf
+ ret
+
+.noPlayerPikachu
+ pop hl
+ and a
+ ret
+
+IsThisPartymonStarterPikachu_Box::
+ ld hl, wBoxMon1
+ ld bc, wBoxMon2 - wBoxMon1
+ ld de, wBoxMonOT
+ jr asm_fce21
+
+IsThisPartymonStarterPikachu_Party::
+IsThisPartymonStarterPikachu::
+ ld hl, wPartyMon1
+ ld bc, wPartyMon2 - wPartyMon1
+ ld de, wPartyMonOT
+asm_fce21:
+ ld a, [wWhichPokemon]
+ call AddNTimes
+ ld a, [hl]
+ cp STARTER_PIKACHU
+ jr nz, .notPlayerPikachu
+ ld bc, wPartyMon1OTID - wPartyMon1
+ add hl, bc
+ ld a, [wPlayerID]
+ cp [hl]
+ jr nz, .notPlayerPikachu
+ inc hl
+ ld a, [wPlayerID+1]
+ cp [hl]
+ jr nz, .notPlayerPikachu
+ ld h, d
+ ld l, e
+ ld a, [wWhichPokemon]
+ ld bc, NAME_LENGTH
+ call AddNTimes
+ ld de, wPlayerName
+ ld b, $6
+.loop
+ dec b
+ jr z, .isPlayerPikachu
+ ld a, [de]
+ inc de
+ cp [hl]
+ inc hl
+ jr z, .loop
+.notPlayerPikachu
+ and a
+ ret
+
+.isPlayerPikachu
+ scf
+ ret
+
+UpdatePikachuMoodAfterBattle::
+; because d is always $82 at this function, it serves to
+; ensure Pikachu's mood is at least 130 after battle
+ push de
+ call IsStarterPikachuInOurParty
+ pop de
+ ret nc
+ ld a, d
+ cp 128
+ ld a, [wPikachuMood]
+ jr c, .d_less_than_128 ; we never jump
+ cp d
+ jr c, .load_d_into_mood
+ ret
+
+.d_less_than_128
+ cp d
+ ret c
+.load_d_into_mood
+ ld a, d
+ ld [wPikachuMood], a
+ ret
+
+CheckPikachuFaintedOrStatused::
+; function to test if Pikachu is alive?
+ xor a
+ ld [wWhichPokemon], a
+ ld hl, wPartyCount
+.loop
+ inc hl
+ ld a, [hl]
+ cp $ff
+ jr z, .dead_or_not_in_party
+ push hl
+ call IsThisPartymonStarterPikachu_Party
+ pop hl
+ jr nc, .next
+ ld a, [wWhichPokemon]
+ ld hl, wPartyMon1HP
+ ld bc, wPartyMon2 - wPartyMon1
+ call AddNTimes
+ ld a, [hli]
+ or [hl]
+ ld d, a
+ inc hl
+ inc hl
+ ld a, [hl] ; status
+ and a
+ jr nz, .alive
+ jr .dead_or_not_in_party
+
+.next
+ ld a, [wWhichPokemon]
+ inc a
+ ld [wWhichPokemon], a
+ jr .loop
+
+.alive
+ scf
+ ret
+
+.dead_or_not_in_party
+ and a
+ ret
+
+IsSurfingPikachuInThePlayersParty::
+ ld hl, wPartySpecies
+ ld de, wPartyMon1Moves
+ ld bc, wPartyMonOT
+ push hl
+.loop
+ pop hl
+ ld a, [hli]
+ push hl
+ inc a
+ jr z, .noSurfingPlayerPikachu
+ cp STARTER_PIKACHU + 1
+ jr nz, .curMonNotSurfingPlayerPikachu
+ ld h, d
+ ld l, e
+ push hl
+ push bc
+ ld b, NUM_MOVES
+.moveSearchLoop
+ ld a, [hli]
+ cp SURF
+ jr z, .foundSurfingPikachu
+ dec b
+ jr nz, .moveSearchLoop
+ pop bc
+ pop hl
+ jr .curMonNotSurfingPlayerPikachu
+
+.foundSurfingPikachu
+ pop bc
+ pop hl
+ inc hl
+ inc hl
+ inc hl
+ inc hl
+ ld a, [wPlayerID]
+ cp [hl]
+ jr nz, .curMonNotSurfingPlayerPikachu
+ inc hl
+ ld a, [wPlayerID+1]
+ cp [hl]
+ jr nz, .curMonNotSurfingPlayerPikachu
+ push de
+ push bc
+ ld hl, wPlayerName
+ ld d, $6
+.nameCompareLoop
+ dec d
+ jr z, .foundSurfingPlayerPikachu
+ ld a, [bc]
+ inc bc
+ cp [hl]
+ inc hl
+ jr z, .nameCompareLoop
+ pop bc
+ pop de
+.curMonNotSurfingPlayerPikachu
+ ld hl, wPartyMon2 - wPartyMon1
+ add hl, de
+ ld d, h
+ ld e, l
+ ld hl, NAME_LENGTH
+ add hl, bc
+ ld b, h
+ ld c, l
+ jr .loop
+
+.foundSurfingPlayerPikachu
+ pop bc
+ pop de
+ pop hl
+ scf
+ ret
+
+.noSurfingPlayerPikachu
+ pop hl
+ and a
+ ret
diff --git a/engine/pikachu/respawn_overworld_pikachu.asm b/engine/pikachu/respawn_overworld_pikachu.asm
new file mode 100644
index 00000000..4b610085
--- /dev/null
+++ b/engine/pikachu/respawn_overworld_pikachu.asm
@@ -0,0 +1,6 @@
+RespawnOverworldPikachu:
+ callfar IsThisPartymonStarterPikachu_Party
+ ret nc
+ ld a, $3
+ ld [wPikachuSpawnState], a
+ ret
diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm
index 611aebf4..c498f02a 100644
--- a/engine/pokemon/add_mon.asm
+++ b/engine/pokemon/add_mon.asm
@@ -170,6 +170,12 @@ _AddPartyMon::
inc de
ld a, [hli] ; catch rate (held item in gen 2)
ld [de], a
+ ld a, [wcf91]
+ cp KADABRA
+ jr nz, .notKadabra
+ ld a, TWISTEDSPOON_GSC
+ ld [de], a
+.notKadabra
ld hl, wMonHMoves
ld a, [hli]
inc de
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index 7aba8001..13ad1b20 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -11,18 +11,15 @@ DisplayPCMainMenu::
and a
jr nz, .leaguePCAvailable
hlcoord 0, 0
- ld b, 8
- ld c, 14
+ lb bc, 8, 14
jr .next
.noOaksPC
hlcoord 0, 0
- ld b, 6
- ld c, 14
+ lb bc, 6, 14
jr .next
.leaguePCAvailable
hlcoord 0, 0
- ld b, 10
- ld c, 14
+ lb bc, 10, 14
.next
call TextBoxBorder
call UpdateSprites
@@ -119,10 +116,13 @@ BillsPCMenu:
lb bc, BANK(PokeballTileGraphics), 1
call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer
+ hlcoord 0, 12
+ lb bc, 4, 18
+ call TextBoxBorder
hlcoord 0, 0
- ld b, 10
- ld c, 12
+ lb bc, 12, 12
call TextBoxBorder
+ call UpdateSprites
hlcoord 2, 2
ld de, BillsPCMenuText
call PlaceString
@@ -133,7 +133,7 @@ BillsPCMenu:
ld [hli], a ; wTopMenuItemX
inc hl
inc hl
- ld a, 4
+ ld a, 5
ld [hli], a ; wMaxMenuItem
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
@@ -144,11 +144,8 @@ BillsPCMenu:
ld [hli], a ; wListScrollOffset
ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a
- ld hl, WhatText
- call PrintText
hlcoord 9, 14
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
ld a, [wCurrentBoxNum]
and $7f
@@ -184,6 +181,8 @@ BillsPCMenu:
jp z, BillsPCRelease ; release
cp $3
jp z, BillsPCChangeBox ; change box
+ cp $4
+ jp z, BillsPCPrintBox
ExitBillsPC:
ld a, [wFlags_0xcd60]
@@ -204,6 +203,10 @@ ExitBillsPC:
res 6, [hl]
ret
+BillsPCPrintBox:
+ callfar PrintPCBox
+ jp BillsPCMenu
+
BillsPCDeposit:
ld a, [wPartyCount]
dec a
@@ -222,11 +225,26 @@ BillsPCDeposit:
ld hl, wPartyCount
call DisplayMonListMenu
jp c, BillsPCMenu
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_215ad
+ call CheckPikachuFollowingPlayer
+ jr z, .asm_215ad
+ ld hl, SleepingPikachuText2
+ call PrintText
+ jp BillsPCMenu
+.asm_215ad
call DisplayDepositWithdrawMenu
jp nc, BillsPCMenu
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_215c9
+ ld e, $1b
+ callfar PlayPikachuSoundClip
+ jr .asm_215cf
+.asm_215c9
ld a, [wcf91]
- call GetCryData
- call PlaySoundWaitForCurrent
+ call PlayCry
+.asm_215cf
+ callabd_ModifyPikachuHappiness PIKAHAPPY_DEPOSITED
ld a, PARTY_TO_BOX
ld [wMoveMonType], a
call MoveMon
@@ -253,6 +271,10 @@ BillsPCDeposit:
call PrintText
jp BillsPCMenu
+SleepingPikachuText2:
+ text_far _SleepingPikachuText2
+ text_end
+
BillsPCWithdraw:
ld a, [wBoxCount]
and a
@@ -276,9 +298,15 @@ BillsPCWithdraw:
ld a, [wWhichPokemon]
ld hl, wBoxMonNicks
call GetPartyMonName
+ callfar IsThisPartymonStarterPikachu_Box
+ jr nc, .asm_21660
+ ld e, $22
+ callfar PlayPikachuSoundClip
+ jr .asm_21666
+.asm_21660
ld a, [wcf91]
- call GetCryData
- call PlaySoundWaitForCurrent
+ call PlayCry
+.asm_21666
xor a ; BOX_TO_PARTY
ld [wMoveMonType], a
call MoveMon
@@ -301,6 +329,8 @@ BillsPCRelease:
ld hl, wBoxCount
call DisplayMonListMenu
jp c, BillsPCMenu
+ callfar IsThisPartymonStarterPikachu_Box
+ jr c, .asm_216cb
ld hl, OnceReleasedText
call PrintText
call YesNoChoice
@@ -317,6 +347,16 @@ BillsPCRelease:
call PrintText
jp BillsPCMenu
+.asm_216cb
+ ld a, [wWhichPokemon]
+ ld hl, wBoxMonNicks
+ call GetPartyMonName
+ ld e, $27
+ callfar PlayPikachuSoundClip
+ ld hl, PikachuUnhappyText
+ call PrintText
+ jp BillsPCMenu
+
BillsPCChangeBox:
farcall ChangeBox
jp BillsPCMenu
@@ -343,6 +383,7 @@ BillsPCMenuText:
next "DEPOSIT <PKMN>"
next "RELEASE <PKMN>"
next "CHANGE BOX"
+ next "PRINT BOX"
next "SEE YA!"
db "@"
@@ -381,8 +422,7 @@ INCLUDE "data/moves/hm_moves.asm"
DisplayDepositWithdrawMenu:
hlcoord 9, 10
- ld b, 6
- ld c, 9
+ lb bc, 6, 9
call TextBoxBorder
ld a, [wParentMenuItem]
and a ; was the Deposit or Withdraw item selected in the parent menu?
@@ -488,6 +528,10 @@ CantTakeMonText:
text_far _CantTakeMonText
text_end
+PikachuUnhappyText:
+ text_far _PikachuUnhappyText
+ text_end
+
ReleaseWhichMonText:
text_far _ReleaseWhichMonText
text_end
diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm
index 7d5fd469..165ae02d 100644
--- a/engine/pokemon/evos_moves.asm
+++ b/engine/pokemon/evos_moves.asm
@@ -1,5 +1,6 @@
; try to evolve the mon in [wWhichPokemon]
TryEvolvingMon:
+EvolveTradeMon:
ld hl, wCanEvolveFlags
xor a
ld [hl], a
@@ -93,9 +94,13 @@ Evolution_PartyMonLoop: ; loop over party mons
jp c, Evolution_PartyMonLoop ; if so, go the next mon
jr .doEvolution
.checkItemEvo
+ ld a, [wIsInBattle] ; are we in battle?
+ and a
ld a, [hli]
+ jp nz, .nextEvoEntry1 ; don't evolve if we're in a battle as wcf91 could be holding the last mon sent out
+
ld b, a ; evolution item
- ld a, [wcf91] ; this is supposed to be the last item used, but it is also used to hold species numbers
+ ld a, [wcf91] ; last item used
cp b ; was the evolution item in this entry used?
jp nz, .nextEvoEntry1 ; if not, go to the next evolution entry
.checkLevel
@@ -140,7 +145,7 @@ Evolution_PartyMonLoop: ; loop over party mons
ld [wEvoNewSpecies], a
ld a, MONSTER_NAME
ld [wNameListType], a
- ld a, BANK(TrainerNames) ; bank is not used for monster names
+ ld a, BANK(MonsterNames) ; bank is not used for monster names
ld [wPredefBank], a
call GetName
push hl
@@ -318,23 +323,9 @@ Evolution_ReloadTilesetTilePatterns:
jp ReloadTilesetTilePatterns
LearnMoveFromLevelUp:
- ld hl, EvosMovesPointerTable
ld a, [wd11e] ; species
ld [wcf91], a
- dec a
- ld bc, 0
- ld hl, EvosMovesPointerTable
- add a
- rl b
- ld c, a
- add hl, bc
- ld a, [hli]
- ld h, [hl]
- ld l, a
-.skipEvolutionDataLoop ; loop to skip past the evolution data, which comes before the move data
- ld a, [hli]
- and a ; have we reached the end of the evolution data?
- jr nz, .skipEvolutionDataLoop ; if not, jump back up
+ call GetMonLearnset
.learnSetLoop ; loop over the learn set until we reach a move that is learnt at the current level or the end of the list
ld a, [hli]
and a ; have we reached the end of the learn set?
@@ -370,33 +361,147 @@ LearnMoveFromLevelUp:
call GetMoveName
call CopyStringToCF4B
predef LearnMove
+ ld a, b
+ and a
+ jr z, .done
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .done
+ ld a, [wMoveNum]
+ cp THUNDERBOLT
+ jr z, .foundThunderOrThunderbolt
+ cp THUNDER
+ jr nz, .done
+.foundThunderOrThunderbolt
+ ld a, $5
+ ld [wd49c], a
+ ld a, $85
+ ld [wPikachuMood], a
.done
ld a, [wcf91]
ld [wd11e], a
ret
-; writes the moves a mon has at level [wCurEnemyLVL] to [de]
-; move slots are being filled up sequentially and shifted if all slots are full
-WriteMonMoves:
- call GetPredefRegisters
- push hl
- push de
- push bc
+Func_3b079:
+ ld a, [wcf91]
+ push af
+ call Func_3b0a2
+ jr c, .asm_3b09c
+
+ call Func_3b10f
+ jr nc, .asm_3b096
+
+ call Func_3b0a2
+ jr c, .asm_3b09c
+
+ call Func_3b10f
+ jr nc, .asm_3b096
+
+ call Func_3b0a2
+ jr c, .asm_3b09c
+.asm_3b096
+ pop af
+ ld [wcf91], a
+ and a
+ ret
+.asm_3b09c
+ pop af
+ ld [wcf91], a
+ scf
+ ret
+
+Func_3b0a2:
+; XXX what is wcf91 entering this function?
+ ld a, [wd11e]
+ ld [wMoveNum], a
+ predef CanLearnTM
+ ld a, c
+ and a
+ jr nz, .asm_3b0ec
+ ld hl, Pointer_3b0ee
+ ld a, [wcf91]
+ ld de, $1
+ call IsInArray
+ jr c, .asm_3b0d2
+ ld a, $ff
+ ld [wMonHGrowthRate], a
+ ld a, [wd11e]
+ ld hl, wMonHMoves
+ ld de, $1
+ call IsInArray
+ jr c, .asm_3b0ec
+.asm_3b0d2
+ ld a, [wd11e]
+ ld d, a
+ call GetMonLearnset
+.loop
+ ld a, [hli]
+ and a
+ jr z, .asm_3b0ea
+ ld b, a
+ ld a, [wCurEnemyLVL]
+ cp b
+ jr c, .asm_3b0ea
+ ld a, [hli]
+ cp d
+ jr z, .asm_3b0ec
+ jr .loop
+.asm_3b0ea
+ and a
+ ret
+.asm_3b0ec
+ scf
+ ret
+
+INCLUDE "data/pokemon/unknown_list.asm"
+
+Func_3b10f:
+ ld c, $0
+.asm_3b111
ld hl, EvosMovesPointerTable
- ld b, 0
- ld a, [wcf91] ; cur mon ID
- dec a
- add a
- rl b
- ld c, a
+ ld b, $0
+ add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
-.skipEvoEntriesLoop
+.asm_3b11b
ld a, [hli]
and a
- jr nz, .skipEvoEntriesLoop
+ jr z, .asm_3b130
+ cp $2
+ jr nz, .asm_3b124
+ inc hl
+.asm_3b124
+ inc hl
+ ld a, [wcf91]
+ cp [hl]
+ jr z, .asm_3b138
+ inc hl
+ ld a, [hl]
+ and a
+ jr nz, .asm_3b11b
+.asm_3b130
+ inc c
+ ld a, c
+ cp VICTREEBEL
+ jr c, .asm_3b111
+ and a
+ ret
+.asm_3b138
+ inc c
+ ld a, c
+ ld [wcf91], a
+ scf
+ ret
+
+; writes the moves a mon has at level [wCurEnemyLVL] to [de]
+; move slots are being filled up sequentially and shifted if all slots are full
+WriteMonMoves:
+ call GetPredefRegisters
+ push hl
+ push de
+ push bc
+ call GetMonLearnset
jr .firstMove
.nextMove
pop de
@@ -510,4 +615,21 @@ WriteMonMoves_ShiftMoveData:
Evolution_FlagAction:
predef_jump FlagActionPredef
+GetMonLearnset:
+ ld hl, EvosMovesPointerTable
+ ld b, 0
+ ld a, [wcf91]
+ dec a
+ ld c, a
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+.skipEvolutionDataLoop ; loop to skip past the evolution data, which comes before the move data
+ ld a, [hli]
+ and a ; have we reached the end of the evolution data?
+ jr nz, .skipEvolutionDataLoop ; if not, jump back up
+ ret
+
INCLUDE "data/pokemon/evos_moves.asm"
diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm
index fd92ec57..9f4ac2d2 100644
--- a/engine/pokemon/learn_move.asm
+++ b/engine/pokemon/learn_move.asm
@@ -121,8 +121,7 @@ TryingToLearn:
ld hl, WhichMoveToForgetText
call PrintText
hlcoord 4, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
hlcoord 6, 8
ld de, wMovesString
@@ -206,11 +205,36 @@ TryingToLearnText:
text_end
OneTwoAndText:
+; bugfix: In Red/Blue, the SFX_SWAP sound was played in the wrong bank, which played an incorrect sound
+; Yellow has fixed this by swapping to the correct bank
text_far _OneTwoAndText
text_pause
text_asm
+ push af
+ push bc
+ push de
+ push hl
+ ld a, $1
+ ld [wMuteAudioAndPauseMusic], a
+ call DelayFrame
+ ld a, [wAudioROMBank]
+ push af
+ ld a, BANK(SFX_Swap_1)
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ call WaitForSoundToFinish
ld a, SFX_SWAP
- call PlaySoundWaitForCurrent
+ call PlaySound
+ call WaitForSoundToFinish
+ pop af
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ xor a
+ ld [wMuteAudioAndPauseMusic], a
+ pop hl
+ pop de
+ pop bc
+ pop af
ld hl, PoofText
ret
diff --git a/engine/pokemon/load_mon_data.asm b/engine/pokemon/load_mon_data.asm
index c5e2041a..3d9417a7 100644
--- a/engine/pokemon/load_mon_data.asm
+++ b/engine/pokemon/load_mon_data.asm
@@ -15,7 +15,7 @@ LoadMonData_::
ld a, [wWhichPokemon]
ld e, a
- callfar GetMonSpecies
+ call GetMonSpecies
.GetMonHeader
ld a, [wcf91]
@@ -47,3 +47,22 @@ LoadMonData_::
ld de, wLoadedMon
ld bc, wPartyMon2 - wPartyMon1
jp CopyData
+
+; get species of mon e in list [wMonDataLocation] for LoadMonData
+GetMonSpecies:
+ ld hl, wPartySpecies
+ ld a, [wMonDataLocation]
+ and a
+ jr z, .getSpecies
+ dec a
+ jr z, .enemyParty
+ ld hl, wBoxSpecies
+ jr .getSpecies
+.enemyParty
+ ld hl, wEnemyPartySpecies
+.getSpecies
+ ld d, 0
+ add hl, de
+ ld a, [hl]
+ ld [wcf91], a
+ ret
diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm
index ac03514a..0adfc217 100644
--- a/engine/pokemon/status_screen.asm
+++ b/engine/pokemon/status_screen.asm
@@ -170,8 +170,25 @@ StatusScreen:
call GBPalNormal
hlcoord 1, 0
call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture
+ ld a, [wMonDataLocation]
+ cp ENEMY_PARTY_DATA
+ jr z, .playRegularCry
+ cp BOX_DATA
+ jr z, .checkBoxData
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .playRegularCry
+ jr .playPikachuSoundClip
+.checkBoxData
+ callfar IsThisPartymonStarterPikachu_Box
+ jr nc, .playRegularCry
+.playPikachuSoundClip
+ ld e, 16
+ callfar PlayPikachuSoundClip
+ jr .continue
+.playRegularCry
ld a, [wcf91]
call PlayCry ; play Pokémon cry
+.continue
call WaitForTextScrollButtonPress ; wait for button
pop af
ldh [hTileAnimations], a
@@ -251,16 +268,14 @@ PrintStatsBox:
and a ; a is 0 from the status screen
jr nz, .DifferentBox
hlcoord 0, 8
- ld b, 8
- ld c, 8
+ lb bc, 8, 8
call TextBoxBorder ; Draws the box
hlcoord 1, 9 ; Start printing stats from here
ld bc, $19 ; Number offset
jr .PrintStats
.DifferentBox
hlcoord 9, 2
- ld b, 8
- ld c, 9
+ lb bc, 8, 9
call TextBoxBorder
hlcoord 11, 3
ld bc, $18
@@ -315,8 +330,7 @@ StatusScreen2:
hlcoord 19, 3
ld [hl], $78
hlcoord 0, 8
- ld b, 8
- ld c, 18
+ lb bc, 8, 18
call TextBoxBorder ; Draw move container
hlcoord 2, 9
ld de, wMovesString
diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm
new file mode 100644
index 00000000..18bb18a6
--- /dev/null
+++ b/engine/printer/printer.asm
@@ -0,0 +1,986 @@
+PrintPokedexEntry:
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ldh [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call Printer_GetDexEntryRegisters
+ call Printer_StartTransmission
+ ld a, [wPrinterPokedexMonIsOwned]
+ and a
+ jr z, .not_caught
+ ld a, 16
+ jr .got_size
+
+.not_caught
+ ld a, 19
+.got_size
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call ClearScreen
+ callfar Pokedex_DrawInterface
+ callfar Pokedex_PlacePokemonList
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call .TryPrintPage
+ jr c, .finish_printing
+ ld a, [wPrinterPokedexMonIsOwned]
+ and a
+ jr z, .finish_printing
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld c, $c
+ call DelayFrames
+ call SaveScreenTilesToBuffer1
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call Printer_PrepareDexEntryForPrinting
+ ld a, $7
+ call Printer_StartTransmission
+ ld a, $3
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call .TryPrintPage
+.finish_printing
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ ret
+
+.TryPrintPage:
+ call Printer_ResetJoypadHRAM
+.print_loop
+ call JoypadLowSensitivity
+ call Printer_CheckPressingB
+ jr c, .pressed_b
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .completed
+ call PrinterTransmissionJumptable
+ call GBPrinter_CheckForErrors
+ call GBPrinter_UpdateStatusMessage
+ call DelayFrame
+ jr .print_loop
+
+.completed
+ and a
+ ret
+
+.pressed_b
+ scf
+ ret
+
+Printer_GetDexEntryRegisters:
+ callfar DrawDexEntryOnScreen
+ ld a, l
+ ld [wPrinterPokedexEntryTextPointer], a
+ ld a, h
+ ld [wPrinterPokedexEntryTextPointer + 1], a
+ ld a, $0
+ rla ; copy carry flag state to bit 0
+ ld [wPrinterPokedexMonIsOwned], a
+ and a
+ jr z, .not_caught
+ ld a, $5
+ jr .got_num_rows
+
+.not_caught
+ ld a, $9
+.got_num_rows
+ ret
+
+Printer_PrepareDexEntryForPrinting:
+ call ClearScreen
+ callfar Pokedex_PrepareDexEntryForPrinting
+ ret
+
+PrintSurfingMinigameHighScore::
+ xor a
+ ldh [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call Printer_PrepareSurfingMinigameHighScoreTileMap
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ call StartTransmission_Send9Rows
+ ld a, $13
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call Printer_ResetJoypadHRAM
+.loop
+ call JoypadLowSensitivity
+ call Printer_CheckPressingB
+ jr c, .quit
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .quit
+ call PrinterTransmissionJumptable
+ call GBPrinter_CheckForErrors
+ call GBPrinter_UpdateStatusMessage
+ call DelayFrame
+ jr .loop
+
+.quit
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ call Printer_CopyTileMapFromPrinterTileBuffer
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ ret
+
+PrintDiploma::
+ xor a
+ ldh [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call _DisplayDiploma
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ call StartTransmission_Send9Rows
+ ld a, $10
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call Func_e8d11
+ jr c, .asm_e8cfa
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld c, $c
+ call DelayFrames
+ call SaveScreenTilesToBuffer1
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call Func_e9ad3
+ call StartTransmission_Send9Rows
+ ld a, $3
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ call Func_e8d11
+.asm_e8cfa
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ call Printer_CopyTileMapFromPrinterTileBuffer
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ ret
+
+Func_e8d11:
+ call Printer_ResetJoypadHRAM
+.asm_e8d14
+ call JoypadLowSensitivity
+ call Printer_CheckPressingB
+ jr c, .asm_e8d33
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .asm_e8d31
+ call PrinterTransmissionJumptable
+ call GBPrinter_CheckForErrors
+ call GBPrinter_UpdateStatusMessage
+ call DelayFrame
+ jr .asm_e8d14
+
+.asm_e8d31
+ and a
+ ret
+
+.asm_e8d33
+ scf
+ ret
+
+PrintPCBox::
+ ld a, [wBoxDataStart]
+ and a
+ jp z, Func_e8df4
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ldh [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ call SaveScreenTilesToBuffer1
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call PrintPCBox_DrawPage1
+ call StartTransmission_Send9Rows
+ ld a, $10
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ call Func_e8dfb
+ jr c, .asm_e8ddc
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld c, 12
+ call DelayFrames
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call PrintPCBox_DrawPage2
+ call StartTransmission_Send9Rows
+ ld a, $0
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ call Func_e8dfb
+ jr c, .asm_e8ddc
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld c, 12
+ call DelayFrames
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call PrintPCBox_DrawPage3
+ call StartTransmission_Send9Rows
+ ld a, $0
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ call Func_e8dfb
+ jr c, .asm_e8ddc
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld c, 12
+ call DelayFrames
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ call PrintPCBox_DrawPage4
+ call StartTransmission_Send9Rows
+ ld a, $3
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call LoadScreenTilesFromBuffer1
+ call Func_e8dfb
+.asm_e8ddc
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ ret
+
+Func_e8df4:
+ ld hl, String_e8e1f
+ call PrintText
+ ret
+
+Func_e8dfb:
+ call Printer_ResetJoypadHRAM
+.asm_e8dfe
+ call JoypadLowSensitivity
+ call Printer_CheckPressingB
+ jr c, .asm_e8e1d
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .asm_e8e1b
+ call PrinterTransmissionJumptable
+ call GBPrinter_CheckForErrors
+ call GBPrinter_UpdateStatusMessage
+ call DelayFrame
+ jr .asm_e8dfe
+
+.asm_e8e1b
+ and a
+ ret
+
+.asm_e8e1d
+ scf
+ ret
+
+String_e8e1f:
+ text_far _NoPokemonText
+ text_end
+
+PrintFanClubPortrait::
+ xor a
+ ldh [hCanceledPrinting], a
+ call Printer_PlayPrinterMusic
+ call Printer_GetMonStats
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ call StartTransmission_Send9Rows
+ ld a, $13
+ ld [wcae2], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call Printer_ResetJoypadHRAM
+.asm_e8e45
+ call JoypadLowSensitivity
+ call Printer_CheckPressingB
+ jr c, .asm_e8e62
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .asm_e8e62
+ call PrinterTransmissionJumptable
+ call GBPrinter_CheckForErrors
+ call GBPrinter_UpdateStatusMessage
+ call DelayFrame
+ jr .asm_e8e45
+
+.asm_e8e62
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ call Printer_CopyTileMapFromPrinterTileBuffer
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ call ReloadMapAfterPrinter
+ call Printer_PlayMapMusic
+ ret
+
+PrinterDebug:
+ push af
+ push bc
+ push de
+ push hl
+ call StopAllMusic
+ ldh a, [rIE]
+ push af
+ xor a
+ ldh [rIF], a
+ ld a, $9
+ ldh [rIE], a
+ call StartTransmission_Send9Rows
+ ld a, $13
+ ld [wcae2], a
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call Printer_CopyTileMapToPrinterTileBuffer
+ call PrinterDebug_LoadGFX
+.loop
+ ld a, [wPrinterSendState]
+ bit 7, a
+ jr nz, .quit
+ call PrinterDebug_DoFunction
+ call PrinterDebug_ConvertStatusFlagsToTiles
+ call DelayFrame
+ jr .loop
+
+.quit
+ xor a
+ ld [wPrinterConnectionOpen], a
+ ld [wPrinterOpcode], a
+ ld hl, wOAMBuffer + 32 * 4
+ ld bc, 8 * 4
+ xor a
+ call FillMemory
+ xor a
+ ldh [rIF], a
+ pop af
+ ldh [rIE], a
+ pop hl
+ pop de
+ pop bc
+ pop af
+ ret
+
+Printer_CheckPressingB:
+ ldh a, [hJoyHeld]
+ and B_BUTTON
+ jr nz, .quit
+ and a
+ ret
+
+.quit
+ ld a, [wPrinterSendState]
+ cp $c
+ jr nz, .already_done
+.wait_current_task
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .wait_current_task
+ ld a, $16
+ ld [wPrinterOpcode], a
+ ld a, $88
+ ldh [rSB], a
+ ld a, $1
+ ldh [rSC], a
+ ld a, $81
+ ldh [rSC], a
+.wait_send_cancel
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .wait_send_cancel
+.already_done
+ ld a, $1
+ ldh [hCanceledPrinting], a
+ scf
+ ret
+
+Printer_CopyTileMapToPrinterTileBuffer:
+ hlcoord 0, 0
+ decoord 0, 0, wPrinterTileBuffer
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ call CopyData
+ ret
+
+Printer_CopyTileMapFromPrinterTileBuffer:
+ hlcoord 0, 0, wPrinterTileBuffer
+ decoord 0, 0
+ ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
+ call CopyData
+ ret
+
+Printer_ResetJoypadHRAM:
+ xor a
+ ldh [hJoyLast], a
+ ldh [hJoyReleased], a
+ ldh [hJoyPressed], a
+ ldh [hJoyHeld], a
+ ldh [hJoy5], a
+ ldh [hJoy6], a
+ ret
+
+Printer_PlayPrinterMusic:
+ call Printer_FadeOutMusicAndWait
+ ld a, [wAudioROMBank]
+ ld [wAudioSavedROMBank], a
+ ld a, BANK(Music_GBPrinter)
+ ld [wAudioROMBank], a
+ ld a, MUSIC_GB_PRINTER
+ ld [wNewSoundID], a
+ call PlaySound
+ ret
+
+Printer_PlayMapMusic:
+ call Printer_FadeOutMusicAndWait
+ call PlayDefaultMusic
+ ret
+
+Printer_FadeOutMusicAndWait:
+ ld a, $4
+ ld [wAudioFadeOutControl], a
+ call StopAllMusic
+.wait_music_stop
+ ld a, [wAudioFadeOutControl]
+ and a
+ jr nz, .wait_music_stop
+ ret
+
+GBPrinter_CheckForErrors:
+ ld a, [wPrinterHandshake]
+ cp $81
+ jr z, .check_other_errors
+ ld a, [wPrinterStatusFlags]
+ cp $ff
+ jr z, .error2
+ xor a
+ jr .load_status
+
+.check_other_errors
+ ld a, [wPrinterStatusFlags]
+ and %11100000
+ ret z
+ bit 7, a
+ jr nz, .error1
+ bit 6, a
+ jr nz, .error4
+ ; error 3
+ ld a, PRINTER_ERROR_3
+ jr .load_status
+
+.error4
+ ld a, PRINTER_ERROR_4
+ jr .load_status
+
+.error1
+ ld a, PRINTER_ERROR_1
+ jr .load_status
+
+.error2
+ ld a, PRINTER_ERROR_2
+.load_status
+ ld [wPrinterStatusIndicator], a
+ ret
+
+GBPrinter_UpdateStatusMessage:
+ ld a, [wPrinterStatusIndicator]
+ and a
+ ret z
+ push af
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ hlcoord 0, 5
+ lb bc, 10, 18
+ call TextBoxBorder
+ pop af
+ ld e, a
+ ld d, $0
+ ld hl, .PrinterStatusMessages
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ hlcoord 1, 7
+ call PlaceString
+ hlcoord 2, 15
+ ld de, .PressBToCancel
+ call PlaceString
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ xor a
+ ld [wPrinterStatusIndicator], a
+ ret
+
+.PressBToCancel:
+ db "Press B to Cancel@"
+
+.PrinterStatusMessages:
+ dw .Blank
+ dw .CheckingLink
+ dw .Transmitting
+ dw .Printing
+ dw .Error1
+ dw .Error2
+ dw .Error3
+ dw .Error4
+ dw .WrongDevice
+
+.Blank:
+ db "@"
+.CheckingLink:
+ db ""
+ next " CHECKING LINK...@"
+.Transmitting:
+ db ""
+ next " TRANSMITTING...@"
+.Printing:
+ db ""
+ next " PRINTING...@"
+.Error1:
+ db " Printer Error 1"
+ next ""
+ next "Check the Game Boy"
+ next "Printer Manual.@"
+.Error2:
+ db " Printer Error 2"
+ next ""
+ next "Check the Game Boy"
+ next "Printer Manual.@"
+.Error3:
+ db " Printer Error 3"
+ next ""
+ next "Check the Game Boy"
+ next "Printer Manual.@"
+.Error4:
+ db " Printer Error 4"
+ next ""
+ next "Check the Game Boy"
+ next "Printer Manual.@"
+.WrongDevice:
+ db "This is not the"
+ next "Game Boy Printer!@"
+
+Printer_PrepareSurfingMinigameHighScoreTileMap::
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ ld de, SurfingPikachu2Graphics
+ ld hl, vChars2
+ lb bc, BANK(SurfingPikachu2Graphics), (SurfingPikachu2GraphicsEnd - SurfingPikachu2Graphics) / $10
+ call CopyVideoData
+ hlcoord 0, 0
+ call .PlaceRowAlternatingTiles
+ hlcoord 0, 17
+ call .PlaceRowAlternatingTiles
+ hlcoord 0, 0
+ call .PlaceColumnAlternatingTiles
+ hlcoord 19, 0
+ call .PlaceColumnAlternatingTiles
+ ld a, $4
+ hlcoord 0, 0
+ ld [hl], a
+ hlcoord 0, 17
+ ld [hl], a
+ hlcoord 19, 0
+ ld [hl], a
+ hlcoord 19, 17
+ ld [hl], a
+ ld de, .Tilemap1
+ hlcoord 10, 8
+ lb bc, 3, 8
+ call Diploma_Surfing_CopyBox
+ ld de, .Tilemap2
+ hlcoord 2, 11
+ lb bc, 6, 16
+ call Diploma_Surfing_CopyBox
+ ld de, .PikachusBeachString
+ hlcoord 3, 2
+ call PlaceString
+ ld de, .HiScoreString
+ hlcoord 9, 4
+ call PlaceString
+ ld de, .PointsString
+ hlcoord 12, 6
+ call PlaceString
+ ld de, wPlayerName
+ ld hl, wPlayerName
+ ld bc, 0
+.find_end_of_name
+ ld a, [hli]
+ inc c
+ cp "@"
+ jr nz, .find_end_of_name
+ ld a, 8
+ sub c
+ jr nc, .got_name_length
+ xor a
+.got_name_length
+ ld c, a
+ hlcoord 2, 4
+ add hl, bc
+ call PlaceString
+ call CopySurfingMinigameScore
+ ld b, 8
+ call RunPaletteCommand
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ call GBPalNormal
+ ret
+
+.PlaceRowAlternatingTiles:
+ ld c, SCREEN_WIDTH / 2
+.row_loop
+ ld [hl], $0
+ inc hl
+ ld [hl], $1
+ inc hl
+ dec c
+ jr nz, .row_loop
+ ret
+
+.PlaceColumnAlternatingTiles:
+ ld c, SCREEN_HEIGHT / 2
+ ld de, SCREEN_WIDTH
+.col_loop
+ ld [hl], $2
+ add hl, de
+ ld [hl], $3
+ add hl, de
+ dec c
+ jr nz, .col_loop
+ ret
+
+.Tilemap1:
+ db $7f, $7f, $10, $11, $12, $13, $14, $15
+ db $0f, $3c, $3d, $3e, $20, $21, $30, $31
+ db $4c, $4d, $4e, $50, $34, $1a, $51, $2d
+
+.Tilemap2:
+ db $7f, $7f, $7f, $7f, $7f, $7f, $16, $17, $18, $19, $7f, $1b, $1c, $1d, $1e, $1f
+ db $7f, $7f, $22, $23, $24, $25, $26, $27, $28, $29, $2a, $2b, $2c, $7f, $2e, $2f
+ db $7f, $7f, $32, $33, $33, $35, $36, $37, $38, $39, $3a, $3b, $7f, $7f, $7f, $3f
+ db $40, $41, $42, $43, $44, $45, $46, $47, $48, $49, $4a, $4b, $40, $40, $40, $4f
+ db $52, $52, $52, $53, $54, $55, $56, $57, $58, $59, $5a, $5b, $5c, $5d, $5d, $5e
+ db $7f, $7f, $7f, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $7f, $7f, $7f
+
+.PikachusBeachString:
+ db "Pikachu's Beach@"
+.HiScoreString:
+ db "'s Hi-Score@"
+.PointsString:
+ db "Points@"
+
+Diploma_Surfing_CopyBox:
+.y
+ push bc
+ push hl
+.x
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .x
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .y
+ ret
+
+CopySurfingMinigameScore:
+ ld de, wSurfingMinigameHiScore + 1
+ hlcoord 7, 6
+ ld a, [de]
+ call .BCDConvertScore
+ ld a, [de]
+.BCDConvertScore:
+ ld c, a
+ swap a
+ and $f
+ add -10
+ ld [hli], a
+ ld a, c
+ and $f
+ add -10
+ ld [hli], a
+ dec de
+ ret
+
+SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu/surfing_pikachu_2.2bpp"
+SurfingPikachu2GraphicsEnd:
+
+PrintPCBox_DrawPage1:
+ xor a
+ ld [wBoxNumString], a
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ hlcoord 0, 0
+ ld bc, 11 * SCREEN_WIDTH
+ ld a, " "
+ call FillMemory
+ call PrintPCBox_DrawLeftAndRightBorders
+ call PrintPCBox_DrawTopBorder
+ hlcoord 4, 4
+ ld de, .PokemonListString
+ call PlaceString
+ hlcoord 7, 6
+ ld de, .BoxString
+ call PlaceString
+ hlcoord 11, 6
+ ld a, [wCurrentBoxNum]
+ and $7f
+ cp 9
+ jr c, .less_than_9
+ sub 9
+ ld [hl], "1"
+ inc hl
+ add "0"
+ jr .placed_box_number
+
+.less_than_9
+ add "1"
+.placed_box_number
+ ld [hl], a
+ hlcoord 4, 9
+ ld de, wBoxSpecies
+ ld c, $3
+ call PrintPCBox_PlaceBoxMonInfo
+ ret
+
+.PokemonListString: db "POKéMON LIST@"
+.BoxString: db "BOX@"
+
+PrintPCBox_DrawPage2:
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ call PrintPCBox_DrawLeftAndRightBorders
+ ld a, [wBoxDataStart]
+ cp 4
+ ret c
+ hlcoord 4, 0
+ ld de, wBoxSpecies + 3
+ ld c, 6
+ call PrintPCBox_PlaceBoxMonInfo
+ ret
+
+PrintPCBox_DrawPage3:
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ call PrintPCBox_DrawLeftAndRightBorders
+ ld a, [wBoxDataStart]
+ cp 10
+ ret c
+ hlcoord 4, 0
+ ld de, wBoxSpecies + 9
+ ld c, 6
+ call PrintPCBox_PlaceBoxMonInfo
+ ret
+
+PrintPCBox_DrawPage4:
+ call ClearScreen
+ call PrintPCBox_PlaceHorizontalLines
+ call PrintPCBox_DrawLeftAndRightBorders
+ hlcoord 0, 15
+ call PrintPCBox_DrawBottomBorderAtHL
+ hlcoord 0, 16
+ ld bc, 2 * SCREEN_WIDTH
+ ld a, " "
+ call FillMemory
+ ld a, [wBoxDataStart]
+ cp 16
+ ret c
+ hlcoord 4, 0
+ ld de, wBoxSpecies + 15
+ ld c, 5
+ call PrintPCBox_PlaceBoxMonInfo
+ ret
+
+PrintPCBox_PlaceBoxMonInfo:
+.loop
+ ld a, c
+ and a
+ jr z, .done
+ dec c
+ ld a, [de]
+ cp $ff
+ jr z, .done
+ ld [wd11e], a
+ push bc
+ push hl
+ push de
+ push hl
+ ld bc, 12
+ ld a, " "
+ call FillMemory
+ pop hl
+ push hl
+ ld de, SCREEN_WIDTH
+ add hl, de
+ ld bc, 12
+ ld a, " "
+ call FillMemory
+ pop hl
+ push hl
+ call GetMonName
+ pop hl
+ call PlaceString
+ push hl
+ ld hl, wBoxMonNicks
+ ld bc, NAME_LENGTH
+ ld a, [wBoxNumString]
+ call AddNTimes
+ ld e, l
+ ld d, h
+ pop hl
+ ld bc, SCREEN_WIDTH + 1
+ add hl, bc
+ ld [hl], " "
+ inc hl
+ call PlaceString
+ ld hl, wBoxNumString
+ inc [hl]
+ pop de
+ pop hl
+ ld bc, 3 * SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ inc de
+ jr .loop
+
+.done
+ ret
+
+PrintPCBox_DrawTopBorder:
+ hlcoord 0, 0
+ ld a, $79
+ ld [hli], a
+ ld a, $7a
+ ld c, SCREEN_WIDTH - 2
+.loop
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ ld a, $7b
+ ld [hl], a
+ ret
+
+PrintPCBox_DrawLeftAndRightBorders:
+ hlcoord 0, 0
+ ld de, SCREEN_WIDTH - 1
+ ld c, SCREEN_HEIGHT
+.loop
+ ld a, $7c
+ ld [hl], a
+ add hl, de
+ ld a, $7c
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ ret
+
+PrintPCBox_DrawBottomBorder:
+ hlcoord 0, 17
+PrintPCBox_DrawBottomBorderAtHL:
+ ld a, $7d
+ ld [hli], a
+ ld a, $7a
+ ld c, SCREEN_WIDTH - 2
+.loop
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ ld a, $7e
+ ld [hl], a
+ ret
+
+PrintPCBox_PlaceHorizontalLines:
+ hlcoord 4, 0
+ ld c, 6
+ call .PlaceHorizontalLine
+ hlcoord 6, 1
+ ld c, 6
+.PlaceHorizontalLine:
+.loop
+ push bc
+ push hl
+ ld de, .HorizontalLineString
+ call PlaceString
+ pop hl
+ ld bc, 3 * SCREEN_WIDTH
+ add hl, bc
+ pop bc
+ dec c
+ jr nz, .loop
+ ret
+
+.HorizontalLineString:
+ db "----------@"
diff --git a/engine/printer/printer2.asm b/engine/printer/printer2.asm
new file mode 100644
index 00000000..1f8ac975
--- /dev/null
+++ b/engine/printer/printer2.asm
@@ -0,0 +1,973 @@
+Printer_GetMonStats:
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ call LoadHpBarAndStatusTilePatterns
+ ld de, GFX_ea563
+ ld hl, vChars2 + $710
+ lb bc, BANK(GFX_ea563), (GFX_ea563End - GFX_ea563) / 8
+ call CopyVideoDataDouble
+
+ ld de, GFX_ea56b
+ ld hl, vChars2 + $6e0
+ lb bc, BANK(GFX_ea56b), (GFX_ea56bEnd - GFX_ea56b) / 8
+ call CopyVideoDataDouble
+
+ xor a
+ ldh [hAutoBGTransferEnabled], a
+ xor a
+ ld [wWhichTradeMonSelectionMenu], a
+ call LoadMonData
+
+ ld hl, wTileMap
+ lb bc, 16, 18
+ call TextBoxBorder
+
+ hlcoord 0, 12
+ lb bc, 4, 18
+ call TextBoxBorder
+
+ hlcoord 3, 10
+ call PrintLevelFull
+
+ hlcoord 2, 10
+ ld a, $6e
+ ld [hli], a
+ ld [hl], " "
+
+ hlcoord 2, 11
+ ld [hl], "’"
+
+ hlcoord 4, 11
+ ld de, wLoadedMonMaxHP
+ lb bc, 2, 3
+ call PrintNumber
+
+ ld a, [wMonHeader]
+ ld [wPokeBallAnimData], a
+ ld [wd0b5], a
+ ld hl, wPartyMonNicks
+ call .GetNamePointer
+ hlcoord 8, 2
+ call PlaceString
+
+ call GetMonName
+ hlcoord 9, 3
+ call PlaceString
+
+ predef IndexToPokedex
+ hlcoord 2, 8
+ ld [hl], "№"
+ inc hl
+ ld [hl], $f2
+ inc hl
+ ld de, wPokeBallAnimData
+ lb bc, $80 | 1, 3
+ call PrintNumber
+
+ hlcoord 8, 4
+ ld de, .OT
+ call PlaceString
+
+ ld hl, wPartyMonOT
+ call .GetNamePointer
+ hlcoord 9, 5
+ call PlaceString
+
+ hlcoord 9, 6
+ ld de, .IDNo
+ call PlaceString
+
+ hlcoord 13, 6
+ ld de, wLoadedMonOTID
+ lb bc, $80 | 2, 5
+ call PrintNumber
+
+ hlcoord 9, 8
+ ld de, .Stats
+ ldh a, [hUILayoutFlags]
+ set 2, a
+ ldh [hUILayoutFlags], a
+ call PlaceString
+ ldh a, [hUILayoutFlags]
+ res 2, a
+ ldh [hUILayoutFlags], a
+
+ hlcoord 16, 8
+ ld de, wLoadedMonAttack
+ ld a, 4
+.loop
+ push af
+ push de
+
+ push hl
+ lb bc, 2, 3
+ call PrintNumber
+ pop hl
+ ld bc, SCREEN_WIDTH
+ add hl, bc
+
+ pop de
+ inc de
+ inc de
+ pop af
+ dec a
+ jr nz, .loop
+
+ hlcoord 1, 13
+ ld a, [wLoadedMonMoves]
+ call .PlaceMoveName
+
+ hlcoord 1, 14
+ ld a, [wLoadedMonMoves + 1]
+ call .PlaceMoveName
+
+ hlcoord 1, 15
+ ld a, [wLoadedMonMoves + 2]
+ call .PlaceMoveName
+
+ hlcoord 1, 16
+ ld a, [wLoadedMonMoves + 3]
+ call .PlaceMoveName
+
+ ld b, $4 ; SET_PAL_STATUS_SCREEN
+ call RunPaletteCommand
+
+ ld a, $1
+ ldh [hAutoBGTransferEnabled], a
+ call Delay3
+ call GBPalNormal
+ hlcoord 1, 1
+ call LoadFlippedFrontSpriteByMonIndex
+ ret
+
+.GetNamePointer:
+ ld bc, NAME_LENGTH
+ ld a, [wWhichPokemon]
+ call AddNTimes
+ ld e, l
+ ld d, h
+ ret
+
+.PlaceMoveName:
+ and a
+ jr z, .no_move
+ ld [wPokeBallAnimData], a
+ call GetMoveName
+ jr .place_string
+
+.no_move
+ ld de, .Blank
+.place_string
+ call PlaceString
+ ret
+
+.OT:
+ db "OT/@"
+
+.IDNo:
+ db $73, "№/@"
+
+.Stats:
+ db "ATTACK"
+ next "DEFENSE"
+ next "SPEED"
+ next "SPECIAL@"
+
+.Blank:
+ db "--------------@"
+
+GFX_ea563:
+INCBIN "gfx/printer/hp.1bpp"
+GFX_ea563End:
+
+GFX_ea56b:
+INCBIN "gfx/printer/lv.1bpp"
+GFX_ea56bEnd:
+
+PrinterDebug_LoadGFX:
+ ld hl, vChars1 + $7e0
+ ld de, GFX_ea597
+ lb bc, BANK(GFX_ea597), (GFX_ea597End - GFX_ea597) / 16
+ call CopyVideoData
+
+ ld hl, wOAMBuffer + 32 * 4
+ ld a, $8
+ ld c, $8
+.loop
+ ld [hl], $10
+ inc hl
+ ld [hl], a
+ inc hl
+ ld [hl], $fe
+ inc hl
+ ld [hl], $0
+ inc hl
+ add $8
+ dec c
+ jr nz, .loop
+ ret
+
+GFX_ea597:
+INCBIN "gfx/printer/01.2bpp"
+GFX_ea597End:
+
+PrinterDebug_ConvertStatusFlagsToTiles:
+ ld hl, wOAMBuffer + 32 * 4 + 2
+ ld de, 4
+ ld a, [wPrinterStatusFlags]
+ ld c, 8
+.loop
+ sla a
+ jr c, .place_1
+ ld [hl], $fe
+ jr .okay
+
+.place_1
+ ld [hl], $ff
+.okay
+ add hl, de
+ dec c
+ jr nz, .loop
+ ret
+
+PrinterDebug_DoFunction:
+ ld a, [wPrinterSendState]
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.Jumptable:
+ dw Func_ea623
+ dw Func_ea6d2
+ dw Func_ea6af
+ dw Func_ea645
+ dw Func_ea701
+ dw Func_ea6bd
+ dw Func_ea671
+ dw Func_ea701
+ dw Func_ea6af
+ dw Func_ea68a
+ dw Func_ea701
+ dw Func_ea6af
+ dw Func_ea721
+ dw Func_ea610
+ dw Func_ea61a
+ dw Func_ea6af
+ dw Func_ea61e
+ dw Func_ea72f
+ dw Func_ea732
+
+Func_ea606:
+ ld hl, wPrinterSendState
+ inc [hl]
+ ret
+
+Func_ea60b:
+ ld hl, wPrinterSendState
+ dec [hl]
+ ret
+
+Func_ea610:
+ xor a
+ ld [wPrinterStatusFlags], a
+ ld hl, wPrinterSendState
+ set 7, [hl]
+ ret
+
+Func_ea61a:
+ call Func_ea606
+ ret
+
+Func_ea61e:
+ xor a
+ ld [wPrinterSendState], a
+ ret
+
+Func_ea623:
+ call Func_ea784
+ ld hl, Data_ea9de
+ call Func_ea76b
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ ld a, [wPrinterQueueLength]
+ ld [wPrinterRowIndex], a
+ call Func_ea606
+ call Func_ea74c
+ ld a, $1
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Func_ea645:
+ call Func_ea784
+ ld hl, wPrinterRowIndex
+ ld a, [hl]
+ and a
+ jr z, Func_ea671
+ ld hl, Data_ea9ea
+ call Func_ea76b
+ call PrinterDebug_PrepOAMForPrinting
+ ld a, $80
+ ld [wPrinterDataSize], a
+ ld a, $2
+ ld [wPrinterDataSize + 1], a
+ call Func_ea7a2
+ call Func_ea606
+ call Func_ea74c
+ ld a, $2
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Func_ea671:
+ ld a, $6
+ ld [wPrinterSendState], a
+ ld hl, Data_ea9f0
+ call Func_ea76b
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ call Func_ea606
+ call Func_ea74c
+ ret
+
+Func_ea68a:
+ call Func_ea784
+ ld hl, Data_ea9e4
+ call Func_ea76b
+ call Func_ea7d2
+ ld a, $4
+ ld [wPrinterDataSize], a
+ ld a, $0
+ ld [wPrinterDataSize + 1], a
+ call Func_ea7a2
+ call Func_ea606
+ call Func_ea74c
+ ld a, $3
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Func_ea6af:
+ ld hl, wPrinterSerialFrameDelay
+ inc [hl]
+ ld a, [hl]
+ cp $6
+ ret c
+ xor a
+ ld [hl], a
+ call Func_ea606
+ ret
+
+Func_ea6bd:
+ ld hl, wPrinterSerialFrameDelay
+ inc [hl]
+ ld a, [hl]
+ cp 6
+ ret c
+ xor a
+ ld [hl], a
+ ld hl, wPrinterRowIndex
+ dec [hl]
+ call Func_ea60b
+ call Func_ea60b
+ ret
+
+Func_ea6d2:
+ call Func_ea742
+ ret c
+ ld a, [wPrinterHandshake]
+ cp $ff
+ jr nz, .asm_ea6e4
+ ld a, [wPrinterStatusFlags]
+ cp $ff
+ jr z, .asm_ea6fb
+.asm_ea6e4
+ ld a, [wPrinterHandshake]
+ cp $81
+ jr nz, .asm_ea6fb
+ ld a, [wPrinterStatusFlags]
+ cp $0
+ jr nz, .asm_ea6fb
+ ld hl, wPrinterConnectionOpen
+ set 1, [hl]
+ call Func_ea606
+ ret
+
+.asm_ea6fb
+ ld a, $e
+ ld [wPrinterSendState], a
+ ret
+
+Func_ea701:
+ call Func_ea742
+ ret c
+ ld a, [wPrinterStatusFlags]
+ and $f0
+ jr nz, .asm_ea71b
+ ld a, [wPrinterStatusFlags]
+ and $1
+ jr nz, .asm_ea717
+ call Func_ea606
+ ret
+
+.asm_ea717
+ call Func_ea60b
+ ret
+
+.asm_ea71b
+ ld a, $11
+ ld [wPrinterSendState], a
+ ret
+
+Func_ea721:
+ call Func_ea742
+ ret c
+ ld a, [wPrinterStatusFlags]
+ and $f3
+ ret nz
+ call Func_ea606
+ ret
+
+Func_ea72f:
+ call Func_ea606
+Func_ea732:
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld a, [wPrinterStatusFlags]
+ and $f0
+ ret nz
+ xor a
+ ld [wPrinterSendState], a
+ ret
+
+Func_ea742:
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .asm_ea74a
+ and a
+ ret
+
+.asm_ea74a
+ scf
+ ret
+
+Func_ea74c:
+.asm_ea74c
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .asm_ea74c
+ ld a, $1
+ ld [wPrinterOpcode], a
+ xor a
+ ld [wPrinterSendByteOffset], a
+ ld [wPrinterSendByteOffset + 1], a
+ ld a, $88
+ ldh [rSB], a
+ ld a, $1
+ ldh [rSC], a
+ ld a, $81
+ ldh [rSC], a
+ ret
+
+Func_ea76b:
+ ld a, [hli]
+ ld [wPrinterDataHeader], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 1], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 2], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 3], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 4], a
+ ld a, [hl]
+ ld [wPrinterDataHeader + 5], a
+ ret
+
+Func_ea784:
+ xor a
+ ld hl, wPrinterDataHeader
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld hl, wPrinterDataHeader + 4
+ ld [hli], a
+ ld [hl], a
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ ld hl, wPrinterSendDataSource1
+ ld bc, $280
+ call FillMemory
+ ret
+
+Func_ea7a2:
+ ld hl, $0
+ ld bc, $4
+ ld de, wPrinterDataHeader
+ call Func_ea7c5
+ ld a, [wPrinterDataSize]
+ ld c, a
+ ld a, [wPrinterDataSize + 1]
+ ld b, a
+ ld de, wPrinterSendDataSource1
+ call Func_ea7c5
+ ld a, l
+ ld [wPrinterDataHeader + 4], a
+ ld a, h
+ ld [wPrinterDataHeader + 5], a
+ ret
+
+Func_ea7c5:
+.asm_ea7c5
+ ld a, [de]
+ inc de
+ add l
+ jr nc, .asm_ea7cb
+ inc h
+.asm_ea7cb
+ ld l, a
+ dec bc
+ ld a, c
+ or b
+ jr nz, .asm_ea7c5
+ ret
+
+Func_ea7d2:
+ ld a, $1
+ ld [wPrinterSendDataSource1], a
+ ld a, [wcae2]
+ ld [wPrinterStatusReceived], a
+ ld a, $e4
+ ld [wc6f2], a
+ ld a, [wPrinterSettingsTempCopy]
+ ld [wc6f3], a
+ ret
+
+PrinterDebug_PrepOAMForPrinting:
+ ld a, [wPrinterRowIndex]
+ ld b, a
+ ld a, [wPrinterQueueLength]
+ sub b
+ ld hl, wPrinterTileBuffer
+ ld de, $28
+.get_start_addr
+ and a
+ jr z, .start_working
+ add hl, de
+ dec a
+ jr .get_start_addr
+
+.start_working
+ ld e, l
+ ld d, h
+ ld hl, wPrinterSendDataSource1
+ ld c, $28
+.prep_loop
+ ld a, [de]
+ inc de
+ push bc
+ push de
+ push hl
+ swap a
+ ld d, a
+ and $f0
+ ld e, a
+ ld a, d
+ and $f
+ ld d, a
+ and $8
+ ld a, d
+ jr nz, .vtiles1
+ or $90
+ jr .got_vram_address
+
+.vtiles1
+ or $80
+.got_vram_address
+ ld d, a
+ lb bc, BANK(PrinterDebug_PrepOAMForPrinting), $1
+ call CopyVideoData
+ pop hl
+ ld de, $10
+ add hl, de
+ pop de
+ pop bc
+ dec c
+ jr nz, .prep_loop
+ call .UnnecessaryCall
+ ret
+
+.UnnecessaryCall:
+ ld hl, wcbdc
+ ld bc, $20
+ xor a
+ call FillMemory
+ ld hl, wOAMBuffer
+ ld c, $28
+.master_loop
+ push bc
+ push hl
+ call .AreWePrintingThisSegment
+ jr nc, .skip_segment
+ call .GetVRAMAddress
+ call .GetOAMFlags
+ call .ApplyObjectPalettes
+ call .PlaceObject
+.skip_segment
+ pop hl
+ inc hl
+ inc hl
+ inc hl
+ inc hl
+ pop bc
+ dec c
+ jr nz, .master_loop
+ ret
+
+.AreWePrintingThisSegment:
+ ld a, [wPrinterRowIndex]
+ ld b, a
+ ld a, [wPrinterQueueLength]
+ sub b
+ ld c, a
+ ld b, $10
+.add_n_times
+ ld a, c
+ and a
+ jr z, .check
+ ld a, b
+ add $10
+ ld b, a
+ dec c
+ jr .add_n_times
+
+.check
+ ld a, b
+ ld e, a
+ add $10
+ ld d, a
+ ld a, [hl]
+ cp e
+ jr c, .not_printing
+ cp d
+ jr nc, .not_printing
+ scf
+ ret
+
+.not_printing
+ and a
+ ret
+
+.GetVRAMAddress:
+ push hl
+ inc hl
+ inc hl
+ ld a, [hl]
+ swap a
+ ld d, a
+ and $f0
+ ld e, a
+ ld a, d
+ and $f
+ or $80
+ ld d, a
+ ld hl, wcbdc
+ lb bc, BANK(.GetVRAMAddress), $1
+ call CopyVideoData
+ pop hl
+ ret
+
+.GetOAMFlags:
+ push hl
+ inc hl
+ inc hl
+ inc hl
+ ld a, [hl]
+ call .DoBitOperation
+ pop hl
+ ret
+
+.DoBitOperation:
+ and $60
+ swap a
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.Jumptable:
+ dw .nop
+ dw .xflip
+ dw .yflip
+ dw .both
+
+.nop:
+ ret
+
+.xflip:
+ call .XFlip
+ ret
+
+.yflip:
+ call .YFlip
+ ret
+
+.both:
+ call .XFlip
+ call .YFlip
+ ret
+
+.XFlip:
+ ld hl, wcbdc
+ ld c, 16
+.byte_loop
+ ld d, [hl]
+ ld a, 0
+ ld b, 8
+.bit_loop
+ sla d
+ rr a
+ dec b
+ jr nz, .bit_loop
+ ld [hli], a
+ dec c
+ jr nz, .byte_loop
+ ret
+
+.YFlip:
+ ld hl, wcbdc
+ ld de, wcbea
+ ld c, $4
+.swap_loop
+ ld b, [hl]
+ ld a, [de]
+ ld [hli], a
+ ld a, b
+ ld [de], a
+ inc de
+ ld b, [hl]
+ ld a, [de]
+ ld [hli], a
+ ld a, b
+ ld [de], a
+ dec de
+ dec de
+ dec de
+ dec c
+ jr nz, .swap_loop
+ ret
+
+.ApplyObjectPalettes:
+ push hl
+ ld hl, wcbdc
+ ld de, wcbec
+ ld a, 8
+.loop1
+ push af
+ ld bc, $0
+ ld a, 8
+.loop2
+ push af
+ xor a
+ rlc [hl]
+ rl a
+ inc hl
+ rlc [hl]
+ rl a
+ dec hl
+ push hl
+ push de
+ call .ExpandPalettesToBC
+ pop de
+ pop hl
+ pop af
+ dec a
+ jr nz, .loop2
+ inc hl
+ inc hl
+ ld a, b
+ ld [de], a
+ inc de
+ ld a, c
+ ld [de], a
+ inc de
+ pop af
+ dec a
+ jr nz, .loop1
+ pop hl
+ ret
+
+.ExpandPalettesToBC:
+ call .GetPaletteFunction
+ call .ApplyPaletteFunction
+ ret
+
+.GetPaletteFunction:
+ ld e, a
+ ld d, 0
+ ld hl, .PalJumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.PalJumptable:
+ dw .Pal0
+ dw .Pal1
+ dw .Pal2
+ dw .Pal3
+
+.Pal0:
+ ldh a, [rOBP0]
+ and $3
+ ret
+
+.Pal2:
+ ldh a, [rOBP0]
+ and $c
+ srl a
+ srl a
+ ret
+
+.Pal1:
+ ldh a, [rOBP0]
+ and $30
+ swap a
+ ret
+
+.Pal3:
+ ldh a, [rOBP0]
+ and $c0
+ rlca
+ rlca
+ ret
+
+.ApplyPaletteFunction:
+ ld e, a
+ ld d, 0
+ ld hl, .PalFunJumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.PalFunJumptable:
+ dw .zero_zero
+ dw .xflip_zero
+ dw .zero_xflip
+ dw .xflip_xflip
+
+.zero_zero:
+ sla b
+ sla c
+ ret
+
+.xflip_zero:
+ scf
+ rl b
+ sla c
+ ret
+
+.zero_xflip:
+ sla b
+ scf
+ rl c
+ ret
+
+.xflip_xflip:
+ scf
+ rl b
+ scf
+ rl c
+ ret
+
+.PlaceObject:
+ push hl
+ ld a, [hli]
+ ld c, [hl]
+ and $8
+ jr nz, .use_source_2
+ ld hl, wPrinterSendDataSource1
+ jr .got_data_source
+
+.use_source_2
+ ld hl, wPrinterSendDataSource2
+.got_data_source
+ ld b, $0
+ ld a, c
+ and %11111000
+ sub $8
+ ld c, a
+ sla c
+ rl b
+ add hl, bc
+ ld e, l
+ ld d, h
+ ld hl, wcbec
+ ld c, $8
+.coord_copy_loop
+ call .GetBitMask
+ ld a, [de]
+ and b
+ or [hl]
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [de]
+ and b
+ or [hl]
+ ld [de], a
+ inc hl
+ inc de
+ dec c
+ jr nz, .coord_copy_loop
+ pop hl
+ ret
+
+.GetBitMask:
+ push hl
+ push de
+ ld de, -$10
+ add hl, de
+ ld a, [hli]
+ or [hl]
+ xor $ff
+ ld b, a
+ pop de
+ pop hl
+ ret
+
+Data_ea9de:
+ db 1, 0, $00, 0
+ dw 1
+Data_ea9e4:
+ db 2, 0, $04, 0
+ dw 0
+Data_ea9ea:
+ db 4, 0, $80, 2
+ dw 0
+Data_ea9f0:
+ db 4, 0, $00, 0
+ dw 4
+Data_ea9f6:
+ db 8, 0, $00, 0
+ dw 8
+Data_ea9fc:
+ db 15, 0, $00, 0
+ dw 15
diff --git a/engine/printer/serial.asm b/engine/printer/serial.asm
new file mode 100644
index 00000000..fd4dd056
--- /dev/null
+++ b/engine/printer/serial.asm
@@ -0,0 +1,632 @@
+ const_def
+ const PRINTER_STATUS_BLANK
+ const PRINTER_STATUS_CHECKING_LINK
+ const PRINTER_STATUS_TRANSMITTING
+ const PRINTER_STATUS_PRINTING
+ const PRINTER_ERROR_1
+ const PRINTER_ERROR_2
+ const PRINTER_ERROR_3
+ const PRINTER_ERROR_4
+ const PRINTER_ERROR_WRONG_DEVICE
+
+StartTransmission_Send9Rows:
+ ld a, 9
+Printer_StartTransmission:
+ push af
+ ld hl, wPrinterData
+ ld bc, wPrinterDataEnd - wPrinterData
+ xor a
+ call Printer_FillMemory
+ xor a
+ ldh [rSB], a
+ ldh [rSC], a
+ ld [wPrinterOpcode], a
+ ld hl, wPrinterConnectionOpen
+ set 0, [hl]
+ ld a, [wPrinterSettings]
+ ld [wPrinterSettingsTempCopy], a
+ pop af
+ ld [wPrinterQueueLength], a
+ ret
+
+PrinterTransmissionJumptable:
+ ld a, [wPrinterSendState]
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.Jumptable:
+ dw Printer_InitSerial ; 00
+ dw Printer_CheckConnectionStatus ; 01
+ dw Printer_WaitSerial ; 02
+ dw Printer_StartTransmittingTilemap ; 03
+ dw Printer_TransmissionLoop ; 04
+ dw Printer_WaitSerialAndLoopBack2 ; 05
+ dw Printer_EndTilemapTransmission ; 06
+ dw Printer_TransmissionLoop ; 07
+ dw Printer_WaitSerial ; 08
+
+ dw Printer_SignalSendHeader ; 09
+ dw Printer_TransmissionLoop ; 0a
+ dw Printer_WaitSerial ; 0b
+ dw Printer_WaitUntilFinished ; 0c
+ dw Printer_Quit ; 0d
+
+ dw Printer_Next_ ; 0e
+ dw Printer_WaitSerial ; 0f
+ dw Printer_SignalLoopBack ; 10
+ dw Printer_LoopBack ; 11
+ dw Printer_WaitLoopBack ; 12
+ dw Printer_WaitLoopBack_ ; 13
+
+Printer_Next:
+ ld hl, wPrinterSendState
+ inc [hl]
+ ret
+
+Printer_Back:
+ ld hl, wPrinterSendState
+ dec [hl]
+ ret
+
+Printer_Quit:
+ xor a
+ ld [wPrinterStatusFlags], a
+ ld hl, wPrinterSendState
+ set 7, [hl]
+ ret
+
+Printer_Next_:
+ call Printer_Next
+ ret
+
+Printer_LoopBack:
+ ld a, $1
+ ld [wPrinterSendState], a
+ ret
+
+Printer_InitSerial:
+ call ResetPrinterData
+ ld hl, PrinterDataPacket1
+ call CopyPrinterDataHeader
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ ld a, [wPrinterQueueLength]
+ ld [wPrinterRowIndex], a
+ call Printer_Next
+ call Printer_PrepareToSend
+ ld a, PRINTER_STATUS_CHECKING_LINK
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Printer_StartTransmittingTilemap:
+ call ResetPrinterData
+ ld hl, wPrinterRowIndex
+ ld a, [hl]
+ and a
+ jr z, Printer_EndTilemapTransmission
+ ld hl, PrinterDataPacket3
+ call CopyPrinterDataHeader
+ call Printer_Convert2RowsTo2bpp
+ ld a, LOW(wPrinterSendDataSource1End - wPrinterSendDataSource1)
+ ld [wPrinterDataSize], a
+ ld a, HIGH(wPrinterSendDataSource1End - wPrinterSendDataSource1)
+ ld [wPrinterDataSize + 1], a
+ call ComputePrinterChecksum
+ call Printer_Next
+ call Printer_PrepareToSend
+ ld a, PRINTER_STATUS_TRANSMITTING
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Printer_EndTilemapTransmission:
+ ld a, $6
+ ld [wPrinterSendState], a
+ ld hl, PrinterDataPacket4
+ call CopyPrinterDataHeader
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ call Printer_Next
+ call Printer_PrepareToSend
+ ret
+
+Printer_SignalSendHeader:
+ call ResetPrinterData
+ ld hl, PrinterDataPacket2
+ call CopyPrinterDataHeader
+ call Printer_StageHeaderForSend
+ ld a, $4
+ ld [wPrinterDataSize], a
+ ld a, $0
+ ld [wPrinterDataSize + 1], a
+ call ComputePrinterChecksum
+ call Printer_Next
+ call Printer_PrepareToSend
+ ld a, PRINTER_STATUS_PRINTING
+ ld [wPrinterStatusIndicator], a
+ ret
+
+Printer_SignalLoopBack:
+ call ResetPrinterData
+ ld hl, PrinterDataPacket1
+ call CopyPrinterDataHeader
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ ld a, [wPrinterQueueLength]
+ ld [wPrinterRowIndex], a
+ call Printer_Next
+ call Printer_PrepareToSend
+ ret
+
+Printer_WaitSerial:
+ ld hl, wPrinterSerialFrameDelay
+ inc [hl]
+ ld a, [hl]
+ cp $6
+ ret c
+ xor a
+ ld [hl], a
+ call Printer_Next
+ ret
+
+Printer_WaitSerialAndLoopBack2:
+ ld hl, wPrinterSerialFrameDelay
+ inc [hl]
+ ld a, [hl]
+ cp $6
+ ret c
+ xor a
+ ld [hl], a
+ ld hl, wPrinterRowIndex
+ dec [hl]
+ call Printer_Back
+ call Printer_Back
+ ret
+
+Printer_CheckConnectionStatus:
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld a, [wPrinterHandshake]
+ cp $ff
+ jr nz, .asm_e88dc
+ ld a, [wPrinterStatusFlags]
+ cp $ff
+ jr z, .asm_e88f8
+.asm_e88dc
+ ld a, [wPrinterHandshake]
+ cp $81
+ jr nz, .asm_e88f8
+ ld a, [wPrinterStatusFlags]
+ cp $0
+ jr nz, .asm_e88f8
+ ld hl, wPrinterConnectionOpen
+ set 1, [hl]
+ ld a, $5
+ ld [wHandshakeFrameDelay], a
+ call Printer_Next
+ ret
+
+.asm_e88f8
+ ld a, $ff
+ ld [wPrinterHandshake], a
+ ld [wPrinterStatusFlags], a
+ ld a, $e
+ ld [wPrinterSendState], a
+ ret
+
+Printer_TransmissionLoop:
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld a, [wPrinterStatusFlags]
+ and $f0
+ jr nz, .asm_e8921
+ ld a, [wPrinterStatusFlags]
+ and $1
+ jr nz, .asm_e891d
+ call Printer_Next
+ ret
+
+.asm_e891d
+ call Printer_Back
+ ret
+
+.asm_e8921
+ ld a, $12
+ ld [wPrinterSendState], a
+ ret
+
+Printer_WaitUntilFinished:
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld a, [wPrinterStatusFlags]
+ and $f3
+ ret nz
+ call Printer_Next
+ ret
+
+Printer_WaitLoopBack:
+ call Printer_Next
+Printer_WaitLoopBack_:
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld a, [wPrinterStatusFlags]
+ and $f0
+ ret nz
+ xor a
+ ld [wPrinterSendState], a
+ ret
+
+Printer_PrepareToSend:
+.wait_printer_operation
+ ld a, [wPrinterOpcode]
+ and a
+ jr nz, .wait_printer_operation
+ xor a
+ ld [wPrinterSendByteOffset], a
+ ld [wPrinterSendByteOffset + 1], a
+ ld a, $1
+ ld [wPrinterOpcode], a
+ ld a, $88
+ ldh [rSB], a
+ ld a, $1
+ ldh [rSC], a
+ ld a, $81
+ ldh [rSC], a
+ ret
+
+CopyPrinterDataHeader:
+ ld a, [hli]
+ ld [wPrinterDataHeader], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 1], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 2], a
+ ld a, [hli]
+ ld [wPrinterDataHeader + 3], a
+ ld a, [hli]
+ ld [wPrinterChecksum], a
+ ld a, [hl]
+ ld [wPrinterChecksum + 1], a
+ ret
+
+ResetPrinterData:
+ xor a
+ ld hl, wPrinterDataHeader
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld hl, wPrinterChecksum
+ ld [hli], a
+ ld [hl], a
+ xor a
+ ld [wPrinterDataSize], a
+ ld [wPrinterDataSize + 1], a
+ ld hl, wPrinterSendDataSource1
+ ld bc, wPrinterSendDataSource1End - wPrinterSendDataSource1
+ call Printer_FillMemory
+ ret
+
+ComputePrinterChecksum:
+ ld hl, $0
+ ld bc, $4
+ ld de, wPrinterDataHeader
+ call .AddToChecksum
+ ld a, [wPrinterDataSize]
+ ld c, a
+ ld a, [wPrinterDataSize + 1]
+ ld b, a
+ ld de, wPrinterSendDataSource1
+ call .AddToChecksum
+ ld a, l
+ ld [wPrinterChecksum], a
+ ld a, h
+ ld [wPrinterChecksum + 1], a
+ ret
+
+.AddToChecksum:
+.loop
+ ld a, [de]
+ inc de
+ add l
+ jr nc, .no_carry
+ inc h
+.no_carry
+ ld l, a
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ ret
+
+Printer_StageHeaderForSend:
+ ld a, $1
+ ld [wPrinterSendDataSource1], a
+ ld a, [wcae2]
+ ld [wPrinterSendDataSource1 + 1], a
+ ld a, %11100100
+ ld [wPrinterSendDataSource1 + 2], a
+ ld a, [wPrinterSettingsTempCopy]
+ ld [wPrinterSendDataSource1 + 3], a
+ ret
+
+Printer_Convert2RowsTo2bpp:
+ ld a, [wPrinterRowIndex]
+ ld b, a
+ ld a, [wPrinterQueueLength]
+ sub b
+ ld hl, wPrinterTileBuffer
+ ld de, 2 * SCREEN_WIDTH
+.get_row
+ and a
+ jr z, .got_row
+ add hl, de
+ dec a
+ jr .get_row
+
+.got_row
+ ld e, l
+ ld d, h
+ ld hl, wPrinterSendDataSource1
+ ld c, 2 * SCREEN_WIDTH
+.loop
+ ld a, [de]
+ inc de
+ push bc
+ push de
+ push hl
+ swap a
+ ld d, a
+ and $f0
+ ld e, a
+ ld a, d
+ and $f
+ ld d, a
+ and $8
+ ld a, d
+ jr nz, .vchars1
+ or $90
+ jr .got_addr
+
+.vchars1
+ or $80
+.got_addr
+ ld d, a
+ lb bc, BANK(Printer_Convert2RowsTo2bpp), 1
+ call CopyVideoData
+ pop hl
+ ld de, $10
+ add hl, de
+ pop de
+ pop bc
+ dec c
+ jr nz, .loop
+ ret
+
+Printer_FillMemory:
+ push de
+ ld e, a
+.loop
+ ld [hl], e
+ inc hl
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ ld a, e
+ pop de
+ ret
+
+PrinterDataPacket1:
+ db 1, 0, $00, 0
+ dw 1
+PrinterDataPacket2:
+ db 2, 0, $04, 0
+ dw 0
+PrinterDataPacket3:
+ db 4, 0, $80, 2
+ dw 0
+PrinterDataPacket4:
+ db 4, 0, $00, 0
+ dw 4
+PrinterDataPacket5: ; unused
+ db 8, 0, $00, 0
+ dw 8
+PrinterDataPacket6: ; unused
+ db 15, 0, $00, 0
+ dw 15
+
+PrinterSerial_::
+ ld a, [wPrinterOpcode]
+ ld e, a
+ ld d, 0
+ ld hl, .Jumptable
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp hl
+
+.Jumptable:
+ dw .Nop
+
+ dw .SignalTransmissionStart
+ dw .SendHeaderByte1
+ dw .SendHeaderByte2
+ dw .SendHeaderByte3
+ dw .SendHeaderByte4
+ dw .DataByte
+ dw .SendChecksumLo
+ dw .SendChecksumHi
+ dw .SignalTransmissionEnd
+ dw .Receive1
+ dw .Receive2
+
+ dw .SignalTransmissionStart
+ dw .Send_0F
+ dw .Send_00
+ dw .Send_00
+ dw .Send_00
+ dw .Send_0F
+ dw .Send_00
+ dw .SignalTransmissionEnd
+ dw .Receive1
+ dw .Receive2_
+
+ dw .SignalTransmissionStart
+ dw .SignalQuit
+ dw .Send_00
+ dw .Send_00
+ dw .Send_00
+ dw .SignalQuit
+ dw .Send_00
+ dw .SignalTransmissionEnd
+ dw .Receive1
+ dw .Receive2
+
+.NextInstruction:
+ ld hl, wPrinterOpcode
+ inc [hl]
+ ret
+
+.Nop:
+ ret
+
+.SignalTransmissionStart:
+ ld a, $33
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendHeaderByte1:
+ ld a, [wPrinterDataHeader]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendHeaderByte2:
+ ld a, [wPrinterDataHeader + 1]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendHeaderByte3:
+ ld a, [wPrinterDataHeader + 2]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendHeaderByte4:
+ ld a, [wPrinterDataHeader + 3]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.DataByte:
+ ld hl, wPrinterDataSize
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld a, e
+ or d
+ jr z, .sent_last_byte
+ dec de
+ ld [hl], d
+ dec hl
+ ld [hl], e
+ ld a, [wPrinterSendByteOffset]
+ ld e, a
+ ld a, [wPrinterSendByteOffset + 1]
+ ld d, a
+ ld hl, wPrinterSendDataSource1
+ add hl, de
+ inc de
+ ld a, e
+ ld [wPrinterSendByteOffset], a
+ ld a, d
+ ld [wPrinterSendByteOffset + 1], a
+ ld a, [hl]
+ call .SendByte
+ ret
+
+.sent_last_byte
+ call .NextInstruction
+.SendChecksumLo:
+ ld a, [wPrinterChecksum]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendChecksumHi:
+ ld a, [wPrinterChecksum + 1]
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SignalTransmissionEnd:
+ ld a, $0
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.Receive1:
+ ldh a, [rSB]
+ ld [wPrinterHandshake], a
+ ld a, $0
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.Receive2:
+ ldh a, [rSB]
+ ld [wPrinterStatusFlags], a
+ xor a
+ ld [wPrinterOpcode], a
+ ret
+
+.Send_0F:
+ ld a, $f
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.Send_00:
+ ld a, $0
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SignalQuit:
+ ld a, $8
+ call .SendByte
+ call .NextInstruction
+ ret
+
+.SendByte:
+ ldh [rSB], a
+ ld a, $1
+ ldh [rSC], a
+ ld a, $81
+ ldh [rSC], a
+ ret
+
+.Receive2_:
+ ldh a, [rSB]
+ ld [wPrinterStatusFlags], a
+ xor a
+ ld [wPrinterOpcode], a
+ ret
diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm
index fe137632..ba007d9d 100644
--- a/engine/slots/slot_machine.asm
+++ b/engine/slots/slot_machine.asm
@@ -23,9 +23,11 @@ PromptUserToPlaySlots:
call LoadFontTilePatterns
ld b, SET_PAL_SLOTS
call RunPaletteCommand
+ call Delay3
call GBPalNormal
ld a, $e4
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
ld hl, wd730
set 6, [hl]
xor a
@@ -80,8 +82,7 @@ MainSlotMachineLoop:
ld [wLastMenuItem], a
ld [wMenuWatchMovingOutOfBounds], a
hlcoord 14, 11
- ld b, 5
- ld c, 4
+ lb bc, 5, 4
call TextBoxBorder
hlcoord 16, 12
ld de, CoinMultiplierSlotMachineText
@@ -457,6 +458,7 @@ SlotMachine_CheckForMatches:
ldh a, [rBGP]
xor $40
ldh [rBGP], a
+ call UpdateGBCPal_BGP
ld c, 5
call DelayFrames
dec b
@@ -473,6 +475,7 @@ SlotMachine_CheckForMatches:
call SlotMachine_PrintPayoutCoins
ld a, $e4
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
jp .done
SymbolLinedUpSlotMachineText:
@@ -698,6 +701,7 @@ SlotMachine_PayCoinsToPlayer:
ldh a, [rOBP0]
xor $40 ; make the slot wheel symbols flash
ldh [rOBP0], a
+ call UpdateGBCPal_OBP0
ld a, 5
.skip1
ld [wAnimCounter], a
@@ -852,17 +856,17 @@ LoadSlotMachineTiles:
ld de, vChars0
ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles
ld a, BANK(SlotMachineTiles2)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineTiles1
ld de, vChars2
ld bc, SlotMachineTiles1End - SlotMachineTiles1
ld a, BANK(SlotMachineTiles1)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineTiles2
ld de, vChars2 tile $25
ld bc, $1c tiles ; should be SlotMachineTiles2End - SlotMachineTiles2, or $18 tiles
ld a, BANK(SlotMachineTiles2)
- call FarCopyData2
+ call FarCopyData
ld hl, SlotMachineMap
decoord 0, 0
ld bc, SlotMachineMapEnd - SlotMachineMap
@@ -884,10 +888,5 @@ SlotMachineMapEnd:
INCLUDE "data/events/slot_machine_wheels.asm"
SlotMachineTiles1:
-IF DEF(_RED)
- INCBIN "gfx/slots/red_slots_1.2bpp"
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/slots/blue_slots_1.2bpp"
-ENDC
+ INCBIN "gfx/slots/slots_1.2bpp"
SlotMachineTiles1End:
diff --git a/garbage/bank20.bin b/garbage/bank20.bin
new file mode 100644
index 00000000..96a64283
--- /dev/null
+++ b/garbage/bank20.bin
Binary files differ
diff --git a/garbage/bank30.bin b/garbage/bank30.bin
new file mode 100644
index 00000000..6309c149
--- /dev/null
+++ b/garbage/bank30.bin
Binary files differ
diff --git a/gfx/battle/prof.oakb.png b/gfx/battle/prof.oakb.png
new file mode 100644
index 00000000..fb96bbf9
--- /dev/null
+++ b/gfx/battle/prof.oakb.png
Binary files differ
diff --git a/gfx/blocksets/beach_house.bst b/gfx/blocksets/beach_house.bst
new file mode 100644
index 00000000..bafbe0b2
--- /dev/null
+++ b/gfx/blocksets/beach_house.bst
Binary files differ
diff --git a/gfx/blocksets/gym.bst b/gfx/blocksets/gym.bst
index 48889bfa..f903c964 100644
--- a/gfx/blocksets/gym.bst
+++ b/gfx/blocksets/gym.bst
Binary files differ
diff --git a/gfx/blocksets/pokecenter.bst b/gfx/blocksets/pokecenter.bst
index a82460f5..213460aa 100644
--- a/gfx/blocksets/pokecenter.bst
+++ b/gfx/blocksets/pokecenter.bst
Binary files differ
diff --git a/gfx/emotes/bolt.png b/gfx/emotes/bolt.png
new file mode 100644
index 00000000..0eef6ad3
--- /dev/null
+++ b/gfx/emotes/bolt.png
Binary files differ
diff --git a/gfx/emotes/fish.png b/gfx/emotes/fish.png
new file mode 100644
index 00000000..216c9c43
--- /dev/null
+++ b/gfx/emotes/fish.png
Binary files differ
diff --git a/gfx/emotes/heart.png b/gfx/emotes/heart.png
new file mode 100644
index 00000000..166fff51
--- /dev/null
+++ b/gfx/emotes/heart.png
Binary files differ
diff --git a/gfx/emotes/question.png b/gfx/emotes/question.png
index ef1d770b..091ddbba 100644
--- a/gfx/emotes/question.png
+++ b/gfx/emotes/question.png
Binary files differ
diff --git a/gfx/emotes/skull.png b/gfx/emotes/skull.png
new file mode 100644
index 00000000..e241a5b1
--- /dev/null
+++ b/gfx/emotes/skull.png
Binary files differ
diff --git a/gfx/emotes/zzz.png b/gfx/emotes/zzz.png
new file mode 100644
index 00000000..41c958f7
--- /dev/null
+++ b/gfx/emotes/zzz.png
Binary files differ
diff --git a/gfx/font.asm b/gfx/font.asm
index fc2aff4f..06b02fdf 100644
--- a/gfx/font.asm
+++ b/gfx/font.asm
@@ -1,4 +1,4 @@
-PokemonLogoGraphics: INCBIN "gfx/title/pokemon_logo.2bpp"
+PokemonLogoJapanGraphics: INCBIN "gfx/title/pokemon_logo_japan.2bpp"
FontGraphics:: INCBIN "gfx/font/font.1bpp"
FontGraphicsEnd::
@@ -18,6 +18,8 @@ NintendoCopyrightLogoGraphics: INCBIN "gfx/splash/copyright.2bpp"
GamefreakLogoGraphics: INCBIN "gfx/title/gamefreak_inc.2bpp"
GamefreakLogoGraphicsEnd:
+NineTile: INCBIN "gfx/title/nine.2bpp"
+
TextBoxGraphics:: INCBIN "gfx/font/font_extra.2bpp"
TextBoxGraphicsEnd::
diff --git a/gfx/intro/blue_jigglypuff_1.png b/gfx/intro/blue_jigglypuff_1.png
deleted file mode 100644
index 0e53582c..00000000
--- a/gfx/intro/blue_jigglypuff_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/blue_jigglypuff_2.png b/gfx/intro/blue_jigglypuff_2.png
deleted file mode 100644
index 21107af0..00000000
--- a/gfx/intro/blue_jigglypuff_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/blue_jigglypuff_3.png b/gfx/intro/blue_jigglypuff_3.png
deleted file mode 100644
index 1c30a0e8..00000000
--- a/gfx/intro/blue_jigglypuff_3.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/clouds.png b/gfx/intro/clouds.png
new file mode 100644
index 00000000..872492b1
--- /dev/null
+++ b/gfx/intro/clouds.png
Binary files differ
diff --git a/gfx/intro/gengar.png b/gfx/intro/gengar.png
deleted file mode 100644
index 9558d1a1..00000000
--- a/gfx/intro/gengar.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/red_nidorino_1.png b/gfx/intro/red_nidorino_1.png
deleted file mode 100644
index 4c7804a1..00000000
--- a/gfx/intro/red_nidorino_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/red_nidorino_2.png b/gfx/intro/red_nidorino_2.png
deleted file mode 100644
index a29a4814..00000000
--- a/gfx/intro/red_nidorino_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/red_nidorino_3.png b/gfx/intro/red_nidorino_3.png
deleted file mode 100644
index e920d55d..00000000
--- a/gfx/intro/red_nidorino_3.png
+++ /dev/null
Binary files differ
diff --git a/gfx/intro/unknown_f9b6e.map b/gfx/intro/unknown_f9b6e.map
new file mode 100644
index 00000000..3ce924dc
--- /dev/null
+++ b/gfx/intro/unknown_f9b6e.map
Binary files differ
diff --git a/gfx/intro/unknown_f9be6.map b/gfx/intro/unknown_f9be6.map
new file mode 100644
index 00000000..18560135
--- /dev/null
+++ b/gfx/intro/unknown_f9be6.map
@@ -0,0 +1 @@
+0123@ABCPQRS \ No newline at end of file
diff --git a/gfx/intro/unknown_f9bf2.map b/gfx/intro/unknown_f9bf2.map
new file mode 100644
index 00000000..e587b7ce
--- /dev/null
+++ b/gfx/intro/unknown_f9bf2.map
@@ -0,0 +1 @@
+"# \ No newline at end of file
diff --git a/gfx/intro/yellow_intro_1.png b/gfx/intro/yellow_intro_1.png
new file mode 100644
index 00000000..f7258169
--- /dev/null
+++ b/gfx/intro/yellow_intro_1.png
Binary files differ
diff --git a/gfx/intro/yellow_intro_2.png b/gfx/intro/yellow_intro_2.png
new file mode 100644
index 00000000..dc5313c3
--- /dev/null
+++ b/gfx/intro/yellow_intro_2.png
Binary files differ
diff --git a/gfx/overworld/pikachu_ball.png b/gfx/overworld/pikachu_ball.png
new file mode 100644
index 00000000..20bcf5a7
--- /dev/null
+++ b/gfx/overworld/pikachu_ball.png
Binary files differ
diff --git a/gfx/overworld/shadow.png b/gfx/overworld/shadow.png
index 8e760056..ba3dab5b 100644
--- a/gfx/overworld/shadow.png
+++ b/gfx/overworld/shadow.png
Binary files differ
diff --git a/gfx/pics.asm b/gfx/pics.asm
index 134516cd..e7a52a17 100644
--- a/gfx/pics.asm
+++ b/gfx/pics.asm
@@ -40,6 +40,8 @@ LaprasPicFront:: INCBIN "gfx/pokemon/front/lapras.pic"
LaprasPicBack:: INCBIN "gfx/pokemon/back/laprasb.pic"
ArcaninePicFront:: INCBIN "gfx/pokemon/front/arcanine.pic"
ArcaninePicBack:: INCBIN "gfx/pokemon/back/arcanineb.pic"
+MewPicFront:: INCBIN "gfx/pokemon/front/mew.pic"
+MewPicBack:: INCBIN "gfx/pokemon/back/mewb.pic"
GyaradosPicFront:: INCBIN "gfx/pokemon/front/gyarados.pic"
GyaradosPicBack:: INCBIN "gfx/pokemon/back/gyaradosb.pic"
ShellderPicFront:: INCBIN "gfx/pokemon/front/shellder.pic"
@@ -263,9 +265,6 @@ PidgeotPicBack:: INCBIN "gfx/pokemon/back/pidgeotb.pic"
StarmiePicFront:: INCBIN "gfx/pokemon/front/starmie.pic"
StarmiePicBack:: INCBIN "gfx/pokemon/back/starmieb.pic"
-RedPicBack:: INCBIN "gfx/player/redb.pic"
-OldManPicBack:: INCBIN "gfx/battle/oldmanb.pic"
-
SECTION "Pics 5", ROMX
@@ -373,3 +372,11 @@ LoreleiPic:: INCBIN "gfx/trainers/lorelei.pic"
ChannelerPic:: INCBIN "gfx/trainers/channeler.pic"
AgathaPic:: INCBIN "gfx/trainers/agatha.pic"
LancePic:: INCBIN "gfx/trainers/lance.pic"
+JessieJamesPic:: INCBIN "gfx/trainers/jessiejames.pic"
+
+
+SECTION "Pics 7", ROMX
+
+RedPicBack:: INCBIN "gfx/player/redb.pic"
+OldManPicBack:: INCBIN "gfx/battle/oldmanb.pic"
+ProfOakPicBack:: INCBIN "gfx/battle/prof.oakb.pic"
diff --git a/gfx/pikachu.asm b/gfx/pikachu.asm
new file mode 100644
index 00000000..6852e91e
--- /dev/null
+++ b/gfx/pikachu.asm
@@ -0,0 +1,128 @@
+SECTION "Pikachu Graphics 1", ROMX
+
+Pic_e4000::
+INCBIN "gfx/pikachu/unknown_e4000.pic"
+GFX_e40cc::
+INCBIN "gfx/pikachu/unknown_e40cc.2bpp"
+Pic_e411c::
+INCBIN "gfx/pikachu/unknown_e411c.pic"
+GFX_e41d2::
+INCBIN "gfx/pikachu/unknown_e41d2.2bpp"
+Pic_e4272::
+INCBIN "gfx/pikachu/unknown_e4272.pic"
+GFX_e4323::
+INCBIN "gfx/pikachu/unknown_e4323.2bpp"
+Pic_e4383::
+INCBIN "gfx/pikachu/unknown_e4383.pic"
+GFX_e444b::
+INCBIN "gfx/pikachu/unknown_e444b.2bpp"
+Pic_e458b::
+INCBIN "gfx/pikachu/unknown_e458b.pic"
+GFX_e463b::
+INCBIN "gfx/pikachu/unknown_e463b.2bpp"
+Pic_e467b::
+INCBIN "gfx/pikachu/unknown_e467b.pic"
+GFX_e472e::
+INCBIN "gfx/pikachu/unknown_e472e.2bpp"
+Pic_e476e::
+INCBIN "gfx/pikachu/unknown_e476e.pic"
+GFX_e4841::
+INCBIN "gfx/pikachu/unknown_e4841.2bpp"
+Pic_e49d1::
+INCBIN "gfx/pikachu/unknown_e49d1.pic"
+GFX_e4a99::
+INCBIN "gfx/pikachu/unknown_e4a99.2bpp"
+Pic_e4b39::
+INCBIN "gfx/pikachu/unknown_e4b39.pic"
+GFX_e4bde::
+INCBIN "gfx/pikachu/unknown_e4bde.2bpp"
+Pic_e4c3e::
+INCBIN "gfx/pikachu/unknown_e4c3e.pic"
+GFX_e4ce0::
+INCBIN "gfx/pikachu/unknown_e4ce0.2bpp"
+GFX_e4e70::
+INCBIN "gfx/pikachu/unknown_e4e70.2bpp"
+Pic_e5000::
+INCBIN "gfx/pikachu/unknown_e5000.pic"
+GFX_e50af::
+INCBIN "gfx/pikachu/unknown_e50af.2bpp"
+Pic_e523f::
+INCBIN "gfx/pikachu/unknown_e523f.pic"
+GFX_e52fe::
+INCBIN "gfx/pikachu/unknown_e52fe.2bpp"
+Pic_e548e::
+INCBIN "gfx/pikachu/unknown_e548e.pic"
+GFX_e5541::
+INCBIN "gfx/pikachu/unknown_e5541.2bpp"
+Pic_e56d1::
+INCBIN "gfx/pikachu/unknown_e56d1.pic"
+GFX_e5794::
+INCBIN "gfx/pikachu/unknown_e5794.2bpp"
+Pic_e5924::
+INCBIN "gfx/pikachu/unknown_e5924.pic"
+GFX_e59ed::
+INCBIN "gfx/pikachu/unknown_e59ed.2bpp"
+Pic_e5b7d::
+INCBIN "gfx/pikachu/unknown_e5b7d.pic"
+GFX_e5c4d::
+INCBIN "gfx/pikachu/unknown_e5c4d.2bpp"
+Pic_e5ddd::
+INCBIN "gfx/pikachu/unknown_e5ddd.pic"
+GFX_e5e90::
+INCBIN "gfx/pikachu/unknown_e5e90.2bpp"
+GFX_e6020::
+INCBIN "gfx/pikachu/unknown_e6020.2bpp"
+GFX_e61b0::
+INCBIN "gfx/pikachu/unknown_e61b0.2bpp"
+Pic_e6340::
+INCBIN "gfx/pikachu/unknown_e6340.pic"
+GFX_e63f7::
+INCBIN "gfx/pikachu/unknown_e63f7.2bpp"
+Pic_e6587::
+INCBIN "gfx/pikachu/unknown_e6587.pic"
+GFX_e6646::
+INCBIN "gfx/pikachu/unknown_e6646.2bpp"
+Pic_e67d6::
+INCBIN "gfx/pikachu/unknown_e67d6.pic"
+GFX_e682f::
+INCBIN "gfx/pikachu/unknown_e682f.2bpp"
+GFX_e69bf::
+INCBIN "gfx/pikachu/unknown_e69bf.2bpp"
+GFX_e6b4f::
+INCBIN "gfx/pikachu/unknown_e6b4f.2bpp"
+GFX_e6cdf::
+INCBIN "gfx/pikachu/unknown_e6cdf.2bpp"
+GFX_e6e6f::
+INCBIN "gfx/pikachu/unknown_e6e6f.2bpp"
+GFX_e6fff::
+INCBIN "gfx/pikachu/unknown_e6fff.2bpp"
+GFX_e718f::
+INCBIN "gfx/pikachu/unknown_e718f.2bpp"
+GFX_e731f::
+INCBIN "gfx/pikachu/unknown_e731f.2bpp"
+GFX_e74af::
+INCBIN "gfx/pikachu/unknown_e74af.2bpp"
+GFX_e763f::
+INCBIN "gfx/pikachu/unknown_e763f.2bpp"
+Pic_e77cf::
+INCBIN "gfx/pikachu/unknown_e77cf.pic"
+GFX_e7863::
+INCBIN "gfx/pikachu/unknown_e7863.2bpp"
+GFX_e79f3::
+INCBIN "gfx/pikachu/unknown_e79f3.2bpp"
+GFX_e7b83::
+INCBIN "gfx/pikachu/unknown_e7b83.2bpp"
+GFX_e7d13::
+INCBIN "gfx/pikachu/unknown_e7d13.2bpp"
+
+
+SECTION "Pikachu Graphics 2", ROMX
+
+Pic_f0abf::
+INCBIN "gfx/pikachu/unknown_f0abf.pic"
+GFX_f0b64::
+INCBIN "gfx/pikachu/unknown_f0b64.2bpp"
+Pic_f0cf4::
+INCBIN "gfx/pikachu/unknown_f0cf4.pic"
+GFX_f0d82::
+INCBIN "gfx/pikachu/unknown_f0d82.2bpp"
diff --git a/gfx/pikachu/unknown_e4000.png b/gfx/pikachu/unknown_e4000.png
new file mode 100644
index 00000000..75a54919
--- /dev/null
+++ b/gfx/pikachu/unknown_e4000.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e40cc.png b/gfx/pikachu/unknown_e40cc.png
new file mode 100644
index 00000000..bd7619fd
--- /dev/null
+++ b/gfx/pikachu/unknown_e40cc.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e411c.png b/gfx/pikachu/unknown_e411c.png
new file mode 100644
index 00000000..40e3d336
--- /dev/null
+++ b/gfx/pikachu/unknown_e411c.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e41d2.png b/gfx/pikachu/unknown_e41d2.png
new file mode 100644
index 00000000..e2ed42b7
--- /dev/null
+++ b/gfx/pikachu/unknown_e41d2.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4272.png b/gfx/pikachu/unknown_e4272.png
new file mode 100644
index 00000000..8b23b56e
--- /dev/null
+++ b/gfx/pikachu/unknown_e4272.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4323.png b/gfx/pikachu/unknown_e4323.png
new file mode 100644
index 00000000..6d8d5c22
--- /dev/null
+++ b/gfx/pikachu/unknown_e4323.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4383.png b/gfx/pikachu/unknown_e4383.png
new file mode 100644
index 00000000..5ac60dc3
--- /dev/null
+++ b/gfx/pikachu/unknown_e4383.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e444b.png b/gfx/pikachu/unknown_e444b.png
new file mode 100644
index 00000000..61d4c51b
--- /dev/null
+++ b/gfx/pikachu/unknown_e444b.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e458b.png b/gfx/pikachu/unknown_e458b.png
new file mode 100644
index 00000000..e374a571
--- /dev/null
+++ b/gfx/pikachu/unknown_e458b.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e463b.png b/gfx/pikachu/unknown_e463b.png
new file mode 100644
index 00000000..2e31d6f6
--- /dev/null
+++ b/gfx/pikachu/unknown_e463b.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e467b.png b/gfx/pikachu/unknown_e467b.png
new file mode 100644
index 00000000..d088d590
--- /dev/null
+++ b/gfx/pikachu/unknown_e467b.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e472e.png b/gfx/pikachu/unknown_e472e.png
new file mode 100644
index 00000000..1a1ac334
--- /dev/null
+++ b/gfx/pikachu/unknown_e472e.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e476e.png b/gfx/pikachu/unknown_e476e.png
new file mode 100644
index 00000000..2ca64b68
--- /dev/null
+++ b/gfx/pikachu/unknown_e476e.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4841.png b/gfx/pikachu/unknown_e4841.png
new file mode 100644
index 00000000..f3425637
--- /dev/null
+++ b/gfx/pikachu/unknown_e4841.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e49d1.png b/gfx/pikachu/unknown_e49d1.png
new file mode 100644
index 00000000..1414cd6e
--- /dev/null
+++ b/gfx/pikachu/unknown_e49d1.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4a99.png b/gfx/pikachu/unknown_e4a99.png
new file mode 100644
index 00000000..1cb2b252
--- /dev/null
+++ b/gfx/pikachu/unknown_e4a99.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4b39.png b/gfx/pikachu/unknown_e4b39.png
new file mode 100644
index 00000000..948c46fe
--- /dev/null
+++ b/gfx/pikachu/unknown_e4b39.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4bde.png b/gfx/pikachu/unknown_e4bde.png
new file mode 100644
index 00000000..18209284
--- /dev/null
+++ b/gfx/pikachu/unknown_e4bde.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4c3e.png b/gfx/pikachu/unknown_e4c3e.png
new file mode 100644
index 00000000..698c15e8
--- /dev/null
+++ b/gfx/pikachu/unknown_e4c3e.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4ce0.png b/gfx/pikachu/unknown_e4ce0.png
new file mode 100644
index 00000000..68a6832b
--- /dev/null
+++ b/gfx/pikachu/unknown_e4ce0.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e4e70.png b/gfx/pikachu/unknown_e4e70.png
new file mode 100644
index 00000000..ee849b32
--- /dev/null
+++ b/gfx/pikachu/unknown_e4e70.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5000.png b/gfx/pikachu/unknown_e5000.png
new file mode 100644
index 00000000..9b2685e4
--- /dev/null
+++ b/gfx/pikachu/unknown_e5000.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e50af.png b/gfx/pikachu/unknown_e50af.png
new file mode 100644
index 00000000..04acf34f
--- /dev/null
+++ b/gfx/pikachu/unknown_e50af.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e523f.png b/gfx/pikachu/unknown_e523f.png
new file mode 100644
index 00000000..810c752a
--- /dev/null
+++ b/gfx/pikachu/unknown_e523f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e52fe.png b/gfx/pikachu/unknown_e52fe.png
new file mode 100644
index 00000000..7a33deec
--- /dev/null
+++ b/gfx/pikachu/unknown_e52fe.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e548e.png b/gfx/pikachu/unknown_e548e.png
new file mode 100644
index 00000000..442025a2
--- /dev/null
+++ b/gfx/pikachu/unknown_e548e.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5541.png b/gfx/pikachu/unknown_e5541.png
new file mode 100644
index 00000000..889fa5f6
--- /dev/null
+++ b/gfx/pikachu/unknown_e5541.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e56d1.png b/gfx/pikachu/unknown_e56d1.png
new file mode 100644
index 00000000..85f96a92
--- /dev/null
+++ b/gfx/pikachu/unknown_e56d1.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5794.png b/gfx/pikachu/unknown_e5794.png
new file mode 100644
index 00000000..4926e791
--- /dev/null
+++ b/gfx/pikachu/unknown_e5794.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5924.png b/gfx/pikachu/unknown_e5924.png
new file mode 100644
index 00000000..b4f15591
--- /dev/null
+++ b/gfx/pikachu/unknown_e5924.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e59ed.png b/gfx/pikachu/unknown_e59ed.png
new file mode 100644
index 00000000..971075ab
--- /dev/null
+++ b/gfx/pikachu/unknown_e59ed.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5b7d.png b/gfx/pikachu/unknown_e5b7d.png
new file mode 100644
index 00000000..2b141191
--- /dev/null
+++ b/gfx/pikachu/unknown_e5b7d.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5c4d.png b/gfx/pikachu/unknown_e5c4d.png
new file mode 100644
index 00000000..07f70a39
--- /dev/null
+++ b/gfx/pikachu/unknown_e5c4d.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5ddd.png b/gfx/pikachu/unknown_e5ddd.png
new file mode 100644
index 00000000..e95e11ba
--- /dev/null
+++ b/gfx/pikachu/unknown_e5ddd.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e5e90.png b/gfx/pikachu/unknown_e5e90.png
new file mode 100644
index 00000000..8e896836
--- /dev/null
+++ b/gfx/pikachu/unknown_e5e90.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6020.png b/gfx/pikachu/unknown_e6020.png
new file mode 100644
index 00000000..7b938b8d
--- /dev/null
+++ b/gfx/pikachu/unknown_e6020.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e61b0.png b/gfx/pikachu/unknown_e61b0.png
new file mode 100644
index 00000000..d0260da7
--- /dev/null
+++ b/gfx/pikachu/unknown_e61b0.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6340.png b/gfx/pikachu/unknown_e6340.png
new file mode 100644
index 00000000..1bb0b1d9
--- /dev/null
+++ b/gfx/pikachu/unknown_e6340.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e63f7.png b/gfx/pikachu/unknown_e63f7.png
new file mode 100644
index 00000000..71ed5a1f
--- /dev/null
+++ b/gfx/pikachu/unknown_e63f7.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6587.png b/gfx/pikachu/unknown_e6587.png
new file mode 100644
index 00000000..0ec65607
--- /dev/null
+++ b/gfx/pikachu/unknown_e6587.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6646.png b/gfx/pikachu/unknown_e6646.png
new file mode 100644
index 00000000..c45de678
--- /dev/null
+++ b/gfx/pikachu/unknown_e6646.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e67d6.png b/gfx/pikachu/unknown_e67d6.png
new file mode 100644
index 00000000..ee5bdacf
--- /dev/null
+++ b/gfx/pikachu/unknown_e67d6.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e682f.png b/gfx/pikachu/unknown_e682f.png
new file mode 100644
index 00000000..d0f522dc
--- /dev/null
+++ b/gfx/pikachu/unknown_e682f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e69bf.png b/gfx/pikachu/unknown_e69bf.png
new file mode 100644
index 00000000..ce8de250
--- /dev/null
+++ b/gfx/pikachu/unknown_e69bf.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6b4f.png b/gfx/pikachu/unknown_e6b4f.png
new file mode 100644
index 00000000..4ea34714
--- /dev/null
+++ b/gfx/pikachu/unknown_e6b4f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6cdf.png b/gfx/pikachu/unknown_e6cdf.png
new file mode 100644
index 00000000..f0f96237
--- /dev/null
+++ b/gfx/pikachu/unknown_e6cdf.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6e6f.png b/gfx/pikachu/unknown_e6e6f.png
new file mode 100644
index 00000000..608af942
--- /dev/null
+++ b/gfx/pikachu/unknown_e6e6f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e6fff.png b/gfx/pikachu/unknown_e6fff.png
new file mode 100644
index 00000000..a722794a
--- /dev/null
+++ b/gfx/pikachu/unknown_e6fff.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e718f.png b/gfx/pikachu/unknown_e718f.png
new file mode 100644
index 00000000..1276764c
--- /dev/null
+++ b/gfx/pikachu/unknown_e718f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e731f.png b/gfx/pikachu/unknown_e731f.png
new file mode 100644
index 00000000..2d6d6bdb
--- /dev/null
+++ b/gfx/pikachu/unknown_e731f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e74af.png b/gfx/pikachu/unknown_e74af.png
new file mode 100644
index 00000000..0aa1592b
--- /dev/null
+++ b/gfx/pikachu/unknown_e74af.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e763f.png b/gfx/pikachu/unknown_e763f.png
new file mode 100644
index 00000000..72f9ef29
--- /dev/null
+++ b/gfx/pikachu/unknown_e763f.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e77cf.png b/gfx/pikachu/unknown_e77cf.png
new file mode 100644
index 00000000..ad94af7a
--- /dev/null
+++ b/gfx/pikachu/unknown_e77cf.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e7863.png b/gfx/pikachu/unknown_e7863.png
new file mode 100644
index 00000000..cd02d18d
--- /dev/null
+++ b/gfx/pikachu/unknown_e7863.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e79f3.png b/gfx/pikachu/unknown_e79f3.png
new file mode 100644
index 00000000..07b8230d
--- /dev/null
+++ b/gfx/pikachu/unknown_e79f3.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e7b83.png b/gfx/pikachu/unknown_e7b83.png
new file mode 100644
index 00000000..8a835dfb
--- /dev/null
+++ b/gfx/pikachu/unknown_e7b83.png
Binary files differ
diff --git a/gfx/pikachu/unknown_e7d13.png b/gfx/pikachu/unknown_e7d13.png
new file mode 100644
index 00000000..3204f702
--- /dev/null
+++ b/gfx/pikachu/unknown_e7d13.png
Binary files differ
diff --git a/gfx/pikachu/unknown_f0abf.png b/gfx/pikachu/unknown_f0abf.png
new file mode 100644
index 00000000..dd553a8a
--- /dev/null
+++ b/gfx/pikachu/unknown_f0abf.png
Binary files differ
diff --git a/gfx/pikachu/unknown_f0b64.png b/gfx/pikachu/unknown_f0b64.png
new file mode 100644
index 00000000..6b0424a8
--- /dev/null
+++ b/gfx/pikachu/unknown_f0b64.png
Binary files differ
diff --git a/gfx/pikachu/unknown_f0cf4.png b/gfx/pikachu/unknown_f0cf4.png
new file mode 100644
index 00000000..a4a4e5f4
--- /dev/null
+++ b/gfx/pikachu/unknown_f0cf4.png
Binary files differ
diff --git a/gfx/pikachu/unknown_f0d82.png b/gfx/pikachu/unknown_f0d82.png
new file mode 100644
index 00000000..1af4b770
--- /dev/null
+++ b/gfx/pikachu/unknown_f0d82.png
Binary files differ
diff --git a/gfx/player/red.png b/gfx/player/red.png
index 9098fc76..dff68167 100644
--- a/gfx/player/red.png
+++ b/gfx/player/red.png
Binary files differ
diff --git a/gfx/pokemon/front/abra.png b/gfx/pokemon/front/abra.png
index 12045ee3..3573a040 100644
--- a/gfx/pokemon/front/abra.png
+++ b/gfx/pokemon/front/abra.png
Binary files differ
diff --git a/gfx/pokemon/front/aerodactyl.png b/gfx/pokemon/front/aerodactyl.png
index 4cbfdeeb..cf0212a0 100644
--- a/gfx/pokemon/front/aerodactyl.png
+++ b/gfx/pokemon/front/aerodactyl.png
Binary files differ
diff --git a/gfx/pokemon/front/alakazam.png b/gfx/pokemon/front/alakazam.png
index 9c379b6a..613ae5ad 100644
--- a/gfx/pokemon/front/alakazam.png
+++ b/gfx/pokemon/front/alakazam.png
Binary files differ
diff --git a/gfx/pokemon/front/arbok.png b/gfx/pokemon/front/arbok.png
index bd8da001..45df87b1 100644
--- a/gfx/pokemon/front/arbok.png
+++ b/gfx/pokemon/front/arbok.png
Binary files differ
diff --git a/gfx/pokemon/front/arcanine.png b/gfx/pokemon/front/arcanine.png
index 5d25961d..77bb89b0 100644
--- a/gfx/pokemon/front/arcanine.png
+++ b/gfx/pokemon/front/arcanine.png
Binary files differ
diff --git a/gfx/pokemon/front/articuno.png b/gfx/pokemon/front/articuno.png
index 66986add..e8ae875e 100644
--- a/gfx/pokemon/front/articuno.png
+++ b/gfx/pokemon/front/articuno.png
Binary files differ
diff --git a/gfx/pokemon/front/beedrill.png b/gfx/pokemon/front/beedrill.png
index 36b4a06f..bc9ca73d 100644
--- a/gfx/pokemon/front/beedrill.png
+++ b/gfx/pokemon/front/beedrill.png
Binary files differ
diff --git a/gfx/pokemon/front/bellsprout.png b/gfx/pokemon/front/bellsprout.png
index e4fc5e18..f3d2ff1c 100644
--- a/gfx/pokemon/front/bellsprout.png
+++ b/gfx/pokemon/front/bellsprout.png
Binary files differ
diff --git a/gfx/pokemon/front/blastoise.png b/gfx/pokemon/front/blastoise.png
index 2192b43a..6cdd8e30 100644
--- a/gfx/pokemon/front/blastoise.png
+++ b/gfx/pokemon/front/blastoise.png
Binary files differ
diff --git a/gfx/pokemon/front/bulbasaur.png b/gfx/pokemon/front/bulbasaur.png
index a2a924c7..27abe273 100644
--- a/gfx/pokemon/front/bulbasaur.png
+++ b/gfx/pokemon/front/bulbasaur.png
Binary files differ
diff --git a/gfx/pokemon/front/butterfree.png b/gfx/pokemon/front/butterfree.png
index 8f1a69aa..951ae4c4 100644
--- a/gfx/pokemon/front/butterfree.png
+++ b/gfx/pokemon/front/butterfree.png
Binary files differ
diff --git a/gfx/pokemon/front/caterpie.png b/gfx/pokemon/front/caterpie.png
index 8e1a49dd..8e3205c9 100644
--- a/gfx/pokemon/front/caterpie.png
+++ b/gfx/pokemon/front/caterpie.png
Binary files differ
diff --git a/gfx/pokemon/front/chansey.png b/gfx/pokemon/front/chansey.png
index 832ba27c..d517535a 100644
--- a/gfx/pokemon/front/chansey.png
+++ b/gfx/pokemon/front/chansey.png
Binary files differ
diff --git a/gfx/pokemon/front/charizard.png b/gfx/pokemon/front/charizard.png
index ad29e489..100416d4 100644
--- a/gfx/pokemon/front/charizard.png
+++ b/gfx/pokemon/front/charizard.png
Binary files differ
diff --git a/gfx/pokemon/front/charmander.png b/gfx/pokemon/front/charmander.png
index 12d16f01..155a68a4 100644
--- a/gfx/pokemon/front/charmander.png
+++ b/gfx/pokemon/front/charmander.png
Binary files differ
diff --git a/gfx/pokemon/front/charmeleon.png b/gfx/pokemon/front/charmeleon.png
index a5cff72f..63808b25 100644
--- a/gfx/pokemon/front/charmeleon.png
+++ b/gfx/pokemon/front/charmeleon.png
Binary files differ
diff --git a/gfx/pokemon/front/clefable.png b/gfx/pokemon/front/clefable.png
index 2fcfac0a..8e5111f9 100644
--- a/gfx/pokemon/front/clefable.png
+++ b/gfx/pokemon/front/clefable.png
Binary files differ
diff --git a/gfx/pokemon/front/clefairy.png b/gfx/pokemon/front/clefairy.png
index 5a7f3721..4a26be0b 100644
--- a/gfx/pokemon/front/clefairy.png
+++ b/gfx/pokemon/front/clefairy.png
Binary files differ
diff --git a/gfx/pokemon/front/cloyster.png b/gfx/pokemon/front/cloyster.png
index 71f63a7f..67542d93 100644
--- a/gfx/pokemon/front/cloyster.png
+++ b/gfx/pokemon/front/cloyster.png
Binary files differ
diff --git a/gfx/pokemon/front/cubone.png b/gfx/pokemon/front/cubone.png
index 23e3a23a..c5dec329 100644
--- a/gfx/pokemon/front/cubone.png
+++ b/gfx/pokemon/front/cubone.png
Binary files differ
diff --git a/gfx/pokemon/front/dewgong.png b/gfx/pokemon/front/dewgong.png
index aac4e65c..c7bb5424 100644
--- a/gfx/pokemon/front/dewgong.png
+++ b/gfx/pokemon/front/dewgong.png
Binary files differ
diff --git a/gfx/pokemon/front/diglett.png b/gfx/pokemon/front/diglett.png
index f92ae5bc..a9becda8 100644
--- a/gfx/pokemon/front/diglett.png
+++ b/gfx/pokemon/front/diglett.png
Binary files differ
diff --git a/gfx/pokemon/front/ditto.png b/gfx/pokemon/front/ditto.png
index 4485e6ec..3c662491 100644
--- a/gfx/pokemon/front/ditto.png
+++ b/gfx/pokemon/front/ditto.png
Binary files differ
diff --git a/gfx/pokemon/front/dodrio.png b/gfx/pokemon/front/dodrio.png
index 92e6839d..45606e63 100644
--- a/gfx/pokemon/front/dodrio.png
+++ b/gfx/pokemon/front/dodrio.png
Binary files differ
diff --git a/gfx/pokemon/front/doduo.png b/gfx/pokemon/front/doduo.png
index 20cba7ba..0aa722c0 100644
--- a/gfx/pokemon/front/doduo.png
+++ b/gfx/pokemon/front/doduo.png
Binary files differ
diff --git a/gfx/pokemon/front/dragonair.png b/gfx/pokemon/front/dragonair.png
index 55d1ef5b..e7fc1448 100644
--- a/gfx/pokemon/front/dragonair.png
+++ b/gfx/pokemon/front/dragonair.png
Binary files differ
diff --git a/gfx/pokemon/front/dragonite.png b/gfx/pokemon/front/dragonite.png
index 4c387c3e..7ac78924 100644
--- a/gfx/pokemon/front/dragonite.png
+++ b/gfx/pokemon/front/dragonite.png
Binary files differ
diff --git a/gfx/pokemon/front/dratini.png b/gfx/pokemon/front/dratini.png
index 9df332e4..5a1a880f 100644
--- a/gfx/pokemon/front/dratini.png
+++ b/gfx/pokemon/front/dratini.png
Binary files differ
diff --git a/gfx/pokemon/front/drowzee.png b/gfx/pokemon/front/drowzee.png
index cc85510b..16d3edfc 100644
--- a/gfx/pokemon/front/drowzee.png
+++ b/gfx/pokemon/front/drowzee.png
Binary files differ
diff --git a/gfx/pokemon/front/dugtrio.png b/gfx/pokemon/front/dugtrio.png
index 433f95ef..c20d01b6 100644
--- a/gfx/pokemon/front/dugtrio.png
+++ b/gfx/pokemon/front/dugtrio.png
Binary files differ
diff --git a/gfx/pokemon/front/eevee.png b/gfx/pokemon/front/eevee.png
index 956f8ce0..7bc62ae9 100644
--- a/gfx/pokemon/front/eevee.png
+++ b/gfx/pokemon/front/eevee.png
Binary files differ
diff --git a/gfx/pokemon/front/ekans.png b/gfx/pokemon/front/ekans.png
index 6dffaf84..1d454a13 100644
--- a/gfx/pokemon/front/ekans.png
+++ b/gfx/pokemon/front/ekans.png
Binary files differ
diff --git a/gfx/pokemon/front/electabuzz.png b/gfx/pokemon/front/electabuzz.png
index 0ddccbe1..77647d26 100644
--- a/gfx/pokemon/front/electabuzz.png
+++ b/gfx/pokemon/front/electabuzz.png
Binary files differ
diff --git a/gfx/pokemon/front/electrode.png b/gfx/pokemon/front/electrode.png
index 8df79e6a..f5e05464 100644
--- a/gfx/pokemon/front/electrode.png
+++ b/gfx/pokemon/front/electrode.png
Binary files differ
diff --git a/gfx/pokemon/front/exeggcute.png b/gfx/pokemon/front/exeggcute.png
index 0ddf8e32..901e2244 100644
--- a/gfx/pokemon/front/exeggcute.png
+++ b/gfx/pokemon/front/exeggcute.png
Binary files differ
diff --git a/gfx/pokemon/front/exeggutor.png b/gfx/pokemon/front/exeggutor.png
index 89ccbdc4..3e8d37cb 100644
--- a/gfx/pokemon/front/exeggutor.png
+++ b/gfx/pokemon/front/exeggutor.png
Binary files differ
diff --git a/gfx/pokemon/front/farfetchd.png b/gfx/pokemon/front/farfetchd.png
index 490e2b7c..8412e767 100644
--- a/gfx/pokemon/front/farfetchd.png
+++ b/gfx/pokemon/front/farfetchd.png
Binary files differ
diff --git a/gfx/pokemon/front/fearow.png b/gfx/pokemon/front/fearow.png
index c2c65257..7b54a854 100644
--- a/gfx/pokemon/front/fearow.png
+++ b/gfx/pokemon/front/fearow.png
Binary files differ
diff --git a/gfx/pokemon/front/flareon.png b/gfx/pokemon/front/flareon.png
index eadebd27..5b0e5376 100644
--- a/gfx/pokemon/front/flareon.png
+++ b/gfx/pokemon/front/flareon.png
Binary files differ
diff --git a/gfx/pokemon/front/gastly.png b/gfx/pokemon/front/gastly.png
index 081b121d..9d236e5a 100644
--- a/gfx/pokemon/front/gastly.png
+++ b/gfx/pokemon/front/gastly.png
Binary files differ
diff --git a/gfx/pokemon/front/gengar.png b/gfx/pokemon/front/gengar.png
index 450662d7..1993bcfc 100644
--- a/gfx/pokemon/front/gengar.png
+++ b/gfx/pokemon/front/gengar.png
Binary files differ
diff --git a/gfx/pokemon/front/geodude.png b/gfx/pokemon/front/geodude.png
index 4202192a..c28db680 100644
--- a/gfx/pokemon/front/geodude.png
+++ b/gfx/pokemon/front/geodude.png
Binary files differ
diff --git a/gfx/pokemon/front/gloom.png b/gfx/pokemon/front/gloom.png
index c2ea9ba4..6071ea5d 100644
--- a/gfx/pokemon/front/gloom.png
+++ b/gfx/pokemon/front/gloom.png
Binary files differ
diff --git a/gfx/pokemon/front/golbat.png b/gfx/pokemon/front/golbat.png
index 6abc6f0a..7d2b17da 100644
--- a/gfx/pokemon/front/golbat.png
+++ b/gfx/pokemon/front/golbat.png
Binary files differ
diff --git a/gfx/pokemon/front/goldeen.png b/gfx/pokemon/front/goldeen.png
index e8cbfddc..c6bbeae5 100644
--- a/gfx/pokemon/front/goldeen.png
+++ b/gfx/pokemon/front/goldeen.png
Binary files differ
diff --git a/gfx/pokemon/front/golduck.png b/gfx/pokemon/front/golduck.png
index 5448f7c8..299b6300 100644
--- a/gfx/pokemon/front/golduck.png
+++ b/gfx/pokemon/front/golduck.png
Binary files differ
diff --git a/gfx/pokemon/front/golem.png b/gfx/pokemon/front/golem.png
index 1dba6a67..7d317b7d 100644
--- a/gfx/pokemon/front/golem.png
+++ b/gfx/pokemon/front/golem.png
Binary files differ
diff --git a/gfx/pokemon/front/graveler.png b/gfx/pokemon/front/graveler.png
index 0d9da672..26d4b0a1 100644
--- a/gfx/pokemon/front/graveler.png
+++ b/gfx/pokemon/front/graveler.png
Binary files differ
diff --git a/gfx/pokemon/front/grimer.png b/gfx/pokemon/front/grimer.png
index 255b10b9..a72c9e45 100644
--- a/gfx/pokemon/front/grimer.png
+++ b/gfx/pokemon/front/grimer.png
Binary files differ
diff --git a/gfx/pokemon/front/growlithe.png b/gfx/pokemon/front/growlithe.png
index b753bce7..e75173cf 100644
--- a/gfx/pokemon/front/growlithe.png
+++ b/gfx/pokemon/front/growlithe.png
Binary files differ
diff --git a/gfx/pokemon/front/gyarados.png b/gfx/pokemon/front/gyarados.png
index a7ed0c17..387c2725 100644
--- a/gfx/pokemon/front/gyarados.png
+++ b/gfx/pokemon/front/gyarados.png
Binary files differ
diff --git a/gfx/pokemon/front/haunter.png b/gfx/pokemon/front/haunter.png
index 4d6c758d..d7f96e3d 100644
--- a/gfx/pokemon/front/haunter.png
+++ b/gfx/pokemon/front/haunter.png
Binary files differ
diff --git a/gfx/pokemon/front/hitmonchan.png b/gfx/pokemon/front/hitmonchan.png
index d8a6ffd3..2fb7122b 100644
--- a/gfx/pokemon/front/hitmonchan.png
+++ b/gfx/pokemon/front/hitmonchan.png
Binary files differ
diff --git a/gfx/pokemon/front/hitmonlee.png b/gfx/pokemon/front/hitmonlee.png
index 36042c68..acbe68ff 100644
--- a/gfx/pokemon/front/hitmonlee.png
+++ b/gfx/pokemon/front/hitmonlee.png
Binary files differ
diff --git a/gfx/pokemon/front/horsea.png b/gfx/pokemon/front/horsea.png
index cd28df8c..390c419d 100644
--- a/gfx/pokemon/front/horsea.png
+++ b/gfx/pokemon/front/horsea.png
Binary files differ
diff --git a/gfx/pokemon/front/hypno.png b/gfx/pokemon/front/hypno.png
index e7434ea4..ed100f66 100644
--- a/gfx/pokemon/front/hypno.png
+++ b/gfx/pokemon/front/hypno.png
Binary files differ
diff --git a/gfx/pokemon/front/ivysaur.png b/gfx/pokemon/front/ivysaur.png
index dad10ae0..4da5664b 100644
--- a/gfx/pokemon/front/ivysaur.png
+++ b/gfx/pokemon/front/ivysaur.png
Binary files differ
diff --git a/gfx/pokemon/front/jigglypuff.png b/gfx/pokemon/front/jigglypuff.png
index a5475777..d11ec165 100644
--- a/gfx/pokemon/front/jigglypuff.png
+++ b/gfx/pokemon/front/jigglypuff.png
Binary files differ
diff --git a/gfx/pokemon/front/jolteon.png b/gfx/pokemon/front/jolteon.png
index 7ecd6fbb..a1942ec6 100644
--- a/gfx/pokemon/front/jolteon.png
+++ b/gfx/pokemon/front/jolteon.png
Binary files differ
diff --git a/gfx/pokemon/front/jynx.png b/gfx/pokemon/front/jynx.png
index 583bd5da..699ab3f5 100644
--- a/gfx/pokemon/front/jynx.png
+++ b/gfx/pokemon/front/jynx.png
Binary files differ
diff --git a/gfx/pokemon/front/kabuto.png b/gfx/pokemon/front/kabuto.png
index e8e44e15..58f27e0f 100644
--- a/gfx/pokemon/front/kabuto.png
+++ b/gfx/pokemon/front/kabuto.png
Binary files differ
diff --git a/gfx/pokemon/front/kabutops.png b/gfx/pokemon/front/kabutops.png
index 39fcb900..e898ca12 100644
--- a/gfx/pokemon/front/kabutops.png
+++ b/gfx/pokemon/front/kabutops.png
Binary files differ
diff --git a/gfx/pokemon/front/kadabra.png b/gfx/pokemon/front/kadabra.png
index 36589440..58aff19a 100644
--- a/gfx/pokemon/front/kadabra.png
+++ b/gfx/pokemon/front/kadabra.png
Binary files differ
diff --git a/gfx/pokemon/front/kakuna.png b/gfx/pokemon/front/kakuna.png
index ee350ffd..fb4ec863 100644
--- a/gfx/pokemon/front/kakuna.png
+++ b/gfx/pokemon/front/kakuna.png
Binary files differ
diff --git a/gfx/pokemon/front/kangaskhan.png b/gfx/pokemon/front/kangaskhan.png
index 1c0ba99c..56ab2619 100644
--- a/gfx/pokemon/front/kangaskhan.png
+++ b/gfx/pokemon/front/kangaskhan.png
Binary files differ
diff --git a/gfx/pokemon/front/kingler.png b/gfx/pokemon/front/kingler.png
index b2bd7418..c7610d11 100644
--- a/gfx/pokemon/front/kingler.png
+++ b/gfx/pokemon/front/kingler.png
Binary files differ
diff --git a/gfx/pokemon/front/koffing.png b/gfx/pokemon/front/koffing.png
index 36961502..9d394cdc 100644
--- a/gfx/pokemon/front/koffing.png
+++ b/gfx/pokemon/front/koffing.png
Binary files differ
diff --git a/gfx/pokemon/front/krabby.png b/gfx/pokemon/front/krabby.png
index b280e8db..fe463732 100644
--- a/gfx/pokemon/front/krabby.png
+++ b/gfx/pokemon/front/krabby.png
Binary files differ
diff --git a/gfx/pokemon/front/lapras.png b/gfx/pokemon/front/lapras.png
index 822c00e9..ee954079 100644
--- a/gfx/pokemon/front/lapras.png
+++ b/gfx/pokemon/front/lapras.png
Binary files differ
diff --git a/gfx/pokemon/front/lickitung.png b/gfx/pokemon/front/lickitung.png
index 050f7d23..3b480655 100644
--- a/gfx/pokemon/front/lickitung.png
+++ b/gfx/pokemon/front/lickitung.png
Binary files differ
diff --git a/gfx/pokemon/front/machamp.png b/gfx/pokemon/front/machamp.png
index c854a2cf..f2bf5a0b 100644
--- a/gfx/pokemon/front/machamp.png
+++ b/gfx/pokemon/front/machamp.png
Binary files differ
diff --git a/gfx/pokemon/front/machoke.png b/gfx/pokemon/front/machoke.png
index 317dad96..7079a52b 100644
--- a/gfx/pokemon/front/machoke.png
+++ b/gfx/pokemon/front/machoke.png
Binary files differ
diff --git a/gfx/pokemon/front/machop.png b/gfx/pokemon/front/machop.png
index 63909c11..cd6d6891 100644
--- a/gfx/pokemon/front/machop.png
+++ b/gfx/pokemon/front/machop.png
Binary files differ
diff --git a/gfx/pokemon/front/magikarp.png b/gfx/pokemon/front/magikarp.png
index e71402f8..881aa50a 100644
--- a/gfx/pokemon/front/magikarp.png
+++ b/gfx/pokemon/front/magikarp.png
Binary files differ
diff --git a/gfx/pokemon/front/magmar.png b/gfx/pokemon/front/magmar.png
index 9bc1d929..839fa204 100644
--- a/gfx/pokemon/front/magmar.png
+++ b/gfx/pokemon/front/magmar.png
Binary files differ
diff --git a/gfx/pokemon/front/magnemite.png b/gfx/pokemon/front/magnemite.png
index f2254bed..4cb5e3da 100644
--- a/gfx/pokemon/front/magnemite.png
+++ b/gfx/pokemon/front/magnemite.png
Binary files differ
diff --git a/gfx/pokemon/front/magneton.png b/gfx/pokemon/front/magneton.png
index 4d0f2cc7..5d2a3eaa 100644
--- a/gfx/pokemon/front/magneton.png
+++ b/gfx/pokemon/front/magneton.png
Binary files differ
diff --git a/gfx/pokemon/front/mankey.png b/gfx/pokemon/front/mankey.png
index 303ce1f2..f3266f29 100644
--- a/gfx/pokemon/front/mankey.png
+++ b/gfx/pokemon/front/mankey.png
Binary files differ
diff --git a/gfx/pokemon/front/marowak.png b/gfx/pokemon/front/marowak.png
index b2d18437..d90e4627 100644
--- a/gfx/pokemon/front/marowak.png
+++ b/gfx/pokemon/front/marowak.png
Binary files differ
diff --git a/gfx/pokemon/front/meowth.png b/gfx/pokemon/front/meowth.png
index 0e706c35..de82b0c2 100644
--- a/gfx/pokemon/front/meowth.png
+++ b/gfx/pokemon/front/meowth.png
Binary files differ
diff --git a/gfx/pokemon/front/metapod.png b/gfx/pokemon/front/metapod.png
index cbfa6e1e..6268ed9a 100644
--- a/gfx/pokemon/front/metapod.png
+++ b/gfx/pokemon/front/metapod.png
Binary files differ
diff --git a/gfx/pokemon/front/mew.png b/gfx/pokemon/front/mew.png
index 7e25a96d..a00783a9 100644
--- a/gfx/pokemon/front/mew.png
+++ b/gfx/pokemon/front/mew.png
Binary files differ
diff --git a/gfx/pokemon/front/mewtwo.png b/gfx/pokemon/front/mewtwo.png
index b7a31296..40c6f217 100644
--- a/gfx/pokemon/front/mewtwo.png
+++ b/gfx/pokemon/front/mewtwo.png
Binary files differ
diff --git a/gfx/pokemon/front/moltres.png b/gfx/pokemon/front/moltres.png
index 7c153998..e5e3d02e 100644
--- a/gfx/pokemon/front/moltres.png
+++ b/gfx/pokemon/front/moltres.png
Binary files differ
diff --git a/gfx/pokemon/front/mr.mime.png b/gfx/pokemon/front/mr.mime.png
index d9085ec6..5a3642d3 100644
--- a/gfx/pokemon/front/mr.mime.png
+++ b/gfx/pokemon/front/mr.mime.png
Binary files differ
diff --git a/gfx/pokemon/front/muk.png b/gfx/pokemon/front/muk.png
index f69b83b7..d7d98e37 100644
--- a/gfx/pokemon/front/muk.png
+++ b/gfx/pokemon/front/muk.png
Binary files differ
diff --git a/gfx/pokemon/front/nidoking.png b/gfx/pokemon/front/nidoking.png
index 24330538..785adc67 100644
--- a/gfx/pokemon/front/nidoking.png
+++ b/gfx/pokemon/front/nidoking.png
Binary files differ
diff --git a/gfx/pokemon/front/nidoqueen.png b/gfx/pokemon/front/nidoqueen.png
index c0043e1b..24f786c7 100644
--- a/gfx/pokemon/front/nidoqueen.png
+++ b/gfx/pokemon/front/nidoqueen.png
Binary files differ
diff --git a/gfx/pokemon/front/nidoranf.png b/gfx/pokemon/front/nidoranf.png
index 6b58b274..1f6532d2 100644
--- a/gfx/pokemon/front/nidoranf.png
+++ b/gfx/pokemon/front/nidoranf.png
Binary files differ
diff --git a/gfx/pokemon/front/nidoranm.png b/gfx/pokemon/front/nidoranm.png
index 92d0cb49..bb960e01 100644
--- a/gfx/pokemon/front/nidoranm.png
+++ b/gfx/pokemon/front/nidoranm.png
Binary files differ
diff --git a/gfx/pokemon/front/nidorina.png b/gfx/pokemon/front/nidorina.png
index 68aca7c4..76edf719 100644
--- a/gfx/pokemon/front/nidorina.png
+++ b/gfx/pokemon/front/nidorina.png
Binary files differ
diff --git a/gfx/pokemon/front/nidorino.png b/gfx/pokemon/front/nidorino.png
index 795bf0c5..c68dbdd1 100644
--- a/gfx/pokemon/front/nidorino.png
+++ b/gfx/pokemon/front/nidorino.png
Binary files differ
diff --git a/gfx/pokemon/front/ninetales.png b/gfx/pokemon/front/ninetales.png
index ed6bb398..f7ff9ff6 100644
--- a/gfx/pokemon/front/ninetales.png
+++ b/gfx/pokemon/front/ninetales.png
Binary files differ
diff --git a/gfx/pokemon/front/oddish.png b/gfx/pokemon/front/oddish.png
index e47dabe1..17281e3b 100644
--- a/gfx/pokemon/front/oddish.png
+++ b/gfx/pokemon/front/oddish.png
Binary files differ
diff --git a/gfx/pokemon/front/omanyte.png b/gfx/pokemon/front/omanyte.png
index bdfa5440..eafbd593 100644
--- a/gfx/pokemon/front/omanyte.png
+++ b/gfx/pokemon/front/omanyte.png
Binary files differ
diff --git a/gfx/pokemon/front/omastar.png b/gfx/pokemon/front/omastar.png
index 3221d3d8..2eb40d37 100644
--- a/gfx/pokemon/front/omastar.png
+++ b/gfx/pokemon/front/omastar.png
Binary files differ
diff --git a/gfx/pokemon/front/onix.png b/gfx/pokemon/front/onix.png
index 44a21a61..1e49634f 100644
--- a/gfx/pokemon/front/onix.png
+++ b/gfx/pokemon/front/onix.png
Binary files differ
diff --git a/gfx/pokemon/front/paras.png b/gfx/pokemon/front/paras.png
index f4909bbd..73c805c8 100644
--- a/gfx/pokemon/front/paras.png
+++ b/gfx/pokemon/front/paras.png
Binary files differ
diff --git a/gfx/pokemon/front/parasect.png b/gfx/pokemon/front/parasect.png
index 938bf53b..def9e493 100644
--- a/gfx/pokemon/front/parasect.png
+++ b/gfx/pokemon/front/parasect.png
Binary files differ
diff --git a/gfx/pokemon/front/persian.png b/gfx/pokemon/front/persian.png
index cc15677a..831a9da8 100644
--- a/gfx/pokemon/front/persian.png
+++ b/gfx/pokemon/front/persian.png
Binary files differ
diff --git a/gfx/pokemon/front/pidgeot.png b/gfx/pokemon/front/pidgeot.png
index 7daf609f..4bb98422 100644
--- a/gfx/pokemon/front/pidgeot.png
+++ b/gfx/pokemon/front/pidgeot.png
Binary files differ
diff --git a/gfx/pokemon/front/pidgeotto.png b/gfx/pokemon/front/pidgeotto.png
index c86b86f1..0490003c 100644
--- a/gfx/pokemon/front/pidgeotto.png
+++ b/gfx/pokemon/front/pidgeotto.png
Binary files differ
diff --git a/gfx/pokemon/front/pidgey.png b/gfx/pokemon/front/pidgey.png
index 70d9dd4a..fe507e6d 100644
--- a/gfx/pokemon/front/pidgey.png
+++ b/gfx/pokemon/front/pidgey.png
Binary files differ
diff --git a/gfx/pokemon/front/pikachu.png b/gfx/pokemon/front/pikachu.png
index 159e47e9..4fc61c87 100644
--- a/gfx/pokemon/front/pikachu.png
+++ b/gfx/pokemon/front/pikachu.png
Binary files differ
diff --git a/gfx/pokemon/front/pinsir.png b/gfx/pokemon/front/pinsir.png
index 320c79cb..0f8d8639 100644
--- a/gfx/pokemon/front/pinsir.png
+++ b/gfx/pokemon/front/pinsir.png
Binary files differ
diff --git a/gfx/pokemon/front/poliwag.png b/gfx/pokemon/front/poliwag.png
index 397d2e66..1c19fd1c 100644
--- a/gfx/pokemon/front/poliwag.png
+++ b/gfx/pokemon/front/poliwag.png
Binary files differ
diff --git a/gfx/pokemon/front/poliwhirl.png b/gfx/pokemon/front/poliwhirl.png
index a7039145..f56f75df 100644
--- a/gfx/pokemon/front/poliwhirl.png
+++ b/gfx/pokemon/front/poliwhirl.png
Binary files differ
diff --git a/gfx/pokemon/front/poliwrath.png b/gfx/pokemon/front/poliwrath.png
index f31d0680..20fe9e6c 100644
--- a/gfx/pokemon/front/poliwrath.png
+++ b/gfx/pokemon/front/poliwrath.png
Binary files differ
diff --git a/gfx/pokemon/front/ponyta.png b/gfx/pokemon/front/ponyta.png
index 4d8c1bee..b4ec63b2 100644
--- a/gfx/pokemon/front/ponyta.png
+++ b/gfx/pokemon/front/ponyta.png
Binary files differ
diff --git a/gfx/pokemon/front/porygon.png b/gfx/pokemon/front/porygon.png
index ba3500c6..f991dd6e 100644
--- a/gfx/pokemon/front/porygon.png
+++ b/gfx/pokemon/front/porygon.png
Binary files differ
diff --git a/gfx/pokemon/front/primeape.png b/gfx/pokemon/front/primeape.png
index 7c5a1a09..a14234f5 100644
--- a/gfx/pokemon/front/primeape.png
+++ b/gfx/pokemon/front/primeape.png
Binary files differ
diff --git a/gfx/pokemon/front/psyduck.png b/gfx/pokemon/front/psyduck.png
index 86772256..75cd2f17 100644
--- a/gfx/pokemon/front/psyduck.png
+++ b/gfx/pokemon/front/psyduck.png
Binary files differ
diff --git a/gfx/pokemon/front/raichu.png b/gfx/pokemon/front/raichu.png
index a29731e5..1ef39dc9 100644
--- a/gfx/pokemon/front/raichu.png
+++ b/gfx/pokemon/front/raichu.png
Binary files differ
diff --git a/gfx/pokemon/front/rapidash.png b/gfx/pokemon/front/rapidash.png
index 62d47506..804e7829 100644
--- a/gfx/pokemon/front/rapidash.png
+++ b/gfx/pokemon/front/rapidash.png
Binary files differ
diff --git a/gfx/pokemon/front/raticate.png b/gfx/pokemon/front/raticate.png
index 64340846..95018e0b 100644
--- a/gfx/pokemon/front/raticate.png
+++ b/gfx/pokemon/front/raticate.png
Binary files differ
diff --git a/gfx/pokemon/front/rattata.png b/gfx/pokemon/front/rattata.png
index 9b391cca..423299bb 100644
--- a/gfx/pokemon/front/rattata.png
+++ b/gfx/pokemon/front/rattata.png
Binary files differ
diff --git a/gfx/pokemon/front/rhydon.png b/gfx/pokemon/front/rhydon.png
index 92406476..6d75e4be 100644
--- a/gfx/pokemon/front/rhydon.png
+++ b/gfx/pokemon/front/rhydon.png
Binary files differ
diff --git a/gfx/pokemon/front/rhyhorn.png b/gfx/pokemon/front/rhyhorn.png
index 9452b701..dcf9dd6a 100644
--- a/gfx/pokemon/front/rhyhorn.png
+++ b/gfx/pokemon/front/rhyhorn.png
Binary files differ
diff --git a/gfx/pokemon/front/sandshrew.png b/gfx/pokemon/front/sandshrew.png
index bcf52215..010908fd 100644
--- a/gfx/pokemon/front/sandshrew.png
+++ b/gfx/pokemon/front/sandshrew.png
Binary files differ
diff --git a/gfx/pokemon/front/sandslash.png b/gfx/pokemon/front/sandslash.png
index 3b212a60..d37a8de1 100644
--- a/gfx/pokemon/front/sandslash.png
+++ b/gfx/pokemon/front/sandslash.png
Binary files differ
diff --git a/gfx/pokemon/front/scyther.png b/gfx/pokemon/front/scyther.png
index 3fe6eeae..51663342 100644
--- a/gfx/pokemon/front/scyther.png
+++ b/gfx/pokemon/front/scyther.png
Binary files differ
diff --git a/gfx/pokemon/front/seadra.png b/gfx/pokemon/front/seadra.png
index e8af292f..150416dc 100644
--- a/gfx/pokemon/front/seadra.png
+++ b/gfx/pokemon/front/seadra.png
Binary files differ
diff --git a/gfx/pokemon/front/seaking.png b/gfx/pokemon/front/seaking.png
index ebe70c7e..75060461 100644
--- a/gfx/pokemon/front/seaking.png
+++ b/gfx/pokemon/front/seaking.png
Binary files differ
diff --git a/gfx/pokemon/front/seel.png b/gfx/pokemon/front/seel.png
index c4b2315a..ef3574b0 100644
--- a/gfx/pokemon/front/seel.png
+++ b/gfx/pokemon/front/seel.png
Binary files differ
diff --git a/gfx/pokemon/front/shellder.png b/gfx/pokemon/front/shellder.png
index cf44a7fe..d7ddfa48 100644
--- a/gfx/pokemon/front/shellder.png
+++ b/gfx/pokemon/front/shellder.png
Binary files differ
diff --git a/gfx/pokemon/front/slowbro.png b/gfx/pokemon/front/slowbro.png
index e61ad34b..e506c9ec 100644
--- a/gfx/pokemon/front/slowbro.png
+++ b/gfx/pokemon/front/slowbro.png
Binary files differ
diff --git a/gfx/pokemon/front/slowpoke.png b/gfx/pokemon/front/slowpoke.png
index fdf701d7..1328f4a0 100644
--- a/gfx/pokemon/front/slowpoke.png
+++ b/gfx/pokemon/front/slowpoke.png
Binary files differ
diff --git a/gfx/pokemon/front/snorlax.png b/gfx/pokemon/front/snorlax.png
index 5b571a18..00c78d27 100644
--- a/gfx/pokemon/front/snorlax.png
+++ b/gfx/pokemon/front/snorlax.png
Binary files differ
diff --git a/gfx/pokemon/front/spearow.png b/gfx/pokemon/front/spearow.png
index 835800a5..d9349987 100644
--- a/gfx/pokemon/front/spearow.png
+++ b/gfx/pokemon/front/spearow.png
Binary files differ
diff --git a/gfx/pokemon/front/squirtle.png b/gfx/pokemon/front/squirtle.png
index bc0c9979..db7aa6c7 100644
--- a/gfx/pokemon/front/squirtle.png
+++ b/gfx/pokemon/front/squirtle.png
Binary files differ
diff --git a/gfx/pokemon/front/starmie.png b/gfx/pokemon/front/starmie.png
index 24025ddf..2ed93b4d 100644
--- a/gfx/pokemon/front/starmie.png
+++ b/gfx/pokemon/front/starmie.png
Binary files differ
diff --git a/gfx/pokemon/front/staryu.png b/gfx/pokemon/front/staryu.png
index 394732e9..320fb6a6 100644
--- a/gfx/pokemon/front/staryu.png
+++ b/gfx/pokemon/front/staryu.png
Binary files differ
diff --git a/gfx/pokemon/front/tangela.png b/gfx/pokemon/front/tangela.png
index eff9c5a5..43d04726 100644
--- a/gfx/pokemon/front/tangela.png
+++ b/gfx/pokemon/front/tangela.png
Binary files differ
diff --git a/gfx/pokemon/front/tauros.png b/gfx/pokemon/front/tauros.png
index 3a4edfee..8086fd13 100644
--- a/gfx/pokemon/front/tauros.png
+++ b/gfx/pokemon/front/tauros.png
Binary files differ
diff --git a/gfx/pokemon/front/tentacool.png b/gfx/pokemon/front/tentacool.png
index 534e5496..88d7fde3 100644
--- a/gfx/pokemon/front/tentacool.png
+++ b/gfx/pokemon/front/tentacool.png
Binary files differ
diff --git a/gfx/pokemon/front/tentacruel.png b/gfx/pokemon/front/tentacruel.png
index 7a26a305..47383372 100644
--- a/gfx/pokemon/front/tentacruel.png
+++ b/gfx/pokemon/front/tentacruel.png
Binary files differ
diff --git a/gfx/pokemon/front/vaporeon.png b/gfx/pokemon/front/vaporeon.png
index 48dafce6..2c35af22 100644
--- a/gfx/pokemon/front/vaporeon.png
+++ b/gfx/pokemon/front/vaporeon.png
Binary files differ
diff --git a/gfx/pokemon/front/venomoth.png b/gfx/pokemon/front/venomoth.png
index e28b1017..9d801497 100644
--- a/gfx/pokemon/front/venomoth.png
+++ b/gfx/pokemon/front/venomoth.png
Binary files differ
diff --git a/gfx/pokemon/front/venonat.png b/gfx/pokemon/front/venonat.png
index edf15889..574ed26b 100644
--- a/gfx/pokemon/front/venonat.png
+++ b/gfx/pokemon/front/venonat.png
Binary files differ
diff --git a/gfx/pokemon/front/venusaur.png b/gfx/pokemon/front/venusaur.png
index dd39184a..f6a964e3 100644
--- a/gfx/pokemon/front/venusaur.png
+++ b/gfx/pokemon/front/venusaur.png
Binary files differ
diff --git a/gfx/pokemon/front/victreebel.png b/gfx/pokemon/front/victreebel.png
index 29a471c8..115c45a3 100644
--- a/gfx/pokemon/front/victreebel.png
+++ b/gfx/pokemon/front/victreebel.png
Binary files differ
diff --git a/gfx/pokemon/front/vileplume.png b/gfx/pokemon/front/vileplume.png
index e788425e..af4f0862 100644
--- a/gfx/pokemon/front/vileplume.png
+++ b/gfx/pokemon/front/vileplume.png
Binary files differ
diff --git a/gfx/pokemon/front/voltorb.png b/gfx/pokemon/front/voltorb.png
index 22d0c675..8b4bc64d 100644
--- a/gfx/pokemon/front/voltorb.png
+++ b/gfx/pokemon/front/voltorb.png
Binary files differ
diff --git a/gfx/pokemon/front/vulpix.png b/gfx/pokemon/front/vulpix.png
index f4780ef2..cef8fbd8 100644
--- a/gfx/pokemon/front/vulpix.png
+++ b/gfx/pokemon/front/vulpix.png
Binary files differ
diff --git a/gfx/pokemon/front/wartortle.png b/gfx/pokemon/front/wartortle.png
index bd844562..961aaf4f 100644
--- a/gfx/pokemon/front/wartortle.png
+++ b/gfx/pokemon/front/wartortle.png
Binary files differ
diff --git a/gfx/pokemon/front/weedle.png b/gfx/pokemon/front/weedle.png
index 445fe8f3..989b57b5 100644
--- a/gfx/pokemon/front/weedle.png
+++ b/gfx/pokemon/front/weedle.png
Binary files differ
diff --git a/gfx/pokemon/front/weepinbell.png b/gfx/pokemon/front/weepinbell.png
index 6ee57334..8dd8fc34 100644
--- a/gfx/pokemon/front/weepinbell.png
+++ b/gfx/pokemon/front/weepinbell.png
Binary files differ
diff --git a/gfx/pokemon/front/weezing.png b/gfx/pokemon/front/weezing.png
index deb2a623..445556b3 100644
--- a/gfx/pokemon/front/weezing.png
+++ b/gfx/pokemon/front/weezing.png
Binary files differ
diff --git a/gfx/pokemon/front/wigglytuff.png b/gfx/pokemon/front/wigglytuff.png
index c7cd495b..c9ae89ad 100644
--- a/gfx/pokemon/front/wigglytuff.png
+++ b/gfx/pokemon/front/wigglytuff.png
Binary files differ
diff --git a/gfx/pokemon/front/zapdos.png b/gfx/pokemon/front/zapdos.png
index 0bd71f4e..47b63d6a 100644
--- a/gfx/pokemon/front/zapdos.png
+++ b/gfx/pokemon/front/zapdos.png
Binary files differ
diff --git a/gfx/pokemon/front/zubat.png b/gfx/pokemon/front/zubat.png
index 73078725..86ac4710 100644
--- a/gfx/pokemon/front/zubat.png
+++ b/gfx/pokemon/front/zubat.png
Binary files differ
diff --git a/gfx/pokemon/front_rg/abra.png b/gfx/pokemon/front_rg/abra.png
deleted file mode 100644
index bc0cb24b..00000000
--- a/gfx/pokemon/front_rg/abra.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/aerodactyl.png b/gfx/pokemon/front_rg/aerodactyl.png
deleted file mode 100644
index 89812b32..00000000
--- a/gfx/pokemon/front_rg/aerodactyl.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/alakazam.png b/gfx/pokemon/front_rg/alakazam.png
deleted file mode 100644
index 3a8b32d1..00000000
--- a/gfx/pokemon/front_rg/alakazam.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/arbok.png b/gfx/pokemon/front_rg/arbok.png
deleted file mode 100644
index dab294f5..00000000
--- a/gfx/pokemon/front_rg/arbok.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/arcanine.png b/gfx/pokemon/front_rg/arcanine.png
deleted file mode 100644
index 0149138b..00000000
--- a/gfx/pokemon/front_rg/arcanine.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/articuno.png b/gfx/pokemon/front_rg/articuno.png
deleted file mode 100644
index 99b6385d..00000000
--- a/gfx/pokemon/front_rg/articuno.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/beedrill.png b/gfx/pokemon/front_rg/beedrill.png
deleted file mode 100644
index b6f31036..00000000
--- a/gfx/pokemon/front_rg/beedrill.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/bellsprout.png b/gfx/pokemon/front_rg/bellsprout.png
deleted file mode 100644
index 380913d5..00000000
--- a/gfx/pokemon/front_rg/bellsprout.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/blastoise.png b/gfx/pokemon/front_rg/blastoise.png
deleted file mode 100644
index 97bf497b..00000000
--- a/gfx/pokemon/front_rg/blastoise.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/bulbasaur.png b/gfx/pokemon/front_rg/bulbasaur.png
deleted file mode 100644
index 1a4676a1..00000000
--- a/gfx/pokemon/front_rg/bulbasaur.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/butterfree.png b/gfx/pokemon/front_rg/butterfree.png
deleted file mode 100644
index 0b3044d4..00000000
--- a/gfx/pokemon/front_rg/butterfree.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/caterpie.png b/gfx/pokemon/front_rg/caterpie.png
deleted file mode 100644
index dca52b88..00000000
--- a/gfx/pokemon/front_rg/caterpie.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/chansey.png b/gfx/pokemon/front_rg/chansey.png
deleted file mode 100644
index fa47540e..00000000
--- a/gfx/pokemon/front_rg/chansey.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/charizard.png b/gfx/pokemon/front_rg/charizard.png
deleted file mode 100644
index a8b87e05..00000000
--- a/gfx/pokemon/front_rg/charizard.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/charmander.png b/gfx/pokemon/front_rg/charmander.png
deleted file mode 100644
index 153f9381..00000000
--- a/gfx/pokemon/front_rg/charmander.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/charmeleon.png b/gfx/pokemon/front_rg/charmeleon.png
deleted file mode 100644
index f60d1294..00000000
--- a/gfx/pokemon/front_rg/charmeleon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/clefable.png b/gfx/pokemon/front_rg/clefable.png
deleted file mode 100644
index 8ef6be5f..00000000
--- a/gfx/pokemon/front_rg/clefable.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/clefairy.png b/gfx/pokemon/front_rg/clefairy.png
deleted file mode 100644
index 632844d5..00000000
--- a/gfx/pokemon/front_rg/clefairy.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/cloyster.png b/gfx/pokemon/front_rg/cloyster.png
deleted file mode 100644
index b6e16485..00000000
--- a/gfx/pokemon/front_rg/cloyster.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/cubone.png b/gfx/pokemon/front_rg/cubone.png
deleted file mode 100644
index 1312b7c7..00000000
--- a/gfx/pokemon/front_rg/cubone.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dewgong.png b/gfx/pokemon/front_rg/dewgong.png
deleted file mode 100644
index 823b7125..00000000
--- a/gfx/pokemon/front_rg/dewgong.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/diglett.png b/gfx/pokemon/front_rg/diglett.png
deleted file mode 100644
index 69b93a90..00000000
--- a/gfx/pokemon/front_rg/diglett.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/ditto.png b/gfx/pokemon/front_rg/ditto.png
deleted file mode 100644
index 1a38c474..00000000
--- a/gfx/pokemon/front_rg/ditto.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dodrio.png b/gfx/pokemon/front_rg/dodrio.png
deleted file mode 100644
index c88fa388..00000000
--- a/gfx/pokemon/front_rg/dodrio.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/doduo.png b/gfx/pokemon/front_rg/doduo.png
deleted file mode 100644
index c95aae73..00000000
--- a/gfx/pokemon/front_rg/doduo.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dragonair.png b/gfx/pokemon/front_rg/dragonair.png
deleted file mode 100644
index fe097cfa..00000000
--- a/gfx/pokemon/front_rg/dragonair.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dragonite.png b/gfx/pokemon/front_rg/dragonite.png
deleted file mode 100644
index 49474a4d..00000000
--- a/gfx/pokemon/front_rg/dragonite.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dratini.png b/gfx/pokemon/front_rg/dratini.png
deleted file mode 100644
index 9c7e454d..00000000
--- a/gfx/pokemon/front_rg/dratini.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/drowzee.png b/gfx/pokemon/front_rg/drowzee.png
deleted file mode 100644
index b8cdf0db..00000000
--- a/gfx/pokemon/front_rg/drowzee.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/dugtrio.png b/gfx/pokemon/front_rg/dugtrio.png
deleted file mode 100644
index 1619ab92..00000000
--- a/gfx/pokemon/front_rg/dugtrio.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/eevee.png b/gfx/pokemon/front_rg/eevee.png
deleted file mode 100644
index b8fcab5a..00000000
--- a/gfx/pokemon/front_rg/eevee.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/ekans.png b/gfx/pokemon/front_rg/ekans.png
deleted file mode 100644
index cd43c69c..00000000
--- a/gfx/pokemon/front_rg/ekans.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/electabuzz.png b/gfx/pokemon/front_rg/electabuzz.png
deleted file mode 100644
index 24791e64..00000000
--- a/gfx/pokemon/front_rg/electabuzz.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/electrode.png b/gfx/pokemon/front_rg/electrode.png
deleted file mode 100644
index ff812003..00000000
--- a/gfx/pokemon/front_rg/electrode.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/exeggcute.png b/gfx/pokemon/front_rg/exeggcute.png
deleted file mode 100644
index 63b55927..00000000
--- a/gfx/pokemon/front_rg/exeggcute.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/exeggutor.png b/gfx/pokemon/front_rg/exeggutor.png
deleted file mode 100644
index dc1f7287..00000000
--- a/gfx/pokemon/front_rg/exeggutor.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/farfetchd.png b/gfx/pokemon/front_rg/farfetchd.png
deleted file mode 100644
index bd97b9e8..00000000
--- a/gfx/pokemon/front_rg/farfetchd.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/fearow.png b/gfx/pokemon/front_rg/fearow.png
deleted file mode 100644
index 93d7a847..00000000
--- a/gfx/pokemon/front_rg/fearow.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/flareon.png b/gfx/pokemon/front_rg/flareon.png
deleted file mode 100644
index 7a39866a..00000000
--- a/gfx/pokemon/front_rg/flareon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/fossilaerodactyl.png b/gfx/pokemon/front_rg/fossilaerodactyl.png
deleted file mode 100644
index 27d5c3ac..00000000
--- a/gfx/pokemon/front_rg/fossilaerodactyl.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/fossilkabutops.png b/gfx/pokemon/front_rg/fossilkabutops.png
deleted file mode 100644
index d37edb02..00000000
--- a/gfx/pokemon/front_rg/fossilkabutops.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/gastly.png b/gfx/pokemon/front_rg/gastly.png
deleted file mode 100644
index a5c0f406..00000000
--- a/gfx/pokemon/front_rg/gastly.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/gengar.png b/gfx/pokemon/front_rg/gengar.png
deleted file mode 100644
index cb31fecf..00000000
--- a/gfx/pokemon/front_rg/gengar.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/geodude.png b/gfx/pokemon/front_rg/geodude.png
deleted file mode 100644
index 02b690e9..00000000
--- a/gfx/pokemon/front_rg/geodude.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/gloom.png b/gfx/pokemon/front_rg/gloom.png
deleted file mode 100644
index c2fd2aa7..00000000
--- a/gfx/pokemon/front_rg/gloom.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/golbat.png b/gfx/pokemon/front_rg/golbat.png
deleted file mode 100644
index 1fb2a341..00000000
--- a/gfx/pokemon/front_rg/golbat.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/goldeen.png b/gfx/pokemon/front_rg/goldeen.png
deleted file mode 100644
index bee7de2a..00000000
--- a/gfx/pokemon/front_rg/goldeen.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/golduck.png b/gfx/pokemon/front_rg/golduck.png
deleted file mode 100644
index a0827b54..00000000
--- a/gfx/pokemon/front_rg/golduck.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/golem.png b/gfx/pokemon/front_rg/golem.png
deleted file mode 100644
index 86ea3c68..00000000
--- a/gfx/pokemon/front_rg/golem.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/graveler.png b/gfx/pokemon/front_rg/graveler.png
deleted file mode 100644
index 5e876f0b..00000000
--- a/gfx/pokemon/front_rg/graveler.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/grimer.png b/gfx/pokemon/front_rg/grimer.png
deleted file mode 100644
index cc6931fb..00000000
--- a/gfx/pokemon/front_rg/grimer.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/growlithe.png b/gfx/pokemon/front_rg/growlithe.png
deleted file mode 100644
index 1aafd535..00000000
--- a/gfx/pokemon/front_rg/growlithe.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/gyarados.png b/gfx/pokemon/front_rg/gyarados.png
deleted file mode 100644
index 4d25aabb..00000000
--- a/gfx/pokemon/front_rg/gyarados.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/haunter.png b/gfx/pokemon/front_rg/haunter.png
deleted file mode 100644
index 531c8a62..00000000
--- a/gfx/pokemon/front_rg/haunter.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/hitmonchan.png b/gfx/pokemon/front_rg/hitmonchan.png
deleted file mode 100644
index 1774dd18..00000000
--- a/gfx/pokemon/front_rg/hitmonchan.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/hitmonlee.png b/gfx/pokemon/front_rg/hitmonlee.png
deleted file mode 100644
index 04ca9be3..00000000
--- a/gfx/pokemon/front_rg/hitmonlee.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/horsea.png b/gfx/pokemon/front_rg/horsea.png
deleted file mode 100644
index 0d11d78c..00000000
--- a/gfx/pokemon/front_rg/horsea.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/hypno.png b/gfx/pokemon/front_rg/hypno.png
deleted file mode 100644
index f29559c2..00000000
--- a/gfx/pokemon/front_rg/hypno.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/ivysaur.png b/gfx/pokemon/front_rg/ivysaur.png
deleted file mode 100644
index 337bc27d..00000000
--- a/gfx/pokemon/front_rg/ivysaur.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/jigglypuff.png b/gfx/pokemon/front_rg/jigglypuff.png
deleted file mode 100644
index 607c429e..00000000
--- a/gfx/pokemon/front_rg/jigglypuff.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/jolteon.png b/gfx/pokemon/front_rg/jolteon.png
deleted file mode 100644
index fab34a30..00000000
--- a/gfx/pokemon/front_rg/jolteon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/jynx.png b/gfx/pokemon/front_rg/jynx.png
deleted file mode 100644
index 6966ce34..00000000
--- a/gfx/pokemon/front_rg/jynx.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kabuto.png b/gfx/pokemon/front_rg/kabuto.png
deleted file mode 100644
index b8923ad7..00000000
--- a/gfx/pokemon/front_rg/kabuto.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kabutops.png b/gfx/pokemon/front_rg/kabutops.png
deleted file mode 100644
index 0f33c4d0..00000000
--- a/gfx/pokemon/front_rg/kabutops.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kadabra.png b/gfx/pokemon/front_rg/kadabra.png
deleted file mode 100644
index 8b8abc1a..00000000
--- a/gfx/pokemon/front_rg/kadabra.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kakuna.png b/gfx/pokemon/front_rg/kakuna.png
deleted file mode 100644
index 0cc6eabf..00000000
--- a/gfx/pokemon/front_rg/kakuna.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kangaskhan.png b/gfx/pokemon/front_rg/kangaskhan.png
deleted file mode 100644
index c9d3361d..00000000
--- a/gfx/pokemon/front_rg/kangaskhan.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/kingler.png b/gfx/pokemon/front_rg/kingler.png
deleted file mode 100644
index c1302fbf..00000000
--- a/gfx/pokemon/front_rg/kingler.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/koffing.png b/gfx/pokemon/front_rg/koffing.png
deleted file mode 100644
index e6dfee04..00000000
--- a/gfx/pokemon/front_rg/koffing.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/krabby.png b/gfx/pokemon/front_rg/krabby.png
deleted file mode 100644
index 2740128f..00000000
--- a/gfx/pokemon/front_rg/krabby.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/lapras.png b/gfx/pokemon/front_rg/lapras.png
deleted file mode 100644
index b696b8d9..00000000
--- a/gfx/pokemon/front_rg/lapras.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/lickitung.png b/gfx/pokemon/front_rg/lickitung.png
deleted file mode 100644
index 3deb9b12..00000000
--- a/gfx/pokemon/front_rg/lickitung.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/machamp.png b/gfx/pokemon/front_rg/machamp.png
deleted file mode 100644
index a6f773a0..00000000
--- a/gfx/pokemon/front_rg/machamp.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/machoke.png b/gfx/pokemon/front_rg/machoke.png
deleted file mode 100644
index ed637897..00000000
--- a/gfx/pokemon/front_rg/machoke.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/machop.png b/gfx/pokemon/front_rg/machop.png
deleted file mode 100644
index a5e20532..00000000
--- a/gfx/pokemon/front_rg/machop.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/magikarp.png b/gfx/pokemon/front_rg/magikarp.png
deleted file mode 100644
index 68bc4f8c..00000000
--- a/gfx/pokemon/front_rg/magikarp.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/magmar.png b/gfx/pokemon/front_rg/magmar.png
deleted file mode 100644
index f12bd2f2..00000000
--- a/gfx/pokemon/front_rg/magmar.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/magnemite.png b/gfx/pokemon/front_rg/magnemite.png
deleted file mode 100644
index fc807398..00000000
--- a/gfx/pokemon/front_rg/magnemite.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/magneton.png b/gfx/pokemon/front_rg/magneton.png
deleted file mode 100644
index 51a3f12c..00000000
--- a/gfx/pokemon/front_rg/magneton.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/mankey.png b/gfx/pokemon/front_rg/mankey.png
deleted file mode 100644
index 9ae43757..00000000
--- a/gfx/pokemon/front_rg/mankey.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/marowak.png b/gfx/pokemon/front_rg/marowak.png
deleted file mode 100644
index 8ac6c6ee..00000000
--- a/gfx/pokemon/front_rg/marowak.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/meowth.png b/gfx/pokemon/front_rg/meowth.png
deleted file mode 100644
index d00a08db..00000000
--- a/gfx/pokemon/front_rg/meowth.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/metapod.png b/gfx/pokemon/front_rg/metapod.png
deleted file mode 100644
index 5d7514f4..00000000
--- a/gfx/pokemon/front_rg/metapod.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/mew.png b/gfx/pokemon/front_rg/mew.png
deleted file mode 100644
index 0d9bef36..00000000
--- a/gfx/pokemon/front_rg/mew.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/mewtwo.png b/gfx/pokemon/front_rg/mewtwo.png
deleted file mode 100644
index b41409ca..00000000
--- a/gfx/pokemon/front_rg/mewtwo.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/moltres.png b/gfx/pokemon/front_rg/moltres.png
deleted file mode 100644
index 52259f4a..00000000
--- a/gfx/pokemon/front_rg/moltres.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/mr.mime.png b/gfx/pokemon/front_rg/mr.mime.png
deleted file mode 100644
index 6dca1791..00000000
--- a/gfx/pokemon/front_rg/mr.mime.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/muk.png b/gfx/pokemon/front_rg/muk.png
deleted file mode 100644
index 8816e939..00000000
--- a/gfx/pokemon/front_rg/muk.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidoking.png b/gfx/pokemon/front_rg/nidoking.png
deleted file mode 100644
index c181e60c..00000000
--- a/gfx/pokemon/front_rg/nidoking.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidoqueen.png b/gfx/pokemon/front_rg/nidoqueen.png
deleted file mode 100644
index 86cba6d6..00000000
--- a/gfx/pokemon/front_rg/nidoqueen.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidoranf.png b/gfx/pokemon/front_rg/nidoranf.png
deleted file mode 100644
index 8d99c920..00000000
--- a/gfx/pokemon/front_rg/nidoranf.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidoranm.png b/gfx/pokemon/front_rg/nidoranm.png
deleted file mode 100644
index 9a93e864..00000000
--- a/gfx/pokemon/front_rg/nidoranm.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidorina.png b/gfx/pokemon/front_rg/nidorina.png
deleted file mode 100644
index a8d277b8..00000000
--- a/gfx/pokemon/front_rg/nidorina.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/nidorino.png b/gfx/pokemon/front_rg/nidorino.png
deleted file mode 100644
index 4d6c9e55..00000000
--- a/gfx/pokemon/front_rg/nidorino.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/ninetales.png b/gfx/pokemon/front_rg/ninetales.png
deleted file mode 100644
index 128e8e53..00000000
--- a/gfx/pokemon/front_rg/ninetales.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/oddish.png b/gfx/pokemon/front_rg/oddish.png
deleted file mode 100644
index 55aa2d09..00000000
--- a/gfx/pokemon/front_rg/oddish.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/omanyte.png b/gfx/pokemon/front_rg/omanyte.png
deleted file mode 100644
index d042710e..00000000
--- a/gfx/pokemon/front_rg/omanyte.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/omastar.png b/gfx/pokemon/front_rg/omastar.png
deleted file mode 100644
index af84f55f..00000000
--- a/gfx/pokemon/front_rg/omastar.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/onix.png b/gfx/pokemon/front_rg/onix.png
deleted file mode 100644
index 3b731ece..00000000
--- a/gfx/pokemon/front_rg/onix.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/paras.png b/gfx/pokemon/front_rg/paras.png
deleted file mode 100644
index b8ee6517..00000000
--- a/gfx/pokemon/front_rg/paras.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/parasect.png b/gfx/pokemon/front_rg/parasect.png
deleted file mode 100644
index 3d58b8e5..00000000
--- a/gfx/pokemon/front_rg/parasect.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/persian.png b/gfx/pokemon/front_rg/persian.png
deleted file mode 100644
index aed4d6dc..00000000
--- a/gfx/pokemon/front_rg/persian.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/pidgeot.png b/gfx/pokemon/front_rg/pidgeot.png
deleted file mode 100644
index 4b4aa72f..00000000
--- a/gfx/pokemon/front_rg/pidgeot.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/pidgeotto.png b/gfx/pokemon/front_rg/pidgeotto.png
deleted file mode 100644
index 58a51f5d..00000000
--- a/gfx/pokemon/front_rg/pidgeotto.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/pidgey.png b/gfx/pokemon/front_rg/pidgey.png
deleted file mode 100644
index 7636fb67..00000000
--- a/gfx/pokemon/front_rg/pidgey.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/pikachu.png b/gfx/pokemon/front_rg/pikachu.png
deleted file mode 100644
index 5a3eb782..00000000
--- a/gfx/pokemon/front_rg/pikachu.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/pinsir.png b/gfx/pokemon/front_rg/pinsir.png
deleted file mode 100644
index 2944c453..00000000
--- a/gfx/pokemon/front_rg/pinsir.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/poliwag.png b/gfx/pokemon/front_rg/poliwag.png
deleted file mode 100644
index a1ad26c8..00000000
--- a/gfx/pokemon/front_rg/poliwag.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/poliwhirl.png b/gfx/pokemon/front_rg/poliwhirl.png
deleted file mode 100644
index d18311d6..00000000
--- a/gfx/pokemon/front_rg/poliwhirl.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/poliwrath.png b/gfx/pokemon/front_rg/poliwrath.png
deleted file mode 100644
index 49f07b96..00000000
--- a/gfx/pokemon/front_rg/poliwrath.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/ponyta.png b/gfx/pokemon/front_rg/ponyta.png
deleted file mode 100644
index c3a67849..00000000
--- a/gfx/pokemon/front_rg/ponyta.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/porygon.png b/gfx/pokemon/front_rg/porygon.png
deleted file mode 100644
index 1ed804ff..00000000
--- a/gfx/pokemon/front_rg/porygon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/primeape.png b/gfx/pokemon/front_rg/primeape.png
deleted file mode 100644
index 42c03f6d..00000000
--- a/gfx/pokemon/front_rg/primeape.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/psyduck.png b/gfx/pokemon/front_rg/psyduck.png
deleted file mode 100644
index cd0a5e9e..00000000
--- a/gfx/pokemon/front_rg/psyduck.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/raichu.png b/gfx/pokemon/front_rg/raichu.png
deleted file mode 100644
index 961d2aeb..00000000
--- a/gfx/pokemon/front_rg/raichu.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/rapidash.png b/gfx/pokemon/front_rg/rapidash.png
deleted file mode 100644
index d118b947..00000000
--- a/gfx/pokemon/front_rg/rapidash.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/raticate.png b/gfx/pokemon/front_rg/raticate.png
deleted file mode 100644
index 895c1006..00000000
--- a/gfx/pokemon/front_rg/raticate.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/rattata.png b/gfx/pokemon/front_rg/rattata.png
deleted file mode 100644
index 8d114876..00000000
--- a/gfx/pokemon/front_rg/rattata.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/rhydon.png b/gfx/pokemon/front_rg/rhydon.png
deleted file mode 100644
index 772e64d8..00000000
--- a/gfx/pokemon/front_rg/rhydon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/rhyhorn.png b/gfx/pokemon/front_rg/rhyhorn.png
deleted file mode 100644
index 1b968785..00000000
--- a/gfx/pokemon/front_rg/rhyhorn.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/sandshrew.png b/gfx/pokemon/front_rg/sandshrew.png
deleted file mode 100644
index e078d6d3..00000000
--- a/gfx/pokemon/front_rg/sandshrew.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/sandslash.png b/gfx/pokemon/front_rg/sandslash.png
deleted file mode 100644
index 55320b96..00000000
--- a/gfx/pokemon/front_rg/sandslash.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/scyther.png b/gfx/pokemon/front_rg/scyther.png
deleted file mode 100644
index de4d89ed..00000000
--- a/gfx/pokemon/front_rg/scyther.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/seadra.png b/gfx/pokemon/front_rg/seadra.png
deleted file mode 100644
index 17cdf4ea..00000000
--- a/gfx/pokemon/front_rg/seadra.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/seaking.png b/gfx/pokemon/front_rg/seaking.png
deleted file mode 100644
index 184f0556..00000000
--- a/gfx/pokemon/front_rg/seaking.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/seel.png b/gfx/pokemon/front_rg/seel.png
deleted file mode 100644
index cb2f7f2e..00000000
--- a/gfx/pokemon/front_rg/seel.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/shellder.png b/gfx/pokemon/front_rg/shellder.png
deleted file mode 100644
index b7c41dd2..00000000
--- a/gfx/pokemon/front_rg/shellder.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/slowbro.png b/gfx/pokemon/front_rg/slowbro.png
deleted file mode 100644
index b67bbc08..00000000
--- a/gfx/pokemon/front_rg/slowbro.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/slowpoke.png b/gfx/pokemon/front_rg/slowpoke.png
deleted file mode 100644
index d59e9008..00000000
--- a/gfx/pokemon/front_rg/slowpoke.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/snorlax.png b/gfx/pokemon/front_rg/snorlax.png
deleted file mode 100644
index c249327d..00000000
--- a/gfx/pokemon/front_rg/snorlax.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/spearow.png b/gfx/pokemon/front_rg/spearow.png
deleted file mode 100644
index c1fce869..00000000
--- a/gfx/pokemon/front_rg/spearow.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/squirtle.png b/gfx/pokemon/front_rg/squirtle.png
deleted file mode 100644
index 3139cddc..00000000
--- a/gfx/pokemon/front_rg/squirtle.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/starmie.png b/gfx/pokemon/front_rg/starmie.png
deleted file mode 100644
index 395fd857..00000000
--- a/gfx/pokemon/front_rg/starmie.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/staryu.png b/gfx/pokemon/front_rg/staryu.png
deleted file mode 100644
index 740089e8..00000000
--- a/gfx/pokemon/front_rg/staryu.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/tangela.png b/gfx/pokemon/front_rg/tangela.png
deleted file mode 100644
index a6f6327c..00000000
--- a/gfx/pokemon/front_rg/tangela.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/tauros.png b/gfx/pokemon/front_rg/tauros.png
deleted file mode 100644
index ae57f111..00000000
--- a/gfx/pokemon/front_rg/tauros.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/tentacool.png b/gfx/pokemon/front_rg/tentacool.png
deleted file mode 100644
index 59a979c2..00000000
--- a/gfx/pokemon/front_rg/tentacool.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/tentacruel.png b/gfx/pokemon/front_rg/tentacruel.png
deleted file mode 100644
index aaf4d426..00000000
--- a/gfx/pokemon/front_rg/tentacruel.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/vaporeon.png b/gfx/pokemon/front_rg/vaporeon.png
deleted file mode 100644
index 72db05da..00000000
--- a/gfx/pokemon/front_rg/vaporeon.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/venomoth.png b/gfx/pokemon/front_rg/venomoth.png
deleted file mode 100644
index e677255e..00000000
--- a/gfx/pokemon/front_rg/venomoth.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/venonat.png b/gfx/pokemon/front_rg/venonat.png
deleted file mode 100644
index cf2f4df1..00000000
--- a/gfx/pokemon/front_rg/venonat.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/venusaur.png b/gfx/pokemon/front_rg/venusaur.png
deleted file mode 100644
index f444a234..00000000
--- a/gfx/pokemon/front_rg/venusaur.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/victreebel.png b/gfx/pokemon/front_rg/victreebel.png
deleted file mode 100644
index 62193011..00000000
--- a/gfx/pokemon/front_rg/victreebel.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/vileplume.png b/gfx/pokemon/front_rg/vileplume.png
deleted file mode 100644
index e39d50e0..00000000
--- a/gfx/pokemon/front_rg/vileplume.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/voltorb.png b/gfx/pokemon/front_rg/voltorb.png
deleted file mode 100644
index c2159e6c..00000000
--- a/gfx/pokemon/front_rg/voltorb.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/vulpix.png b/gfx/pokemon/front_rg/vulpix.png
deleted file mode 100644
index 8b8810ad..00000000
--- a/gfx/pokemon/front_rg/vulpix.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/wartortle.png b/gfx/pokemon/front_rg/wartortle.png
deleted file mode 100644
index 6e65bb7c..00000000
--- a/gfx/pokemon/front_rg/wartortle.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/weedle.png b/gfx/pokemon/front_rg/weedle.png
deleted file mode 100644
index 3efbd49d..00000000
--- a/gfx/pokemon/front_rg/weedle.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/weepinbell.png b/gfx/pokemon/front_rg/weepinbell.png
deleted file mode 100644
index 18b44783..00000000
--- a/gfx/pokemon/front_rg/weepinbell.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/weezing.png b/gfx/pokemon/front_rg/weezing.png
deleted file mode 100644
index 5b30b4e0..00000000
--- a/gfx/pokemon/front_rg/weezing.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/wigglytuff.png b/gfx/pokemon/front_rg/wigglytuff.png
deleted file mode 100644
index e986affd..00000000
--- a/gfx/pokemon/front_rg/wigglytuff.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/zapdos.png b/gfx/pokemon/front_rg/zapdos.png
deleted file mode 100644
index 534ac4a9..00000000
--- a/gfx/pokemon/front_rg/zapdos.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon/front_rg/zubat.png b/gfx/pokemon/front_rg/zubat.png
deleted file mode 100644
index 14dc9118..00000000
--- a/gfx/pokemon/front_rg/zubat.png
+++ /dev/null
Binary files differ
diff --git a/gfx/printer/01.png b/gfx/printer/01.png
new file mode 100644
index 00000000..0c11b9da
--- /dev/null
+++ b/gfx/printer/01.png
Binary files differ
diff --git a/gfx/printer/hp.png b/gfx/printer/hp.png
new file mode 100644
index 00000000..adf086ca
--- /dev/null
+++ b/gfx/printer/hp.png
Binary files differ
diff --git a/gfx/printer/lv.png b/gfx/printer/lv.png
new file mode 100644
index 00000000..0d5c6620
--- /dev/null
+++ b/gfx/printer/lv.png
Binary files differ
diff --git a/gfx/sgb/blue_border.png b/gfx/sgb/blue_border.png
deleted file mode 100644
index 098df2b6..00000000
--- a/gfx/sgb/blue_border.png
+++ /dev/null
Binary files differ
diff --git a/gfx/sgb/blue_border.tilemap b/gfx/sgb/blue_border.tilemap
deleted file mode 100644
index b0b0b94b..00000000
--- a/gfx/sgb/blue_border.tilemap
+++ /dev/null
Binary files differ
diff --git a/gfx/sgb/border.png b/gfx/sgb/border.png
new file mode 100644
index 00000000..7c86a1ec
--- /dev/null
+++ b/gfx/sgb/border.png
Binary files differ
diff --git a/gfx/sgb/border.tilemap b/gfx/sgb/border.tilemap
new file mode 100644
index 00000000..9c97c339
--- /dev/null
+++ b/gfx/sgb/border.tilemap
Binary files differ
diff --git a/gfx/sgb/green_border.png b/gfx/sgb/green_border.png
deleted file mode 100644
index 939f2240..00000000
--- a/gfx/sgb/green_border.png
+++ /dev/null
Binary files differ
diff --git a/gfx/sgb/green_border.tilemap b/gfx/sgb/green_border.tilemap
deleted file mode 100644
index 5381bb17..00000000
--- a/gfx/sgb/green_border.tilemap
+++ /dev/null
Binary files differ
diff --git a/gfx/sgb/red_border.png b/gfx/sgb/red_border.png
deleted file mode 100644
index 7549bb47..00000000
--- a/gfx/sgb/red_border.png
+++ /dev/null
Binary files differ
diff --git a/gfx/sgb/red_border.tilemap b/gfx/sgb/red_border.tilemap
deleted file mode 100644
index 4077ed8e..00000000
--- a/gfx/sgb/red_border.tilemap
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/blue_slots_1.png b/gfx/slots/blue_slots_1.png
deleted file mode 100644
index ea4cf0bd..00000000
--- a/gfx/slots/blue_slots_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/blue_slots_2.png b/gfx/slots/blue_slots_2.png
deleted file mode 100644
index ee8c688e..00000000
--- a/gfx/slots/blue_slots_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/green_slots_1.png b/gfx/slots/green_slots_1.png
deleted file mode 100644
index dc7bffdd..00000000
--- a/gfx/slots/green_slots_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/green_slots_2.png b/gfx/slots/green_slots_2.png
deleted file mode 100644
index 5072b556..00000000
--- a/gfx/slots/green_slots_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/red_slots_1.png b/gfx/slots/red_slots_1.png
deleted file mode 100644
index b27d5801..00000000
--- a/gfx/slots/red_slots_1.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/red_slots_2.png b/gfx/slots/red_slots_2.png
deleted file mode 100644
index 779d0cd8..00000000
--- a/gfx/slots/red_slots_2.png
+++ /dev/null
Binary files differ
diff --git a/gfx/slots/slots_1.png b/gfx/slots/slots_1.png
new file mode 100644
index 00000000..cee209f5
--- /dev/null
+++ b/gfx/slots/slots_1.png
Binary files differ
diff --git a/gfx/slots/slots_2.png b/gfx/slots/slots_2.png
new file mode 100644
index 00000000..b4bdf8a8
--- /dev/null
+++ b/gfx/slots/slots_2.png
Binary files differ
diff --git a/gfx/splash/copyright.png b/gfx/splash/copyright.png
index 49174349..71a2085f 100644
--- a/gfx/splash/copyright.png
+++ b/gfx/splash/copyright.png
Binary files differ
diff --git a/gfx/sprites.asm b/gfx/sprites.asm
index 4bcf678c..c54aef3d 100644
--- a/gfx/sprites.asm
+++ b/gfx/sprites.asm
@@ -27,6 +27,7 @@ ClipboardSprite:: INCBIN "gfx/sprites/clipboard.2bpp"
SnorlaxSprite:: INCBIN "gfx/sprites/snorlax.2bpp"
OldAmberSprite:: INCBIN "gfx/sprites/old_amber.2bpp"
GamblerAsleepSprite:: INCBIN "gfx/sprites/gambler_asleep.2bpp"
+QuestionMarkSprite:: INCBIN "gfx/sprites/question_mark.2bpp"
SECTION "NPC Sprites 2", ROMX
@@ -71,3 +72,18 @@ AgathaSprite:: INCBIN "gfx/sprites/agatha.2bpp"
BrunoSprite:: INCBIN "gfx/sprites/bruno.2bpp"
LoreleiSprite:: INCBIN "gfx/sprites/lorelei.2bpp"
SeelSprite:: INCBIN "gfx/sprites/seel.2bpp"
+
+
+SECTION "NPC Sprites 3", ROMX
+
+OfficerJennySprite:: INCBIN "gfx/sprites/officer_jenny.2bpp"
+PikachuSprite:: INCBIN "gfx/sprites/pikachu.2bpp"
+SandshrewSprite:: INCBIN "gfx/sprites/sandshrew.2bpp"
+OddishSprite:: INCBIN "gfx/sprites/oddish.2bpp"
+BulbasaurSprite:: INCBIN "gfx/sprites/bulbasaur.2bpp"
+JigglypuffSprite:: INCBIN "gfx/sprites/jigglypuff.2bpp"
+ClefairySprite:: INCBIN "gfx/sprites/clefairy.2bpp"
+ChanseySprite:: INCBIN "gfx/sprites/chansey.2bpp"
+SurfingPikachuSprite:: INCBIN "gfx/sprites/surfing_pikachu.2bpp"
+JessieSprite:: INCBIN "gfx/sprites/jessie.2bpp"
+JamesSprite:: INCBIN "gfx/sprites/james.2bpp"
diff --git a/gfx/sprites/bike_shop_clerk.png b/gfx/sprites/bike_shop_clerk.png
index 1ea83685..da3d5ac6 100644
--- a/gfx/sprites/bike_shop_clerk.png
+++ b/gfx/sprites/bike_shop_clerk.png
Binary files differ
diff --git a/gfx/sprites/bulbasaur.png b/gfx/sprites/bulbasaur.png
new file mode 100644
index 00000000..a26d3a37
--- /dev/null
+++ b/gfx/sprites/bulbasaur.png
Binary files differ
diff --git a/gfx/sprites/chansey.png b/gfx/sprites/chansey.png
new file mode 100644
index 00000000..7efade25
--- /dev/null
+++ b/gfx/sprites/chansey.png
Binary files differ
diff --git a/gfx/sprites/clefairy.png b/gfx/sprites/clefairy.png
new file mode 100644
index 00000000..e8502ddd
--- /dev/null
+++ b/gfx/sprites/clefairy.png
Binary files differ
diff --git a/gfx/sprites/daisy.png b/gfx/sprites/daisy.png
index 9bad9116..84f330f1 100644
--- a/gfx/sprites/daisy.png
+++ b/gfx/sprites/daisy.png
Binary files differ
diff --git a/gfx/sprites/james.png b/gfx/sprites/james.png
new file mode 100644
index 00000000..a96772cb
--- /dev/null
+++ b/gfx/sprites/james.png
Binary files differ
diff --git a/gfx/sprites/jessie.png b/gfx/sprites/jessie.png
new file mode 100644
index 00000000..2f4f5a29
--- /dev/null
+++ b/gfx/sprites/jessie.png
Binary files differ
diff --git a/gfx/sprites/jigglypuff.png b/gfx/sprites/jigglypuff.png
new file mode 100644
index 00000000..2fc06ecc
--- /dev/null
+++ b/gfx/sprites/jigglypuff.png
Binary files differ
diff --git a/gfx/sprites/middle_aged_woman.png b/gfx/sprites/middle_aged_woman.png
index c9b556ea..13862615 100644
--- a/gfx/sprites/middle_aged_woman.png
+++ b/gfx/sprites/middle_aged_woman.png
Binary files differ
diff --git a/gfx/sprites/nurse.png b/gfx/sprites/nurse.png
index b49768c8..5defe155 100644
--- a/gfx/sprites/nurse.png
+++ b/gfx/sprites/nurse.png
Binary files differ
diff --git a/gfx/sprites/oddish.png b/gfx/sprites/oddish.png
new file mode 100644
index 00000000..c63e9cc7
--- /dev/null
+++ b/gfx/sprites/oddish.png
Binary files differ
diff --git a/gfx/sprites/officer_jenny.png b/gfx/sprites/officer_jenny.png
new file mode 100644
index 00000000..06eb3e10
--- /dev/null
+++ b/gfx/sprites/officer_jenny.png
Binary files differ
diff --git a/gfx/sprites/pikachu.png b/gfx/sprites/pikachu.png
new file mode 100644
index 00000000..8f00f6d1
--- /dev/null
+++ b/gfx/sprites/pikachu.png
Binary files differ
diff --git a/gfx/sprites/question_mark.png b/gfx/sprites/question_mark.png
new file mode 100644
index 00000000..9c58264e
--- /dev/null
+++ b/gfx/sprites/question_mark.png
Binary files differ
diff --git a/gfx/sprites/sandshrew.png b/gfx/sprites/sandshrew.png
new file mode 100644
index 00000000..8a31d24c
--- /dev/null
+++ b/gfx/sprites/sandshrew.png
Binary files differ
diff --git a/gfx/sprites/surfing_pikachu.png b/gfx/sprites/surfing_pikachu.png
new file mode 100644
index 00000000..546ecbaf
--- /dev/null
+++ b/gfx/sprites/surfing_pikachu.png
Binary files differ
diff --git a/gfx/surfing_pikachu.asm b/gfx/surfing_pikachu.asm
new file mode 100644
index 00000000..51884db2
--- /dev/null
+++ b/gfx/surfing_pikachu.asm
@@ -0,0 +1,3 @@
+SurfingPikachu1Graphics1:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1a.2bpp"
+SurfingPikachu1Graphics2:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1b.2bpp"
+SurfingPikachu1Graphics3:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1c.2bpp"
diff --git a/gfx/surfing_pikachu/surfing_pikachu_1a.png b/gfx/surfing_pikachu/surfing_pikachu_1a.png
new file mode 100644
index 00000000..0bc11684
--- /dev/null
+++ b/gfx/surfing_pikachu/surfing_pikachu_1a.png
Binary files differ
diff --git a/gfx/surfing_pikachu/surfing_pikachu_1b.png b/gfx/surfing_pikachu/surfing_pikachu_1b.png
new file mode 100644
index 00000000..a64eb4c7
--- /dev/null
+++ b/gfx/surfing_pikachu/surfing_pikachu_1b.png
Binary files differ
diff --git a/gfx/surfing_pikachu/surfing_pikachu_1c.png b/gfx/surfing_pikachu/surfing_pikachu_1c.png
new file mode 100644
index 00000000..eeedb243
--- /dev/null
+++ b/gfx/surfing_pikachu/surfing_pikachu_1c.png
Binary files differ
diff --git a/gfx/surfing_pikachu/surfing_pikachu_2.png b/gfx/surfing_pikachu/surfing_pikachu_2.png
new file mode 100644
index 00000000..f8752966
--- /dev/null
+++ b/gfx/surfing_pikachu/surfing_pikachu_2.png
Binary files differ
diff --git a/gfx/surfing_pikachu/surfing_pikachu_3.png b/gfx/surfing_pikachu/surfing_pikachu_3.png
new file mode 100644
index 00000000..91d4a607
--- /dev/null
+++ b/gfx/surfing_pikachu/surfing_pikachu_3.png
Binary files differ
diff --git a/gfx/surfing_pikachu/unknown_f8946.map b/gfx/surfing_pikachu/unknown_f8946.map
new file mode 100644
index 00000000..a89a52b8
--- /dev/null
+++ b/gfx/surfing_pikachu/unknown_f8946.map
@@ -0,0 +1 @@
+           \ No newline at end of file
diff --git a/gfx/surfing_pikachu/unknown_f90bc.map b/gfx/surfing_pikachu/unknown_f90bc.map
new file mode 100644
index 00000000..98b8ba51
--- /dev/null
+++ b/gfx/surfing_pikachu/unknown_f90bc.map
Binary files differ
diff --git a/gfx/surfing_pikachu/unknown_f91ac.map b/gfx/surfing_pikachu/unknown_f91ac.map
new file mode 100644
index 00000000..8a1f06b7
--- /dev/null
+++ b/gfx/surfing_pikachu/unknown_f91ac.map
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/gfx/surfing_pikachu/unknown_f91bb.map b/gfx/surfing_pikachu/unknown_f91bb.map
new file mode 100644
index 00000000..6d8ebb43
--- /dev/null
+++ b/gfx/surfing_pikachu/unknown_f91bb.map
@@ -0,0 +1,2 @@
+
+ \ No newline at end of file
diff --git a/gfx/surfing_pikachu/unknown_f91c8.map b/gfx/surfing_pikachu/unknown_f91c8.map
new file mode 100644
index 00000000..20d18de5
--- /dev/null
+++ b/gfx/surfing_pikachu/unknown_f91c8.map
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/gfx/tilesets.asm b/gfx/tilesets.asm
index f64dc20a..911ad34f 100644
--- a/gfx/tilesets.asm
+++ b/gfx/tilesets.asm
@@ -1,6 +1,7 @@
SECTION "Tilesets 1", ROMX
Overworld_GFX:: INCBIN "gfx/tilesets/overworld.2bpp"
+ ds 32
Overworld_Block:: INCBIN "gfx/blocksets/overworld.bst"
RedsHouse1_GFX::
@@ -61,3 +62,10 @@ Club_GFX:: INCBIN "gfx/tilesets/club.2bpp"
Club_Block:: INCBIN "gfx/blocksets/club.bst"
Underground_GFX:: INCBIN "gfx/tilesets/underground.2bpp"
Underground_Block:: INCBIN "gfx/blocksets/underground.bst"
+
+
+SECTION "Tilesets 4", ROMX
+
+BeachHouse_GFX:: INCBIN "gfx/tilesets/beach_house.2bpp"
+ ds 384
+BeachHouse_Block:: INCBIN "gfx/blocksets/beach_house.bst"
diff --git a/gfx/tilesets/beach_house.png b/gfx/tilesets/beach_house.png
new file mode 100644
index 00000000..f5dccf7a
--- /dev/null
+++ b/gfx/tilesets/beach_house.png
Binary files differ
diff --git a/gfx/tilesets/overworld.png b/gfx/tilesets/overworld.png
index c7533e40..a707eec4 100644
--- a/gfx/tilesets/overworld.png
+++ b/gfx/tilesets/overworld.png
Binary files differ
diff --git a/gfx/tilesets/tilesets_rg/flower.png b/gfx/tilesets/tilesets_rg/flower.png
deleted file mode 100644
index bb54085a..00000000
--- a/gfx/tilesets/tilesets_rg/flower.png
+++ /dev/null
Binary files differ
diff --git a/gfx/tilesets/tilesets_rg/forest.png b/gfx/tilesets/tilesets_rg/forest.png
deleted file mode 100644
index bd01b7cf..00000000
--- a/gfx/tilesets/tilesets_rg/forest.png
+++ /dev/null
Binary files differ
diff --git a/gfx/tilesets/tilesets_rg/overworld.png b/gfx/tilesets/tilesets_rg/overworld.png
deleted file mode 100644
index 009c1359..00000000
--- a/gfx/tilesets/tilesets_rg/overworld.png
+++ /dev/null
Binary files differ
diff --git a/gfx/title/nine.png b/gfx/title/nine.png
new file mode 100644
index 00000000..e6fc8911
--- /dev/null
+++ b/gfx/title/nine.png
Binary files differ
diff --git a/gfx/title/pika_bubble.tilemap b/gfx/title/pika_bubble.tilemap
new file mode 100644
index 00000000..892be3c7
--- /dev/null
+++ b/gfx/title/pika_bubble.tilemap
@@ -0,0 +1 @@
+$%fghi*PQRSTUVWXYZ[\]m^_`abc \ No newline at end of file
diff --git a/gfx/title/pikachu.tilemap b/gfx/title/pikachu.tilemap
new file mode 100644
index 00000000..9fc7de6f
--- /dev/null
+++ b/gfx/title/pikachu.tilemap
Binary files differ
diff --git a/gfx/title/pikachu_bg.png b/gfx/title/pikachu_bg.png
new file mode 100644
index 00000000..245fdbf6
--- /dev/null
+++ b/gfx/title/pikachu_bg.png
Binary files differ
diff --git a/gfx/title/pikachu_ob.png b/gfx/title/pikachu_ob.png
new file mode 100644
index 00000000..066221cb
--- /dev/null
+++ b/gfx/title/pikachu_ob.png
Binary files differ
diff --git a/gfx/title/pokemon_logo.png b/gfx/title/pokemon_logo.png
index cc7582c5..30b4a46d 100644
--- a/gfx/title/pokemon_logo.png
+++ b/gfx/title/pokemon_logo.png
Binary files differ
diff --git a/gfx/title/pokemon_logo.tilemap b/gfx/title/pokemon_logo.tilemap
new file mode 100644
index 00000000..92488a1f
--- /dev/null
+++ b/gfx/title/pokemon_logo.tilemap
@@ -0,0 +1,2 @@
+Ir0
+  !"#$%&'()*+,-./123456789:;<=>?ABCDEFGHJKLMNOjklmnopq \ No newline at end of file
diff --git a/gfx/title/pokemon_logo_corner.png b/gfx/title/pokemon_logo_corner.png
new file mode 100644
index 00000000..ffb2a514
--- /dev/null
+++ b/gfx/title/pokemon_logo_corner.png
Binary files differ
diff --git a/gfx/title/pokemon_logo_japan.png b/gfx/title/pokemon_logo_japan.png
new file mode 100644
index 00000000..d75bb302
--- /dev/null
+++ b/gfx/title/pokemon_logo_japan.png
Binary files differ
diff --git a/gfx/title/red_version.png b/gfx/title/red_version.png
deleted file mode 100644
index e41b4295..00000000
--- a/gfx/title/red_version.png
+++ /dev/null
Binary files differ
diff --git a/gfx/trainer_card/badges.png b/gfx/trainer_card/badges.png
index 8b0fc516..46e7add3 100644
--- a/gfx/trainer_card/badges.png
+++ b/gfx/trainer_card/badges.png
Binary files differ
diff --git a/gfx/trainers/brock.png b/gfx/trainers/brock.png
index fc8f2378..8b33e8b9 100644
--- a/gfx/trainers/brock.png
+++ b/gfx/trainers/brock.png
Binary files differ
diff --git a/gfx/trainers/erika.png b/gfx/trainers/erika.png
index 961d094b..446ed6aa 100644
--- a/gfx/trainers/erika.png
+++ b/gfx/trainers/erika.png
Binary files differ
diff --git a/gfx/trainers/jessiejames.png b/gfx/trainers/jessiejames.png
new file mode 100644
index 00000000..764e5af4
--- /dev/null
+++ b/gfx/trainers/jessiejames.png
Binary files differ
diff --git a/gfx/trainers/misty.png b/gfx/trainers/misty.png
index ea2e655a..a7fdd6bc 100644
--- a/gfx/trainers/misty.png
+++ b/gfx/trainers/misty.png
Binary files differ
diff --git a/gfx/trainers/rival1.png b/gfx/trainers/rival1.png
index 6b94fd27..4a0ba97c 100644
--- a/gfx/trainers/rival1.png
+++ b/gfx/trainers/rival1.png
Binary files differ
diff --git a/gfx/trainers/rival2.png b/gfx/trainers/rival2.png
index df9b2524..e8718589 100644
--- a/gfx/trainers/rival2.png
+++ b/gfx/trainers/rival2.png
Binary files differ
diff --git a/gfx/trainers/rival3.png b/gfx/trainers/rival3.png
index 5e6fc5ff..08e22813 100644
--- a/gfx/trainers/rival3.png
+++ b/gfx/trainers/rival3.png
Binary files differ
diff --git a/gfx/version.asm b/gfx/version.asm
index 6f49bca9..45010029 100644
--- a/gfx/version.asm
+++ b/gfx/version.asm
@@ -1,8 +1,3 @@
Version_GFX:
-IF DEF(_RED)
- INCBIN "gfx/title/red_version.1bpp" ; 10 tiles
-ENDC
-IF DEF(_BLUE)
- INCBIN "gfx/title/blue_version.1bpp" ; 8 tiles
-ENDC
+INCBIN "gfx/title/blue_version.1bpp" ; unused
Version_GFXEnd:
diff --git a/gfx/yellow_intro.asm b/gfx/yellow_intro.asm
new file mode 100644
index 00000000..4bdd1a3f
--- /dev/null
+++ b/gfx/yellow_intro.asm
@@ -0,0 +1,4 @@
+YellowIntroGraphics1: INCBIN "gfx/intro/yellow_intro_1.2bpp"
+YellowIntroGraphics1End::
+YellowIntroGraphics2: INCBIN "gfx/intro/yellow_intro_2.2bpp"
+YellowIntroGraphics2End::
diff --git a/home.asm b/home.asm
index ee507c21..4ae08bc1 100644
--- a/home.asm
+++ b/home.asm
@@ -16,24 +16,22 @@ INCLUDE "home/copy.asm"
SECTION "Home", ROM0
+INCLUDE "home/pikachu_cries.asm"
INCLUDE "home/start.asm"
INCLUDE "home/joypad.asm"
-
-INCLUDE "data/maps/map_header_pointers.asm"
-
INCLUDE "home/overworld.asm"
INCLUDE "home/pokemon.asm"
INCLUDE "home/print_bcd.asm"
INCLUDE "home/pics.asm"
-
-INCLUDE "data/tilesets/collision_tile_ids.asm"
-
+INCLUDE "home/pikachu.asm"
+INCLUDE "home/lcdc.asm"
INCLUDE "home/copy2.asm"
INCLUDE "home/text.asm"
INCLUDE "home/vcopy.asm"
INCLUDE "home/init.asm"
INCLUDE "home/vblank.asm"
INCLUDE "home/fade.asm"
+INCLUDE "home/play_time.asm"
INCLUDE "home/serial.asm"
INCLUDE "home/timer.asm"
INCLUDE "home/audio.asm"
@@ -52,8 +50,10 @@ INCLUDE "home/inventory.asm"
INCLUDE "home/list_menu.asm"
INCLUDE "home/names.asm"
INCLUDE "home/reload_tiles.asm"
+INCLUDE "home/printer.asm"
INCLUDE "home/item.asm"
INCLUDE "home/textbox.asm"
+INCLUDE "home/cgb_palettes.asm"
INCLUDE "home/npc_movement.asm"
INCLUDE "home/trainers.asm"
INCLUDE "home/map_objects.asm"
@@ -82,6 +82,7 @@ INCLUDE "home/palettes.asm"
INCLUDE "home/reload_sprites.asm"
INCLUDE "home/give.asm"
INCLUDE "home/random.asm"
+INCLUDE "home/bankswitch2.asm"
INCLUDE "home/predef.asm"
INCLUDE "home/hidden_objects.asm"
INCLUDE "home/predef_text.asm"
diff --git a/home/audio.asm b/home/audio.asm
index eded85e9..41fb503a 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -24,6 +24,8 @@ PlayDefaultMusicCommon::
jr z, .walking
cp $2
jr z, .surfing
+ call CheckForNoBikingMusicMap
+ jr c, .walking
ld a, MUSIC_BIKE_RIDING
jr .next
@@ -66,33 +68,32 @@ PlayDefaultMusicCommon::
ld [wNewSoundID], a
jp PlaySound
-UpdateMusic6Times::
-; This is called when entering a map, before fading out the current music and
-; playing the default music (i.e. the map's music or biking/surfing music).
- ld a, [wAudioROMBank]
- ld b, a
- cp BANK(Audio1_UpdateMusic)
- jr nz, .checkForAudio2
-; audio 1
- ld hl, Audio1_UpdateMusic
- jr .next
-
-.checkForAudio2
- cp BANK(Audio2_UpdateMusic)
- jr nz, .audio3
-; audio 2
- ld hl, Audio2_UpdateMusic
- jr .next
-
-.audio3
- ld hl, Audio3_UpdateMusic
+CheckForNoBikingMusicMap::
+; probably used to not change music upon getting on bike
+ ld a, [wCurMap]
+ cp ROUTE_23
+ jr z, .found
+ cp VICTORY_ROAD_1F
+ jr z, .found
+ cp VICTORY_ROAD_2F
+ jr z, .found
+ cp VICTORY_ROAD_3F
+ jr z, .found
+ cp INDIGO_PLATEAU
+ jr z, .found
+ and a
+ ret
+.found
+ scf
+ ret
-.next
+UpdateMusic6Times::
ld c, 6
+UpdateMusicCTimes::
.loop
push bc
push hl
- call Bankswitch
+ farcall Audio1_UpdateMusic
pop hl
pop bc
dec c
@@ -135,7 +136,20 @@ PlayMusic::
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
ld a, b
+ jr PlaySound
+Func_2223::
+ xor a
+ ld [wChannelSoundIDs + Ch5], a
+ ld [wChannelSoundIDs + Ch6], a
+ ld [wChannelSoundIDs + Ch7], a
+ ld [wChannelSoundIDs + Ch8], a
+ ldh [rNR10], a
+ ret
+
+StopAllMusic::
+ ld a, SFX_STOP_ALL_MUSIC
+ ld [wNewSoundID], a
; plays music specified by a. If value is $ff, music is stopped
PlaySound::
push hl
@@ -168,47 +182,116 @@ PlaySound::
.noFadeOut
xor a
ld [wNewSoundID], a
+ call DetermineAudioFunction
+ jr .done
+
+.fadeOut
+ ld a, b
+ ld [wLastMusicSoundID], a
+ ld a, [wAudioFadeOutControl]
+ ld [wAudioFadeOutCounterReloadValue], a
+ ld [wAudioFadeOutCounter], a
+ ld a, b
+ ld [wAudioFadeOutControl], a
+.done
+ pop bc
+ pop de
+ pop hl
+ ret
+
+GetNextMusicByte::
ldh a, [hLoadedROMBank]
- ldh [hSavedROMBank], a
+ push af
ld a, [wAudioROMBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
+ ld d, $0
+ ld a, c
+ add a
+ ld e, a
+ ld hl, wChannelCommandPointers
+ add hl, de
+ ld a, [hli]
+ ld e, a
+ ld a, [hld]
+ ld d, a
+ ld a, [de]
+ inc de
+ ld [hl], e
+ inc hl
+ ld [hl], d
+ ld e, a
+ pop af
+ call BankswitchCommon
+ ld a, e
+ ret
+
+InitMusicVariables::
+ push hl
+ push de
+ push bc
+ homecall Audio2_InitMusicVariables
+ pop bc
+ pop de
+ pop hl
+ ret
+
+InitSFXVariables::
+ push hl
+ push de
+ push bc
+ homecall Audio2_InitSFXVariables
+ pop bc
+ pop de
+ pop hl
+ ret
+
+StopAllAudio::
+ push hl
+ push de
+ push bc
+ homecall Audio2_StopAllAudio
+ pop bc
+ pop de
+ pop hl
+ ret
+
+DetermineAudioFunction::
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, [wAudioROMBank]
+ call BankswitchCommon
+; determine the audio function, based on the bank
cp BANK(Audio1_PlaySound)
jr nz, .checkForAudio2
; audio 1
ld a, b
call Audio1_PlaySound
- jr .next2
+ jr .done
.checkForAudio2
cp BANK(Audio2_PlaySound)
- jr nz, .audio3
+ jr nz, .checkForAudio3
; audio 2
ld a, b
call Audio2_PlaySound
- jr .next2
+ jr .done
-.audio3
+.checkForAudio3
+ cp BANK(Audio3_PlaySound)
+ jr nz, .audio4
+; audio 3
ld a, b
call Audio3_PlaySound
-
-.next2
- ldh a, [hSavedROMBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
jr .done
-.fadeOut
+.audio4
+; invalid banks will default to audio 4
+; this is seen when encountering Missingno,
+; as its sprite dimensions overflow to wAudioROMBank
ld a, b
- ld [wLastMusicSoundID], a
- ld a, [wAudioFadeOutControl]
- ld [wAudioFadeOutCounterReloadValue], a
- ld [wAudioFadeOutCounter], a
- ld a, b
- ld [wAudioFadeOutControl], a
+ call Audio4_PlaySound
.done
- pop bc
- pop de
- pop hl
+ pop af
+ call BankswitchCommon
ret
diff --git a/home/bankswitch.asm b/home/bankswitch.asm
index 52c8a45c..3e85e955 100644
--- a/home/bankswitch.asm
+++ b/home/bankswitch.asm
@@ -5,31 +5,11 @@ BankswitchHome::
ldh a, [hLoadedROMBank]
ld [wBankswitchHomeSavedROMBank], a
ld a, [wBankswitchHomeTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
BankswitchBack::
; returns from BankswitchHome
ld a, [wBankswitchHomeSavedROMBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ret
-
-Bankswitch::
-; self-contained bankswitch, use this when not in the home bank
-; switches to the bank in b
- ldh a, [hLoadedROMBank]
- push af
- ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ld bc, .Return
- push bc
- jp hl
-.Return
- pop bc
- ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
diff --git a/home/bankswitch2.asm b/home/bankswitch2.asm
new file mode 100644
index 00000000..cc7169cd
--- /dev/null
+++ b/home/bankswitch2.asm
@@ -0,0 +1,39 @@
+BankswitchCommon::
+ ldh [hLoadedROMBank], a
+ ld [MBC1RomBank], a
+ ret
+
+Bankswitch::
+; self-contained bankswitch, use this when not in the home bank
+; switches to the bank in b
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, b
+ ldh [hLoadedROMBank], a
+ ld [MBC1RomBank], a
+ call JumpToAddress
+ pop bc
+ ld a, b
+ ldh [hLoadedROMBank], a
+ ld [MBC1RomBank], a
+ ret
+JumpToAddress::
+ jp hl
+
+SwitchSRAMBankAndLatchClockData::
+ push af
+ ld a, $1
+ ld [MBC1SRamBankingMode], a
+ ld a, SRAM_ENABLE
+ ld [MBC1SRamEnable], a
+ pop af
+ ld [MBC1SRamBank], a
+ ret
+
+PrepareRTCDataAndDisableSRAM::
+ push af
+ ld a, $0
+ ld [MBC1SRamBankingMode], a
+ ld [MBC1SRamEnable], a
+ pop af
+ ret
diff --git a/home/cgb_palettes.asm b/home/cgb_palettes.asm
new file mode 100644
index 00000000..b8cc92c6
--- /dev/null
+++ b/home/cgb_palettes.asm
@@ -0,0 +1,85 @@
+UpdateGBCPal_BGP::
+ push af
+ ldh a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ldh a, [rBGP]
+ ld b, a
+ ld a, [wLastBGP]
+ cp b
+ jr z, .noChangeInBGP
+ farcall _UpdateGBCPal_BGP
+.noChangeInBGP
+ pop hl
+ pop de
+ pop bc
+.notGBC
+ pop af
+ ret
+
+UpdateGBCPal_OBP0::
+ push af
+ ldh a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ldh a, [rOBP0]
+ ld b, a
+ ld a, [wLastOBP0]
+ cp b
+ jr z, .noChangeInOBP0
+ ld b, BANK(_UpdateGBCPal_OBP)
+ ld hl, _UpdateGBCPal_OBP
+ ld c, CONVERT_OBP0
+ call Bankswitch
+.noChangeInOBP0
+ pop hl
+ pop de
+ pop bc
+.notGBC
+ pop af
+ ret
+
+UpdateGBCPal_OBP1::
+ push af
+ ldh a, [hGBC]
+ and a
+ jr z, .notGBC
+ push bc
+ push de
+ push hl
+ ldh a, [rOBP1]
+ ld b, a
+ ld a, [wLastOBP1]
+ cp b
+ jr z, .noChangeInOBP1
+ ld b, BANK(_UpdateGBCPal_OBP)
+ ld hl, _UpdateGBCPal_OBP
+ ld c, CONVERT_OBP1
+ call Bankswitch
+.noChangeInOBP1
+ pop hl
+ pop de
+ pop bc
+.notGBC
+ pop af
+ ret
+
+Func_3082::
+ ldh a, [hLoadedROMBank]
+ push af
+ call FadeOutAudio
+ ld a, BANK(Music_DoLowHealthAlarm)
+ call BankswitchCommon
+ call Music_DoLowHealthAlarm
+ ld a, BANK(Audio1_UpdateMusic)
+ call BankswitchCommon
+ call Audio1_UpdateMusic
+ pop af
+ call BankswitchCommon
+ ret
diff --git a/home/copy.asm b/home/copy.asm
index 880d1fb7..b239d951 100644
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -1,24 +1,74 @@
FarCopyData::
; Copy bc bytes from a:hl to de.
- ld [wBuffer], a
+ ld [wFarCopyDataSavedROMBank], a
ldh a, [hLoadedROMBank]
push af
- ld a, [wBuffer]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ ld a, [wFarCopyDataSavedROMBank]
+ call BankswitchCommon
call CopyData
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
CopyData::
; Copy bc bytes from hl to de.
+ ld a, b
+ and a
+ jr z, .copybytes
+ ld a, c
+ and a ; is lower byte 0
+ jr z, .loop
+ inc b ; if not, increment b as there are <$100 bytes to copy
+.loop
+ call .copybytes
+ dec b
+ jr nz, .loop
+ ret
+
+.copybytes
ld a, [hli]
ld [de], a
inc de
- dec bc
- ld a, c
- or b
- jr nz, CopyData
+ dec c
+ jr nz, .copybytes
ret
+
+CopyVideoDataAlternate::
+ ldh a, [rLCDC]
+ bit 7, a ; LCD enabled?
+ jp nz, CopyVideoData ; if yes, then copy video data
+ push hl
+ ld h, d
+ ld l, e
+ pop de
+ ld a, b ; save bank
+ push af
+ swap c
+ ld a, $f
+ and c
+ ld b, a
+ ld a, $f0
+ and c
+ ld c, a
+ pop af
+ jp FarCopyData
+
+CopyVideoDataDoubleAlternate::
+ ldh a, [rLCDC]
+ bit 7, a ; LCD enabled?
+ jp nz, CopyVideoDataDouble ; if yes, then copy video data
+ push de
+ ld d, h
+ ld e, l
+ ld a, b
+ push af ; save bank to switch to
+ ld h, $0
+ ld l, c
+ add hl, hl ; get raw length of bytes to copy
+ add hl, hl
+ add hl, hl
+ ld b, h
+ ld c, l
+ pop af
+ pop hl
+ jp FarCopyDataDouble
diff --git a/home/copy2.asm b/home/copy2.asm
index 1c9a56f3..6245ad5d 100644
--- a/home/copy2.asm
+++ b/home/copy2.asm
@@ -1,62 +1,41 @@
-FarCopyData2::
-; Identical to FarCopyData, but uses hROMBankTemp
-; as temp space instead of wBuffer.
- ldh [hROMBankTemp], a
- ldh a, [hLoadedROMBank]
- push af
- ldh a, [hROMBankTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- call CopyData
- pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ret
-
-FarCopyData3::
-; Copy bc bytes from a:de to hl.
- ldh [hROMBankTemp], a
- ldh a, [hLoadedROMBank]
- push af
- ldh a, [hROMBankTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- push hl
- push de
- push de
- ld d, h
- ld e, l
- pop hl
- call CopyData
- pop de
- pop hl
- pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+IsTilePassable::
+; sets carry if tile is passable, resets carry otherwise
+ homecall_sf _IsTilePassable
ret
FarCopyDataDouble::
; Expand bc bytes of 1bpp image data
-; from a:hl to 2bpp data at de.
- ldh [hROMBankTemp], a
+; from a:de to 2bpp data at hl.
+ ld [wFarCopyDataSavedROMBank], a
ldh a, [hLoadedROMBank]
push af
- ldh a, [hROMBankTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
-.loop
- ld a, [hli]
- ld [de], a
- inc de
- ld [de], a
- inc de
- dec bc
+ ld a, [wFarCopyDataSavedROMBank]
+ call BankswitchCommon
+ ld a, h ; swap hl and de
+ ld h, d
+ ld d, a
+ ld a, l
+ ld l, e
+ ld e, a
+ ld a, b
+ and a
+ jr z, .eightbitcopyamount
ld a, c
- or b
- jr nz, .loop
+ and a ; multiple of $100
+ jr z, .expandloop ; if so, do not increment b because the first instance of dec c results in underflow
+.eightbitcopyamount
+ inc b
+.expandloop
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld [hli], a
+ dec c
+ jr nz, .expandloop
+ dec b
+ jr nz, .expandloop
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
CopyVideoData::
@@ -70,11 +49,10 @@ CopyVideoData::
ldh [hAutoBGTransferEnabled], a
ldh a, [hLoadedROMBank]
- ldh [hROMBankTemp], a
+ push af
ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, e
ldh [hVBlankCopySource], a
@@ -94,9 +72,8 @@ CopyVideoData::
.done
ldh [hVBlankCopySize], a
call DelayFrame
- ldh a, [hROMBankTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ pop af
+ call BankswitchCommon
pop af
ldh [hAutoBGTransferEnabled], a
ret
@@ -119,11 +96,10 @@ CopyVideoDataDouble::
xor a ; disable auto-transfer while copying
ldh [hAutoBGTransferEnabled], a
ldh a, [hLoadedROMBank]
- ldh [hROMBankTemp], a
+ push af
ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, e
ldh [hVBlankCopyDoubleSource], a
@@ -143,9 +119,8 @@ CopyVideoDataDouble::
.done
ldh [hVBlankCopyDoubleSize], a
call DelayFrame
- ldh a, [hROMBankTemp]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ pop af
+ call BankswitchCommon
pop af
ldh [hAutoBGTransferEnabled], a
ret
@@ -159,6 +134,42 @@ CopyVideoDataDouble::
ld c, a
jr .loop
+FillMemory::
+ push af
+ ld a, b
+ and a
+ jr z, .eightbitcopyamount
+ ld a, c
+ and a
+ jr z, .mulitpleof0x100
+.eightbitcopyamount
+ inc b
+.mulitpleof0x100
+ pop af
+.loop
+ ld [hli], a
+ dec c
+ jr nz, .loop
+ dec b
+ jr nz, .loop
+ ret
+
+GetFarByte::
+; get a byte from a:hl
+; and return it in a
+ push bc
+ ld b, a
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, b
+ call BankswitchCommon
+ ld b, [hl]
+ pop af
+ call BankswitchCommon
+ ld a, b
+ pop bc
+ ret
+
ClearScreenArea::
; Clear tilemap area cxb at hl.
ld a, " " ; blank tile
diff --git a/home/delay.asm b/home/delay.asm
index 850b23e9..eba865c2 100644
--- a/home/delay.asm
+++ b/home/delay.asm
@@ -26,6 +26,7 @@ WaitForSoundToFinish::
inc hl
inc hl
or [hl]
+ and a
jr nz, .waitLoop
pop hl
ret
diff --git a/home/fade.asm b/home/fade.asm
index f5ddf964..f38878b1 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -16,6 +16,9 @@ LoadGBPal::
ldh [rOBP0], a
ld a, [hli]
ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBFadeInFromBlack::
@@ -34,6 +37,9 @@ GBFadeIncCommon:
ldh [rOBP0], a
ld a, [hli]
ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
@@ -56,6 +62,9 @@ GBFadeDecCommon:
ldh [rOBP0], a
ld a, [hld]
ldh [rBGP], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ld c, 8
call DelayFrames
dec b
diff --git a/home/fade_audio.asm b/home/fade_audio.asm
index 4ad2607d..f4e77c3f 100644
--- a/home/fade_audio.asm
+++ b/home/fade_audio.asm
@@ -38,9 +38,7 @@ FadeOutAudio::
ld b, a
xor a
ld [wAudioFadeOutControl], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, [wAudioSavedROMBank]
ld [wAudioROMBank], a
ld a, b
diff --git a/home/header.asm b/home/header.asm
index c12a0565..671f29b1 100644
--- a/home/header.asm
+++ b/home/header.asm
@@ -49,7 +49,7 @@ SECTION "vblank", ROM0[$0040]
ds $48 - @, 0 ; unused
SECTION "lcd", ROM0[$0048]
- rst $38
+ jp LCDC
ds $50 - @, 0 ; unused
diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm
index eccf1c8f..0003022b 100644
--- a/home/hidden_objects.asm
+++ b/home/hidden_objects.asm
@@ -1,5 +1,6 @@
UpdateCinnabarGymGateTileBlocks::
- farjp UpdateCinnabarGymGateTileBlocks_
+ farcall UpdateCinnabarGymGateTileBlocks_
+ ret
CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
ldh a, [hLoadedROMBank]
@@ -9,22 +10,20 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
jr z, .nothingFound
; A button is pressed
ld a, BANK(CheckForHiddenObject)
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
+ call BankswitchCommon
call CheckForHiddenObject
ldh a, [hDidntFindAnyHiddenObject]
and a
jr nz, .hiddenObjectNotFound
- ld a, [wHiddenObjectFunctionRomBank]
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
- ld de, .returnAddress
- push de
- jp hl
-.returnAddress
xor a
+ ldh [hItemAlreadyFound], a
+ ld a, [wHiddenObjectFunctionRomBank]
+ call BankswitchCommon
+ call JumpToAddress
+ ldh a, [hItemAlreadyFound]
jr .done
.hiddenObjectNotFound
+ predef GetTileAndCoordsInFrontOfPlayer
farcall PrintBookshelfText
ldh a, [hFFDB]
and a
@@ -34,6 +33,5 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
.done
ldh [hItemAlreadyFound], a
pop af
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
+ call BankswitchCommon
ret
diff --git a/home/init.asm b/home/init.asm
index e5840e65..624d2393 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -54,7 +54,7 @@ rLCDC_DEFAULT EQU %11100011
call ClearVram
ld hl, HRAM_Begin
- ld bc, HRAM_End - HRAM_Begin
+ ld bc, HRAM_End - HRAM_Begin - 1
call FillMemory
call ClearSprites
@@ -70,6 +70,8 @@ rLCDC_DEFAULT EQU %11100011
ldh [hSCX], a
ldh [hSCY], a
ldh [rIF], a
+ ld [wc0f3], a
+ ld [wc0f3 + 1], a
ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL
ldh [rIE], a
@@ -133,5 +135,4 @@ StopAllSounds::
ld [wAudioFadeOutControl], a
ld [wNewSoundID], a
ld [wLastMusicSoundID], a
- dec a
- jp PlaySound
+ jp StopAllMusic
diff --git a/home/item_price.asm b/home/item_price.asm
index 98eb31b1..39749ee9 100644
--- a/home/item_price.asm
+++ b/home/item_price.asm
@@ -9,8 +9,7 @@ GetItemPrice::
jr nz, .ok
ld a, $f ; hardcoded Bank
.ok
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld hl, wItemPrices
ld a, [hli]
ld h, [hl]
@@ -33,12 +32,10 @@ GetItemPrice::
jr .done
.getTMPrice
ld a, BANK(GetMachinePrice)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
call GetMachinePrice
.done
ld de, hItemPrice
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
diff --git a/home/joypad.asm b/home/joypad.asm
index 9bc8663e..5eb2962f 100644
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -1,39 +1,5 @@
-ReadJoypad::
-; Poll joypad input.
-; Unlike the hardware register, button
-; presses are indicated by a set bit.
-
- ld a, 1 << 5 ; select direction keys
- ld c, 0
-
- ldh [rJOYP], a
-REPT 6
- ldh a, [rJOYP]
-ENDR
- cpl
- and %1111
- swap a
- ld b, a
-
- ld a, 1 << 4 ; select button keys
- ldh [rJOYP], a
-REPT 10
- ldh a, [rJOYP]
-ENDR
- cpl
- and %1111
- or b
-
- ldh [hJoyInput], a
-
- ld a, 1 << 4 + 1 << 5 ; deselect keys
- ldh [rJOYP], a
- ret
-
Joypad::
-; Update the joypad state variables:
-; [hJoyReleased] keys released since last time
-; [hJoyPressed] keys pressed since last time
-; [hJoyHeld] currently pressed keys
- homecall _Joypad
- ret
+ homejp _Joypad
+
+ReadJoypad::
+ homejp ReadJoypad_
diff --git a/home/joypad2.asm b/home/joypad2.asm
index 139dd3f5..30f9f788 100644
--- a/home/joypad2.asm
+++ b/home/joypad2.asm
@@ -66,7 +66,11 @@ WaitForTextScrollButtonPress::
ld a, [wTownMapSpriteBlinkingEnabled]
and a
jr z, .skipAnimation
- call TownMapSpriteBlinkingAnimation
+ push de
+ push bc
+ callfar TownMapSpriteBlinkingAnimation
+ pop bc
+ pop de
.skipAnimation
hlcoord 18, 16
call HandleDownArrowBlinkTiming
@@ -88,6 +92,7 @@ ManualTextScroll::
cp LINK_STATE_BATTLING
jr z, .inLinkBattle
call WaitForTextScrollButtonPress
+ call WaitForSoundToFinish
ld a, SFX_PRESS_AB
jp PlaySound
.inLinkBattle
diff --git a/home/lcdc.asm b/home/lcdc.asm
new file mode 100644
index 00000000..4b350cc2
--- /dev/null
+++ b/home/lcdc.asm
@@ -0,0 +1,20 @@
+LCDC::
+ push af
+ ldh a, [hLCDCPointer] ; doubles as enabling byte
+ and a
+ jr z, .noLCDCInterrupt
+ push hl
+ ; [C700 + [rLY]] --> [FF00 + [hLCDCPointer]]
+ ldh a, [rLY]
+ ld l, a
+ ld h, HIGH(wLYOverrides)
+ ld h, [hl] ; h != not part of pointer
+ ldh a, [hLCDCPointer]
+ ld l, a
+ ld a, h
+ ld h, $ff
+ ld [hl], a
+ pop hl
+.noLCDCInterrupt
+ pop af
+ reti
diff --git a/home/list_menu.asm b/home/list_menu.asm
index c856e91d..f0480460 100644
--- a/home/list_menu.asm
+++ b/home/list_menu.asm
@@ -68,7 +68,7 @@ DisplayListMenuIDLoop::
.oldManBattle
ld a, "▶"
ldcoord_a 5, 4 ; place menu cursor in front of first menu entry
- ld c, 80
+ ld c, 20
call DelayFrames
xor a
ld [wCurrentMenuItem], a
@@ -195,15 +195,13 @@ DisplayListMenuIDLoop::
DisplayChooseQuantityMenu::
; text box dimensions/coordinates for just quantity
hlcoord 15, 9
- ld b, 1 ; height
- ld c, 3 ; width
+ lb bc, 1, 3 ; height and width
ld a, [wListMenuID]
cp PRICEDITEMLISTMENU
jr nz, .drawTextBox
; text box dimensions/coordinates for quantity and price
hlcoord 7, 9
- ld b, 1 ; height
- ld c, 11 ; width
+ lb bc, 1, 11 ; height and width
.drawTextBox
call TextBoxBorder
hlcoord 16, 10
@@ -335,8 +333,7 @@ ExitListMenu::
PrintListMenuEntries::
hlcoord 5, 3
- ld b, 9
- ld c, 14
+ lb bc, 9, 14
call ClearScreenArea
ld a, [wListPointer]
ld e, a
@@ -351,7 +348,7 @@ PrintListMenuEntries::
jr nz, .skipMultiplying
; if it's an item menu
; item entries are 2 bytes long, so multiply by 2
- sla a
+ add a
sla c
.skipMultiplying
add e
@@ -500,7 +497,7 @@ PrintListMenuEntries::
ld a, [wMenuItemToSwap] ; ID of item chosen for swapping (counts from 1)
and a ; is an item being swapped?
jr z, .nextListEntry
- sla a
+ add a
cp c ; is it this item?
jr nz, .nextListEntry
dec hl
diff --git a/home/load_font.asm b/home/load_font.asm
index 3b56d3a8..8ed0f0a7 100644
--- a/home/load_font.asm
+++ b/home/load_font.asm
@@ -23,7 +23,7 @@ LoadTextBoxTilePatterns::
ld de, vChars2 tile $60
ld bc, TextBoxGraphicsEnd - TextBoxGraphics
ld a, BANK(TextBoxGraphics)
- jp FarCopyData2 ; if LCD is off, transfer all at once
+ jp FarCopyData ; if LCD is off, transfer all at once
.on
ld de, TextBoxGraphics
ld hl, vChars2 tile $60
@@ -39,7 +39,7 @@ LoadHpBarAndStatusTilePatterns::
ld de, vChars2 tile $62
ld bc, HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics
ld a, BANK(HpBarAndStatusGraphics)
- jp FarCopyData2 ; if LCD is off, transfer all at once
+ jp FarCopyData ; if LCD is off, transfer all at once
.on
ld de, HpBarAndStatusGraphics
ld hl, vChars2 tile $62
diff --git a/home/map_objects.asm b/home/map_objects.asm
index 27a69965..a54e8f31 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -70,6 +70,60 @@ IsItemInBag::
and a
ret
+IsSurfingPikachuInParty::
+; set bit 6 of wd472 if true
+; also calls Func_3467, which is a bankswitch to IsStarterPikachuInOurParty
+ ld a, [wd472]
+ and $3f
+ ld [wd472], a
+ ld hl, wPartyMon1
+ ld c, PARTY_LENGTH
+ ld b, SURF
+.loop
+ ld a, [hl]
+ cp STARTER_PIKACHU
+ jr nz, .notPikachu
+ push hl
+ ld de, $8
+ add hl, de
+ ld a, [hli]
+ cp b ; does pikachu have surf as one of its moves
+ jr z, .hasSurf
+ ld a, [hli]
+ cp b
+ jr z, .hasSurf
+ ld a, [hli]
+ cp b
+ jr z, .hasSurf
+ ld a, [hli]
+ cp b
+ jr nz, .noSurf
+.hasSurf
+ ld a, [wd472]
+ set 6, a
+ ld [wd472], a
+.noSurf
+ pop hl
+.notPikachu
+ ld de, wPartyMon2 - wPartyMon1
+ add hl, de
+ dec c
+ jr nz, .loop
+ call Func_3467
+ ret
+
+Func_3467::
+ push hl
+ push bc
+ callfar IsStarterPikachuInOurParty
+ pop bc
+ pop hl
+ ret nc
+ ld a, [wd472]
+ set 7, a
+ ld [wd472], a
+ ret
+
DisplayPokedex::
ld [wd11e], a
farjp _DisplayPokedex
@@ -93,6 +147,26 @@ SetSpriteImageIndexAfterSettingFacingDirection::
ld [hl], a
ret
+SpriteFunc_34a1::
+ ldh a, [hSpriteIndex]
+ swap a
+ add $e
+ ld l, a
+ ld h, $c2
+ ld c, [hl]
+ dec c
+ swap c
+ ldh a, [hSpriteOffset]
+ add c
+ ld c, a
+ ldh a, [hSpriteHeight]
+ swap a
+ add $2
+ ld l, a
+ dec h
+ ld [hl], c
+ ret
+
; tests if the player's coordinates are in a specified array
; INPUT:
; hl = address of array
@@ -241,8 +315,8 @@ GetSpriteMovementByte2Pointer::
ldh a, [hSpriteIndex]
dec a
add a
- ld d, 0
ld e, a
+ ld d, 0
add hl, de
pop de
ret
diff --git a/home/names2.asm b/home/names2.asm
index 7b905fc5..b0be05df 100644
--- a/home/names2.asm
+++ b/home/names2.asm
@@ -47,8 +47,7 @@ GetName::
.otherEntries
; 2-7 = other names
ld a, [wPredefBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, [wNameListType]
dec a
add a
@@ -95,6 +94,5 @@ GetName::
pop bc
pop hl
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
diff --git a/home/npc_movement.asm b/home/npc_movement.asm
index a3367f9a..40942bf3 100644
--- a/home/npc_movement.asm
+++ b/home/npc_movement.asm
@@ -31,13 +31,11 @@ RunNPCMovementScript::
ldh a, [hLoadedROMBank]
push af
ld a, [wNPCMovementScriptBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld a, [wNPCMovementScriptFunctionNum]
call CallFunctionInTable
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
.NPCMovementScriptPointerTables
@@ -52,13 +50,11 @@ EndNPCMovementScript::
DebugPressedOrHeldB::
IF DEF(_DEBUG)
- ld a, [wd732]
- bit 1, a
- ret z
ldh a, [hJoyHeld]
bit BIT_B_BUTTON, a
ret nz
ldh a, [hJoyPressed]
bit BIT_B_BUTTON, a
+ ret
ENDC
ret
diff --git a/home/overworld.asm b/home/overworld.asm
index eb6f2ddb..50edcf74 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -1,8 +1,3 @@
-HandleMidJump::
-; Handle the player jumping down
-; a ledge in the overworld.
- farjp _HandleMidJump
-
EnterMap::
; Load a new map.
ld a, $ff
@@ -24,11 +19,18 @@ EnterMap::
ld a, [hl]
and 1 << 4 | 1 << 3 ; fly warp or dungeon warp
jr z, .didNotEnterUsingFlyWarpOrDungeonWarp
- res 3, [hl]
farcall EnterMapAnim
call UpdateSprites
+ ld hl, wd732
+ res 3, [hl]
+ ld hl, wd72e
+ res 4, [hl]
.didNotEnterUsingFlyWarpOrDungeonWarp
+ call IsSurfingPikachuInParty
farcall CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road
+ ld hl, wd732
+ bit 4, [hl]
+ res 4, [hl]
ld hl, wd72d
res 5, [hl]
call UpdateSprites
@@ -42,10 +44,9 @@ OverworldLoop::
call DelayFrame
OverworldLoopLessDelay::
call DelayFrame
+ call IsSurfingPikachuInParty
call LoadGBPal
- ld a, [wd736]
- bit 6, a ; jumping down a ledge?
- call nz, HandleMidJump
+ call HandleMidJump
ld a, [wWalkCounter]
and a
jp nz, .moveAhead ; if the player sprite has not yet completed the walking animation
@@ -91,7 +92,10 @@ OverworldLoopLessDelay::
ldh a, [hItemAlreadyFound]
and a
jp z, OverworldLoop ; jump if a hidden object or bookshelf was found, but not if a card key door was found
+ xor a
+ ld [wd436], a ; new yellow address
call IsSpriteOrSignInFrontOfPlayer
+ call Func_0ffe
ldh a, [hSpriteIndexOrTextID]
and a
jp z, OverworldLoop
@@ -109,39 +113,31 @@ OverworldLoopLessDelay::
ld a, [wEnteringCableClub]
and a
jr z, .checkForOpponent
- dec a
- ld a, 0
- ld [wEnteringCableClub], a
- jr z, .changeMap
-; XXX can this code be reached?
- predef LoadSAV
- ld a, [wCurMap]
- ld [wDestinationMap], a
- call SpecialWarpIn
- ld a, [wCurMap]
- call SwitchToMapRomBank ; switch to the ROM bank of the current map
- ld hl, wCurMapTileset
- set 7, [hl]
-.changeMap
+ xor a
+ ld [wLinkTimeoutCounter], a
jp EnterMap
.checkForOpponent
ld a, [wCurOpponent]
and a
jp nz, .newBattle
jp OverworldLoop
+
.noDirectionButtonsPressed
+ call UpdateSprites
ld hl, wFlags_0xcd60
res 2, [hl]
- call UpdateSprites
+ xor a
+ ld [wd435], a
ld a, 1
ld [wCheckFor180DegreeTurn], a
ld a, [wPlayerMovingDirection] ; the direction that was pressed last time
and a
- jp z, OverworldLoop
+ jr z, .overworldloop
; if a direction was pressed last time
ld [wPlayerLastStopDirection], a ; save the last direction
xor a
ld [wPlayerMovingDirection], a ; zero the direction
+.overworldloop
jp OverworldLoop
.checkIfDownButtonIsPressed
@@ -174,7 +170,7 @@ OverworldLoopLessDelay::
jr z, .noDirectionButtonsPressed
ld a, 1
ld [wSpritePlayerStateData1XStepVector], a
-
+ ld a, 1
.handleDirectionButtonPress
ld [wPlayerDirection], a ; new direction
@@ -189,44 +185,13 @@ OverworldLoopLessDelay::
ld a, [wPlayerLastStopDirection] ; old direction
cp b
jr z, .noDirectionChange
-; Check whether the player did a 180-degree turn.
-; It appears that this code was supposed to show the player rotate by having
-; the player's sprite face an intermediate direction before facing the opposite
-; direction (instead of doing an instantaneous about-face), but the intermediate
-; direction is only set for a short period of time. It is unlikely for it to
-; ever be visible because DelayFrame is called at the start of OverworldLoop and
-; normally not enough cycles would be executed between then and the time the
-; direction is set for V-blank to occur while the direction is still set.
- swap a ; put old direction in upper half
- or b ; put new direction in lower half
- cp (PLAYER_DIR_DOWN << 4) | PLAYER_DIR_UP ; change dir from down to up
- jr nz, .notDownToUp
- ld a, PLAYER_DIR_LEFT
- ld [wPlayerMovingDirection], a
- jr .holdIntermediateDirectionLoop
-.notDownToUp
- cp (PLAYER_DIR_UP << 4) | PLAYER_DIR_DOWN ; change dir from up to down
- jr nz, .notUpToDown
- ld a, PLAYER_DIR_RIGHT
- ld [wPlayerMovingDirection], a
- jr .holdIntermediateDirectionLoop
-.notUpToDown
- cp (PLAYER_DIR_RIGHT << 4) | PLAYER_DIR_LEFT ; change dir from right to left
- jr nz, .notRightToLeft
- ld a, PLAYER_DIR_DOWN
- ld [wPlayerMovingDirection], a
- jr .holdIntermediateDirectionLoop
-.notRightToLeft
- cp (PLAYER_DIR_LEFT << 4) | PLAYER_DIR_RIGHT ; change dir from left to right
- jr nz, .holdIntermediateDirectionLoop
- ld a, PLAYER_DIR_UP
- ld [wPlayerMovingDirection], a
-.holdIntermediateDirectionLoop
+ ld a, $8
+ ld [wd435], a
+; unlike in red/blue, yellow does not have the 180 degrees odd code
ld hl, wFlags_0xcd60
set 2, [hl]
- ld hl, wCheckFor180DegreeTurn
- dec [hl]
- jr nz, .holdIntermediateDirectionLoop
+ xor a
+ ld [wCheckFor180DegreeTurn], a
ld a, [wPlayerDirection]
ld [wPlayerMovingDirection], a
call NewBattle
@@ -263,48 +228,26 @@ OverworldLoopLessDelay::
.noCollision
ld a, $08
ld [wWalkCounter], a
+ callfar Func_fcc08
jr .moveAhead2
.moveAhead
- ld a, [wd736]
- bit 7, a
- jr z, .noSpinning
- farcall LoadSpinnerArrowTiles
-.noSpinning
+ call IsSpinning
call UpdateSprites
.moveAhead2
ld hl, wFlags_0xcd60
res 2, [hl]
- ld a, [wWalkBikeSurfState]
- dec a ; riding a bike?
- jr nz, .normalPlayerSpriteAdvancement
- ld a, [wd736]
- bit 6, a ; jumping a ledge?
- jr nz, .normalPlayerSpriteAdvancement
+ xor a
+ ld [wd435], a
call DoBikeSpeedup
-.normalPlayerSpriteAdvancement
call AdvancePlayerSprite
ld a, [wWalkCounter]
and a
jp nz, CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works)
; walking animation finished
- ld a, [wd730]
- bit 7, a
- jr nz, .doneStepCounting ; if button presses are being simulated, don't count steps
-; step counting
- ld hl, wStepCounter
- dec [hl]
- ld a, [wd72c]
- bit 0, a
- jr z, .doneStepCounting
- ld hl, wNumberOfNoRandomBattleStepsLeft
- dec [hl]
- jr nz, .doneStepCounting
- ld hl, wd72c
- res 0, [hl] ; indicate that the player has stepped thrice since the last battle
-.doneStepCounting
- CheckEvent EVENT_IN_SAFARI_ZONE
+ call StepCountCheck
+ CheckEvent EVENT_IN_SAFARI_ZONE ; in the safari zone?
jr z, .notSafariZone
farcall SafariZoneCheckSteps
ld a, [wSafariZoneGameOver]
@@ -346,12 +289,31 @@ OverworldLoopLessDelay::
callfar AnyPartyAlive
ld a, d
and a
- jr z, .allPokemonFainted
+ jr z, AllPokemonFainted
.noFaintCheck
ld c, 10
call DelayFrames
jp EnterMap
-.allPokemonFainted
+
+StepCountCheck::
+ ld a, [wd730]
+ bit 7, a
+ jr nz, .doneStepCounting ; if button presses are being simulated, don't count steps
+; step counting
+ ld hl, wStepCounter
+ dec [hl]
+ ld a, [wd72c]
+ bit 0, a
+ jr z, .doneStepCounting
+ ld hl, wNumberOfNoRandomBattleStepsLeft
+ dec [hl]
+ jr nz, .doneStepCounting
+ ld hl, wd72c
+ res 0, [hl] ; indicate that the player has stepped thrice since the last battle
+.doneStepCounting
+ ret
+
+AllPokemonFainted::
ld a, $ff
ld [wIsInBattle], a
call RunMapScript
@@ -375,6 +337,12 @@ NewBattle::
; function to make bikes twice as fast as walking
DoBikeSpeedup::
+ ld a, [wWalkBikeSurfState]
+ dec a ; riding a bike?
+ ret nz
+ ld a, [wd736]
+ bit 6, a
+ ret nz
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
@@ -385,15 +353,16 @@ DoBikeSpeedup::
and D_UP | D_LEFT | D_RIGHT
ret nz
.goFaster
- jp AdvancePlayerSprite
+ call AdvancePlayerSprite
+ ret
; check if the player has stepped onto a warp after having not collided
CheckWarpsNoCollision::
ld a, [wNumberOfWarps]
and a
jp z, CheckMapConnections
- ld a, [wNumberOfWarps]
ld b, 0
+ ld a, [wNumberOfWarps]
ld c, a
ld a, [wYCoord]
ld d, a
@@ -436,6 +405,17 @@ CheckWarpsNoCollisionLoop::
jr z, CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp
jr WarpFound1
+CheckWarpsNoCollisionRetry1::
+ inc hl
+CheckWarpsNoCollisionRetry2::
+ inc hl
+ inc hl
+ContinueCheckWarpsNoCollisionLoop::
+ inc b ; increment warp number
+ dec c ; decrement number of warps
+ jp nz, CheckWarpsNoCollisionLoop
+ jp CheckMapConnections
+
; check if the player has stepped onto a warp after having collided
CheckWarpsCollision::
ld a, [wNumberOfWarps]
@@ -466,13 +446,6 @@ CheckWarpsCollision::
jr nz, .loop
jp OverworldLoop
-CheckWarpsNoCollisionRetry1::
- inc hl
-CheckWarpsNoCollisionRetry2::
- inc hl
- inc hl
- jp ContinueCheckWarpsNoCollisionLoop
-
WarpFound1::
ld a, [hli]
ld [wDestinationWarpID], a
@@ -500,6 +473,7 @@ WarpFound2::
ld [wMapPalOffset], a
call GBFadeOutToBlack
.notRockTunnel
+ callfar SetPikachuSpawnOutside
call PlayMapChangeSound
jr .done
@@ -516,9 +490,9 @@ WarpFound2::
dec a ; is the player on a warp pad?
jr nz, .notWarpPad
; if the player is on a warp pad
+ call LeaveMapAnim
ld hl, wd732
set 3, [hl]
- call LeaveMapAnim
jr .skipMapChangeSound
.notWarpPad
call PlayMapChangeSound
@@ -526,8 +500,11 @@ WarpFound2::
ld hl, wd736
res 0, [hl]
res 1, [hl]
+ callfar SetPikachuSpawnWarpPad
jr .done
+
.goBackOutside
+ callfar SetPikachuSpawnBackOutside
ld a, [wLastMap]
ld [wCurMap], a
call PlayMapChangeSound
@@ -539,11 +516,6 @@ WarpFound2::
call IgnoreInputForHalfSecond
jp EnterMap
-ContinueCheckWarpsNoCollisionLoop::
- inc b ; increment warp number
- dec c ; decrement number of warps
- jp nz, CheckWarpsNoCollisionLoop
-
; if no matching warp was found
CheckMapConnections::
.checkWestMap
@@ -673,13 +645,17 @@ CheckMapConnections::
ld a, h
ld [wCurrentTileBlockMapViewPointer + 1], a
.loadNewMap ; load the connected map that was entered
+ ld hl, wPikachuOverworldStateFlags
+ set 4, [hl]
+ ld a, $2
+ ld [wPikachuSpawnState], a
call LoadMapHeader
call PlayDefaultMusicFadeOutCurrent
ld b, SET_PAL_OVERWORLD
call RunPaletteCommand
; Since the sprite set shouldn't change, this will just update VRAM slots at
; x#SPRITESTATEDATA2_IMAGEBASEOFFSET without loading any tile patterns.
- farcall InitMapSprites
+ call InitMapSprites
call LoadTileBlockMap
jp OverworldLoopLessDelay
@@ -688,6 +664,11 @@ CheckMapConnections::
; function to play a sound when changing maps
PlayMapChangeSound::
+ ld a, [wCurMapTileset]
+ cp FACILITY
+ jr z, .didNotGoThroughDoor
+ cp CEMETERY
+ jr z, .didNotGoThroughDoor
lda_coord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on
cp $0b ; door tile in tileset 0
jr nz, .didNotGoThroughDoor
@@ -762,19 +743,16 @@ HandleBlackOut::
call StopMusic
ld hl, wd72e
res 5, [hl]
- ld a, BANK(ResetStatusAndHalveMoneyOnBlackout) ; also BANK(SpecialWarpIn) and BANK(SpecialEnterMap)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- call ResetStatusAndHalveMoneyOnBlackout
+ ld a, BANK(SpecialWarpIn) ; also BANK(SpecialEnterMap)
+ call BankswitchCommon
+ callfar ResetStatusAndHalveMoneyOnBlackout
call SpecialWarpIn
call PlayDefaultMusicFadeOutCurrent
jp SpecialEnterMap
StopMusic::
ld [wAudioFadeOutControl], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.wait
ld a, [wAudioFadeOutControl]
and a
@@ -786,22 +764,33 @@ HandleFlyWarpOrDungeonWarp::
call Delay3
xor a
ld [wBattleResult], a
- ld [wWalkBikeSurfState], a
ld [wIsInBattle], a
ld [wMapPalOffset], a
ld hl, wd732
set 2, [hl] ; fly warp or dungeon warp
res 5, [hl] ; forced to ride bike
call LeaveMapAnim
+ call Func_07c4
ld a, BANK(SpecialWarpIn)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
call SpecialWarpIn
jp SpecialEnterMap
LeaveMapAnim::
farjp _LeaveMapAnim
+Func_07c4::
+ ld a, [wWalkBikeSurfState]
+ and a
+ ret z
+ xor a
+ ld [wWalkBikeSurfState], a
+ ld hl, wd732
+ bit 4, [hl]
+ ret z
+ call PlayDefaultMusic
+ ret
+
LoadPlayerSpriteGraphics::
; Load sprite graphics based on whether the player is standing, biking, or surfing.
@@ -837,7 +826,7 @@ LoadPlayerSpriteGraphics::
dec a
jp z, LoadBikePlayerSpriteGraphics
dec a
- jp z, LoadSurfingPlayerSpriteGraphics
+ jp z, LoadSurfingPlayerSpriteGraphics2
jp LoadWalkingPlayerSpriteGraphics
IsBikeRidingAllowed::
@@ -878,23 +867,16 @@ LoadTilesetTilePatternData::
ld de, vTileset
ld bc, $600
ld a, [wTilesetBank]
- jp FarCopyData2
+ jp FarCopyData
; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8
; it can also load partial tile maps of connected maps into a border of length 3 around the current map
LoadTileBlockMap::
; fill C6E8-CBFB with the background tile
ld hl, wOverworldMap
- ld a, [wMapBackgroundTile]
- ld d, a
ld bc, wOverworldMapEnd - wOverworldMap
-.backgroundTileLoop
- ld a, d
- ld [hli], a
- dec bc
- ld a, c
- or b
- jr nz, .backgroundTileLoop
+ ld a, [wMapBackgroundTile] ; background tile number
+ call FillMemory
; load tile map of current map (made of tile block IDs)
; a 3-byte border at the edges of the map is kept so that there is space for map connections
ld hl, wOverworldMap
@@ -1073,8 +1055,7 @@ LoadEastWestConnectionsTileMap::
ret
; function to check if there is a sign or sprite in front of the player
-; if so, it is stored in [hSpriteIndexOrTextID]
-; if not, [hSpriteIndexOrTextID] is set to 0
+; if so, carry is set. otherwise, carry is cleared
IsSpriteOrSignInFrontOfPlayer::
xor a
ldh [hSpriteIndexOrTextID], a
@@ -1083,39 +1064,10 @@ IsSpriteOrSignInFrontOfPlayer::
jr z, .extendRangeOverCounter
; if there are signs
predef GetTileAndCoordsInFrontOfPlayer ; get the coordinates in front of the player in de
- ld hl, wSignCoords
- ld a, [wNumSigns]
- ld b, a
- ld c, 0
-.signLoop
- inc c
- ld a, [hli] ; sign Y
- cp d
- jr z, .yCoordMatched
- inc hl
- jr .retry
-.yCoordMatched
- ld a, [hli] ; sign X
- cp e
- jr nz, .retry
-.xCoordMatched
-; found sign
- push hl
- push bc
- ld hl, wSignTextIDs
- ld b, 0
- dec c
- add hl, bc
- ld a, [hl]
- ldh [hSpriteIndexOrTextID], a ; store sign text ID
- pop bc
- pop hl
- ret
-.retry
- dec b
- jr nz, .signLoop
-; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
+ call SignLoop
+ ret c
.extendRangeOverCounter
+; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c
ld hl, wTilesetTalkingOverTiles ; list of tiles that extend talking range (counter tiles)
ld b, 3
@@ -1127,8 +1079,7 @@ IsSpriteOrSignInFrontOfPlayer::
dec b
jr nz, .counterTilesLoop
-; part of the above function, but sometimes its called on its own, when signs are irrelevant
-; the caller must zero [hSpriteIndexOrTextID]
+; sets carry flag if a sprite is in front of the player, resets if not
IsSpriteInFrontOfPlayer::
ld d, $10 ; talking range in pixels (normal range)
IsSpriteInFrontOfPlayer2::
@@ -1172,13 +1123,10 @@ IsSpriteInFrontOfPlayer2::
ld a, PLAYER_DIR_LEFT
.doneCheckingDirection
ld [wPlayerDirection], a
- ld a, [wNumSprites] ; number of sprites
- and a
- ret z
-; if there are sprites
ld hl, wSprite01StateData1
- ld d, a
+; yellow does not have the "if sprites are existant" check
ld e, $01
+ ld d, $f
.spriteLoop
push hl
ld a, [hli] ; image (0 if no sprite)
@@ -1204,7 +1152,9 @@ IsSpriteInFrontOfPlayer2::
inc e
dec d
jr nz, .spriteLoop
+ xor a
ret
+
.foundSpriteInFrontOfPlayer
pop hl
ld a, l
@@ -1214,6 +1164,52 @@ IsSpriteInFrontOfPlayer2::
set 7, [hl] ; set flag to make the sprite face the player
ld a, e
ldh [hSpriteIndexOrTextID], a
+ ldh a, [hSpriteIndexOrTextID] ; possible useless read because a already has the value of the read address
+ cp $f
+ jr nz, .dontwritetowd436
+ ld a, $FF
+ ld [wd436], a
+.dontwritetowd436
+ scf
+ ret
+
+SignLoop::
+; search if a player is facing a sign
+ ld hl, wSignCoords ; start of sign coordinates
+ ld a, [wNumSigns] ; number of signs in the map
+ ld b, a
+ ld c, $00
+.signLoop
+ inc c
+ ld a, [hli] ; sign Y
+ cp d
+ jr z, .yCoordMatched
+ inc hl
+ jr .retry
+
+.yCoordMatched
+ ld a, [hli] ; sign X
+ cp e
+ jr nz, .retry
+.xCoordMatched
+; found sign
+ push hl
+ push bc
+ ld hl, wSignTextIDs ; start of sign text ID's
+ ld b, $00
+ dec c
+ add hl, bc
+ ld a, [hl]
+ ldh [hSpriteIndexOrTextID], a ; store sign text ID
+ pop bc
+ pop hl
+ scf
+ ret
+
+.retry
+ dec b
+ jr nz, .signLoop
+ xor a
ret
; function to check if the player will jump down a ledge and check if the tile ahead is passable (when not surfing)
@@ -1230,14 +1226,31 @@ CollisionCheckOnLand::
ld d, a
ld a, [wSpritePlayerStateData1CollisionData]
and d ; check if a sprite is in the direction the player is trying to go
+ nop ; ??? why is this in the code
jr nz, .collision
xor a
ldh [hSpriteIndexOrTextID], a
call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision?
+ jr nc, .asm_0a5c
+ res 7, [hl]
ldh a, [hSpriteIndexOrTextID]
and a ; was there a sprite collision?
- jr nz, .collision
+ jr z, .asm_0a5c
; if no sprite collision
+ cp $f
+ jr nz, .collision
+ call CheckPikachuFollowingPlayer
+ jr nz, .collision
+ ldh a, [hJoyHeld]
+ and $2
+ jr nz, .asm_0a5c
+ ld hl, wd435
+ ld a, [hl]
+ and a
+ jr z, .asm_0a5c
+ dec [hl]
+ jr nz, .collision
+.asm_0a5c
ld hl, TilePairCollisionsLand
call CheckForJumpingAndTilePairCollisions
jr c, .collision
@@ -1262,19 +1275,7 @@ CheckTilePassable::
predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player
ld a, [wTileInFrontOfPlayer] ; tile in front of player
ld c, a
- ld hl, wTilesetCollisionPtr ; pointer to list of passable tiles
- ld a, [hli]
- ld h, [hl]
- ld l, a ; hl now points to passable tiles
-.loop
- ld a, [hli]
- cp $ff
- jr z, .tileNotPassable
- cp c
- ret z
- jr .loop
-.tileNotPassable
- scf
+ call IsTilePassable
ret
; check if the player is going to jump down a small ledge
@@ -1352,8 +1353,7 @@ LoadCurrentMapView::
ldh a, [hLoadedROMBank]
push af
ld a, [wTilesetBank] ; tile data ROM bank
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a ; switch to ROM bank that contains tile data
+ call BankswitchCommon ; switch to ROM bank that contains tile data
ld a, [wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view
ld e, a
ld a, [wCurrentTileBlockMapViewPointer + 1]
@@ -1434,254 +1434,17 @@ LoadCurrentMapView::
dec b
jr nz, .rowLoop2
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a ; restore previous ROM bank
+ call BankswitchCommon ; restore previous ROM bank
ret
AdvancePlayerSprite::
- ld a, [wSpritePlayerStateData1YStepVector]
- ld b, a
- ld a, [wSpritePlayerStateData1XStepVector]
- ld c, a
- ld hl, wWalkCounter ; walking animation counter
- dec [hl]
- jr nz, .afterUpdateMapCoords
-; if it's the end of the animation, update the player's map coordinates
- ld a, [wYCoord]
- add b
- ld [wYCoord], a
- ld a, [wXCoord]
- add c
- ld [wXCoord], a
-.afterUpdateMapCoords
- ld a, [wWalkCounter] ; walking animation counter
- cp $07
- jp nz, .scrollBackgroundAndSprites
-; if this is the first iteration of the animation
- ld a, c
- cp $01
- jr nz, .checkIfMovingWest
-; moving east
- ld a, [wMapViewVRAMPointer]
- ld e, a
- and $e0
- ld d, a
- ld a, e
- add $02
- and $1f
- or d
- ld [wMapViewVRAMPointer], a
- jr .adjustXCoordWithinBlock
-.checkIfMovingWest
- cp $ff
- jr nz, .checkIfMovingSouth
-; moving west
- ld a, [wMapViewVRAMPointer]
- ld e, a
- and $e0
- ld d, a
- ld a, e
- sub $02
- and $1f
- or d
- ld [wMapViewVRAMPointer], a
- jr .adjustXCoordWithinBlock
-.checkIfMovingSouth
- ld a, b
- cp $01
- jr nz, .checkIfMovingNorth
-; moving south
- ld a, [wMapViewVRAMPointer]
- add $40
- ld [wMapViewVRAMPointer], a
- jr nc, .adjustXCoordWithinBlock
- ld a, [wMapViewVRAMPointer + 1]
- inc a
- and $03
- or $98
- ld [wMapViewVRAMPointer + 1], a
- jr .adjustXCoordWithinBlock
-.checkIfMovingNorth
- cp $ff
- jr nz, .adjustXCoordWithinBlock
-; moving north
- ld a, [wMapViewVRAMPointer]
- sub $40
- ld [wMapViewVRAMPointer], a
- jr nc, .adjustXCoordWithinBlock
- ld a, [wMapViewVRAMPointer + 1]
- dec a
- and $03
- or $98
- ld [wMapViewVRAMPointer + 1], a
-.adjustXCoordWithinBlock
- ld a, c
- and a
- jr z, .pointlessJump ; mistake?
-.pointlessJump
- ld hl, wXBlockCoord
- ld a, [hl]
- add c
- ld [hl], a
- cp $02
- jr nz, .checkForMoveToWestBlock
-; moved into the tile block to the east
- xor a
- ld [hl], a
- ld hl, wXOffsetSinceLastSpecialWarp
- inc [hl]
- ld de, wCurrentTileBlockMapViewPointer
- call MoveTileBlockMapPointerEast
- jr .updateMapView
-.checkForMoveToWestBlock
- cp $ff
- jr nz, .adjustYCoordWithinBlock
-; moved into the tile block to the west
- ld a, $01
- ld [hl], a
- ld hl, wXOffsetSinceLastSpecialWarp
- dec [hl]
- ld de, wCurrentTileBlockMapViewPointer
- call MoveTileBlockMapPointerWest
- jr .updateMapView
-.adjustYCoordWithinBlock
- ld hl, wYBlockCoord
- ld a, [hl]
- add b
- ld [hl], a
- cp $02
- jr nz, .checkForMoveToNorthBlock
-; moved into the tile block to the south
- xor a
- ld [hl], a
- ld hl, wYOffsetSinceLastSpecialWarp
- inc [hl]
- ld de, wCurrentTileBlockMapViewPointer
- ld a, [wCurMapWidth]
- call MoveTileBlockMapPointerSouth
- jr .updateMapView
-.checkForMoveToNorthBlock
- cp $ff
- jr nz, .updateMapView
-; moved into the tile block to the north
- ld a, $01
- ld [hl], a
- ld hl, wYOffsetSinceLastSpecialWarp
- dec [hl]
- ld de, wCurrentTileBlockMapViewPointer
- ld a, [wCurMapWidth]
- call MoveTileBlockMapPointerNorth
-.updateMapView
- call LoadCurrentMapView
- ld a, [wSpritePlayerStateData1YStepVector]
- cp $01
- jr nz, .checkIfMovingNorth2
-; if moving south
- call ScheduleSouthRowRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingNorth2
- cp $ff
- jr nz, .checkIfMovingEast2
-; if moving north
- call ScheduleNorthRowRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingEast2
- ld a, [wSpritePlayerStateData1XStepVector]
- cp $01
- jr nz, .checkIfMovingWest2
-; if moving east
- call ScheduleEastColumnRedraw
- jr .scrollBackgroundAndSprites
-.checkIfMovingWest2
- cp $ff
- jr nz, .scrollBackgroundAndSprites
-; if moving west
- call ScheduleWestColumnRedraw
-.scrollBackgroundAndSprites
- ld a, [wSpritePlayerStateData1YStepVector]
- ld b, a
- ld a, [wSpritePlayerStateData1XStepVector]
- ld c, a
- sla b
- sla c
- ldh a, [hSCY]
- add b
- ldh [hSCY], a ; update background scroll Y
- ldh a, [hSCX]
- add c
- ldh [hSCX], a ; update background scroll X
-; shift all the sprites in the direction opposite of the player's motion
-; so that the player appears to move relative to them
- ld hl, wSprite01StateData1YPixels
- ld a, [wNumSprites] ; number of sprites
- and a ; are there any sprites?
- jr z, .done
- ld e, a
-.spriteShiftLoop
- ld a, [hl]
- sub b
- ld [hli], a
- inc l
- ld a, [hl]
- sub c
- ld [hl], a
- ld a, $0e
- add l
- ld l, a
- dec e
- jr nz, .spriteShiftLoop
-.done
- ret
-
-; the following four functions are used to move the pointer to the upper left
-; corner of the tile block map in the direction of motion
-
-MoveTileBlockMapPointerEast::
- ld a, [de]
- add $01
- ld [de], a
- ret nc
- inc de
- ld a, [de]
- inc a
- ld [de], a
- ret
-
-MoveTileBlockMapPointerWest::
- ld a, [de]
- sub $01
- ld [de], a
- ret nc
- inc de
- ld a, [de]
- dec a
- ld [de], a
- ret
-
-MoveTileBlockMapPointerSouth::
- add MAP_BORDER * 2
- ld b, a
- ld a, [de]
- add b
- ld [de], a
- ret nc
- inc de
- ld a, [de]
- inc a
- ld [de], a
- ret
-
-MoveTileBlockMapPointerNorth::
- add MAP_BORDER * 2
- ld b, a
- ld a, [de]
- sub b
- ld [de], a
- ret nc
- inc de
- ld a, [de]
- dec a
- ld [de], a
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $FF
+ ld [wUpdateSpritesEnabled], a
+ callfar _AdvancePlayerSprite
+ pop af
+ ld [wUpdateSpritesEnabled], a
ret
; the following 6 functions are used to tell the V-blank handler to redraw
@@ -1826,18 +1589,25 @@ JoypadOverworld::
ld [wSpritePlayerStateData1XStepVector], a
call RunMapScript
call Joypad
+ call ForceBikeDown
+ call AreInputsSimulated
+ ret
+
+ForceBikeDown::
ld a, [wFlags_D733]
bit 3, a ; check if a trainer wants a challenge
- jr nz, .notForcedDownwards
+ ret nz
ld a, [wCurMap]
cp ROUTE_17 ; Cycling Road
- jr nz, .notForcedDownwards
+ ret nz
ldh a, [hJoyHeld]
and D_DOWN | D_UP | D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON
- jr nz, .notForcedDownwards
+ ret nz
ld a, D_DOWN
ldh [hJoyHeld], a ; on the cycling road, if there isn't a trainer and the player isn't pressing buttons, simulate a down press
-.notForcedDownwards
+ ret
+
+AreInputsSimulated::
ld a, [wd730]
bit 7, a
ret z
@@ -1847,18 +1617,8 @@ JoypadOverworld::
ld a, [wOverrideSimulatedJoypadStatesMask] ; bit mask for button presses that override simulated ones
and b
ret nz ; return if the simulated button presses are overridden
- ld hl, wSimulatedJoypadStatesIndex
- dec [hl]
- ld a, [hl]
- cp $ff
- jr z, .doneSimulating ; if the end of the simulated button presses has been reached
- ld hl, wSimulatedJoypadStatesEnd
- add l
- ld l, a
- jr nc, .noCarry
- inc h
-.noCarry
- ld a, [hl]
+ call GetSimulatedInput
+ jr nc, .doneSimulating
ldh [hJoyHeld], a ; store simulated button press in joypad state
and a
ret nz
@@ -1882,15 +1642,30 @@ JoypadOverworld::
res 7, [hl]
ret
+GetSimulatedInput::
+ ld hl, wSimulatedJoypadStatesIndex
+ dec [hl]
+ ld a, [hl]
+ cp $ff
+ jr z, .endofsimulatedinputs ; if the end of the simulated button presses has been reached
+ push de
+ ld e, a
+ ld d, $0
+ ld hl, wSimulatedJoypadStatesEnd
+ add hl, de
+ ld a, [hl]
+ pop de
+ scf
+ ret
+
+.endofsimulatedinputs
+ and a
+ ret
+
+
; function to check the tile ahead to determine if the character should get on land or keep surfing
; sets carry if there is a collision and clears carry otherwise
-; It seems that this function has a bug in it, but due to luck, it doesn't
-; show up. After detecting a sprite collision, it jumps to the code that
-; checks if the next tile is passable instead of just directly jumping to the
-; "collision detected" code. However, it doesn't store the next tile in c,
-; so the old value of c is used. 2429 is always called before this function,
-; and 2429 always sets c to 0xF0. There is no 0xF0 background tile, so it
-; is considered impassable and it is detected as a collision.
+; This function had a bug in Red/Blue, but it was fixed in Yellow.
CollisionCheckOnWater::
ld a, [wd730]
bit 7, a
@@ -1899,31 +1674,17 @@ CollisionCheckOnWater::
ld d, a
ld a, [wSpritePlayerStateData1CollisionData]
and d ; check if a sprite is in the direction the player is trying to go
- jr nz, .checkIfNextTileIsPassable ; bug?
+ jr nz, .collision
ld hl, TilePairCollisionsWater
call CheckForJumpingAndTilePairCollisions
jr c, .collision
predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player (puts it in c and [wTileInFrontOfPlayer])
+ callfar IsNextTileShoreOrWater
+ jr c, .noCollision
ld a, [wTileInFrontOfPlayer] ; tile in front of player
- cp $14 ; water tile
- jr z, .noCollision ; keep surfing if it's a water tile
- cp $32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset)
- jr z, .checkIfVermilionDockTileset
- cp $48 ; tile on right on coast lines in Safari Zone
- jr z, .noCollision ; keep surfing
-; check if the [land] tile in front of the player is passable
-.checkIfNextTileIsPassable
- ld hl, wTilesetCollisionPtr ; pointer to list of passable tiles
- ld a, [hli]
- ld h, [hl]
- ld l, a
-.loop
- ld a, [hli]
- cp $ff
- jr z, .collision
- cp c
- jr z, .stopSurfing ; stop surfing if the tile is passable
- jr .loop
+ ld c, a
+ call IsTilePassable
+ jr nc, .stopSurfing
.collision
ld a, [wChannelSoundIDs + Ch5]
cp SFX_COLLISION ; check if collision sound is already playing
@@ -1933,21 +1694,26 @@ CollisionCheckOnWater::
.setCarry
scf
jr .done
-.noCollision
- and a
-.done
- ret
-.stopSurfing
- xor a
- ld [wWalkBikeSurfState], a
- call LoadPlayerSpriteGraphics
- call PlayDefaultMusic
- jr .noCollision
.checkIfVermilionDockTileset
ld a, [wCurMapTileset] ; tileset
cp SHIP_PORT ; Vermilion Dock tileset
jr nz, .noCollision ; keep surfing if it's not the boarding platform tile
jr .stopSurfing ; if it is the boarding platform tile, stop surfing
+.stopSurfing ; based game freak
+ ld a, $3
+ ld [wPikachuSpawnState], a
+ ld hl, wPikachuOverworldStateFlags
+ set 5, [hl]
+ xor a
+ ld [wWalkBikeSurfState], a
+ call LoadPlayerSpriteGraphics
+ call PlayDefaultMusic
+ jr .noCollision
+
+.noCollision ; ...and they do the same mistake twice
+ and a
+.done
+ ret
; function to run the current map's script
RunMapScript::
@@ -1977,24 +1743,47 @@ RunMapScript::
ret
LoadWalkingPlayerSpriteGraphics::
+; new sprite copy stuff
+ xor a
+ ld [wd473], a
+ ld b, BANK(RedSprite)
ld de, RedSprite
- ld hl, vNPCSprites
+ jr LoadPlayerSpriteGraphicsCommon
+
+LoadSurfingPlayerSpriteGraphics2::
+ ld a, [wd473]
+ and a
+ jr z, .asm_0d75
+ dec a
+ jr z, LoadSurfingPlayerSpriteGraphics
+ dec a
+ jr z, .asm_0d7c
+.asm_0d75
+ ld a, [wd472]
+ bit 6, a
+ jr z, LoadSurfingPlayerSpriteGraphics
+.asm_0d7c
+ ld b, BANK(SurfingPikachuSprite)
+ ld de, SurfingPikachuSprite
jr LoadPlayerSpriteGraphicsCommon
LoadSurfingPlayerSpriteGraphics::
+ ld b, BANK(SeelSprite)
ld de, SeelSprite
- ld hl, vNPCSprites
jr LoadPlayerSpriteGraphicsCommon
LoadBikePlayerSpriteGraphics::
+ ld b, BANK(RedBikeSprite)
ld de, RedBikeSprite
- ld hl, vNPCSprites
LoadPlayerSpriteGraphicsCommon::
+ ld hl, vNPCSprites
push de
push hl
- lb bc, BANK(RedSprite), $0c
+ push bc
+ ld c, $c
call CopyVideoData
+ pop bc
pop hl
pop de
ld a, $c0
@@ -2004,12 +1793,17 @@ LoadPlayerSpriteGraphicsCommon::
inc d
.noCarry
set 3, h
- lb bc, BANK(RedSprite), $0c
+ ld c, $c
jp CopyVideoData
; function to load data from the map header
LoadMapHeader::
farcall MarkTownVisitedAndLoadMissableObjects
+ jr asm_0dbd
+
+Func_0db5:: ; XXX
+ farcall LoadMissableObjectData
+asm_0dbd:
ld a, [wCurMapTileset]
ld [wUnusedD119], a
ld a, [wCurMap]
@@ -2021,20 +1815,7 @@ LoadMapHeader::
ldh [hPreviousTileset], a
bit 7, b
ret nz
- ld hl, MapHeaderPointers
- ld a, [wCurMap]
- sla a
- jr nc, .noCarry1
- inc h
-.noCarry1
- add l
- ld l, a
- jr nc, .noCarry2
- inc h
-.noCarry2
- ld a, [hli]
- ld h, [hl]
- ld l, a ; hl = base of map header
+ call GetMapHeaderPointer
; copy the first 10 bytes (the fixed area) of the map data to D367-D370
ld de, wCurMapTileset
ld c, $0a
@@ -2108,155 +1889,19 @@ LoadMapHeader::
ld [wNumSigns], a
and a ; are there any signs?
jr z, .loadSpriteData ; if not, skip this
- ld c, a
- ld de, wSignTextIDs
- ld a, d
- ldh [hSignCoordPointer], a
- ld a, e
- ldh [hSignCoordPointer + 1], a
- ld de, wSignCoords
-.signLoop
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- push de
- ldh a, [hSignCoordPointer]
- ld d, a
- ldh a, [hSignCoordPointer + 1]
- ld e, a
- ld a, [hli]
- ld [de], a
- inc de
- ld a, d
- ldh [hSignCoordPointer], a
- ld a, e
- ldh [hSignCoordPointer + 1], a
- pop de
- dec c
- jr nz, .signLoop
+ call CopySignData
.loadSpriteData
ld a, [wd72e]
bit 5, a ; did a battle happen immediately before this?
- jp nz, .finishUp ; if so, skip this because battles don't destroy this data
- ld a, [hli]
- ld [wNumSprites], a ; save the number of sprites
- push hl
-; zero out sprite state data for sprites 01-15
- ld hl, wSprite01StateData1
- ld de, wSprite01StateData2
- xor a
- ld b, $f0
-.zeroSpriteDataLoop
- ld [hli], a
- ld [de], a
- inc e
- dec b
- jr nz, .zeroSpriteDataLoop
-; disable SPRITESTATEDATA1_IMAGEINDEX (set to $ff) for sprites 01-15
- ld hl, wSprite01StateData1ImageIndex
- ld de, $10
- ld c, $0f
-.disableSpriteEntriesLoop
- ld [hl], $ff
- add hl, de
- dec c
- jr nz, .disableSpriteEntriesLoop
- pop hl
- ld de, wSprite01StateData1
- ld a, [wNumSprites] ; number of sprites
- and a ; are there any sprites?
- jp z, .finishUp ; if there are no sprites, skip the rest
- ld b, a
- ld c, $00
-.loadSpriteLoop
- ld a, [hli]
- ld [de], a ; x#SPRITESTATEDATA1_PICTUREID
- inc d
- ld a, $04
- add e
- ld e, a
- ld a, [hli]
- ld [de], a ; x#SPRITESTATEDATA2_MAPY
- inc e
- ld a, [hli]
- ld [de], a ; x#SPRITESTATEDATA2_MAPX
- inc e
- ld a, [hli]
- ld [de], a ; x#SPRITESTATEDATA2_MOVEMENTBYTE1
- ld a, [hli]
- ldh [hLoadSpriteTemp1], a ; save movement byte 2
- ld a, [hli]
- ldh [hLoadSpriteTemp2], a ; save text ID and flags byte
- push bc
- push hl
- ld b, $00
- ld hl, wMapSpriteData
- add hl, bc
- ldh a, [hLoadSpriteTemp1]
- ld [hli], a ; store movement byte 2 in byte 0 of sprite entry
- ldh a, [hLoadSpriteTemp2]
- ld [hl], a ; this appears pointless, since the value is overwritten immediately after
- ldh a, [hLoadSpriteTemp2]
- ldh [hLoadSpriteTemp1], a
- and $3f
- ld [hl], a ; store text ID in byte 1 of sprite entry
- pop hl
- ldh a, [hLoadSpriteTemp1]
- bit 6, a
- jr nz, .trainerSprite
- bit 7, a
- jr nz, .itemBallSprite
- jr .regularSprite
-.trainerSprite
- ld a, [hli]
- ldh [hLoadSpriteTemp1], a ; save trainer class
- ld a, [hli]
- ldh [hLoadSpriteTemp2], a ; save trainer number (within class)
- push hl
- ld hl, wMapSpriteExtraData
- add hl, bc
- ldh a, [hLoadSpriteTemp1]
- ld [hli], a ; store trainer class in byte 0 of the entry
- ldh a, [hLoadSpriteTemp2]
- ld [hl], a ; store trainer number in byte 1 of the entry
- pop hl
- jr .nextSprite
-.itemBallSprite
- ld a, [hli]
- ldh [hLoadSpriteTemp1], a ; save item number
- push hl
- ld hl, wMapSpriteExtraData
- add hl, bc
- ldh a, [hLoadSpriteTemp1]
- ld [hli], a ; store item number in byte 0 of the entry
- xor a
- ld [hl], a ; zero byte 1, since it is not used
- pop hl
- jr .nextSprite
-.regularSprite
- push hl
- ld hl, wMapSpriteExtraData
- add hl, bc
-; zero both bytes, since regular sprites don't use this extra space
- xor a
- ld [hli], a
- ld [hl], a
- pop hl
-.nextSprite
- pop bc
- dec d
- ld a, $0a
- add e
- ld e, a
- inc c
- inc c
- dec b
- jp nz, .loadSpriteLoop
+ jr nz, .finishUp ; if so, skip this because battles don't destroy this data
+ call InitSprites
.finishUp
predef LoadTilesetHeader
+ ld a, [wd72e]
+ bit 5, a ; did a battle happen immediately before this?
+ jr nz, .skip_pika_spawn
+ callfar SchedulePikachuSpawnForAfterText
+.skip_pika_spawn
callfar LoadWildData
pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose)
ld a, [wCurMapHeight] ; map height in 4x4 tile blocks
@@ -2271,8 +1916,7 @@ LoadMapHeader::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(MapSongBanks)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld hl, MapSongBanks
add hl, bc
add hl, bc
@@ -2281,8 +1925,7 @@ LoadMapHeader::
ld a, [hl]
ld [wMapMusicROMBank], a ; music 2
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; function to copy map connection data from ROM to WRAM
@@ -2297,11 +1940,92 @@ CopyMapConnectionHeader::
jr nz, .loop
ret
+CopySignData::
+ ld de, wSignCoords ; start of sign coords
+ ld bc, wSignTextIDs ; start of sign text ids
+ ld a, [wNumSigns] ; number of signs
+.signcopyloop
+ push af
+ ld a, [hli]
+ ld [de], a ; copy y coord
+ inc de
+ ld a, [hli]
+ ld [de], a ; copy x coord
+ inc de
+ ld a, [hli]
+ ld [bc], a ; copy sign text id
+ inc bc
+ pop af
+ dec a
+ jr nz, .signcopyloop
+ ret
+
; function to load map data
LoadMapData::
ldh a, [hLoadedROMBank]
push af
call DisableLCD
+ call ResetMapVariables
+ call LoadTextBoxTilePatterns
+ call LoadMapHeader
+ call InitMapSprites ; load tile pattern data for sprites
+ call LoadScreenRelatedData
+ call CopyMapViewToVRAM
+ ld a, $01
+ ld [wUpdateSpritesEnabled], a
+ call EnableLCD
+ ld b, $09
+ call RunPaletteCommand
+ call LoadPlayerSpriteGraphics
+ ld a, [wd732]
+ and 1 << 4 | 1 << 3 ; fly warp or dungeon warp
+ jr nz, .restoreRomBank
+ ld a, [wFlags_D733]
+ bit 1, a
+ jr nz, .restoreRomBank
+ call UpdateMusic6Times ; music related
+ call PlayDefaultMusicFadeOutCurrent ; music related
+.restoreRomBank
+ pop af
+ call BankswitchCommon
+ ret
+
+LoadScreenRelatedData::
+ call LoadTileBlockMap
+ call LoadTilesetTilePatternData
+ call LoadCurrentMapView
+ ret
+
+ReloadMapAfterSurfingMinigame::
+ ldh a, [hLoadedROMBank]
+ push af
+ call DisableLCD
+ call ResetMapVariables
+ ld a, [wCurMap]
+ call SwitchToMapRomBank
+ call LoadScreenRelatedData
+ call CopyMapViewToVRAM
+ ld de, vBGMap1
+ call CopyMapViewToVRAM2
+ call EnableLCD
+ call ReloadMapSpriteTilePatterns
+ pop af
+ call BankswitchCommon
+ jr FinishReloadingMap
+
+ReloadMapAfterPrinter::
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, [wCurMap]
+ call SwitchToMapRomBank
+ call LoadTileBlockMap
+ pop af
+ call BankswitchCommon
+FinishReloadingMap:
+ jpfar SetMapSpecificScriptFlagsOnMapReload
+ ret ; useless
+
+ResetMapVariables::
ld a, $98
ld [wMapViewVRAMPointer + 1], a
xor a
@@ -2310,17 +2034,15 @@ LoadMapData::
ldh [hSCX], a
ld [wWalkCounter], a
ld [wUnusedD119], a
- ld [wWalkBikeSurfStateCopy], a
ld [wSpriteSetID], a
- call LoadTextBoxTilePatterns
- call LoadMapHeader
- farcall InitMapSprites ; load tile pattern data for sprites
- call LoadTileBlockMap
- call LoadTilesetTilePatternData
- call LoadCurrentMapView
+ ld [wWalkBikeSurfStateCopy], a
+ ret
+
+CopyMapViewToVRAM::
; copy current map view to VRAM
- hlcoord 0, 0
ld de, vBGMap0
+CopyMapViewToVRAM2:
+ ld hl, wTileMap
ld b, SCREEN_HEIGHT
.vramCopyLoop
ld c, SCREEN_WIDTH
@@ -2338,24 +2060,6 @@ LoadMapData::
.noCarry
dec b
jr nz, .vramCopyLoop
- ld a, $01
- ld [wUpdateSpritesEnabled], a
- call EnableLCD
- ld b, SET_PAL_OVERWORLD
- call RunPaletteCommand
- call LoadPlayerSpriteGraphics
- ld a, [wd732]
- and 1 << 4 | 1 << 3 ; fly warp or dungeon warp
- jr nz, .restoreRomBank
- ld a, [wFlags_D733]
- bit 1, a
- jr nz, .restoreRomBank
- call UpdateMusic6Times
- call PlayDefaultMusicFadeOutCurrent
-.restoreRomBank
- pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
ret
; function to switch to the ROM bank that a map is stored in
@@ -2373,12 +2077,30 @@ SwitchToMapRomBank::
ldh [hMapROMBank], a
call BankswitchBack
ldh a, [hMapROMBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
pop bc
pop hl
ret
+GetMapHeaderPointer::
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, BANK(MapHeaderPointers)
+ call BankswitchCommon
+ push de
+ ld a, [wCurMap]
+ ld e, a
+ ld d, $0
+ ld hl, MapHeaderPointers
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop de
+ pop af
+ jp BankswitchCommon
+
IgnoreInputForHalfSecond:
ld a, 30
ld [wIgnoreInputCounter], a
@@ -2399,6 +2121,163 @@ ForceBikeOrSurf::
call Bankswitch
jp PlayDefaultMusic ; update map/player state?
+; Handle the player jumping down
+; a ledge in the overworld.
+HandleMidJump::
+ ld a, [wd736]
+ bit 6, a ; jumping down a ledge?
+ ret z
+ farcall _HandleMidJump
+ ret
+
+IsSpinning::
+ ld a, [wd736]
+ bit 7, a
+ ret z ; no spinning
+ farjp LoadSpinnerArrowTiles ; spin while moving
+
+Func_0ffe::
+ jpfar IsPlayerTalkingToPikachu
+
+InitSprites::
+ ld a, [hli]
+ ld [wNumSprites], a ; save the number of sprites
+ push hl
+ push de
+ push bc
+ call ZeroSpriteStateData
+ call DisableRegularSprites
+ ld hl, wMapSpriteData
+ ld bc, $20
+ xor a
+ call FillMemory
+ pop bc
+ pop de
+ pop hl
+ ld a, [wNumSprites]
+ and a ; are sprites existant?
+ ret z ; don't copy sprite data if not
+ ld b, a
+ ld c, $0
+ ld de, wSprite01StateData1
+; copy sprite stuff?
+.loadSpriteLoop
+ ld a, [hli]
+ ld [de], a ; x#SPRITESTATEDATA1_PICTUREID
+ inc d
+ ld a, e
+ add $4
+ ld e, a
+ ld a, [hli]
+ ld [de], a ; x#SPRITESTATEDATA2_MAPY
+ inc e
+ ld a, [hli]
+ ld [de], a ; x#SPRITESTATEDATA2_MAPX
+ inc e
+ ld a, [hli]
+ ld [de], a ; x#SPRITESTATEDATA2_MOVEMENTBYTE1
+ ld a, [hli]
+ ldh [hLoadSpriteTemp1], a ; save movement byte 2
+ ld a, [hli]
+ ldh [hLoadSpriteTemp2], a ; save text ID and flags byte
+ push bc
+ call LoadSprite
+ pop bc
+ dec d
+ ld a, e
+ add $a
+ ld e, a
+ inc c
+ inc c
+ dec b
+ jr nz, .loadSpriteLoop
+ ret
+
+ZeroSpriteStateData::
+; zero out sprite state data for sprites 01-14
+; sprite 15 is used for Pikachu
+ ld hl, wSprite01StateData1
+ ld de, wSprite01StateData2
+ xor a
+ ld b, 14 * $10
+.loop
+ ld [hli], a
+ ld [de], a
+ inc e
+ dec b
+ jr nz, .loop
+ ret
+
+DisableRegularSprites::
+; disable SPRITESTATEDATA1_IMAGEINDEX (set to $ff) for sprites 01-14
+ ld hl, wSprite01StateData1ImageIndex
+ ld de, $10
+ ld c, $e
+.loop
+ ld [hl], $ff
+ add hl, de
+ dec c
+ jr nz, .loop
+ ret
+
+LoadSprite::
+ push hl
+ ld b, $0
+ ld hl, wMapSpriteData
+ add hl, bc
+ ldh a, [hLoadSpriteTemp1]
+ ld [hli], a ; store movement byte 2 in byte 0 of sprite entry
+ ldh a, [hLoadSpriteTemp2]
+ ld [hl], a ; this appears pointless, since the value is overwritten immediately after
+ ldh a, [hLoadSpriteTemp2]
+ ldh [hLoadSpriteTemp1], a
+ and $3f
+ ld [hl], a ; store text ID in byte 1 of sprite entry
+ pop hl
+ ldh a, [hLoadSpriteTemp1]
+ bit 6, a
+ jr nz, .trainerSprite
+ bit 7, a
+ jr nz, .itemBallSprite
+; for regular sprites
+ push hl
+ ld hl, wMapSpriteExtraData
+ add hl, bc
+; zero both bytes, since regular sprites don't use this extra space
+ xor a
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ ret
+
+.trainerSprite
+ ld a, [hli]
+ ldh [hLoadSpriteTemp1], a ; save trainer class
+ ld a, [hli]
+ ldh [hLoadSpriteTemp2], a ; save trainer number (within class)
+ push hl
+ ld hl, wMapSpriteExtraData
+ add hl, bc
+ ldh a, [hLoadSpriteTemp1]
+ ld [hli], a ; store trainer class in byte 0 of the entry
+ ldh a, [hLoadSpriteTemp2]
+ ld [hl], a ; store trainer number in byte 1 of the entry
+ pop hl
+ ret
+
+.itemBallSprite
+ ld a, [hli]
+ ldh [hLoadSpriteTemp1], a ; save item number
+ push hl
+ ld hl, wMapSpriteExtraData
+ add hl, bc
+ ldh a, [hLoadSpriteTemp1]
+ ld [hli], a ; store item number in byte 0 of the entry
+ xor a
+ ld [hl], a ; zero byte 1, since it is not used
+ pop hl
+ ret
+
CheckForUserInterruption::
; Return carry if Up+Select+B, Start or A are pressed in c frames.
; Used only in the intro and title screen.
diff --git a/home/palettes.asm b/home/palettes.asm
index 08dcdc85..af66e74b 100644
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -1,3 +1,6 @@
+InitMapSprites::
+ jpfar _InitMapSprites
+
RestoreScreenTilesAndReloadTilePatterns::
call ClearSprites
ld a, $1
@@ -23,6 +26,9 @@ GBPalNormal::
ldh [rBGP], a
ld a, %11010000 ; 3100
ldh [rOBP0], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
GBPalWhiteOut::
@@ -31,6 +37,9 @@ GBPalWhiteOut::
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
+ call UpdateGBCPal_BGP
+ call UpdateGBCPal_OBP0
+ call UpdateGBCPal_OBP1
ret
RunDefaultPaletteCommand::
diff --git a/home/pics.asm b/home/pics.asm
index 3bce1532..c0559908 100644
--- a/home/pics.asm
+++ b/home/pics.asm
@@ -18,10 +18,6 @@ UncompressMonSprite::
; $99 ≤ index: bank $D ("Pics 5")
ld a, [wcf91]
ld b, a
- cp MEW
- ld a, BANK(MewPicFront)
- jr z, .GotBank
- ld a, b
cp FOSSIL_KABUTOPS
ld a, BANK(FossilKabutopsPic)
jr z, .GotBank
@@ -92,8 +88,8 @@ LoadUncompressedSpriteData::
add a
add a ; 8*(7*((8-w)/2) + 7-h) ; combined overall offset (in bytes)
ldh [hSpriteOffset], a
- xor a
- ld [MBC1SRamBank], a
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
ld hl, sSpriteBuffer0
call ZeroSpriteBuffer ; zero buffer 0
ld de, sSpriteBuffer1
@@ -104,6 +100,7 @@ LoadUncompressedSpriteData::
ld de, sSpriteBuffer2
ld hl, sSpriteBuffer1
call AlignSpriteDataCentered ; copy and align buffer 2 to 1 (containing the LSB of the 2bpp sprite)
+ call PrepareRTCDataAndDisableSRAM
pop de
jp InterlaceMergeSpriteBuffers
@@ -150,8 +147,8 @@ ZeroSpriteBuffer::
; in the resulting sprite, the rows of the two source sprites are interlaced
; de: output address
InterlaceMergeSpriteBuffers::
- xor a
- ld [MBC1SRamBank], a
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
push de
ld hl, sSpriteBuffer2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2
ld de, sSpriteBuffer1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1
@@ -193,4 +190,5 @@ InterlaceMergeSpriteBuffers::
ld c, (2*SPRITEBUFFERSIZE)/16 ; $31, number of 16 byte chunks to be copied
ldh a, [hLoadedROMBank]
ld b, a
- jp CopyVideoData
+ call CopyVideoData
+ jp PrepareRTCDataAndDisableSRAM
diff --git a/home/pikachu.asm b/home/pikachu.asm
new file mode 100644
index 00000000..ae6acfe3
--- /dev/null
+++ b/home/pikachu.asm
@@ -0,0 +1,116 @@
+Func_1510::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ set 7, [hl]
+ ld hl, wSpritePikachuStateData1ImageIndex ; pikachu data?
+ ld [hl], $ff
+ pop hl
+ ret
+
+Func_151d::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ res 7, [hl]
+ pop hl
+ ret
+
+EnablePikachuOverworldSpriteDrawing::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ res 3, [hl]
+ pop hl
+ ret
+
+DisablePikachuOverworldSpriteDrawing::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ set 3, [hl]
+ ld hl, wSpritePikachuStateData1ImageIndex ; pikachu data?
+ ld [hl], $ff
+ pop hl
+ ret
+
+DisablePikachuFollowingPlayer::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ set 1, [hl]
+ pop hl
+ ret
+
+EnablePikachuFollowingPlayer::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ res 1, [hl]
+ pop hl
+ ret
+
+CheckPikachuFollowingPlayer::
+ push hl
+ ld hl, wPikachuOverworldStateFlags
+ bit 1, [hl]
+ pop hl
+ ret
+
+SpawnPikachu::
+ ld a, [hl]
+ dec a
+ swap a
+ ldh [hTilePlayerStandingOn], a
+ homecall SpawnPikachu_
+ ret
+
+Pikachu_IsInArray::
+ ld b, $0
+ ld c, a
+.loop
+ inc b
+ ld a, [hli]
+ cp $ff
+ jr z, .not_in_array
+ cp c
+ jr nz, .loop
+ dec b
+ dec hl
+ scf
+ ret
+
+.not_in_array
+ dec b
+ dec hl
+ and a
+ ret
+
+GetPikachuMovementScriptByte::
+ push hl
+ push bc
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, [wPikachuMovementScriptBank]
+ call BankswitchCommon
+ ld hl, wPikachuMovementScriptAddress
+ ld c, [hl]
+ inc hl
+ ld b, [hl]
+ ld a, [bc]
+ inc bc
+ ld [hl], b
+ dec hl
+ ld [hl], c
+ ld c, a
+ pop af
+ call BankswitchCommon
+ ld a, c
+ pop bc
+ pop hl
+ ret
+
+ApplyPikachuMovementData::
+ ldh a, [hLoadedROMBank]
+ ld b, a
+ push af
+ ld a, BANK(ApplyPikachuMovementData_)
+ call BankswitchCommon
+ call ApplyPikachuMovementData_
+ pop af
+ call BankswitchCommon
+ ret
diff --git a/home/pikachu_cries.asm b/home/pikachu_cries.asm
new file mode 100644
index 00000000..84889ef9
--- /dev/null
+++ b/home/pikachu_cries.asm
@@ -0,0 +1,46 @@
+PlayPikachuPCM::
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, b
+ call BankswitchCommon
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+.loop
+ ld a, [hli]
+ ld d, a
+ ld a, $3
+.playSingleSample
+ dec a
+ jr nz, .playSingleSample
+
+REPT 7
+ call LoadNextSoundClipSample
+ call PlaySoundClipSample
+ENDR
+
+ call LoadNextSoundClipSample
+ dec bc
+ ld a, c
+ or b
+ jr nz, .loop
+ pop af
+ call BankswitchCommon
+ ret
+
+LoadNextSoundClipSample::
+ ld a, d
+ and $80
+ srl a
+ srl a
+ ldh [rNR32], a
+ sla d
+ ret
+
+PlaySoundClipSample::
+ ld a, $3
+.loop
+ dec a
+ jr nz, .loop
+ ret
diff --git a/engine/play_time.asm b/home/play_time.asm
index 29897242..d6c95fbd 100644
--- a/engine/play_time.asm
+++ b/home/play_time.asm
@@ -1,5 +1,8 @@
TrackPlayTime::
call CountDownIgnoreInputBitReset
+ ld hl, wd47a
+ bit 0, [hl]
+ jr nz, .maxIGT
ld a, [wd732]
bit 0, a
ret z
@@ -32,19 +35,26 @@ TrackPlayTime::
ld [wPlayTimeHours], a
cp $ff
ret nz
+ ld hl, wd47a
+ set 0, [hl]
+.maxIGT
+ ld a, 59
+ ld [wPlayTimeSeconds], a
+ ld [wPlayTimeMinutes], a
ld a, $ff
+ ld [wPlayTimeHours], a
ld [wPlayTimeMaxed], a
ret
CountDownIgnoreInputBitReset:
ld a, [wIgnoreInputCounter]
and a
- jr nz, .asm_18e40
+ jr nz, .asm_1f5e
ld a, $ff
- jr .asm_18e41
-.asm_18e40
+ jr .asm_1f5f
+.asm_1f5e
dec a
-.asm_18e41
+.asm_1f5f
ld [wIgnoreInputCounter], a
and a
ret nz
diff --git a/home/pokemon.asm b/home/pokemon.asm
index 4e6e080b..93b536ff 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -5,7 +5,6 @@ DrawHPBar::
push hl
push de
- push bc
; Left
ld a, $71 ; "HP:"
@@ -61,7 +60,6 @@ DrawHPBar::
add e
ld [hl], a
.done
- pop bc
pop de
pop hl
ret
@@ -125,24 +123,32 @@ LoadFrontSpriteByMonIndex::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(CopyUncompressedPicToHL)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
xor a
ldh [hStartTileID], a
call CopyUncompressedPicToHL
xor a
ld [wSpriteFlipped], a
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ret
+ jp BankswitchCommon
PlayCry::
; Play monster a's cry.
+ push bc
+ ld b, a
+ ld a, [wLowHealthAlarm]
+ push af
+ xor a
+ ld [wLowHealthAlarm], a
+ ld a, b
call GetCryData
call PlaySound
- jp WaitForSoundToFinish
+ call WaitForSoundToFinish
+ pop af
+ ld [wLowHealthAlarm], a
+ pop bc
+ ret
GetCryData::
; Load cry data for monster a.
@@ -239,12 +245,23 @@ HandlePartyMenuInput::
ld a, $40
ld [wPartyMenuAnimMonEnabled], a
call HandleMenuInput_
- call PlaceUnfilledArrowMenuCursor
- ld b, a
- xor a
+ push af ; save hJoy5 OR wMenuWrapping enabled, if no inputs were selected within a certain period of time
+ bit 1, a ; was B button pressed?
+ ld a, $0
ld [wPartyMenuAnimMonEnabled], a
ld a, [wCurrentMenuItem]
ld [wPartyAndBillsPCSavedMenuItem], a
+ jr nz, .asm_1258
+ ld a, [wCurrentMenuItem]
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_1258
+ call CheckPikachuFollowingPlayer
+ jr nz, .asm_128f
+.asm_1258
+ pop af
+ call PlaceUnfilledArrowMenuCursor
+ ld b, a
ld hl, wd730
res 6, [hl] ; turn on letter printing delay
ld a, [wMenuItemToSwap]
@@ -269,6 +286,14 @@ HandlePartyMenuInput::
call BankswitchBack
and a
ret
+.asm_128f
+ pop af
+ ld hl, PartyMenuText_12cc
+ call PrintText
+ xor a
+ ld [wMenuItemToSwap], a
+ pop af
+ ldh [hTileAnimations], a
.noPokemonChosen
call BankswitchBack
scf
@@ -282,12 +307,16 @@ HandlePartyMenuInput::
ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a
call RedrawPartyMenu
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
.handleSwap
ld a, [wCurrentMenuItem]
ld [wWhichPokemon], a
farcall SwitchPartyMon
- jr HandlePartyMenuInput
+ jp HandlePartyMenuInput
+
+PartyMenuText_12cc::
+ text_far _SleepingPikachuText1
+ text_end
DrawPartyMenu::
ld hl, DrawPartyMenu_
@@ -325,8 +354,7 @@ PrintStatusCondition::
ret
PrintStatusConditionNotFainted::
- homecall_sf PrintStatusAilment
- ret
+ homejp_sf PrintStatusAilment
; function to print pokemon level, leaving off the ":L" if the level is at least 100
; INPUT:
@@ -376,8 +404,7 @@ GetMonHeader::
ldh a, [hLoadedROMBank]
push af
ld a, BANK(BaseStats)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
push bc
push de
push hl
@@ -396,8 +423,6 @@ GetMonHeader::
ld b, $77 ; size of Aerodactyl fossil sprite
cp FOSSIL_AERODACTYL ; Aerodactyl fossil
jr z, .specialID
- cp MEW
- jr z, .mew
predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number
ld a, [wd11e]
dec a
@@ -415,13 +440,6 @@ GetMonHeader::
ld [hl], e ; write front sprite pointer
inc hl
ld [hl], d
- jr .done
-.mew
- ld hl, MewBaseStats
- ld de, wMonHeader
- ld bc, BASE_DATA_SIZE
- ld a, BANK(MewBaseStats)
- call FarCopyData
.done
ld a, [wd0b5]
ld [wMonHIndex], a
@@ -431,8 +449,7 @@ GetMonHeader::
pop de
pop bc
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; copy party pokemon's name to wcd6d
diff --git a/home/predef.asm b/home/predef.asm
index 14ac07b5..4861d5d0 100644
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -19,8 +19,7 @@ Predef::
call GetPredefPointer
ld a, [wPredefBank]
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ld de, .done
push de
@@ -28,8 +27,7 @@ Predef::
.done
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
GetPredefRegisters::
diff --git a/home/print_num.asm b/home/print_num.asm
index e2628b1f..d86527a6 100644
--- a/home/print_num.asm
+++ b/home/print_num.asm
@@ -1,3 +1,14 @@
+FarPrintText::
+; print text b:hl at (1, 14)
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, b
+ call BankswitchCommon
+ call PrintText
+ pop af
+ call BankswitchCommon
+ ret
+
PrintNumber::
; Print the c-digit, b-byte value at de.
; Allows 2 to 7 digits. For 1-digit numbers, add
diff --git a/home/printer.asm b/home/printer.asm
new file mode 100644
index 00000000..6d9f145c
--- /dev/null
+++ b/home/printer.asm
@@ -0,0 +1,34 @@
+
+PrinterSerial::
+ homecall PrinterSerial_
+ ret
+
+SerialFunction::
+ ld a, [wPrinterConnectionOpen]
+ bit 0, a
+ ret z
+ ld a, [wPrinterOpcode]
+ and a
+ ret nz
+ ld hl, wOverworldMap + 650
+ inc [hl]
+ ld a, [hl]
+ cp $6
+ ret c
+ xor a
+ ld [hl], a
+ ld a, $0c
+ ld [wPrinterOpcode], a
+ ld a, $88
+ ldh [rSB], a
+ ld a, $1
+ ldh [rSC], a
+ ld a, START_TRANSFER_INTERNAL_CLOCK
+ ldh [rSC], a
+ ret
+
+; causes the text box to close without waiting for a button press after displaying text
+DisableWaitingAfterTextDisplay::
+ ld a, $01
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ret
diff --git a/home/reload_sprites.asm b/home/reload_sprites.asm
index 8a08d64d..63a71d26 100644
--- a/home/reload_sprites.asm
+++ b/home/reload_sprites.asm
@@ -9,7 +9,7 @@ ReloadMapSpriteTilePatterns::
xor a
ld [wSpriteSetID], a
call DisableLCD
- farcall InitMapSprites
+ call InitMapSprites
call EnableLCD
pop hl
pop af
diff --git a/home/reload_tiles.asm b/home/reload_tiles.asm
index 6228395c..b596263a 100644
--- a/home/reload_tiles.asm
+++ b/home/reload_tiles.asm
@@ -10,8 +10,7 @@ ReloadMapData::
call LoadTilesetTilePatternData
call EnableLCD
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; reloads tileset tile patterns
@@ -24,8 +23,7 @@ ReloadTilesetTilePatterns::
call LoadTilesetTilePatternData
call EnableLCD
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; shows the town map and lets the player choose a destination to fly to
@@ -33,9 +31,3 @@ ChooseFlyDestination::
ld hl, wd72e
res 4, [hl]
farjp LoadTownMap_Fly
-
-; causes the text box to close without waiting for a button press after displaying text
-DisableWaitingAfterTextDisplay::
- ld a, $01
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ret
diff --git a/home/reset_player_sprite.asm b/home/reset_player_sprite.asm
index 72df31a1..2765d613 100644
--- a/home/reset_player_sprite.asm
+++ b/home/reset_player_sprite.asm
@@ -17,4 +17,5 @@ ResetPlayerSpriteData::
ResetPlayerSpriteData_ClearSpriteData::
ld bc, $10
xor a
- jp FillMemory
+ call FillMemory
+ ret
diff --git a/home/serial.asm b/home/serial.asm
index bd984d4f..ef914933 100644
--- a/home/serial.asm
+++ b/home/serial.asm
@@ -3,6 +3,9 @@ Serial::
push bc
push de
push hl
+ ld a, [wPrinterConnectionOpen]
+ bit 0, a
+ jp nz, PrinterSerial__
ldh a, [hSerialConnectionStatus]
inc a
jr z, .connectionNotYetEstablished
@@ -310,3 +313,11 @@ Serial_TryEstablishingExternallyClockedConnection::
ld a, START_TRANSFER_EXTERNAL_CLOCK
ldh [rSC], a
ret
+
+PrinterSerial__::
+ call PrinterSerial
+ pop hl
+ pop de
+ pop bc
+ pop af
+ reti
diff --git a/home/start.asm b/home/start.asm
index 764f9468..366806e9 100644
--- a/home/start.asm
+++ b/home/start.asm
@@ -4,7 +4,7 @@ _Start::
xor a
jr .ok
.gbc
- ld a, FALSE
+ ld a, TRUE
.ok
- ld [wGBC], a
+ ldh [hGBC], a
jp Init
diff --git a/home/start_menu.asm b/home/start_menu.asm
index 5b29f67a..8edccfe2 100644
--- a/home/start_menu.asm
+++ b/home/start_menu.asm
@@ -1,7 +1,6 @@
DisplayStartMenu::
- ld a, BANK(StartMenu_Pokedex)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ ld a, BANK(StartMenu_Pokedex) ; also bank for other functions
+ call BankswitchCommon
ld a, [wWalkBikeSurfState] ; walking/biking/surfing
ld [wWalkBikeSurfStateCopy], a
ld a, SFX_START_MENU
@@ -9,6 +8,7 @@ DisplayStartMenu::
RedisplayStartMenu::
farcall DrawStartMenu
+RedisplayStartMenu_DoNotDrawStartMenu::
farcall PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone
call UpdateSprites
.loop
diff --git a/home/text.asm b/home/text.asm
index 244c6fdb..a8571722 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -239,6 +239,13 @@ Paragraph::
jp NextChar
PageChar::
+ ldh a, [hUILayoutFlags]
+ bit 3, a
+ jr z, .pageChar
+ ld a, "<NEXT>"
+ jp PlaceNextChar.NotTerminator
+
+.pageChar
push de
ld a, "▼"
ldcoord_a 18, 16
@@ -516,7 +523,7 @@ TextCommand_SOUND::
jr .loop
.play
- cp TX_SOUND_CRY_NIDORINA
+ cp TX_SOUND_CRY_PIKACHU
jr z, .pokemonCry
cp TX_SOUND_CRY_PIDGEOT
jr z, .pokemonCry
@@ -546,9 +553,9 @@ TextCommandSounds::
db TX_SOUND_GET_ITEM_2, SFX_GET_ITEM_2
db TX_SOUND_GET_KEY_ITEM, SFX_GET_KEY_ITEM
db TX_SOUND_DEX_PAGE_ADDED, SFX_DEX_PAGE_ADDED
- db TX_SOUND_CRY_NIDORINA, NIDORINA ; used in OakSpeech
- db TX_SOUND_CRY_PIDGEOT, PIDGEOT ; used in SaffronCityText12
- db TX_SOUND_CRY_DEWGONG, DEWGONG ; unused
+ db TX_SOUND_CRY_PIKACHU, STARTER_PIKACHU ; used in OakSpeech
+ db TX_SOUND_CRY_PIDGEOT, PIDGEOT ; used in SaffronCityText12
+ db TX_SOUND_CRY_DEWGONG, DEWGONG ; unused
TextCommand_DOTS::
; wait for button press or 30 frames while printing "…"s
diff --git a/home/text_script.asm b/home/text_script.asm
index a6881dc5..5ef9f9fa 100644
--- a/home/text_script.asm
+++ b/home/text_script.asm
@@ -1,3 +1,7 @@
+UnknownText_2812:: ; unreferenced
+ text_far _PokemonText
+ text_end
+
; this function is used to display sign messages, sprite dialog, etc.
; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID
DisplayTextID::
@@ -22,6 +26,7 @@ DisplayTextID::
ld [wSpriteIndex], a
dict TEXT_START_MENU, DisplayStartMenu
+ dict TEXT_PIKACHU_ANIM, DisplayPikachuEmotion
dict TEXT_SAFARI_GAME_OVER, DisplaySafariGameOverText
dict TEXT_MON_FAINTED, DisplayPokemonFaintedText
dict TEXT_BLACKED_OUT, DisplayPlayerBlackedOutText
@@ -36,20 +41,13 @@ DisplayTextID::
.spriteHandling
; get the text ID of the sprite
push hl
- push de
- push bc
- farcall UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction)
- pop bc
- pop de
ld hl, wMapSpriteData ; NPC text entries
ldh a, [hSpriteIndexOrTextID]
dec a
add a
- add l
- ld l, a
- jr nc, .noCarry
- inc h
-.noCarry
+ ld e, a
+ ld d, 0
+ add hl, de
inc hl
ld a, [hl] ; a = text ID of the sprite
pop hl
@@ -57,7 +55,8 @@ DisplayTextID::
; look up the address of the text in the map's text entries
dec a
ld e, a
- sla e
+ ld d, 0
+ add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
@@ -122,9 +121,6 @@ CloseTextDisplay::
add hl, de
dec c
jr nz, .restoreSpriteFacingDirectionLoop
- ld a, BANK(InitMapSprites)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
ld hl, wFontLoaded
res 0, [hl]
@@ -133,8 +129,7 @@ CloseTextDisplay::
call z, LoadPlayerSpriteGraphics
call LoadCurrentMapView
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
jp UpdateSprites
DisplayPokemartDialogue::
@@ -199,6 +194,16 @@ DisplayPlayerBlackedOutText::
ld a, [wd732]
res 5, a ; reset forced to use bike bit
ld [wd732], a
+ CheckEvent EVENT_IN_SAFARI_ZONE
+ jr z, .didnotblackoutinsafari
+ xor a
+ ld [wNumSafariBalls], a
+ ld [wSafariSteps], a
+ ld [wSafariSteps + 1], a
+ EventFlagAddressA EVENT_IN_SAFARI_ZONE
+ ld [wcf0d], a
+ ld [wSafariZoneGateCurScript], a
+.didnotblackoutinsafari
jp HoldTextDisplayOpen
PlayerBlackedOutText::
@@ -213,3 +218,7 @@ DisplayRepelWoreOffText::
RepelWoreOffText::
text_far _RepelWoreOffText
text_end
+
+DisplayPikachuEmotion::
+ callfar TalkToPikachu
+ jp CloseTextDisplay
diff --git a/home/tilemap.asm b/home/tilemap.asm
index afee7097..ea247763 100644
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -1,17 +1,3 @@
-FillMemory::
-; Fill bc bytes at hl with a.
- push de
- ld d, a
-.loop
- ld a, d
- ld [hli], a
- dec bc
- ld a, b
- or c
- jr nz, .loop
- pop de
- ret
-
UncompressSpriteFromDE::
; Decompress pic at a:de.
ld hl, wSpriteInputPtr
@@ -24,8 +10,7 @@ SaveScreenTilesToBuffer2::
hlcoord 0, 0
ld de, wTileMapBackup2
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- call CopyData
- ret
+ jp CopyData
LoadScreenTilesFromBuffer2::
call LoadScreenTilesFromBuffer2DisableBGTransfer
@@ -40,8 +25,7 @@ LoadScreenTilesFromBuffer2DisableBGTransfer::
ld hl, wTileMapBackup2
decoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- call CopyData
- ret
+ jp CopyData
SaveScreenTilesToBuffer1::
hlcoord 0, 0
diff --git a/home/trainers.asm b/home/trainers.asm
index 4dc63fef..468b63f8 100644
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -383,17 +383,6 @@ TrainerEndBattleText::
call TextCommandProcessor
jp TextScriptEnd
-; only engage with the trainer if the player is not already
-; engaged with another trainer
-; XXX unused?
-CheckIfAlreadyEngaged::
- ld a, [wFlags_0xcd60]
- bit 0, a
- ret nz
- call EngageMapTrainer
- xor a
- ret
-
PlayTrainerMusic::
ld a, [wEngagedTrainerClass]
cp OPP_RIVAL1
@@ -407,8 +396,7 @@ PlayTrainerMusic::
ret nz
xor a
ld [wAudioFadeOutControl], a
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ld a, BANK(Music_MeetEvilTrainer)
ld [wAudioROMBank], a
ld [wAudioSavedROMBank], a
diff --git a/home/trainers2.asm b/home/trainers2.asm
index 950eabb2..78fb6463 100644
--- a/home/trainers2.asm
+++ b/home/trainers2.asm
@@ -22,6 +22,7 @@ GetTrainerInformation::
inc de
ld a, [hli]
ld [de], a
+ call IsFightingJessieJames
jp BankswitchBack
.linkBattle
ld hl, wTrainerPicPointer
@@ -31,5 +32,23 @@ GetTrainerInformation::
ld [hl], d
ret
+IsFightingJessieJames::
+ ld a, [wTrainerClass]
+ cp ROCKET
+ ret nz
+ ld a, [wTrainerNo]
+ cp $2a
+ ret c
+ ld de, JessieJamesPic
+ cp $2e
+ jr c, .dummy
+ ld de, JessieJamesPic ; possibly meant to add another pic
+.dummy
+ ld hl, wTrainerPicPointer
+ ld a, e
+ ld [hli], a
+ ld [hl], d
+ ret
+
GetTrainerName::
farjp GetTrainerName_
diff --git a/home/uncompress.asm b/home/uncompress.asm
index d3d84b26..27474f2d 100644
--- a/home/uncompress.asm
+++ b/home/uncompress.asm
@@ -5,16 +5,13 @@ UncompressSpriteData::
ldh a, [hLoadedROMBank]
push af
ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
- ld a, SRAM_ENABLE
- ld [MBC1SRamEnable], a
- xor a
- ld [MBC1SRamBank], a
+ call BankswitchCommon
+ ld a, $0
+ call SwitchSRAMBankAndLatchClockData
call _UncompressSpriteData
+ call PrepareRTCDataAndDisableSRAM
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
ret
; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop
diff --git a/home/update_sprites.asm b/home/update_sprites.asm
index 5530c2a4..5bb9ee12 100644
--- a/home/update_sprites.asm
+++ b/home/update_sprites.asm
@@ -2,5 +2,15 @@ UpdateSprites::
ld a, [wUpdateSpritesEnabled]
dec a
ret nz
- homecall _UpdateSprites
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, BANK(_UpdateSprites)
+ call BankswitchCommon
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ call _UpdateSprites
+ ld a, $1
+ ld [wUpdateSpritesEnabled], a
+ pop af
+ call BankswitchCommon
ret
diff --git a/home/vblank.asm b/home/vblank.asm
index 4c7abc20..3957639a 100644
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -5,6 +5,11 @@ VBlank::
push de
push hl
+ ldh a, [rVBK] ; vram bank
+ push af
+ xor a
+ ldh [rVBK], a ; reset vram bank to 0
+
ldh a, [hLoadedROMBank]
ld [wVBlankSavedROMBank], a
@@ -33,8 +38,10 @@ VBlank::
call PrepareOAMData
; VBlank-sensitive operations end.
+ call TrackPlayTime ; keep track of time played
call Random
+ call ReadJoypad
ldh a, [hVBlankOccurred]
and a
@@ -52,36 +59,22 @@ VBlank::
.skipDec
call FadeOutAudio
- ld a, [wAudioROMBank] ; music ROM bank
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
-
- cp BANK(Audio1_UpdateMusic)
- jr nz, .checkForAudio2
-.audio1
- call Audio1_UpdateMusic
- jr .afterMusic
-.checkForAudio2
- cp BANK(Audio2_UpdateMusic)
- jr nz, .audio3
-.audio2
+ ld a, BANK(Music_DoLowHealthAlarm)
+ call BankswitchCommon
call Music_DoLowHealthAlarm
- call Audio2_UpdateMusic
- jr .afterMusic
-.audio3
- call Audio3_UpdateMusic
-.afterMusic
-
- farcall TrackPlayTime ; keep track of time played
+ ld a, BANK(Audio1_UpdateMusic)
+ call BankswitchCommon
+ call Audio1_UpdateMusic
- ldh a, [hDisableJoypadPolling]
- and a
- call z, ReadJoypad
+ call SerialFunction
ld a, [wVBlankSavedROMBank]
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
+ pop af
+ ldh [rVBK], a
+
pop hl
pop de
pop bc
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 0b0e0144..4a80d261 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -123,11 +123,7 @@ AutoBgMapTransfer::
ldh a, [hAutoBGTransferEnabled]
and a
ret z
- ld hl, sp + 0
- ld a, h
- ldh [hSPTemp], a
- ld a, l
- ldh [hSPTemp + 1], a ; save stack pinter
+ ld [hSPTemp], sp ; save stack pointer
ldh a, [hAutoBGTransferPortion]
and a
jr z, .transferTopThird
@@ -191,9 +187,9 @@ ENDR
jr nz, TransferBgRows
ldh a, [hSPTemp]
- ld h, a
- ldh a, [hSPTemp + 1]
ld l, a
+ ldh a, [hSPTemp + 1]
+ ld h, a
ld sp, hl
ret
@@ -203,11 +199,7 @@ VBlankCopyBgMap::
ldh a, [hVBlankCopyBGSource] ; doubles as enabling byte
and a
ret z
- ld hl, sp + 0
- ld a, h
- ldh [hSPTemp], a
- ld a, l
- ldh [hSPTemp + 1], a ; save stack pointer
+ ld [hSPTemp], sp ; save stack pointer
ldh a, [hVBlankCopyBGSource]
ld l, a
ldh a, [hVBlankCopyBGSource + 1]
@@ -236,11 +228,7 @@ VBlankCopyDouble::
and a
ret z
- ld hl, sp + 0
- ld a, h
- ldh [hSPTemp], a
- ld a, l
- ldh [hSPTemp + 1], a
+ ld [hSPTemp], sp ; save stack pointer
ldh a, [hVBlankCopyDoubleSource]
ld l, a
@@ -282,21 +270,14 @@ ENDR
dec b
jr nz, .loop
- ld a, l
- ldh [hVBlankCopyDoubleDest], a
- ld a, h
- ldh [hVBlankCopyDoubleDest + 1], a
-
- ld hl, sp + 0
- ld a, l
- ldh [hVBlankCopyDoubleSource], a
- ld a, h
- ldh [hVBlankCopyDoubleSource + 1], a
+ ld [hVBlankCopyDoubleSource], sp
+ ld sp, hl ; load destination into sp to save time with ld [$xxxx], sp
+ ld [hVBlankCopyDoubleDest], sp
ldh a, [hSPTemp]
- ld h, a
- ldh a, [hSPTemp + 1]
ld l, a
+ ldh a, [hSPTemp + 1]
+ ld h, a
ld sp, hl
ret
@@ -313,11 +294,7 @@ VBlankCopy::
and a
ret z
- ld hl, sp + 0
- ld a, h
- ldh [hSPTemp], a
- ld a, l
- ldh [hSPTemp + 1], a
+ ld [hSPTemp], sp
ldh a, [hVBlankCopySource]
ld l, a
@@ -351,21 +328,14 @@ ENDR
dec b
jr nz, .loop
- ld a, l
- ldh [hVBlankCopyDest], a
- ld a, h
- ldh [hVBlankCopyDest + 1], a
-
- ld hl, sp + 0
- ld a, l
- ldh [hVBlankCopySource], a
- ld a, h
- ldh [hVBlankCopySource + 1], a
+ ld [hVBlankCopySource], sp
+ ld sp, hl
+ ld [hVBlankCopyDest], sp
ldh a, [hSPTemp]
- ld h, a
- ldh a, [hSPTemp + 1]
ld l, a
+ ldh a, [hSPTemp + 1]
+ ld h, a
ld sp, hl
ret
@@ -379,6 +349,10 @@ UpdateMovingBgTiles::
and a
ret z ; no animations if indoors (or if a menu set this to 0)
+ ldh a, [rLY]
+ cp $90 ; check if not in vblank period??? (maybe if vblank is too long)
+ ret c
+
ldh a, [hMovingBGTilesCounter1]
inc a
ldh [hMovingBGTilesCounter1], a
diff --git a/home/window.asm b/home/window.asm
index 0182bdd3..1be272f9 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -50,6 +50,8 @@ HandleMenuInput_::
ld [wCheckFor180DegreeTurn], a
ldh a, [hJoy5]
ld b, a
+ bit 0, a ; pressed A key?
+ jr nz, .checkOtherKeys
bit 6, a ; pressed Up key?
jr z, .checkIfDownPressed
.upPressed
@@ -135,15 +137,13 @@ PlaceMenuCursor::
ld a, [wLastMenuItem]
and a ; was the previous menu id 0?
jr z, .checkForArrow1
+ ld bc, 40
push af
ldh a, [hUILayoutFlags]
bit 1, a ; is the menu double spaced?
jr z, .doubleSpaced1
ld bc, 20
- jr .getOldMenuItemScreenPosition
.doubleSpaced1
- ld bc, 40
-.getOldMenuItemScreenPosition
pop af
.oldMenuItemLoop
add hl, bc
@@ -161,15 +161,13 @@ PlaceMenuCursor::
ld a, [wCurrentMenuItem]
and a
jr z, .checkForArrow2
+ ld bc, 40
push af
ldh a, [hUILayoutFlags]
bit 1, a ; is the menu double spaced?
jr z, .doubleSpaced2
ld bc, 20
- jr .getCurrentMenuItemScreenPosition
.doubleSpaced2
- ld bc, 40
-.getCurrentMenuItemScreenPosition
pop af
.currentMenuItemLoop
add hl, bc
diff --git a/home/yes_no.asm b/home/yes_no.asm
index 5b0e09ed..28d6c7aa 100644
--- a/home/yes_no.asm
+++ b/home/yes_no.asm
@@ -5,7 +5,7 @@ YesNoChoice::
call InitYesNoTextBoxParameters
jr DisplayYesNoChoice
-Func_35f4::
+Func_35f7::
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call InitYesNoTextBoxParameters
diff --git a/hram.asm b/hram.asm
index 0607a484..0e9a61e1 100644
--- a/hram.asm
+++ b/hram.asm
@@ -332,6 +332,9 @@ hGymTrashCanRandNumMask::
NEXTU
hFFDB:: db
hFFDC:: db
+
+NEXTU
+hCanceledPrinting:: db
ENDU
ds 1
@@ -385,9 +388,15 @@ ENDU
hWhoseTurn:: db ; 0 on player's turn, 1 on enemy's turn
-hClearLetterPrintingDelayFlags:: db
+hLCDCPointer:: db
- ds 1
+hJoyInput:: db
+
+ ds 2
+
+hDisableJoypadPolling:: db
+
+hClearLetterPrintingDelayFlags:: db
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
; bit 1: menu is double spaced
@@ -395,8 +404,9 @@ hUILayoutFlags:: db
hFieldMoveMonMenuTopMenuItemX:: db
-hJoyInput:: db
+hPikachuSpriteVRAMOffset:: db
-hDisableJoypadPolling:: db
+ ds 1
- ds 5
+; 0 if DMG, != 0 if GBC
+hGBC:: db
diff --git a/layout.link b/layout.link
index 0c7096cb..ff4c250f 100644
--- a/layout.link
+++ b/layout.link
@@ -44,20 +44,20 @@ ROMX $2
ROMX $3
"bank3"
ROMX $4
+ "bank4"
"NPC Sprites 1"
- "Font Graphics"
"Battle Engine 1"
ROMX $5
+ "bank5"
"NPC Sprites 2"
"Battle Engine 2"
ROMX $6
"Maps 1"
- "Play Time"
"Maps 2"
"Doors and Ledges"
ROMX $7
"Maps 3"
- "Pokémon Names"
+ "bank7"
"Maps 4"
"Hidden Objects 1"
ROMX $8
@@ -79,12 +79,11 @@ ROMX $B
"Battle Engine 5"
ROMX $C
"Pics 4"
- "Battle Engine 6"
ROMX $D
"Pics 5"
"Slot Machines"
ROMX $E
- "Battle Engine 7"
+ "Battle Engine 6"
ROMX $F
"Battle Core"
ROMX $10
@@ -93,28 +92,25 @@ ROMX $11
"Maps 5"
"Pokédex Rating"
"Maps 6"
- "Hidden Objects Core"
+ "Dungeon Warps"
ROMX $12
"Maps 7"
- "Screen Effects"
"Maps 8"
ROMX $13
"Pics 6"
"Maps 9"
- "Predefs"
ROMX $14
"Maps 10"
- "Battle Engine 8"
"Hidden Objects 2"
ROMX $15
"Maps 11"
- "Battle Engine 9"
+ "Battle Engine 7"
"Maps 12"
"Diploma"
"Trainer Sight"
ROMX $16
"Maps 13"
- "Battle Engine 10"
+ "bank16"
"Maps 14"
"Saffron Guards"
ROMX $17
@@ -130,7 +126,7 @@ ROMX $18
ROMX $19
"Tilesets 1"
ROMX $1A
- "Battle Engine 11"
+ "Version Graphics"
"Tilesets 2"
ROMX $1B
"Tilesets 3"
@@ -152,35 +148,89 @@ ROMX $1F
"Audio Engine 3"
"Music 3"
ROMX $20
- "Text 1"
+ "Sound Effect Headers 4"
+ "Music Headers 4"
+ "Sound Effects 4"
+ "Audio Engine 4"
+ "Music 4"
ROMX $21
- "Text 2"
+ "Pikachu Cries 1"
ROMX $22
- "Text 3"
+ "Pikachu Cries 2"
ROMX $23
- "Text 4"
+ "Pikachu Cries 3"
ROMX $24
- "Text 5"
+ "Pikachu Cries 4"
ROMX $25
- "Text 6"
+ "Pikachu Cries 5"
ROMX $26
- "Text 7"
+ "Text 1"
ROMX $27
- "Text 8"
+ "Text 2"
ROMX $28
- "Text 9"
+ "Text 3"
ROMX $29
- "Text 10"
+ "Text 4"
ROMX $2A
- "Text 11"
+ "Text 5"
ROMX $2B
- "Pokédex Text"
+ "Text 6"
ROMX $2C
+ "Text 7"
+ROMX $2D
+ "Text 8"
+ROMX $2E
+ "Pokédex Text"
+ROMX $2f
"Move Names"
+ "BG Map Attributes (Debug)"
+ org $5000
+ "BG Map Attributes"
+ROMX $30
+ "bank30"
+ROMX $31
+ "Pikachu Cries 6"
+ROMX $32
+ "Pikachu Cries 7"
+ROMX $33
+ "Pikachu Cries 8"
+ROMX $34
+ "Pikachu Cries 9"
+ROMX $35
+ "Pikachu Cries 10"
+ROMX $36
+ "Pikachu Cries 11"
+ROMX $37
+ "Pikachu Cries 12"
+ROMX $38
+ "Pikachu Cries 13"
+ROMX $39
+ "Pikachu Graphics 1"
+ROMX $3A
+ "bank3A"
+; bank $3B is empty
+ROMX $3C
+ "Pikachu PCM"
+ "Tilesets 4"
+ "Try Pikachu Movement"
+ "Pikachu Graphics 2"
+ "Credits"
+ "Maps 22"
+ "Hidden Objects Core"
+ROMX $3D
+ "Battle Engine 8"
+ "Pics 7"
+ "Battle Engine 9"
+ROMX $3E
+ "Surfing Minigame"
+ROMX $3F
+ "Overworld Pikachu"
+ "NPC Sprites 3"
WRAM0
"Audio RAM"
org $c100
"Sprite State Data"
+ org $c300
"OAM Buffer"
"Tilemap"
"Overworld Map"
@@ -188,9 +238,10 @@ WRAM0
"Party Data"
"Main Data"
"Current Box Data"
- org $df00
+ "GBC Palette Data"
+ org $df15
"Stack"
-VRAM
+VRAM $0
"VRAM"
SRAM $0
"Sprite Buffers"
diff --git a/macros.asm b/macros.asm
index 4eacddaf..7b64db91 100644
--- a/macros.asm
+++ b/macros.asm
@@ -11,3 +11,4 @@ INCLUDE "macros/scripts/audio.asm"
INCLUDE "macros/scripts/maps.asm"
INCLUDE "macros/scripts/events.asm"
INCLUDE "macros/scripts/text.asm"
+INCLUDE "macros/scripts/gfx_anims.asm"
diff --git a/macros/data.asm b/macros/data.asm
index eb5b5564..9d8a4406 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -60,3 +60,12 @@ ENDM
dab: MACRO
dwb \1, BANK(\1)
ENDM
+
+sine_table: MACRO
+; \1 samples of sin(x) from x=0 to x<32768 (pi radians)
+x = 0
+REPT \1
+ dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
+x = x + DIV(32768, \1) ; a circle has 65536 "degrees"
+ENDR
+ENDM
diff --git a/macros/farcall.asm b/macros/farcall.asm
index 93f8f1ac..f3fa07d4 100644
--- a/macros/farcall.asm
+++ b/macros/farcall.asm
@@ -26,23 +26,54 @@ homecall: MACRO
ldh a, [hLoadedROMBank]
push af
ld a, BANK(\1)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
call \1
pop af
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
+ENDM
+
+homejp: MACRO
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ pop af
+ jp BankswitchCommon
ENDM
homecall_sf: MACRO ; homecall but save flags by popping into bc instead of af
ldh a, [hLoadedROMBank]
push af
ld a, BANK(\1)
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
call \1
pop bc
ld a, b
- ldh [hLoadedROMBank], a
- ld [MBC1RomBank], a
+ call BankswitchCommon
+ENDM
+
+homejp_sf: MACRO ; homejp but save flags by popping into bc instead of af
+ ldh a, [hLoadedROMBank]
+ push af
+ ld a, BANK(\1)
+ call BankswitchCommon
+ call \1
+ pop bc
+ ld a, b
+ jp BankswitchCommon
+ENDM
+
+calladb_ModifyPikachuHappiness: MACRO
+ ld hl, ModifyPikachuHappiness
+ ld d, \1
+ ld b, BANK(ModifyPikachuHappiness)
+ call Bankswitch
+ENDM
+
+callabd_ModifyPikachuHappiness: MACRO
+ ld hl, ModifyPikachuHappiness
+ ld b, BANK(ModifyPikachuHappiness)
+ ld d, \1
+ call Bankswitch
ENDM
diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm
index c7fdb484..a5f7113d 100644
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -62,6 +62,16 @@ event_byte = ((\2) / 8)
ENDM
+EventFlagAddressA: MACRO
+event_byte = ((\1) / 8)
+ ld [wEventFlags + event_byte], a
+ENDM
+
+AEventFlagAddress: MACRO
+event_byte = ((\1) / 8)
+ ld a, [wEventFlags + event_byte]
+ENDM
+
;\1 = event index
CheckEventHL: MACRO
event_byte = ((\1) / 8)
@@ -138,6 +148,27 @@ CheckAndResetEventA: MACRO
ENDM
+CheckAndSetEventReuseHL: MACRO
+ IF event_byte != ((\1) / 8)
+event_byte = ((\1) / 8)
+ ld hl, wEventFlags + event_byte
+ ENDC
+
+ bit (\1) % 8, [hl]
+ set (\1) % 8, [hl]
+ENDM
+
+CheckAndResetEventReuseHL: MACRO
+ IF event_byte != ((\1) / 8)
+event_byte = ((\1) / 8)
+ ld hl, wEventFlags + event_byte
+ ENDC
+
+ bit (\1) % 8, [hl]
+ res (\1) % 8, [hl]
+ENDM
+
+
;\1 = event index
SetEvent: MACRO
event_byte = ((\1) / 8)
@@ -438,6 +469,36 @@ CheckEitherEventSet: MACRO
ENDM
+CheckEitherEventSetReuseA: MACRO
+ IF event_byte != ((\1) / 8)
+event_byte = ((\1) / 8)
+ ld a, [wEventFlags + event_byte]
+ ENDC
+ IF ((\1) / 8) == ((\2) / 8)
+ ld a, [wEventFlags + ((\1) / 8)]
+ and (1 << ((\1) % 8)) | (1 << ((\2) % 8))
+ ELSE
+ ; This case doesn't happen in the original ROM.
+ IF ((\1) % 8) == ((\2) % 8)
+ push hl
+ ld a, [wEventFlags + ((\1) / 8)]
+ ld hl, wEventFlags + ((\2) / 8)
+ or [hl]
+ bit ((\1) % 8), a
+ pop hl
+ ELSE
+ push bc
+ ld a, [wEventFlags + ((\1) / 8)]
+ and (1 << ((\1) % 8))
+ ld b, a
+ ld a, [wEventFlags + ((\2) / 8)]
+ and (1 << ((\2) % 8))
+ or b
+ pop bc
+ ENDC
+ ENDC
+ENDM
+
; for handling fixed event bits when events are inserted/removed
;\1 = event index
;\2 = fixed flag bit
diff --git a/macros/scripts/gfx_anims.asm b/macros/scripts/gfx_anims.asm
new file mode 100644
index 00000000..f475ad8d
--- /dev/null
+++ b/macros/scripts/gfx_anims.asm
@@ -0,0 +1,37 @@
+; pic + oam animations
+
+frame: MACRO
+ db \1
+x = \2
+IF _NARG > 2
+REPT _NARG - 2
+x = x | (\3 << 1)
+ shift
+ENDR
+ENDC
+ db x
+ENDM
+
+ const_def -1, -1
+
+ const endanim_command ; $ff
+endanim: MACRO
+ db endanim_command
+ENDM
+
+ const dorestart_command ; $fe
+dorestart: MACRO
+ db dorestart_command
+ENDM
+
+ const dorepeat_command ; $fd
+dorepeat: MACRO
+ db dorepeat_command
+ db \1 ; command offset to jump to
+ENDM
+
+ const delanim_command ; $fc
+delanim: MACRO
+; Removes the object from the screen, as opposed to `endanim` which just stops all motion
+ db delanim_command
+ENDM
diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm
index c446c6c7..38e56b77 100644
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -127,9 +127,9 @@ sound_dex_page_added: MACRO
db TX_SOUND_DEX_PAGE_ADDED
ENDM
- const TX_SOUND_CRY_NIDORINA ; $14
-sound_cry_nidorina: MACRO
- db TX_SOUND_CRY_NIDORINA
+ const TX_SOUND_CRY_PIKACHU ; $14
+sound_cry_pikachu: MACRO
+ db TX_SOUND_CRY_PIKACHU
ENDM
const TX_SOUND_CRY_PIDGEOT ; $15
diff --git a/macros/wram.asm b/macros/wram.asm
index 872e7f57..be89dad6 100644
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -113,3 +113,23 @@ map_connection_struct: MACRO
\1ConnectedMapXAlignment:: db
\1ConnectedMapViewPointer:: dw
ENDM
+
+animated_object: MACRO
+\1Index:: db
+\1FramesetID:: db
+\1AnimSeqID:: db
+\1TileID:: db
+\1XCoord:: db
+\1YCoord:: db
+\1XOffset:: db
+\1YOffset:: db
+\1Duration:: db
+\1DurationOffset:: db
+\1FrameIndex:: db
+\1FieldB:: db
+\1FieldC:: db
+\1FieldD:: db
+\1FieldE:: db
+\1FieldF:: db
+\1End::
+ENDM
diff --git a/main.asm b/main.asm
index 31506a29..30ce5825 100644
--- a/main.asm
+++ b/main.asm
@@ -4,8 +4,6 @@ INCLUDE "constants.asm"
SECTION "bank1", ROMX
INCLUDE "data/sprites/facings.asm"
-INCLUDE "engine/events/black_out.asm"
-INCLUDE "data/pokemon/mew.asm"
INCLUDE "engine/battle/safari_zone.asm"
INCLUDE "engine/movie/title.asm"
INCLUDE "engine/pokemon/load_mon_data.asm"
@@ -13,10 +11,8 @@ INCLUDE "data/items/prices.asm"
INCLUDE "data/items/names.asm"
INCLUDE "data/text/unused_names.asm"
INCLUDE "engine/gfx/sprite_oam.asm"
-INCLUDE "engine/gfx/oam_dma.asm"
INCLUDE "engine/link/print_waiting_text.asm"
INCLUDE "engine/overworld/sprite_collisions.asm"
-INCLUDE "engine/debug/debug_menu.asm"
INCLUDE "engine/events/pick_up_item.asm"
INCLUDE "engine/overworld/movement.asm"
INCLUDE "engine/link/cable_club.asm"
@@ -45,16 +41,12 @@ INCLUDE "engine/events/display_pokedex.asm"
SECTION "bank3", ROMX
INCLUDE "engine/joypad.asm"
-INCLUDE "data/maps/songs.asm"
-INCLUDE "data/maps/map_header_banks.asm"
INCLUDE "engine/overworld/clear_variables.asm"
INCLUDE "engine/overworld/player_state.asm"
INCLUDE "engine/events/poison.asm"
INCLUDE "engine/overworld/tilesets.asm"
INCLUDE "engine/overworld/daycare_exp.asm"
INCLUDE "data/maps/hide_show_data.asm"
-INCLUDE "engine/overworld/field_move_messages.asm"
-INCLUDE "engine/items/inventory.asm"
INCLUDE "engine/overworld/wild_mons.asm"
INCLUDE "engine/items/item_effects.asm"
INCLUDE "engine/menus/draw_badges.asm"
@@ -78,42 +70,35 @@ INCLUDE "engine/events/hidden_objects/town_map.asm"
INCLUDE "engine/events/hidden_objects/pokemon_stuff.asm"
-SECTION "Font Graphics", ROMX
+SECTION "bank4", ROMX
INCLUDE "gfx/font.asm"
-
-
-SECTION "Battle Engine 1", ROMX
-
-INCLUDE "engine/overworld/is_player_just_outside_map.asm"
INCLUDE "engine/pokemon/status_screen.asm"
INCLUDE "engine/menus/party_menu.asm"
INCLUDE "gfx/player.asm"
-INCLUDE "engine/overworld/turn_sprite.asm"
INCLUDE "engine/menus/start_sub_menus.asm"
INCLUDE "engine/items/tms.asm"
+
+
+SECTION "Battle Engine 1", ROMX
+
INCLUDE "engine/battle/end_of_battle.asm"
INCLUDE "engine/battle/wild_encounters.asm"
INCLUDE "engine/battle/move_effects/recoil.asm"
INCLUDE "engine/battle/move_effects/conversion.asm"
INCLUDE "engine/battle/move_effects/haze.asm"
-INCLUDE "engine/battle/get_trainer_name.asm"
-INCLUDE "engine/math/random.asm"
-SECTION "Battle Engine 2", ROMX
+SECTION "bank5", ROMX
INCLUDE "engine/gfx/load_pokedex_tiles.asm"
INCLUDE "engine/overworld/map_sprites.asm"
-INCLUDE "engine/overworld/emotion_bubbles.asm"
-INCLUDE "engine/events/evolve_trade.asm"
-INCLUDE "engine/battle/move_effects/substitute.asm"
-INCLUDE "engine/menus/pc.asm"
-SECTION "Play Time", ROMX
+SECTION "Battle Engine 2", ROMX
-INCLUDE "engine/play_time.asm"
+INCLUDE "engine/battle/move_effects/substitute.asm"
+INCLUDE "engine/menus/pc.asm"
SECTION "Doors and Ledges", ROMX
@@ -123,9 +108,8 @@ INCLUDE "engine/overworld/doors.asm"
INCLUDE "engine/overworld/ledges.asm"
-SECTION "Pokémon Names", ROMX
+SECTION "bank7", ROMX
-INCLUDE "data/pokemon/names.asm"
INCLUDE "engine/movie/oak_speech/clear_save.asm"
INCLUDE "engine/events/elevator.asm"
@@ -151,54 +135,39 @@ SECTION "Battle Engine 3", ROMX
INCLUDE "engine/battle/print_type.asm"
INCLUDE "engine/battle/save_trainer_name.asm"
-INCLUDE "engine/battle/move_effects/focus_energy.asm"
SECTION "Battle Engine 4", ROMX
+INCLUDE "engine/gfx/screen_effects.asm"
INCLUDE "engine/battle/move_effects/leech_seed.asm"
SECTION "Battle Engine 5", ROMX
INCLUDE "engine/battle/display_effectiveness.asm"
-INCLUDE "gfx/trainer_card.asm"
INCLUDE "engine/items/tmhm.asm"
+INCLUDE "engine/pikachu/respawn_overworld_pikachu.asm"
INCLUDE "engine/battle/scale_sprites.asm"
-INCLUDE "engine/battle/move_effects/pay_day.asm"
INCLUDE "engine/slots/game_corner_slots2.asm"
-SECTION "Battle Engine 6", ROMX
-
-INCLUDE "engine/battle/move_effects/mist.asm"
-INCLUDE "engine/battle/move_effects/one_hit_ko.asm"
-
-
SECTION "Slot Machines", ROMX
-INCLUDE "engine/movie/title2.asm"
-INCLUDE "engine/battle/link_battle_versus_text.asm"
+INCLUDE "engine/movie/title_rb.asm"
INCLUDE "engine/slots/slot_machine.asm"
-INCLUDE "engine/events/pewter_guys.asm"
-INCLUDE "engine/math/multiply_divide.asm"
INCLUDE "engine/slots/game_corner_slots.asm"
-SECTION "Battle Engine 7", ROMX
+SECTION "Battle Engine 6", ROMX
INCLUDE "data/moves/moves.asm"
INCLUDE "data/pokemon/base_stats.asm"
INCLUDE "data/pokemon/cries.asm"
-INCLUDE "engine/battle/unused_stats_functions.asm"
-INCLUDE "engine/battle/scroll_draw_trainer_pic.asm"
INCLUDE "engine/battle/trainer_ai.asm"
INCLUDE "engine/battle/draw_hud_pokeball_gfx.asm"
INCLUDE "gfx/trade.asm"
INCLUDE "engine/pokemon/evos_moves.asm"
-INCLUDE "engine/battle/move_effects/heal.asm"
-INCLUDE "engine/battle/move_effects/transform.asm"
-INCLUDE "engine/battle/move_effects/reflect_light_screen.asm"
SECTION "Battle Core", ROMX
@@ -210,9 +179,11 @@ INCLUDE "engine/battle/effects.asm"
SECTION "bank10", ROMX
INCLUDE "engine/menus/pokedex.asm"
+INCLUDE "engine/overworld/emotion_bubbles.asm"
INCLUDE "engine/movie/trade.asm"
INCLUDE "engine/movie/intro.asm"
INCLUDE "engine/movie/trade2.asm"
+INCLUDE "engine/menus/options.asm"
SECTION "Pokédex Rating", ROMX
@@ -220,26 +191,9 @@ SECTION "Pokédex Rating", ROMX
INCLUDE "engine/events/pokedex_rating.asm"
-SECTION "Hidden Objects Core", ROMX
-
-INCLUDE "engine/overworld/hidden_objects.asm"
+SECTION "Dungeon Warps", ROMX
-
-SECTION "Screen Effects", ROMX
-
-INCLUDE "engine/gfx/screen_effects.asm"
-
-
-SECTION "Predefs", ROMX
-
-INCLUDE "engine/events/give_pokemon.asm"
-INCLUDE "engine/predefs.asm"
-
-
-SECTION "Battle Engine 8", ROMX
-
-INCLUDE "engine/battle/init_battle_variables.asm"
-INCLUDE "engine/battle/move_effects/paralyze.asm"
+INCLUDE "engine/overworld/dungeon_warps.asm"
SECTION "Hidden Objects 2", ROMX
@@ -251,7 +205,7 @@ INCLUDE "engine/events/hidden_objects/fighting_dojo.asm"
INCLUDE "engine/events/hidden_objects/indigo_plateau_hq.asm"
-SECTION "Battle Engine 9", ROMX
+SECTION "Battle Engine 7", ROMX
INCLUDE "engine/battle/experience.asm"
@@ -266,10 +220,10 @@ SECTION "Trainer Sight", ROMX
INCLUDE "engine/overworld/trainer_sight.asm"
-SECTION "Battle Engine 10", ROMX
+SECTION "bank16", ROMX
-INCLUDE "engine/battle/common_text.asm"
INCLUDE "engine/pokemon/experience.asm"
+INCLUDE "engine/pokemon/status_ailments.asm"
INCLUDE "engine/events/oaks_aide.asm"
@@ -285,10 +239,13 @@ INCLUDE "engine/events/starter_dex.asm"
SECTION "Hidden Objects 3", ROMX
+INCLUDE "engine/movie/evolution.asm"
INCLUDE "engine/pokemon/set_types.asm"
INCLUDE "engine/events/hidden_objects/reds_room.asm"
INCLUDE "engine/events/hidden_objects/route_15_binoculars.asm"
INCLUDE "engine/events/hidden_objects/museum_fossils.asm"
+INCLUDE "engine/events/hidden_objects/fanclub_pictures.asm"
+INCLUDE "engine/events/hidden_objects/museum_fossils2.asm"
INCLUDE "engine/events/hidden_objects/school_blackboard.asm"
INCLUDE "engine/events/hidden_objects/vermilion_gym_trash.asm"
@@ -306,9 +263,8 @@ INCLUDE "engine/events/hidden_objects/blues_room.asm"
INCLUDE "engine/events/hidden_objects/pokecenter_pc.asm"
-SECTION "Battle Engine 11", ROMX
+SECTION "Version Graphics", ROMX
-INCLUDE "engine/battle/decrement_pp.asm"
INCLUDE "gfx/version.asm"
@@ -329,8 +285,6 @@ INCLUDE "engine/menus/save.asm"
SECTION "Itemfinder 1", ROMX
-INCLUDE "engine/movie/credits.asm"
-INCLUDE "engine/pokemon/status_ailments.asm"
INCLUDE "engine/items/itemfinder.asm"
@@ -342,6 +296,7 @@ INCLUDE "engine/events/vending_machine.asm"
SECTION "Itemfinder 2", ROMX
INCLUDE "engine/menus/league_pc.asm"
+INCLUDE "engine/overworld/elevator.asm"
INCLUDE "engine/events/hidden_items.asm"
@@ -354,6 +309,121 @@ INCLUDE "gfx/fishing.asm"
INCLUDE "data/moves/animations.asm"
INCLUDE "data/battle_anims/subanimations.asm"
INCLUDE "data/battle_anims/frame_blocks.asm"
-INCLUDE "engine/movie/evolution.asm"
-INCLUDE "engine/overworld/elevator.asm"
+
+
+SECTION "BG Map Attributes (Debug)", ROMX
+
+IF DEF(_DEBUG)
+ INCLUDE "engine/gfx/bg_map_attributes.asm"
+ENDC
+
+
+SECTION "BG Map Attributes", ROMX
+
+INCLUDE "data/cgb/bg_map_attributes.asm"
+IF !DEF(_DEBUG)
+ INCLUDE "engine/gfx/bg_map_attributes.asm"
+ENDC
+
+
+SECTION "bank30", ROMX
+
+; This whole bank is garbage data.
+IF !DEF(_DEBUG)
+ INCBIN "garbage/bank30.bin"
+ENDC
+
+
+SECTION "bank3A", ROMX
+
+INCLUDE "data/pokemon/names.asm"
+INCLUDE "engine/overworld/is_player_just_outside_map.asm"
+INCLUDE "engine/printer/serial.asm"
+INCLUDE "engine/printer/printer.asm"
+INCLUDE "engine/events/diploma2.asm"
+INCLUDE "engine/printer/printer2.asm"
+INCLUDE "engine/overworld/npc_movement_2.asm"
+
+
+SECTION "Pikachu PCM", ROMX
+
+INCLUDE "engine/pikachu/pikachu_pcm.asm"
+INCLUDE "engine/overworld/advance_player_sprite.asm"
+INCLUDE "engine/events/black_out.asm"
+INCLUDE "engine/overworld/specific_script_flags.asm"
+
+
+SECTION "Try Pikachu Movement", ROMX
+
+INCLUDE "engine/overworld/unused_load_missable_object_data.asm"
+INCLUDE "engine/events/try_pikachu_movement.asm"
+
+
+SECTION "Credits", ROMX
+
+INCLUDE "engine/events/pokecenter_chansey.asm"
+INCLUDE "engine/movie/credits.asm"
+
+
+SECTION "Hidden Objects Core", ROMX
+
+INCLUDE "engine/overworld/hidden_objects.asm"
+INCLUDE "engine/events/hidden_objects/vermilion_gym_trash2.asm"
+
+
+SECTION "Battle Engine 8", ROMX
+
+INCLUDE "engine/battle/common_text.asm"
+INCLUDE "engine/battle/link_battle_versus_text.asm"
+INCLUDE "engine/battle/unused_stats_functions.asm"
+INCLUDE "engine/battle/scroll_draw_trainer_pic.asm"
+INCLUDE "engine/battle/pikachu_entrance_anim.asm"
+INCLUDE "engine/battle/decrement_pp.asm"
+INCLUDE "engine/events/pikachu_happiness.asm"
+
+
+SECTION "Battle Engine 9", ROMX
+
+INCLUDE "engine/movie/title_yellow.asm"
+INCLUDE "engine/menus/link_menu.asm"
+INCLUDE "engine/menus/unused_input.asm"
+INCLUDE "engine/overworld/field_move_messages.asm"
+INCLUDE "engine/items/inventory.asm"
+INCLUDE "gfx/trainer_card.asm"
+INCLUDE "engine/items/super_rod.asm"
+INCLUDE "engine/battle/init_battle.asm"
+INCLUDE "engine/battle/init_battle_variables.asm"
+INCLUDE "engine/battle/move_effects/focus_energy.asm"
+INCLUDE "engine/battle/move_effects/heal.asm"
+INCLUDE "engine/battle/move_effects/transform.asm"
+INCLUDE "engine/battle/move_effects/reflect_light_screen.asm"
+INCLUDE "engine/battle/move_effects/mist.asm"
+INCLUDE "engine/battle/move_effects/one_hit_ko.asm"
+INCLUDE "engine/battle/move_effects/pay_day.asm"
+INCLUDE "engine/battle/move_effects/paralyze.asm"
INCLUDE "engine/items/tm_prices.asm"
+INCLUDE "engine/math/multiply_divide.asm"
+INCLUDE "engine/events/give_pokemon.asm"
+INCLUDE "engine/battle/get_trainer_name.asm"
+INCLUDE "engine/math/random.asm"
+INCLUDE "engine/predefs.asm"
+
+
+SECTION "Surfing Minigame", ROMX
+
+INCLUDE "engine/minigame/surfing_pikachu.asm"
+INCLUDE "engine/movie/intro_yellow.asm"
+INCLUDE "engine/gfx/animated_objects.asm"
+
+
+SECTION "Overworld Pikachu", ROMX
+
+INCLUDE "data/maps/songs.asm"
+INCLUDE "data/maps/map_header_pointers.asm"
+INCLUDE "data/maps/map_header_banks.asm"
+INCLUDE "engine/pikachu/pikachu_follow.asm"
+INCLUDE "engine/pikachu/pikachu_status.asm"
+INCLUDE "engine/pikachu/pikachu_emotions.asm"
+INCLUDE "engine/pikachu/pikachu_movement.asm"
+INCLUDE "engine/pikachu/pikachu_pic_animation.asm"
+INCLUDE "engine/debug/debug_menu.asm"
diff --git a/maps.asm b/maps.asm
index 4f00f451..4efa99d7 100644
--- a/maps.asm
+++ b/maps.asm
@@ -96,7 +96,7 @@ Route2TradeHouse_Blocks:
SaffronPidgeyHouse_Blocks:
VermilionPidgeyHouse_Blocks:
LavenderCuboneHouse_Blocks:
-CeruleanTradeHouse_Blocks:
+CeruleanMelaniesHouse_Blocks:
PewterNidoranHouse_Blocks:
PewterSpeechHouse_Blocks:
ViridianNicknameHouse_Blocks: INCBIN "maps/ViridianNicknameHouse.blk"
@@ -146,9 +146,9 @@ INCLUDE "data/maps/headers/CeruleanTrashedHouse.asm"
INCLUDE "scripts/CeruleanTrashedHouse.asm"
INCLUDE "data/maps/objects/CeruleanTrashedHouse.asm"
-INCLUDE "data/maps/headers/CeruleanTradeHouse.asm"
-INCLUDE "scripts/CeruleanTradeHouse.asm"
-INCLUDE "data/maps/objects/CeruleanTradeHouse.asm"
+INCLUDE "data/maps/headers/CeruleanMelaniesHouse.asm"
+INCLUDE "scripts/CeruleanMelaniesHouse.asm"
+INCLUDE "data/maps/objects/CeruleanMelaniesHouse.asm"
INCLUDE "data/maps/headers/BikeShop.asm"
INCLUDE "scripts/BikeShop.asm"
@@ -271,6 +271,11 @@ INCLUDE "data/maps/headers/ViridianPokecenter.asm"
INCLUDE "scripts/ViridianPokecenter.asm"
INCLUDE "data/maps/objects/ViridianPokecenter.asm"
+INCLUDE "data/maps/headers/CeladonMart1F.asm"
+INCLUDE "scripts/CeladonMart1F.asm"
+INCLUDE "data/maps/objects/CeladonMart1F.asm"
+CeladonMart1F_Blocks: INCBIN "maps/CeladonMart1F.blk"
+
INCLUDE "data/maps/headers/PokemonMansion1F.asm"
INCLUDE "scripts/PokemonMansion1F.asm"
INCLUDE "data/maps/objects/PokemonMansion1F.asm"
@@ -561,6 +566,7 @@ INCLUDE "data/maps/headers/MtMoonB2F.asm"
INCLUDE "scripts/MtMoonB2F.asm"
INCLUDE "data/maps/objects/MtMoonB2F.asm"
MtMoonB2F_Blocks: INCBIN "maps/MtMoonB2F.blk"
+INCLUDE "scripts/MtMoonB2F_2.asm"
INCLUDE "data/maps/headers/SafariZoneWest.asm"
INCLUDE "scripts/SafariZoneWest.asm"
@@ -1024,11 +1030,6 @@ INCLUDE "scripts/PokemonTower7F.asm"
INCLUDE "data/maps/objects/PokemonTower7F.asm"
PokemonTower7F_Blocks: INCBIN "maps/PokemonTower7F.blk"
-INCLUDE "data/maps/headers/CeladonMart1F.asm"
-INCLUDE "scripts/CeladonMart1F.asm"
-INCLUDE "data/maps/objects/CeladonMart1F.asm"
-CeladonMart1F_Blocks: INCBIN "maps/CeladonMart1F.blk"
-
SECTION "Maps 18", ROMX
@@ -1152,9 +1153,9 @@ INCLUDE "data/maps/objects/WardensHouse.asm"
WardensHouse_Blocks: INCBIN "maps/WardensHouse.blk"
INCLUDE "data/maps/headers/SafariZoneGate.asm"
-INCLUDE "scripts/SafariZoneGate.asm"
INCLUDE "data/maps/objects/SafariZoneGate.asm"
SafariZoneGate_Blocks: INCBIN "maps/SafariZoneGate.blk"
+INCLUDE "scripts/SafariZoneGate.asm"
INCLUDE "data/maps/headers/FuchsiaGym.asm"
INCLUDE "scripts/FuchsiaGym.asm"
@@ -1170,6 +1171,7 @@ INCLUDE "data/maps/headers/CinnabarGym.asm"
INCLUDE "scripts/CinnabarGym.asm"
INCLUDE "data/maps/objects/CinnabarGym.asm"
CinnabarGym_Blocks: INCBIN "maps/CinnabarGym.blk"
+INCLUDE "scripts/CinnabarGym_2.asm"
INCLUDE "data/maps/headers/CinnabarLab.asm"
INCLUDE "scripts/CinnabarLab.asm"
@@ -1222,3 +1224,37 @@ INCLUDE "data/maps/headers/AgathasRoom.asm"
INCLUDE "scripts/AgathasRoom.asm"
INCLUDE "data/maps/objects/AgathasRoom.asm"
AgathasRoom_Blocks: INCBIN "maps/AgathasRoom.blk"
+
+
+SECTION "Maps 22", ROMX
+
+INCLUDE "scripts/ViridianCity2.asm"
+INCLUDE "scripts/VermilionCity2.asm"
+INCLUDE "scripts/CeladonCity2.asm"
+INCLUDE "scripts/Route1_2.asm"
+INCLUDE "scripts/Route22_2.asm"
+INCLUDE "scripts/RedsHouse1F2.asm"
+INCLUDE "scripts/OaksLab2.asm"
+INCLUDE "scripts/ViridianSchoolHouse2.asm"
+INCLUDE "scripts/Museum1F2.asm"
+INCLUDE "scripts/PewterPokecenter2.asm"
+INCLUDE "scripts/PokemonTower2F_2.asm"
+INCLUDE "scripts/CeladonMart3F_2.asm"
+INCLUDE "scripts/CeladonMansion1F_2.asm"
+INCLUDE "scripts/CeladonMansion3F_2.asm"
+INCLUDE "scripts/GameCorner2.asm"
+INCLUDE "scripts/CeladonDiner2.asm"
+INCLUDE "scripts/SafariZoneGate2.asm"
+INCLUDE "scripts/CinnabarGym3.asm"
+INCLUDE "scripts/MtMoonPokecenter2.asm"
+
+INCLUDE "data/maps/headers/SummerBeachHouse.asm"
+INCLUDE "scripts/SummerBeachHouse.asm"
+SummerBeachHouse_Blocks: INCBIN "maps/SummerBeachHouse.blk"
+INCLUDE "data/maps/objects/SummerBeachHouse.asm"
+INCLUDE "scripts/SummerBeachHouse2.asm"
+
+INCLUDE "scripts/BillsHouse2.asm"
+INCLUDE "scripts/ViridianForest2.asm"
+INCLUDE "scripts/SSAnne2FRooms_2.asm"
+INCLUDE "scripts/SilphCo11F_2.asm"
diff --git a/maps/CeladonGym.blk b/maps/CeladonGym.blk
index dcecc50c..7ac1b683 100644
--- a/maps/CeladonGym.blk
+++ b/maps/CeladonGym.blk
@@ -1 +1 @@
-38:933<3=33;?>3344356344321 \ No newline at end of file
+58:963<3=33;?>3344356344321 \ No newline at end of file
diff --git a/maps/CeladonHotel.blk b/maps/CeladonHotel.blk
index 07a8b781..d1399446 100644
--- a/maps/CeladonHotel.blk
+++ b/maps/CeladonHotel.blk
@@ -1,2 +1,2 @@
- 
+ &
 \ No newline at end of file
diff --git a/maps/CeladonPokecenter.blk b/maps/CeladonPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/CeladonPokecenter.blk
+++ b/maps/CeladonPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/CeruleanCave1F.blk b/maps/CeruleanCave1F.blk
index 574613af..7cc9d4d5 100644
--- a/maps/CeruleanCave1F.blk
+++ b/maps/CeruleanCave1F.blk
@@ -1,2 +1,3 @@
- "||b -}f N_vvvvvvvv#vvvvr}|qvv,-Xv=,vtfvvvfvf+}_ "vv-
- } "$ \ No newline at end of file
+ "b ^|bz qmf_fX
+z'n  n>}MMt "__ ">nzr fvvv_r " 
+^t "vv "_ "_Onnvvvvvvvvvvvv$L \ No newline at end of file
diff --git a/maps/CeruleanCave2F.blk b/maps/CeruleanCave2F.blk
index 6eb27eee..f82b5aed 100644
--- a/maps/CeruleanCave2F.blk
+++ b/maps/CeruleanCave2F.blk
@@ -1,3 +1,7 @@
-}( ((  
- 
-}( #  (      }    \ No newline at end of file
+  ( ((   }
+   (# }( 
+  }
+}
+
+ 
+  \ No newline at end of file
diff --git a/maps/CeruleanCaveB1F.blk b/maps/CeruleanCaveB1F.blk
index 858f0529..581ade79 100644
--- a/maps/CeruleanCaveB1F.blk
+++ b/maps/CeruleanCaveB1F.blk
@@ -1 +1,2 @@
-,--Nr02a}f D+,v "pfvvv} fXfvv^tvvtvv)   "vvvSvvvv \ No newline at end of file
+  n z " rf- j[o  "nrfaX rO "}
+ Qmn } "__rv "m v}vvv) r "vvQr)Svvvvvvvvvvvvr \ No newline at end of file
diff --git a/maps/CeruleanMart.blk b/maps/CeruleanMart.blk
index 1da8fffc..62385406 100644
--- a/maps/CeruleanMart.blk
+++ b/maps/CeruleanMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/CeruleanPokecenter.blk b/maps/CeruleanPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/CeruleanPokecenter.blk
+++ b/maps/CeruleanPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/CinnabarMart.blk b/maps/CinnabarMart.blk
index 1da8fffc..62385406 100644
--- a/maps/CinnabarMart.blk
+++ b/maps/CinnabarMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/CinnabarPokecenter.blk b/maps/CinnabarPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/CinnabarPokecenter.blk
+++ b/maps/CinnabarPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/FuchsiaMart.blk b/maps/FuchsiaMart.blk
index 1da8fffc..62385406 100644
--- a/maps/FuchsiaMart.blk
+++ b/maps/FuchsiaMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/FuchsiaPokecenter.blk b/maps/FuchsiaPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/FuchsiaPokecenter.blk
+++ b/maps/FuchsiaPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/GameCorner.blk b/maps/GameCorner.blk
index 82fd0b61..8c8b1fd8 100644
--- a/maps/GameCorner.blk
+++ b/maps/GameCorner.blk
@@ -2,4 +2,4 @@
-4***C*///3 : : : :9!9!9!99!9!9!98!8!8!8 () \ No newline at end of file
+4***C*///3 : : : :9!9!9!99!9!9!98!8!8!8 () \ No newline at end of file
diff --git a/maps/LavenderMart.blk b/maps/LavenderMart.blk
index 1da8fffc..62385406 100644
--- a/maps/LavenderMart.blk
+++ b/maps/LavenderMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/LavenderPokecenter.blk b/maps/LavenderPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/LavenderPokecenter.blk
+++ b/maps/LavenderPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/MtMoonPokecenter.blk b/maps/MtMoonPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/MtMoonPokecenter.blk
+++ b/maps/MtMoonPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/PewterMart.blk b/maps/PewterMart.blk
index 1da8fffc..62385406 100644
--- a/maps/PewterMart.blk
+++ b/maps/PewterMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/PewterPokecenter.blk b/maps/PewterPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/PewterPokecenter.blk
+++ b/maps/PewterPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/RockTunnelPokecenter.blk b/maps/RockTunnelPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/RockTunnelPokecenter.blk
+++ b/maps/RockTunnelPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/Route19.blk b/maps/Route19.blk
index 0bd469e7..3fc58494 100644
--- a/maps/Route19.blk
+++ b/maps/Route19.blk
@@ -1 +1 @@
-(,)(,)(,)$W%$W%CCC11111CCk1111kkCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCkkkkkkkkk \ No newline at end of file
+(,)(,)(,)$W%$W%CCC11111CCC111CCk1111kkCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCkkkkkkkkk \ No newline at end of file
diff --git a/maps/Route4.blk b/maps/Route4.blk
index cb6a6a74..11fefc62 100644
--- a/maps/Route4.blk
+++ b/maps/Route4.blk
@@ -61,4 +61,4 @@ N
-,,)>??,,,,,,,,,,,?????????????????????;tt \ No newline at end of file
+,,)>??,,,,,,,,,,,?????????????????????;tt \ No newline at end of file
diff --git a/maps/SaffronMart.blk b/maps/SaffronMart.blk
index 1da8fffc..62385406 100644
--- a/maps/SaffronMart.blk
+++ b/maps/SaffronMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/SaffronPokecenter.blk b/maps/SaffronPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/SaffronPokecenter.blk
+++ b/maps/SaffronPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/SummerBeachHouse.blk b/maps/SummerBeachHouse.blk
new file mode 100644
index 00000000..5bcdb58a
--- /dev/null
+++ b/maps/SummerBeachHouse.blk
@@ -0,0 +1 @@
+      \ No newline at end of file
diff --git a/maps/UnusedPokecenterCopy.blk b/maps/UnusedPokecenterCopy.blk
index 9641efe4..dd54efd9 100644
--- a/maps/UnusedPokecenterCopy.blk
+++ b/maps/UnusedPokecenterCopy.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/VermilionMart.blk b/maps/VermilionMart.blk
index 1da8fffc..62385406 100644
--- a/maps/VermilionMart.blk
+++ b/maps/VermilionMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/VermilionPokecenter.blk b/maps/VermilionPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/VermilionPokecenter.blk
+++ b/maps/VermilionPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/ViridianMart.blk b/maps/ViridianMart.blk
index 1da8fffc..62385406 100644
--- a/maps/ViridianMart.blk
+++ b/maps/ViridianMart.blk
@@ -1 +1 @@
-   \ No newline at end of file
+ %  \ No newline at end of file
diff --git a/maps/ViridianPokecenter.blk b/maps/ViridianPokecenter.blk
index 9641efe4..dd54efd9 100644
--- a/maps/ViridianPokecenter.blk
+++ b/maps/ViridianPokecenter.blk
@@ -1,2 +1,2 @@
-  !"#
+  '"#
 \ No newline at end of file
diff --git a/maps/green/CeruleanCave1F.blk b/maps/green/CeruleanCave1F.blk
deleted file mode 100644
index 689593fd..00000000
--- a/maps/green/CeruleanCave1F.blk
+++ /dev/null
@@ -1,3 +0,0 @@
-|_vvvv|bRvvvvvfm,+vvvvv'fv,+|vvtvf,v=vvv f S
- ^-f+
-$ \ No newline at end of file
diff --git a/maps/green/CeruleanCave2F.blk b/maps/green/CeruleanCave2F.blk
deleted file mode 100644
index c62864da..00000000
--- a/maps/green/CeruleanCave2F.blk
+++ /dev/null
@@ -1 +0,0 @@
- (  ((    (#( \ No newline at end of file
diff --git a/maps/green/CeruleanCaveB1F.blk b/maps/green/CeruleanCaveB1F.blk
deleted file mode 100644
index 8411849f..00000000
--- a/maps/green/CeruleanCaveB1F.blk
+++ /dev/null
@@ -1 +0,0 @@
-n !"n,- " L  "avvv "Q-+tv "vfvvNvvvvvvf--SQvvvvvL  \ No newline at end of file
diff --git a/rgbdscheck.asm b/rgbdscheck.asm
index 25277131..4514bd69 100644
--- a/rgbdscheck.asm
+++ b/rgbdscheck.asm
@@ -3,7 +3,7 @@ MINOR EQU 5
PATCH EQU 1
wrong_rgbds: MACRO
- fail "pokered requires rgbds v0.5.1 or newer."
+ fail "pokeyellow requires rgbds v0.5.1 or newer."
ENDM
IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
diff --git a/roms.sha1 b/roms.sha1
index 44e94aaf..624d47f3 100644
--- a/roms.sha1
+++ b/roms.sha1
@@ -1,3 +1,2 @@
-ea9bcae617fdf159b045185467ae58b2e4a48b9a *pokered.gbc
-d7037c83e1ae5b39bde3c30787637ba1d4c48ce2 *pokeblue.gbc
-5b1456177671b79b263c614ea0e7cc9ac542e9c4 *pokeblue_debug.gbc
+cc7d03262ebfaf2f06772c1a480c7d9d5f4a38e1 *pokeyellow.gbc
+d44e96eddfbdad633cbe4e6e64915e9e198974b0 *pokeyellow_debug.gbc
diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm
index f5f0539e..0c5357d2 100644
--- a/scripts/BikeShop.asm
+++ b/scripts/BikeShop.asm
@@ -1,5 +1,6 @@
BikeShop_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
BikeShop_TextPointers:
dw BikeShopText1
@@ -50,8 +51,7 @@ BikeShopText1:
ld hl, wd730
set 6, [hl]
hlcoord 0, 0
- ld b, 4
- ld c, 15
+ lb bc, 4, 15
call TextBoxBorder
call UpdateSprites
hlcoord 2, 2
@@ -62,11 +62,12 @@ BikeShopText1:
call PlaceString
ld hl, BikeShopText_1d815
call PrintText
+ ; This fixes the bike shop instatext glitch
+ ld hl, wd730
+ res 6, [hl]
call HandleMenuInput
bit BIT_B_BUTTON, a
jr nz, .cancel
- ld hl, wd730
- res 6, [hl]
ld a, [wCurrentMenuItem]
and a
jr nz, .cancel
diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm
index 2085f417..8559c0b1 100644
--- a/scripts/BillsHouse.asm
+++ b/scripts/BillsHouse.asm
@@ -1,8 +1,10 @@
BillsHouse_Script:
+ call BillsHouseScript_1e09e
call EnableAutoTextBoxDrawing
ld a, [wBillsHouseCurScript]
ld hl, BillsHouse_ScriptPointers
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
BillsHouse_ScriptPointers:
dw BillsHouseScript0
@@ -11,21 +13,64 @@ BillsHouse_ScriptPointers:
dw BillsHouseScript3
dw BillsHouseScript4
dw BillsHouseScript5
+ dw BillsHouseScript6
+ dw BillsHouseScript7
+ dw BillsHouseScript8
+ dw BillsHouseScript9
+
+BillsHouseScript_1e09e:
+ ld hl, wd492
+ bit 7, [hl]
+ set 7, [hl]
+ ret nz
+ CheckEventHL EVENT_MET_BILL_2
+ jr z, .asm_1e0af
+ jr .asm_1e0b3
+
+.asm_1e0af
+ ld a, $0
+ jr .asm_1e0b5
+
+.asm_1e0b3
+ ld a, $9
+.asm_1e0b5
+ ld [wBillsHouseCurScript], a
+ ret
BillsHouseScript0:
+ ld a, [wd472]
+ bit 7, a
+ jr z, .asm_1e0d2
+ callfar CheckPikachuFaintedOrStatused
+ jr c, .asm_1e0d2
+ callfar Func_f24d5
+.asm_1e0d2
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wBillsHouseCurScript], a
ret
BillsHouseScript1:
+ ret
+
+BillsHouseScript2:
+ ld a, $ff
+ ld [wJoyIgnore], a
ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
ld de, MovementData_1e79c
jr nz, .notDown
+ call CheckPikachuFollowingPlayer
+ jr nz, .asm_1e0f8
+ callfar Func_f250b
+.asm_1e0f8
ld de, MovementData_1e7a0
.notDown
ld a, $1
ldh [hSpriteIndex], a
call MoveSprite
- ld a, $2
+ ld a, $3
ld [wBillsHouseCurScript], a
ret
@@ -44,25 +89,58 @@ MovementData_1e7a0:
db NPC_MOVEMENT_UP
db -1 ; end
-BillsHouseScript2:
+BillsHouseScript3:
ld a, [wd730]
bit 0, a
ret nz
ld a, HS_BILL_POKEMON
ld [wMissableObjectIndex], a
predef HideObject
- SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR
+ call CheckPikachuFollowingPlayer
+ jr z, .asm_1e13e
+ ld hl, PikachuMovementData_1e14d
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ and a ; cp SPRITE_FACING_DOWN
+ jr nz, .asm_1e133
+ ld hl, PikachuMovementData_1e152
+.asm_1e133
+ call ApplyPikachuMovementData
+ callfar InitializePikachuTextID
+.asm_1e13e
xor a
ld [wJoyIgnore], a
- ld a, $3
+ SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR
+ ld a, $4
ld [wBillsHouseCurScript], a
ret
-BillsHouseScript3:
+PikachuMovementData_1e14d:
+ db $00
+ db $1e
+ db $1e
+ db $1e
+ db $3f
+
+PikachuMovementData_1e152:
+ db $00
+ db $1e
+ db $1f
+ db $1e
+ db $1e
+ db $20
+ db $36
+ db $3f
+
+BillsHouseScript4:
CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL
ret z
- ld a, $f0
+ ld a, $fc
ld [wJoyIgnore], a
+ ld a, $5
+ ld [wBillsHouseCurScript], a
+ ret
+
+BillsHouseScript5:
ld a, $2
ld [wSpriteIndex], a
ld a, $c
@@ -79,11 +157,30 @@ BillsHouseScript3:
predef ShowObject
ld c, 8
call DelayFrames
+ ld hl, wd472
+ bit 7, [hl]
+ jr z, .asm_1e1c6
+ call CheckPikachuFollowingPlayer
+ jr z, .asm_1e1c6
+ ld a, $2
+ ldh [hSpriteIndex], a
+ ld a, SPRITE_FACING_DOWN
+ ldh [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
+ ld hl, PikachuMovementData_1e1a9
+ call ApplyPikachuMovementData
+ ld a, $f
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ callfar InitializePikachuTextID
+.asm_1e1c6
ld a, $2
ldh [hSpriteIndex], a
ld de, MovementData_1e807
call MoveSprite
- ld a, $4
+ ld a, $6
ld [wBillsHouseCurScript], a
ret
@@ -95,26 +192,67 @@ MovementData_1e807:
db NPC_MOVEMENT_DOWN
db -1 ; end
-BillsHouseScript4:
+PikachuMovementData_1e1a9:
+ db $00
+ db $37
+ db $3f
+
+BillsHouseScript6:
ld a, [wd730]
bit 0, a
ret nz
- xor a
- ld [wJoyIgnore], a
SetEvent EVENT_MET_BILL_2 ; this event seems redundant
SetEvent EVENT_MET_BILL
- ld a, $0
+ ld a, $7
ld [wBillsHouseCurScript], a
ret
-BillsHouseScript5:
- ld a, $4
+BillsHouseScript7:
+ xor a
+ ld [wPlayerMovingDirection], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld de, RLE_1e219
+ ld hl, wSimulatedJoypadStatesEnd
+ call DecodeRLEList
+ dec a
+ ld [wSimulatedJoypadStatesIndex], a
+ call StartSimulatingJoypadStates
+ ld a, $8
+ ld [wBillsHouseCurScript], a
+ ret
+
+RLE_1e219:
+ db D_RIGHT, $3
+ db $FF
+
+BillsHouseScript8:
+ ld a, [wSimulatedJoypadStatesIndex]
+ and a
+ ret nz
+ xor a
+ ld [wPlayerMovingDirection], a
+ ld a, SPRITE_FACING_UP
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $2
+ ldh [hSpriteIndex], a
+ ld a, SPRITE_FACING_DOWN
+ ldh [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $2
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $0
+ ld a, $9
ld [wBillsHouseCurScript], a
ret
+BillsHouseScript9:
+ ret
+
BillsHouse_TextPointers:
dw BillsHouseText1
dw BillsHouseText2
@@ -122,93 +260,20 @@ BillsHouse_TextPointers:
dw BillsHouseText4
BillsHouseText4:
- script_bills_pc
+ text_far _BillsHouseDontLeaveText
+ text_end
BillsHouseText1:
text_asm
- ld hl, BillsHouseText_1e865
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .asm_1e85a
-.asm_1e84d
- ld hl, BillsHouseText_1e86a
- call PrintText
- ld a, $1
- ld [wBillsHouseCurScript], a
- jr .asm_1e862
-.asm_1e85a
- ld hl, BillsHouseText_1e86f
- call PrintText
- jr .asm_1e84d
-.asm_1e862
+ farcall Func_f2418
jp TextScriptEnd
-BillsHouseText_1e865:
- text_far _BillsHouseText_1e865
- text_end
-
-BillsHouseText_1e86a:
- text_far _BillsHouseText_1e86a
- text_end
-
-BillsHouseText_1e86f:
- text_far _BillsHouseText_1e86f
- text_end
-
BillsHouseText2:
text_asm
- CheckEvent EVENT_GOT_SS_TICKET
- jr nz, .asm_1e8a9
- ld hl, BillThankYouText
- call PrintText
- lb bc, S_S_TICKET, 1
- call GiveItem
- jr nc, .BagFull
- ld hl, SSTicketReceivedText
- call PrintText
- SetEvent EVENT_GOT_SS_TICKET
- ld a, HS_CERULEAN_GUARD_1
- ld [wMissableObjectIndex], a
- predef ShowObject
- ld a, HS_CERULEAN_GUARD_2
- ld [wMissableObjectIndex], a
- predef HideObject
-.asm_1e8a9
- ld hl, BillsHouseText_1e8cb
- call PrintText
- jr .asm_1e8b7
-.BagFull
- ld hl, SSTicketNoRoomText
- call PrintText
-.asm_1e8b7
+ farcall Func_f244a
jp TextScriptEnd
-BillThankYouText:
- text_far _BillThankYouText
- text_end
-
-SSTicketReceivedText:
- text_far _SSTicketReceivedText
- sound_get_key_item
- text_promptbutton
- text_end
-
-SSTicketNoRoomText:
- text_far _SSTicketNoRoomText
- text_end
-
-BillsHouseText_1e8cb:
- text_far _BillsHouseText_1e8cb
- text_end
-
BillsHouseText3:
text_asm
- ld hl, BillsHouseText_1e8da
- call PrintText
+ farcall Func_f24a2
jp TextScriptEnd
-
-BillsHouseText_1e8da:
- text_far _BillsHouseText_1e8da
- text_end
diff --git a/scripts/BillsHouse2.asm b/scripts/BillsHouse2.asm
new file mode 100644
index 00000000..ca1a56ad
--- /dev/null
+++ b/scripts/BillsHouse2.asm
@@ -0,0 +1,158 @@
+Func_f2418::
+ ld hl, BillsHouseText_f243b
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_f2433
+.asm_f2427
+ ld hl, BillsHouseText_f2440
+ call PrintText
+ ld a, $2
+ ld [wBillsHouseCurScript], a
+ ret
+
+.asm_f2433
+ ld hl, BillsHouseText_f2445
+ call PrintText
+ jr .asm_f2427
+
+BillsHouseText_f243b:
+ text_far _BillsHouseText_1e865
+ text_end
+
+BillsHouseText_f2440:
+ text_far _BillsHouseText_1e86a
+ text_end
+
+BillsHouseText_f2445:
+ text_far _BillsHouseText_1e86f
+ text_end
+
+Func_f244a::
+ CheckEvent EVENT_GOT_SS_TICKET
+ jr nz, .asm_f247e
+ ld hl, BillsHouseText_f248c
+ call PrintText
+ lb bc, S_S_TICKET, 1
+ call GiveItem
+ jr nc, .asm_f2485
+ ld hl, BillsHouseText_f2491
+ call PrintText
+ SetEvent EVENT_GOT_SS_TICKET
+ ld a, HS_CERULEAN_GUARD_1
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ ld a, HS_CERULEAN_GUARD_2
+ ld [wMissableObjectIndex], a
+ predef HideObject
+.asm_f247e
+ ld hl, BillsHouseText_f249d
+ call PrintText
+ ret
+
+.asm_f2485
+ ld hl, BillsHouseText_f2498
+ call PrintText
+ ret
+
+BillsHouseText_f248c:
+ text_far _BillThankYouText
+ text_end
+
+BillsHouseText_f2491:
+ text_far _SSTicketReceivedText
+ sound_get_key_item
+ text_promptbutton
+ text_end
+
+BillsHouseText_f2498:
+ text_far _SSTicketNoRoomText
+ text_end
+
+BillsHouseText_f249d:
+ text_far _BillsHouseText_1e8cb
+ text_end
+
+Func_f24a2::
+ ld hl, BillsHouseText_f24a9
+ call PrintText
+ ret
+
+BillsHouseText_f24a9:
+ text_far _BillsHouseText_1e8da
+ text_end
+
+Func_f24ae::
+ ld a, [wCurMap]
+ cp BILLS_HOUSE
+ jr nz, .asm_f24d2
+ call CheckPikachuFollowingPlayer
+ jr z, .asm_f24d2
+ ld a, [wBillsHouseCurScript]
+ cp $5
+ ld e, $1b
+ ret z
+ cp $0
+ ld e, $17
+ ret z
+ CheckEventHL EVENT_MET_BILL_2
+ ld e, $20
+ ret z
+ ld e, $1f
+ ret
+
+.asm_f24d2
+ ld e, $ff
+ ret
+
+Func_f24d5::
+ ld a, $ff
+ ld [wJoyIgnore], a
+ xor a
+ ld [wPlayerMovingDirection], a
+ call UpdateSprites
+ call UpdateSprites
+ ld hl, Data_f2505
+ call ApplyPikachuMovementData
+ ld a, $f ; pikachu
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, QUESTION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ call DisablePikachuFollowingPlayer
+ callfar InitializePikachuTextID
+ ret
+
+Data_f2505:
+ db $00
+ db $20
+ db $20
+ db $20
+ db $1e
+ db $3f
+
+Func_f250b::
+ ld hl, Data_f251c
+ ld b, SPRITE_FACING_UP
+ call TryApplyPikachuMovementData
+ ld hl, Data_f2521
+ ld b, SPRITE_FACING_RIGHT
+ call TryApplyPikachuMovementData
+ ret
+
+Data_f251c:
+ db $00
+ db $1f
+ db $1d
+ db $38
+ db $3f
+
+Data_f2521:
+ db $00
+ db $1e
+ db $1f
+ db $1f
+ db $1d
+ db $38
+ db $3f
diff --git a/scripts/BluesHouse.asm b/scripts/BluesHouse.asm
index 1ab0fd06..9d9bf33a 100644
--- a/scripts/BluesHouse.asm
+++ b/scripts/BluesHouse.asm
@@ -1,8 +1,9 @@
BluesHouse_Script:
call EnableAutoTextBoxDrawing
ld hl, BluesHouse_ScriptPointers
- ld a, [wBluesHouseCurScript]
- jp CallFunctionInTable
+ xor a
+ call CallFunctionInTable
+ ret
BluesHouse_ScriptPointers:
dw BluesHouseScript0
@@ -12,8 +13,6 @@ BluesHouseScript0:
SetEvent EVENT_ENTERED_BLUES_HOUSE
ld a, $1
ld [wBluesHouseCurScript], a
- ret
-
BluesHouseScript1:
ret
diff --git a/scripts/CeladonCity.asm b/scripts/CeladonCity.asm
index bd0228d8..b6280980 100644
--- a/scripts/CeladonCity.asm
+++ b/scripts/CeladonCity.asm
@@ -1,5 +1,14 @@
CeladonCity_Script:
call EnableAutoTextBoxDrawing
+ ld hl, CeladonCity_ScriptPointers
+ ld a, [wCeladonCityCurScript]
+ call CallFunctionInTable
+ ret
+
+CeladonCity_ScriptPointers:
+ dw CeladonCityScript1
+
+CeladonCityScript1:
ResetEvents EVENT_1B8, EVENT_1BF
ResetEvent EVENT_67F
ret
@@ -100,8 +109,9 @@ CeladonCityText9:
text_end
CeladonCityText10:
- text_far _CeladonCityText10
- text_end
+ text_asm
+ farcall Func_f1ac6
+ jp TextScriptEnd
CeladonCityText11:
text_far _CeladonCityText11
diff --git a/scripts/CeladonCity2.asm b/scripts/CeladonCity2.asm
new file mode 100644
index 00000000..56824c9a
--- /dev/null
+++ b/scripts/CeladonCity2.asm
@@ -0,0 +1,8 @@
+Func_f1ac6::
+ ld hl, Text_f1acd
+ call PrintText
+ ret
+
+Text_f1acd:
+ text_far _CeladonCityText10
+ text_end
diff --git a/scripts/CeladonDiner.asm b/scripts/CeladonDiner.asm
index e95035f0..b4936e75 100644
--- a/scripts/CeladonDiner.asm
+++ b/scripts/CeladonDiner.asm
@@ -27,40 +27,5 @@ CeladonDinerText4:
CeladonDinerText5:
text_asm
- CheckEvent EVENT_GOT_COIN_CASE
- jr nz, .got_item
- ld hl, CeladonDinerText_491a7
- call PrintText
- lb bc, COIN_CASE, 1
- call GiveItem
- jr nc, .bag_full
- SetEvent EVENT_GOT_COIN_CASE
- ld hl, ReceivedCoinCaseText
- call PrintText
- jr .done
-.bag_full
- ld hl, CoinCaseNoRoomText
- call PrintText
- jr .done
-.got_item
- ld hl, CeladonDinerText_491b7
- call PrintText
-.done
+ callfar Func_f1f31
jp TextScriptEnd
-
-CeladonDinerText_491a7:
- text_far _CeladonDinerText_491a7
- text_end
-
-ReceivedCoinCaseText:
- text_far _ReceivedCoinCaseText
- sound_get_key_item
- text_end
-
-CoinCaseNoRoomText:
- text_far _CoinCaseNoRoomText
- text_end
-
-CeladonDinerText_491b7:
- text_far _CeladonDinerText_491b7
- text_end
diff --git a/scripts/CeladonDiner2.asm b/scripts/CeladonDiner2.asm
new file mode 100644
index 00000000..ceef9f52
--- /dev/null
+++ b/scripts/CeladonDiner2.asm
@@ -0,0 +1,38 @@
+Func_f1f31::
+ CheckEvent EVENT_GOT_COIN_CASE
+ jr nz, .got_item
+ ld hl, CeladonDinerText_491a7
+ call PrintText
+ lb bc, COIN_CASE, 1
+ call GiveItem
+ jr nc, .bag_full
+ SetEvent EVENT_GOT_COIN_CASE
+ ld hl, ReceivedCoinCaseText
+ call PrintText
+ jr .done
+.bag_full
+ ld hl, CoinCaseNoRoomText
+ call PrintText
+ jr .done
+.got_item
+ ld hl, CeladonDinerText_491b7
+ call PrintText
+.done
+ ret
+
+CeladonDinerText_491a7:
+ text_far _CeladonDinerText_491a7
+ text_end
+
+ReceivedCoinCaseText:
+ text_far _ReceivedCoinCaseText
+ sound_get_key_item
+ text_end
+
+CoinCaseNoRoomText:
+ text_far _CoinCaseNoRoomText
+ text_end
+
+CeladonDinerText_491b7:
+ text_far _CeladonDinerText_491b7
+ text_end
diff --git a/scripts/CeladonMansion1F.asm b/scripts/CeladonMansion1F.asm
index fa901ff9..61d53da7 100644
--- a/scripts/CeladonMansion1F.asm
+++ b/scripts/CeladonMansion1F.asm
@@ -1,5 +1,6 @@
CeladonMansion1F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMansion1F_TextPointers:
dw CeladonMansion1Text1
@@ -8,31 +9,39 @@ CeladonMansion1F_TextPointers:
dw CeladonMansion1Text4
dw CeladonMansion1Text5
-CeladonMansion1_PlayCryScript:
- call PlayCry
- jp TextScriptEnd
-
CeladonMansion1Text1:
text_far _CeladonMansion1Text1
text_asm
ld a, MEOWTH
- jp CeladonMansion1_PlayCryScript
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text2:
- text_far _CeladonMansion1Text2
- text_end
+ text_asm
+ farcall Func_f1e70
+ ld a, [wPikachuHappiness]
+ cp 251
+ jr c, .asm_485d9
+ ld c, 50
+ call DelayFrames
+ ldpikacry e, PikachuCry23
+ callfar PlayPikachuSoundClip
+.asm_485d9
+ jp TextScriptEnd
CeladonMansion1Text3:
text_far _CeladonMansion1Text3
text_asm
ld a, CLEFAIRY
- jp CeladonMansion1_PlayCryScript
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text4:
text_far _CeladonMansion1Text4
text_asm
ld a, NIDORAN_F
- jp CeladonMansion1_PlayCryScript
+ call PlayCry
+ jp TextScriptEnd
CeladonMansion1Text5:
text_far _CeladonMansion1Text5
diff --git a/scripts/CeladonMansion1F_2.asm b/scripts/CeladonMansion1F_2.asm
new file mode 100644
index 00000000..4cddf268
--- /dev/null
+++ b/scripts/CeladonMansion1F_2.asm
@@ -0,0 +1,78 @@
+Func_f1e70::
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, CeladonMansion1Text_f1e96
+ call PrintText
+ callfar IsStarterPikachuInOurParty
+ ret nc
+ ld hl, CeladonMansionText_f1e9c
+ call PrintText
+ ld a, $0
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call Func_f1ea2
+ call PrintText
+ ret
+
+CeladonMansion1Text_f1e96:
+ text_far _CeladonMansion1Text2
+ text_waitbutton
+ text_end
+
+CeladonMansionText_f1e9c:
+ text_far _CeladonMansion1Text6
+ text_promptbutton
+ text_end
+
+Func_f1ea2:
+ ld hl, PikachuHappinessThresholds_f1eb9
+.asm_f1ea5
+ ld a, [hli]
+ inc hl
+ and a
+ jr z, .asm_f1eb5
+ ld b, a
+ ld a, [wPikachuHappiness]
+ cp b
+ jr c, .asm_f1eb5
+ inc hl
+ inc hl
+ jr .asm_f1ea5
+
+.asm_f1eb5
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ret
+
+PikachuHappinessThresholds_f1eb9:
+ dw 51, CeladonMansion1Text_f1ed5
+ dw 101, CeladonMansion1Text_f1eda
+ dw 131, CeladonMansion1Text_f1edf
+ dw 161, CeladonMansion1Text_f1ee4
+ dw 201, CeladonMansion1Text_f1ee9
+ dw 255, CeladonMansion1Text_f1eee
+ dw -256, CeladonMansion1Text_f1eee
+
+CeladonMansion1Text_f1ed5:
+ text_far _CeladonMansion1Text7
+ text_end
+
+CeladonMansion1Text_f1eda:
+ text_far _CeladonMansion1Text8
+ text_end
+
+CeladonMansion1Text_f1edf:
+ text_far _CeladonMansion1Text9
+ text_end
+
+CeladonMansion1Text_f1ee4:
+ text_far _CeladonMansion1Text10
+ text_end
+
+CeladonMansion1Text_f1ee9:
+ text_far _CeladonMansion1Text11
+ text_end
+
+CeladonMansion1Text_f1eee:
+ text_far _CeladonMansion1Text12
+ text_end
diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm
index f8972793..ae1718a0 100644
--- a/scripts/CeladonMansion3F.asm
+++ b/scripts/CeladonMansion3F.asm
@@ -1,5 +1,13 @@
CeladonMansion3F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
+
+CeladonMansion3_PokedexCount:
+ ld hl, wPokedexOwned
+ ld b, wPokedexOwnedEnd - wPokedexOwned
+ call CountSetBits
+ ld a, [wNumSetBits]
+ ret
CeladonMansion3F_TextPointers:
dw ProgrammerText
@@ -12,29 +20,119 @@ CeladonMansion3F_TextPointers:
dw GameFreakSignText
ProgrammerText:
+ text_asm
+ call CeladonMansion3_PokedexCount
+ cp NUM_POKEMON - 1 ; discount Mew
+ ld hl, CeladonMansion3Text_486f5
+ jr nc, .print
+ ld hl, CeladonMansion3Text_486f0
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_486f0:
text_far _ProgrammerText
text_end
+CeladonMansion3Text_486f5:
+ text_far _ProgrammerText2
+ text_end
+
GraphicArtistText:
+ text_asm
+ call CeladonMansion3_PokedexCount
+ cp NUM_POKEMON - 1 ; discount Mew
+ jr nc, .completed
+ ld hl, CeladonMansion3Text_48757
+ jr .print
+
+.completed
+ ld hl, CeladonMansion3Text_4875c
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .declined_print
+ call SaveScreenTilesToBuffer2
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ld hl, wd730
+ set 6, [hl]
+ callfar PrintDiploma
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, CeladonMansion3Text_4876b
+ ldh a, [hCanceledPrinting]
+ and a
+ jr nz, .print
+ ld hl, CeladonMansion3Text_48766
+ jr .print
+
+.declined_print
+ ld hl, CeladonMansion3Text_48761
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_48757:
text_far _GraphicArtistText
text_end
+CeladonMansion3Text_4875c:
+ text_far _GraphicArtistText2
+ text_end
+
+CeladonMansion3Text_48761:
+ text_far _GraphicArtistText3
+ text_end
+
+CeladonMansion3Text_48766:
+ text_far _GraphicArtistText4
+ text_end
+
+CeladonMansion3Text_4876b:
+ text_far _GraphicArtistText5
+ text_end
+
WriterText:
+ text_asm
+ call CeladonMansion3_PokedexCount
+ cp NUM_POKEMON - 1 ; discount Mew
+ ld hl, CeladonMansion3Text_48789
+ jr nc, .print
+ ld hl, CeladonMansion3Text_48784
+.print
+ call PrintText
+ jp TextScriptEnd
+
+CeladonMansion3Text_48784:
text_far _WriterText
text_end
+CeladonMansion3Text_48789:
+ text_far _WriterText2
+ text_end
+
DirectorText:
text_asm
- ld hl, wPokedexOwned
- ld b, wPokedexOwnedEnd - wPokedexOwned
- call CountSetBits
- ld a, [wNumSetBits]
+ call CeladonMansion3_PokedexCount
cp NUM_POKEMON - 1 ; discount Mew
jr nc, .completed_dex
ld hl, .GameDesignerText
jr .done
.completed_dex
ld hl, .CompletedDexText
+ call PrintText
+ call Delay3
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .UnlockedDiplomaPrinting
.done
call PrintText
jp TextScriptEnd
@@ -52,18 +150,26 @@ DirectorText:
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
jp TextScriptEnd
-GameFreakPCText1:
- text_far _CeladonMansion3Text5
+.UnlockedDiplomaPrinting
+ text_far _CompletedDexText2
text_end
+GameFreakPCText1:
+ text_asm
+ farcall Func_f1ef3
+ jp TextScriptEnd
+
GameFreakPCText2:
- text_far _CeladonMansion3Text6
- text_end
+ text_asm
+ farcall Func_f1eff
+ jp TextScriptEnd
GameFreakPCText3:
- text_far _CeladonMansion3Text7
- text_end
+ text_asm
+ farcall Func_f1f0b
+ jp TextScriptEnd
GameFreakSignText:
- text_far _CeladonMansion3Text8
- text_end
+ text_asm
+ farcall Func_f1f17
+ jp TextScriptEnd
diff --git a/scripts/CeladonMansion3F_2.asm b/scripts/CeladonMansion3F_2.asm
new file mode 100644
index 00000000..f0b7c395
--- /dev/null
+++ b/scripts/CeladonMansion3F_2.asm
@@ -0,0 +1,35 @@
+Func_f1ef3::
+ ld hl, CeladonMansion3Text_f1efa
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1efa:
+ text_far _CeladonMansion3Text5
+ text_end
+
+Func_f1eff::
+ ld hl, CeladonMansion3Text_f1f06
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f06:
+ text_far _CeladonMansion3Text6
+ text_end
+
+Func_f1f0b::
+ ld hl, CeladonMansion3Text_f1f12
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f12:
+ text_far _CeladonMansion3Text7
+ text_end
+
+Func_f1f17::
+ ld hl, CeladonMansion3Text_f1f1e
+ call PrintText
+ ret
+
+CeladonMansion3Text_f1f1e:
+ text_far _CeladonMansion3Text8
+ text_end
diff --git a/scripts/CeladonMansionRoof.asm b/scripts/CeladonMansionRoof.asm
index 860fcbdf..47c093dd 100644
--- a/scripts/CeladonMansionRoof.asm
+++ b/scripts/CeladonMansionRoof.asm
@@ -1,5 +1,6 @@
CeladonMansionRoof_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMansionRoof_TextPointers:
dw CeladonMansion4Text1
diff --git a/scripts/CeladonMansionRoofHouse.asm b/scripts/CeladonMansionRoofHouse.asm
index bd564dcc..3b7e3914 100644
--- a/scripts/CeladonMansionRoofHouse.asm
+++ b/scripts/CeladonMansionRoofHouse.asm
@@ -1,5 +1,6 @@
CeladonMansionRoofHouse_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMansionRoofHouse_TextPointers:
dw CeladonMansion5Text1
diff --git a/scripts/CeladonMart1F.asm b/scripts/CeladonMart1F.asm
index dca3c796..54176e01 100644
--- a/scripts/CeladonMart1F.asm
+++ b/scripts/CeladonMart1F.asm
@@ -1,5 +1,6 @@
CeladonMart1F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMart1F_TextPointers:
dw CeladonMart1Text1
diff --git a/scripts/CeladonMart3F.asm b/scripts/CeladonMart3F.asm
index 55081982..01ab73ce 100644
--- a/scripts/CeladonMart3F.asm
+++ b/scripts/CeladonMart3F.asm
@@ -22,42 +22,9 @@ CeladonMart3F_TextPointers:
CeladonMart3Text1:
text_asm
- CheckEvent EVENT_GOT_TM18
- jr nz, .got_item
- ld hl, TM18PreReceiveText
- call PrintText
- lb bc, TM_COUNTER, 1
- call GiveItem
- jr nc, .bag_full
- SetEvent EVENT_GOT_TM18
- ld hl, ReceivedTM18Text
- jr .done
-.bag_full
- ld hl, TM18NoRoomText
- jr .done
-.got_item
- ld hl, TM18ExplanationText
-.done
- call PrintText
+ callfar Func_f1e30
jp TextScriptEnd
-TM18PreReceiveText:
- text_far _TM18PreReceiveText
- text_end
-
-ReceivedTM18Text:
- text_far _ReceivedTM18Text
- sound_get_item_1
- text_end
-
-TM18ExplanationText:
- text_far _TM18ExplanationText
- text_end
-
-TM18NoRoomText:
- text_far _TM18NoRoomText
- text_end
-
CeladonMart3Text2:
text_far _CeladonMart3Text2
text_end
diff --git a/scripts/CeladonMart3F_2.asm b/scripts/CeladonMart3F_2.asm
new file mode 100644
index 00000000..239f84d1
--- /dev/null
+++ b/scripts/CeladonMart3F_2.asm
@@ -0,0 +1,36 @@
+Func_f1e30::
+ CheckEvent EVENT_GOT_TM18
+ jr nz, .got_item
+ ld hl, TM18PreReceiveText
+ call PrintText
+ lb bc, TM_COUNTER, 1
+ call GiveItem
+ jr nc, .bag_full
+ SetEvent EVENT_GOT_TM18
+ ld hl, ReceivedTM18Text
+ jr .done
+.bag_full
+ ld hl, TM18NoRoomText
+ jr .done
+.got_item
+ ld hl, TM18ExplanationText
+.done
+ call PrintText
+ ret
+
+TM18PreReceiveText:
+ text_far _TM18PreReceiveText
+ text_end
+
+ReceivedTM18Text:
+ text_far _ReceivedTM18Text
+ sound_get_item_1
+ text_end
+
+TM18ExplanationText:
+ text_far _TM18ExplanationText
+ text_end
+
+TM18NoRoomText:
+ text_far _TM18NoRoomText
+ text_end
diff --git a/scripts/CeladonMart5F.asm b/scripts/CeladonMart5F.asm
index 91748706..a6e97405 100644
--- a/scripts/CeladonMart5F.asm
+++ b/scripts/CeladonMart5F.asm
@@ -1,5 +1,6 @@
CeladonMart5F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMart5F_TextPointers:
dw CeladonMart5Text1
diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm
index 37b8671e..473f5f09 100644
--- a/scripts/CeladonMartRoof.asm
+++ b/scripts/CeladonMartRoof.asm
@@ -1,5 +1,6 @@
CeladonMartRoof_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
CeladonMartRoofScript_GetDrinksInBag:
; construct a list of all drinks in the player's bag
@@ -125,13 +126,16 @@ CeladonMartRoofScript_GiveDrinkToGirl:
ret
.bagFull
ld hl, CeladonMartRoofText_48526
- jp PrintText
+ call PrintText
+ ret
.alreadyGaveDrink
ld hl, CeladonMartRoofText_4852c
- jp PrintText
+ call PrintText
+ ret
RemoveItemByIDBank12:
- farjp RemoveItemByID
+ farcall RemoveItemByID
+ ret
CeladonMartRoofText_484ee:
text_far _CeladonMartRoofText_484ee
diff --git a/scripts/CeladonPokecenter.asm b/scripts/CeladonPokecenter.asm
index 0f28e1b2..febc21f8 100644
--- a/scripts/CeladonPokecenter.asm
+++ b/scripts/CeladonPokecenter.asm
@@ -7,6 +7,7 @@ CeladonPokecenter_TextPointers:
dw CeladonPokecenterText2
dw CeladonPokecenterText3
dw CeladonTradeNurseText
+ dw CeladonPokecenterText5
CeladonTradeNurseText:
script_cable_club_receptionist
@@ -21,3 +22,8 @@ CeladonPokecenterText2:
CeladonPokecenterText3:
text_far _CeladonPokecenterText3
text_end
+
+CeladonPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/CeruleanCave1F.asm b/scripts/CeruleanCave1F.asm
index 6f5c7b13..e2803587 100644
--- a/scripts/CeruleanCave1F.asm
+++ b/scripts/CeruleanCave1F.asm
@@ -5,3 +5,4 @@ CeruleanCave1F_TextPointers:
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
+ dw PickUpItemText
diff --git a/scripts/CeruleanCave2F.asm b/scripts/CeruleanCave2F.asm
index 1bc8457b..e6a70082 100644
--- a/scripts/CeruleanCave2F.asm
+++ b/scripts/CeruleanCave2F.asm
@@ -5,3 +5,4 @@ CeruleanCave2F_TextPointers:
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
+ dw PickUpItemText
diff --git a/scripts/CeruleanCaveB1F.asm b/scripts/CeruleanCaveB1F.asm
index 0c0ce766..03d6f38c 100644
--- a/scripts/CeruleanCaveB1F.asm
+++ b/scripts/CeruleanCaveB1F.asm
@@ -16,6 +16,8 @@ CeruleanCaveB1F_TextPointers:
dw MewtwoText
dw PickUpItemText
dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
CeruleanCaveB1FTrainerHeaders:
def_trainers
diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm
index ae4350cd..a9f62baa 100644
--- a/scripts/CeruleanCity.asm
+++ b/scripts/CeruleanCity.asm
@@ -68,9 +68,7 @@ ENDC
ld a, [wWalkBikeSurfState]
and a
jr z, .walking
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.walking
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
@@ -140,23 +138,8 @@ CeruleanCityScript1:
call SaveEndBattleTextPointers
ld a, OPP_RIVAL1
ld [wCurOpponent], a
-
- ; select which team to use during the encounter
- ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .NotSquirtle
- ld a, $7
- jr .done
-.NotSquirtle
- cp STARTER3
- jr nz, .Charmander
- ld a, $8
- jr .done
-.Charmander
- ld a, $9
-.done
+ ld a, 3
ld [wTrainerNo], a
-
xor a
ldh [hJoyHeld], a
call CeruleanCityScript_1955d
@@ -175,9 +158,7 @@ CeruleanCityScript2:
ld a, $1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld a, $1
ldh [hSpriteIndex], a
diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm
index 798716e3..388e128a 100644
--- a/scripts/CeruleanGym.asm
+++ b/scripts/CeruleanGym.asm
@@ -145,8 +145,6 @@ TM11NoRoomText:
ReceivedCascadeBadgeText:
text_far _ReceivedCascadeBadgeText
- sound_get_key_item ; actually plays the second channel of SFX_BALL_POOF due to the wrong music bank being loaded
- text_promptbutton
text_end
CeruleanGymTrainerText1:
diff --git a/scripts/CeruleanMelaniesHouse.asm b/scripts/CeruleanMelaniesHouse.asm
new file mode 100644
index 00000000..ca006506
--- /dev/null
+++ b/scripts/CeruleanMelaniesHouse.asm
@@ -0,0 +1,106 @@
+CeruleanMelaniesHouse_Script:
+ call EnableAutoTextBoxDrawing
+ ret
+
+CeruleanMelaniesHouse_TextPointers:
+ dw CeruleanHouse1Text1
+ dw CeruleanHouse1Text2
+ dw CeruleanHouse1Text3
+ dw CeruleanHouse1Text4
+
+CeruleanHouse1Text1:
+ text_asm
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ CheckEvent EVENT_GOT_BULBASAUR_IN_CERULEAN
+ jr nz, .asm_1cfbf
+ ld hl, CeruleanHouse1Text_1cfc8
+ call PrintText
+ ld a, [wPikachuHappiness]
+ cp 147
+ jr c, .asm_1cfb3
+ ld hl, CeruleanHouse1Text_1cfce
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_1cfb6
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, BULBASAUR
+ ld [wd11e], a
+ ld [wcf91], a
+ call GetMonName
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ lb bc, BULBASAUR, 10
+ call GivePokemon
+ jr nc, .asm_1cfb3
+ ld a, [wAddedToParty]
+ and a
+ call z, WaitForTextScrollButtonPress
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, CeruleanHouse1Text_1cfd3
+ call PrintText
+ ld a, HS_CERULEAN_BULBASAUR
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ SetEvent EVENT_GOT_BULBASAUR_IN_CERULEAN
+.asm_1cfb3
+ jp TextScriptEnd
+
+.asm_1cfb6
+ ld hl, CeruleanHouse1Text_1cfdf
+ call PrintText
+ jp TextScriptEnd
+
+.asm_1cfbf
+ ld hl, CeruleanHouse1Text_1cfd9
+ call PrintText
+ jp TextScriptEnd
+
+CeruleanHouse1Text_1cfc8:
+ text_far MelanieText1
+ text_waitbutton
+ text_end
+
+CeruleanHouse1Text_1cfce:
+ text_far MelanieText2
+ text_end
+
+CeruleanHouse1Text_1cfd3:
+ text_far MelanieText3
+ text_waitbutton
+ text_end
+
+CeruleanHouse1Text_1cfd9:
+ text_far MelanieText4
+ text_waitbutton
+ text_end
+
+CeruleanHouse1Text_1cfdf:
+ text_far MelanieText5
+ text_waitbutton
+ text_end
+
+CeruleanHouse1Text2:
+ text_far MelanieBulbasaurText
+ text_asm
+ ld a, BULBASAUR
+ call PlayCry
+ jp TextScriptEnd
+
+CeruleanHouse1Text3:
+ text_far MelanieOddishText
+ text_asm
+ ld a, ODDISH
+ call PlayCry
+ jp TextScriptEnd
+
+CeruleanHouse1Text4:
+ text_far MelanieSandshrewText
+ text_asm
+ ld a, SANDSHREW
+ call PlayCry
+ jp TextScriptEnd
diff --git a/scripts/CeruleanPokecenter.asm b/scripts/CeruleanPokecenter.asm
index 680640f4..3aa465ca 100644
--- a/scripts/CeruleanPokecenter.asm
+++ b/scripts/CeruleanPokecenter.asm
@@ -7,6 +7,7 @@ CeruleanPokecenter_TextPointers:
dw CeruleanPokecenterText2
dw CeruleanPokecenterText3
dw CeruleanTradeNurseText
+ dw CeruleanPokecenterText5
CeruleanTradeNurseText:
script_cable_club_receptionist
@@ -21,3 +22,8 @@ CeruleanPokecenterText2:
CeruleanPokecenterText3:
text_far _CeruleanPokecenterText3
text_end
+
+CeruleanPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/CeruleanTradeHouse.asm b/scripts/CeruleanTradeHouse.asm
deleted file mode 100644
index 66952cd4..00000000
--- a/scripts/CeruleanTradeHouse.asm
+++ /dev/null
@@ -1,17 +0,0 @@
-CeruleanTradeHouse_Script:
- jp EnableAutoTextBoxDrawing
-
-CeruleanTradeHouse_TextPointers:
- dw CeruleanHouse1Text1
- dw CeruleanHouse1Text2
-
-CeruleanHouse1Text1:
- text_far _CeruleanHouse1Text1
- text_end
-
-CeruleanHouse1Text2:
- text_asm
- ld a, TRADE_FOR_LOLA
- ld [wWhichTrade], a
- predef DoInGameTradeDialogue
- jp TextScriptEnd
diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm
index 11f99ee1..d500e1d2 100644
--- a/scripts/ChampionsRoom.asm
+++ b/scripts/ChampionsRoom.asm
@@ -2,7 +2,8 @@ ChampionsRoom_Script:
call EnableAutoTextBoxDrawing
ld hl, ChampionsRoom_ScriptPointers
ld a, [wChampionsRoomCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
ResetGaryScript:
xor a
@@ -69,18 +70,7 @@ GaryScript2:
; select which team to use during the encounter
ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .NotStarter2
- ld a, $1
- jr .saveTrainerId
-.NotStarter2
- cp STARTER3
- jr nz, .NotStarter3
- ld a, $2
- jr .saveTrainerId
-.NotStarter3
- ld a, $3
-.saveTrainerId
+ add $0 ; Wow GameFreak
ld [wTrainerNo], a
xor a
diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm
index 370a875f..63da9a86 100644
--- a/scripts/CinnabarGym.asm
+++ b/scripts/CinnabarGym.asm
@@ -42,6 +42,9 @@ CinnabarGymSetTrainerHeader:
ld [wTrainerHeaderFlagBit], a
ret
+CinnabarGymFlagAction:
+ predef_jump FlagActionPredef
+
CinnabarGym_ScriptPointers:
dw CinnabarGymScript0
dw CinnabarGymScript1
@@ -57,12 +60,18 @@ CinnabarGymScript0:
jr nz, .asm_757c3
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
+ ld hl, PikachuMovementData_74f97
+ ld b, SPRITE_FACING_DOWN
+ call CinnabarGymScript_74fa3
ld de, MovementNpcToLeftAndUp
jr .MoveSprite
.asm_757c3
- ld de, MovementNpcToLeft
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
+ ld hl, PikachuMovementData_74f9e
+ ld b, SPRITE_FACING_RIGHT
+ call CinnabarGymScript_74fa3
+ ld de, MovementNpcToLeft
.MoveSprite
call MoveSprite
ld a, $1
@@ -75,10 +84,39 @@ MovementNpcToLeftAndUp:
db NPC_MOVEMENT_UP
db -1 ; end
+PikachuMovementData_74f97:
+ db $00
+ db $20
+ db $1e
+ db $35
+ db $3f
+
MovementNpcToLeft:
db NPC_MOVEMENT_LEFT
db -1 ; end
+PikachuMovementData_74f9e:
+ db $00
+ db $1d
+ db $1f
+ db $38
+ db $3f
+
+CinnabarGymScript_74fa3:
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ push hl
+ push bc
+ callfar GetPikachuFacingDirectionAndReturnToE
+ pop bc
+ pop hl
+ ld a, b
+ cp e
+ ret nz
+ call ApplyPikachuMovementData
+ ret
+
CinnabarGymScript1:
ld a, [wd730]
bit 0, a
@@ -90,52 +128,74 @@ CinnabarGymScript1:
ldh [hSpriteIndexOrTextID], a
jp DisplayTextID
-CinnabarGymFlagAction:
- predef_jump FlagActionPredef
-
CinnabarGymScript2:
+ call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymResetScripts
ld a, [wTrainerHeaderFlagBit]
- ldh [hGymGateIndex], a
- AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
+ sub $2
ld c, a
ld b, FLAG_TEST
- EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
+ EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
call CinnabarGymFlagAction
ld a, c
and a
- jr nz, .asm_7581b
+ jr nz, .asm_7500d
+ ld a, [wTrainerHeaderFlagBit]
+ cp 2
+ jr z, .asm_7500d
+ ld c, 30
+ call DelayFrames
+ call CinnabarGymScript_75023
+ call CinnabarGymScript_75041
call WaitForSoundToFinish
ld a, SFX_GO_INSIDE
call PlaySound
call WaitForSoundToFinish
-.asm_7581b
+ jr .asm_75013
+.asm_7500d
+ call CinnabarGymScript_75023
+ call CinnabarGymScript_75041
+.asm_75013
+ xor a
+ ld [wJoyIgnore], a
+ ld [wOpponentAfterWrongAnswer], a
+ ld a, $0
+ ld [wCinnabarGymCurScript], a
+ ld [wCurMapScript], a
+ ret
+
+CinnabarGymScript_75023:
ld a, [wTrainerHeaderFlagBit]
ldh [hGymGateIndex], a
- AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
ld c, a
ld b, FLAG_SET
EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
call CinnabarGymFlagAction
+ ret
+
+CinnabarGymScript_75032:
ld a, [wTrainerHeaderFlagBit]
- sub $2
- AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
+ ldh [hGymGateIndex], a
+ ld c, a
+ ld b, FLAG_TEST
+ EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
+ call CinnabarGymFlagAction
+ ret
+
+CinnabarGymScript_75041:
+ ld a, [wTrainerHeaderFlagBit]
+ sub 2
ld c, a
ld b, FLAG_SET
EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
call CinnabarGymFlagAction
call UpdateCinnabarGymGateTileBlocks
- xor a
- ld [wJoyIgnore], a
- ld [wOpponentAfterWrongAnswer], a
- ld a, $0
- ld [wCinnabarGymCurScript], a
- ld [wCurMapScript], a
ret
CinnabarGymBlainePostBattle:
+ call CinnabarGymScript_753e9
ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymResetScripts
@@ -187,7 +247,7 @@ CinnabarGym_TextPointers:
dw ReceivedTM38Text
dw TM38NoRoomText
-CinnabarGymScript_758b7:
+CinnabarGymScript_750c3:
ldh a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
@@ -228,7 +288,7 @@ BlaineText:
call SaveEndBattleTextPointers
ld a, $7
ld [wGymLeaderNo], a
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
BlainePreBattleText:
text_far _BlainePreBattleText
@@ -268,7 +328,7 @@ CinnabarGymTrainerText1:
ld hl, CinnabarGymEndBattleText2
ld de, CinnabarGymEndBattleText2
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.asm_46bb4
ld hl, CinnabarGymAfterBattleText2
call PrintText
@@ -290,14 +350,23 @@ CinnabarGymTrainerText2:
text_asm
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1
- jr nz, .asm_4b406
+ jr nz, .asm_751a8
+ call CinnabarGymScript_753f3
+ jr nz, .asm_75196
+ CheckEvent EVENT_CINNABAR_GYM_GATE1_UNLOCKED
+ jr nz, .asm_75196
+ ld e, $00
+ jp CinnabarGymScript_753de
+
+.asm_75196
ld hl, CinnabarGymBattleText1
call PrintText
ld hl, CinnabarGymEndBattleText1
ld de, CinnabarGymEndBattleText1
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
-.asm_4b406
+ jp CinnabarGymScript_750c3
+
+.asm_751a8
ld hl, CinnabarGymAfterBattleText1
call PrintText
jp TextScriptEnd
@@ -319,12 +388,20 @@ CinnabarGymTrainerText3:
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2
jr nz, .afterBeat
+ call CinnabarGymScript_753f3
+ jr nz, .asm_751dc
+ CheckEvent EVENT_CINNABAR_GYM_GATE2_UNLOCKED
+ jr nz, .asm_751dc
+ ld e, $1
+ jp CinnabarGymScript_753de
+
+.asm_751dc
ld hl, CinnabarGymBattleText3
call PrintText
ld hl, CinnabarGymEndBattleText3
ld de, CinnabarGymEndBattleText3
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.afterBeat
ld hl, CinnabarGymAfterBattleText3
call PrintText
@@ -347,12 +424,20 @@ CinnabarGymTrainerText4:
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3
jr nz, .afterBeat
+ call CinnabarGymScript_753f3
+ jr nz, .asm_75222
+ CheckEvent EVENT_CINNABAR_GYM_GATE3_UNLOCKED
+ jr nz, .asm_75222
+ ld e, $2
+ jp CinnabarGymScript_753de
+
+.asm_75222
ld hl, CinnabarGymBattleText4
call PrintText
ld hl, CinnabarGymEndBattleText4
ld de, CinnabarGymEndBattleText4
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.afterBeat
ld hl, CinnabarGymAfterBattleText4
call PrintText
@@ -375,12 +460,20 @@ CinnabarGymTrainerText5:
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4
jr nz, .afterBeat
+ call CinnabarGymScript_753f3
+ jr nz, .asm_75222
+ CheckEvent EVENT_CINNABAR_GYM_GATE4_UNLOCKED
+ jr nz, .asm_75222
+ ld e, $3
+ jp CinnabarGymScript_753de
+
+.asm_75222
ld hl, CinnabarGymBattleText5
call PrintText
ld hl, CinnabarGymEndBattleText5
ld de, CinnabarGymEndBattleText5
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.afterBeat
ld hl, CinnabarGymAfterBattleText5
call PrintText
@@ -403,12 +496,20 @@ CinnabarGymTrainerText6:
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5
jr nz, .afterBeat
+ call CinnabarGymScript_753f3
+ jr nz, .asm_75222
+ CheckEvent EVENT_CINNABAR_GYM_GATE5_UNLOCKED
+ jr nz, .asm_75222
+ ld e, $4
+ jp CinnabarGymScript_753de
+
+.asm_75222
ld hl, CinnabarGymBattleText6
call PrintText
ld hl, CinnabarGymEndBattleText6
ld de, CinnabarGymEndBattleText6
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.afterBeat
ld hl, CinnabarGymAfterBattleText6
call PrintText
@@ -431,12 +532,20 @@ CinnabarGymTrainerText7:
call CinnabarGymSetTrainerHeader
CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6
jr nz, .afterBeat
+ call CinnabarGymScript_753f3
+ jr nz, .asm_75222
+ CheckEvent EVENT_CINNABAR_GYM_GATE6_UNLOCKED
+ jr nz, .asm_75222
+ ld e, $5
+ jp CinnabarGymScript_753de
+
+.asm_75222
ld hl, CinnabarGymBattleText7
call PrintText
ld hl, CinnabarGymEndBattleText7
ld de, CinnabarGymEndBattleText7
call SaveEndBattleTextPointers
- jp CinnabarGymScript_758b7
+ jp CinnabarGymScript_750c3
.afterBeat
ld hl, CinnabarGymAfterBattleText7
call PrintText
@@ -456,20 +565,5 @@ CinnabarGymAfterBattleText7:
CinnabarGymGuideText:
text_asm
- CheckEvent EVENT_BEAT_BLAINE
- jr nz, .afterBeat
- ld hl, CinnabarGymGuidePreBattleText
- jr .done
-.afterBeat
- ld hl, CinnabarGymGuidePostBattleText
-.done
- call PrintText
+ callfar Func_f2133
jp TextScriptEnd
-
-CinnabarGymGuidePreBattleText:
- text_far _CinnabarGymGuidePreBattleText
- text_end
-
-CinnabarGymGuidePostBattleText:
- text_far _CinnabarGymGuidePostBattleText
- text_end
diff --git a/scripts/CinnabarGym3.asm b/scripts/CinnabarGym3.asm
new file mode 100644
index 00000000..dae792df
--- /dev/null
+++ b/scripts/CinnabarGym3.asm
@@ -0,0 +1,64 @@
+Func_f2133::
+ CheckEvent EVENT_BEAT_BLAINE
+ jr nz, .afterBeat
+ ld hl, CinnabarGymGuidePreBattleText
+ jr .done
+.afterBeat
+ ld hl, CinnabarGymGuidePostBattleText
+.done
+ call PrintText
+ ret
+
+CinnabarGymGuidePreBattleText:
+ text_far _CinnabarGymGuidePreBattleText
+ text_end
+
+CinnabarGymGuidePostBattleText:
+ text_far _CinnabarGymGuidePostBattleText
+ text_end
+
+Func_f2150::
+ ld hl, TextPointers_f215d
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp PrintText
+
+TextPointers_f215d:
+ dw CinnabarGymText_f2169
+ dw CinnabarGymText_f216e
+ dw CinnabarGymText_f2173
+ dw CinnabarGymText_f2178
+ dw CinnabarGymText_f217d
+ dw CinnabarGymText_f2182
+
+CinnabarGymText_f2169:
+ text_far _CinnabarGymText_1
+ text_end
+
+CinnabarGymText_f216e:
+ text_far _CinnabarGymText_2
+ text_end
+
+CinnabarGymText_f2173:
+ text_far _CinnabarGymText_3
+ text_end
+
+CinnabarGymText_f2178:
+ text_far _CinnabarGymText_4
+ text_end
+
+CinnabarGymText_f217d:
+ text_far _CinnabarGymText_5
+ text_end
+
+CinnabarGymText_f2182:
+ text_far _CinnabarGymText_6
+ text_end
+
+CinnabarGymText_f2187:
+ text_far _CinnabarGymText_7 ; unused
+ text_end
diff --git a/scripts/CinnabarGym_2.asm b/scripts/CinnabarGym_2.asm
new file mode 100644
index 00000000..4c296cf7
--- /dev/null
+++ b/scripts/CinnabarGym_2.asm
@@ -0,0 +1,18 @@
+CinnabarGymScript_753de:
+ callfar Func_f2150
+ jp TextScriptEnd
+
+CinnabarGymScript_753e9:
+ push hl
+ ld hl, wd475
+ bit 7, [hl]
+ res 7, [hl]
+ pop hl
+ ret
+
+CinnabarGymScript_753f3:
+ push hl
+ ld hl, wd475
+ bit 7, [hl]
+ pop hl
+ ret
diff --git a/scripts/CinnabarPokecenter.asm b/scripts/CinnabarPokecenter.asm
index 9396f851..3a229ca3 100644
--- a/scripts/CinnabarPokecenter.asm
+++ b/scripts/CinnabarPokecenter.asm
@@ -7,6 +7,7 @@ CinnabarPokecenter_TextPointers:
dw CinnabarPokecenterText2
dw CinnabarPokecenterText3
dw CinnabarTradeNurseText
+ dw CinnabarPokecenterText5
CinnabarHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ CinnabarPokecenterText3:
CinnabarTradeNurseText:
script_cable_club_receptionist
+
+CinnabarPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/Daycare.asm b/scripts/Daycare.asm
index 481d7e14..164664b4 100644
--- a/scripts/Daycare.asm
+++ b/scripts/Daycare.asm
@@ -50,11 +50,21 @@ DayCareMText1:
ld a, PARTY_TO_DAYCARE
ld [wMoveMonType], a
call MoveMon
+ callfar IsThisPartymonStarterPikachu
+ push af
xor a
ld [wRemoveMonFromBox], a
call RemovePokemon
+ pop af
+ jr c, .depositedPikachuIntoDayCare
ld a, [wcf91]
call PlayCry
+ jr .asm_562e3
+
+.depositedPikachuIntoDayCare
+ ldpikacry e, PikachuCry28
+ callfar PlayPikachuSoundClip
+.asm_562e3
ld hl, DayCareComeSeeMeInAWhileText
jp .done
@@ -197,8 +207,27 @@ DayCareMText1:
ld a, [hl]
ld [de], a
+ ld a, [wPartyCount]
+ dec a
+ ld [wWhichPokemon], a
+ callfar IsThisPartymonStarterPikachu
+ jr c, .withdrewPikachuFromDayCare
ld a, [wcf91]
call PlayCry
+ jr .asm_56430
+
+.withdrewPikachuFromDayCare
+ ld a, $6
+ ld [wPikachuSpawnState], a
+
+ ; GameFreak... TriHard
+ ld hl, SchedulePikachuSpawnForAfterText
+ ld b, BANK(SchedulePikachuSpawnForAfterText)
+ ld hl, Bankswitch
+
+ ldpikacry e, PikachuCry35
+ callfar PlayPikachuSoundClip
+.asm_56430
ld hl, DayCareGotMonBackText
jr .done
diff --git a/scripts/FuchsiaMart.asm b/scripts/FuchsiaMart.asm
index e6d64c53..75e9a45d 100644
--- a/scripts/FuchsiaMart.asm
+++ b/scripts/FuchsiaMart.asm
@@ -1,5 +1,6 @@
FuchsiaMart_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
FuchsiaMart_TextPointers:
dw FuchsiaCashierText
diff --git a/scripts/FuchsiaPokecenter.asm b/scripts/FuchsiaPokecenter.asm
index 788ee24b..2d98ca17 100644
--- a/scripts/FuchsiaPokecenter.asm
+++ b/scripts/FuchsiaPokecenter.asm
@@ -7,6 +7,7 @@ FuchsiaPokecenter_TextPointers:
dw FuchsiaPokecenterText2
dw FuchsiaPokecenterText3
dw FuchsiaTradeNurseText
+ dw FuchsiaPokecenterText5
FuchsiaHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ FuchsiaPokecenterText3:
FuchsiaTradeNurseText:
script_cable_club_receptionist
+
+FuchsiaPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm
index 04c8504e..b2d4d96a 100644
--- a/scripts/GameCorner.asm
+++ b/scripts/GameCorner.asm
@@ -71,8 +71,12 @@ CeladonGameCornerScript1:
.asm_48c43
ld a, [wXCoord]
cp 8
- jr nz, .asm_48c4d
+ jr nz, .pikachu
ld de, MovementData_48c63
+ jr .asm_48c4d
+.pikachu
+ callfar Func_f1f23
+ ld de, MovementData_48c5a
.asm_48c4d
ld a, $b
ldh [hSpriteIndex], a
@@ -85,8 +89,8 @@ MovementData_48c5a:
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_UP
db NPC_MOVEMENT_RIGHT
+ db NPC_MOVEMENT_UP
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
@@ -475,13 +479,11 @@ CeladonGameCornerScript_48f1e:
ld hl, wd730
set 6, [hl]
hlcoord 11, 0
- ld b, 5
- ld c, 7
+ lb bc, 5, 7
call TextBoxBorder
call UpdateSprites
hlcoord 12, 1
- ld b, 4
- ld c, 7
+ lb bc, 4, 7
call ClearScreenArea
hlcoord 12, 2
ld de, GameCornerMoneyText
diff --git a/scripts/GameCorner2.asm b/scripts/GameCorner2.asm
new file mode 100644
index 00000000..3571e9d9
--- /dev/null
+++ b/scripts/GameCorner2.asm
@@ -0,0 +1,12 @@
+Func_f1f23::
+ ld hl, PikachuMovementData_f1f2c
+ ld b, SPRITE_FACING_DOWN
+ call TryApplyPikachuMovementData
+ ret
+
+PikachuMovementData_f1f2c:
+ db $00
+ db $20
+ db $1e
+ db $35
+ db $3f
diff --git a/scripts/IndigoPlateauLobby.asm b/scripts/IndigoPlateauLobby.asm
index a9b549e3..0a532d9a 100644
--- a/scripts/IndigoPlateauLobby.asm
+++ b/scripts/IndigoPlateauLobby.asm
@@ -20,6 +20,7 @@ IndigoPlateauLobby_TextPointers:
dw IndigoPlateauLobbyText3
dw IndigoCashierText
dw IndigoTradeNurseText
+ dw IndigoPlateauLobbyText6
IndigoHealNurseText:
script_pokecenter_nurse
@@ -34,3 +35,8 @@ IndigoPlateauLobbyText3:
IndigoTradeNurseText:
script_cable_club_receptionist
+
+IndigoPlateauLobbyText6:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm
index 9c316416..8a3dc31d 100644
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -108,7 +108,7 @@ WalkToLance:
ret
WalkToLance_RLEList:
- db D_UP, 12
+ db D_UP, 13
db D_LEFT, 12
db D_DOWN, 7
db D_LEFT, 6
diff --git a/scripts/LavenderPokecenter.asm b/scripts/LavenderPokecenter.asm
index b8a1d2a5..a15bfcfa 100644
--- a/scripts/LavenderPokecenter.asm
+++ b/scripts/LavenderPokecenter.asm
@@ -7,6 +7,7 @@ LavenderPokecenter_TextPointers:
dw LavenderPokecenterText2
dw LavenderPokecenterText3
dw LavenderTradeNurseText
+ dw LavenderPokecenterText5
LavenderTradeNurseText:
script_cable_club_receptionist
@@ -21,3 +22,8 @@ LavenderPokecenterText2:
LavenderPokecenterText3:
text_far _LavenderPokecenterText3
text_end
+
+LavenderPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/MtMoon1F.asm b/scripts/MtMoon1F.asm
index d0477d2c..125a8fc5 100644
--- a/scripts/MtMoon1F.asm
+++ b/scripts/MtMoon1F.asm
@@ -49,42 +49,37 @@ MtMoon1TrainerHeader6:
MtMoon1Text1:
text_asm
ld hl, MtMoon1TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text2:
text_asm
ld hl, MtMoon1TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text3:
text_asm
ld hl, MtMoon1TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text4:
text_asm
ld hl, MtMoon1TrainerHeader3
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text5:
text_asm
ld hl, MtMoon1TrainerHeader4
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text6:
text_asm
ld hl, MtMoon1TrainerHeader5
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon1TalkToTrainer
MtMoon1Text7:
text_asm
ld hl, MtMoon1TrainerHeader6
+MtMoon1TalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm
index dbfca6a3..83601218 100644
--- a/scripts/MtMoonB2F.asm
+++ b/scripts/MtMoonB2F.asm
@@ -37,13 +37,23 @@ CoordsData_49d37:
dbmapcoord 14, 8
db -1 ; end
-MtMoon3Script_49d58:
+MtMoon3Script_49cd7:
+ CheckAndResetEvent EVENT_57E
+ call nz, MtMoon3Script_49cec
xor a
ld [wJoyIgnore], a
+MtMoon3Script_49ce5:
ld [wMtMoonB2FCurScript], a
ld [wCurMapScript], a
ret
+MtMoon3Script_49cec:
+ ld a, HS_MT_MOON_B2F_JESSIE
+ call MtMoon3Script_49f93
+ ld a, HS_MT_MOON_B2F_JAMES
+ call MtMoon3Script_49f93
+ ret
+
MtMoonB2F_ScriptPointers:
dw MtMoon3Script0
dw DisplayEnemyTrainerTextAndStartBattle
@@ -51,23 +61,45 @@ MtMoonB2F_ScriptPointers:
dw MtMoon3Script3
dw MtMoon3Script4
dw MtMoon3Script5
+ dw MtMoon3Script6
+ dw MtMoon3Script7
+ dw MtMoon3Script8
+ dw MtMoon3Script9
+ dw MtMoon3Script10
+ dw MtMoon3Script11
+ dw MtMoon3Script12
+ dw MtMoon3Script13
+ dw MtMoon3Script14
+ dw MtMoon3Script15
MtMoon3Script0:
+IF DEF(_DEBUG)
+ call DebugPressedOrHeldB
+ ret nz
+ENDC
+ CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
+ call z, MtMoon3Script_49d28
+ CheckEvent EVENT_BEAT_MT_MOON_3_TRAINER_0
+ call z, MtMoon3Script_49e15
+ ret
+
+MtMoon3Script_49d28:
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
- jp nz, MtMoon3Script_49d91
+ jp nz, .asm_49d4b
ld a, [wYCoord]
cp 8
- jp nz, MtMoon3Script_49d91
+ jp nz, .asm_49d4b
ld a, [wXCoord]
cp 13
- jp nz, MtMoon3Script_49d91
+ jp nz, .asm_49d4b
xor a
ldh [hJoyHeld], a
ld a, $1
ldh [hSpriteIndexOrTextID], a
- jp DisplayTextID
+ call DisplayTextID
+ ret
-MtMoon3Script_49d91:
+.asm_49d4b
CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
jp z, CheckFightingMapTrainers
ret
@@ -75,55 +107,91 @@ MtMoon3Script_49d91:
MtMoon3Script3:
ld a, [wIsInBattle]
cp $ff
- jp z, MtMoon3Script_49d58
+ jp z, MtMoon3Script_49cd7
call UpdateSprites
call Delay3
SetEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
+ call MtMoon3Script_49ce5
ret
MtMoon3Script4:
ld a, $1
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
- ld hl, CoordsData_49dea
+ ld hl, CoordsData_49dc7
+ call ArePlayerCoordsInArray
+ jr c, .asm_49da8
+ ld hl, CoordsData_49dc0
call ArePlayerCoordsInArray
- jr c, .asm_49dd7
- ld hl, CoordsData_49df1
+ jr c, .asm_49db0
+ ld hl, CoordsData_49dd5
call ArePlayerCoordsInArray
- jp nc, CheckFightingMapTrainers
- ld de, MovementData_49df9
- jr .asm_49dda
-.asm_49dd7
- ld de, MovementData_49df8
-.asm_49dda
+ jr c, .asm_49d9b
+ ld hl, CoordsData_49dce
+ call ArePlayerCoordsInArray
+ jr c, .asm_49da3
+ jp CheckFightingMapTrainers
+
+.asm_49d9b
+ ld b, SPRITE_FACING_LEFT
+ ld hl, PikachuMovementData_49dd8
+ call MtMoon3Script_4a325
+.asm_49da3
+ ld de, MovementData_49ddd
+ jr .asm_49db3
+
+.asm_49da8
+ ld b, SPRITE_FACING_RIGHT
+ ld hl, PikachuMovementData_49dca
+ call MtMoon3Script_4a325
+.asm_49db0
+ ld de, MovementData_49ddc
+.asm_49db3
ld a, $1
ldh [hSpriteIndex], a
call MoveSprite
ld a, $5
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
+ call MtMoon3Script_49ce5
ret
-CoordsData_49dea:
+CoordsData_49dc0:
dbmapcoord 12, 7
dbmapcoord 11, 6
dbmapcoord 12, 5
db -1 ; end
-CoordsData_49df1:
+CoordsData_49dc7:
+ dbmapcoord 12, 7
+ db -1 ; end
+
+PikachuMovementData_49dca:
+ db $00
+ db $35
+ db $33
+ db $3f
+
+CoordsData_49dce:
dbmapcoord 13, 7
dbmapcoord 14, 6
dbmapcoord 14, 5
db -1 ; end
-MovementData_49df8:
+CoordsData_49dd5:
+ dbmapcoord 13, 7
+ db -1 ; end
+
+PikachuMovementData_49dd8:
+ db $00
+ db $35
+ db $34
+ db $3f
+
+MovementData_49ddc:
db NPC_MOVEMENT_RIGHT
-MovementData_49df9:
+MovementData_49ddd:
db NPC_MOVEMENT_UP
db -1 ; end
@@ -135,23 +203,213 @@ MtMoon3Script5:
ld [wJoyIgnore], a
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld a, $a
+ ld a, $b
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- CheckEvent EVENT_GOT_DOME_FOSSIL
+ CheckEvent EVENT_GOT_HELIX_FOSSIL
jr z, .asm_49e1d
- ld a, HS_MT_MOON_B2F_FOSSIL_2
+ ld a, HS_MT_MOON_B2F_FOSSIL_1
jr .asm_49e1f
.asm_49e1d
- ld a, HS_MT_MOON_B2F_FOSSIL_1
+ ld a, HS_MT_MOON_B2F_FOSSIL_2
.asm_49e1f
ld [wMissableObjectIndex], a
predef HideObject
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script_49e15:
+ ld a, [wXCoord]
+ cp $3
+ ret nz
+ ld a, [wYCoord]
+ cp $5
+ ret nz
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, HS_MT_MOON_B2F_JESSIE
+ call MtMoon3Script_49f84
+ ld a, HS_MT_MOON_B2F_JAMES
+ call MtMoon3Script_49f84
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $c
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $1
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_UP
+ ld [wSimulatedJoypadStatesEnd], a
+ call StartSimulatingJoypadStates
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $6
+ call MtMoon3Script_49ce5
+ ret
+
+MovementData_f9e65:
+ db $06
+MovementData_f9e66:
+ db $06
+ db $06
+ db $06
+ db $06
+ db $06
+ db $FF
+
+MtMoon3Script6:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wSimulatedJoypadStatesIndex]
+ and a
+ ret nz
+ call Delay3
+ ld a, $2
+ ldh [hSpriteIndex], a
+ ld de, MovementData_f9e65
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $7
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script7:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+MtMoon3Script8:
+ ld a, $2
+ ld [wSprite02StateData1MovementStatus], a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSprite02StateData1FacingDirection], a
+MtMoon3Script9:
+ ld a, $6
+ ldh [hSpriteIndex], a
+ ld de, MovementData_f9e66
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $a
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script10:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+MtMoon3Script11:
+ ld a, $2
+ ld [wSprite06StateData1MovementStatus], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSprite06StateData1FacingDirection], a
+ call Delay3
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $d
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+MtMoon3Script12:
+ ld hl, wd72d
+ set 6, [hl]
+ set 7, [hl]
+ ld hl, MtMoon3JessieJamesEndBattleText
+ ld de, MtMoon3JessieJamesEndBattleText
+ call SaveEndBattleTextPointers
+ ld a, OPP_ROCKET
+ ld [wCurOpponent], a
+ ld a, $2a
+ ld [wTrainerNo], a
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ SetEvent EVENT_57E
+ ld a, $d
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script13:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wIsInBattle]
+ cp $ff
+ jp z, MtMoon3Script_49cd7
+ ld a, $2
+ ld [wSprite02StateData1MovementStatus], a
+ ld [wSprite06StateData1MovementStatus], a
+ xor a
+ ld [wSprite02StateData1FacingDirection], a
+ ld [wSprite06StateData1FacingDirection], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $e
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $e
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script14:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ call GBFadeOutToBlack
+ ld a, HS_MT_MOON_B2F_JESSIE
+ call MtMoon3Script_49f93
+ ld a, HS_MT_MOON_B2F_JAMES
+ call MtMoon3Script_49f93
+ call UpdateSprites
+ call Delay3
+ call GBFadeInFromBlack
+ ld a, $f
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script15:
+ call PlayDefaultMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ SetEvent EVENT_BEAT_MT_MOON_3_TRAINER_0
+ ResetEventReuseHL EVENT_57E
+ ld a, $0
+ call MtMoon3Script_49ce5
+ ret
+
+MtMoon3Script_49f84:
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ call UpdateSprites
+ call Delay3
+ ret
+
+MtMoon3Script_49f93:
+ ld [wMissableObjectIndex], a
+ predef HideObject
ret
MtMoonB2F_TextPointers:
@@ -162,188 +420,206 @@ MtMoonB2F_TextPointers:
dw MtMoon3Text5
dw MtMoon3Text6
dw MtMoon3Text7
+ dw MtMoon3Text8
dw PickUpItemText
dw PickUpItemText
- dw MtMoon3Text_49f99
+ dw MtMoon3Text11
+ dw MtMoon3Text12
+ dw MtMoon3Text13
+ dw MtMoon3Text14
MtMoon3TrainerHeaders:
- def_trainers 2
+ def_trainers 3
MtMoon3TrainerHeader0:
- trainer EVENT_BEAT_MT_MOON_3_TRAINER_0, 4, MtMoon3BattleText2, MtMoon3EndBattleText2, MtMoon3AfterBattleText2
-MtMoon3TrainerHeader1:
trainer EVENT_BEAT_MT_MOON_3_TRAINER_1, 4, MtMoon3BattleText3, MtMoon3EndBattleText3, MtMoon3AfterBattleText3
-MtMoon3TrainerHeader2:
+MtMoon3TrainerHeader1:
trainer EVENT_BEAT_MT_MOON_3_TRAINER_2, 4, MtMoon3BattleText4, MtMoon3EndBattleText4, MtMoon3AfterBattleText4
-MtMoon3TrainerHeader3:
+MtMoon3TrainerHeader2:
trainer EVENT_BEAT_MT_MOON_3_TRAINER_3, 4, MtMoon3BattleText5, MtMoon3EndBattleText5, MtMoon3AfterBattleText5
db -1 ; end
+MtMoon3Text2:
+MtMoon3Text6:
+ text_end
+
+MtMoon3Text12:
+ text_far _MtMoonJessieJamesText1
+ text_asm
+ ld c, 10
+ call DelayFrames
+ ld a, PLAYER_DIR_UP
+ ld [wPlayerMovingDirection], a
+ ld a, $0
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ ld c, 20
+ call DelayFrames
+ jp TextScriptEnd
+
+MtMoon3Text13:
+ text_far _MtMoonJessieJamesText2
+ text_end
+
+MtMoon3JessieJamesEndBattleText:
+ text_far _MtMoonJessieJamesText3
+ text_end
+
+MtMoon3Text14:
+ text_far _MtMoonJessieJamesText4
+ text_asm
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
+
MtMoon3Text1:
text_asm
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
- jr z, .asm_49e8d
+ jr z, .asm_4a02f
; CheckEitherEventSetReuseA EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
and (1 << (EVENT_GOT_DOME_FOSSIL % 8)) | (1 << (EVENT_GOT_HELIX_FOSSIL % 8))
- jr nz, .asm_49eb8
- ld hl, MtMoon3Text_49f8f
+ jr nz, .asm_4a057
+ ld hl, MtMoon3Text_4a116
call PrintText
- jr .asm_49ebe
-.asm_49e8d
- ld hl, MtMoon3Text_49f85
+ jr .asm_4a05d
+
+.asm_4a02f
+ ld hl, MtMoon3Text_4a10c
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, MtMoon3Text_49f8a
- ld de, MtMoon3Text_49f8a
+ ld hl, MtMoon3SuperNerdEndBattleText
+ ld de, MtMoon3SuperNerdEndBattleText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $3
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
- jr .asm_49ebe
-.asm_49eb8
- ld hl, MtMoon3Text_49f94
+ call MtMoon3Script_49ce5
+ jr .asm_4a05d
+
+.asm_4a057
+ ld hl, MtMoon3Text_4a11b
call PrintText
-.asm_49ebe
+.asm_4a05d
jp TextScriptEnd
-MtMoon3Text2:
+MtMoon3Text3:
text_asm
ld hl, MtMoon3TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon3TalkToTrainer
-MtMoon3Text3:
+MtMoon3Text4:
text_asm
ld hl, MtMoon3TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr MtMoon3TalkToTrainer
-MtMoon3Text4:
- text_asm
- ld hl, MtMoon3TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
MtMoon3Text5:
text_asm
- ld hl, MtMoon3TrainerHeader3
+ ld hl, MtMoon3TrainerHeader2
+MtMoon3TalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
-MtMoon3Text6:
+MtMoon3Text7:
text_asm
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, MtMoon3Text_49f24
+ ld hl, MtMoon3Text_4a0ae
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_49f21
+ jr nz, .asm_4a0ab
lb bc, DOME_FOSSIL, 1
call GiveItem
- jp nc, MtMoon3Script_49f76
- call MtMoon3Script_49f69
+ jp nc, MtMoon3Script_4a0fd
+ call MtMoon3Script_4a0f0
ld a, HS_MT_MOON_B2F_FOSSIL_1
ld [wMissableObjectIndex], a
predef HideObject
SetEvent EVENT_GOT_DOME_FOSSIL
ld a, $4
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
-.asm_49f21
+ call MtMoon3Script_49ce5
+.asm_4a0ab
jp TextScriptEnd
-MtMoon3Text_49f24:
+MtMoon3Text_4a0ae:
text_far _MtMoon3Text_49f24
text_end
-MtMoon3Text7:
+MtMoon3Text8:
text_asm
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, MtMoon3Text_49f64
+ ld hl, MtMoon3Text_4a0eb
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_49f61
+ jr nz, .asm_4a0e8
lb bc, HELIX_FOSSIL, 1
call GiveItem
- jp nc, MtMoon3Script_49f76
- call MtMoon3Script_49f69
+ jp nc, MtMoon3Script_4a0fd
+ call MtMoon3Script_4a0f0
ld a, HS_MT_MOON_B2F_FOSSIL_2
ld [wMissableObjectIndex], a
predef HideObject
SetEvent EVENT_GOT_HELIX_FOSSIL
ld a, $4
- ld [wMtMoonB2FCurScript], a
- ld [wCurMapScript], a
-.asm_49f61
+ call MtMoon3Script_49ce5
+.asm_4a0e8
jp TextScriptEnd
-MtMoon3Text_49f64:
+MtMoon3Text_4a0eb:
text_far _MtMoon3Text_49f64
text_end
-MtMoon3Script_49f69:
- ld hl, MtMoon3Text_49f6f
+MtMoon3Script_4a0f0:
+ ld hl, MtMoon3Text_4a0f6
jp PrintText
-MtMoon3Text_49f6f:
+MtMoon3Text_4a0f6:
text_far _MtMoon3Text_49f6f
sound_get_key_item
text_waitbutton
text_end
-MtMoon3Script_49f76:
- ld hl, MtMoon3Text_49f7f
+MtMoon3Script_4a0fd:
+ ld hl, MtMoon3Text_4a106
call PrintText
jp TextScriptEnd
-MtMoon3Text_49f7f:
+MtMoon3Text_4a106:
text_far _MtMoon3Text_49f7f
text_waitbutton
text_end
-MtMoon3Text_49f85:
+MtMoon3Text_4a10c:
text_far _MtMoon3Text_49f85
text_end
-MtMoon3Text_49f8a:
+MtMoon3SuperNerdEndBattleText:
text_far _MtMoon3Text_49f8a
text_end
-MtMoon3Text_49f8f:
+MtMoon3Text_4a116:
text_far _MtMoon3Text_49f8f
text_end
-MtMoon3Text_49f94:
+MtMoon3Text_4a11b:
text_far _MtMoon3Text_49f94
text_end
-MtMoon3Text_49f99:
+MtMoon3Text11:
text_far _MtMoon3Text_49f99
sound_get_key_item
text_end
-MtMoon3BattleText2:
- text_far _MtMoon3BattleText2
- text_end
-
-MtMoon3EndBattleText2:
- text_far _MtMoon3EndBattleText2
- text_end
-
-MtMoon3AfterBattleText2:
- text_far _MtMoon3AfterBattleText2
- text_end
-
MtMoon3BattleText3:
text_far _MtMoon3BattleText3
text_end
diff --git a/scripts/MtMoonB2F_2.asm b/scripts/MtMoonB2F_2.asm
new file mode 100644
index 00000000..c983bb0d
--- /dev/null
+++ b/scripts/MtMoonB2F_2.asm
@@ -0,0 +1,28 @@
+MtMoon3Script_4a325: ; pikachu-related function?
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ ld a, [wWalkBikeSurfState]
+ and a
+ ret nz
+
+ push hl
+ push bc
+ callfar GetPikachuFacingDirectionAndReturnToE
+ pop bc
+ pop hl
+ ld a, b
+ cp e
+ ret nz
+
+ push hl
+ ld a, [wUpdateSpritesEnabled]
+ push af
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ callfar LoadPikachuShadowIntoVRAM
+ pop af
+ ld [wUpdateSpritesEnabled], a
+ pop hl
+ call ApplyPikachuMovementData
+ ret
diff --git a/scripts/MtMoonPokecenter.asm b/scripts/MtMoonPokecenter.asm
index e4b881d1..302c5f19 100644
--- a/scripts/MtMoonPokecenter.asm
+++ b/scripts/MtMoonPokecenter.asm
@@ -9,6 +9,7 @@ MtMoonPokecenter_TextPointers:
dw MagikarpSalesmanText
dw MtMoonPokecenterText5
dw MtMoonTradeNurseText
+ dw MtMoonPokecenterText7
MtMoonHealNurseText:
script_pokecenter_nurse
@@ -23,72 +24,17 @@ MtMoonPokecenterText3:
MagikarpSalesmanText:
text_asm
- CheckEvent EVENT_BOUGHT_MAGIKARP, 1
- jp c, .alreadyBoughtMagikarp
- ld hl, .Text1
- call PrintText
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jp nz, .choseNo
- ldh [hMoney], a
- ldh [hMoney + 2], a
- ld a, $5
- ldh [hMoney + 1], a
- call HasEnoughMoney
- jr nc, .enoughMoney
- ld hl, .NoMoneyText
- jr .printText
-.enoughMoney
- lb bc, MAGIKARP, 5
- call GivePokemon
- jr nc, .done
- xor a
- ld [wPriceTemp], a
- ld [wPriceTemp + 2], a
- ld a, $5
- ld [wPriceTemp + 1], a
- ld hl, wPriceTemp + 2
- ld de, wPlayerMoney + 2
- ld c, $3
- predef SubBCDPredef
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- SetEvent EVENT_BOUGHT_MAGIKARP
- jr .done
-.choseNo
- ld hl, .RefuseText
- jr .printText
-.alreadyBoughtMagikarp
- ld hl, .Text2
-.printText
- call PrintText
-.done
+ callfar MagikarpSalesman
jp TextScriptEnd
-.Text1
- text_far _MagikarpSalesmanText1
- text_end
-
-.RefuseText
- text_far _MagikarpSalesmanNoText
- text_end
-
-.NoMoneyText
- text_far _MagikarpSalesmanNoMoneyText
- text_end
-
-.Text2
- text_far _MagikarpSalesmanText2
- text_end
-
MtMoonPokecenterText5:
text_far _MtMoonPokecenterText5
text_end
MtMoonTradeNurseText:
script_cable_club_receptionist
+
+MtMoonPokecenterText7:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/MtMoonPokecenter2.asm b/scripts/MtMoonPokecenter2.asm
new file mode 100644
index 00000000..9abc0286
--- /dev/null
+++ b/scripts/MtMoonPokecenter2.asm
@@ -0,0 +1,66 @@
+MagikarpSalesman::
+ CheckEvent EVENT_BOUGHT_MAGIKARP, 1
+ jp c, .alreadyBoughtMagikarp
+ ld hl, .Text1
+ call PrintText
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, .choseNo
+ ; $000500
+ xor a
+ ldh [hMoney], a
+ ldh [hMoney + 2], a
+ ld a, $5
+ ldh [hMoney + 1], a
+ call HasEnoughMoney
+ jr nc, .enoughMoney
+ ld hl, .NoMoneyText
+ jr .printText
+.enoughMoney
+ lb bc, MAGIKARP, 5
+ call GivePokemon
+ jr nc, .done
+ ; $000500
+ xor a
+ ld [wPriceTemp], a
+ ld [wPriceTemp + 2], a
+ ld a, $5
+ ld [wPriceTemp + 1], a
+ ld hl, wPriceTemp + 2
+ ld de, wPlayerMoney + 2
+ ld c, $3
+ predef SubBCDPredef
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ SetEvent EVENT_BOUGHT_MAGIKARP
+ jr .done
+.choseNo
+ ld hl, .RefuseText
+ jr .printText
+.alreadyBoughtMagikarp
+ ld hl, .Text2
+.printText
+ call PrintText
+.done
+ ret
+
+.Text1
+ text_far _MagikarpSalesmanText1
+ text_end
+
+.RefuseText
+ text_far _MagikarpSalesmanNoText
+ text_end
+
+.NoMoneyText
+ text_far _MagikarpSalesmanNoMoneyText
+ text_end
+
+.Text2
+ text_far _MagikarpSalesmanText2
+ text_end
diff --git a/scripts/Museum1F.asm b/scripts/Museum1F.asm
index ee3473ff..c89eacda 100644
--- a/scripts/Museum1F.asm
+++ b/scripts/Museum1F.asm
@@ -5,7 +5,8 @@ Museum1F_Script:
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, Museum1F_ScriptPointers
ld a, [wMuseum1FCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
Museum1F_ScriptPointers:
dw Museum1FScript0
@@ -40,208 +41,25 @@ Museum1F_TextPointers:
Museum1FText1:
text_asm
- ld a, [wYCoord]
- cp 4
- jr nz, .asm_8774b
- ld a, [wXCoord]
- cp 13
- jp z, Museum1FScript_5c1f9
- jr .asm_b8709
-.asm_8774b
- cp $3
- jr nz, .asm_d49e7
- ld a, [wXCoord]
- cp 12
- jp z, Museum1FScript_5c1f9
-.asm_d49e7
- CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
- jr nz, .asm_31a16
- ld hl, Museum1FText_5c23d
- call PrintText
- jp Museum1FScriptEnd
-.asm_b8709
- CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
- jr z, .asm_3ded4
-.asm_31a16
- ld hl, Museum1FText_5c242
- call PrintText
- jp Museum1FScriptEnd
-.asm_3ded4
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- xor a
- ldh [hJoyHeld], a
- ld hl, Museum1FText_5c21f
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .asm_de133
- xor a
- ldh [hMoney], a
- ldh [hMoney + 1], a
- ld a, $50
- ldh [hMoney + 2], a
- call HasEnoughMoney
- jr nc, .asm_0f3e3
- ld hl, Museum1FText_5c229
- call PrintText
- jp .asm_de133
-.asm_0f3e3
- ld hl, Museum1FText_5c224
- call PrintText
- SetEvent EVENT_BOUGHT_MUSEUM_TICKET
- xor a
- ld [wPriceTemp], a
- ld [wPriceTemp + 1], a
- ld a, $50
- ld [wPriceTemp + 2], a
- ld hl, wPriceTemp + 2
- ld de, wPlayerMoney + 2
- ld c, $3
- predef SubBCDPredef
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- ld a, SFX_PURCHASE
- call PlaySoundWaitForCurrent
- call WaitForSoundToFinish
- jr .asm_0b094
-.asm_de133
- ld hl, Museum1FText_5c21a
- call PrintText
- ld a, $1
- ld [wSimulatedJoypadStatesIndex], a
- ld a, D_DOWN
- ld [wSimulatedJoypadStatesEnd], a
- call StartSimulatingJoypadStates
- call UpdateSprites
- jr Museum1FScriptEnd
-.asm_0b094
- ld a, $1
- ld [wMuseum1FCurScript], a
- jr Museum1FScriptEnd
-
-Museum1FScript_5c1f9:
- ld hl, Museum1FText_5c22e
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- cp $0
- jr nz, .asm_d1144
- ld hl, Museum1FText_5c233
- call PrintText
- jr Museum1FScriptEnd
-.asm_d1144
- ld hl, Museum1FText_5c238
- call PrintText
-Museum1FScriptEnd:
+ farcall Func_f1c1b
jp TextScriptEnd
-Museum1FText_5c21a:
- text_far _Museum1FText_5c21a
- text_end
-
-Museum1FText_5c21f:
- text_far _Museum1FText_5c21f
- text_end
-
-Museum1FText_5c224:
- text_far _Museum1FText_5c224
- text_end
-
-Museum1FText_5c229:
- text_far _Museum1FText_5c229
- text_end
-
-Museum1FText_5c22e:
- text_far _Museum1FText_5c22e
- text_end
-
-Museum1FText_5c233:
- text_far _Museum1FText_5c233
- text_end
-
-Museum1FText_5c238:
- text_far _Museum1FText_5c238
- text_end
-
-Museum1FText_5c23d:
- text_far _Museum1FText_5c23d
- text_end
-
-Museum1FText_5c242:
- text_far _Museum1FText_5c242
- text_end
-
Museum1FText2:
text_asm
- ld hl, Museum1FText_5c251
- call PrintText
+ farcall Func_f1d2a
jp TextScriptEnd
-Museum1FText_5c251:
- text_far _Museum1FText_5c251
- text_end
-
Museum1FText3:
text_asm
- CheckEvent EVENT_GOT_OLD_AMBER
- jr nz, .got_item
- ld hl, Museum1FText_5c28e
- call PrintText
- lb bc, OLD_AMBER, 1
- call GiveItem
- jr nc, .bag_full
- SetEvent EVENT_GOT_OLD_AMBER
- ld a, HS_OLD_AMBER
- ld [wMissableObjectIndex], a
- predef HideObject
- ld hl, ReceivedOldAmberText
- jr .done
-.bag_full
- ld hl, Museum1FText_5c29e
- jr .done
-.got_item
- ld hl, Museum1FText_5c299
-.done
- call PrintText
+ farcall Func_f1d36
jp TextScriptEnd
-Museum1FText_5c28e:
- text_far _Museum1FText_5c28e
- text_end
-
-ReceivedOldAmberText:
- text_far _ReceivedOldAmberText
- sound_get_item_1
- text_end
-
-Museum1FText_5c299:
- text_far _Museum1FText_5c299
- text_end
-
-Museum1FText_5c29e:
- text_far _Museum1FText_5c29e
- text_end
-
Museum1FText4:
text_asm
- ld hl, Museum1FText_5c2ad
- call PrintText
+ farcall Func_f1d80
jp TextScriptEnd
-Museum1FText_5c2ad:
- text_far _Museum1FText_5c2ad
- text_end
-
Museum1FText5:
text_asm
- ld hl, Museum1FText_5c2bc
- call PrintText
+ farcall Func_f1d8c
jp TextScriptEnd
-
-Museum1FText_5c2bc:
- text_far _Museum1FText_5c2bc
- text_end
diff --git a/scripts/Museum1F2.asm b/scripts/Museum1F2.asm
new file mode 100644
index 00000000..512a3295
--- /dev/null
+++ b/scripts/Museum1F2.asm
@@ -0,0 +1,209 @@
+Func_f1c1b::
+ ld a, [wYCoord]
+ cp 4
+ jr nz, .asm_f1c2c
+ ld a, [wXCoord]
+ cp 13
+ jp z, .asm_f1cde
+ jr .asm_f1c48
+
+.asm_f1c2c
+ cp $3
+ jr nz, .asm_f1c38
+ ld a, [wXCoord]
+ cp 12
+ jp z, .asm_f1cde
+.asm_f1c38
+ CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
+ jr nz, .asm_f1c4f
+ ld hl, Museum1FText_f1d20
+ call PrintText
+ jp .asm_f1cfc
+
+.asm_f1c48
+ CheckEvent EVENT_BOUGHT_MUSEUM_TICKET
+ jr z, .asm_f1c58
+.asm_f1c4f
+ ld hl, Museum1FText_f1d25
+ call PrintText
+ jp .asm_f1cfc
+
+.asm_f1c58
+ ld a, $13
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ xor a
+ ldh [hJoyHeld], a
+ ld hl, Museum1FText_f1d02
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_f1cbf
+ xor a
+ ldh [hMoney], a
+ ldh [hMoney + 1], a
+ ld a, $50
+ ldh [hMoney + 2], a
+ call HasEnoughMoney
+ jr nc, .asm_f1c89
+ ld hl, Museum1FText_f1d0c
+ call PrintText
+ jp .asm_f1cbf
+
+.asm_f1c89
+ ld hl, Museum1FText_f1d07
+ call PrintText
+ SetEvent EVENT_BOUGHT_MUSEUM_TICKET
+ xor a
+ ld [wPriceTemp], a
+ ld [wPriceTemp + 1], a
+ ld a, $50
+ ld [wPriceTemp + 2], a
+ ld hl, wPriceTemp + 2
+ ld de, wPlayerMoney + 2
+ ld c, 3
+ predef SubBCDPredef
+ ld a, $13
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ ld a, SFX_PURCHASE
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
+ jr .asm_f1cd7
+
+.asm_f1cbf
+ ld hl, Museum1FText_f1cfd
+ call PrintText
+ ld a, $1
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_DOWN
+ ld [wSimulatedJoypadStatesEnd], a
+ call StartSimulatingJoypadStates
+ call UpdateSprites
+ jr .asm_f1cfc
+
+.asm_f1cd7
+ ld a, $1
+ ld [wMuseum1FCurScript], a
+ jr .asm_f1cfc
+
+.asm_f1cde
+ ld hl, Museum1FText_f1d11
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ cp 0
+ jr nz, .asm_f1cf6
+ ld hl, Museum1FText_f1d16
+ call PrintText
+ jr .asm_f1cfc
+
+.asm_f1cf6
+ ld hl, Museum1FText_f1d1b
+ call PrintText
+.asm_f1cfc
+ ret
+
+Museum1FText_f1cfd:
+ text_far _Museum1FText_5c21a
+ text_end
+
+Museum1FText_f1d02:
+ text_far _Museum1FText_5c21f
+ text_end
+
+Museum1FText_f1d07:
+ text_far _Museum1FText_5c224
+ text_end
+
+Museum1FText_f1d0c:
+ text_far _Museum1FText_5c229
+ text_end
+
+Museum1FText_f1d11:
+ text_far _Museum1FText_5c22e
+ text_end
+
+Museum1FText_f1d16:
+ text_far _Museum1FText_5c233
+ text_end
+
+Museum1FText_f1d1b:
+ text_far _Museum1FText_5c238
+ text_end
+
+Museum1FText_f1d20:
+ text_far _Museum1FText_5c23d
+ text_end
+
+Museum1FText_f1d25:
+ text_far _Museum1FText_5c242
+ text_end
+
+Func_f1d2a::
+ ld hl, Museum1FText_f1d31
+ call PrintText
+ ret
+
+Museum1FText_f1d31:
+ text_far _Museum1FText_5c251
+ text_end
+
+Func_f1d36::
+ CheckEvent EVENT_GOT_OLD_AMBER
+ jr nz, .got_item
+ ld hl, Museum1FText_5c28e
+ call PrintText
+ lb bc, OLD_AMBER, 1
+ call GiveItem
+ jr nc, .bag_full
+ SetEvent EVENT_GOT_OLD_AMBER
+ ld a, HS_OLD_AMBER
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ld hl, ReceivedOldAmberText
+ jr .done
+.bag_full
+ ld hl, Museum1FText_5c29e
+ jr .done
+.got_item
+ ld hl, Museum1FText_5c299
+.done
+ call PrintText
+ ret
+
+Museum1FText_5c28e:
+ text_far _Museum1FText_5c28e
+ text_end
+
+ReceivedOldAmberText:
+ text_far _ReceivedOldAmberText
+ sound_get_item_1
+ text_end
+
+Museum1FText_5c299:
+ text_far _Museum1FText_5c299
+ text_end
+
+Museum1FText_5c29e:
+ text_far _Museum1FText_5c29e
+ text_end
+
+Func_f1d80::
+ ld hl, Museum1FText_f1d87
+ call PrintText
+ ret
+
+Museum1FText_f1d87:
+ text_far _Museum1FText_5c2ad
+ text_end
+
+Func_f1d8c::
+ ld hl, Museum1FText_f1d93
+ call PrintText
+ ret
+
+Museum1FText_f1d93:
+ text_far _Museum1FText_5c2bc
+ text_end
diff --git a/scripts/Museum2F.asm b/scripts/Museum2F.asm
index 8b1aa0bf..fe02f544 100644
--- a/scripts/Museum2F.asm
+++ b/scripts/Museum2F.asm
@@ -1,5 +1,6 @@
Museum2F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
Museum2F_TextPointers:
dw Museum2FText1
@@ -27,9 +28,40 @@ Museum2FText4:
text_end
Museum2FText5:
+ text_asm
+ ld a, [wd472]
+ bit 7, a
+ jr nz, .asm_5c1f6
+ ld hl, Museum2FText_5c20e
+ call PrintText
+ jr .asm_5c20b
+
+.asm_5c1f6
+ ld a, [wPikachuHappiness]
+ cp 101
+ jr c, .asm_5c205
+ ld hl, Museum2FText_5c218
+ call PrintText
+ jr .asm_5c20b
+
+.asm_5c205
+ ld hl, Museum2FText_5c213
+ call PrintText
+.asm_5c20b
+ jp TextScriptEnd
+
+Museum2FText_5c20e:
text_far _Museum2FText5
text_end
+Museum2FText_5c213:
+ text_far _Museum2FPikachuText1
+ text_end
+
+Museum2FText_5c218:
+ text_far _Museum2FPikachuText2
+ text_end
+
Museum2FText6:
text_far _Museum2FText6
text_end
diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm
index d1755fa8..3d9fde89 100644
--- a/scripts/OaksLab.asm
+++ b/scripts/OaksLab.asm
@@ -7,7 +7,8 @@ OaksLab_Script:
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, OaksLab_ScriptPointers
ld a, [wOaksLabCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
OaksLab_ScriptPointers:
dw OaksLabScript0
@@ -29,6 +30,10 @@ OaksLab_ScriptPointers:
dw OaksLabScript16
dw OaksLabScript17
dw OaksLabScript18
+ dw OaksLabScript19
+ dw OaksLabScript20
+ dw OaksLabScript21
+ dw OaksLabScript22
OaksLabScript0:
CheckEvent EVENT_OAK_APPEARED_IN_PALLET
@@ -47,7 +52,7 @@ OaksLabScript0:
ret
OaksLabScript1:
- ld a, $8
+ ld a, $6
ldh [hSpriteIndex], a
ld de, OakEntryMovement
call MoveSprite
@@ -90,7 +95,7 @@ OaksLabScript3:
xor a
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $5
+ ld a, $3
ldh [hSpriteIndex], a
xor a
ldh [hSpriteFacingDirection], a
@@ -115,7 +120,6 @@ OaksLabScript4:
ld a, SPRITE_FACING_UP
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- call UpdateSprites
ld hl, wFlags_D733
res 1, [hl]
call PlayDefaultMusic
@@ -125,24 +129,28 @@ OaksLabScript4:
ret
OaksLabScript5:
+ SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON
ld a, $fc
ld [wJoyIgnore], a
- ld a, $11
+ ld a, $d
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $12
+ ld a, $e
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $13
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ ld a, SPRITE_FACING_UP
+ ld [wSprite01StateData1FacingDirection], a
+ ld a, $f
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
- ld a, $14
+ ld a, $10
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON
xor a
ld [wJoyIgnore], a
@@ -154,7 +162,7 @@ OaksLabScript6:
ld a, [wYCoord]
cp 6
ret nz
- ld a, $5
+ ld a, $3
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
ldh [hSpriteFacingDirection], a
@@ -165,7 +173,7 @@ OaksLabScript6:
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call UpdateSprites
- ld a, $c
+ ld a, $a
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
@@ -191,176 +199,130 @@ OaksLabScript7:
ret
OaksLabScript8:
- ld a, [wPlayerStarter]
- cp STARTER1
- jr z, .Charmander
- cp STARTER2
- jr z, .Squirtle
- jr .Bulbasaur
-.Charmander
- ld de, .MiddleBallMovement1
- ld a, [wYCoord]
- cp 4 ; is the player standing below the table?
- jr z, .moveBlue
- ld de, .MiddleBallMovement2
- jr .moveBlue
-
-.MiddleBallMovement1
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_UP
- db -1 ; end
-
-.MiddleBallMovement2
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db -1 ; end
-
-.Squirtle
- ld de, .RightBallMovement1
- ld a, [wYCoord]
- cp 4 ; is the player standing below the table?
- jr z, .moveBlue
- ld de, .RightBallMovement2
- jr .moveBlue
-
-.RightBallMovement1
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_UP
- db -1 ; end
-
-.RightBallMovement2
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_RIGHT
- db -1 ; end
-
-.Bulbasaur
- ld de, .LeftBallMovement1
- ld a, [wXCoord]
- cp 9 ; is the player standing to the right of the table?
- jr nz, .moveBlue
- push hl
ld a, $1
- ldh [hSpriteIndex], a
- ld a, SPRITESTATEDATA1_YPIXELS
- ldh [hSpriteDataOffset], a
- call GetPointerWithinSpriteStateData1
- push hl
- ld [hl], $4c ; SPRITESTATEDATA1_YPIXELS
- inc hl
- inc hl
- ld [hl], $0 ; SPRITESTATEDATA1_XPIXELS
- pop hl
- inc h
- ld [hl], 8 ; SPRITESTATEDATA2_MAPY
- inc hl
- ld [hl], 9 ; SPRITESTATEDATA2_MAPX
- ld de, .LeftBallMovement2 ; the rival is not currently onscreen, so account for that
- pop hl
- jr .moveBlue
-
-.LeftBallMovement1
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
-.LeftBallMovement2
- db NPC_MOVEMENT_RIGHT
- db -1 ; end
-
-.moveBlue
- ld a, $1
- ldh [hSpriteIndex], a
+ ldh [hSpriteIndexOrTextID], a
+ ld de, .RivalPushesPlayerAwayFromEeveeBall
call MoveSprite
-
ld a, $9
ld [wOaksLabCurScript], a
ret
+.RivalPushesPlayerAwayFromEeveeBall
+ db $00
+ db $07
+ db $07
+ db $07
+ db $FF
+
OaksLabScript9:
ld a, [wd730]
bit 0, a
- ret nz
- ld a, $fc
- ld [wJoyIgnore], a
+ jr nz, .asm_1c564
+ ld a, HS_STARTER_BALL_1
+ ld [wMissableObjectIndex], a
+ predef HideObject
ld a, $1
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_UP
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $d
- ldh [hSpriteIndexOrTextID], a
- call DisplayTextID
- ld a, [wRivalStarterBallSpriteIndex]
- cp $2
- jr nz, .rivalDidNotChoseBall1
- ld a, HS_STARTER_BALL_1
- jr .hideBallAndContinue
-.rivalDidNotChoseBall1
- cp $3
- jr nz, .rivalChoseBall3
- ld a, HS_STARTER_BALL_2
- jr .hideBallAndContinue
-.rivalChoseBall3
- ld a, HS_STARTER_BALL_3
-.hideBallAndContinue
- ld [wMissableObjectIndex], a
- predef HideObject
- call Delay3
- ld a, [wRivalStarterTemp]
+ ld a, RIVAL_STARTER_JOLTEON
ld [wRivalStarter], a
- ld [wcf91], a
+ ld a, EEVEE
ld [wd11e], a
call GetMonName
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $11
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+
+ ld a, $a
+ ld [wOaksLabCurScript], a
+ ret
+
+.asm_1c564
+ ld a, [wYCoord]
+ cp 4
+ ret nz
+ ld a, [wNPCNumScriptedSteps]
+ cp 1
+ ret nz
+ ld a, PLAYER_DIR_LEFT
+ ld [wPlayerMovingDirection], a
+ ld a, $2
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_RIGHT
+ ld [wSimulatedJoypadStatesEnd], a
+ ld [wSimulatedJoypadStatesEnd + 1], a
+ call StartSimulatingJoypadStates
+ ret
+
+OaksLabScript10:
+ ld a, [wYCoord]
+ cp 4
+ jr z, .asm_1c599
ld a, $1
- ldh [hSpriteIndex], a
- ld a, SPRITE_FACING_UP
- ldh [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
- ld a, $e
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_LEFT
+ ld [wSimulatedJoypadStatesEnd], a
+ jr .asm_1c5a6
+
+.asm_1c599
+ ld hl, wSimulatedJoypadStatesEnd
+ ld de, OaksLabRLE_PlayerWalksToOak
+ call DecodeRLEList
+ dec a
+ ld [wSimulatedJoypadStatesIndex], a
+.asm_1c5a6
+ call StartSimulatingJoypadStates
+ ld a, $b
+ ld [wOaksLabCurScript], a
+ ret
+
+OaksLabRLE_PlayerWalksToOak:
+ db D_UP, 2
+ db D_LEFT, 3
+ db D_DOWN, 1
+ db D_LEFT, 1
+ db $FF
+
+OaksLabScript11:
+ ld a, [wSimulatedJoypadStatesIndex]
+ and a
+ ret nz
+ ld a, $12
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- SetEvent EVENT_GOT_STARTER
xor a
ld [wJoyIgnore], a
- ld a, $a
+ ld a, $c
ld [wOaksLabCurScript], a
ret
-OaksLabScript10:
+OaksLabScript12:
ld a, [wYCoord]
cp 6
ret nz
+ ld a, PLAYER_DIR_UP
+ ld [wPlayerMovingDirection], a
ld a, $1
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, PLAYER_DIR_UP
- ld [wPlayerMovingDirection], a
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
- ld a, $f
+ ld a, $b
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ldh [hNPCPlayerRelativePosPerspective], a
ld a, $1
swap a
- ldh [hNPCSpriteOffset], a
+ ldh [hNPCPlayerYDistance], a
predef CalcPositionOfPlayerRelativeToNPC
ldh a, [hNPCPlayerYDistance]
dec a
@@ -370,38 +332,23 @@ OaksLabScript10:
ld a, $1
ldh [hSpriteIndex], a
call MoveSprite
-
- ld a, $b
+ ld a, $d
ld [wOaksLabCurScript], a
ret
-OaksLabScript11:
+OaksLabScript13:
ld a, [wd730]
bit 0, a
ret nz
-
- ; define which team rival uses, and fight it
+ ld a, $1
+ ld [wSpriteIndex], a
+ call GetSpritePosition1
ld a, OPP_RIVAL1
ld [wCurOpponent], a
- ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .NotSquirtle
ld a, $1
- jr .done
-.NotSquirtle
- cp STARTER3
- jr nz, .Charmander
- ld a, $2
- jr .done
-.Charmander
- ld a, $3
-.done
ld [wTrainerNo], a
- ld a, $1
- ld [wSpriteIndex], a
- call GetSpritePosition1
- ld hl, OaksLabText_1d3be
- ld de, OaksLabText_1d3c3
+ ld hl, OaksLabRivalDefeatedText
+ ld de, OaksLabRivalBeatYouText
call SaveEndBattleTextPointers
ld hl, wd72d
set 6, [hl]
@@ -410,12 +357,28 @@ OaksLabScript11:
ld [wJoyIgnore], a
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
- ld a, $c
+ ld a, $e
ld [wOaksLabCurScript], a
ret
-OaksLabScript12:
- ld a, $f0
+OaksLabScript14:
+ ld a, $ff
+ ld [wJoyIgnore], a
+
+ ; If you beat your rival here, his Eevee will evolve into
+ ; Jolteon if you beat him on Route 22, or Flareon if you
+ ; skip or lose that battle.
+ ; Otherwise, it will evolve into Vaporeon.
+ ld a, [wBattleResult]
+ and a
+ ld b, RIVAL_STARTER_VAPOREON
+ jr nz, .got_rival_starter
+ ld b, RIVAL_STARTER_FLAREON
+.got_rival_starter
+ ld a, b
+ ld [wRivalStarter], a
+
+ ld a, $ff ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
@@ -423,66 +386,64 @@ OaksLabScript12:
ld a, $1
ld [wSpriteIndex], a
call SetSpritePosition1
- ld a, $1
- ldh [hSpriteIndex], a
- xor a ; SPRITE_FACING_DOWN
- ldh [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ xor a
+ ld [wSprite01StateData1FacingDirection], a
predef HealParty
SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB
-
- ld a, $d
+ ld a, $f
ld [wOaksLabCurScript], a
ret
-OaksLabScript13:
+OaksLabScript15:
ld c, 20
call DelayFrames
- ld a, $10
+ ld a, $c
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
farcall Music_RivalAlternateStart
ld a, $1
ldh [hSpriteIndex], a
- ld de, .RivalExitMovement
+ ld de, .OaksLabMovement_RivalWalksOut1
call MoveSprite
ld a, [wXCoord]
cp 4
- ; move left or right depending on where the player is standing
- jr nz, .moveLeft
+ jr nz, .asm_1c6bb
ld a, NPC_MOVEMENT_RIGHT
- jr .next
-.moveLeft
+ jr .asm_1c6bd
+
+.asm_1c6bb
ld a, NPC_MOVEMENT_LEFT
-.next
+.asm_1c6bd
ld [wNPCMovementDirections], a
-
- ld a, $e
+ ld a, $10
ld [wOaksLabCurScript], a
ret
-.RivalExitMovement
+.OaksLabMovement_RivalWalksOut1
db NPC_CHANGE_FACING
db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
+ db $04
+ db $04
+ db $04
+ db $04
+ db $04
db -1 ; end
-OaksLabScript14:
+OaksLabScript16:
ld a, [wd730]
bit 0, a
jr nz, .checkRivalPosition
+ ld a, $ff ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
ld a, HS_OAKS_LAB_RIVAL
ld [wMissableObjectIndex], a
predef HideObject
- xor a
- ld [wJoyIgnore], a
- call PlayDefaultMusic ; reset to map music
- ld a, $12
+ call PlayDefaultMusic
+ ld a, $11
ld [wOaksLabCurScript], a
- jr .done
+ ret
; make the player keep facing the rival as he walks away
.checkRivalPosition
ld a, [wNPCNumScriptedSteps]
@@ -492,32 +453,54 @@ OaksLabScript14:
cp 4
jr nz, .turnPlayerLeft
ld a, SPRITE_FACING_RIGHT
- ld [wSpritePlayerStateData1FacingDirection], a
jr .done
.turnPlayerLeft
ld a, SPRITE_FACING_LEFT
- ld [wSpritePlayerStateData1FacingDirection], a
jr .done
.turnPlayerDown
cp $4
ret nz
xor a ; ld a, SPRITE_FACING_DOWN
- ld [wSpritePlayerStateData1FacingDirection], a
.done
+ ld [wSpritePlayerStateData1FacingDirection], a
ret
-OaksLabScript15:
+OaksLabScript17:
+; Pikachu comes out
+ ld a, SPRITE_FACING_UP
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $2
+ ld [wPikachuSpawnState], a
+ farcall SchedulePikachuSpawnForAfterText
+ call EnablePikachuOverworldSpriteDrawing
+ ld a, $1a
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, $12
+ ld [wOaksLabCurScript], a
+ ret
+
+OaksLabScript18:
+ ld a, $1b
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $16
+ ld [wOaksLabCurScript], a
+ ret
+
+OaksLabScript19:
xor a
ldh [hJoyHeld], a
call EnableAutoTextBoxDrawing
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
- ld a, $15
+ ld a, $13
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- call OaksLabScript_1d02b
+ callfar Func_f1be0
+ call OaksLabScript_1c8b9
ld a, HS_OAKS_LAB_RIVAL
ld [wMissableObjectIndex], a
predef ShowObject
@@ -533,47 +516,47 @@ OaksLabScript15:
ldh [hSpriteIndex], a
ld de, wNPCMovementDirections2
call MoveSprite
-
- ld a, $10
+ ld a, $14
ld [wOaksLabCurScript], a
ret
-OaksLabScript_1cefd:
+OaksLabScript_1c78e:
ld a, $1
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_UP
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, $8
+ ld a, $6
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
ldh [hSpriteFacingDirection], a
- jp SetSpriteFacingDirectionAndDelay
+ call SetSpriteFacingDirectionAndDelay
+ ret
-OaksLabScript16:
+OaksLabScript20:
ld a, [wd730]
bit 0, a
ret nz
call EnableAutoTextBoxDrawing
call PlayDefaultMusic
- ld a, $fc
+ ld a, $ff ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
- call OaksLabScript_1cefd
- ld a, $16
+ call OaksLabScript_1c78e
+ ld a, $14
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- call OaksLabScript_1cefd
- ld a, $17
+ call OaksLabScript_1c78e
+ ld a, $15
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- call OaksLabScript_1cefd
- ld a, $18
+ call OaksLabScript_1c78e
+ ld a, $16
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
- ld a, $19
+ ld a, $17
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
@@ -583,8 +566,8 @@ OaksLabScript16:
ld a, HS_POKEDEX_2
ld [wMissableObjectIndex], a
predef HideObject
- call OaksLabScript_1cefd
- ld a, $1a
+ call OaksLabScript_1c78e
+ ld a, $18
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
@@ -593,10 +576,12 @@ OaksLabScript16:
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call Delay3
- ld a, $1b
+ ld a, $19
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
SetEvent EVENT_GOT_POKEDEX
+ ld a, $1
+ ld [wViridianCityCurScript], a
SetEvent EVENT_OAK_GOT_PARCEL
ld a, HS_LYING_OLD_MAN
ld [wMissableObjectIndex], a
@@ -611,20 +596,17 @@ OaksLabScript16:
xor a ; NPC_MOVEMENT_DOWN
call FillMemory
ld [hl], $ff
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld a, $1
- ldh [hSpriteIndex], a
+ ldh [hSpriteIndexOrTextID], a
ld de, wNPCMovementDirections2
call MoveSprite
-
- ld a, $11
+ ld a, $15
ld [wOaksLabCurScript], a
ret
-OaksLabScript17:
+OaksLabScript21:
ld a, [wd730]
bit 0, a
ret nz
@@ -638,16 +620,13 @@ OaksLabScript17:
ld a, HS_ROUTE_22_RIVAL_1
ld [wMissableObjectIndex], a
predef ShowObject
- ld a, $5
- ld [wPalletTownCurScript], a
xor a
ld [wJoyIgnore], a
-
- ld a, $12
+ ld a, $16
ld [wOaksLabCurScript], a
ret
-OaksLabScript18:
+OaksLabScript22:
ret
OaksLabScript_RemoveParcel:
@@ -668,41 +647,42 @@ OaksLabScript_RemoveParcel:
ld [wWhichPokemon], a
ld a, 1
ld [wItemQuantity], a
- jp RemoveItemFromInventory
+ call RemoveItemFromInventory
+ ret
-OaksLabScript_1d02b:
+OaksLabScript_1c8b9:
ld a, $7c
ldh [hSpriteScreenYCoord], a
ld a, 8
ldh [hSpriteMapXCoord], a
ld a, [wYCoord]
cp 3
- jr nz, .asm_1d045
+ jr nz, .asm_1c8d3
ld a, $4
ld [wNPCMovementDirections2Index], a
ld a, $30
ld b, 11
- jr .asm_1d068
-.asm_1d045
+ jr .asm_1c8f6
+.asm_1c8d3
cp 1
- jr nz, .asm_1d054
+ jr nz, .asm_1c8e2
ld a, $2
ld [wNPCMovementDirections2Index], a
ld a, $30
ld b, 9
- jr .asm_1d068
-.asm_1d054
+ jr .asm_1c8f6
+.asm_1c8e2
ld a, $3
ld [wNPCMovementDirections2Index], a
ld b, 10
ld a, [wXCoord]
cp 4
- jr nz, .asm_1d066
+ jr nz, .asm_1c8f4
ld a, $40
- jr .asm_1d068
-.asm_1d066
+ jr .asm_1c8f6
+.asm_1c8f4
ld a, $20
-.asm_1d068
+.asm_1c8f6
ldh [hSpriteScreenXCoord], a
ld a, b
ldh [hSpriteMapYCoord], a
@@ -758,8 +738,6 @@ OaksLab_TextPointers2:
dw OaksLabText7
dw OaksLabText8
dw OaksLabText9
- dw OaksLabText10
- dw OaksLabText11
OaksLabText1:
text_asm
@@ -769,7 +747,7 @@ OaksLabText1:
call PrintText
jr .done
.beforeChooseMon
- bit 2, a
+ CheckEventReuseA EVENT_GOT_STARTER
jr nz, .afterChooseMon
ld hl, OaksLabText40
call PrintText
@@ -794,42 +772,12 @@ OaksLabText41:
OaksLabText2:
text_asm
- ld a, STARTER2
- ld [wRivalStarterTemp], a
- ld a, $3
- ld [wRivalStarterBallSpriteIndex], a
- ld a, STARTER1
- ld b, $2
- jr OaksLabScript_1d133
-
-OaksLabText3:
- text_asm
- ld a, STARTER3
- ld [wRivalStarterTemp], a
- ld a, $4
- ld [wRivalStarterBallSpriteIndex], a
- ld a, STARTER2
- ld b, $3
- jr OaksLabScript_1d133
-
-OaksLabText4:
- text_asm
- ld a, STARTER1
- ld [wRivalStarterTemp], a
- ld a, $2
- ld [wRivalStarterBallSpriteIndex], a
- ld a, STARTER3
- ld b, $4
-
-OaksLabScript_1d133:
- ld [wcf91], a
- ld [wd11e], a
- ld a, b
- ld [wSpriteIndex], a
- CheckEvent EVENT_GOT_STARTER
- jp nz, OaksLabScript_1d22d
- CheckEventReuseA EVENT_OAK_ASKED_TO_CHOOSE_MON
- jr nz, OaksLabScript_1d157
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ CheckEvent EVENT_OAK_ASKED_TO_CHOOSE_MON
+ jr nz, OaksLabScript_1c9ac
+ ld a, $0
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, OaksLabText39
call PrintText
jp TextScriptEnd
@@ -838,209 +786,100 @@ OaksLabText39:
text_far _OaksLabText39
text_end
-OaksLabScript_1d157:
- ld a, $5
- ldh [hSpriteIndex], a
- ld a, SPRITESTATEDATA1_FACINGDIRECTION
- ldh [hSpriteDataOffset], a
- call GetPointerWithinSpriteStateData1
- ld [hl], SPRITE_FACING_DOWN
- ld a, $1
- ldh [hSpriteIndex], a
- ld a, SPRITESTATEDATA1_FACINGDIRECTION
- ldh [hSpriteDataOffset], a
- call GetPointerWithinSpriteStateData1
- ld [hl], SPRITE_FACING_RIGHT
- ld hl, wd730
- set 6, [hl]
- predef StarterDex
- ld hl, wd730
- res 6, [hl]
- call ReloadMapData
- ld c, 10
- call DelayFrames
- ld a, [wSpriteIndex]
- cp $2
- jr z, OaksLabLookAtCharmander
- cp $3
- jr z, OaksLabLookAtSquirtle
- jr OaksLabLookAtBulbasaur
-
-OaksLabLookAtCharmander:
- ld hl, OaksLabCharmanderText
- jr OaksLabMonChoiceMenu
-OaksLabCharmanderText:
- text_far _OaksLabCharmanderText
- text_end
-
-OaksLabLookAtSquirtle:
- ld hl, OaksLabSquirtleText
- jr OaksLabMonChoiceMenu
-OaksLabSquirtleText:
- text_far _OaksLabSquirtleText
- text_end
-
-OaksLabLookAtBulbasaur:
- ld hl, OaksLabBulbasaurText
- jr OaksLabMonChoiceMenu
-OaksLabBulbasaurText:
- text_far _OaksLabBulbasaurText
- text_end
-
-OaksLabMonChoiceMenu:
- call PrintText
- ld a, $1
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- call YesNoChoice ; yes/no menu
- ld a, [wCurrentMenuItem]
- and a
- jr nz, OaksLabMonChoiceEnd
- ld a, [wcf91]
- ld [wPlayerStarter], a
- ld [wd11e], a
- call GetMonName
- ld a, [wSpriteIndex]
- cp $2
- jr nz, .asm_1d1db
- ld a, HS_STARTER_BALL_1
- jr .asm_1d1e5
-.asm_1d1db
- cp $3
- jr nz, .asm_1d1e3
- ld a, HS_STARTER_BALL_2
- jr .asm_1d1e5
-.asm_1d1e3
- ld a, HS_STARTER_BALL_3
-.asm_1d1e5
- ld [wMissableObjectIndex], a
- predef HideObject
+OaksLabScript_1c9ac:
ld a, $1
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, OaksLabMonEnergeticText
- call PrintText
- ld hl, OaksLabReceivedMonText
- call PrintText
- xor a ; PLAYER_PARTY_DATA
- ld [wMonDataLocation], a
- ld a, 5
- ld [wCurEnemyLVL], a
- ld a, [wcf91]
- ld [wd11e], a
- call AddPartyMon
- ld hl, wd72e
- set 3, [hl]
- ld a, $fc
- ld [wJoyIgnore], a
+ ld [wEmotionBubbleSpriteIndex], a
+ xor a ; EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
ld a, $8
ld [wOaksLabCurScript], a
-OaksLabMonChoiceEnd:
- jp TextScriptEnd
-
-OaksLabMonEnergeticText:
- text_far _OaksLabMonEnergeticText
- text_end
-
-OaksLabReceivedMonText:
- text_far _OaksLabReceivedMonText
- sound_get_key_item
- text_end
-
-OaksLabScript_1d22d:
- ld a, $5
- ldh [hSpriteIndex], a
- ld a, SPRITESTATEDATA1_FACINGDIRECTION
- ldh [hSpriteDataOffset], a
- call GetPointerWithinSpriteStateData1
- ld [hl], SPRITE_FACING_DOWN
- ld hl, OaksLabLastMonText
- call PrintText
jp TextScriptEnd
-OaksLabLastMonText:
- text_far _OaksLabLastMonText
- text_end
-
-OaksLabText32:
-OaksLabText5:
+OaksLabText3:
text_asm
CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS
- jr nz, .asm_1d266
+ jr nz, .asm_1c9d9
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld a, [wNumSetBits]
cp 2
- jr c, .asm_1d279
- CheckEvent EVENT_GOT_POKEDEX
- jr z, .asm_1d279
-.asm_1d266
- ld hl, OaksLabText_1d31d
+ jr c, .asm_1c9ec
+.asm_1c9d9
+ ld hl, OaksLabText_1ca9f
call PrintText
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
predef DisplayDexRating
- jp .asm_1d2ed
-.asm_1d279
+ jp .asm_1ca6f
+.asm_1c9ec
ld b, POKE_BALL
call IsItemInBag
- jr nz, .asm_1d2e7
+ jr nz, .asm_1ca69
+ ld hl, wPokedexOwned
+ ld b, wPokedexOwnedEnd - wPokedexOwned
+ call CountSetBits
+ ld a, [wNumSetBits]
+ cp 2
+ jr nc, .asm_1ca69
CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE
- jr nz, .asm_1d2d0
+ jr nz, .asm_1ca52
CheckEvent EVENT_GOT_POKEDEX
- jr nz, .asm_1d2c8
+ jr nz, .asm_1ca4a
CheckEventReuseA EVENT_BATTLED_RIVAL_IN_OAKS_LAB
- jr nz, .asm_1d2a9
+ jr nz, .asm_1ca2b
ld a, [wd72e]
bit 3, a
- jr nz, .asm_1d2a1
- ld hl, OaksLabText_1d2f0
+ jr nz, .asm_1ca23
+ ld hl, OaksLabText_1ca72
call PrintText
- jr .asm_1d2ed
-.asm_1d2a1
- ld hl, OaksLabText_1d2f5
+ jr .asm_1ca6f
+.asm_1ca23
+ ld hl, OaksLabText_1ca77
call PrintText
- jr .asm_1d2ed
-.asm_1d2a9
+ jr .asm_1ca6f
+.asm_1ca2b
ld b, OAKS_PARCEL
call IsItemInBag
- jr nz, .asm_1d2b8
- ld hl, OaksLabText_1d2fa
+ jr nz, .asm_1ca3a
+ ld hl, OaksLabText_1ca7c
call PrintText
- jr .asm_1d2ed
-.asm_1d2b8
+ jr .asm_1ca6f
+.asm_1ca3a
ld hl, OaksLabDeliverParcelText
call PrintText
call OaksLabScript_RemoveParcel
- ld a, $f
+ ld a, $13
ld [wOaksLabCurScript], a
- jr .asm_1d2ed
-.asm_1d2c8
+ jr .asm_1ca6f
+.asm_1ca4a
ld hl, OaksLabAroundWorldText
call PrintText
- jr .asm_1d2ed
-.asm_1d2d0
+ jr .asm_1ca6f
+.asm_1ca52
CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK
- jr nz, .asm_1d2e7
+ jr nz, .asm_1ca69
lb bc, POKE_BALL, 5
call GiveItem
ld hl, OaksLabGivePokeballsText
call PrintText
- jr .asm_1d2ed
-.asm_1d2e7
+ jr .asm_1ca6f
+.asm_1ca69
ld hl, OaksLabPleaseVisitText
call PrintText
-.asm_1d2ed
+.asm_1ca6f
jp TextScriptEnd
-OaksLabText_1d2f0:
- text_far _OaksLabText_1d2f0
+OaksLabText_1ca72:
+ text_far _OaksLabPikachuText
text_end
-OaksLabText_1d2f5:
+OaksLabText_1ca77:
text_far _OaksLabText_1d2f5
text_end
-OaksLabText_1d2fa:
+OaksLabText_1ca7c:
text_far _OaksLabText_1d2fa
text_end
@@ -1064,36 +903,36 @@ OaksLabPleaseVisitText:
text_far _OaksLabPleaseVisitText
text_end
-OaksLabText_1d31d:
+OaksLabText_1ca9f:
text_far _OaksLabText_1d31d
text_end
-OaksLabText7:
-OaksLabText6:
+OaksLabText4:
+OaksLabText5:
text_asm
- ld hl, OaksLabText_1d32c
+ ld hl, OaksLabText_1caae
call PrintText
jp TextScriptEnd
-OaksLabText_1d32c:
+OaksLabText_1caae:
text_far _OaksLabText_1d32c
text_end
-OaksLabText8:
+OaksLabText6:
text_far _OaksLabText8
text_end
-OaksLabText9:
+OaksLabText7:
text_asm
- ld hl, OaksLabText_1d340
+ ld hl, OaksLabText_1cac2
call PrintText
jp TextScriptEnd
-OaksLabText_1d340:
+OaksLabText_1cac2:
text_far _OaksLabText_1d340
text_end
-OaksLabText17:
+OaksLabText13:
text_asm
ld hl, OaksLabRivalWaitingText
call PrintText
@@ -1103,7 +942,7 @@ OaksLabRivalWaitingText:
text_far _OaksLabRivalWaitingText
text_end
-OaksLabText18:
+OaksLabText14:
text_asm
ld hl, OaksLabChooseMonText
call PrintText
@@ -1113,7 +952,7 @@ OaksLabChooseMonText:
text_far _OaksLabChooseMonText
text_end
-OaksLabText19:
+OaksLabText15:
text_asm
ld hl, OaksLabRivalInterjectionText
call PrintText
@@ -1123,7 +962,7 @@ OaksLabRivalInterjectionText:
text_far _OaksLabRivalInterjectionText
text_end
-OaksLabText20:
+OaksLabText16:
text_asm
ld hl, OaksLabBePatientText
call PrintText
@@ -1133,38 +972,89 @@ OaksLabBePatientText:
text_far _OaksLabBePatientText
text_end
-OaksLabText12:
+OaksLabText17:
text_asm
- ld hl, OaksLabLeavingText
+ ld hl, OaksLabRivalTakesText1
+ call PrintText
+ ld hl, OaksLabRivalTakesText2
+ call PrintText
+ ld hl, OaksLabRivalTakesText3
+ call PrintText
+ ld hl, OaksLabRivalTakesText4
+ call PrintText
+ ld hl, OaksLabRivalTakesText5
call PrintText
jp TextScriptEnd
-OaksLabLeavingText:
- text_far _OaksLabLeavingText
+OaksLabRivalTakesText1:
+ text_far _OaksLabRivalTakesText1
text_end
-OaksLabText13:
+OaksLabRivalTakesText2:
+ text_far _OaksLabRivalTakesText2
+ sound_get_key_item
+ text_end
+
+OaksLabRivalTakesText3:
+ text_far _OaksLabRivalTakesText3
+ text_end
+
+OaksLabRivalTakesText4:
+ text_far _OaksLabRivalTakesText4
+ text_end
+
+OaksLabRivalTakesText5:
+ text_far _OaksLabRivalTakesText5
+ text_end
+
+OaksLabText18:
text_asm
- ld hl, OaksLabRivalPickingMonText
+ ld a, STARTER_PIKACHU
+ ld [wPlayerStarter], a
+ ld [wd11e], a
+ call GetMonName
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, OaksLabOakGivesText
+ call PrintText
+ ld hl, OaksLabRecievedText
call PrintText
+ xor a
+ ld [wMonDataLocation], a
+ ld a, 5
+ ld [wCurEnemyLVL], a
+ ld a, STARTER_PIKACHU
+ ld [wd11e], a
+ ld [wcf91], a
+ call AddPartyMon
+ ld a, 163
+ ld [wPartyMon1CatchRate], a
+ call DisablePikachuOverworldSpriteDrawing
+ SetEvent EVENT_GOT_STARTER
+ ld hl, wd72e
+ set 3, [hl]
jp TextScriptEnd
-OaksLabRivalPickingMonText:
- text_far _OaksLabRivalPickingMonText
+OaksLabOakGivesText:
+ text_far _OaksLabOakGivesText
text_end
-OaksLabText14:
+OaksLabRecievedText:
+ text_far _OaksLabReceivedText
+ sound_get_key_item
+ text_end
+
+OaksLabText10:
text_asm
- ld hl, OaksLabRivalReceivedMonText
+ ld hl, OaksLabLeavingText
call PrintText
jp TextScriptEnd
-OaksLabRivalReceivedMonText:
- text_far _OaksLabRivalReceivedMonText
- sound_get_key_item
+OaksLabLeavingText:
+ text_far _OaksLabLeavingText
text_end
-OaksLabText15:
+OaksLabText11:
text_asm
ld hl, OaksLabRivalChallengeText
call PrintText
@@ -1174,15 +1064,15 @@ OaksLabRivalChallengeText:
text_far _OaksLabRivalChallengeText
text_end
-OaksLabText_1d3be:
+OaksLabRivalDefeatedText:
text_far _OaksLabText_1d3be
text_end
-OaksLabText_1d3c3:
+OaksLabRivalBeatYouText:
text_far _OaksLabText_1d3c3
text_end
-OaksLabText16:
+OaksLabText12:
text_asm
ld hl, OaksLabRivalToughenUpText
call PrintText
@@ -1192,42 +1082,64 @@ OaksLabRivalToughenUpText:
text_far _OaksLabRivalToughenUpText
text_end
-OaksLabText21:
+OaksLabText26:
+ text_asm
+ ldpikacry e, PikachuCry2
+ callfar PlayPikachuSoundClip
+ ld hl, OaksLabPikachuDislikesPokeballsText1
+ call PrintText
+ jp TextScriptEnd
+
+OaksLabPikachuDislikesPokeballsText1:
+ text_far _OaksLabPikachuDislikesPokeballsText1
+ text_end
+
+OaksLabText27:
+ text_asm
+ ld hl, OaksLabPikachuDislikesPokeballsText2
+ call PrintText
+ jp TextScriptEnd
+
+OaksLabPikachuDislikesPokeballsText2:
+ text_far _OaksLabPikachuDislikesPokeballsText2
+ text_end
+
+OaksLabText19:
text_far _OaksLabText21
text_end
-OaksLabText22:
+OaksLabText20:
text_far _OaksLabText22
text_end
-OaksLabText23:
+OaksLabText21:
text_far _OaksLabText23
text_end
-OaksLabText24:
+OaksLabText22:
text_far _OaksLabText24
text_end
-OaksLabText25:
+OaksLabText23:
text_far _OaksLabText25
sound_get_key_item
text_end
-OaksLabText26:
+OaksLabText24:
text_far _OaksLabText26
text_end
-OaksLabText27:
+OaksLabText25:
text_far _OaksLabText27
text_end
-OaksLabText11:
-OaksLabText10:
+OaksLabText8:
+OaksLabText9:
text_asm
- ld hl, OaksLabText_1d405
+ ld hl, OaksLabText_1c31d
call PrintText
jp TextScriptEnd
-OaksLabText_1d405:
+OaksLabText_1c31d:
text_far _OaksLabText_1d405
text_end
diff --git a/scripts/OaksLab2.asm b/scripts/OaksLab2.asm
new file mode 100644
index 00000000..b0519827
--- /dev/null
+++ b/scripts/OaksLab2.asm
@@ -0,0 +1,28 @@
+Func_f1be0::
+ ld a, [wYCoord]
+ cp 3
+ jr z, .asm_f1bf0
+ ld b, SPRITE_FACING_DOWN
+ ld hl, Data_f1bf9
+ call TryApplyPikachuMovementData
+ ret
+
+.asm_f1bf0
+ ld b, SPRITE_FACING_LEFT
+ ld hl, Data_f1bfe
+ call TryApplyPikachuMovementData
+ ret
+
+Data_f1bf9:
+ db $00
+ db $1f
+ db $1e
+ db $38
+ db $3f
+
+Data_f1bfe:
+ db $00
+ db $1d
+ db $20
+ db $36
+ db $3f
diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm
index 5c26fc55..e7cc1f7a 100644
--- a/scripts/PalletTown.asm
+++ b/scripts/PalletTown.asm
@@ -16,25 +16,33 @@ PalletTown_ScriptPointers:
dw PalletTownScript4
dw PalletTownScript5
dw PalletTownScript6
+ dw PalletTownScript7
+ dw PalletTownScript8
+ dw PalletTownScript9
PalletTownScript0:
CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB
ret nz
ld a, [wYCoord]
- cp 1 ; is player near north exit?
+ cp 0 ; is player at north exit?
ret nz
+ ResetEvent EVENT_PLAYER_AT_RIGHT_EXIT_TO_PALLET_TOWN
+ ld a, [wXCoord]
+ cp 10
+ jr z, .asm_18e40
+ SetEventReuseHL EVENT_PLAYER_AT_RIGHT_EXIT_TO_PALLET_TOWN
+.asm_18e40
xor a
ldh [hJoyHeld], a
- ld a, PLAYER_DIR_DOWN
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
+ call StopAllMusic
ld a, BANK(Music_MeetProfOak)
ld c, a
ld a, MUSIC_MEET_PROF_OAK ; "oak appears" music
call PlayMusic
- ld a, $FC
- ld [wJoyIgnore], a
SetEvent EVENT_OAK_APPEARED_IN_PALLET
; trigger the next script
@@ -43,6 +51,8 @@ PalletTownScript0:
ret
PalletTownScript1:
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
xor a
ld [wcf0d], a
ld a, 1
@@ -50,23 +60,27 @@ PalletTownScript1:
call DisplayTextID
ld a, $FF
ld [wJoyIgnore], a
+ ld hl, wSprite01StateData2MapY
+ ld a, 8
+ ld [hli], a ; SPRITESTATEDATA2_MAPY
+ ld a, 14
+ ld [hl], a ; SPRITESTATEDATA2_MAPX
ld a, HS_PALLET_TOWN_OAK
ld [wMissableObjectIndex], a
predef ShowObject
; trigger the next script
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ ld a, SPRITE_FACING_UP
+ ld [wSprite01StateData1FacingDirection], a
ld a, 2
ld [wPalletTownCurScript], a
ret
PalletTownScript2:
- ld a, 1
- ldh [hSpriteIndex], a
- ld a, SPRITE_FACING_UP
- ldh [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
call Delay3
- ld a, 1
+ ld a, 0
ld [wYCoord], a
ld a, 1
ldh [hNPCPlayerRelativePosPerspective], a
@@ -81,8 +95,6 @@ PalletTownScript2:
ld a, 1 ; oak
ldh [hSpriteIndex], a
call MoveSprite
- ld a, $FF
- ld [wJoyIgnore], a
; trigger the next script
ld a, 3
@@ -93,19 +105,77 @@ PalletTownScript3:
ld a, [wd730]
bit 0, a
ret nz
- xor a ; ld a, SPRITE_FACING_DOWN
- ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
ld a, 1
ld [wcf0d], a
- ld a, $FC
- ld [wJoyIgnore], a
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ ld a, SPRITE_FACING_UP
+ ld [wSprite01StateData1FacingDirection], a
ld a, 1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
-; set up movement script that causes the player to follow Oak to his lab
+ ; oak faces the horizontally adjacent patch of grass to face pikachu
ld a, $FF
ld [wJoyIgnore], a
- ld a, 1
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ CheckEvent EVENT_PLAYER_AT_RIGHT_EXIT_TO_PALLET_TOWN
+ ld a, SPRITE_FACING_RIGHT
+ jr z, .asm_18f01
+ ld a, SPRITE_FACING_LEFT
+.asm_18f01
+ ld [wSprite01StateData1FacingDirection], a
+
+ ; trigger the next script
+ ld a, 4
+ ld [wPalletTownCurScript], a
+ ret
+
+PalletTownScript4:
+ ; start the pikachu battle
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ xor a
+ ld [wListScrollOffset], a
+ ld a, BATTLE_TYPE_PIKACHU
+ ld [wBattleType], a
+ ld a, STARTER_PIKACHU
+ ld [wCurOpponent], a
+ ld a, 5
+ ld [wCurEnemyLVL], a
+
+ ; trigger the next script
+ ld a, 5
+ ld [wPalletTownCurScript], a
+ ret
+
+PalletTownScript5:
+ ld a, $2
+ ld [wcf0d], a
+ ld a, $1
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ ld a, SPRITE_FACING_UP
+ ld [wSprite01StateData1FacingDirection], a
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, $ff
+ ld [wJoyIgnore], a
+
+ ; trigger the next script
+ ld a, 6
+ ld [wPalletTownCurScript], a
+ ret
+
+PalletTownScript6:
+ xor a
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $1
ld [wSpriteIndex], a
xor a
ld [wNPCMovementScriptFunctionNum], a
@@ -115,21 +185,21 @@ PalletTownScript3:
ld [wNPCMovementScriptBank], a
; trigger the next script
- ld a, 4
+ ld a, 7
ld [wPalletTownCurScript], a
ret
-PalletTownScript4:
+PalletTownScript7:
ld a, [wNPCMovementScriptPointerTableNum]
and a ; is the movement script over?
ret nz
; trigger the next script
- ld a, 5
+ ld a, 8
ld [wPalletTownCurScript], a
ret
-PalletTownScript5:
+PalletTownScript8:
CheckEvent EVENT_DAISY_WALKING
jr nz, .next
CheckBothEventsSet EVENT_GOT_TOWN_MAP, EVENT_ENTERED_BLUES_HOUSE, 1
@@ -145,7 +215,7 @@ PalletTownScript5:
CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK
ret z
SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2
-PalletTownScript6:
+PalletTownScript9:
ret
PalletTown_TextPointers:
@@ -156,6 +226,7 @@ PalletTown_TextPointers:
dw PalletTownText5
dw PalletTownText6
dw PalletTownText7
+ dw PalletTownText8
PalletTownText1:
text_asm
@@ -167,7 +238,13 @@ PalletTownText1:
ld hl, OakAppearsText
jr .done
.next
+ dec a
+ jr nz, .asm_18fd3
ld hl, OakWalksUpText
+ jr .done
+
+.asm_18fd3
+ ld hl, PalletTownText_19002
.done
call PrintText
jp TextScriptEnd
@@ -177,18 +254,27 @@ OakAppearsText:
text_asm
ld c, 10
call DelayFrames
- xor a
- ld [wEmotionBubbleSpriteIndex], a ; player's sprite
- ld [wWhichEmotionBubble], a ; EXCLAMATION_BUBBLE
- predef EmotionBubble
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
+ ld a, 0
+ ld [wEmotionBubbleSpriteIndex], a ; player's sprite
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
jp TextScriptEnd
OakWalksUpText:
text_far _OakWalksUpText
text_end
+PalletTownText_19002:
+ text_far _OakWhewText
+ text_end
+
+PalletTownText8:
+ text_far _OakGrassText
+ text_end
+
PalletTownText2: ; girl
text_far _PalletTownText2
text_end
@@ -202,8 +288,23 @@ PalletTownText4: ; sign by lab
text_end
PalletTownText5: ; sign by fence
+IF DEF(_DEBUG)
+ text_asm
+ ld a, 239
+ inc a
+ ld [wWhichPewterGuy], a
+ ld hl, PalletTownText_502b
+ call PrintText
+ jp TextScriptEnd
+
+PalletTownText_502b:
+ text_decimal wWhichPewterGuy, 1, 3
+ text "bit"
+ done
+ELSE
text_far _PalletTownText5
text_end
+ENDC
PalletTownText6: ; sign by Red's house
text_far _PalletTownText6
diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm
index 221834de..c1c2d190 100644
--- a/scripts/PewterCity.asm
+++ b/scripts/PewterCity.asm
@@ -1,8 +1,11 @@
PewterCity_Script:
call EnableAutoTextBoxDrawing
+ ld hl, wd492
+ res 7, [hl]
ld hl, PewterCity_ScriptPointers
ld a, [wPewterCityCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
PewterCity_ScriptPointers:
dw PewterCityScript0
@@ -30,7 +33,7 @@ ENDC
ld hl, CoordsData_19277
call ArePlayerCoordsInArray
ret nc
- ld a, $f0
+ ld a, $fc
ld [wJoyIgnore], a
ld a, $5
ldh [hSpriteIndexOrTextID], a
@@ -52,9 +55,9 @@ PewterCityScript1:
ld a, SPRITE_FACING_UP
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
- ld a, ($3 << 4) | SPRITE_FACING_UP
+ ld a, SPRITE_FACING_UP
ldh [hSpriteImageIndex], a
- call SetSpriteImageIndexAfterSettingFacingDirection
+ call SpriteFunc_34a1
call PlayDefaultMusic
ld hl, wFlags_0xcd60
set 4, [hl]
@@ -119,10 +122,7 @@ PewterCityScript4:
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_LEFT
ldh [hSpriteFacingDirection], a
- call SetSpriteFacingDirectionAndDelay
- ld a, ($1 << 4) | SPRITE_FACING_LEFT
- ldh [hSpriteImageIndex], a
- call SetSpriteImageIndexAfterSettingFacingDirection
+ call SpriteFunc_34a1
call PlayDefaultMusic
ld hl, wFlags_0xcd60
set 4, [hl]
diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm
index 798285d3..016535c2 100644
--- a/scripts/PewterGym.asm
+++ b/scripts/PewterGym.asm
@@ -14,7 +14,8 @@ PewterGym_Script:
.LoadNames:
ld hl, .CityName
ld de, .LeaderName
- jp LoadGymLeaderAndCityName
+ call LoadGymLeaderAndCityName
+ ret
.CityName:
db "PEWTER CITY@"
@@ -153,7 +154,7 @@ TM34NoRoomText:
ReceivedBoulderBadgeText:
text_far _ReceivedBoulderBadgeText
- sound_level_up ; probably supposed to play SFX_GET_ITEM_1 but the wrong music bank is loaded
+ sound_get_item_1
text_far _BrockBoulerBadgeInfoText ; Text to tell that the flash technique can be used
text_end
@@ -186,6 +187,9 @@ PewterGymGuideText:
ld a, [wCurrentMenuItem]
and a
jr nz, .PewterGymGuideBeginAdviceText
+ ld a, [wd472]
+ bit 7, a
+ jp nz, .asm_5c3fa
ld hl, PewterGymGuideBeginAdviceText
call PrintText
jr .PewterGymGuideAdviceText
@@ -201,6 +205,10 @@ PewterGymGuideText:
call PrintText
.done
jp TextScriptEnd
+.asm_5c3fa
+ ld hl, PewterGymText_5c41c
+ call PrintText
+ jp TextScriptEnd
PewterGymGuidePreAdviceText:
text_far _PewterGymGuidePreAdviceText
@@ -221,3 +229,7 @@ PewterGymText_5c524:
PewterGymGuidePostBattleText:
text_far _PewterGymGuidePostBattleText
text_end
+
+PewterGymText_5c41c:
+ text_far _PewterGymGuyText
+ text_end
diff --git a/scripts/PewterNidoranHouse.asm b/scripts/PewterNidoranHouse.asm
index 93d430c0..77fb12c0 100644
--- a/scripts/PewterNidoranHouse.asm
+++ b/scripts/PewterNidoranHouse.asm
@@ -1,5 +1,6 @@
PewterNidoranHouse_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
PewterNidoranHouse_TextPointers:
dw PewterHouse1Text1
diff --git a/scripts/PewterPokecenter.asm b/scripts/PewterPokecenter.asm
index 5030244c..247ecb03 100644
--- a/scripts/PewterPokecenter.asm
+++ b/scripts/PewterPokecenter.asm
@@ -1,12 +1,17 @@
PewterPokecenter_Script:
+ ld hl, wd492
+ set 7, [hl]
call Serial_TryEstablishingExternallyClockedConnection
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
PewterPokecenter_TextPointers:
dw PewterHealNurseText
dw PewterPokecenterText2
dw PewterJigglypuffText
dw PewterTradeNurseText
+ dw PewterPokecenterText5
+ dw PewterPokecenterText6
PewterHealNurseText:
script_pokecenter_nurse
@@ -17,70 +22,18 @@ PewterPokecenterText2:
PewterJigglypuffText:
text_asm
- ld a, TRUE
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, .JigglypuffText
- call PrintText
-
- ld a, SFX_STOP_ALL_MUSIC
- call PlaySound
- ld c, 32
- call DelayFrames
-
- ld hl, JigglypuffFacingDirections
- ld de, wJigglypuffFacingDirections
- ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
- call CopyData
-
- ld a, [wSprite03StateData1ImageIndex]
- ld hl, wJigglypuffFacingDirections
-.findMatchingFacingDirectionLoop
- cp [hl]
- inc hl
- jr nz, .findMatchingFacingDirectionLoop
- dec hl
-
- push hl
- ld c, BANK(Music_JigglypuffSong)
- ld a, MUSIC_JIGGLYPUFF_SONG
- call PlayMusic
- pop hl
-
-.spinMovementLoop
- ld a, [hl]
- ld [wSprite03StateData1ImageIndex], a
-; rotate the array
- push hl
- ld hl, wJigglypuffFacingDirections
- ld de, wJigglypuffFacingDirections - 1
- ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
- call CopyData
- ld a, [wJigglypuffFacingDirections - 1]
- ld [wJigglypuffFacingDirections + 3], a
- pop hl
- ld c, 24
- call DelayFrames
- ld a, [wChannelSoundIDs]
- ld b, a
- ld a, [wChannelSoundIDs + Ch2]
- or b
- jr nz, .spinMovementLoop
-
- ld c, 48
- call DelayFrames
- call PlayDefaultMusic
+ farcall PewterJigglypuff
jp TextScriptEnd
-.JigglypuffText:
- text_far _PewterJigglypuffText
- text_end
-
-JigglypuffFacingDirections:
- db $30 | SPRITE_FACING_DOWN
- db $30 | SPRITE_FACING_LEFT
- db $30 | SPRITE_FACING_UP
- db $30 | SPRITE_FACING_RIGHT
-JigglypuffFacingDirectionsEnd:
-
PewterTradeNurseText:
script_cable_club_receptionist
+
+PewterPokecenterText5:
+ text_asm
+ farcall Func_f1d98
+ jp TextScriptEnd
+
+PewterPokecenterText6:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/PewterPokecenter2.asm b/scripts/PewterPokecenter2.asm
new file mode 100644
index 00000000..79d22b2f
--- /dev/null
+++ b/scripts/PewterPokecenter2.asm
@@ -0,0 +1,79 @@
+Func_f1d98::
+ ld hl, PewterPokecenterText_f1d9f
+ call PrintText
+ ret
+
+PewterPokecenterText_f1d9f:
+ text_far _PewterPokecenterText3
+ text_end
+
+PewterJigglypuff::
+ ld a, TRUE
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .JigglypuffText
+ call PrintText
+
+ call StopAllMusic
+ ld c, 32
+ call DelayFrames
+
+ ld hl, JigglypuffFacingDirections
+ ld de, wJigglypuffFacingDirections
+ ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
+ call CopyData
+
+ ld a, [wSprite03StateData1ImageIndex]
+ ld hl, wJigglypuffFacingDirections
+.findMatchingFacingDirectionLoop
+ cp [hl]
+ inc hl
+ jr nz, .findMatchingFacingDirectionLoop
+ dec hl
+
+ push hl
+ ld c, BANK(Music_JigglypuffSong)
+ ld a, MUSIC_JIGGLYPUFF_SONG
+ call PlayMusic
+ pop hl
+
+.spinMovementLoop
+ ld a, [hl]
+ ld [wSprite03StateData1ImageIndex], a
+; rotate the array
+ push hl
+ ld hl, wJigglypuffFacingDirections
+ ld de, wJigglypuffFacingDirections - 1
+ ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
+ call CopyData
+ ld a, [wJigglypuffFacingDirections - 1]
+ ld [wJigglypuffFacingDirections + 3], a
+ pop hl
+ ld c, 24
+ call DelayFrames
+ ld a, [wChannelSoundIDs]
+ ld b, a
+ ld a, [wChannelSoundIDs + Ch2]
+ or b
+ jr nz, .spinMovementLoop
+
+ ld c, 48
+ call DelayFrames
+ call PlayDefaultMusic
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ callfar CheckPikachuFaintedOrStatused
+ ret c
+ call DisablePikachuFollowingPlayer
+ ret
+
+.JigglypuffText:
+ text_far _PewterJigglypuffText
+ text_end
+
+JigglypuffFacingDirections:
+ db $40 | SPRITE_FACING_DOWN
+ db $40 | SPRITE_FACING_LEFT
+ db $40 | SPRITE_FACING_UP
+ db $40 | SPRITE_FACING_RIGHT
+JigglypuffFacingDirectionsEnd:
diff --git a/scripts/PokemonFanClub.asm b/scripts/PokemonFanClub.asm
index 717ba4bb..e8e68a7f 100644
--- a/scripts/PokemonFanClub.asm
+++ b/scripts/PokemonFanClub.asm
@@ -1,15 +1,72 @@
PokemonFanClub_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ld hl, PokemonFanClub_ScriptPointers
+ ld a, [wFanClubCurScript]
+ call CallFunctionInTable
+ ret
-FanClubBikeInBag:
-; check if any bike paraphernalia in bag
- CheckEvent EVENT_GOT_BIKE_VOUCHER
- ret nz
- ld b, BICYCLE
- call IsItemInBag
- ret nz
- ld b, BIKE_VOUCHER
- jp IsItemInBag
+PokemonFanClub_ScriptPointers:
+ dw FanClubScript1
+ dw FanClubScript2
+
+FanClubScript1:
+ ld hl, wd492
+ bit 7, [hl]
+ call z, FanClubScript_59a44
+ ld hl, wd492
+ set 7, [hl]
+ ret
+
+FanClubScript2:
+ ld hl, wd492
+ bit 7, [hl]
+ call z, FanClubScript_59a39
+ ld hl, wd492
+ set 7, [hl]
+ ret
+
+FanClubScript_59a39:
+ call Random
+ ldh a, [hRandomAdd]
+ cp 25
+ call c, FanClubScript_59a44
+ ret
+
+FanClubScript_59a44:
+ ld a, [wd472]
+ bit 7, a
+ ret z
+ callfar CheckPikachuFaintedOrStatused
+ ret c
+ ld a, $1
+ ld [wFanClubCurScript], a
+ xor a
+ ld [wPlayerMovingDirection], a
+ call UpdateSprites
+ call UpdateSprites
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ ld a, $f ; Pikachu
+ ld [wEmotionBubbleSpriteIndex], a
+ predef EmotionBubble
+ ld hl, PikachuMovementScript_59a8c
+ call ApplyPikachuMovementData
+ ld a, $2
+ ld [wSprite03StateData1MovementStatus], a ; Seel
+ xor a ; SPRITE_FACING_DOWN
+ ld [wSprite03StateData1FacingDirection], a
+ callfar InitializePikachuTextID
+ call DisablePikachuFollowingPlayer
+ ret
+
+PikachuMovementScript_59a8c:
+ db $00
+ db $26
+ db $20
+ db $20
+ db $20
+ db $1e
+ db $3f
PokemonFanClub_TextPointers:
dw FanClubText1
@@ -18,22 +75,28 @@ PokemonFanClub_TextPointers:
dw FanClubText4
dw FanClubText5
dw FanClubText6
- dw FanClubText7
- dw FanClubText8
FanClubText1:
-; pikachu fan
+; clefairy fan
text_asm
- CheckEvent EVENT_PIKACHU_FAN_BOAST
+ CheckEventHL EVENT_152
+ jr z, .asm_59aaf
+ ld hl, .yellowtext
+ call PrintText
+ jr .done
+
+.asm_59aaf
+ CheckEventReuseHL EVENT_PIKACHU_FAN_BOAST
jr nz, .mineisbetter
+ SetEventReuseHL EVENT_SEEL_FAN_BOAST
ld hl, .normaltext
call PrintText
- SetEvent EVENT_SEEL_FAN_BOAST
jr .done
+
.mineisbetter
+ ResetEventReuseHL EVENT_PIKACHU_FAN_BOAST
ld hl, .bettertext
call PrintText
- ResetEvent EVENT_PIKACHU_FAN_BOAST
.done
jp TextScriptEnd
@@ -45,19 +108,29 @@ FanClubText1:
text_far PikachuFanBetterText
text_end
+.yellowtext
+ text_far PikachuFanPrintText
+ text_end
+
FanClubText2:
; seel fan
text_asm
- CheckEvent EVENT_SEEL_FAN_BOAST
+ CheckEventHL EVENT_152
+ jr z, .asm_59ae7
+ ld hl, .yellowtext
+ call PrintText
+ jr .done
+.asm_59ae7
+ CheckEventReuseHL EVENT_SEEL_FAN_BOAST
jr nz, .mineisbetter
+ SetEventReuseHL EVENT_PIKACHU_FAN_BOAST
ld hl, .normaltext
call PrintText
- SetEvent EVENT_PIKACHU_FAN_BOAST
jr .done
.mineisbetter
+ ResetEventReuseHL EVENT_SEEL_FAN_BOAST
ld hl, .bettertext
call PrintText
- ResetEvent EVENT_SEEL_FAN_BOAST
.done
jp TextScriptEnd
@@ -69,12 +142,16 @@ FanClubText2:
text_far SeelFanBetterText
text_end
+.yellowtext
+ text_far SeelFanPrintText
+ text_end
+
FanClubText3:
; pikachu
text_asm
ld hl, .text
call PrintText
- ld a, PIKACHU
+ ld a, CLEFAIRY
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd
@@ -100,9 +177,20 @@ FanClubText4:
FanClubText5:
; chair
text_asm
- call FanClubBikeInBag
- jr nz, .nothingleft
+ CheckEventHL EVENT_152
+ jr z, .check_bike_voucher
+ ld hl, Text_59c1f
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr z, .select_mon_to_print
+ ld hl, Text_59c24
+ jr .gbpals_print_text
+.check_bike_voucher
+ CheckEvent EVENT_GOT_BIKE_VOUCHER
+ jr nz, .nothingleft
ld hl, .meetchairtext
call PrintText
call YesNoChoice
@@ -119,21 +207,58 @@ FanClubText5:
ld hl, .receivedvouchertext
call PrintText
SetEvent EVENT_GOT_BIKE_VOUCHER
- jr .done
+ jp TextScriptEnd
.bag_full
ld hl, .bagfulltext
- call PrintText
- jr .done
+ jr .gbpals_print_text
.nothanks
ld hl, .nostorytext
- call PrintText
- jr .done
+ jr .gbpals_print_text
.nothingleft
ld hl, .finaltext
+.gbpals_print_text
+ push hl
+ call LoadGBPal
+ pop hl
call PrintText
-.done
jp TextScriptEnd
+.select_mon_to_print
+ call GBPalWhiteOutWithDelay3
+ call LoadCurrentMapView
+ call SaveScreenTilesToBuffer2
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ ld a, $00
+ ld [wTempTilesetNumTiles], a
+ call DisplayPartyMenu
+ jp nc, .print
+ call GBPalWhiteOutWithDelay3
+ call RestoreScreenTilesAndReloadTilePatterns
+ ld hl, Text_59c24
+ jr .gbpals_print_text
+
+.print
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ld hl, wd730
+ set 6, [hl]
+ callfar PrintFanClubPortrait
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, Text_59c2e
+ ldh a, [hOaksAideResult]
+ and a
+ jr nz, .gbpals_print_text
+ ld hl, Text_59c29
+ jr .gbpals_print_text
+
.meetchairtext
text_far FanClubMeetChairText
text_end
@@ -160,14 +285,22 @@ FanClubText5:
text_far FanClubBagFullText
text_end
-FanClubText6:
- text_far _FanClubText6
+Text_59c1f:
+ text_far FanClubChairPrintText1
+ text_end
+
+Text_59c24:
+ text_far FanClubChairPrintText2
+ text_end
+
+Text_59c29:
+ text_far FanClubChairPrintText3
text_end
-FanClubText7:
- text_far _FanClubText7
+Text_59c2e:
+ text_far FanClubChairPrintText4
text_end
-FanClubText8:
- text_far _FanClubText8
+FanClubText6:
+ text_far _FanClubText6
text_end
diff --git a/scripts/PokemonTower1F.asm b/scripts/PokemonTower1F.asm
index 65614523..0870364c 100644
--- a/scripts/PokemonTower1F.asm
+++ b/scripts/PokemonTower1F.asm
@@ -1,5 +1,6 @@
PokemonTower1F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
PokemonTower1F_TextPointers:
dw PokemonTower1Text1
diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm
index be3b5b89..b9a46f85 100644
--- a/scripts/PokemonTower2F.asm
+++ b/scripts/PokemonTower2F.asm
@@ -26,9 +26,7 @@ ENDC
ld hl, CoordsData_6055e
call ArePlayerCoordsInArray
ret nc
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -75,14 +73,13 @@ PokemonTower2Script1:
ld de, MovementData_605b2
CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT
jr nz, .asm_60589
+ callfar Func_f1e22
ld de, MovementData_605a9
.asm_60589
ld a, $1
ldh [hSpriteIndex], a
call MoveSprite
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld a, $2
ld [wPokemonTower2FCurScript], a
@@ -148,21 +145,8 @@ PokemonTower2Text1:
call SaveEndBattleTextPointers
ld a, OPP_RIVAL2
ld [wCurOpponent], a
-
- ; select which team to use during the encounter
ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .NotSquirtle
- ld a, $4
- jr .done
-.NotSquirtle
- cp STARTER3
- jr nz, .Charmander
- ld a, $5
- jr .done
-.Charmander
- ld a, $6
-.done
+ add $1
ld [wTrainerNo], a
ld a, $1
diff --git a/scripts/PokemonTower2F_2.asm b/scripts/PokemonTower2F_2.asm
new file mode 100644
index 00000000..0dfbb965
--- /dev/null
+++ b/scripts/PokemonTower2F_2.asm
@@ -0,0 +1,12 @@
+Func_f1e22::
+ ld hl, PikachuMovementData_f1e2b
+ ld b, SPRITE_FACING_RIGHT
+ call TryApplyPikachuMovementData
+ ret
+
+PikachuMovementData_f1e2b:
+ db $00
+ db $1d
+ db $1f
+ db $38
+ db $3f
diff --git a/scripts/PokemonTower7F.asm b/scripts/PokemonTower7F.asm
index 5ed5aabd..984322b6 100644
--- a/scripts/PokemonTower7F.asm
+++ b/scripts/PokemonTower7F.asm
@@ -1,69 +1,238 @@
PokemonTower7F_Script:
call EnableAutoTextBoxDrawing
- ld hl, PokemonTower7TrainerHeaders
- ld de, PokemonTower7F_ScriptPointers
+ ld hl, PokemonTower7F_ScriptPointers
ld a, [wPokemonTower7FCurScript]
- call ExecuteCurMapScriptInTable
- ld [wPokemonTower7FCurScript], a
+ call CallFunctionInTable
ret
-PokemonTower7Script_60d18:
+PokemonTower7Script_60d01:
xor a
ld [wJoyIgnore], a
+PokemonTower7Script_60d05:
ld [wPokemonTower7FCurScript], a
- ld [wCurMapScript], a
ret
PokemonTower7F_ScriptPointers:
- dw CheckFightingMapTrainers
- dw DisplayEnemyTrainerTextAndStartBattle
+ dw PokemonTower7Script0
+ dw PokemonTower7Script1
dw PokemonTower7Script2
dw PokemonTower7Script3
dw PokemonTower7Script4
+ dw PokemonTower7Script5
+ dw PokemonTower7Script6
+ dw PokemonTower7Script7
+ dw PokemonTower7Script8
+ dw PokemonTower7Script9
+ dw PokemonTower7Script10
+ dw PokemonTower7Script11
-PokemonTower7Script2:
- ld hl, wFlags_0xcd60
- res 0, [hl]
- ld a, [wIsInBattle]
- cp $ff
- jp z, PokemonTower7Script_60d18
- call EndTrainerBattle
- ld a, $f0
+PokemonTower7Script0:
+IF DEF(_DEBUG)
+ call DebugPressedOrHeldB
+ ret nz
+ENDC
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
+ call z, PokemonTower7Script_60d2a
+ ret
+
+PokemonTower7Script_60d2a:
+ ld a, [wYCoord]
+ cp $c
+ ret nz
+ ResetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ ld a, [wXCoord]
+ cp $a
+ jr z, .asm_60d47
+ ld a, [wXCoord] ; why?
+ cp $b
+ ret nz
+ SetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+.asm_60d47
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
ld [wJoyIgnore], a
- ld a, [wSpriteIndex]
+ ld a, HS_POKEMON_TOWER_7F_JESSIE
+ call PokemonTower7Script_60eaf
+ ld a, HS_POKEMON_TOWER_7F_JAMES
+ call PokemonTower7Script_60eaf
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $4
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- call PokemonTower7Script_60db6
- ld a, $3
- ld [wPokemonTower7FCurScript], a
- ld [wCurMapScript], a
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $1
+ call PokemonTower7Script_60d05
ret
+PokemonTower7MovementData_60d7a:
+ db $4
+PokemonTower7MovementData_60d7b:
+ db $4
+ db $4
+ db $4
+ db $FF
+
+PokemonTower7Script1:
+ ld de, PokemonTower7MovementData_60d7b
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60d8c
+ ld de, PokemonTower7MovementData_60d7a
+.asm_60d8c
+ ld a, $1
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $2
+ call PokemonTower7Script_60d05
+ ret
+
+PokemonTower7Script2:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
PokemonTower7Script3:
+ ld a, $0
+ ld [wSprite01StateData1FacingDirection], a
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60dba
+ ld a, $c
+ ld [wSprite01StateData1FacingDirection], a
+.asm_60dba
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+PokemonTower7Script4:
+ ld de, PokemonTower7MovementData_60d7a
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60dcc
+ ld de, PokemonTower7MovementData_60d7b
+.asm_60dcc
+ ld a, $2
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $5
+ call PokemonTower7Script_60d05
+ ret
+PokemonTower7Script5:
+ ld a, $ff
+ ld [wJoyIgnore], a
ld a, [wd730]
bit 0, a
ret nz
- ld hl, wMissableObjectList
- ld a, [wSpriteIndex]
- ld b, a
-.missableObjectsListLoop
- ld a, [hli]
- cp b ; search for sprite ID in missing objects list
- ld a, [hli]
- jr nz, .missableObjectsListLoop
- ld [wMissableObjectIndex], a ; remove missable object
- predef HideObject
+PokemonTower7Script6:
+ ld a, $2
+ ld [wSprite02StateData1MovementStatus], a
+ ld a, $8
+ ld [wSprite02StateData1FacingDirection], a
+ CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_1
+ jr z, .asm_60dff
+ ld a, $0
+ ld [wSprite02StateData1FacingDirection], a
+.asm_60dff
+ call Delay3
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $5
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+PokemonTower7Script7:
+ ld hl, wd72d
+ set 6, [hl]
+ set 7, [hl]
+ ld hl, PokemonTower7JessieJamesEndBattleText
+ ld de, PokemonTower7JessieJamesEndBattleText
+ call SaveEndBattleTextPointers
+ ld a, OPP_ROCKET
+ ld [wCurOpponent], a
+ ld a, $2c
+ ld [wTrainerNo], a
xor a
+ ldh [hJoyHeld], a
ld [wJoyIgnore], a
- ld [wSpriteIndex], a
- ld [wTrainerHeaderFlagBit], a
- ld [wUnusedDA38], a
+ ld a, $8
+ call PokemonTower7Script_60d05
+ ret
+
+PokemonTower7Script8:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wIsInBattle]
+ cp $ff
+ jp z, PokemonTower7Script_60d01
+ ld a, $2
+ ld [wSprite01StateData1MovementStatus], a
+ ld [wSprite02StateData1MovementStatus], a
+ xor a
+ ld [wSprite01StateData1FacingDirection], a
+ ld [wSprite02StateData1FacingDirection], a
+ ld a, $FF ^ (A_BUTTON | B_BUTTON)
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $6
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $9
+ call PokemonTower7Script_60d05
+ ret
+
+PokemonTower7Script9:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ call GBFadeOutToBlack
+ ld a, HS_POKEMON_TOWER_7F_JESSIE
+ call PokemonTower7Script_60ebe
+ ld a, HS_POKEMON_TOWER_7F_JAMES
+ call PokemonTower7Script_60ebe
+ call UpdateSprites
+ call Delay3
+ call GBFadeInFromBlack
+ ld a, $a
+ call PokemonTower7Script_60d05
+ ret
+
+PokemonTower7Script10:
+ call PlayDefaultMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ SetEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0
ld a, $0
- ld [wPokemonTower7FCurScript], a
- ld [wCurMapScript], a
+ call PokemonTower7Script_60d05
ret
-PokemonTower7Script4:
+PokemonTower7Script_60eaf:
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ call UpdateSprites
+ call Delay3
+ ret
+
+PokemonTower7Script_60ebe:
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ret
+
+PokemonTower7Script11:
ld a, $ff
ld [wJoyIgnore], a
ld a, HS_POKEMON_TOWER_7F_MR_FUJI
@@ -81,148 +250,54 @@ PokemonTower7Script4:
set 3, [hl]
ld a, $0
ld [wPokemonTower7FCurScript], a
- ld [wCurMapScript], a
ret
-PokemonTower7Script_60db6:
- ld hl, CoordsData_60de3
- ld a, [wSpriteIndex]
- dec a
- swap a
- ld d, $0
- ld e, a
- add hl, de
- ld a, [wYCoord]
- ld b, a
- ld a, [wXCoord]
- ld c, a
-.asm_60dcb
- ld a, [hli]
- cp b
- jr nz, .asm_60dde
- ld a, [hli]
- cp c
- jr nz, .asm_60ddf
- ld a, [hli]
- ld d, [hl]
- ld e, a
- ld a, [wSpriteIndex]
- ldh [hSpriteIndex], a
- jp MoveSprite
-.asm_60dde
- inc hl
-.asm_60ddf
- inc hl
- inc hl
- jr .asm_60dcb
-
-CoordsData_60de3:
- map_coord_movement 9, 12, MovementData_60e13
- map_coord_movement 10, 11, MovementData_60e1b
- map_coord_movement 11, 11, MovementData_60e22
- map_coord_movement 12, 11, MovementData_60e22
- map_coord_movement 12, 10, MovementData_60e28
- map_coord_movement 11, 9, MovementData_60e30
- map_coord_movement 10, 9, MovementData_60e22
- map_coord_movement 9, 9, MovementData_60e22
- map_coord_movement 9, 8, MovementData_60e37
- map_coord_movement 10, 7, MovementData_60e22
- map_coord_movement 11, 7, MovementData_60e22
- map_coord_movement 12, 7, MovementData_60e22
-
-MovementData_60e13:
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_LEFT
- db -1 ; end
-
-MovementData_60e1b:
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db -1 ; end
-
-MovementData_60e22:
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db -1 ; end
-
-MovementData_60e28:
- db NPC_MOVEMENT_LEFT
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db -1 ; end
-
-MovementData_60e30:
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_LEFT
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db -1 ; end
-
-MovementData_60e37:
- db NPC_MOVEMENT_RIGHT
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db NPC_MOVEMENT_DOWN
- db -1 ; end
-
PokemonTower7F_TextPointers:
dw PokemonTower7Text1
dw PokemonTower7Text2
dw PokemonTower7Text3
- dw PokemonTower7FujiText
-
-PokemonTower7TrainerHeaders:
- def_trainers
-PokemonTower7TrainerHeader0:
- trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_0, 3, PokemonTower7BattleText1, PokemonTower7EndBattleText1, PokemonTower7AfterBattleText1
-PokemonTower7TrainerHeader1:
- trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_1, 3, PokemonTower7BattleText2, PokemonTower7EndBattleText2, PokemonTower7AfterBattleText2
-PokemonTower7TrainerHeader2:
- trainer EVENT_BEAT_POKEMONTOWER_7_TRAINER_2, 3, PokemonTower7BattleText3, PokemonTower7EndBattleText3, PokemonTower7AfterBattleText3
- db -1 ; end
+ dw PokemonTower7Text4
+ dw PokemonTower7Text5
+ dw PokemonTower7Text6
PokemonTower7Text1:
- text_asm
- ld hl, PokemonTower7TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
PokemonTower7Text2:
+ text_end
+
+PokemonTower7Text4:
+ text_far _PokemonTowerJessieJamesText1
text_asm
- ld hl, PokemonTower7TrainerHeader1
- call TalkToTrainer
+ ld c, 10
+ call DelayFrames
+ ld a, PLAYER_DIR_UP
+ ld [wPlayerMovingDirection], a
+ ld a, $0
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ ld c, 20
+ call DelayFrames
jp TextScriptEnd
-PokemonTower7Text3:
+PokemonTower7Text5:
+ text_far _PokemonTowerJessieJamesText2
+ text_end
+
+PokemonTower7JessieJamesEndBattleText:
+ text_far _PokemonTowerJessieJamesText3
+ text_end
+
+PokemonTower7Text6:
+ text_far _PokemonTowerJessieJamesText4
text_asm
- ld hl, PokemonTower7TrainerHeader2
- call TalkToTrainer
+ ld c, 64
+ call DelayFrames
jp TextScriptEnd
-PokemonTower7FujiText:
+PokemonTower7Text3:
text_asm
- ld hl, TowerRescueFujiText
+ ld hl, PokemonTower7Text_60f75
call PrintText
SetEvent EVENT_RESCUED_MR_FUJI
SetEvent EVENT_RESCUED_MR_FUJI_2
@@ -235,47 +310,10 @@ PokemonTower7FujiText:
ld a, HS_SAFFRON_CITY_F
ld [wMissableObjectIndex], a
predef ShowObject
- ld a, $4
+ ld a, $b
ld [wPokemonTower7FCurScript], a
- ld [wCurMapScript], a
jp TextScriptEnd
-TowerRescueFujiText:
+PokemonTower7Text_60f75:
text_far _TowerRescueFujiText
text_end
-
-PokemonTower7BattleText1:
- text_far _PokemonTower7BattleText1
- text_end
-
-PokemonTower7EndBattleText1:
- text_far _PokemonTower7EndBattleText1
- text_end
-
-PokemonTower7AfterBattleText1:
- text_far _PokemonTower7AfterBattleText1
- text_end
-
-PokemonTower7BattleText2:
- text_far _PokemonTower7BattleText2
- text_end
-
-PokemonTower7EndBattleText2:
- text_far _PokemonTower7EndBattleText2
- text_end
-
-PokemonTower7AfterBattleText2:
- text_far _PokemonTower7AfterBattleText2
- text_end
-
-PokemonTower7BattleText3:
- text_far _PokemonTower7BattleText3
- text_end
-
-PokemonTower7EndBattleText3:
- text_far _PokemonTower7EndBattleText3
- text_end
-
-PokemonTower7AfterBattleText3:
- text_far _PokemonTower7AfterBattleText3
- text_end
diff --git a/scripts/RedsHouse1F.asm b/scripts/RedsHouse1F.asm
index bdeb96d7..4af4a2e6 100644
--- a/scripts/RedsHouse1F.asm
+++ b/scripts/RedsHouse1F.asm
@@ -1,5 +1,6 @@
RedsHouse1F_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
RedsHouse1F_TextPointers:
dw RedsHouse1FMomText
@@ -7,63 +8,10 @@ RedsHouse1F_TextPointers:
RedsHouse1FMomText:
text_asm
- ld a, [wd72e]
- bit 3, a ; received a Pokémon from Oak?
- jr nz, .heal
- ld hl, MomWakeUpText
- call PrintText
- jr .done
-.heal
- call MomHealPokemon
-.done
+ callfar Func_f1b73
jp TextScriptEnd
-MomWakeUpText:
- text_far _MomWakeUpText
- text_end
-
-MomHealPokemon:
- ld hl, MomHealText1
- call PrintText
- call GBFadeOutToWhite
- call ReloadMapData
- predef HealParty
- ld a, MUSIC_PKMN_HEALED
- ld [wNewSoundID], a
- call PlaySound
-.next
- ld a, [wChannelSoundIDs]
- cp MUSIC_PKMN_HEALED
- jr z, .next
- ld a, [wMapMusicSoundID]
- ld [wNewSoundID], a
- call PlaySound
- call GBFadeInFromWhite
- ld hl, MomHealText2
- jp PrintText
-
-MomHealText1:
- text_far _MomHealText1
- text_end
-MomHealText2:
- text_far _MomHealText2
- text_end
-
RedsHouse1FTVText:
text_asm
- ld a, [wSpritePlayerStateData1FacingDirection]
- cp SPRITE_FACING_UP
- ld hl, TVWrongSideText
- jr nz, .got_text
- ld hl, StandByMeText
-.got_text
- call PrintText
+ callfar Func_f1bc4
jp TextScriptEnd
-
-StandByMeText:
- text_far _StandByMeText
- text_end
-
-TVWrongSideText:
- text_far _TVWrongSideText
- text_end
diff --git a/scripts/RedsHouse1F2.asm b/scripts/RedsHouse1F2.asm
new file mode 100644
index 00000000..fc4a5cdb
--- /dev/null
+++ b/scripts/RedsHouse1F2.asm
@@ -0,0 +1,57 @@
+Func_f1b73::
+ ld a, [wd72e]
+ bit 3, a ; received a Pokémon from Oak?
+ jp nz, MomHealPokemon
+ ld hl, MomWakeUpText
+ call PrintText
+ ret
+
+MomWakeUpText:
+ text_far _MomWakeUpText
+ text_end
+
+MomHealPokemon:
+ ld hl, MomHealText1
+ call PrintText
+ call GBFadeOutToWhite
+ call ReloadMapData
+ predef HealParty
+ ld a, MUSIC_PKMN_HEALED
+ ld [wNewSoundID], a
+ call PlaySound
+.next
+ ld a, [wChannelSoundIDs]
+ cp MUSIC_PKMN_HEALED
+ jr z, .next
+ ld a, [wMapMusicSoundID]
+ ld [wNewSoundID], a
+ call PlaySound
+ call GBFadeInFromWhite
+ ld hl, MomHealText2
+ call PrintText
+ ret
+
+MomHealText1:
+ text_far _MomHealText1
+ text_end
+MomHealText2:
+ text_far _MomHealText2
+ text_end
+
+Func_f1bc4::
+ ld hl, TVWrongSideText
+ ld a, [wSpritePlayerStateData1FacingDirection]
+ cp SPRITE_FACING_UP
+ jp nz, .got_text
+ ld hl, StandByMeText
+.got_text
+ call PrintText
+ ret
+
+StandByMeText:
+ text_far _StandByMeText
+ text_end
+
+TVWrongSideText:
+ text_far _TVWrongSideText
+ text_end
diff --git a/scripts/RedsHouse2F.asm b/scripts/RedsHouse2F.asm
index b44b9f98..4eb465c4 100644
--- a/scripts/RedsHouse2F.asm
+++ b/scripts/RedsHouse2F.asm
@@ -1,23 +1,22 @@
RedsHouse2F_Script:
call EnableAutoTextBoxDrawing
ld hl, RedsHouse2F_ScriptPointers
- ld a, [wRedsHouse2FCurScript]
- jp CallFunctionInTable
+ ld a, 0
+ call CallFunctionInTable
+ ret
RedsHouse2F_ScriptPointers:
dw RedsHouse2FScript0
dw RedsHouse2FScript1
+ dw RedsHouse2FScript2
+ dw RedsHouse2FScript3
+ dw RedsHouse2FScript4
RedsHouse2FScript0:
- xor a
- ldh [hJoyHeld], a
- ld a, PLAYER_DIR_UP
- ld [wPlayerMovingDirection], a
- ld a, 1
- ld [wRedsHouse2FCurScript], a
- ret
-
RedsHouse2FScript1:
+RedsHouse2FScript2:
+RedsHouse2FScript3:
+RedsHouse2FScript4:
ret
RedsHouse2F_TextPointers:
diff --git a/scripts/RockTunnelPokecenter.asm b/scripts/RockTunnelPokecenter.asm
index 755bb8f8..3b3da387 100644
--- a/scripts/RockTunnelPokecenter.asm
+++ b/scripts/RockTunnelPokecenter.asm
@@ -7,6 +7,7 @@ RockTunnelPokecenter_TextPointers:
dw RockTunnelPokecenterText2
dw RockTunnelPokecenterText3
dw RockTunnelTradeNurseText
+ dw RockTunnelPokecenterText5
RockTunnelHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ RockTunnelPokecenterText3:
RockTunnelTradeNurseText:
script_cable_club_receptionist
+
+RockTunnelPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm
index a65ffb54..c3943e98 100644
--- a/scripts/RocketHideoutB4F.asm
+++ b/scripts/RocketHideoutB4F.asm
@@ -1,5 +1,4 @@
RocketHideoutB4F_Script:
- call RocketHideout4Script_45473
call EnableAutoTextBoxDrawing
ld hl, RocketHideout4TrainerHeaders
ld de, RocketHideoutB4F_ScriptPointers
@@ -8,47 +7,44 @@ RocketHideoutB4F_Script:
ld [wRocketHideoutB4FCurScript], a
ret
-RocketHideout4Script_45473:
- ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
- ret z
- CheckEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED
- jr nz, .asm_45496
- CheckBothEventsSet EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 1
- jr z, .asm_4548c
- ld a, $2d
- jr .asm_45498
-.asm_4548c
- ld a, SFX_GO_INSIDE
- call PlaySound
- SetEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED
-.asm_45496
- ld a, $e
-.asm_45498
- ld [wNewTileBlockID], a
- lb bc, 5, 12
- predef_jump ReplaceTileBlock
-
-RocketHideout4Script_454a3:
+RocketHideout4Script_45510:
+ CheckAndResetEvent EVENT_6A0
+ call nz, RocketHideout4Script_45525
xor a
ld [wJoyIgnore], a
+RocketHideout4Script_4551e:
ld [wRocketHideoutB4FCurScript], a
ld [wCurMapScript], a
ret
+RocketHideout4Script_45525:
+ ld a, HS_ROCKET_HIDEOUT_B4F_JAMES
+ call RocketHideout4Script_45756
+ ld a, HS_ROCKET_HIDEOUT_B4F_JESSIE
+ call RocketHideout4Script_45756
+ ret
+
RocketHideoutB4F_ScriptPointers:
- dw CheckFightingMapTrainers
+ dw RocketHideout4Script0
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
dw RocketHideout4Script3
+ dw RocketHideout4Script4
+ dw RocketHideout4Script5
+ dw RocketHideout4Script6
+ dw RocketHideout4Script7
+ dw RocketHideout4Script8
+ dw RocketHideout4Script9
+ dw RocketHideout4Script10
+ dw RocketHideout4Script11
+ dw RocketHideout4Script12
+ dw RocketHideout4Script13
RocketHideout4Script3:
ld a, [wIsInBattle]
cp $ff
- jp z, RocketHideout4Script_454a3
- call UpdateSprites
- ld a, $f0
+ jp z, RocketHideout4Script_45510
+ ld a, $fc
ld [wJoyIgnore], a
SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI
ld a, $a
@@ -72,39 +68,292 @@ RocketHideout4Script3:
ld [wCurMapScript], a
ret
+RocketHideout4Script0:
+IF DEF(_DEBUG)
+ call DebugPressedOrHeldB
+ ret nz
+ENDC
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
+ call z, RocketHideout4Script_455a5
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2
+ call z, CheckFightingMapTrainers
+ ret
+
+RocketHideout4Script_455a5:
+ ld a, [wYCoord]
+ cp $e
+ ret nz
+ ResetEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ ld a, [wXCoord]
+ cp $18
+ jr z, .asm_455c2
+ ld a, [wXCoord]
+ cp $19
+ ret nz
+ SetEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+.asm_455c2
+ xor a
+ ldh [hJoyHeld], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ call UpdateSprites
+ call Delay3
+ call UpdateSprites
+ call Delay3
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $b
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, HS_ROCKET_HIDEOUT_B4F_JAMES
+ call RocketHideout4Script_45747
+ ld a, HS_ROCKET_HIDEOUT_B4F_JESSIE
+ call RocketHideout4Script_45747
+ ld a, $4
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4JessieJamesMovementData_45605:
+ db $4
+RocketHideout4JessieJamesMovementData_45606:
+ db $4
+ db $4
+ db $4
+ db $ff
+
+RocketHideout4Script4:
+ ld de, RocketHideout4JessieJamesMovementData_45605
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_45617
+ ld de, RocketHideout4JessieJamesMovementData_45606
+.asm_45617
+ ld a, $2
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $5
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script5:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+RocketHideout4Script6:
+ ld a, $2
+ ld [wSprite02StateData1MovementStatus], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSprite02StateData1FacingDirection], a
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_4564a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSprite02StateData1FacingDirection], a
+.asm_4564a
+ call Delay3
+ ld a, $fc
+ ld [wJoyIgnore], a
+RocketHideout4Script7:
+ ld de, RocketHideout4JessieJamesMovementData_45606
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_4565f
+ ld de, RocketHideout4JessieJamesMovementData_45605
+.asm_4565f
+ ld a, $3
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $8
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script8:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+ ld a, $fc
+ ld [wJoyIgnore], a
+RocketHideout4Script9:
+ ld a, $2
+ ld [wSprite03StateData1MovementStatus], a
+ ld a, SPRITE_FACING_DOWN
+ ld [wSprite03StateData1FacingDirection], a
+ CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1
+ jr z, .asm_45697
+ ld a, SPRITE_FACING_RIGHT
+ ld [wSprite03StateData1FacingDirection], a
+.asm_45697
+ call Delay3
+ ld a, $c
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+RocketHideout4Script10:
+ ld hl, wd72d
+ set 6, [hl]
+ set 7, [hl]
+ ld hl, RocketHideout4JessieJamesEndBattleText
+ ld de, RocketHideout4JessieJamesEndBattleText
+ call SaveEndBattleTextPointers
+ ld a, OPP_ROCKET
+ ld [wCurOpponent], a
+ ld a, $2b
+ ld [wTrainerNo], a
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ SetEvent EVENT_6A0
+ ld a, $b
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script11:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wIsInBattle]
+ cp $ff
+ jp z, RocketHideout4Script_45510
+ ld a, $2
+ ld [wSprite02StateData1MovementStatus], a
+ ld [wSprite03StateData1MovementStatus], a
+ xor a
+ ld [wSprite02StateData1FacingDirection], a
+ ld [wSprite03StateData1FacingDirection], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $d
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $c
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script12:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ call GBFadeOutToBlack
+ ld a, HS_ROCKET_HIDEOUT_B4F_JAMES
+ call RocketHideout4Script_45756
+ ld a, HS_ROCKET_HIDEOUT_B4F_JESSIE
+ call RocketHideout4Script_45756
+ call UpdateSprites
+ call Delay3
+ call GBFadeInFromBlack
+ ld a, $d
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script13:
+ call PlayDefaultMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ SetEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0
+ ld a, $0
+ call RocketHideout4Script_4551e
+ ret
+
+RocketHideout4Script_45747:
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ call UpdateSprites
+ call Delay3
+ ret
+
+RocketHideout4Script_45756:
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ret
+
RocketHideoutB4F_TextPointers:
+ dw RocketHideout4Text0
dw RocketHideout4Text1
dw RocketHideout4Text2
dw RocketHideout4Text3
- dw RocketHideout4Text4
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
+ dw RocketHideout4Text9
dw RocketHideout4Text10
+ dw RocketHideout4Text11
+ dw RocketHideout4Text12
RocketHideout4TrainerHeaders:
- def_trainers 2
+ def_trainers 4
RocketHideout4TrainerHeader0:
- trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0, 0, RocketHideout4BattleText2, RocketHideout4EndBattleText2, RocketHideout4AfterBattleText2
-RocketHideout4TrainerHeader1:
- trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_1, 0, RocketHideout4BattleText3, RocketHideout4EndBattleText3, RocketHideout4AfterBattleText3
-RocketHideout4TrainerHeader2:
- trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1, RocketHideout4BattleText4, RocketHideout4EndBattleText4, RocketHideout4AfterBattleText4
+ trainer EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_2, 1, RocketHideout4Trainer0BeforeText, RocketHideout4Trainer0EndBattleText, RocketHideout4Trainer0AfterText
db -1 ; end
RocketHideout4Text1:
+RocketHideout4Text2:
+ text_end
+
+RocketHideout4Text10:
+ text_far _RocketHideoutJessieJamesText1
+ text_asm
+ ld c, 10
+ call DelayFrames
+ ld a, $8
+ ld [wPlayerMovingDirection], a
+ ld a, $0
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ ld c, 20
+ call DelayFrames
+ jp TextScriptEnd
+
+RocketHideout4Text11:
+ text_far _RocketHideoutJessieJamesText2
+ text_end
+
+RocketHideout4JessieJamesEndBattleText:
+ text_far _RocketHideoutJessieJamesText3
+ text_end
+
+RocketHideout4Text12:
+ text_far _RocketHideoutJessieJamesText4
+ text_asm
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
+
+RocketHideout4Text0:
text_asm
CheckEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI
- jp nz, .asm_545571
- ld hl, RocketHideout4Text_4557a
+ jp nz, .asm_457fb
+ ld hl, RocketHideout4Text_45804
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, RocketHideout4Text_4557f
- ld de, RocketHideout4Text_4557f
+ ld hl, RocketHideout4Text_45809
+ ld de, RocketHideout4Text_45809
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -115,87 +364,52 @@ RocketHideout4Text1:
ld a, $3
ld [wRocketHideoutB4FCurScript], a
ld [wCurMapScript], a
- jr .asm_209f0
-.asm_545571
- ld hl, RocketHideout4Text10
+ jr .asm_45801
+
+.asm_457fb
+ ld hl, RocketHideout4Text9
call PrintText
-.asm_209f0
+.asm_45801
jp TextScriptEnd
-RocketHideout4Text_4557a:
+RocketHideout4Text_45804:
text_far _RocketHideout4Text_4557a
text_end
-RocketHideout4Text_4557f:
+RocketHideout4Text_45809:
text_far _RocketHideout4Text_4557f
text_end
-RocketHideout4Text10:
+RocketHideout4Text9:
text_far _RocketHideout4Text_45584
text_end
-RocketHideout4Text2:
- text_asm
- ld hl, RocketHideout4TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
-RocketHideout4BattleText2:
- text_far _RocketHideout4BattleText2
- text_end
-
-RocketHideout4EndBattleText2:
- text_far _RocketHideout4EndBattleText2
- text_end
-
-RocketHideout4AfterBattleText2:
- text_far _RocketHide4AfterBattleText2
- text_end
-
RocketHideout4Text3:
text_asm
- ld hl, RocketHideout4TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
-
-RocketHideout4BattleText3:
- text_far _RocketHideout4BattleText3
- text_end
-
-RocketHideout4EndBattleText3:
- text_far _RocketHideout4EndBattleText3
- text_end
-
-RocketHideout4AfterBattleText3:
- text_far _RocketHide4AfterBattleText3
- text_end
-
-RocketHideout4Text4:
- text_asm
- ld hl, RocketHideout4TrainerHeader2
+ ld hl, RocketHideout4TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-RocketHideout4BattleText4:
+RocketHideout4Trainer0BeforeText:
text_far _RocketHideout4BattleText4
text_end
-RocketHideout4EndBattleText4:
+RocketHideout4Trainer0EndBattleText:
text_far _RocketHideout4EndBattleText4
- text_end
-
-RocketHideout4AfterBattleText4:
+ text_promptbutton
text_asm
- ld hl, RocketHideout4Text_455ec
- call PrintText
- CheckAndSetEvent EVENT_ROCKET_DROPPED_LIFT_KEY
- jr nz, .asm_455e9
+ SetEvent EVENT_ROCKET_DROPPED_LIFT_KEY
ld a, HS_ROCKET_HIDEOUT_B4F_ITEM_5
ld [wMissableObjectIndex], a
predef ShowObject
-.asm_455e9
jp TextScriptEnd
-RocketHideout4Text_455ec:
+RocketHideout4Trainer0AfterText:
+ text_asm
+ ld hl, RocketHideout4Text_45844
+ call PrintText
+ jp TextScriptEnd
+
+RocketHideout4Text_45844:
text_far _RocketHideout4Text_455ec
text_end
diff --git a/scripts/Route1.asm b/scripts/Route1.asm
index bd9afea3..d2f0b766 100644
--- a/scripts/Route1.asm
+++ b/scripts/Route1.asm
@@ -1,5 +1,6 @@
Route1_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
Route1_TextPointers:
dw Route1Text1
@@ -8,45 +9,15 @@ Route1_TextPointers:
Route1Text1:
text_asm
- CheckAndSetEvent EVENT_GOT_POTION_SAMPLE
- jr nz, .got_item
- ld hl, Route1ViridianMartSampleText
- call PrintText
- lb bc, POTION, 1
- call GiveItem
- jr nc, .bag_full
- ld hl, Route1Text_1cae8
- jr .done
-.bag_full
- ld hl, Route1Text_1caf3
- jr .done
-.got_item
- ld hl, Route1Text_1caee
-.done
- call PrintText
+ farcall Func_f1ad2
jp TextScriptEnd
-Route1ViridianMartSampleText:
- text_far _Route1ViridianMartSampleText
- text_end
-
-Route1Text_1cae8:
- text_far _Route1Text_1cae8
- sound_get_item_1
- text_end
-
-Route1Text_1caee:
- text_far _Route1Text_1caee
- text_end
-
-Route1Text_1caf3:
- text_far _Route1Text_1caf3
- text_end
-
Route1Text2:
- text_far _Route1Text2
- text_end
+ text_asm
+ farcall Func_f1b0f
+ jp TextScriptEnd
Route1Text3:
- text_far _Route1Text3
- text_end
+ text_asm
+ farcall Func_f1b1b
+ jp TextScriptEnd
diff --git a/scripts/Route11Gate2F.asm b/scripts/Route11Gate2F.asm
index 47c8db22..65352cd9 100644
--- a/scripts/Route11Gate2F.asm
+++ b/scripts/Route11Gate2F.asm
@@ -9,7 +9,7 @@ Route11Gate2F_TextPointers:
Route11GateUpstairsText1:
text_asm
- xor a ; TRADE_FOR_TERRY
+ ld a, TRADE_FOR_TERRY
ld [wWhichTrade], a
predef DoInGameTradeDialogue
Route11GateUpstairsScriptEnd:
diff --git a/scripts/Route19.asm b/scripts/Route19.asm
index 7467ee1e..4db46dad 100644
--- a/scripts/Route19.asm
+++ b/scripts/Route19.asm
@@ -30,7 +30,7 @@ Route19TrainerHeaders:
Route19TrainerHeader0:
trainer EVENT_BEAT_ROUTE_19_TRAINER_0, 4, Route19BattleText1, Route19EndBattleText1, Route19AfterBattleText1
Route19TrainerHeader1:
- trainer EVENT_BEAT_ROUTE_19_TRAINER_1, 3, Route19BattleText2, Route19EndBattleText2, Route19AfterBattleText2
+ trainer EVENT_BEAT_ROUTE_19_TRAINER_1, 4, Route19BattleText2, Route19EndBattleText2, Route19AfterBattleText2
Route19TrainerHeader2:
trainer EVENT_BEAT_ROUTE_19_TRAINER_2, 3, Route19BattleText3, Route19EndBattleText3, Route19AfterBattleText3
Route19TrainerHeader3:
@@ -52,60 +52,52 @@ Route19TrainerHeader9:
Route19Text1:
text_asm
ld hl, Route19TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text2:
text_asm
ld hl, Route19TrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text3:
text_asm
ld hl, Route19TrainerHeader2
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text4:
text_asm
ld hl, Route19TrainerHeader3
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text5:
text_asm
ld hl, Route19TrainerHeader4
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text6:
text_asm
ld hl, Route19TrainerHeader5
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text7:
text_asm
ld hl, Route19TrainerHeader6
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text8:
text_asm
ld hl, Route19TrainerHeader7
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text9:
text_asm
ld hl, Route19TrainerHeader8
- call TalkToTrainer
- jp TextScriptEnd
+ jr Route19_TalkToTrainer
Route19Text10:
text_asm
ld hl, Route19TrainerHeader9
+Route19_TalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
diff --git a/scripts/Route1_2.asm b/scripts/Route1_2.asm
new file mode 100644
index 00000000..94748252
--- /dev/null
+++ b/scripts/Route1_2.asm
@@ -0,0 +1,53 @@
+Func_f1ad2::
+ CheckAndSetEvent EVENT_GOT_POTION_SAMPLE
+ jr nz, .got_item
+ ld hl, Route1ViridianMartSampleText
+ call PrintText
+ lb bc, POTION, 1
+ call GiveItem
+ jr nc, .bag_full
+ ld hl, Route1Text_1cae8
+ jr .done
+.bag_full
+ ld hl, Route1Text_1caf3
+ jr .done
+.got_item
+ ld hl, Route1Text_1caee
+.done
+ call PrintText
+ ret
+
+Route1ViridianMartSampleText:
+ text_far _Route1ViridianMartSampleText
+ text_end
+
+Route1Text_1cae8:
+ text_far _Route1Text_1cae8
+ sound_get_item_1
+ text_end
+
+Route1Text_1caee:
+ text_far _Route1Text_1caee
+ text_end
+
+Route1Text_1caf3:
+ text_far _Route1Text_1caf3
+ text_end
+
+Func_f1b0f::
+ ld hl, Route1Text_f1b16
+ call PrintText
+ ret
+
+Route1Text_f1b16:
+ text_far _Route1Text2
+ text_end
+
+Func_f1b1b::
+ ld hl, Route1Text_f1b22
+ call PrintText
+ ret
+
+Route1Text_f1b22:
+ text_far _Route1Text3
+ text_end
diff --git a/scripts/Route22.asm b/scripts/Route22.asm
index 1b02752f..4ffeff23 100644
--- a/scripts/Route22.asm
+++ b/scripts/Route22.asm
@@ -22,16 +22,17 @@ Route22Script7:
ret
Route22Script_50ed6:
+ ld a, OPP_RIVAL1
+ ld [wCurOpponent], a
+ ld a, $2
+ ld [wTrainerNo], a
+ ret
+
+Route22Script_50ee1:
+ ld a, OPP_RIVAL2
+ ld [wCurOpponent], a
ld a, [wRivalStarter]
- ld b, a
-.asm_50eda
- ld a, [hli]
- cp b
- jr z, .asm_50ee1
- inc hl
- jr .asm_50eda
-.asm_50ee1
- ld a, [hl]
+ add 7
ld [wTrainerNo], a
ret
@@ -88,9 +89,7 @@ Route22Script0:
ld a, [wWalkBikeSurfState]
and a
jr z, .asm_50f4e
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.asm_50f4e
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
@@ -131,24 +130,29 @@ Route22Script1:
ld hl, Route22RivalDefeatedText1
ld de, Route22Text_511bc
call SaveEndBattleTextPointers
- ld a, OPP_RIVAL1
- ld [wCurOpponent], a
- ld hl, StarterMons_50faf
call Route22Script_50ed6
ld a, $2
ld [wRoute22CurScript], a
ret
-StarterMons_50faf:
-; starter the rival picked, rival trainer number
- db STARTER2, 4
- db STARTER3, 5
- db STARTER1, 6
+Route22RivalDefeatedText1:
+ text_far _Route22RivalDefeatedText1
+ text_end
+
+Route22Text_511bc:
+ text_far _Route22Text_511bc
+ text_end
Route22Script2:
ld a, [wIsInBattle]
cp $ff
jp z, Route22Script_50ece
+ ld a, [wRivalStarter]
+ cp RIVAL_STARTER_FLAREON
+ jr nz, .keep_rival_starter
+ ld a, RIVAL_STARTER_JOLTEON
+ ld [wRivalStarter], a
+.keep_rival_starter
ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
jr nz, .notDown
@@ -167,9 +171,7 @@ Route22Script2:
ld a, $1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld a, [wcf0d]
cp $1
@@ -241,13 +243,9 @@ Route22Script_5104e:
ld a, [wWalkBikeSurfState]
and a
jr z, .skipYVisibilityTesta
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.skipYVisibilityTesta
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateTempo
ld a, $2
ldh [hSpriteIndex], a
@@ -287,18 +285,18 @@ Route22Script4:
ld hl, Route22RivalDefeatedText2
ld de, Route22Text_511d0
call SaveEndBattleTextPointers
- ld a, OPP_RIVAL2
- ld [wCurOpponent], a
- ld hl, StarterMons_510d9
- call Route22Script_50ed6
+ call Route22Script_50ee1
ld a, $5
ld [wRoute22CurScript], a
ret
-StarterMons_510d9:
- db STARTER2, 10
- db STARTER3, 11
- db STARTER1, 12
+Route22RivalDefeatedText2:
+ text_far _Route22RivalDefeatedText2
+ text_end
+
+Route22Text_511d0:
+ text_far _Route22Text_511d0
+ text_end
Route22Script5:
ld a, [wIsInBattle]
@@ -326,9 +324,7 @@ Route22Script5:
ld a, $2
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStartAndTempo
ld a, [wcf0d]
cp $1
@@ -383,62 +379,15 @@ Route22_TextPointers:
Route22Text1:
text_asm
- CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE
- jr z, .asm_5118b
- ld hl, Route22RivalAfterBattleText1
- call PrintText
- jr .asm_51191
-.asm_5118b
- ld hl, Route22RivalBeforeBattleText1
- call PrintText
-.asm_51191
+ farcall Func_f1b27
jp TextScriptEnd
Route22Text2:
text_asm
- CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE
- jr z, .asm_511a4
- ld hl, Route22RivalAfterBattleText2
- call PrintText
- jr .asm_511aa
-.asm_511a4
- ld hl, Route22RivalBeforeBattleText2
- call PrintText
-.asm_511aa
+ farcall Func_f1b47
jp TextScriptEnd
-Route22RivalBeforeBattleText1:
- text_far _Route22RivalBeforeBattleText1
- text_end
-
-Route22RivalAfterBattleText1:
- text_far _Route22RivalAfterBattleText1
- text_end
-
-Route22RivalDefeatedText1:
- text_far _Route22RivalDefeatedText1
- text_end
-
-Route22Text_511bc:
- text_far _Route22Text_511bc
- text_end
-
-Route22RivalBeforeBattleText2:
- text_far _Route22RivalBeforeBattleText2
- text_end
-
-Route22RivalAfterBattleText2:
- text_far _Route22RivalAfterBattleText2
- text_end
-
-Route22RivalDefeatedText2:
- text_far _Route22RivalDefeatedText2
- text_end
-
-Route22Text_511d0:
- text_far _Route22Text_511d0
- text_end
-
Route22FrontGateText:
- text_far _Route22FrontGateText
- text_end
+ text_asm
+ farcall Func_f1b67
+ jp TextScriptEnd
diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm
index 8a726515..9711549f 100644
--- a/scripts/Route22Gate.asm
+++ b/scripts/Route22Gate.asm
@@ -23,9 +23,12 @@ Route22GateScript0:
ret nc
xor a
ldh [hJoyHeld], a
+ ld a, SPRITE_FACING_LEFT
+ ld [wSprite01StateData1FacingDirection], a
ld a, $1
ldh [hSpriteIndexOrTextID], a
- jp DisplayTextID
+ call DisplayTextID
+ ret
Route22GateScriptCoords:
dbmapcoord 4, 2
diff --git a/scripts/Route22_2.asm b/scripts/Route22_2.asm
new file mode 100644
index 00000000..7f3fa54d
--- /dev/null
+++ b/scripts/Route22_2.asm
@@ -0,0 +1,50 @@
+Func_f1b27::
+ CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE
+ jr z, .asm_5118b
+ ld hl, Route22RivalAfterBattleText1
+ call PrintText
+ jr .asm_51191
+
+.asm_5118b
+ ld hl, Route22RivalBeforeBattleText1
+ call PrintText
+.asm_51191
+ ret
+
+Route22RivalBeforeBattleText1:
+ text_far _Route22RivalBeforeBattleText1
+ text_end
+
+Route22RivalAfterBattleText1:
+ text_far _Route22RivalAfterBattleText1
+ text_end
+
+Func_f1b47::
+ CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE
+ jr z, .asm_511a4
+ ld hl, Route22RivalAfterBattleText2
+ call PrintText
+ jr .asm_511aa
+
+.asm_511a4
+ ld hl, Route22RivalBeforeBattleText2
+ call PrintText
+.asm_511aa
+ ret
+
+Route22RivalBeforeBattleText2:
+ text_far _Route22RivalBeforeBattleText2
+ text_end
+
+Route22RivalAfterBattleText2:
+ text_far _Route22RivalAfterBattleText2
+ text_end
+
+Func_f1b67::
+ ld hl, Route22FrontGateText_3c
+ call PrintText
+ ret
+
+Route22FrontGateText_3c:
+ text_far _Route22FrontGateText
+ text_end
diff --git a/scripts/Route24.asm b/scripts/Route24.asm
index 5cbb78a6..79023d00 100644
--- a/scripts/Route24.asm
+++ b/scripts/Route24.asm
@@ -85,6 +85,7 @@ Route24_TextPointers:
dw Route24Text6
dw Route24Text7
dw PickUpItemText
+ dw Route24Text8
Route24TrainerHeaders:
def_trainers 2
@@ -151,7 +152,7 @@ Route24Text_51510:
Route24Text_5151a:
text_far _Route24Text_5151a
- sound_get_item_1
+ sound_get_key_item
text_promptbutton
text_end
@@ -278,3 +279,59 @@ Route24EndBattleText6:
Route24AfterBattleText6:
text_far _Route24AfterBattleText6
text_end
+
+Route24Text8:
+ text_asm
+ CheckEvent EVENT_54F
+ jr nz, .asm_515d5
+ ld hl, Route24Text_515de
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_515d0
+ ld a, CHARMANDER
+ ld [wd11e], a
+ ld [wcf91], a
+ call GetMonName
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ lb bc, CHARMANDER, 10
+ call GivePokemon
+ jp nc, TextScriptEnd
+ ld a, [wAddedToParty]
+ and a
+ call z, WaitForTextScrollButtonPress
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, Route24Text_515e3
+ call PrintText
+ SetEvent EVENT_54F
+ jp TextScriptEnd
+
+.asm_515d0
+ ld hl, Route24Text_515e9
+ jr .asm_515d8
+
+.asm_515d5
+ ld hl, Route24Text_515ee
+.asm_515d8
+ call PrintText
+ jp TextScriptEnd
+
+Route24Text_515de:
+ text_far _Route24DamianText1
+ text_end
+
+Route24Text_515e3:
+ text_far _Route24DamianText2
+ text_waitbutton
+ text_end
+
+Route24Text_515e9:
+ text_far _Route24DamianText3
+ text_end
+
+Route24Text_515ee:
+ text_far _Route24DamianText4
+ text_end
diff --git a/scripts/Route25.asm b/scripts/Route25.asm
index 265a8310..cc90a7d8 100644
--- a/scripts/Route25.asm
+++ b/scripts/Route25.asm
@@ -1,14 +1,21 @@
Route25_Script:
- call Route25Script_515e1
call EnableAutoTextBoxDrawing
ld hl, Route25TrainerHeaders
ld de, Route25_ScriptPointers
ld a, [wRoute25CurScript]
call ExecuteCurMapScriptInTable
ld [wRoute25CurScript], a
+ call Route25Script_515e1
ret
Route25Script_515e1:
+ ld hl, wd492
+ res 2, [hl]
+ res 3, [hl]
+ res 4, [hl]
+ res 7, [hl]
+ xor a
+ ld [wBillsHouseCurScript], a
ld hl, wCurrentMapScriptFlags
bit 6, [hl]
res 6, [hl]
@@ -16,14 +23,15 @@ Route25Script_515e1:
CheckEventHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
ret nz
CheckEventReuseHL EVENT_MET_BILL_2
- jr nz, .asm_515ff
+ jr nz, .asm_51638
ResetEventReuseHL EVENT_BILL_SAID_USE_CELL_SEPARATOR
ld a, HS_BILL_POKEMON
ld [wMissableObjectIndex], a
- predef_jump ShowObject
-.asm_515ff
+ predef ShowObject
+ jr .asm_5165c
+.asm_51638
CheckEventAfterBranchReuseHL EVENT_GOT_SS_TICKET, EVENT_MET_BILL_2
- ret z
+ jr z, .asm_5165c
SetEventReuseHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
ld a, HS_NUGGET_BRIDGE_GUY
ld [wMissableObjectIndex], a
@@ -33,7 +41,9 @@ Route25Script_515e1:
predef HideObject
ld a, HS_BILL_2
ld [wMissableObjectIndex], a
- predef_jump ShowObject
+ predef ShowObject
+.asm_5165c
+ ret
Route25_ScriptPointers:
dw CheckFightingMapTrainers
diff --git a/scripts/Route6.asm b/scripts/Route6.asm
index de1f8918..5701cb9b 100644
--- a/scripts/Route6.asm
+++ b/scripts/Route6.asm
@@ -26,7 +26,7 @@ Route6TrainerHeaders:
Route6TrainerHeader0:
trainer EVENT_BEAT_ROUTE_6_TRAINER_0, 0, Route6BattleText1, Route6EndBattleText1, Route6AfterBattleText1
Route6TrainerHeader1:
- trainer EVENT_BEAT_ROUTE_6_TRAINER_1, 0, Route6BattleText2, Route6EndBattleText2, Route6AfterBattleText1
+ trainer EVENT_BEAT_ROUTE_6_TRAINER_1, 0, Route6BattleText2, Route6EndBattleText2, Route6AfterBattleText2
Route6TrainerHeader2:
trainer EVENT_BEAT_ROUTE_6_TRAINER_2, 4, Route6BattleText3, Route6EndBattleText3, Route6AfterBattleText3
Route6TrainerHeader3:
@@ -69,6 +69,10 @@ Route6EndBattleText2:
text_far _Route6EndBattleText2
text_end
+Route6AfterBattleText2:
+ text_far _Route6AfterBattleText2
+ text_end
+
Route6Text3:
text_asm
ld hl, Route6TrainerHeader2
diff --git a/scripts/Route7.asm b/scripts/Route7.asm
index 1fd38abb..648cbb58 100644
--- a/scripts/Route7.asm
+++ b/scripts/Route7.asm
@@ -1,5 +1,6 @@
Route7_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
Route7_TextPointers:
dw Route7Text1
diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm
index 3167cd76..55443931 100644
--- a/scripts/Route8Gate.asm
+++ b/scripts/Route8Gate.asm
@@ -27,7 +27,7 @@ Route8GateScript0:
ld hl, CoordsData_1e22c
call ArePlayerCoordsInArray
ret nc
- ld a, PLAYER_DIR_LEFT
+ ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
xor a
ldh [hJoyHeld], a
diff --git a/scripts/Route9.asm b/scripts/Route9.asm
index 72c43a5c..f4dee72e 100644
--- a/scripts/Route9.asm
+++ b/scripts/Route9.asm
@@ -14,7 +14,7 @@ Route9_ScriptPointers:
Route9_TextPointers:
dw Route9Text1
- dw Route9Text2
+ dw Route9TextAJ
dw Route9Text3
dw Route9Text4
dw Route9Text5
@@ -30,7 +30,7 @@ Route9TrainerHeaders:
Route9TrainerHeader0:
trainer EVENT_BEAT_ROUTE_9_TRAINER_0, 3, Route9BattleText1, Route9EndBattleText1, Route9AfterBattleText1
Route9TrainerHeader1:
- trainer EVENT_BEAT_ROUTE_9_TRAINER_1, 2, Route9BattleText2, Route9EndBattleText2, Route9AfterBattleText2
+ trainer EVENT_BEAT_ROUTE_9_TRAINER_1, 2, Route9BattleTextAJ, Route9EndBattleTextAJ, Route9AfterBattleTextAJ
Route9TrainerHeader2:
trainer EVENT_BEAT_ROUTE_9_TRAINER_2, 4, Route9BattleText3, Route9EndBattleText3, Route9AfterBattleText3
Route9TrainerHeader3:
@@ -52,7 +52,7 @@ Route9Text1:
ld hl, Route9TrainerHeader0
jr Route9TalkToTrainer
-Route9Text2:
+Route9TextAJ:
text_asm
ld hl, Route9TrainerHeader1
jr Route9TalkToTrainer
@@ -106,16 +106,16 @@ Route9AfterBattleText1:
text_far _Route9AfterBattleText1
text_end
-Route9BattleText2:
- text_far _Route9BattleText2
+Route9BattleTextAJ:
+ text_far _Route9BattleTextAJ
text_end
-Route9EndBattleText2:
- text_far _Route9EndBattleText2
+Route9EndBattleTextAJ:
+ text_far _Route9EndBattleTextAJ
text_end
-Route9AfterBattleText2:
- text_far _Route9AfterBattleText2
+Route9AfterBattleTextAJ:
+ text_far _Route9AfterBattleTextAJ
text_end
Route9BattleText3:
diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm
index d15ec180..d00917fe 100644
--- a/scripts/SSAnne2F.asm
+++ b/scripts/SSAnne2F.asm
@@ -24,9 +24,7 @@ SSAnne2Script0:
ld hl, CoordsData_61411
call ArePlayerCoordsInArray
ret nc
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -98,23 +96,8 @@ SSAnne2Script1:
call Delay3
ld a, OPP_RIVAL2
ld [wCurOpponent], a
-
- ; select which team to use during the encounter
- ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .NotSquirtle
ld a, $1
- jr .done
-.NotSquirtle
- cp STARTER3
- jr nz, .Charmander
- ld a, $2
- jr .done
-.Charmander
- ld a, $3
-.done
ld [wTrainerNo], a
-
call SSAnne2Script_61416
ld a, $2
ld [wSSAnne2FCurScript], a
@@ -144,9 +127,7 @@ SSAnne2Script2:
ld a, $2
ldh [hSpriteIndex], a
call MoveSprite
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld a, $3
ld [wSSAnne2FCurScript], a
diff --git a/scripts/SSAnne2FRooms.asm b/scripts/SSAnne2FRooms.asm
index 4fa679e3..f3346fe3 100644
--- a/scripts/SSAnne2FRooms.asm
+++ b/scripts/SSAnne2FRooms.asm
@@ -1,8 +1,5 @@
SSAnne2FRooms_Script:
- ld a, TRUE
- ld [wAutoTextBoxDrawingControl], a
- xor a
- ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call DisableAutoTextBoxDrawing
ld hl, SSAnne9TrainerHeaders
ld de, SSAnne2FRooms_ScriptPointers
ld a, [wSSAnne2FRoomsCurScript]
@@ -102,44 +99,24 @@ SSAnne9Text_61c10:
SSAnne9Text10:
text_asm
- ld hl, SSAnne9Text_61c1f
- call PrintText
+ farcall Func_f2570
jp TextScriptEnd
-SSAnne9Text_61c1f:
- text_far _SSAnne9Text_61c1f
- text_end
-
SSAnne9Text11:
text_asm
- ld hl, SSAnne9Text_61c2e
- call PrintText
+ farcall Func_f257c
jp TextScriptEnd
-SSAnne9Text_61c2e:
- text_far _SSAnne9Text_61c2e
- text_end
-
SSAnne9Text12:
text_asm
- ld hl, SSAnne9Text_61c3d
- call PrintText
+ farcall Func_f2588
jp TextScriptEnd
-SSAnne9Text_61c3d:
- text_far _SSAnne9Text_61c3d
- text_end
-
SSAnne9Text13:
text_asm
- ld hl, SSAnne9Text_61c4c
- call PrintText
+ farcall Func_f2594
jp TextScriptEnd
-SSAnne9Text_61c4c:
- text_far _SSAnne9Text_61c4c
- text_end
-
SSAnne9BattleText1:
text_far _SSAnne9BattleText1
text_end
diff --git a/scripts/SSAnne2FRooms_2.asm b/scripts/SSAnne2FRooms_2.asm
new file mode 100644
index 00000000..2271e83d
--- /dev/null
+++ b/scripts/SSAnne2FRooms_2.asm
@@ -0,0 +1,35 @@
+Func_f2570::
+ ld hl, SSAnne9Text_f2577
+ call PrintText
+ ret
+
+SSAnne9Text_f2577:
+ text_far _SSAnne9Text_61c1f
+ text_end
+
+Func_f257c::
+ ld hl, SSAnne9Text_f2583
+ call PrintText
+ ret
+
+SSAnne9Text_f2583:
+ text_far _SSAnne9Text_61c2e
+ text_end
+
+Func_f2588::
+ ld hl, SSAnne9Text_f258f
+ call PrintText
+ ret
+
+SSAnne9Text_f258f:
+ text_far _SSAnne9Text_61c3d
+ text_end
+
+Func_f2594::
+ ld hl, SSAnne9Text_f259b
+ call PrintText
+ ret
+
+SSAnne9Text_f259b:
+ text_far _SSAnne9Text_61c4c
+ text_end
diff --git a/scripts/SSAnneCaptainsRoom.asm b/scripts/SSAnneCaptainsRoom.asm
index d618a69e..9af4744e 100644
--- a/scripts/SSAnneCaptainsRoom.asm
+++ b/scripts/SSAnneCaptainsRoom.asm
@@ -3,7 +3,7 @@ SSAnneCaptainsRoom_Script:
jp EnableAutoTextBoxDrawing
SSAnne7Script_6189b:
- CheckEvent EVENT_RUBBED_CAPTAINS_BACK
+ CheckEvent EVENT_GOT_HM01
ret nz
ld hl, wd72d
set 5, [hl]
@@ -28,12 +28,12 @@ SSAnne7Text1:
ld hl, ReceivedHM01Text
call PrintText
SetEvent EVENT_GOT_HM01
+ ld hl, wd72d
+ res 5, [hl]
jr .done
.bag_full
ld hl, HM01NoRoomText
call PrintText
- ld hl, wd72d
- set 5, [hl]
jr .done
.got_item
ld hl, SSAnne7Text_61932
@@ -48,9 +48,7 @@ SSAnne7RubText:
cp BANK("Audio Engine 3")
ld [wAudioSavedROMBank], a
jr nz, .asm_61908
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld a, BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.asm_61908
diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm
index fd9a0884..9e4cc5dd 100644
--- a/scripts/SafariZoneGate.asm
+++ b/scripts/SafariZoneGate.asm
@@ -2,7 +2,8 @@ SafariZoneGate_Script:
call EnableAutoTextBoxDrawing
ld hl, SafariZoneGate_ScriptPointers
ld a, [wSafariZoneGateCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
SafariZoneGate_ScriptPointers:
dw .SafariZoneEntranceScript0
@@ -85,6 +86,8 @@ SafariZoneGate_ScriptPointers:
call DisplayTextID
xor a
ld [wNumSafariBalls], a
+ ld [wSafariSteps], a
+ ld [wSafariSteps], a ; ?????
ld a, D_DOWN
ld c, $3
call SafariZoneEntranceAutoWalk
@@ -143,84 +146,10 @@ SafariZoneGate_TextPointers:
text_end
.SafariZoneEntranceText4
- text_far SafariZoneEntranceText_9e6e4
text_asm
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jp nz, .PleaseComeAgain
- xor a
- ldh [hMoney], a
- ld a, $05
- ldh [hMoney + 1], a
- ld a, $00
- ldh [hMoney + 2], a
- call HasEnoughMoney
- jr nc, .success
- ld hl, .NotEnoughMoneyText
- call PrintText
- jr .CantPayWalkDown
-
-.success
- xor a
- ld [wPriceTemp], a
- ld a, $05
- ld [wPriceTemp + 1], a
- ld a, $00
- ld [wPriceTemp + 2], a
- ld hl, wPriceTemp + 2
- ld de, wPlayerMoney + 2
- ld c, 3
- predef SubBCDPredef
- ld a, MONEY_BOX
- ld [wTextBoxID], a
- call DisplayTextBoxID
- ld hl, .MakePaymentText
- call PrintText
- ld a, 30
- ld [wNumSafariBalls], a
- ld a, HIGH(502)
- ld [wSafariSteps], a
- ld a, LOW(502)
- ld [wSafariSteps + 1], a
- ld a, D_UP
- ld c, 3
- call SafariZoneEntranceAutoWalk
- SetEvent EVENT_IN_SAFARI_ZONE
- ResetEventReuseHL EVENT_SAFARI_GAME_OVER
- ld a, 3
- ld [wSafariZoneGateCurScript], a
- jr .done
-
-.PleaseComeAgain
- ld hl, .PleaseComeAgainText
- call PrintText
-.CantPayWalkDown
- ld a, D_DOWN
- ld c, 1
- call SafariZoneEntranceAutoWalk
- ld a, 4
- ld [wSafariZoneGateCurScript], a
-.done
+ callfar Func_f1f77
jp TextScriptEnd
-.MakePaymentText
- text_far SafariZoneEntranceText_9e747
- sound_get_item_1
- text_far _SafariZoneEntranceText_75360
- text_end
-
-.PleaseComeAgainText
- text_far _SafariZoneEntranceText_75365
- text_end
-
-.NotEnoughMoneyText
- text_far _SafariZoneEntranceText_7536a
- text_end
-
.SafariZoneEntranceText5
text_far SafariZoneEntranceText_9e814
text_asm
@@ -268,26 +197,5 @@ SafariZoneGate_TextPointers:
.SafariZoneEntranceText2
text_asm
- ld hl, .FirstTimeQuestionText
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- ld hl, .RegularText
- jr nz, .Explanation
- ld hl, .ExplanationText
-.Explanation
- call PrintText
+ callfar Func_f203e
jp TextScriptEnd
-
-.FirstTimeQuestionText
- text_far _SafariZoneEntranceText_753e6
- text_end
-
-.ExplanationText
- text_far _SafariZoneEntranceText_753eb
- text_end
-
-.RegularText
- text_far _SafariZoneEntranceText_753f0
- text_end
diff --git a/scripts/SafariZoneGate2.asm b/scripts/SafariZoneGate2.asm
new file mode 100644
index 00000000..6187b2c6
--- /dev/null
+++ b/scripts/SafariZoneGate2.asm
@@ -0,0 +1,251 @@
+Func_f1f77::
+ ld hl, .WelcomeText
+ call PrintText
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp nz, .declined
+ ld hl, wPlayerMoney
+ ld a, [hli]
+ or [hl]
+ inc hl
+ or [hl]
+ jr nz, .has_positive_balance
+ call SafariZoneEntranceGetLowCostAdmissionText
+ jr c, .deny_entry
+ jr .poor_mans_discount
+
+.has_positive_balance
+ xor a
+ ldh [hMoney], a
+ ld a, $5
+ ldh [hMoney + 1], a
+ ld a, $0
+ ldh [hMoney + 2], a
+ call HasEnoughMoney
+ jr nc, .has_enough_money
+ ld hl, .NotEnoughMoneyText
+ call PrintText
+ call SafariZoneEntranceCalculateLowCostAdmission
+ jr c, .deny_entry
+ jr .poor_mans_discount
+
+.has_enough_money
+ xor a
+ ld [wPriceTemp + 0], a
+ ld a, $5
+ ld [wPriceTemp + 1], a
+ ld a, $0
+ ld [wPriceTemp + 2], a
+ ld hl, wTrainerInfoTextBoxNextRowOffset
+ ld de, wPlayerMoney + 2
+ ld c, 3
+ predef SubBCDPredef
+ ld a, SFX_PURCHASE
+ call PlaySoundWaitForCurrent
+ call WaitForSoundToFinish
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ ld hl, .MakePaymentText
+ call PrintText
+ ld a, 30
+ ld hl, 502
+.poor_mans_discount
+ ld [wNumSafariBalls], a
+ ld a, h
+ ld [wSafariSteps], a
+ ld a, l
+ ld [wSafariSteps + 1], a
+ ld a, D_UP
+ ld c, 3
+ call SafariZoneEntranceStartSimulatingJoypadStates
+ SetEvent EVENT_IN_SAFARI_ZONE
+ ResetEventReuseHL EVENT_SAFARI_GAME_OVER
+ ld a, $3
+ ld [wSafariZoneGateCurScript], a
+ jr .asm_f2024
+.declined:
+ ld hl, .PleaseComeAgainText
+ call PrintText
+.deny_entry
+ ld a, D_DOWN
+ ld c, 1
+ call SafariZoneEntranceStartSimulatingJoypadStates
+ ld a, $4
+ ld [wSafariZoneGateCurScript], a
+.asm_f2024
+ ret
+
+.WelcomeText
+ text_far SafariZoneEntranceText_9e6e4
+ text_end
+
+.MakePaymentText
+ text_far SafariZoneEntranceText_9e747
+ sound_get_item_1
+ text_far _SafariZoneEntranceText_75360
+ text_end
+
+.PleaseComeAgainText
+ text_far _SafariZoneEntranceText_75365
+ text_end
+
+.NotEnoughMoneyText
+ text_far _SafariZoneEntranceText_7536a
+ text_end
+
+Func_f203e::
+ ld hl, .FirstTimeQuestionText
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ ld hl, .RegularText
+ jr nz, .Explanation
+ ld hl, .ExplanationText
+.Explanation
+ call PrintText
+ ret
+
+.FirstTimeQuestionText
+ text_far _SafariZoneEntranceText_753e6
+ text_end
+
+.ExplanationText
+ text_far _SafariZoneEntranceText_753eb
+ text_end
+
+.RegularText
+ text_far _SafariZoneEntranceText_753f0
+ text_end
+
+SafariZoneEntranceStartSimulatingJoypadStates:
+ push af
+ ld b, $0
+ ld a, c
+ ld [wSimulatedJoypadStatesIndex], a
+ ld hl, wParentMenuItem
+ pop af
+ call FillMemory
+ jp StartSimulatingJoypadStates
+
+SafariZoneEntranceCalculateLowCostAdmission:
+ ld hl, wPlayerMoney
+ ld de, hMoney
+ ld bc, $3
+ call CopyData
+ xor a
+ ldh [hDivideBCDDivisor], a
+ ldh [hDivideBCDDivisor + 1], a
+ ld a, 23
+ ldh [hDivideBCDDivisor + 2], a
+ predef DivideBCDPredef3
+ ldh a, [hDivideBCDQuotient + 2]
+ call SafariZoneEntranceConvertBCDtoNumber
+ push af
+ ld hl, wPlayerMoney
+ xor a
+ ld bc, $3
+ call FillMemory
+ ld hl, SafariZoneEntranceText_f20c4
+ call PrintText_NoCreatingTextBox
+ ld a, MONEY_BOX
+ ld [wTextBoxID], a
+ call DisplayTextBoxID
+ ld hl, SafariZoneEntranceText_f20c9
+ call PrintText
+ pop af
+ inc a
+ jr z, .max_balls
+ cp 29
+ jr c, .load_balls
+.max_balls
+ ld a, 29
+.load_balls
+ ld hl, 502
+ and a
+ ret
+
+SafariZoneEntranceText_f20c4:
+ text_far _SafariZoneLowCostText1
+ text_end
+
+SafariZoneEntranceText_f20c9:
+ text_far _SafariZoneLowCostText2
+ text_end
+
+SafariZoneEntranceGetLowCostAdmissionText:
+ ld hl, wSafariSteps
+ ld a, [hl]
+ push af
+ inc [hl]
+ ld e, a
+ ld d, $0
+ ld hl, Pointers_f2100
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call PrintText
+ pop af
+ cp $3
+ jr z, .give_one_ball
+ scf
+ ret
+
+.give_one_ball
+ ld hl, SafariZoneEntranceText_f20f6
+ call PrintText_NoCreatingTextBox
+ ld a, $1
+ ld hl, 502
+ and a
+ ret
+
+SafariZoneEntranceText_f20f6:
+ text_far _SafariZoneLowCostText3
+ sound_get_item_1
+ text_far _SafariZoneLowCostText4
+ text_end
+
+Pointers_f2100:
+ dw SafariZoneEntranceText_f210a
+ dw SafariZoneEntranceText_f210f
+ dw SafariZoneEntranceText_f2114
+ dw SafariZoneEntranceText_f2119
+ dw SafariZoneEntranceText_f2119
+
+SafariZoneEntranceText_f210a:
+ text_far _SafariZoneLowCostText5
+ text_end
+
+SafariZoneEntranceText_f210f:
+ text_far _SafariZoneLowCostText6
+ text_end
+
+SafariZoneEntranceText_f2114:
+ text_far _SafariZoneLowCostText7
+ text_end
+
+SafariZoneEntranceText_f2119:
+ text_far _SafariZoneLowCostText8
+ text_end
+
+SafariZoneEntranceConvertBCDtoNumber:
+ push hl
+ ld c, a
+ and $f
+ ld l, a
+ ld h, $0
+ ld a, c
+ and $f0
+ swap a
+ ld bc, 10
+ call AddNTimes
+ ld a, l
+ pop hl
+ ret
diff --git a/scripts/SaffronPokecenter.asm b/scripts/SaffronPokecenter.asm
index 68eb4fc6..f4d9f192 100644
--- a/scripts/SaffronPokecenter.asm
+++ b/scripts/SaffronPokecenter.asm
@@ -7,6 +7,7 @@ SaffronPokecenter_TextPointers:
dw SaffronPokecenterText2
dw SaffronPokecenterText3
dw SaffronTradeNurseText
+ dw SaffronPokecenterText5
SaffronHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ SaffronPokecenterText3:
SaffronTradeNurseText:
script_cable_club_receptionist
+
+SaffronPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/SeafoamIslandsB4F.asm b/scripts/SeafoamIslandsB4F.asm
index 5fa51bb7..21db0a4d 100644
--- a/scripts/SeafoamIslandsB4F.asm
+++ b/scripts/SeafoamIslandsB4F.asm
@@ -6,8 +6,9 @@ SeafoamIslandsB4F_Script:
SeafoamIslands5Script_467a5:
xor a
- ld [wSeafoamIslandsB4FCurScript], a
ld [wJoyIgnore], a
+ ld [wSeafoamIslandsB4FCurScript], a
+ ld [wCurMapScript], a
ret
SeafoamIslandsB4F_ScriptPointers:
diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm
index 70119331..63c236ee 100644
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -1,5 +1,5 @@
SilphCo11F_Script:
- call SilphCo11Script_62110
+ call SilphCo11Script_62127
call EnableAutoTextBoxDrawing
ld hl, SilphCo11TrainerHeaders
ld de, SilphCo11F_ScriptPointers
@@ -8,26 +8,27 @@ SilphCo11F_Script:
ld [wSilphCo11FCurScript], a
ret
-SilphCo11Script_62110:
+SilphCo11Script_62127:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
ret z
ld hl, SilphCo11GateCoords
- call SilphCo11Script_62137
- call SilphCo11Script_62163
+ call SilphCo11Script_6214f
+ call SilphCo11Script_6217b
CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR
ret nz
ld a, $20
ld [wNewTileBlockID], a
lb bc, 6, 3
- predef_jump ReplaceTileBlock
+ predef ReplaceTileBlock
+ ret
SilphCo11GateCoords:
dbmapcoord 3, 6
db -1 ; end
-SilphCo11Script_62137:
+SilphCo11Script_6214f:
push hl
ld hl, wCardKeyDoorY
ld a, [hli]
@@ -63,93 +64,17 @@ SilphCo11Script_62137:
ldh [hUnlockedSilphCoDoors], a
ret
-SilphCo11Script_62163:
+SilphCo11Script_6217b:
ldh a, [hUnlockedSilphCoDoors]
and a
ret z
SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR
ret
-SilphCo11Script_6216d:
- ld hl, MissableObjectIDs_6219b
-.asm_62170
- ld a, [hli]
- cp $ff
- jr z, .asm_62181
- push hl
- ld [wMissableObjectIndex], a
- predef HideObject
- pop hl
- jr .asm_62170
-.asm_62181
- ld hl, MissableObjectIDs_62194
-.asm_62184
- ld a, [hli]
- cp -1
- ret z
- push hl
- ld [wMissableObjectIndex], a
- predef ShowObject
- pop hl
- jr .asm_62184
-
-MissableObjectIDs_62194:
- db HS_SAFFRON_CITY_8
- db HS_SAFFRON_CITY_9
- db HS_SAFFRON_CITY_A
- db HS_SAFFRON_CITY_B
- db HS_SAFFRON_CITY_C
- db HS_SAFFRON_CITY_D
- db -1 ; end
-
-MissableObjectIDs_6219b:
- db HS_SAFFRON_CITY_1
- db HS_SAFFRON_CITY_2
- db HS_SAFFRON_CITY_3
- db HS_SAFFRON_CITY_4
- db HS_SAFFRON_CITY_5
- db HS_SAFFRON_CITY_6
- db HS_SAFFRON_CITY_7
- db HS_SAFFRON_CITY_E
- db HS_SAFFRON_CITY_F
- db HS_SILPH_CO_2F_2
- db HS_SILPH_CO_2F_3
- db HS_SILPH_CO_2F_4
- db HS_SILPH_CO_2F_5
- db HS_SILPH_CO_3F_1
- db HS_SILPH_CO_3F_2
- db HS_SILPH_CO_4F_1
- db HS_SILPH_CO_4F_2
- db HS_SILPH_CO_4F_3
- db HS_SILPH_CO_5F_1
- db HS_SILPH_CO_5F_2
- db HS_SILPH_CO_5F_3
- db HS_SILPH_CO_5F_4
- db HS_SILPH_CO_6F_1
- db HS_SILPH_CO_6F_2
- db HS_SILPH_CO_6F_3
- db HS_SILPH_CO_7F_1
- db HS_SILPH_CO_7F_2
- db HS_SILPH_CO_7F_3
- db HS_SILPH_CO_7F_4
- db HS_SILPH_CO_8F_1
- db HS_SILPH_CO_8F_2
- db HS_SILPH_CO_8F_3
- db HS_SILPH_CO_9F_1
- db HS_SILPH_CO_9F_2
- db HS_SILPH_CO_9F_3
- db HS_SILPH_CO_10F_1
- db HS_SILPH_CO_10F_2
- db HS_SILPH_CO_11F_1
- db HS_SILPH_CO_11F_2
- db HS_SILPH_CO_11F_3
- db -1 ; end
-
-SilphCo11Script_621c4:
+SilphCo11Script_62185:
xor a
ld [wJoyIgnore], a
-
-SilphCo11Script_621c8:
+SilphCo11Script_62189:
ld [wSilphCo11FCurScript], a
ld [wCurMapScript], a
ret
@@ -161,10 +86,30 @@ SilphCo11F_ScriptPointers:
dw SilphCo11Script3
dw SilphCo11Script4
dw SilphCo11Script5
+ dw SilphCo11Script6
+ dw SilphCo11Script7
+ dw SilphCo11Script8
+ dw SilphCo11Script9
+ dw SilphCo11Script10
+ dw SilphCo11Script11
+ dw SilphCo11Script12
+ dw SilphCo11Script13
+ dw SilphCo11Script14
SilphCo11Script0:
- CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
+IF DEF(_DEBUG)
+ call DebugPressedOrHeldB
+ ret nz
+ENDC
+ CheckEvent EVENT_BEAT_SILPH_CO_11F_TRAINER_0
+ call z, SilphCo11Script_6229c
+ CheckEvent EVENT_782
ret nz
+ CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI
+ call z, SilphCo11Script_621c5
+ ret
+
+SilphCo11Script_621c5:
ld hl, CoordsData_62211
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
@@ -182,8 +127,9 @@ SilphCo11Script0:
call SetSpriteMovementBytesToFF
ld de, MovementData_62216
call MoveSprite
- ld a, $3
- jp SilphCo11Script_621c8
+ ld a, $4
+ call SilphCo11Script_62189
+ ret
CoordsData_62211:
dbmapcoord 6, 13
@@ -196,18 +142,18 @@ MovementData_62216:
db NPC_MOVEMENT_DOWN
db -1 ; end
-SilphCo11Script_6221a:
+SilphCo11Script_621ff:
ld [wPlayerMovingDirection], a
- ld a, $3
- ldh [hSpriteIndex], a
ld a, b
- ldh [hSpriteFacingDirection], a
- jp SetSpriteFacingDirectionAndDelay
+ ld [wSprite03StateData1FacingDirection], a
+ ld a, $2
+ ld [wSprite03StateData1MovementStatus], a
+ ret
-SilphCo11Script5:
+SilphCo11Script3:
ld a, [wIsInBattle]
cp $ff
- jp z, SilphCo11Script_621c4
+ jp z, SilphCo11Script_62185
ld a, [wcf0d]
cp $1
jr z, .asm_6223c
@@ -218,23 +164,23 @@ SilphCo11Script5:
ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN
.asm_62240
- call SilphCo11Script_6221a
+ call SilphCo11Script_621ff
ld a, $f0
ld [wJoyIgnore], a
- ld a, $6
+ ld a, $7
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
call GBFadeOutToBlack
- call SilphCo11Script_6216d
+ farcall Func_f25a0
call UpdateSprites
call Delay3
call GBFadeInFromBlack
SetEvent EVENT_BEAT_SILPH_CO_GIOVANNI
xor a
ld [wJoyIgnore], a
- jp SilphCo11Script_621c8
+ jp SilphCo11Script_62189
-SilphCo11Script3:
+SilphCo11Script4:
ld a, [wd730]
bit 0, a
ret nz
@@ -251,26 +197,275 @@ SilphCo11Script3:
ld a, PLAYER_DIR_UP
ld b, SPRITE_FACING_DOWN
.asm_62288
- call SilphCo11Script_6221a
+ call SilphCo11Script_621ff
call Delay3
- ld a, $4
- jp SilphCo11Script_621c8
-
-SilphCo11Script4:
+ xor a
+ ld [wJoyIgnore], a
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, SilphCo10Text_62330
- ld de, SilphCo10Text_62330
+ ld hl, SilphCo10Text_62528
+ ld de, SilphCo10Text_62528
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
+ ld a, $3
+ jp SilphCo11Script_62189
+
+SilphCo11Script_6229c:
+ ld a, [wYCoord]
+ cp $3
+ ret nz
+ ld a, [wXCoord]
+ cp $4
+ ret nc
+ ResetEvents EVENT_780, EVENT_781
+ ld a, [wXCoord]
+ cp $3
+ jr z, .asm_622c3
+ SetEventReuseHL EVENT_780
+ ld a, [wXCoord]
+ cp $2
+ jr z, .asm_622c3
+ ResetEventReuseHL EVENT_780
+ SetEventReuseHL EVENT_781
+.asm_622c3
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $ff
ld [wJoyIgnore], a
+ SetEvent EVENT_782
ld a, $5
- jp SilphCo11Script_621c8
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11MovementData_622f5:
+ db $5
+ db $5
+ db $5
+ db $5
+ db $5
+ db $ff
+
+SilphCo11MovementData_622fb:
+ db $5
+ db $5
+ db $5
+ db $5
+ db $ff
+
+SilphCo11MovementData_62300:
+ db $5
+ db $5
+ db $5
+ db $5
+ db $ff
+
+SilphCo11MovementData_62305:
+ db $5
+ db $5
+ db $5
+ db $5
+ db $5
+ db $ff
+
+SilphCo11MovementData_6230b:
+ db $5
+ db $5
+ db $6
+ db $5
+ db $5
+ db $ff
+
+SilphCo11MovementData_62311:
+ db $5
+ db $5
+ db $5
+ db $6
+ db $5
+ db $5
+ db $ff
+
+SilphCo11Script5:
+ ld de, SilphCo11MovementData_622f5
+ CheckEitherEventSet EVENT_780, EVENT_781
+ and a
+ jr z, .asm_6232d
+ ld de, SilphCo11MovementData_62300
+ cp $1
+ jr z, .asm_6232d
+ ld de, SilphCo11MovementData_6230b
+.asm_6232d
+ ld a, $4
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $6
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script6:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+SilphCo11Script7:
+ ld a, $2
+ ld [wSprite04StateData1MovementStatus], a
+ ld hl, wSprite04StateData1FacingDirection
+ ld [hl], SPRITE_FACING_RIGHT
+ CheckEitherEventSet EVENT_780, EVENT_781
+ and a
+ jr z, .asm_6235e
+ ld [hl], SPRITE_FACING_UP
+.asm_6235e
+ call Delay3
+ ld a, $fc
+ ld [wJoyIgnore], a
+SilphCo11Script8:
+ ld de, SilphCo11MovementData_622fb
+ CheckEitherEventSet EVENT_780, EVENT_781
+ and a
+ jr z, .asm_6237b
+ ld de, SilphCo11MovementData_62305
+ cp $1
+ jr z, .asm_6237b
+ ld de, SilphCo11MovementData_62311
+.asm_6237b
+ ld a, $6
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $9
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script9:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+ ld a, $fc
+ ld [wJoyIgnore], a
+SilphCo11Script10:
+ ld a, $2
+ ld [wSprite06StateData1MovementStatus], a
+ ld hl, wSprite06StateData1FacingDirection
+ ld [hl], SPRITE_FACING_UP
+ CheckEitherEventSet EVENT_780, EVENT_781
+ and a
+ jr z, .asm_623b1
+ ld [hl], SPRITE_FACING_LEFT
+.asm_623b1
+ call Delay3
+ ld a, $9
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+SilphCo11Script11:
+ ld hl, wd72d
+ set 6, [hl]
+ set 7, [hl]
+ ld hl, SilphCo11Text_624c2
+ ld de, SilphCo11Text_624c2
+ call SaveEndBattleTextPointers
+ ld a, OPP_ROCKET
+ ld [wCurOpponent], a
+ ld a, $2d
+ ld [wTrainerNo], a
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ ld a, $c
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script12:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, [wIsInBattle]
+ cp $ff
+ jp z, SilphCo11Script_62185
+ ld a, $2
+ ld [wSprite04StateData1MovementStatus], a
+ ld [wSprite06StateData1MovementStatus], a
+ xor a
+ ld [wSprite04StateData1FacingDirection], a
+ ld [wSprite06StateData1FacingDirection], a
+ ld a, $fc
+ ld [wJoyIgnore], a
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, $a
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ call StopAllMusic
+ ld c, BANK(Music_MeetJessieJames)
+ ld a, MUSIC_MEET_JESSIE_JAMES
+ call PlayMusic
+ ld a, $ff
+ ld [wJoyIgnore], a
+ ld a, $d
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script13:
+ ld a, $ff
+ ld [wJoyIgnore], a
+ call GBFadeOutToBlack
+ ld a, HS_SILPH_CO_11F_JAMES
+ call SilphCo11Script_6246d
+ ld a, HS_SILPH_CO_11F_JESSIE
+ call SilphCo11Script_6246d
+ call UpdateSprites
+ call Delay3
+ call GBFadeInFromBlack
+ ld a, $e
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script14:
+ call PlayDefaultMusic
+ xor a
+ ldh [hJoyHeld], a
+ ld [wJoyIgnore], a
+ ResetEvent EVENT_782
+ SetEventReuseHL EVENT_BEAT_SILPH_CO_11F_TRAINER_0
+ ld a, $0
+ call SilphCo11Script_62189
+ ret
+
+SilphCo11Script_6245e:
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ call UpdateSprites
+ call Delay3
+ ret
+
+SilphCo11Script_6246d:
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ret
SilphCo11F_TextPointers:
dw SilphCo11Text1
@@ -279,15 +474,50 @@ SilphCo11F_TextPointers:
dw SilphCo11Text4
dw SilphCo11Text5
dw SilphCo11Text6
+ dw SilphCo11Text7
+ dw SilphCo11Text8
+ dw SilphCo11Text9
+ dw SilphCo11Text10
SilphCo11TrainerHeaders:
- def_trainers 4
+ def_trainers 5
SilphCo11TrainerHeader0:
- trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_0, 4, SilphCo11BattleText1, SilphCo11EndBattleText1, SilphCo11AfterBattleText1
-SilphCo11TrainerHeader1:
- trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_1, 3, SilphCo11BattleText2, SilphCo11EndBattleText2, SilphCo11AfterBattleText2
+ trainer EVENT_BEAT_SILPH_CO_11F_TRAINER_1, 3, SilphCo11Trainer1BattleText, SilphCo11Trainer1EndBattleText, SilphCo11Trainer1AfterBattleText
db -1 ; end
+SilphCo11Text4:
+SilphCo11Text6:
+SilphCo11Text8:
+ text_far _SilphCoJessieJamesText1
+ text_asm
+ ld c, 10
+ call DelayFrames
+ ld a, $4
+ ld [wPlayerMovingDirection], a
+ ld a, $0
+ ld [wEmotionBubbleSpriteIndex], a
+ ld a, EXCLAMATION_BUBBLE
+ ld [wWhichEmotionBubble], a
+ predef EmotionBubble
+ ld c, 20
+ call DelayFrames
+ jp TextScriptEnd
+
+SilphCo11Text9:
+ text_far _SilphCoJessieJamesText2
+ text_end
+
+SilphCo11Text_624c2:
+ text_far _SilphCoJessieJamesText3
+ text_end
+
+SilphCo11Text10:
+ text_far _SilphCoJessieJamesText4
+ text_asm
+ ld c, 64
+ call DelayFrames
+ jp TextScriptEnd
+
SilphCo11Text1:
text_asm
CheckEvent EVENT_GOT_MASTER_BALL
@@ -336,58 +566,28 @@ SilphCo11Text3:
text_far _SilphCo11Text3
text_end
-SilphCo10Text_62330:
+SilphCo10Text_62528:
text_far _SilphCo10Text_62330
text_end
-SilphCo11Text6:
+SilphCo11Text7:
text_far _SilphCo10Text_62335
text_end
-SilphCo11Text4:
- text_asm
- ld hl, SilphCo11TrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
-
-SilphCo11BattleText1:
- text_far _SilphCo11BattleText1
- text_end
-
-SilphCo11EndBattleText1:
- text_far _SilphCo11EndBattleText1
- text_end
-
-SilphCo11AfterBattleText1:
- text_far _SilphCo11AfterBattleText1
- text_end
-
SilphCo11Text5:
text_asm
- ld hl, SilphCo11TrainerHeader1
+ ld hl, SilphCo11TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
-SilphCo11BattleText2:
+SilphCo11Trainer1BattleText:
text_far _SilphCo11BattleText2
text_end
-SilphCo11EndBattleText2:
+SilphCo11Trainer1EndBattleText:
text_far _SilphCo11EndBattleText2
text_end
-SilphCo11AfterBattleText2:
+SilphCo11Trainer1AfterBattleText:
text_far _SilphCo11AfterBattleText2
text_end
-
-SilphCo10Text_6236c:
- text_asm
- ld hl, SilphCo10Text_6237b
- call PrintText
- ld a, PORYGON
- call DisplayPokedex
- jp TextScriptEnd
-
-SilphCo10Text_6237b:
- text_far _SilphCo10Text_6237b
- text_end
diff --git a/scripts/SilphCo11F_2.asm b/scripts/SilphCo11F_2.asm
new file mode 100644
index 00000000..c8fd9c3e
--- /dev/null
+++ b/scripts/SilphCo11F_2.asm
@@ -0,0 +1,76 @@
+Func_f25a0::
+ ld hl, MissableObjects_f25ce
+.asm_f25a3
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_f25b4
+ push hl
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ pop hl
+ jr .asm_f25a3
+
+.asm_f25b4
+ ld hl, MissableObjects_f25c7
+.asm_f25b7
+ ld a, [hli]
+ cp $ff
+ ret z
+ push hl
+ ld [wMissableObjectIndex], a
+ predef ShowObject
+ pop hl
+ jr .asm_f25b7
+
+MissableObjects_f25c7:
+ db HS_SAFFRON_CITY_8
+ db HS_SAFFRON_CITY_9
+ db HS_SAFFRON_CITY_A
+ db HS_SAFFRON_CITY_B
+ db HS_SAFFRON_CITY_C
+ db HS_SAFFRON_CITY_D
+ db $FF
+
+MissableObjects_f25ce:
+ db HS_SAFFRON_CITY_1
+ db HS_SAFFRON_CITY_2
+ db HS_SAFFRON_CITY_3
+ db HS_SAFFRON_CITY_4
+ db HS_SAFFRON_CITY_5
+ db HS_SAFFRON_CITY_6
+ db HS_SAFFRON_CITY_7
+ db HS_SAFFRON_CITY_E
+ db HS_SAFFRON_CITY_F
+ db HS_SILPH_CO_2F_2
+ db HS_SILPH_CO_2F_3
+ db HS_SILPH_CO_2F_4
+ db HS_SILPH_CO_2F_5
+ db HS_SILPH_CO_3F_1
+ db HS_SILPH_CO_3F_2
+ db HS_SILPH_CO_4F_1
+ db HS_SILPH_CO_4F_2
+ db HS_SILPH_CO_4F_3
+ db HS_SILPH_CO_5F_1
+ db HS_SILPH_CO_5F_2
+ db HS_SILPH_CO_5F_3
+ db HS_SILPH_CO_5F_4
+ db HS_SILPH_CO_6F_1
+ db HS_SILPH_CO_6F_2
+ db HS_SILPH_CO_6F_3
+ db HS_SILPH_CO_7F_1
+ db HS_SILPH_CO_7F_2
+ db HS_SILPH_CO_7F_3
+ db HS_SILPH_CO_7F_4
+ db HS_SILPH_CO_8F_1
+ db HS_SILPH_CO_8F_2
+ db HS_SILPH_CO_8F_3
+ db HS_SILPH_CO_9F_1
+ db HS_SILPH_CO_9F_2
+ db HS_SILPH_CO_9F_3
+ db HS_SILPH_CO_10F_1
+ db HS_SILPH_CO_10F_2
+ db HS_SILPH_CO_11F_1
+ db HS_SILPH_CO_11F_JAMES
+ db HS_SILPH_CO_11F_2
+ db HS_SILPH_CO_11F_JESSIE
+ db $ff
diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm
index ac4aaa89..b2a63292 100644
--- a/scripts/SilphCo7F.asm
+++ b/scripts/SilphCo7F.asm
@@ -130,9 +130,7 @@ SilphCo7Script0:
ld [wJoyIgnore], a
ld a, PLAYER_DIR_DOWN
ld [wPlayerMovingDirection], a
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
@@ -186,21 +184,11 @@ SilphCo7Script3:
ld a, OPP_RIVAL2
ld [wCurOpponent], a
ld a, [wRivalStarter]
- cp STARTER2
- jr nz, .asm_51cb6
- ld a, $7
- jr .asm_51cc0
-.asm_51cb6
- cp STARTER3
- jr nz, .asm_51cbe
- ld a, $8
- jr .asm_51cc0
-.asm_51cbe
- ld a, $9
-.asm_51cc0
+ add 4
ld [wTrainerNo], a
ld a, $4
- jp SilphCo7Text_51c10
+ call SilphCo7Text_51c10
+ ret
SilphCo7Script4:
ld a, [wIsInBattle]
@@ -219,9 +207,7 @@ SilphCo7Script4:
ld a, $f
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, SFX_STOP_ALL_MUSIC
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
farcall Music_RivalAlternateStart
ld de, MovementData_51d1d
ld a, [wcf0d]
diff --git a/scripts/SummerBeachHouse.asm b/scripts/SummerBeachHouse.asm
new file mode 100644
index 00000000..45e8032d
--- /dev/null
+++ b/scripts/SummerBeachHouse.asm
@@ -0,0 +1,196 @@
+SummerBeachHouse_Script:
+ call EnableAutoTextBoxDrawing
+ ret
+
+SummerBeachHouse_TextPointers:
+ dw SurfinDudeText
+ dw SummerBeachHousePikachuText
+ dw SummerBeachHouseSign1Text
+ dw SummerBeachHouseSign2Text
+ dw SummerBeachHouseSign3Text
+ dw SummerBeachHouseSign4Text
+
+SurfinDudeText:
+ text_asm
+ ld a, [wd472]
+ bit 6, a
+ jr nz, .next
+ ld hl, .SurfinDudeText4
+ call PrintText
+ jr .done
+.next
+ ld hl, wd492
+ bit 0, [hl]
+ set 0, [hl]
+ jr nz, .next2
+ ld hl, .SurfinDudeText1
+ jr .next3
+.next2
+ ld hl, .SurfinDudeText3
+.next3
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_f226b
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ farcall SurfingPikachuMinigame
+ ld hl, wd492
+ set 1, [hl]
+ jr .done
+.asm_f226b
+ ld hl, .SurfinDudeText2
+ call PrintText
+.done
+ jp TextScriptEnd
+
+.SurfinDudeText1
+ text_far _SurfinDudeText1
+ text_end
+.SurfinDudeText2
+ text_far _SurfinDudeText2
+ text_end
+.SurfinDudeText3
+ text_far _SurfinDudeText3
+ text_end
+.SurfinDudeText4
+ text_far _SurfinDudeText4
+ text_end
+
+SummerBeachHousePikachuText:
+ text_asm
+ ld hl, .SummerBeachHousePikachuText
+ call PrintText
+ ld a, PIKACHU
+ call PlayCry
+ call WaitForSoundToFinish
+ jp TextScriptEnd
+
+.SummerBeachHousePikachuText
+ text_far _SummerBeachHousePikachuText
+ text_end
+
+SummerBeachHouseSign1Text:
+ text_asm
+ ld hl, .SummerBeachHouseSign1Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .SummerBeachHouseSign1Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.SummerBeachHouseSign1Text1
+ text_far _SummerBeachHouseSign1Text1
+ text_end
+.SummerBeachHouseSign1Text2
+ text_far _SummerBeachHouseSign1Text2
+ text_end
+
+SummerBeachHouseSign2Text:
+ text_asm
+ ld hl, .SummerBeachHouseSign2Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .SummerBeachHouseSign2Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.SummerBeachHouseSign2Text1
+ text_far _SummerBeachHouseSign2Text1
+ text_end
+.SummerBeachHouseSign2Text2
+ text_far _SummerBeachHouseSign2Text2
+ text_end
+
+SummerBeachHouseSign3Text:
+ text_asm
+ ld hl, .SummerBeachHouseSign3Text2
+ ld a, [wd472]
+ bit 6, a
+ jr z, .next
+ ld hl, .SummerBeachHouseSign3Text1
+.next
+ call PrintText
+ jp TextScriptEnd
+
+.SummerBeachHouseSign3Text1
+ text_far _SummerBeachHouseSign3Text1
+ text_end
+.SummerBeachHouseSign3Text2
+ text_far _SummerBeachHouseSign3Text2
+ text_end
+
+SummerBeachHouseSign4Text:
+ text_asm
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld a, [wd472]
+ bit 6, a
+ jr z, .asm_f2369
+
+ ld hl, wd492
+ bit 1, [hl]
+ jr z, .next2
+ ld a, 0
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+.next2
+ ld hl, .SummerBeachHousePrinterText2
+ call PrintText
+ ld a, [wd492]
+ bit 1, a
+ jr z, .asm_f236f
+
+ ld a, 1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, .SummerBeachHousePrinterText3
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jp z, Func_f23d0
+ call SaveScreenTilesToBuffer2
+ ld hl, wd730
+ set 6, [hl]
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ callfar Printer_PrepareSurfingMinigameHighScoreTileMap
+ call WaitForTextScrollButtonPress
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld a, 1
+ ld [wUpdateSpritesEnabled], a
+ jr .asm_f236f
+.asm_f2369
+ ld hl, .SummerBeachHousePrinterText1
+ call PrintText
+.asm_f236f
+ jp TextScriptEnd
+
+.SummerBeachHousePrinterText1
+ text_far _SummerBeachHousePrinterText1
+ text_waitbutton
+ text_end
+
+.SummerBeachHousePrinterText2
+ text_far _SummerBeachHousePrinterText2
+ text_waitbutton
+ text_end
+
+.SummerBeachHousePrinterText3
+ text_far _SummerBeachHousePrinterText3
+ text_end
+
+.SummerBeachHousePrinterText4
+ text_far _SummerBeachHousePrinterText4
+ text_end
diff --git a/scripts/SummerBeachHouse2.asm b/scripts/SummerBeachHouse2.asm
new file mode 100644
index 00000000..4ac1f705
--- /dev/null
+++ b/scripts/SummerBeachHouse2.asm
@@ -0,0 +1,33 @@
+Func_f23d0:
+ call SaveScreenTilesToBuffer2
+ xor a
+ ld [wUpdateSpritesEnabled], a
+ ld hl, wd730
+ set 6, [hl]
+ callfar PrintSurfingMinigameHighScore
+ ld hl, wd730
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ReloadTilesetTilePatterns
+ call RestoreScreenTilesAndReloadTilePatterns
+ call LoadScreenTilesFromBuffer2
+ call Delay3
+ call GBPalNormal
+ ld hl, Text_f2412
+ ldh a, [hOaksAideResult]
+ and a
+ jr nz, .asm_f2406
+ ld hl, Text_f240c
+.asm_f2406
+ call PrintText
+ jp TextScriptEnd
+
+Text_f240c:
+ text_far _SummerBeachHousePrinterText5
+ text_waitbutton
+ text_end
+
+Text_f2412:
+ text_far _SummerBeachHousePrinterText6
+ text_waitbutton
+ text_end
diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm
index 629bb0c8..8a93b6da 100644
--- a/scripts/VermilionCity.asm
+++ b/scripts/VermilionCity.asm
@@ -1,5 +1,7 @@
VermilionCity_Script:
call EnableAutoTextBoxDrawing
+ ld hl, wd492
+ res 7, [hl]
ld hl, wCurrentMapScriptFlags
bit 6, [hl]
res 6, [hl]
@@ -11,11 +13,24 @@ VermilionCity_Script:
call nz, .setFirstLockTrashCanIndex
ld hl, VermilionCity_ScriptPointers
ld a, [wVermilionCityCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ call .vermilionCityScript_19869
+ ret
+
+.vermilionCityScript_19869
+ CheckEventHL EVENT_152
+ ret nz
+ CheckEventReuseHL EVENT_GOT_BIKE_VOUCHER
+ ret z
+ SetEventReuseHL EVENT_152
+ ret
.setFirstLockTrashCanIndex
call Random
+ ldh a, [hRandomAdd]
+ ld b, a
ldh a, [hRandomSub]
+ adc b
and $e
ld [wFirstLockTrashCanIndex], a
ret
@@ -40,10 +55,10 @@ VermilionCity_ScriptPointers:
VermilionCityScript0:
ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
- ret nz
+ jr nz, .return
ld hl, SSAnneTicketCheckCoords
call ArePlayerCoordsInArray
- ret nc
+ jr nc, .return
xor a
ldh [hJoyHeld], a
ld [wcf0d], a
@@ -67,6 +82,9 @@ VermilionCityScript0:
ld [wVermilionCityCurScript], a
ret
+.return
+ ret
+
SSAnneTicketCheckCoords:
dbmapcoord 18, 30
db -1 ; end
@@ -122,11 +140,12 @@ VermilionCity_TextPointers:
dw VermilionCityText6
dw VermilionCityText7
dw VermilionCityText8
+ dw VermilionCityText9
dw MartSignText
dw PokeCenterSignText
- dw VermilionCityText11
dw VermilionCityText12
dw VermilionCityText13
+ dw VermilionCityText14
VermilionCityText1:
text_far _VermilionCityText1
@@ -225,33 +244,43 @@ VermilionCityText5:
ld a, MACHOP
call PlayCry
call WaitForSoundToFinish
- ld hl, VermilionCityText14
+ ld hl, VermilionCityText15
ret
-VermilionCityText14:
- text_far _VermilionCityText14
+VermilionCityText15:
+ text_far _VermilionCityText15
text_end
VermilionCityText6:
text_far _VermilionCityText6
text_end
-VermilionCityText7:
- text_far _VermilionCityText7
- text_end
-
VermilionCityText8:
- text_far _VermilionCityText8
- text_end
+ text_asm
+ farcall Func_f1a8a
+ jp TextScriptEnd
-VermilionCityText11:
- text_far _VermilionCityText11
- text_end
+VermilionCityText9:
+ text_asm
+ farcall Func_f1a96
+ jp TextScriptEnd
VermilionCityText12:
- text_far _VermilionCityText12
- text_end
+ text_asm
+ farcall Func_f1aa2
+ jp TextScriptEnd
VermilionCityText13:
- text_far _VermilionCityText13
- text_end
+ text_asm
+ farcall Func_f1aae
+ jp TextScriptEnd
+
+VermilionCityText14:
+ text_asm
+ farcall Func_f1aba
+ jp TextScriptEnd
+
+VermilionCityText7:
+ text_asm
+ farcall Func_f1a0f
+ jp TextScriptEnd
diff --git a/scripts/VermilionCity2.asm b/scripts/VermilionCity2.asm
new file mode 100644
index 00000000..93aa8df5
--- /dev/null
+++ b/scripts/VermilionCity2.asm
@@ -0,0 +1,111 @@
+Func_f1a0f::
+ CheckEvent EVENT_GOT_SQUIRTLE_FROM_OFFICER_JENNY
+ jr nz, .asm_f1a69
+ ld a, [wBeatGymFlags]
+ bit 2, a ; THUNDERBADGE
+ jr nz, .asm_f1a24
+ ld hl, OfficerJennyText1
+ call PrintText
+ ret
+
+.asm_f1a24
+ ld hl, OfficerJennyText2
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .asm_f1a62
+ ld a, SQUIRTLE
+ ld [wd11e], a
+ ld [wcf91], a
+ call GetMonName
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ lb bc, SQUIRTLE, 10
+ call GivePokemon
+ ret nc
+ ld a, [wAddedToParty]
+ and a
+ call z, WaitForTextScrollButtonPress
+ ld a, $1
+ ld [wDoNotWaitForButtonPressAfterDisplayingText], a
+ ld hl, OfficerJennyText3
+ call PrintText
+ SetEvent EVENT_GOT_SQUIRTLE_FROM_OFFICER_JENNY
+ ret
+
+.asm_f1a62
+ ld hl, OfficerJennyText4
+ call PrintText
+ ret
+
+.asm_f1a69
+ ld hl, OfficerJennyText5
+ call PrintText
+ ret
+
+OfficerJennyText1:
+ text_far _OfficerJennyText1
+ text_end
+
+OfficerJennyText2:
+ text_far _OfficerJennyText2
+ text_end
+
+OfficerJennyText3:
+ text_far _OfficerJennyText3
+ text_waitbutton
+ text_end
+
+OfficerJennyText4:
+ text_far _OfficerJennyText4
+ text_end
+
+OfficerJennyText5:
+ text_far _OfficerJennyText5
+ text_end
+
+Func_f1a8a::
+ ld hl, VermilionCityText_f1a91
+ call PrintText
+ ret
+
+VermilionCityText_f1a91:
+ text_far _VermilionCityText8
+ text_end
+
+Func_f1a96::
+ ld hl, VermilionCityText_f1a9d
+ call PrintText
+ ret
+
+VermilionCityText_f1a9d:
+ text_far _VermilionCityText9
+ text_end
+
+Func_f1aa2::
+ ld hl, VermilionCityText_f1aa9
+ call PrintText
+ ret
+
+VermilionCityText_f1aa9:
+ text_far _VermilionCityText12
+ text_end
+
+Func_f1aae::
+ ld hl, VermilionCityText_f1ab5
+ call PrintText
+ ret
+
+VermilionCityText_f1ab5:
+ text_far _VermilionCityText13
+ text_end
+
+Func_f1aba::
+ ld hl, VermilionCityText_f1ac1
+ call PrintText
+ ret
+
+VermilionCityText_f1ac1:
+ text_far _VermilionCityText14
+ text_end
diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm
index f98e1250..af118d18 100644
--- a/scripts/VermilionDock.asm
+++ b/scripts/VermilionDock.asm
@@ -38,10 +38,9 @@ VermilionDock_Script:
VermilionDock_1db9b:
SetEventForceReuseHL EVENT_SS_ANNE_LEFT
- ld a, SFX_STOP_ALL_MUSIC
+ ld a, $ff
ld [wJoyIgnore], a
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
ld c, BANK(Music_Surfing)
ld a, MUSIC_SURFING
call PlayMusic
@@ -63,6 +62,7 @@ VermilionDock_1db9b:
ldh [hAutoBGTransferEnabled], a
ld [wSSAnneSmokeDriftAmount], a
ldh [rOBP1], a
+ call UpdateGBCPal_OBP1
ld a, 88
ld [wSSAnneSmokeX], a
ld hl, wMapViewVRAMPointer
diff --git a/scripts/VermilionPokecenter.asm b/scripts/VermilionPokecenter.asm
index 65b5a3df..dd3b514e 100644
--- a/scripts/VermilionPokecenter.asm
+++ b/scripts/VermilionPokecenter.asm
@@ -7,6 +7,7 @@ VermilionPokecenter_TextPointers:
dw VermilionPokecenterText2
dw VermilionPokecenterText3
dw VermilionTradeNurseText
+ dw VermilionPokecenterText5
VermilionHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ VermilionPokecenterText3:
VermilionTradeNurseText:
script_cable_club_receptionist
+
+VermilionPokecenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/VermilionTradeHouse.asm b/scripts/VermilionTradeHouse.asm
index 7fdb9f40..6cdd849a 100644
--- a/scripts/VermilionTradeHouse.asm
+++ b/scripts/VermilionTradeHouse.asm
@@ -5,8 +5,5 @@ VermilionTradeHouse_TextPointers:
dw VermilionHouse3Text1
VermilionHouse3Text1:
- text_asm
- ld a, TRADE_FOR_DUX
- ld [wWhichTrade], a
- predef DoInGameTradeDialogue
- jp TextScriptEnd
+ text_far TeachingHMsText
+ text_end
diff --git a/scripts/VictoryRoad1F.asm b/scripts/VictoryRoad1F.asm
index e07e549e..f7b3b65f 100644
--- a/scripts/VictoryRoad1F.asm
+++ b/scripts/VictoryRoad1F.asm
@@ -29,6 +29,9 @@ VictoryRoad1Script0:
ld hl, CoordsData_5da5c
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
+ ldh a, [hSpriteIndex]
+ cp $f
+ jp z, CheckFightingMapTrainers
ld hl, wCurrentMapScriptFlags
set 5, [hl]
SetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
diff --git a/scripts/VictoryRoad2F.asm b/scripts/VictoryRoad2F.asm
index d86c7a16..2bf46e98 100644
--- a/scripts/VictoryRoad2F.asm
+++ b/scripts/VictoryRoad2F.asm
@@ -44,6 +44,9 @@ VictoryRoad2Script0:
ld hl, CoordsData_51816
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
+ ldh a, [hSpriteIndexOrTextID]
+ cp $f
+ jp z, CheckFightingMapTrainers
EventFlagAddress hl, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1
ld a, [wCoordIndex]
cp $2
diff --git a/scripts/VictoryRoad3F.asm b/scripts/VictoryRoad3F.asm
index c0a0f191..d1f42ac1 100644
--- a/scripts/VictoryRoad3F.asm
+++ b/scripts/VictoryRoad3F.asm
@@ -36,6 +36,9 @@ VictoryRoad3Script0:
ld a, [wCoordIndex]
cp $1
jr nz, .asm_449dc
+ ldh a, [hSpriteIndexOrTextID]
+ cp $f ; Pikachu
+ jp z, .asm_449fe
ld hl, wCurrentMapScriptFlags
set 5, [hl]
SetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
diff --git a/scripts/ViridianCity.asm b/scripts/ViridianCity.asm
index 96e58a19..d960b9cb 100644
--- a/scripts/ViridianCity.asm
+++ b/scripts/ViridianCity.asm
@@ -2,19 +2,34 @@ ViridianCity_Script:
call EnableAutoTextBoxDrawing
ld hl, ViridianCity_ScriptPointers
ld a, [wViridianCityCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
ViridianCity_ScriptPointers:
dw ViridianCityScript0
dw ViridianCityScript1
dw ViridianCityScript2
dw ViridianCityScript3
+ dw ViridianCityScript4
+ dw ViridianCityScript5
+ dw ViridianCityScript6
+ dw ViridianCityScript7
+ dw ViridianCityScript8
+ dw ViridianCityScript9
+ dw ViridianCityScript10
ViridianCityScript0:
- call ViridianCityScript_1900b
- jp ViridianCityScript_1903d
+ call ViridianCityScript_1905b
+ call ViridianCityScript_190ab
+ ret
+
+ViridianCityScript1:
+ call ViridianCityScript_19162
+ViridianCityScript2:
+ call ViridianCityScript_1905b
+ ret
-ViridianCityScript_1900b:
+ViridianCityScript_1905b:
CheckEvent EVENT_VIRIDIAN_GYM_OPEN
ret nz
ld a, [wObtainedBadges]
@@ -29,19 +44,32 @@ ViridianCityScript_1900b:
ld a, [wXCoord]
cp 32
ret nz
- ld a, $e
+ ld a, $f
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
+ call StartSimulatingJoypadStates
+ ld a, $1
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_DOWN
+ ld [wSimulatedJoypadStatesEnd], a
xor a
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld [wJoyIgnore], a
ldh [hJoyHeld], a
- call ViridianCityScript_190cf
- ld a, $3
+ ld a, $6
ld [wViridianCityCurScript], a
ret
-ViridianCityScript_1903d:
- CheckEvent EVENT_GOT_POKEDEX
+ViridianCityScript6:
+ ld a, [wSimulatedJoypadStatesIndex]
+ and a
ret nz
+ call Delay3
+ ld a, $2
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityScript_190ab:
ld a, [wYCoord]
cp 9
ret nz
@@ -53,12 +81,31 @@ ViridianCityScript_1903d:
call DisplayTextID
xor a
ldh [hJoyHeld], a
- call ViridianCityScript_190cf
- ld a, $3
+ call ViridianCityScript_1914d
+ ld a, $5
ld [wViridianCityCurScript], a
ret
-ViridianCityScript1:
+ViridianCityScript3:
+ call ViridianCityScript_190ef
+ call ViridianCityScript_190db
+ ResetEvent EVENT_02F
+ ld a, $4
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityScript_190db:
+ xor a
+ ld [wListScrollOffset], a
+ ld a, BATTLE_TYPE_OLD_MAN
+ ld [wBattleType], a
+ ld a, 5
+ ld [wCurEnemyLVL], a
+ ld a, RATTATA
+ ld [wCurOpponent], a
+ ret
+
+ViridianCityScript_190ef:
ld a, [wSprite03StateData1YPixels]
ldh [hSpriteScreenYCoord], a
ld a, [wSprite03StateData1XPixels]
@@ -67,21 +114,26 @@ ViridianCityScript1:
ldh [hSpriteMapYCoord], a
ld a, [wSprite03StateData2MapX]
ldh [hSpriteMapXCoord], a
- xor a
- ld [wListScrollOffset], a
+ ret
- ; set up battle for Old Man
- ld a, BATTLE_TYPE_OLD_MAN
+ViridianCityScript4:
+ call ViridianCityScript_1912a
+ call UpdateSprites
+ call Delay3
+ SetEvent EVENT_02E
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $10
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
ld [wBattleType], a
- ld a, 5
- ld [wCurEnemyLVL], a
- ld a, WEEDLE
- ld [wCurOpponent], a
+ ld [wJoyIgnore], a
ld a, $2
ld [wViridianCityCurScript], a
ret
-ViridianCityScript2:
+ViridianCityScript_1912a:
ldh a, [hSpriteScreenYCoord]
ld [wSprite03StateData1YPixels], a
ldh a, [hSpriteScreenXCoord]
@@ -90,30 +142,18 @@ ViridianCityScript2:
ld [wSprite03StateData2MapY], a
ldh a, [hSpriteMapXCoord]
ld [wSprite03StateData2MapX], a
- call UpdateSprites
- call Delay3
- xor a
- ld [wJoyIgnore], a
- ld a, $f
- ldh [hSpriteIndexOrTextID], a
- call DisplayTextID
- xor a
- ld [wBattleType], a
- ld [wJoyIgnore], a
- ld a, $0
- ld [wViridianCityCurScript], a
ret
-ViridianCityScript3:
+ViridianCityScript5:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
call Delay3
- ld a, 0
+ ld a, $0
ld [wViridianCityCurScript], a
ret
-ViridianCityScript_190cf:
+ViridianCityScript_1914d:
call StartSimulatingJoypadStates
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
@@ -124,204 +164,200 @@ ViridianCityScript_190cf:
ld [wJoyIgnore], a
ret
+ViridianCityScript_19162:
+ CheckEvent EVENT_02D
+ ret nz
+ ld a, [wYCoord]
+ cp 9
+ ret nz
+ ld a, [wXCoord]
+ cp 19
+ ret nz
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ ld a, SPRITE_FACING_RIGHT
+ ldh [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
+ ld a, $8
+ ld [wSpritePlayerStateData1FacingDirection], a
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ ld a, D_UP | D_DOWN | D_LEFT | D_RIGHT | START | SELECT
+ ld [wJoyIgnore], a
+ ret
+
+ViridianCityScript7:
+ call ViridianCityScript_190ef
+ call ViridianCityScript_190db
+ SetEvent EVENT_02F
+ ld a, D_UP | D_DOWN | D_LEFT | D_RIGHT | START | SELECT
+ ld [wJoyIgnore], a
+ ld a, $8
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityScript8:
+ call ViridianCityScript_1912a
+ call UpdateSprites
+ call Delay3
+ SetEvent EVENT_02D
+ ld a, D_UP | D_DOWN | D_LEFT | D_RIGHT | START | SELECT
+ ld [wJoyIgnore], a
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ call DisplayTextID
+ xor a
+ ld [wBattleType], a
+ dec a
+ ld [wJoyIgnore], a
+ ld a, $9
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityScript9:
+ ld de, ViridianCityOldManMovementData2
+ ld a, [wXCoord]
+ cp 19
+ jr z, .asm_191e4
+ callfar Func_f1a01
+ ld de, ViridianCityOldManMovementData1
+.asm_191e4
+ ld a, $8
+ ldh [hSpriteIndexOrTextID], a
+ call MoveSprite
+ ld a, $a
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityOldManMovementData1:
+ db NPC_MOVEMENT_RIGHT
+ViridianCityOldManMovementData2:
+ db NPC_MOVEMENT_DOWN
+ db NPC_MOVEMENT_DOWN
+ db NPC_MOVEMENT_DOWN
+ db NPC_MOVEMENT_DOWN
+ db NPC_MOVEMENT_DOWN
+ db NPC_MOVEMENT_DOWN
+ db $ff
+
+ViridianCityScript10:
+ ld a, [wd730]
+ bit 0, a
+ ret nz
+ ld a, $3
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ xor a
+ ld [wJoyIgnore], a
+ ld a, $2
+ ld [wViridianCityCurScript], a
+ ret
+
ViridianCity_TextPointers:
- dw ViridianCityText1
- dw ViridianCityText2
- dw ViridianCityText3
- dw ViridianCityText4
- dw ViridianCityText5
- dw ViridianCityText6
- dw ViridianCityText7
- dw ViridianCityText8
- dw ViridianCityText9
- dw ViridianCityText10
+ dw ViridianCityText_0
+ dw ViridianCityText_1
+ dw ViridianCityText_2
+ dw ViridianCityText_3
+ dw ViridianCityText_4
+ dw ViridianCityText_5
+ dw ViridianCityText_6
+ dw ViridianCityText_7
+ dw ViridianCityText_8
+ dw ViridianCityText_9
+ dw ViridianCityText_10
dw MartSignText
dw PokeCenterSignText
- dw ViridianCityText13
- dw ViridianCityText14
- dw ViridianCityText15
+ dw ViridianCityText_11
+ dw ViridianCityText_12
+ dw ViridianCityText_13
-ViridianCityText1:
- text_far _ViridianCityText1
- text_end
-
-ViridianCityText2:
+ViridianCityText_0:
text_asm
- ld a, [wObtainedBadges]
- cp $ff ^ (1 << BIT_EARTHBADGE)
- ld hl, ViridianCityText_19127
- jr z, .done
- CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
- jr nz, .done
- ld hl, ViridianCityText_19122
-.done
- call PrintText
+ farcall Func_f18bb
jp TextScriptEnd
-ViridianCityText_19122:
- text_far _ViridianCityText_19122
- text_end
-
-ViridianCityText_19127:
- text_far _ViridianCityText_19127
- text_end
-
-ViridianCityText3:
+ViridianCityText_1:
text_asm
- ld hl, ViridianCityText_1914d
- call PrintText
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr nz, .no
- ld hl, ViridianCityText_19157
- call PrintText
- jr .done
-.no
- ld hl, ViridianCityText_19152
- call PrintText
-.done
+ farcall Func_f18c7
jp TextScriptEnd
-ViridianCityText_1914d:
- text_far _ViridianCityText_1914d
- text_end
-
-ViridianCityText_19152:
- text_far _ViridianCityText_19152
- text_end
-
-ViridianCityText_19157:
- text_far _ViridianCityText_19157
- text_end
-
-ViridianCityText4:
+ViridianCityText_2:
text_asm
- CheckEvent EVENT_GOT_POKEDEX
- jr nz, .gotPokedex
- ld hl, ViridianCityText_19175
- call PrintText
- jr .done
-.gotPokedex
- ld hl, ViridianCityText_1917a
- call PrintText
-.done
+ farcall Func_f18e9
jp TextScriptEnd
-ViridianCityText_19175:
- text_far _ViridianCityText_19175
- text_end
-
-ViridianCityText_1917a:
- text_far _ViridianCityText_1917a
- text_end
-
-ViridianCityText5:
+ViridianCityText_3:
text_asm
- ld hl, ViridianCityText_19191
- call PrintText
- call ViridianCityScript_190cf
- ld a, $3
- ld [wViridianCityCurScript], a
+ farcall Func_f1911
jp TextScriptEnd
-ViridianCityText_19191:
- text_far _ViridianCityText_19191
- text_end
-
-ViridianCityText6:
+ViridianCityText_4:
text_asm
- CheckEvent EVENT_GOT_TM42
- jr nz, .got_item
- ld hl, ViridianCityText_191ca
- call PrintText
- lb bc, TM_DREAM_EATER, 1
- call GiveItem
- jr nc, .bag_full
- ld hl, ReceivedTM42Text
- call PrintText
- SetEvent EVENT_GOT_TM42
- jr .done
-.bag_full
- ld hl, TM42NoRoomText
- call PrintText
- jr .done
-.got_item
- ld hl, TM42Explanation
- call PrintText
-.done
+ farcall Func_f192c
jp TextScriptEnd
-ViridianCityText_191ca:
- text_far _ViridianCityText_191ca
- text_end
-
-ReceivedTM42Text:
- text_far _ReceivedTM42Text
- sound_get_item_2
- text_end
+ViridianCityText_5:
+ text_asm
+ farcall Func_f194a
+ jp TextScriptEnd
-TM42Explanation:
- text_far _TM42Explanation
- text_end
+ViridianCityText_6:
+ text_asm
+ farcall Func_f198e
+ jp TextScriptEnd
-TM42NoRoomText:
- text_far _TM42NoRoomText
+ViridianCityText_13:
+ text_far _ViridianCityText_19219
text_end
-ViridianCityText7:
+ViridianCityText_7:
text_asm
- ld hl, ViridianCityText_1920a
+ CheckEvent EVENT_02D
+ jr nz, .asm_192a6
+ ld hl, ViridianCityText_192af
call PrintText
ld c, 2
call DelayFrames
- call YesNoChoice
- ld a, [wCurrentMenuItem]
- and a
- jr z, .refused
- ld hl, ViridianCityText_1920f
- call PrintText
- ld a, $1
+ ld a, $7
ld [wViridianCityCurScript], a
- jr .done
-.refused
- ld hl, ViridianCityText_19214
+ jr .asm_192ac
+
+.asm_192a6
+ ld hl, ViridianCityText_192b4
call PrintText
-.done
+.asm_192ac
jp TextScriptEnd
-ViridianCityText_1920a:
+ViridianCityText_192af:
text_far _ViridianCityText_1920a
text_end
-ViridianCityText_1920f:
- text_far _ViridianCityText_1920f
- text_end
-
-ViridianCityText_19214:
- text_far _ViridianCityText_19214
+ViridianCityText_192b4:
+ text_far _OldManTextAfterBattle
text_end
-ViridianCityText15:
- text_far _ViridianCityText_19219
- text_end
-
-ViridianCityText8:
- text_far _ViridianCityText8
- text_end
+ViridianCityText_8:
+ text_asm
+ farcall Func_f19c5
+ jp TextScriptEnd
-ViridianCityText9:
- text_far _ViridianCityText9
- text_end
+ViridianCityText_9:
+ text_asm
+ farcall Func_f19d1
+ jp TextScriptEnd
-ViridianCityText10:
- text_far _ViridianCityText10
- text_end
+ViridianCityText_10:
+ text_asm
+ farcall Func_f19dd
+ jp TextScriptEnd
-ViridianCityText13:
- text_far _ViridianCityText13
- text_end
+ViridianCityText_11:
+ text_asm
+ farcall Func_f19e9
+ jp TextScriptEnd
-ViridianCityText14:
- text_far _ViridianCityText14
- text_end
+ViridianCityText_12:
+ text_asm
+ farcall Func_f19f5
+ jp TextScriptEnd
diff --git a/scripts/ViridianCity2.asm b/scripts/ViridianCity2.asm
new file mode 100644
index 00000000..c2e8254e
--- /dev/null
+++ b/scripts/ViridianCity2.asm
@@ -0,0 +1,215 @@
+Func_f18bb::
+ ld hl, ViridianCityText_f18c2
+ call PrintText
+ ret
+
+ViridianCityText_f18c2:
+ text_far _ViridianCityText1
+ text_end
+
+Func_f18c7::
+ ld hl, ViridianCityText_19127
+ ld a, [wObtainedBadges]
+ cp $ff ^ (1 << BIT_EARTHBADGE)
+ jr z, .done
+ CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
+ jr nz, .done
+ ld hl, ViridianCityText_19122
+.done
+ call PrintText
+ ret
+
+ViridianCityText_19122:
+ text_far _ViridianCityText_19122
+ text_end
+
+ViridianCityText_19127:
+ text_far _ViridianCityText_19127
+ text_end
+
+Func_f18e9::
+ ld hl, ViridianCityText_f1902
+ call PrintText
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ ld hl, ViridianCityText_f1907
+ jr nz, .no
+ ld hl, ViridianCityText_f190c
+.no
+ call PrintText
+ ret
+
+ViridianCityText_f1902:
+ text_far _ViridianCityText_1914d
+ text_end
+
+ViridianCityText_f1907:
+ text_far _ViridianCityText_19152
+ text_end
+
+ViridianCityText_f190c:
+ text_far _ViridianCityText_19157
+ text_end
+
+Func_f1911::
+ ld hl, ViridianCityText_f1927
+ CheckEvent EVENT_GOT_POKEDEX
+ jr nz, .gotPokedex
+ ld hl, ViridianCityText_f1922
+.gotPokedex
+ call PrintText
+ ret
+
+ViridianCityText_f1922:
+ text_far _ViridianCityText_19175
+ text_end
+
+ViridianCityText_f1927:
+ text_far _ViridianCityText_1917a
+ text_end
+
+Func_f192c::
+ ld hl, ViridianCityText_f1945
+ call PrintText
+ call StartSimulatingJoypadStates
+ ld a, $1
+ ld [wSimulatedJoypadStatesIndex], a
+ ld a, D_DOWN
+ ld [wSimulatedJoypadStatesEnd], a
+ ld a, $5
+ ld [wViridianCityCurScript], a
+ ret
+
+ViridianCityText_f1945:
+ text_far _ViridianCityText_19191
+ text_end
+
+Func_f194a::
+ CheckEvent EVENT_GOT_TM42
+ jr nz, .got_item
+ ld hl, ViridianCityText_191ca
+ call PrintText
+ lb bc, TM_DREAM_EATER, 1
+ call GiveItem
+ jr nc, .bag_full
+ ld hl, ReceivedTM42Text
+ call PrintText
+ SetEvent EVENT_GOT_TM42
+ ret
+.bag_full
+ ld hl, TM42NoRoomText
+ call PrintText
+ ret
+.got_item
+ ld hl, TM42Explanation
+ call PrintText
+ ret
+
+ViridianCityText_191ca:
+ text_far _ViridianCityText_191ca
+ text_end
+
+ReceivedTM42Text:
+ text_far _ReceivedTM42Text
+ sound_get_item_2
+ text_end
+
+TM42Explanation:
+ text_far _TM42Explanation
+ text_end
+
+TM42NoRoomText:
+ text_far _TM42NoRoomText
+ text_end
+
+Func_f198e::
+ ld hl, ViridianCityText_f19b6
+ call PrintText
+ ld c, 2
+ call DelayFrames
+ call YesNoChoice
+ ld a, [wCurrentMenuItem]
+ and a
+ jr nz, .refused
+ ld hl, ViridianCityText_f19bb
+ call PrintText
+ ld a, $3
+ ld [wViridianCityCurScript], a
+ jr .done
+.refused
+ ld hl, ViridianCityText_f19c0
+ call PrintText
+.done
+ ret
+
+ViridianCityText_f19b6:
+ text_far _OldManAgainText1
+ text_end
+
+ViridianCityText_f19bb:
+ text_far _OldManAgainText2
+ text_end
+
+ViridianCityText_f19c0:
+ text_far _OldManAgainText3
+ text_end
+
+Func_f19c5::
+ ld hl, ViridianCityText_f19cc
+ call PrintText
+ ret
+
+ViridianCityText_f19cc:
+ text_far _ViridianCityText8
+ text_end
+
+Func_f19d1::
+ ld hl, ViridianCityText_f19d8
+ call PrintText
+ ret
+
+ViridianCityText_f19d8:
+ text_far _ViridianCityText9
+ text_end
+
+Func_f19dd::
+ ld hl, ViridianCityText_f19e4
+ call PrintText
+ ret
+
+ViridianCityText_f19e4:
+ text_far _ViridianCityText10
+ text_end
+
+Func_f19e9::
+ ld hl, ViridianCityText_f19f0
+ call PrintText
+ ret
+
+ViridianCityText_f19f0:
+ text_far _ViridianCityText13
+ text_end
+
+Func_f19f5::
+ ld hl, ViridianCityText_f19fc
+ call PrintText
+ ret
+
+ViridianCityText_f19fc:
+ text_far _ViridianCityText14
+ text_end
+
+
+Func_f1a01::
+ ld hl, Data_f1a0a
+ ld b, SPRITE_FACING_RIGHT
+ call TryApplyPikachuMovementData
+ ret
+
+Data_f1a0a:
+ db $00
+ db $1d
+ db $1f
+ db $38
+ db $3f
diff --git a/scripts/ViridianForest.asm b/scripts/ViridianForest.asm
index 14081694..e9790a37 100644
--- a/scripts/ViridianForest.asm
+++ b/scripts/ViridianForest.asm
@@ -17,16 +17,18 @@ ViridianForest_TextPointers:
dw ViridianForestText2
dw ViridianForestText3
dw ViridianForestText4
+ dw ViridianForestText5
+ dw ViridianForestText6
dw PickUpItemText
dw PickUpItemText
dw PickUpItemText
- dw ViridianForestText8
- dw ViridianForestText9
dw ViridianForestText10
dw ViridianForestText11
dw ViridianForestText12
dw ViridianForestText13
dw ViridianForestText14
+ dw ViridianForestText15
+ dw ViridianForestText16
ViridianForestTrainerHeaders:
def_trainers 2
@@ -36,6 +38,10 @@ ViridianForestTrainerHeader1:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1, 4, ViridianForestBattleText2, ViridianForestEndBattleText2, ViridianForestAfterBattleText2
ViridianForestTrainerHeader2:
trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2, 1, ViridianForestBattleText3, ViridianForestEndBattleText3, ViridianForestAfterBattleText3
+ViridianForestTrainerHeader3:
+ trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_3, 0, ViridianForestBattleText4, ViridianForestEndBattleText4, ViridianForestAfterBattleText4
+ViridianForestTrainerHeader4:
+ trainer EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_4, 4, ViridianForestBattleText5, ViridianForestEndBattleText5, ViridianForestAfterBattleText5
db -1 ; end
ViridianForestText1:
@@ -45,18 +51,27 @@ ViridianForestText1:
ViridianForestText2:
text_asm
ld hl, ViridianForestTrainerHeader0
- call TalkToTrainer
- jp TextScriptEnd
+ jr ViridianForestTalkToTrainer
ViridianForestText3:
text_asm
ld hl, ViridianForestTrainerHeader1
- call TalkToTrainer
- jp TextScriptEnd
+ jr ViridianForestTalkToTrainer
ViridianForestText4:
text_asm
ld hl, ViridianForestTrainerHeader2
+ jr ViridianForestTalkToTrainer
+
+ViridianForestText5:
+ text_asm
+ ld hl, ViridianForestTrainerHeader3
+ jr ViridianForestTalkToTrainer
+
+ViridianForestText6:
+ text_asm
+ ld hl, ViridianForestTrainerHeader4
+ViridianForestTalkToTrainer:
call TalkToTrainer
jp TextScriptEnd
@@ -96,30 +111,63 @@ ViridianForestAfterBattleText3:
text_far _ViridianFrstAfterBattleText3
text_end
-ViridianForestText8:
- text_far _ViridianForestText8
+ViridianForestBattleText4:
+ text_far _ViridianForestBattleTextPikaGirl
+ text_end
+
+ViridianForestEndBattleText4:
+ text_far _ViridianForestEndBattleTextPikaGirl
+ text_end
+
+ViridianForestAfterBattleText4:
+ text_far _ViridianForestAfterBattleTextPikaGirl
+ text_end
+
+ViridianForestBattleText5:
+ text_far _ViridianForestBattleTextSamurai
text_end
-ViridianForestText9:
- text_far _ViridianForestText9
+ViridianForestEndBattleText5:
+ text_far _ViridianForestEndBattleTextSamurai
+ text_end
+
+ViridianForestAfterBattleText5:
+ text_far _ViridianForestAfterBattleTextSamurai
text_end
ViridianForestText10:
- text_far _ViridianForestText10
+ text_far _ViridianForestText8
text_end
ViridianForestText11:
- text_far _ViridianForestText11
- text_end
+ text_asm
+ ld hl, Func_f2528
+ jp ViridianForestScript_6120d
ViridianForestText12:
- text_far _ViridianForestText12
- text_end
+ text_asm
+ ld hl, Func_f2534
+ jp ViridianForestScript_6120d
ViridianForestText13:
- text_far _ViridianForestText13
- text_end
+ text_asm
+ ld hl, Func_f2540
+ jp ViridianForestScript_6120d
ViridianForestText14:
- text_far _ViridianForestText14
- text_end
+ text_asm
+ ld hl, Func_f254c
+ jp ViridianForestScript_6120d
+
+ViridianForestText15:
+ text_asm
+ ld hl, Func_f2558
+ jp ViridianForestScript_6120d
+
+ViridianForestText16:
+ text_asm
+ ld hl, Func_f2528
+ViridianForestScript_6120d:
+ ld b, BANK(Func_f2528)
+ call Bankswitch
+ jp TextScriptEnd
diff --git a/scripts/ViridianForest2.asm b/scripts/ViridianForest2.asm
new file mode 100644
index 00000000..e5f03ccb
--- /dev/null
+++ b/scripts/ViridianForest2.asm
@@ -0,0 +1,53 @@
+Func_f2528::
+ ld hl, Text_f252f
+ call PrintText
+ ret
+
+Text_f252f:
+ text_far _ViridianForestText9
+ text_end
+
+Func_f2534::
+ ld hl, Text_f253b
+ call PrintText
+ ret
+
+Text_f253b:
+ text_far _ViridianForestText10
+ text_end
+
+Func_f2540::
+ ld hl, Text_f254a
+ call PrintText
+ ret
+
+Text_f254a:
+ text_far _ViridianForestText11
+ text_end
+
+Func_f254c::
+ ld hl, Text_f2553
+ call PrintText
+ ret
+
+Text_f2553:
+ text_far _ViridianForestText12
+ text_end
+
+Func_f2558::
+ ld hl, Text_f255f
+ call PrintText
+ ret
+
+Text_f255f:
+ text_far _ViridianForestText13
+ text_end
+
+Func_f2564:
+ ld hl, ViridianForestText_f256b
+ call PrintText
+ ret
+
+ViridianForestText_f256b:
+ text_far _ViridianForestText14
+ text_end
diff --git a/scripts/ViridianForestSouthGate.asm b/scripts/ViridianForestSouthGate.asm
index 996ac2ae..7ef66b85 100644
--- a/scripts/ViridianForestSouthGate.asm
+++ b/scripts/ViridianForestSouthGate.asm
@@ -1,5 +1,6 @@
ViridianForestSouthGate_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
ViridianForestSouthGate_TextPointers:
dw ViridianForestEntranceText1
diff --git a/scripts/ViridianMart.asm b/scripts/ViridianMart.asm
index f71cc6ef..2d837018 100644
--- a/scripts/ViridianMart.asm
+++ b/scripts/ViridianMart.asm
@@ -3,7 +3,8 @@ ViridianMart_Script:
call EnableAutoTextBoxDrawing
ld hl, ViridianMart_ScriptPointers
ld a, [wViridianMartCurScript]
- jp CallFunctionInTable
+ call CallFunctionInTable
+ ret
ViridianMartScript_1d47d:
CheckEvent EVENT_OAK_GOT_PARCEL
@@ -57,8 +58,19 @@ ViridianMartScript1:
SetEvent EVENT_GOT_OAKS_PARCEL
ld a, $2
ld [wViridianMartCurScript], a
- ; fallthrough
+ ret
+
ViridianMartScript2:
+ CheckEventHL EVENT_02D
+ ret z
+ CheckAndSetEventReuseHL EVENT_02C
+ ret nz
+ ld a, HS_OLD_MAN
+ ld [wMissableObjectIndex], a
+ predef HideObject
+ ld a, HS_OLD_MAN_1
+ ld [wMissableObjectIndex], a
+ predef ShowObject
ret
ViridianMart_TextPointers:
diff --git a/scripts/ViridianPokecenter.asm b/scripts/ViridianPokecenter.asm
index 08577678..25f4d637 100644
--- a/scripts/ViridianPokecenter.asm
+++ b/scripts/ViridianPokecenter.asm
@@ -7,6 +7,7 @@ ViridianPokecenter_TextPointers:
dw ViridianPokeCenterText2
dw ViridianPokeCenterText3
dw ViridianTradeNurseText
+ dw ViridianPokeCenterText5
ViridianHealNurseText:
script_pokecenter_nurse
@@ -21,3 +22,8 @@ ViridianPokeCenterText3:
ViridianTradeNurseText:
script_cable_club_receptionist
+
+ViridianPokeCenterText5:
+ text_asm
+ callfar PokecenterChanseyText
+ jp TextScriptEnd
diff --git a/scripts/ViridianSchoolHouse.asm b/scripts/ViridianSchoolHouse.asm
index 731e2dac..77dffa38 100644
--- a/scripts/ViridianSchoolHouse.asm
+++ b/scripts/ViridianSchoolHouse.asm
@@ -1,14 +1,22 @@
ViridianSchoolHouse_Script:
- jp EnableAutoTextBoxDrawing
+ call EnableAutoTextBoxDrawing
+ ret
ViridianSchoolHouse_TextPointers:
dw SchoolText1
dw SchoolText2
+ dw SchoolText3
SchoolText1:
text_far _SchoolText1
text_end
SchoolText2:
- text_far _SchoolText2
- text_end
+ text_asm
+ farcall Func_f1c0f
+ jp TextScriptEnd
+
+SchoolText3:
+ text_asm
+ farcall Func_f1c03
+ jp TextScriptEnd
diff --git a/scripts/ViridianSchoolHouse2.asm b/scripts/ViridianSchoolHouse2.asm
new file mode 100644
index 00000000..e5644830
--- /dev/null
+++ b/scripts/ViridianSchoolHouse2.asm
@@ -0,0 +1,17 @@
+Func_f1c03::
+ ld hl, SchoolText_f1c0a
+ call PrintText
+ ret
+
+SchoolText_f1c0a:
+ text_far _SchoolText3
+ text_end
+
+Func_f1c0f::
+ ld hl, SchoolText_f1c16
+ call PrintText
+ ret
+
+SchoolText_f1c16:
+ text_far _SchoolText2
+ text_end
diff --git a/text.asm b/text.asm
index be17bfc6..618685fa 100644
--- a/text.asm
+++ b/text.asm
@@ -28,16 +28,15 @@ INCLUDE "text/SilphCo2F.asm"
INCLUDE "text/SilphCo3F.asm"
INCLUDE "text/SilphCo4F.asm"
INCLUDE "text/SilphCo5F.asm"
-
-
-SECTION "Text 2", ROMX
-
-INCLUDE "text/SilphCo5F_2.asm"
INCLUDE "text/SilphCo6F.asm"
INCLUDE "text/SilphCo7F.asm"
INCLUDE "text/SilphCo8F.asm"
INCLUDE "text/SilphCo9F.asm"
INCLUDE "text/SilphCo10F.asm"
+
+
+SECTION "Text 2", ROMX
+
INCLUDE "text/SilphCo11F.asm"
INCLUDE "text/PokemonMansion2F.asm"
INCLUDE "text/PokemonMansion3F.asm"
@@ -60,14 +59,14 @@ INCLUDE "text/LoreleisRoom.asm"
INCLUDE "text/BrunosRoom.asm"
INCLUDE "text/AgathasRoom.asm"
INCLUDE "text/RockTunnelB1F.asm"
+INCLUDE "text/SeafoamIslandsB4F.asm"
+INCLUDE "data/text/text_2.asm"
-SECTION "Text 3", ROMX
-INCLUDE "text/RockTunnelB1F_2.asm"
-INCLUDE "text/SeafoamIslandsB4F.asm"
+SECTION "Text 3", ROMX
-INCLUDE "data/text/text_2.asm"
+INCLUDE "data/text/text_3.asm"
INCLUDE "text/DiglettsCaveRoute2.asm"
INCLUDE "text/ViridianForestNorthGate.asm"
@@ -77,11 +76,6 @@ INCLUDE "text/ViridianForestSouthGate.asm"
INCLUDE "text/MtMoonPokecenter.asm"
INCLUDE "text/SaffronGates.asm"
INCLUDE "text/Daycare.asm"
-
-
-SECTION "Text 4", ROMX
-
-INCLUDE "text/Daycare_2.asm"
INCLUDE "text/UndergroundPathRoute6.asm"
INCLUDE "text/UndergroundPathRoute7.asm"
INCLUDE "text/UndergroundPathRoute7Copy.asm"
@@ -102,6 +96,7 @@ INCLUDE "text/Route16Gate2F.asm"
INCLUDE "text/Route16FlyHouse.asm"
INCLUDE "text/Route18Gate1F.asm"
INCLUDE "text/Route18Gate2F.asm"
+INCLUDE "text/SummerBeachHouse.asm"
INCLUDE "text/Route22Gate.asm"
INCLUDE "text/VictoryRoad2F.asm"
INCLUDE "text/BillsHouse.asm"
@@ -114,13 +109,13 @@ INCLUDE "text/Route6.asm"
INCLUDE "text/Route7.asm"
INCLUDE "text/Route8.asm"
INCLUDE "text/Route9.asm"
-INCLUDE "text/Route10.asm"
-INCLUDE "text/Route11.asm"
-SECTION "Text 5", ROMX
+SECTION "Text 4", ROMX
-INCLUDE "text/Route11_2.asm"
+INCLUDE "text/Route9_2.asm"
+INCLUDE "text/Route10.asm"
+INCLUDE "text/Route11.asm"
INCLUDE "text/Route12.asm"
INCLUDE "text/Route13.asm"
INCLUDE "text/Route14.asm"
@@ -134,18 +129,19 @@ INCLUDE "text/Route21.asm"
INCLUDE "text/Route22.asm"
INCLUDE "text/Route23.asm"
INCLUDE "text/Route24.asm"
+INCLUDE "text/Route25.asm"
+INCLUDE "data/text/text_4.asm"
-SECTION "Text 6", ROMX
-INCLUDE "text/Route24_2.asm"
-INCLUDE "text/Route25.asm"
+SECTION "Text 5", ROMX
-INCLUDE "data/text/text_3.asm"
+INCLUDE "data/text/text_5.asm"
INCLUDE "text/RedsHouse1F.asm"
INCLUDE "text/BluesHouse.asm"
INCLUDE "text/OaksLab.asm"
+INCLUDE "text/pokedex_ratings.asm"
INCLUDE "text/ViridianPokecenter.asm"
INCLUDE "text/ViridianMart.asm"
INCLUDE "text/ViridianSchoolHouse.asm"
@@ -154,22 +150,22 @@ INCLUDE "text/ViridianGym.asm"
INCLUDE "text/Museum1F.asm"
INCLUDE "text/Museum2F.asm"
INCLUDE "text/PewterGym.asm"
-
-
-SECTION "Text 7", ROMX
-
-INCLUDE "text/PewterGym_2.asm"
INCLUDE "text/PewterNidoranHouse.asm"
INCLUDE "text/PewterMart.asm"
INCLUDE "text/PewterSpeechHouse.asm"
INCLUDE "text/PewterPokecenter.asm"
INCLUDE "text/CeruleanTrashedHouse.asm"
-INCLUDE "text/CeruleanTradeHouse.asm"
+INCLUDE "text/CeruleanMelaniesHouse.asm"
INCLUDE "text/CeruleanPokecenter.asm"
INCLUDE "text/CeruleanGym.asm"
INCLUDE "text/BikeShop.asm"
INCLUDE "text/CeruleanMart.asm"
INCLUDE "text/CeruleanBadgeHouse.asm"
+
+
+SECTION "Text 6", ROMX
+
+INCLUDE "text/CeruleanBadgeHouse_2.asm"
INCLUDE "text/LavenderPokecenter.asm"
INCLUDE "text/PokemonTower1F.asm"
INCLUDE "text/PokemonTower2F.asm"
@@ -186,13 +182,11 @@ INCLUDE "text/VermilionPokecenter.asm"
INCLUDE "text/PokemonFanClub.asm"
INCLUDE "text/VermilionMart.asm"
INCLUDE "text/VermilionGym.asm"
-
-
-SECTION "Text 8", ROMX
-
-INCLUDE "text/VermilionGym_2.asm"
INCLUDE "text/VermilionPidgeyHouse.asm"
INCLUDE "text/VermilionDock.asm"
+
+INCLUDE "data/text/text_6.asm"
+
INCLUDE "text/VermilionOldRodHouse.asm"
INCLUDE "text/CeladonMart1F.asm"
INCLUDE "text/CeladonMart2F.asm"
@@ -207,6 +201,11 @@ INCLUDE "text/CeladonMansionRoofHouse.asm"
INCLUDE "text/CeladonPokecenter.asm"
INCLUDE "text/CeladonGym.asm"
INCLUDE "text/GameCorner.asm"
+
+
+SECTION "Text 7", ROMX
+
+INCLUDE "text/GameCorner_2.asm"
INCLUDE "text/CeladonMart5F.asm"
INCLUDE "text/GameCornerPrizeRoom.asm"
INCLUDE "text/CeladonDiner.asm"
@@ -218,11 +217,6 @@ INCLUDE "text/FuchsiaPokecenter.asm"
INCLUDE "text/WardensHouse.asm"
INCLUDE "text/SafariZoneGate.asm"
INCLUDE "text/FuchsiaGym.asm"
-
-
-SECTION "Text 9", ROMX
-
-INCLUDE "text/FuchsiaGym_2.asm"
INCLUDE "text/FuchsiaMeetingRoom.asm"
INCLUDE "text/FuchsiaGoodRodHouse.asm"
INCLUDE "text/PokemonMansion1F.asm"
@@ -244,12 +238,12 @@ INCLUDE "text/SilphCo1F.asm"
INCLUDE "text/SaffronPokecenter.asm"
INCLUDE "text/MrPsychicsHouse.asm"
-INCLUDE "data/text/text_4.asm"
+INCLUDE "data/text/text_7.asm"
-SECTION "Text 10", ROMX
+SECTION "Text 8", ROMX
-INCLUDE "data/text/text_5.asm"
+INCLUDE "data/text/text_8.asm"
INCLUDE "text/PalletTown.asm"
INCLUDE "text/ViridianCity.asm"
@@ -262,12 +256,7 @@ INCLUDE "text/FuchsiaCity.asm"
INCLUDE "text/CinnabarIsland.asm"
INCLUDE "text/SaffronCity.asm"
-INCLUDE "data/text/text_6.asm"
-
-
-SECTION "Text 11", ROMX
-
-INCLUDE "data/text/text_7.asm"
+INCLUDE "data/text/text_9.asm"
SECTION "Pokédex Text", ROMX
diff --git a/text/AgathasRoom.asm b/text/AgathasRoom.asm
index 9ef5059a..82cbcd81 100644
--- a/text/AgathasRoom.asm
+++ b/text/AgathasRoom.asm
@@ -23,7 +23,7 @@ _AgathaBeforeBattleText::
done
_AgathaEndBattleText::
- text "Oh ho!"
+ text "Woo-hoo!"
line "You're something"
cont "special, child!"
prompt
diff --git a/text/BikeShop.asm b/text/BikeShop.asm
index 5d71133c..254da08c 100644
--- a/text/BikeShop.asm
+++ b/text/BikeShop.asm
@@ -32,7 +32,7 @@ _BikeShopText_1d824::
_BikeShopComeAgainText::
text "Come back again"
- line "some time!"
+ line "sometime!"
done
_BikeShopText_1d82f::
diff --git a/text/BillsHouse.asm b/text/BillsHouse.asm
index 11bb3200..2ad5748a 100644
--- a/text/BillsHouse.asm
+++ b/text/BillsHouse.asm
@@ -1,3 +1,8 @@
+_BillsHouseDontLeaveText::
+ text "Whoa, don't go"
+ line "anywhere, wait!"
+ done
+
_BillsHouseText_1e865::
text "Hiya! I'm a"
line "#MON..."
diff --git a/text/BluesHouse.asm b/text/BluesHouse.asm
index 6e57cb21..d799b9ed 100644
--- a/text/BluesHouse.asm
+++ b/text/BluesHouse.asm
@@ -30,10 +30,10 @@ _DaisyUseMapText::
done
_BluesHouseDaisyWalkingText::
- text "#MON are living"
- line "things! If they"
- cont "get tired, give"
- cont "them a rest!"
+ text "Spending time"
+ line "with your #MON"
+ cont "makes them more"
+ cont "friendly to you."
done
_BluesHouseTownMapText::
diff --git a/text/CeladonCity.asm b/text/CeladonCity.asm
index 76fa1775..6ec80e66 100644
--- a/text/CeladonCity.asm
+++ b/text/CeladonCity.asm
@@ -1,10 +1,10 @@
_CeladonCityText1::
text "I got my KOFFING"
- line "in CINNABAR!"
+ line "from my friend!"
- para "It's nice, but it"
- line "breathes poison"
- cont "when it's angry!"
+ para "We get along now,"
+ line "because I was"
+ cont "very nice to it!"
done
_CeladonCityText2::
@@ -86,22 +86,6 @@ _CeladonCityText9::
line "ROCKET's way!"
done
-_CeladonCityText10::
- text "TRAINER TIPS"
-
- para "X ACCURACY boosts"
- line "the accuracy of"
- cont "techniques!"
-
- para "DIRE HIT jacks up"
- line "the likelihood of"
- cont "critical hits!"
-
- para "Get your items at"
- line "CELADON DEPT."
- cont "STORE!"
- done
-
_CeladonCityText11::
text "CELADON CITY"
line "The City of"
@@ -113,7 +97,7 @@ _CeladonCityText13::
line "#MON GYM"
cont "LEADER: ERIKA"
- para "The Nature Loving"
+ para "The Nature-Loving"
line "Princess!"
done
@@ -150,5 +134,21 @@ _CeladonCityText17::
_CeladonCityText18::
text "ROCKET GAME CORNER"
line "The playground"
- cont "for grown-ups!"
+ cont "for grownups!"
+ done
+
+_CeladonCityText10::
+ text "TRAINER TIPS"
+
+ para "X ACCURACY boosts"
+ line "the accuracy of"
+ cont "techniques!"
+
+ para "DIRE HIT jacks up"
+ line "the likelihood of"
+ cont "critical hits!"
+
+ para "Get your items at"
+ line "CELADON DEPT."
+ cont "STORE!"
done
diff --git a/text/CeladonMansion1F.asm b/text/CeladonMansion1F.asm
index 14a48a81..52946a41 100644
--- a/text/CeladonMansion1F.asm
+++ b/text/CeladonMansion1F.asm
@@ -2,14 +2,6 @@ _CeladonMansion1Text1::
text "MEOWTH: Meow!@"
text_end
-_CeladonMansion1Text2::
- text "My dear #MON"
- line "keep me company."
-
- para "MEOWTH even brings"
- line "money home!"
- done
-
_CeladonMansion1Text3::
text "CLEFAIRY: Pi"
line "pippippi!@"
@@ -24,3 +16,53 @@ _CeladonMansion1Text5::
text "CELADON MANSION"
line "Manager's Suite"
done
+
+_CeladonMansion1Text2::
+ text "My dear #MON"
+ line "keep me company."
+
+ para "MEOWTH even brings"
+ line "money home!"
+ done
+
+_CeladonMansion1Text6::
+ text "Oh, you have an"
+ line "adorable PIKACHU"
+ cont "with you.@"
+ text_end
+
+_CeladonMansion1Text7::
+ text "It seems like it"
+ line "hasn't been tamed"
+ cont "at all."
+ done
+
+_CeladonMansion1Text8::
+ text "Why don't you"
+ line "take more care"
+ cont "with PIKACHU?"
+ done
+
+_CeladonMansion1Text9::
+ text "You must be happy"
+ line "to have a #MON"
+ cont "that cute."
+ done
+
+_CeladonMansion1Text10::
+ text "Your PIKACHU seems"
+ line "tamed."
+ done
+
+_CeladonMansion1Text11::
+ text "Your PIKACHU looks"
+ line "happy with you."
+ done
+
+_CeladonMansion1Text12::
+ text "You look like a"
+ line "fantastic duo."
+
+ para "You're making me"
+ line "jealous!"
+ done
diff --git a/text/CeladonMansion3F.asm b/text/CeladonMansion3F.asm
index 714ecf19..4381c60f 100644
--- a/text/CeladonMansion3F.asm
+++ b/text/CeladonMansion3F.asm
@@ -3,12 +3,48 @@ _ProgrammerText::
line "programmer!"
done
+_ProgrammerText2::
+ text "Me? I'm the"
+ line "programmer!"
+
+ para "What a surprise!"
+ line "I never expected"
+ cont "anyone to fill a"
+ cont "#DEX."
+ done
+
_GraphicArtistText::
text "I'm the graphic"
line "artist!"
cont "I drew you!"
done
+_GraphicArtistText2::
+ text "I'm the graphic"
+ line "artist!"
+
+ para "Wow, you finished"
+ line "your #DEX!"
+ cont "Want me to PRINT"
+ cont "out a DIPLOMA"
+ cont "as proof?"
+ done
+
+_GraphicArtistText3::
+ text "Just tell me if"
+ line "you want to PRINT"
+ cont "out a DIPLOMA."
+ done
+
+_GraphicArtistText4::
+ text "All done!"
+ done
+
+_GraphicArtistText5::
+ text "OK, let's not"
+ line "PRINT."
+ done
+
_WriterText::
text "I wrote the story!"
line "Isn't ERIKA cute?"
@@ -20,6 +56,14 @@ _WriterText::
line "I like her!"
done
+_WriterText2::
+ text "I wrote the story!"
+
+ para "It's great you"
+ line "caught all the"
+ cont "#MON! Thanks!"
+ done
+
_GameDesignerText::
text "Is that right?"
@@ -42,6 +86,13 @@ _CompletedDexText::
cont "...@"
text_end
+_CompletedDexText2::
+ text "Go show off your"
+ line "DIPLOMA to"
+ cont "the development"
+ cont "crew."
+ done
+
_CeladonMansion3Text5::
text "It's the game"
line "program! Messing"
diff --git a/text/CeladonMart3F.asm b/text/CeladonMart3F.asm
index 9871a5ae..633f1d3b 100644
--- a/text/CeladonMart3F.asm
+++ b/text/CeladonMart3F.asm
@@ -1,31 +1,3 @@
-_TM18PreReceiveText::
- text "Oh, hi! I finally"
- line "finished #MON!"
-
- para "Not done yet?"
- line "This might be"
- cont "useful!"
- prompt
-
-_ReceivedTM18Text::
- text "<PLAYER> received"
- line "@"
- text_ram wcf4b
- text "!@"
- text_end
-
-_TM18ExplanationText::
- text "TM18 is COUNTER!"
- line "Not like the one"
- cont "I'm leaning on,"
- cont "mind you!"
- done
-
-_TM18NoRoomText::
- text "Your pack is full"
- line "of items!"
- done
-
_CeladonMart3Text2::
text "Captured #MON"
line "are registered"
@@ -97,3 +69,31 @@ _CeladonMart3Text15::
text "Red and Blue!"
line "Both are #MON!"
done
+
+_TM18PreReceiveText::
+ text "Oh, hi! I finally"
+ line "finished #MON!"
+
+ para "Not done yet?"
+ line "This might be"
+ cont "useful!"
+ prompt
+
+_ReceivedTM18Text::
+ text "<PLAYER> received"
+ line "@"
+ text_ram wcf4b
+ text "!@"
+ text_end
+
+_TM18ExplanationText::
+ text "TM18 is COUNTER!"
+ line "Not like the one"
+ cont "I'm leaning on,"
+ cont "mind you!"
+ done
+
+_TM18NoRoomText::
+ text "Your pack is full"
+ line "of items!"
+ done
diff --git a/text/CeladonMart4F.asm b/text/CeladonMart4F.asm
index 78fa0b66..c17483c1 100644
--- a/text/CeladonMart4F.asm
+++ b/text/CeladonMart4F.asm
@@ -1,7 +1,11 @@
_CeladonMart4Text2::
text "I'm getting a"
- line "# DOLL for my"
- cont "girl friend!"
+ line "gift for COPYCAT"
+ cont "in CERULEAN CITY."
+
+ para "It's got to be a"
+ line "# DOLL. They"
+ cont "are trendy!"
done
_CeladonMart4Text3::
diff --git a/text/CeladonMartRoof.asm b/text/CeladonMartRoof.asm
index 15bf8c04..fa6f1f64 100644
--- a/text/CeladonMartRoof.asm
+++ b/text/CeladonMartRoof.asm
@@ -57,10 +57,7 @@ _CeladonMartRoofText_4850f::
para "@"
text_ram wcf4b
text " contains"
- line "ROCK SLIDE!"
-
- para "It can spook the"
- line "target sometimes!@"
+ line "ROCK SLIDE!@"
text_end
_CeladonMartRoofText_48515::
diff --git a/text/CeruleanBadgeHouse.asm b/text/CeruleanBadgeHouse.asm
index 9d701443..4bba10cd 100644
--- a/text/CeruleanBadgeHouse.asm
+++ b/text/CeruleanBadgeHouse.asm
@@ -19,7 +19,7 @@ _CeruleanHouse2Text_74e7c::
done
_CeruleanHouse2Text_74e81::
- text "Come visit me any"
+ text "Come visit me any-"
line "time you wish."
done
@@ -29,7 +29,7 @@ _CeruleanHouse2Text_74e96::
cont "a little bit."
para "It also lets you"
- line "use FLASH any"
+ line "use FLASH any-"
cont "time you desire."
prompt
@@ -66,32 +66,3 @@ _CeruleanHouse2Text_74ea5::
line "use STRENGTH out-"
cont "side of battle."
prompt
-
-_CeruleanHouse2Text_74eaa::
- text "The DEFENSE of all"
- line "#MON increases"
- cont "a little bit."
-
- para "It also lets you"
- line "use SURF outside"
- cont "of battle."
- prompt
-
-_CeruleanHouse2Text_74eaf::
- text "#MON up to L70"
- line "will obey you."
-
- para "Any higher, they"
- line "become unruly!"
- prompt
-
-_CeruleanHouse2Text_74eb4::
- text "Your #MON's"
- line "SPECIAL abilities"
- cont "increase a bit."
- prompt
-
-_CeruleanHouse2Text_74eb9::
- text "All #MON will"
- line "obey you!"
- prompt
diff --git a/text/CeruleanBadgeHouse_2.asm b/text/CeruleanBadgeHouse_2.asm
new file mode 100644
index 00000000..e5da0622
--- /dev/null
+++ b/text/CeruleanBadgeHouse_2.asm
@@ -0,0 +1,28 @@
+_CeruleanHouse2Text_74eaa::
+ text "The DEFENSE of all"
+ line "#MON increases"
+ cont "a little bit."
+
+ para "It also lets you"
+ line "use SURF outside"
+ cont "of battle."
+ prompt
+
+_CeruleanHouse2Text_74eaf::
+ text "#MON up to L70"
+ line "will obey you."
+
+ para "Any higher, they"
+ line "become unruly!"
+ prompt
+
+_CeruleanHouse2Text_74eb4::
+ text "Your #MON's"
+ line "SPECIAL abilities"
+ cont "increase a bit."
+ prompt
+
+_CeruleanHouse2Text_74eb9::
+ text "All #MON will"
+ line "obey you!"
+ prompt
diff --git a/text/CeruleanCity.asm b/text/CeruleanCity.asm
index d0884a39..955dca89 100644
--- a/text/CeruleanCity.asm
+++ b/text/CeruleanCity.asm
@@ -123,38 +123,38 @@ _CeruleanCityText5::
done
_CeruleanCityText6::
- text "The people here"
- line "were robbed."
+ text "These poor people"
+ line "here were robbed."
- para "It's obvious that"
- line "TEAM ROCKET is"
- cont "behind this most"
- cont "heinous crime!"
+ para "We're positive"
+ line "that TEAM ROCKET"
+ cont "is behind this"
+ cont "terrible deed."
para "Even our POLICE"
- line "force has trouble"
+ line "FORCE has trouble"
cont "with the ROCKETs!"
done
_CeruleanCityText_19730::
- text "OK! SLOWBRO!"
+ text "OK! ELECTRODE!"
line "Use SONICBOOM!"
- cont "Come on, SLOWBRO"
+ cont "Please ELECTRODE,"
cont "pay attention!"
done
_CeruleanCityText_19735::
- text "SLOWBRO punch!"
+ text "ELECTRODE, TACKLE!"
line "No! You blew it"
cont "again!"
done
_CeruleanCityText_1973a::
- text "SLOWBRO, WITHDRAW!"
+ text "ELECTRODE, SWIFT!"
line "No! That's wrong!"
- para "It's so hard to"
- line "control #MON!"
+ para "Training #MON"
+ line "is difficult!"
para "Your #MON's"
line "obedience depends"
@@ -163,22 +163,22 @@ _CeruleanCityText_1973a::
done
_CeruleanCityText_1976f::
- text "SLOWBRO took a"
+ text "ELECTRODE took a"
line "snooze..."
done
_CeruleanCityText_19774::
- text "SLOWBRO is"
+ text "ELECTRODE is"
line "loafing around..."
done
_CeruleanCityText_19779::
- text "SLOWBRO turned"
+ text "ELECTRODE turned"
line "away..."
done
_CeruleanCityText_1977e::
- text "SLOWBRO"
+ text "ELECTRODE"
line "ignored orders..."
done
diff --git a/text/CeruleanGym.asm b/text/CeruleanGym.asm
index 2c90ed15..c201984f 100644
--- a/text/CeruleanGym.asm
+++ b/text/CeruleanGym.asm
@@ -2,19 +2,21 @@ _MistyPreBattleText::
text "Hi, you're a new"
line "face!"
- para "Trainers who want"
- line "to turn pro have"
- cont "to have a policy"
- cont "about #MON!"
-
- para "What is your"
- line "approach when you"
- cont "catch #MON?"
+ para "What's your policy"
+ line "on #MON? What"
+ cont "is your approach?"
para "My policy is an"
line "all-out offensive"
cont "with water-type"
cont "#MON!"
+
+ para "MISTY, the world-"
+ line "famous beauty, is"
+ cont "your host!"
+
+ para "Are you ready,"
+ line "sweetie?"
done
_TM11ExplanationText::
@@ -35,7 +37,7 @@ _MistyCascadeBadgeInfoText::
para "There's more, you"
line "can now use CUT"
- cont "any time!"
+ cont "anytime!"
para "You can CUT down"
line "small bushes to"
@@ -56,15 +58,15 @@ _TM11NoRoomText::
done
_ReceivedCascadeBadgeText::
- text "Wow!"
- line "You're too much!"
+ text "I can't"
+ line "believe I lost!"
para "All right!"
para "You can have the"
line "CASCADEBADGE to"
- cont "show you beat me!@"
- text_end
+ cont "show you beat me!"
+ prompt
_CeruleanGymBattleText1::
text "I'm more than good"
@@ -127,7 +129,7 @@ _CeruleanGymGuidePostBattleText::
text "You beat MISTY!"
line "What'd I tell ya?"
- para "You and me kid,"
+ para "You and me, kid,"
line "we make a pretty"
cont "darn good team!"
done
diff --git a/text/CeruleanMelaniesHouse.asm b/text/CeruleanMelaniesHouse.asm
new file mode 100644
index 00000000..d50a4ac4
--- /dev/null
+++ b/text/CeruleanMelaniesHouse.asm
@@ -0,0 +1,46 @@
+MelanieText1::
+ text "I take care of"
+ line "injured #MON."
+
+ para "I nursed this"
+ line "BULBASAUR back to"
+ cont "health."
+
+ para "It needs a good"
+ line "trainer to take"
+ cont "care of it now.@"
+ text_end
+
+MelanieText2::
+ text "I know! Would you"
+ line "take care of this"
+ cont "BULBASAUR?"
+ done
+
+MelanieText3::
+ text "Please take care"
+ line "of BULBASAUR!@"
+ text_end
+
+MelanieText4::
+ text "Is BULBASAUR"
+ line "doing well?@"
+ text_end
+
+MelanieText5::
+ text "Oh..."
+ line "That's too bad...@"
+ text_end
+
+MelanieBulbasaurText::
+ text "BULBASAUR: Bubba!"
+ line "Zoar!@"
+ text_end
+
+MelanieOddishText::
+ text "ODDISH: Orddissh!@"
+ text_end
+
+MelanieSandshrewText::
+ text "SANDSHREW: Pikii!@"
+ text_end
diff --git a/text/CeruleanTradeHouse.asm b/text/CeruleanTradeHouse.asm
deleted file mode 100644
index b606613b..00000000
--- a/text/CeruleanTradeHouse.asm
+++ /dev/null
@@ -1,9 +0,0 @@
-_CeruleanHouse1Text1::
- text "My husband likes"
- line "trading #MON."
-
- para "If you are a"
- line "collector, would"
- cont "you please trade"
- cont "with him?"
- done
diff --git a/text/CinnabarGym.asm b/text/CinnabarGym.asm
index 00fa7084..03855d6d 100644
--- a/text/CinnabarGym.asm
+++ b/text/CinnabarGym.asm
@@ -210,3 +210,46 @@ _CinnabarGymGuidePostBattleText::
text "<PLAYER>! You beat"
line "that fire brand!"
done
+
+_CinnabarGymText_1::
+ text "This GYM is also"
+ line "known as the QUIZ"
+ cont "GYM."
+
+ para "You have to take a"
+ line "quiz if you want"
+ cont "to see BLAINE."
+
+ para "You don't have to"
+ line "fight us if you"
+ cont "get it right."
+ done
+
+_CinnabarGymText_2::
+ text "Think you can do"
+ line "it?"
+ done
+
+_CinnabarGymText_3::
+ text "This one's tricky!"
+ done
+
+_CinnabarGymText_4::
+ text "#MON enjoy"
+ line "quizzes too!"
+ done
+
+_CinnabarGymText_5::
+ text "I like it here at"
+ line "QUIZ GYM."
+ done
+
+_CinnabarGymText_6::
+ text "This is the last"
+ line "question."
+ done
+
+_CinnabarGymText_7::
+ text "Come on, answer"
+ line "the question!"
+ done
diff --git a/text/CinnabarIsland.asm b/text/CinnabarIsland.asm
index 352ab8ea..54552a46 100644
--- a/text/CinnabarIsland.asm
+++ b/text/CinnabarIsland.asm
@@ -13,7 +13,7 @@ _CinnabarIslandText1::
_CinnabarIslandText2::
text "Scientists conduct"
line "experiments in"
- cont "the burned out"
+ cont "the burned-out"
cont "building."
done
diff --git a/text/CopycatsHouse1F.asm b/text/CopycatsHouse1F.asm
index 0bf84558..d2d1f42a 100644
--- a/text/CopycatsHouse1F.asm
+++ b/text/CopycatsHouse1F.asm
@@ -16,6 +16,6 @@ _CopycatsHouse1FText2::
done
_CopycatsHouse1FText3::
- text "CHANSEY: Chaan!"
- line "Sii!@"
+ text "CHANSEY: Chaaan"
+ line "sey!@"
text_end
diff --git a/text/Daycare.asm b/text/Daycare.asm
index 197927dd..aa1e5bc5 100644
--- a/text/Daycare.asm
+++ b/text/Daycare.asm
@@ -60,3 +60,38 @@ _DayCareMonNeedsMoreTimeText::
cont "needs some more"
cont "time with me."
prompt
+
+_DayCareAllRightThenText::
+ text "All right then,"
+ line "@"
+ text_end
+
+_DayCareComeAgainText::
+ text "Come again."
+ done
+
+_DayCareNoRoomForMonText::
+ text "You have no room"
+ line "for this #MON!"
+ done
+
+_DayCareOnlyHaveOneMonText::
+ text "You only have one"
+ line "#MON with you."
+ done
+
+_DayCareCantAcceptMonWithHMText::
+ text "I can't accept a"
+ line "#MON that"
+ cont "knows an HM move."
+ done
+
+_DayCareHeresYourMonText::
+ text "Thank you! Here's"
+ line "your #MON!"
+ prompt
+
+_DayCareNotEnoughMoneyText::
+ text "Hey, you don't"
+ line "have enough ¥!"
+ done
diff --git a/text/Daycare_2.asm b/text/Daycare_2.asm
deleted file mode 100644
index 7efb200e..00000000
--- a/text/Daycare_2.asm
+++ /dev/null
@@ -1,34 +0,0 @@
-_DayCareAllRightThenText::
- text "All right then,"
- line "@"
- text_end
-
-_DayCareComeAgainText::
- text "come again."
- done
-
-_DayCareNoRoomForMonText::
- text "You have no room"
- line "for this #MON!"
- done
-
-_DayCareOnlyHaveOneMonText::
- text "You only have one"
- line "#MON with you."
- done
-
-_DayCareCantAcceptMonWithHMText::
- text "I can't accept a"
- line "#MON that"
- cont "knows an HM move."
- done
-
-_DayCareHeresYourMonText::
- text "Thank you! Here's"
- line "your #MON!"
- prompt
-
-_DayCareNotEnoughMoneyText::
- text "Hey, you don't"
- line "have enough ¥!"
- done
diff --git a/text/FightingDojo.asm b/text/FightingDojo.asm
index 3df069c1..a6ccc8c3 100644
--- a/text/FightingDojo.asm
+++ b/text/FightingDojo.asm
@@ -114,13 +114,13 @@ _FightingDojoAfterBattleText4::
_WantHitmonleeText::
text "You want the"
- line "hard kicking"
+ line "hard-kicking"
cont "HITMONLEE?"
done
_WantHitmonchanText::
text "You want the"
- line "piston punching"
+ line "piston-punching"
cont "HITMONCHAN?"
done
diff --git a/text/FuchsiaCity.asm b/text/FuchsiaCity.asm
index a90d0021..0392a1ed 100644
--- a/text/FuchsiaCity.asm
+++ b/text/FuchsiaCity.asm
@@ -58,7 +58,7 @@ _FuchsiaCityText18::
cont "LEADER: KOGA"
para "The Poisonous"
- line "Ninja Master"
+ line "Ninja Master!"
done
_FuchsiaCityChanseyText::
diff --git a/text/FuchsiaGym.asm b/text/FuchsiaGym.asm
index 3b2c01e9..683ae423 100644
--- a/text/FuchsiaGym.asm
+++ b/text/FuchsiaGym.asm
@@ -24,3 +24,198 @@ _ReceivedSoulBadgeText::
para "Here! Take the"
line "SOULBADGE!"
prompt
+
+_KogaPostBattleAdviceText::
+ text "When afflicted by"
+ line "TOXIC, #MON"
+ cont "suffer more and"
+ cont "more as battle"
+ cont "progresses!"
+
+ para "It will surely"
+ line "terrorize foes!"
+ done
+
+_KogaSoulBadgeInfoText::
+ text "Now that you have"
+ line "the SOULBADGE,"
+ cont "the DEFENSE of"
+ cont "your #MON"
+ cont "increases!"
+
+ para "It also lets you"
+ line "SURF outside of"
+ cont "battle!"
+
+ para "Ah! Take this"
+ line "too!"
+ done
+
+_ReceivedTM06Text::
+ text "<PLAYER> received"
+ line "@"
+ text_ram wcf4b
+ text "!@"
+ text_end
+
+_TM06ExplanationText::
+ text_start
+ para "TM06 contains"
+ line "TOXIC!"
+
+ para "It is a secret"
+ line "technique over"
+ cont "400 years old!"
+ done
+
+_TM06NoRoomText::
+ text "Make space for"
+ line "this, child!"
+ done
+
+_FuchsiaGymBattleText1::
+ text "Strength isn't"
+ line "the key for"
+ cont "#MON!"
+
+ para "It's strategy!"
+
+ para "I'll show you how"
+ line "strategy can beat"
+ cont "brute strength!"
+ done
+
+_FuchsiaGymEndBattleText1::
+ text "What?"
+ line "Extraordinary!"
+ prompt
+
+_FuchsiaGymAfterBattleText1::
+ text "So, you mix brawn"
+ line "with brains?"
+ cont "Good strategy!"
+ done
+
+_FuchsiaGymBattleText2::
+ text "I wanted to become"
+ line "a ninja, so I"
+ cont "joined this GYM!"
+ done
+
+_FuchsiaGymEndBattleText2::
+ text "I'm done"
+ line "for!"
+ prompt
+
+_FuchsiaGymAfterBattleText2::
+ text "I will keep on"
+ line "training under"
+ cont "KOGA, my ninja"
+ cont "master!"
+ done
+
+_FuchsiaGymBattleText3::
+ text "Let's see you"
+ line "beat my special"
+ cont "techniques!"
+ done
+
+_FuchsiaGymEndBattleText3::
+ text "You"
+ line "had me fooled!"
+ prompt
+
+_FuchsiaGymAfterBattleText3::
+ text "I like poison and"
+ line "sleep techniques,"
+ cont "as they linger"
+ cont "after battle!"
+ done
+
+_FuchsiaGymBattleText4::
+ text "Stop right there!"
+
+ para "Our invisible"
+ line "walls have you"
+ cont "frustrated?"
+ done
+
+_FuchsiaGymEndBattleText4::
+ text "Whoa!"
+ line "He's got it!"
+ prompt
+
+_FuchsiaGymAfterBattleText4::
+ text "You impressed me!"
+ line "Here's a hint!"
+
+ para "Look very closely"
+ line "for gaps in the"
+ cont "invisible walls!"
+ done
+
+_FuchsiaGymBattleText5::
+ text "I also study the"
+ line "way of the ninja"
+ cont "with master KOGA!"
+
+ para "Ninja have a long"
+ line "history of using"
+ cont "animals!"
+ done
+
+_FuchsiaGymEndBattleText5::
+ text "Awoo!"
+ prompt
+
+_FuchsiaGymAfterBattleText5::
+ text "I still have much"
+ line "to learn!"
+ done
+
+_FuchsiaGymBattleText6::
+ text "Master KOGA comes"
+ line "from a long line"
+ cont "of ninjas!"
+
+ para "What did you"
+ line "descend from?"
+ done
+
+_FuchsiaGymEndBattleText6::
+ text "Dropped"
+ line "my balls!"
+ prompt
+
+_FuchsiaGymAfterBattleText6::
+ text "Where there is"
+ line "light, there is"
+ cont "shadow!"
+
+ para "Light and shadow!"
+ line "Which do you"
+ cont "choose?"
+ done
+
+_FuchsiaGymGuidePreBattleText::
+ text "Yo! Champ in"
+ line "making!"
+
+ para "FUCHSIA GYM is"
+ line "riddled with"
+ cont "invisible walls!"
+
+ para "KOGA might appear"
+ line "close, but he's"
+ cont "blocked off!"
+
+ para "You have to find"
+ line "gaps in the walls"
+ cont "to reach him!"
+ done
+
+_FuchsiaGymGuidePostBattleText::
+ text "It's amazing how"
+ line "ninja can terrify"
+ cont "even now!"
+ done
diff --git a/text/FuchsiaGym_2.asm b/text/FuchsiaGym_2.asm
deleted file mode 100644
index b6443a5a..00000000
--- a/text/FuchsiaGym_2.asm
+++ /dev/null
@@ -1,194 +0,0 @@
-_KogaPostBattleAdviceText::
- text "When afflicted by"
- line "TOXIC, #MON"
- cont "suffer more and"
- cont "more as battle"
- cont "progresses!"
-
- para "It will surely"
- line "terrorize foes!"
- done
-
-_KogaSoulBadgeInfoText::
- text "Now that you have"
- line "the SOULBADGE,"
- cont "the DEFENSE of"
- cont "your #MON"
- cont "increases!"
-
- para "It also lets you"
- line "SURF outside of"
- cont "battle!"
-
- para "Ah! Take this"
- line "too!"
- done
-
-_ReceivedTM06Text::
- text "<PLAYER> received"
- line "@"
- text_ram wcf4b
- text "!@"
- text_end
-
-_TM06ExplanationText::
- text_start
- para "TM06 contains"
- line "TOXIC!"
-
- para "It is a secret"
- line "technique over"
- cont "400 years old!"
- done
-
-_TM06NoRoomText::
- text "Make space for"
- line "this, child!"
- done
-
-_FuchsiaGymBattleText1::
- text "Strength isn't"
- line "the key for"
- cont "#MON!"
-
- para "It's strategy!"
-
- para "I'll show you how"
- line "strategy can beat"
- cont "brute strength!"
- done
-
-_FuchsiaGymEndBattleText1::
- text "What?"
- line "Extraordinary!"
- prompt
-
-_FuchsiaGymAfterBattleText1::
- text "So, you mix brawn"
- line "with brains?"
- cont "Good strategy!"
- done
-
-_FuchsiaGymBattleText2::
- text "I wanted to become"
- line "a ninja, so I"
- cont "joined this GYM!"
- done
-
-_FuchsiaGymEndBattleText2::
- text "I'm done"
- line "for!"
- prompt
-
-_FuchsiaGymAfterBattleText2::
- text "I will keep on"
- line "training under"
- cont "KOGA, my ninja"
- cont "master!"
- done
-
-_FuchsiaGymBattleText3::
- text "Let's see you"
- line "beat my special"
- cont "techniques!"
- done
-
-_FuchsiaGymEndBattleText3::
- text "You"
- line "had me fooled!"
- prompt
-
-_FuchsiaGymAfterBattleText3::
- text "I like poison and"
- line "sleep techniques,"
- cont "as they linger"
- cont "after battle!"
- done
-
-_FuchsiaGymBattleText4::
- text "Stop right there!"
-
- para "Our invisible"
- line "walls have you"
- cont "frustrated?"
- done
-
-_FuchsiaGymEndBattleText4::
- text "Whoa!"
- line "He's got it!"
- prompt
-
-_FuchsiaGymAfterBattleText4::
- text "You impressed me!"
- line "Here's a hint!"
-
- para "Look very closely"
- line "for gaps in the"
- cont "invisible walls!"
- done
-
-_FuchsiaGymBattleText5::
- text "I also study the"
- line "way of the ninja"
- cont "with master KOGA!"
-
- para "Ninja have a long"
- line "history of using"
- cont "animals!"
- done
-
-_FuchsiaGymEndBattleText5::
- text "Awoo!"
- prompt
-
-_FuchsiaGymAfterBattleText5::
- text "I still have much"
- line "to learn!"
- done
-
-_FuchsiaGymBattleText6::
- text "Master KOGA comes"
- line "from a long line"
- cont "of ninjas!"
-
- para "What did you"
- line "descend from?"
- done
-
-_FuchsiaGymEndBattleText6::
- text "Dropped"
- line "my balls!"
- prompt
-
-_FuchsiaGymAfterBattleText6::
- text "Where there is"
- line "light, there is"
- cont "shadow!"
-
- para "Light and shadow!"
- line "Which do you"
- cont "choose?"
- done
-
-_FuchsiaGymGuidePreBattleText::
- text "Yo! Champ in"
- line "making!"
-
- para "FUCHSIA GYM is"
- line "riddled with"
- cont "invisible walls!"
-
- para "KOGA might appear"
- line "close, but he's"
- cont "blocked off!"
-
- para "You have to find"
- line "gaps in the walls"
- cont "to reach him!"
- done
-
-_FuchsiaGymGuidePostBattleText::
- text "It's amazing how"
- line "ninja can terrify"
- cont "even now!"
- done
diff --git a/text/GameCorner.asm b/text/GameCorner.asm
index 1868daf8..a65043d9 100644
--- a/text/GameCorner.asm
+++ b/text/GameCorner.asm
@@ -183,8 +183,3 @@ _CeladonGameCornerText_48f09::
line "the poster!?"
cont "Let's push it!@"
text_end
-
-_CeladonGameCornerText_48f19::
- text "Oops! Forgot the"
- line "COIN CASE!"
- done
diff --git a/text/GameCorner_2.asm b/text/GameCorner_2.asm
new file mode 100644
index 00000000..c288464d
--- /dev/null
+++ b/text/GameCorner_2.asm
@@ -0,0 +1,4 @@
+_CeladonGameCornerText_48f19::
+ text "Oops! Forgot the"
+ line "COIN CASE!"
+ done
diff --git a/text/HallOfFame.asm b/text/HallOfFame.asm
index c799268b..8faefd3f 100644
--- a/text/HallOfFame.asm
+++ b/text/HallOfFame.asm
@@ -1,6 +1,6 @@
_HallofFameRoomText1::
text "OAK: Er-hem!"
- line "Congratulations"
+ line "Congratulations,"
cont "<PLAYER>!"
para "This floor is the"
diff --git a/text/LancesRoom.asm b/text/LancesRoom.asm
index 2531b638..224db0b3 100644
--- a/text/LancesRoom.asm
+++ b/text/LancesRoom.asm
@@ -1,6 +1,6 @@
_LanceBeforeBattleText::
text "Ah! I heard about"
- line "you <PLAYER>!"
+ line "you, <PLAYER>!"
para "I lead the ELITE"
line "FOUR! You can"
diff --git a/text/MtMoon1F.asm b/text/MtMoon1F.asm
index 761a5240..2e8c960e 100644
--- a/text/MtMoon1F.asm
+++ b/text/MtMoon1F.asm
@@ -115,5 +115,5 @@ _MtMoon1AfterBattleText8::
_MtMoon1Text14::
text "Beware! ZUBAT is"
- line "a blood sucker!"
+ line "a bloodsucker!"
done
diff --git a/text/MtMoonB2F.asm b/text/MtMoonB2F.asm
index f920e0fb..e0098791 100644
--- a/text/MtMoonB2F.asm
+++ b/text/MtMoonB2F.asm
@@ -1,3 +1,26 @@
+_MtMoonJessieJamesText1::
+ text "Stop right there!@"
+ text_end
+
+_MtMoonJessieJamesText2::
+ text "That fossil is"
+ line "TEAM ROCKET's!"
+
+ para "Surrender now, or "
+ line "prepare to fight!"
+ done
+
+_MtMoonJessieJamesText3::
+ text "A"
+ line "brat beat us?"
+ prompt
+
+_MtMoonJessieJamesText4::
+ text "TEAM ROCKET, blast"
+ line "off at the speed"
+ cont "of light!@"
+ text_end
+
_MtMoon3Text_49f24::
text "You want the"
line "DOME FOSSIL?"
@@ -55,24 +78,6 @@ _MtMoon3Text_49f99::
line "this is mine!@"
text_end
-_MtMoon3BattleText2::
- text "TEAM ROCKET will"
- line "find the fossils,"
- cont "revive and sell"
- cont "them for cash!"
- done
-
-_MtMoon3EndBattleText2::
- text "Urgh!"
- line "Now I'm mad!"
- prompt
-
-_MtMoon3AfterBattleText2::
- text "You made me mad!"
- line "TEAM ROCKET will"
- cont "blacklist you!"
- done
-
_MtMoon3BattleText3::
text "We, TEAM ROCKET,"
line "are #MON"
diff --git a/text/MtMoonPokecenter.asm b/text/MtMoonPokecenter.asm
index dda62044..052dd85b 100644
--- a/text/MtMoonPokecenter.asm
+++ b/text/MtMoonPokecenter.asm
@@ -16,6 +16,10 @@ _MtMoonPokecenterText3::
cont "news!"
done
+_MtMoonPokecenterText5::
+ text_start
+ done
+
_MagikarpSalesmanText1::
text "MAN: Hello, there!"
line "Have I got a deal"
@@ -42,7 +46,3 @@ _MagikarpSalesmanText2::
text "MAN: Well, I don't"
line "give refunds!"
done
-
-_MtMoonPokecenterText5::
- text_start
- done
diff --git a/text/Museum1F.asm b/text/Museum1F.asm
index be1bb2f7..e7b6ce53 100644
--- a/text/Museum1F.asm
+++ b/text/Museum1F.asm
@@ -72,7 +72,7 @@ _Museum1FText_5c28e::
para "But, my colleagues"
line "just ignore me!"
- para "So I have a favor"
+ para "So, I have a favor"
line "to ask!"
para "Take this to a"
diff --git a/text/Museum2F.asm b/text/Museum2F.asm
index 4f34a249..12cfe8b2 100644
--- a/text/Museum2F.asm
+++ b/text/Museum2F.asm
@@ -33,6 +33,20 @@ _Museum2FText5::
line "soon, I promise!"
done
+_Museum2FPikachuText1::
+ text "Your PIKACHU looks"
+ line "untamed."
+ cont "May I have it for"
+ cont "my daughter?"
+ done
+
+_Museum2FPikachuText2::
+ text "I'd like to get"
+ line "that PIKACHU off"
+ cont "you, but it's too"
+ cont "attached to you."
+ done
+
_Museum2FText6::
text "SPACE SHUTTLE"
line "COLUMBIA"
diff --git a/text/NameRatersHouse.asm b/text/NameRatersHouse.asm
index b5032144..49637b6d 100644
--- a/text/NameRatersHouse.asm
+++ b/text/NameRatersHouse.asm
@@ -43,7 +43,7 @@ _NameRaterText_1dac7::
done
_NameRaterText_1dacc::
- text "Fine! Come any"
+ text "Fine! Come any-"
line "time you like!"
done
diff --git a/text/OaksLab.asm b/text/OaksLab.asm
index 18ecadb7..7e78f8f5 100644
--- a/text/OaksLab.asm
+++ b/text/OaksLab.asm
@@ -2,68 +2,33 @@ _OaksLabGaryText1::
text "<RIVAL>: Yo"
line "<PLAYER>! Gramps"
cont "isn't around!"
+
+ para "I ran here 'cos"
+ line "he said he had a"
+ cont "#MON for me."
done
_OaksLabText40::
- text "<RIVAL>: Heh, I"
- line "don't need to be"
- cont "greedy like you!"
-
- para "Go ahead and"
- line "choose, <PLAYER>!"
+ text "<RIVAL>: Humph!"
+ line "I'll get a better"
+ cont "#MON than you!"
done
_OaksLabText41::
- text "<RIVAL>: My"
+ text "<RIVAL>: Heh, my"
line "#MON looks a"
cont "lot stronger."
done
_OaksLabText39::
- text "Those are #"
- line "BALLs. They"
- cont "contain #MON!"
- done
-
-_OaksLabCharmanderText::
- text "So! You want the"
- line "fire #MON,"
- cont "CHARMANDER?"
- done
-
-_OaksLabSquirtleText::
- text "So! You want the"
- line "water #MON,"
- cont "SQUIRTLE?"
+ text "That's a #"
+ line "BALL. There's a"
+ cont "#MON inside!"
done
-_OaksLabBulbasaurText::
- text "So! You want the"
- line "plant #MON,"
- cont "BULBASAUR?"
- done
-
-_OaksLabMonEnergeticText::
- text "This #MON is"
- line "really energetic!"
- prompt
-
-_OaksLabReceivedMonText::
- text "<PLAYER> received"
- line "a @"
- text_ram wcd6d
- text "!@"
- text_end
-
-_OaksLabLastMonText::
- text "That's PROF.OAK's"
- line "last #MON!"
- done
-
-_OaksLabText_1d2f0::
- text "OAK: Now, <PLAYER>,"
- line "which #MON do"
- cont "you want?"
+_OaksLabPikachuText::
+ text "OAK: Go ahead,"
+ line "it's yours!"
done
_OaksLabText_1d2f5::
@@ -71,13 +36,15 @@ _OaksLabText_1d2f5::
line "#MON appears,"
cont "your #MON can"
cont "fight against it!"
+
+ para "Afterward, go on"
+ line "to the next town."
done
_OaksLabText_1d2fa::
- text "OAK: <PLAYER>,"
- line "raise your young"
- cont "#MON by making"
- cont "it fight!"
+ text "OAK: You should"
+ line "talk to it and"
+ cont "see how it feels."
done
_OaksLabDeliverParcelText1::
@@ -105,7 +72,11 @@ _OaksLabDeliverParcelText2::
para "Ah! This is the"
line "custom # BALL"
cont "I ordered!"
- cont "Thank you!"
+ cont "Thanks, <PLAYER>!"
+
+ para "By the way, I must"
+ line "ask you to do"
+ cont "something for me."
done
_OaksLabAroundWorldText::
@@ -135,9 +106,10 @@ _OaksLabGivePokeballsText2::
line "#MON appears,"
cont "it's fair game."
- para "Just throw a #"
- line "BALL at it and try"
- line "to catch it!"
+ para "Just like I showed"
+ line "you, throw a #"
+ cont "BALL at it and try"
+ cont "to catch it!"
para "This won't always"
line "work, though."
@@ -191,31 +163,26 @@ _OaksLabRivalWaitingText::
done
_OaksLabChooseMonText::
- text "OAK: <RIVAL>?"
- line "Let me think..."
-
- para "Oh, that's right,"
- line "I told you to"
- cont "come! Just wait!"
+ text "OAK: Hmm? <RIVAL>?"
+ line "Why are you here"
+ cont "already?"
- para "Here, <PLAYER>!"
+ para "I said for you to"
+ line "come by later..."
- para "There are 3"
- line "#MON here!"
+ para "Ah, whatever!"
+ line "Just wait there."
- para "Haha!"
+ para "Look, <PLAYER>! Do"
+ line "you see that ball"
+ cont "on the table?"
- para "They are inside"
- line "the # BALLs."
-
- para "When I was young,"
- line "I was a serious"
- cont "#MON trainer!"
+ para "It's called a #"
+ line "BALL. It holds a"
+ cont "#MON inside."
- para "In my old age, I"
- line "have only 3 left,"
- cont "but you can have"
- cont "one! Choose!"
+ para "You may have it!"
+ line "Go on, take it!"
done
_OaksLabRivalInterjectionText::
@@ -225,28 +192,69 @@ _OaksLabRivalInterjectionText::
done
_OaksLabBePatientText::
- text "OAK: Be patient!"
- line "<RIVAL>, you can"
- cont "have one too!"
+ text "OAK: Be patient,"
+ line "<RIVAL>, I'll give"
+ cont "you one later."
done
-_OaksLabLeavingText::
- text "OAK: Hey! Don't go"
- line "away yet!"
- done
+_OaksLabRivalTakesText1::
+ text "<RIVAL>: No way!"
+ line "<PLAYER>, I want"
+ cont "this #MON!"
+ prompt
+
+_OaksLabRivalTakesText2::
+ text "<RIVAL> snatched"
+ line "the #MON!@"
+ text_end
+
+_OaksLabRivalTakesText3::
+ text "OAK: <RIVAL>! What"
+ line "are you doing?"
+ prompt
+
+_OaksLabRivalTakesText4::
+ text "<RIVAL>: Gramps, I"
+ line "want this one!"
+ prompt
-_OaksLabRivalPickingMonText::
- text "<RIVAL>: I'll take"
- line "this one, then!"
+_OaksLabRivalTakesText5::
+ text "OAK: But, I... Oh,"
+ line "all right then."
+ cont "That #MON is"
+ cont "yours."
+
+ para "I was going to"
+ line "give you one"
+ cont "anyway..."
+
+ para "<PLAYER>, come over"
+ line "here."
done
-_OaksLabRivalReceivedMonText::
- text "<RIVAL> received"
+_OaksLabOakGivesText::
+ text "OAK: <PLAYER>, this"
+ line "is the #MON I"
+ cont "caught earlier."
+
+ para "You can have it."
+ line "I caught it in"
+ cont "the wild and it's"
+ cont "not tame yet."
+ prompt
+
+_OaksLabReceivedText::
+ text "<PLAYER> received"
line "a @"
text_ram wcd6d
text "!@"
text_end
+_OaksLabLeavingText::
+ text "OAK: Hey! Don't go"
+ line "away yet!"
+ done
+
_OaksLabRivalChallengeText::
text "<RIVAL>: Wait"
line "<PLAYER>!"
@@ -279,19 +287,48 @@ _OaksLabRivalToughenUpText::
line "Smell you later!"
done
+_OaksLabPikachuDislikesPokeballsText1::
+ text "OAK: What?"
+ done
+
+_OaksLabPikachuDislikesPokeballsText2::
+ text "OAK: Would you"
+ line "look at that!"
+
+ para "It's odd, but it"
+ line "appears that your"
+ cont "PIKACHU dislikes"
+ cont "# BALLs."
+
+ para "You should just"
+ line "keep it with you."
+
+ para "That should make"
+ line "it happy!"
+
+ para "You can talk to it"
+ line "and see how it"
+ cont "feels about you."
+ done
+
_OaksLabText21::
text "<RIVAL>: Gramps!"
done
_OaksLabText22::
- text "<RIVAL>: What did"
- line "you call me for?"
+ text "<RIVAL>: Gramps,"
+ line "my #MON has"
+ cont "grown stronger!"
+ cont "Check it out!"
done
_OaksLabText23::
- text "OAK: Oh right! I"
- line "have a request"
- cont "of you two."
+ text "OAK: Ah, <RIVAL>,"
+ line "good timing!"
+
+ para "I needed to ask"
+ line "both of you to do"
+ cont "something for me."
done
_OaksLabText24::
@@ -362,121 +399,3 @@ _OaksLabText_1d405::
text "I study #MON as"
line "PROF.OAK's AIDE."
done
-
-_OaksLabText_441cc::
- text "#DEX comp-"
- line "letion is:"
-
- para "@"
- text_decimal hDexRatingNumMonsSeen, 1, 3
- text " #MON seen"
- line "@"
- text_decimal hDexRatingNumMonsOwned, 1, 3
- text " #MON owned"
-
- para "PROF.OAK's"
- line "Rating:"
- prompt
-
-_OaksLabText_44201::
- text "You still have"
- line "lots to do."
- cont "Look for #MON"
- cont "in grassy areas!"
- done
-
-_OaksLabText_44206::
- text "You're on the"
- line "right track! "
- cont "Get a FLASH HM"
- cont "from my AIDE!"
- done
-
-_OaksLabText_4420b::
- text "You still need"
- line "more #MON!"
- cont "Try to catch"
- cont "other species!"
- done
-
-_OaksLabText_44210::
- text "Good, you're"
- line "trying hard!"
- cont "Get an ITEMFINDER"
- cont "from my AIDE!"
- done
-
-_OaksLabText_44215::
- text "Looking good!"
- line "Go find my AIDE"
- cont "when you get 50!"
- done
-
-_OaksLabText_4421a::
- text "You finally got at"
- line "least 50 species!"
- cont "Be sure to get"
- cont "EXP.ALL from my"
- cont "AIDE!"
- done
-
-_OaksLabText_4421f::
- text "Ho! This is geting"
- line "even better!"
- done
-
-_OaksLabText_44224::
- text "Very good!"
- line "Go fish for some"
- cont "marine #MON!"
- done
-
-_OaksLabText_44229::
- text "Wonderful!"
- line "Do you like to"
- cont "collect things?"
- done
-
-_OaksLabText_4422e::
- text "I'm impressed!"
- line "It must have been"
- cont "difficult to do!"
- done
-
-_OaksLabText_44233::
- text "You finally got at"
- line "least 100 species!"
- cont "I can't believe"
- cont "how good you are!"
- done
-
-_OaksLabText_44238::
- text "You even have the"
- line "evolved forms of"
- cont "#MON! Super!"
- done
-
-_OaksLabText_4423d::
- text "Excellent! Trade"
- line "with friends to"
- cont "get some more!"
- done
-
-_OaksLabText_44242::
- text "Outstanding!"
- line "You've become a"
- cont "real pro at this!"
- done
-
-_OaksLabText_44247::
- text "I have nothing"
- line "left to say!"
- cont "You're the"
- cont "authority now!"
- done
-
-_OaksLabText_4424c::
- text "Your #DEX is"
- line "entirely complete!"
- cont "Congratulations!"
- done
diff --git a/text/PalletTown.asm b/text/PalletTown.asm
index caaed3ac..ec6ec630 100644
--- a/text/PalletTown.asm
+++ b/text/PalletTown.asm
@@ -4,9 +4,21 @@ _OakAppearsText::
text_end
_OakWalksUpText::
- text "OAK: It's unsafe!"
- line "Wild #MON live"
- cont "in tall grass!"
+ text "OAK: That was"
+ line "close!"
+
+ para "Wild #MON live"
+ line "in tall grass!"
+ done
+
+_OakWhewText::
+ text "OAK: Whew..."
+ done
+
+_OakGrassText::
+ text "OAK: A #MON can"
+ line "appear anytime in"
+ cont "tall grass."
para "You need your own"
line "#MON for your"
diff --git a/text/PewterGym.asm b/text/PewterGym.asm
index 9114ec7b..892269c1 100644
--- a/text/PewterGym.asm
+++ b/text/PewterGym.asm
@@ -16,3 +16,171 @@ _BrockPreBattleText::
cont "Fine then! Show"
cont "me your best!"
done
+
+_BrockPostBattleAdviceText::
+ text "There are all"
+ line "kinds of trainers"
+ cont "in the world!"
+
+ para "Some raise #MON"
+ line "for fights. Some"
+ cont "see them as pets."
+
+ para "I'm in training to"
+ line "become a #MON"
+ cont "breeder."
+
+ para "If you take your"
+ line "#MON training"
+ cont "seriously, go"
+ cont "visit the GYM in"
+ cont "CERULEAN and test"
+ cont "your abilities!"
+ done
+
+_BeforeReceivedTM34Text::
+ text "Wait! Take this"
+ line "with you!"
+ done
+
+_ReceivedTM34Text::
+ text "<PLAYER> received"
+ line "TM34!@"
+ text_end
+
+_TM34ExplanationText::
+ text_start
+
+ para "A TM contains a"
+ line "technique that"
+ cont "can be taught to"
+ cont "#MON!"
+
+ para "A TM is good only"
+ line "once! So when you"
+ cont "use one to teach"
+ cont "a new technique,"
+ cont "pick the #MON"
+ cont "carefully!"
+
+ para "TM34 contains"
+ line "BIDE!"
+
+ para "Your #MON will"
+ line "absorb damage in"
+ cont "battle then pay"
+ cont "it back double!"
+ done
+
+_TM34NoRoomText::
+ text "You don't have"
+ line "room for this!"
+ done
+
+_ReceivedBoulderBadgeText::
+ text "I took"
+ line "you for granted."
+
+ para "As proof of your"
+ line "victory, here's"
+ cont "the BOULDERBADGE!"
+
+ para "<PLAYER> received"
+ line "the BOULDERBADGE!@"
+ text_end
+
+_BrockBoulerBadgeInfoText::
+ text_start
+
+ para "That's an official"
+ line "#MON LEAGUE"
+ cont "BADGE!"
+
+ para "Its bearer's"
+ line "#MON become"
+ cont "more powerful!"
+
+ para "The technique"
+ line "FLASH can now be"
+ cont "used anytime!"
+ prompt
+
+_PewterGymBattleText1::
+ text "Stop right there,"
+ line "kid!"
+
+ para "You're still light"
+ line "years from facing"
+ cont "BROCK!"
+ done
+
+_PewterGymEndBattleText1::
+ text "Darn!"
+
+ para "Light years isn't"
+ line "time! It measures"
+ cont "distance!"
+ prompt
+
+_PewterGymAfterBattleText1::
+ text "You're pretty hot,"
+ line "but not as hot"
+ cont "as BROCK!"
+ done
+
+_PewterGymGuidePreAdviceText::
+ text "Hiya! I can tell"
+ line "you have what it"
+ cont "takes to become a"
+ cont "#MON champ!"
+
+ para "I'm no trainer,"
+ line "but I can tell"
+ cont "you how to win!"
+
+ para "Let me take you"
+ line "to the top!"
+ done
+
+_PewterGymGuideBeginAdviceText::
+ text "All right! Let's"
+ line "get happening!"
+ prompt
+
+_PewterGymGuideAdviceText::
+ text "The 1st #MON"
+ line "out in a match is"
+ cont "at the top of the"
+ cont "#MON LIST!"
+
+ para "By changing the"
+ line "order of #MON,"
+ cont "matches could be"
+ cont "made easier!"
+ done
+
+_PewterGymText_5c524::
+ text "It's a free"
+ line "service! Let's"
+ cont "get happening!"
+ prompt
+
+_PewterGymGuidePostBattleText::
+ text "Just as I thought!"
+ line "You're #MON"
+ cont "champ material!"
+ done
+
+_PewterGymGuyText::
+ text "All right! Let's"
+ line "get happening!"
+
+ para "It will be tough"
+ line "for your PIKACHU"
+ cont "at this GYM!"
+
+ para "Electric attacks"
+ line "are harmless to"
+ cont "BROCK's ground-"
+ cont "type #MON."
+ done
diff --git a/text/PewterGym_2.asm b/text/PewterGym_2.asm
deleted file mode 100644
index 2f651278..00000000
--- a/text/PewterGym_2.asm
+++ /dev/null
@@ -1,146 +0,0 @@
-_BrockPostBattleAdviceText::
- text "There are all"
- line "kinds of trainers"
- cont "in the world!"
-
- para "You appear to be"
- line "very gifted as a"
- cont "#MON trainer!"
-
- para "Go to the GYM in"
- line "CERULEAN and test"
- cont "your abilities!"
- done
-
-_BeforeReceivedTM34Text::
- text "Wait! Take this"
- line "with you!"
- done
-
-_ReceivedTM34Text::
- text "<PLAYER> received"
- line "TM34!@"
- text_end
-
-_TM34ExplanationText::
- text_start
-
- para "A TM contains a"
- line "technique that"
- cont "can be taught to"
- cont "#MON!"
-
- para "A TM is good only"
- line "once! So when you"
- cont "use one to teach"
- cont "a new technique,"
- cont "pick the #MON"
- cont "carefully!"
-
- para "TM34 contains"
- line "BIDE!"
-
- para "Your #MON will"
- line "absorb damage in"
- cont "battle then pay"
- cont "it back double!"
- done
-
-_TM34NoRoomText::
- text "You don't have"
- line "room for this!"
- done
-
-_ReceivedBoulderBadgeText::
- text "I took"
- line "you for granted."
-
- para "As proof of your"
- line "victory, here's"
- cont "the BOULDERBADGE!"
-
- para "<PLAYER> received"
- line "the BOULDERBADGE!@"
- text_end
-
-_BrockBoulerBadgeInfoText::
- text_start
-
- para "That's an official"
- line "#MON LEAGUE"
- cont "BADGE!"
-
- para "Its bearer's"
- line "#MON become"
- cont "more powerful!"
-
- para "The technique"
- line "FLASH can now be"
- cont "used any time!"
- prompt
-
-_PewterGymBattleText1::
- text "Stop right there,"
- line "kid!"
-
- para "You're still light"
- line "years from facing"
- cont "BROCK!"
- done
-
-_PewterGymEndBattleText1::
- text "Darn!"
-
- para "Light years isn't"
- line "time! It measures"
- cont "distance!"
- prompt
-
-_PewterGymAfterBattleText1::
- text "You're pretty hot,"
- line "but not as hot"
- cont "as BROCK!"
- done
-
-_PewterGymGuidePreAdviceText::
- text "Hiya! I can tell"
- line "you have what it"
- cont "takes to become a"
- cont "#MON champ!"
-
- para "I'm no trainer,"
- line "but I can tell"
- cont "you how to win!"
-
- para "Let me take you"
- line "to the top!"
- done
-
-_PewterGymGuideBeginAdviceText::
- text "All right! Let's"
- line "get happening!"
- prompt
-
-_PewterGymGuideAdviceText::
- text "The 1st #MON"
- line "out in a match is"
- cont "at the top of the"
- cont "#MON LIST!"
-
- para "By changing the"
- line "order of #MON,"
- cont "matches could be"
- cont "made easier!"
- done
-
-_PewterGymText_5c524::
- text "It's a free"
- line "service! Let's"
- cont "get happening!"
- prompt
-
-_PewterGymGuidePostBattleText::
- text "Just as I thought!"
- line "You're #MON"
- cont "champ material!"
- done
diff --git a/text/PewterMart.asm b/text/PewterMart.asm
index 0d5b07a2..4dbc3c02 100644
--- a/text/PewterMart.asm
+++ b/text/PewterMart.asm
@@ -1,5 +1,5 @@
_PewterMartText2::
- text "A shady, old man"
+ text "A shady old man"
line "got me to buy"
cont "this really weird"
cont "fish #MON!"
diff --git a/text/PewterPokecenter.asm b/text/PewterPokecenter.asm
index 6a1b373e..968f6af0 100644
--- a/text/PewterPokecenter.asm
+++ b/text/PewterPokecenter.asm
@@ -8,6 +8,19 @@ _PewterPokecenterText2::
para "Scram!"
done
+_PewterPokecenterText3::
+ text "#MON CENTERS"
+ line "are wonderful!"
+
+ para "They heal #MON"
+ line "completely."
+
+ para "Even conditions"
+ line "like sleep, burn,"
+ cont "poison and others"
+ cont "are cured."
+ done
+
_PewterJigglypuffText::
text "JIGGLYPUFF: Puu"
line "pupuu!"
diff --git a/text/PokemonFanClub.asm b/text/PokemonFanClub.asm
index 87c273a6..c3858e1c 100644
--- a/text/PokemonFanClub.asm
+++ b/text/PokemonFanClub.asm
@@ -1,15 +1,25 @@
PikachuFanText::
text "Won't you admire"
- line "my PIKACHU's"
+ line "my CLEFAIRY's"
cont "adorable tail?"
done
PikachuFanBetterText::
- text "Humph! My PIKACHU"
+ text "Humph! My CLEFAIRY"
line "is twice as cute"
cont "as that one!"
done
+PikachuFanPrintText::
+ text "Our CHAIRMAN's new"
+ line "hobby is taking"
+ cont "#MON photos."
+
+ para "He gave me a nice"
+ line "PRINT of my cute"
+ cont "CLEFAIRY."
+ done
+
SeelFanText::
text "I just love my"
line "SEEL!"
@@ -25,9 +35,15 @@ SeelFanBetterText::
line "more attractive!"
done
+SeelFanPrintText::
+ text "I'm going to hook"
+ line "up the cable to"
+ cont "get a photo PRINT"
+ cont "of my SEEL!"
+ done
+
FanClubPikachuText::
- text "PIKACHU: Chu!"
- line "Pikachu!"
+ text "CLEFAIRY: Pippii!"
done
FanClubSeelText::
@@ -38,8 +54,9 @@ FanClubMeetChairText::
text "I chair the"
line "#MON Fan Club!"
- para "I have collected"
- line "over 100 #MON!"
+ para "I have more than"
+ line "100 #MON. I"
+ cont "love them all!"
para "I'm very fussy"
line "when it comes to"
@@ -47,8 +64,8 @@ FanClubMeetChairText::
para "So..."
- para "Did you come"
- line "visit to hear"
+ para "Did you come to"
+ line "hear me brag"
cont "about my #MON?"
done
@@ -69,7 +86,7 @@ FanClubChairStoryText::
cont "love it!"
para "Hug it...when..."
- cont "sleeping...warm"
+ line "sleeping...warm"
cont "and cuddly..."
cont "spectacular..."
cont "ravishing..."
@@ -126,19 +143,37 @@ FanClubBagFullText::
line "this!"
done
-_FanClubText6::
- text "Our Chairman is"
- line "very vocal about"
- cont "#MON."
+FanClubChairPrintText1::
+ text "Hi there, <PLAYER>!"
+ line "Have you seen my"
+ cont "#MON photos?"
+
+ para "I have them framed"
+ line "up on that wall."
+
+ para "Ah, I know!"
+
+ para "Would you like me"
+ line "to take a photo"
+ cont "of your #MON?"
done
-_FanClubText7::
- text "Let's all listen"
- line "politely to other"
- cont "trainers!"
+FanClubChairPrintText2::
+ text "No? That's really"
+ line "disappointing."
done
-_FanClubText8::
- text "If someone brags,"
- line "brag right back!"
+FanClubChairPrintText3::
+ text "OK, I'm done."
+ done
+
+FanClubChairPrintText4::
+ text "Maybe we won't"
+ line "PRINT this now."
+ done
+
+_FanClubText6::
+ text "Our CHAIRMAN is"
+ line "very vocal about"
+ cont "#MON."
done
diff --git a/text/PokemonTower7F.asm b/text/PokemonTower7F.asm
index 704a71eb..86f05445 100644
--- a/text/PokemonTower7F.asm
+++ b/text/PokemonTower7F.asm
@@ -1,3 +1,29 @@
+_PokemonTowerJessieJamesText1::
+ text "Stop right there!@"
+ text_end
+
+_PokemonTowerJessieJamesText2::
+ text "Grampa here wanted"
+ line "to complain, so"
+ cont "we're setting him"
+ cont "straight."
+
+ para "So render yourself"
+ line "invisible, or"
+ cont "prepare to fight!"
+ done
+
+_PokemonTowerJessieJamesText3::
+ text "You"
+ line "will regret this!"
+ prompt
+
+_PokemonTowerJessieJamesText4::
+ text "Looks like TEAM"
+ line "ROCKET's blasting"
+ cont "off again!@"
+ text_end
+
_TowerRescueFujiText::
text "MR.FUJI: Heh? You"
line "came to save me?"
@@ -23,56 +49,3 @@ _TowerRescueFujiText::
cont "HOUSE at the foot"
cont "of this tower."
done
-
-_PokemonTower7BattleText1::
- text "What do you want?"
- line "Why are you here?"
- done
-
-_PokemonTower7EndBattleText1::
- text "I give up!"
- prompt
-
-_PokemonTower7AfterBattleText1::
- text "I'm not going to"
- line "forget this!"
- done
-
-_PokemonTower7BattleText2::
- text "This old guy came"
- line "and complained"
- cont "about us harming"
- cont "useless #MON!"
-
- para "We're talking it"
- line "over as adults!"
- done
-
-_PokemonTower7EndBattleText2::
- text "Please!"
- line "No more!"
- prompt
-
-_PokemonTower7AfterBattleText2::
- text "#MON are only"
- line "good for making"
- cont "money!"
-
- para "Stay out of our"
- line "business!"
- done
-
-_PokemonTower7BattleText3::
- text "You're not saving"
- line "anyone, kid!"
- done
-
-_PokemonTower7EndBattleText3::
- text "Don't"
- line "fight us ROCKETs!"
- prompt
-
-_PokemonTower7AfterBattleText3::
- text "You're not getting"
- line "away with this!"
- done
diff --git a/text/RedsHouse1F.asm b/text/RedsHouse1F.asm
index 07768af9..633075bb 100644
--- a/text/RedsHouse1F.asm
+++ b/text/RedsHouse1F.asm
@@ -1,7 +1,7 @@
_MomWakeUpText::
text "MOM: Right."
line "All boys leave"
- cont "home some day."
+ cont "home someday."
cont "It said so on TV."
para "PROF.OAK, next"
@@ -10,9 +10,14 @@ _MomWakeUpText::
done
_MomHealText1::
- text "MOM: <PLAYER>!"
- line "You should take a"
- cont "quick rest."
+ text "MOM: <PLAYER>, if"
+ line "you drive your"
+ cont "#MON too hard,"
+ cont "they'll dislike"
+ cont "you."
+
+ para "You should take a"
+ line "rest."
prompt
_MomHealText2::
diff --git a/text/RockTunnelB1F.asm b/text/RockTunnelB1F.asm
index 1a565eb3..d0437de7 100644
--- a/text/RockTunnelB1F.asm
+++ b/text/RockTunnelB1F.asm
@@ -106,3 +106,24 @@ _RockTunnel2EndBattleText8::
text "Fired"
line "away!"
prompt
+
+_RockTunnel2AfterBattleText8::
+ text "I'll raise my"
+ line "#MON to beat"
+ cont "yours, kid!"
+ done
+
+_RockTunnel2BattleText9::
+ text "I draw #MON"
+ line "when I'm home."
+ done
+
+_RockTunnel2EndBattleText9::
+ text "Whew!"
+ line "I'm exhausted!"
+ prompt
+
+_RockTunnel2AfterBattleText9::
+ text "I'm an artist,"
+ line "not a fighter."
+ done
diff --git a/text/RockTunnelB1F_2.asm b/text/RockTunnelB1F_2.asm
deleted file mode 100644
index e8e45a7f..00000000
--- a/text/RockTunnelB1F_2.asm
+++ /dev/null
@@ -1,20 +0,0 @@
-_RockTunnel2AfterBattleText8::
- text "I'll raise my"
- line "#MON to beat"
- cont "yours, kid!"
- done
-
-_RockTunnel2BattleText9::
- text "I draw #MON"
- line "when I'm home."
- done
-
-_RockTunnel2EndBattleText9::
- text "Whew!"
- line "I'm exhausted!"
- prompt
-
-_RockTunnel2AfterBattleText9::
- text "I'm an artist,"
- line "not a fighter."
- done
diff --git a/text/RocketHideoutB4F.asm b/text/RocketHideoutB4F.asm
index f3ba43f3..099045bc 100644
--- a/text/RocketHideoutB4F.asm
+++ b/text/RocketHideoutB4F.asm
@@ -1,3 +1,28 @@
+_RocketHideoutJessieJamesText1::
+ text "Not another step,"
+ line "brat!@"
+ text_end
+
+_RocketHideoutJessieJamesText2::
+ text "How dare you"
+ line "humiliate us at"
+ cont "MT.MOON!"
+
+ para "It's payback time,"
+ line "you brat!"
+ done
+
+_RocketHideoutJessieJamesText3::
+ text "Such"
+ line "a dreadful twerp!"
+ prompt
+
+_RocketHideoutJessieJamesText4::
+ text "Looks like TEAM"
+ line "ROCKET's blasting"
+ cont "off again!@"
+ text_end
+
_RocketHideout4Text_4557a::
text "So! I must say, I"
line "am impressed you"
@@ -26,38 +51,6 @@ _RocketHideout4Text_45584::
line "again..."
done
-_RocketHideout4BattleText2::
- text "I know you! You"
- line "ruined our plans"
- cont "at MT.MOON!"
- done
-
-_RocketHideout4EndBattleText2::
- text "Burned"
- line "again!"
- prompt
-
-_RocketHide4AfterBattleText2::
- text "Do you have"
- line "something against"
- cont "TEAM ROCKET?"
- done
-
-_RocketHideout4BattleText3::
- text "How can you not"
- line "see the beauty of"
- cont "our evil?"
- done
-
-_RocketHideout4EndBattleText3::
- text "Ayaya!"
- prompt
-
-_RocketHide4AfterBattleText3::
- text "BOSS! I'm sorry I"
- line "failed you!"
- done
-
_RocketHideout4BattleText4::
text "The elevator"
line "doesn't work? Who"
diff --git a/text/Route10.asm b/text/Route10.asm
index 057ddcb5..a56018f0 100644
--- a/text/Route10.asm
+++ b/text/Route10.asm
@@ -33,7 +33,7 @@ _Route10AfterBattleText2::
done
_Route10BattleText3::
- text "Hi kid, want to"
+ text "Hi, kid, want to"
line "see my #MON?"
done
diff --git a/text/Route11.asm b/text/Route11.asm
index 13e37bdf..451d2bec 100644
--- a/text/Route11.asm
+++ b/text/Route11.asm
@@ -131,3 +131,32 @@ _Route11BattleText9::
text "Watch out for"
line "live wires!"
done
+
+_Route11EndBattleText9::
+ text "Whoa!"
+ line "You spark plug!"
+ prompt
+
+_Route11AfterBattleText9::
+ text "Well, better get"
+ line "back to work."
+ done
+
+_Route11BattleText10::
+ text "My #MON should"
+ line "be ready by now!"
+ done
+
+_Route11EndBattleText10::
+ text "Too"
+ line "much, too young!"
+ prompt
+
+_Route11AfterBattleText10::
+ text "I better go find"
+ line "stronger ones!"
+ done
+
+_Route11Text11::
+ text "DIGLETT's CAVE"
+ done
diff --git a/text/Route11_2.asm b/text/Route11_2.asm
deleted file mode 100644
index b9b68d6d..00000000
--- a/text/Route11_2.asm
+++ /dev/null
@@ -1,28 +0,0 @@
-_Route11EndBattleText9::
- text "Whoa!"
- line "You spark plug!"
- prompt
-
-_Route11AfterBattleText9::
- text "Well, better get"
- line "back to work."
- done
-
-_Route11BattleText10::
- text "My #MON should"
- line "be ready by now!"
- done
-
-_Route11EndBattleText10::
- text "Too"
- line "much, too young!"
- prompt
-
-_Route11AfterBattleText10::
- text "I better go find"
- line "stronger ones!"
- done
-
-_Route11Text11::
- text "DIGLETT's CAVE"
- done
diff --git a/text/Route12.asm b/text/Route12.asm
index 82696fda..27befda5 100644
--- a/text/Route12.asm
+++ b/text/Route12.asm
@@ -109,7 +109,7 @@ _Route12EndBattleText6::
_Route12AfterBattleText6::
text "It's all right."
line "Losing doesn't"
- cont "bug me any more."
+ cont "bug me anymore."
done
_Route12BattleText7::
diff --git a/text/Route12Gate2F.asm b/text/Route12Gate2F.asm
index b5a6465f..adaf22cd 100644
--- a/text/Route12Gate2F.asm
+++ b/text/Route12Gate2F.asm
@@ -5,7 +5,7 @@ _TM39PreReceiveText::
para "You can have this"
line "TM. I don't need"
- cont "it any more..."
+ cont "it anymore..."
prompt
_ReceivedTM39Text::
diff --git a/text/Route14.asm b/text/Route14.asm
index 18e85ed4..9a9de78c 100644
--- a/text/Route14.asm
+++ b/text/Route14.asm
@@ -10,7 +10,7 @@ _Route14EndBattleText1::
prompt
_Route14AfterBattleText1::
- text "You have some HMs"
+ text "You have some HMs,"
line "right? #MON"
cont "can't ever forget"
cont "those moves."
diff --git a/text/Route16.asm b/text/Route16.asm
index 45265829..2ef6b02a 100644
--- a/text/Route16.asm
+++ b/text/Route16.asm
@@ -19,7 +19,7 @@ _Route16BattleText2::
done
_Route16EndBattleText2::
- text "Knock"
+ text "Knock-"
line "out!"
prompt
diff --git a/text/Route17.asm b/text/Route17.asm
index a0affd90..f7f59683 100644
--- a/text/Route17.asm
+++ b/text/Route17.asm
@@ -133,7 +133,7 @@ _Route17AfterBattleText9::
done
_Route17BattleText10::
- text "Get lost kid!"
+ text "Get lost, kid!"
line "I'm bushed!"
done
diff --git a/text/Route22.asm b/text/Route22.asm
index 3a1d28f0..1754627f 100644
--- a/text/Route22.asm
+++ b/text/Route22.asm
@@ -1,3 +1,36 @@
+_Route22RivalDefeatedText1::
+ text "Awww!"
+ line "You just lucked"
+ cont "out!"
+ prompt
+
+_Route22Text_511bc::
+ text "<RIVAL>: What?"
+ line "Why do I have 2"
+ cont "#MON?"
+
+ para "You should catch"
+ cont "some more too!"
+ prompt
+
+_Route22RivalDefeatedText2::
+ text "What!?"
+
+ para "I was just"
+ line "careless!"
+ prompt
+
+_Route22Text_511d0::
+ text "<RIVAL>: Hahaha!"
+ line "<PLAYER>! That's"
+ cont "your best? You're"
+ cont "nowhere near as"
+ cont "good as me, pal!"
+
+ para "Go train some"
+ line "more! You loser!"
+ prompt
+
_Route22RivalBeforeBattleText1::
text "<RIVAL>: Hey!"
line "<PLAYER>!"
@@ -31,21 +64,6 @@ _Route22RivalAfterBattleText1::
cont "a move on!"
done
-_Route22RivalDefeatedText1::
- text "Awww!"
- line "You just lucked"
- cont "out!"
- prompt
-
-_Route22Text_511bc::
- text "<RIVAL>: What?"
- line "Why do I have 2"
- cont "#MON?"
-
- para "You should catch"
- cont "some more too!"
- prompt
-
_Route22RivalBeforeBattleText2::
text "<RIVAL>: What?"
line "<PLAYER>! What a"
@@ -59,9 +77,9 @@ _Route22RivalBeforeBattleText2::
line "the BADGEs too?"
cont "That's cool!"
- para "Then I'll whip you"
- line "<PLAYER> as a"
- cont "warm up for"
+ para "Then I'll whip"
+ line "you, <PLAYER>, as"
+ cont "a warmup for"
cont "#MON LEAGUE!"
para "Come on!"
@@ -80,24 +98,6 @@ _Route22RivalAfterBattleText2::
cont "here. Smell ya!"
done
-_Route22RivalDefeatedText2::
- text "What!?"
-
- para "I was just"
- line "careless!"
- prompt
-
-_Route22Text_511d0::
- text "<RIVAL>: Hahaha!"
- line "<PLAYER>! That's"
- cont "your best? You're"
- cont "nowhere near as"
- cont "good as me, pal!"
-
- para "Go train some"
- line "more! You loser!"
- prompt
-
_Route22FrontGateText::
text "#MON LEAGUE"
line "Front Gate"
diff --git a/text/Route24.asm b/text/Route24.asm
index 6792c401..411a4d91 100644
--- a/text/Route24.asm
+++ b/text/Route24.asm
@@ -65,3 +65,123 @@ _Route24BattleText1::
text "I saw your feat"
line "from the grass!"
done
+
+_Route24EndBattleText1::
+ text "I"
+ line "thought not!"
+ prompt
+
+_Route24AfterBattleText1::
+ text "I hid because the"
+ line "people on the"
+ cont "bridge scared me!"
+ done
+
+_Route24BattleText2::
+ text "OK! I'm No. 5!"
+ line "I'll stomp you!"
+ done
+
+_Route24EndBattleText2::
+ text "Whoa!"
+ line "Too much!"
+ prompt
+
+_Route24AfterBattleText2::
+ text "I did my best, I"
+ line "have no regrets!"
+ done
+
+_Route24BattleText3::
+ text "I'm No. 4!"
+ line "Getting tired?"
+ done
+
+_Route24EndBattleText3::
+ text "I lost"
+ line "too!"
+ prompt
+
+_Route24AfterBattleText3::
+ text "I did my best, so"
+ line "I've no regrets!"
+ done
+
+_Route24BattleText4::
+ text "Here's No. 3!"
+ line "I won't be easy!"
+ done
+
+_Route24EndBattleText4::
+ text "Ow!"
+ line "Stomped flat!"
+ prompt
+
+_Route24AfterBattleText4::
+ text "I did my best, I"
+ line "have no regrets!"
+ done
+
+_Route24BattleText5::
+ text "I'm second!"
+ line "Now it's serious!"
+ done
+
+_Route24EndBattleText5::
+ text "How could I"
+ line "lose?"
+ prompt
+
+_Route24AfterBattleText5::
+ text "I did my best, I"
+ line "have no regrets!"
+ done
+
+_Route24BattleText6::
+ text "This is NUGGET"
+ line "BRIDGE! Beat us 5"
+ cont "trainers and win"
+ cont "a fabulous prize!"
+
+ para "Think you got"
+ line "what it takes?"
+ done
+
+_Route24EndBattleText6::
+ text "Whoo!"
+ line "Good stuff!"
+ prompt
+
+_Route24AfterBattleText6::
+ text "I did my best, I"
+ line "have no regrets!"
+ done
+
+_Route24DamianText1::
+ text "I'm not good at"
+ line "raising #MON."
+
+ para "I should release"
+ line "my CHARMANDER"
+ cont "because I haven't"
+ cont "raised it well..."
+
+ para "If you promise me"
+ line "you'll care for"
+ cont "it, it's yours."
+ done
+
+_Route24DamianText2::
+ text "Take good care of"
+ line "my CHARMANDER!@"
+ text_end
+
+_Route24DamianText3::
+ text "Oh... I'd better"
+ line "release it then."
+ done
+
+_Route24DamianText4::
+ text "How's CHARMANDER"
+ line "doing?"
+ done
diff --git a/text/Route24_2.asm b/text/Route24_2.asm
deleted file mode 100644
index 325dea13..00000000
--- a/text/Route24_2.asm
+++ /dev/null
@@ -1,90 +0,0 @@
-_Route24EndBattleText1::
- text "I"
- line "thought not!"
- prompt
-
-_Route24AfterBattleText1::
- text "I hid because the"
- line "people on the"
- cont "bridge scared me!"
- done
-
-_Route24BattleText2::
- text "OK! I'm No. 5!"
- line "I'll stomp you!"
- done
-
-_Route24EndBattleText2::
- text "Whoa!"
- line "Too much!"
- prompt
-
-_Route24AfterBattleText2::
- text "I did my best, I"
- line "have no regrets!"
- done
-
-_Route24BattleText3::
- text "I'm No. 4!"
- line "Getting tired?"
- done
-
-_Route24EndBattleText3::
- text "I lost"
- line "too!"
- prompt
-
-_Route24AfterBattleText3::
- text "I did my best, so"
- line "I've no regrets!"
- done
-
-_Route24BattleText4::
- text "Here's No. 3!"
- line "I won't be easy!"
- done
-
-_Route24EndBattleText4::
- text "Ow!"
- line "Stomped flat!"
- prompt
-
-_Route24AfterBattleText4::
- text "I did my best, I"
- line "have no regrets!"
- done
-
-_Route24BattleText5::
- text "I'm second!"
- line "Now it's serious!"
- done
-
-_Route24EndBattleText5::
- text "How could I"
- line "lose?"
- prompt
-
-_Route24AfterBattleText5::
- text "I did my best, I"
- line "have no regrets!"
- done
-
-_Route24BattleText6::
- text "This is NUGGET"
- line "BRIDGE! Beat us 5"
- cont "trainers and win"
- cont "a fabulous prize!"
-
- para "Think you got"
- line "what it takes?"
- done
-
-_Route24EndBattleText6::
- text "Whoo!"
- line "Good stuff!"
- prompt
-
-_Route24AfterBattleText6::
- text "I did my best, I"
- line "have no regrets!"
- done
diff --git a/text/Route25.asm b/text/Route25.asm
index 325ab348..4786d830 100644
--- a/text/Route25.asm
+++ b/text/Route25.asm
@@ -56,8 +56,8 @@ _Route25BattleText4::
done
_Route25EndBattleText4::
- text "I was in"
- line "bad condition!"
+ text "I'm in"
+ line "a slump!"
prompt
_Route25AfterBattleText4::
diff --git a/text/Route3.asm b/text/Route3.asm
index 966a0786..14d44e64 100644
--- a/text/Route3.asm
+++ b/text/Route3.asm
@@ -66,8 +66,8 @@ _Route3BattleText4::
_Route3EndBattleText4::
text "If I"
- line "had new #MON I"
- cont "would've won!"
+ line "had new #MON,"
+ cont "I would've won!"
prompt
_Route3AfterBattleText4::
diff --git a/text/Route6.asm b/text/Route6.asm
index c48b5d3d..71760449 100644
--- a/text/Route6.asm
+++ b/text/Route6.asm
@@ -1,30 +1,37 @@
_Route6BattleText1::
- text "Who's there?"
- line "Quit listening in"
- cont "on us!"
+ text "I'm doing this"
+ line "out of love."
+ cont "Leave me alone!"
done
_Route6EndBattleText1::
- text "I"
- line "just can't win!"
+ text "No,"
+ line "this can't be..."
prompt
_Route6AfterBattleText1::
- text "Whisper..."
- line "whisper..."
+ text "My love will leave"
+ line "me in disgust."
done
_Route6BattleText2::
- text "Excuse me! This"
- line "is a private"
- cont "conversation!"
+ text "I'm training for"
+ line "my love. Don't"
+ cont "bother me!"
done
_Route6EndBattleText2::
- text "Ugh!"
- line "I hate losing!"
+ text "My"
+ line "textbook never..."
prompt
+_Route6AfterBattleText2::
+ text "Now I understand,"
+ line "#MON isn't"
+ cont "about calculated"
+ cont "numbers."
+ done
+
_Route6BattleText3::
text "There aren't many"
line "bugs out here."
diff --git a/text/Route8.asm b/text/Route8.asm
index 57a9a5f9..c0988d70 100644
--- a/text/Route8.asm
+++ b/text/Route8.asm
@@ -104,7 +104,7 @@ _Route8EndBattleText7::
prompt
_Route8AfterBattleText7::
- text "SAFFRON's gate"
+ text "SAFFRON's gate-"
line "keeper won't let"
cont "us through."
cont "He's so mean!"
diff --git a/text/Route9.asm b/text/Route9.asm
index 9975000d..741c990c 100644
--- a/text/Route9.asm
+++ b/text/Route9.asm
@@ -15,19 +15,20 @@ _Route9AfterBattleText1::
cont "dark tunnel ahead."
done
-_Route9BattleText2::
- text "Who's that walking"
- line "with those good"
- cont "looking #MON?"
+_Route9BattleTextAJ::
+ text "I aim to be the"
+ line "ultimate trainer!"
done
-_Route9EndBattleText2::
- text "Out"
- line "like a light!"
+_Route9EndBattleTextAJ::
+ text "My"
+ line "SANDSHREW lost?"
prompt
-_Route9AfterBattleText2::
- text "Keep walking!"
+_Route9AfterBattleTextAJ::
+ text "I'll restart my"
+ line "100-win streak"
+ cont "with SANDSHREW."
done
_Route9BattleText3::
@@ -133,25 +134,3 @@ _Route9AfterBattleText8::
line "Us hearty guys"
cont "always laugh!"
done
-
-_Route9BattleText9::
- text "Go, my super bug"
- line "#MON!"
- done
-
-_Route9EndBattleText9::
- text "My"
- line "bugs..."
- prompt
-
-_Route9AfterBattleText9::
- text "If you don't like"
- line "bug #MON, you"
- cont "bug me!"
- done
-
-_Route9Text11::
- text "ROUTE 9"
- line "CERULEAN CITY-"
- cont "ROCK TUNNEL"
- done
diff --git a/text/Route9_2.asm b/text/Route9_2.asm
new file mode 100644
index 00000000..f3803618
--- /dev/null
+++ b/text/Route9_2.asm
@@ -0,0 +1,21 @@
+_Route9BattleText9::
+ text "Go, my super bug"
+ line "#MON!"
+ done
+
+_Route9EndBattleText9::
+ text "My"
+ line "bugs..."
+ prompt
+
+_Route9AfterBattleText9::
+ text "If you don't like"
+ line "bug #MON, you"
+ cont "bug me!"
+ done
+
+_Route9Text11::
+ text "ROUTE 9"
+ line "CERULEAN CITY-"
+ cont "ROCK TUNNEL"
+ done
diff --git a/text/SSAnne2FRooms.asm b/text/SSAnne2FRooms.asm
index a9be8cee..c9b29119 100644
--- a/text/SSAnne2FRooms.asm
+++ b/text/SSAnne2FRooms.asm
@@ -1,5 +1,5 @@
_SSAnne9Text_61bf2::
- text "In all my travels"
+ text "In all my travels,"
line "I've never seen"
cont "any #MON sleep"
cont "like this one!"
@@ -20,32 +20,6 @@ _SSAnne9Text_61c10::
line "down small bushes."
done
-_SSAnne9Text_61c1f::
- text "Have you gone to"
- line "the SAFARI ZONE"
- cont "in FUCHSIA CITY?"
-
- para "It had many rare"
- line "kinds of #MON!!"
- done
-
-_SSAnne9Text_61c2e::
- text "Me and my Daddy"
- line "think the SAFARI"
- cont "ZONE is awesome!"
- done
-
-_SSAnne9Text_61c3d::
- text "The CAPTAIN looked"
- line "really sick and"
- cont "pale!"
- done
-
-_SSAnne9Text_61c4c::
- text "I hear many people"
- line "get seasick!"
- done
-
_SSAnne9BattleText1::
text "Competing against"
line "the young keeps"
@@ -111,3 +85,29 @@ _SSAnne9AfterBattleText4::
text "Oh, I adore your"
line "strong #MON!"
done
+
+_SSAnne9Text_61c1f::
+ text "Have you gone to"
+ line "the SAFARI ZONE"
+ cont "in FUCHSIA CITY?"
+
+ para "It had many rare"
+ line "kinds of #MON!!"
+ done
+
+_SSAnne9Text_61c2e::
+ text "Me and my Daddy"
+ line "think the SAFARI"
+ cont "ZONE is awesome!"
+ done
+
+_SSAnne9Text_61c3d::
+ text "The CAPTAIN looked"
+ line "really sick and"
+ cont "pale!"
+ done
+
+_SSAnne9Text_61c4c::
+ text "I hear many people"
+ line "get seasick!"
+ done
diff --git a/text/SSAnneCaptainsRoom.asm b/text/SSAnneCaptainsRoom.asm
index 5216cf04..5bd86e17 100644
--- a/text/SSAnneCaptainsRoom.asm
+++ b/text/SSAnneCaptainsRoom.asm
@@ -28,7 +28,7 @@ _ReceivingHM01Text::
para "Teach it to your"
line "#MON and you"
cont "can see it CUT"
- cont "any time!"
+ cont "anytime!"
prompt
_ReceivedHM01Text::
@@ -42,7 +42,7 @@ _SSAnne7Text_61932::
text "CAPTAIN: Whew!"
para "Now that I'm not"
- line "sick any more, I"
+ line "sick anymore, I"
cont "guess it's time."
done
diff --git a/text/SSAnneKitchen.asm b/text/SSAnneKitchen.asm
index 7fcc9973..b7784019 100644
--- a/text/SSAnneKitchen.asm
+++ b/text/SSAnneKitchen.asm
@@ -47,7 +47,7 @@ _SSAnne6Text_61807::
prompt
_SSAnne6Text_6180c::
- text "Salmon du Salad!"
+ text "Salade de Salmon!"
para "Les guests may"
line "gripe it's fish"
diff --git a/text/SafariZoneGate.asm b/text/SafariZoneGate.asm
index 59a7c2af..bd7e8de4 100644
--- a/text/SafariZoneGate.asm
+++ b/text/SafariZoneGate.asm
@@ -3,6 +3,26 @@ _SafariZoneEntranceText1::
line "SAFARI ZONE!"
done
+SafariZoneEntranceText_9e814::
+ text "Leaving early?@"
+ text_end
+
+_SafariZoneEntranceText_753bb::
+ text "Please return any"
+ line "SAFARI BALLs you"
+ cont "have left."
+ done
+
+_SafariZoneEntranceText_753c0::
+ text "Good Luck!"
+ done
+
+_SafariZoneEntranceText_753c5::
+ text "Did you get a"
+ line "good haul?"
+ cont "Come again!"
+ done
+
SafariZoneEntranceText_9e6e4::
text "For just ¥500,"
line "you can catch all"
@@ -14,7 +34,9 @@ SafariZoneEntranceText_9e6e4::
text_end
SafariZoneEntranceText_9e747::
- text "That'll be ¥500"
+ text "That'll be ¥@"
+ text_bcd wPriceTemp, $c3
+ text ","
line "please!"
para "We only use a"
@@ -44,26 +66,6 @@ _SafariZoneEntranceText_7536a::
line "money!"
done
-SafariZoneEntranceText_9e814::
- text "Leaving early?@"
- text_end
-
-_SafariZoneEntranceText_753bb::
- text "Please return any"
- line "SAFARI BALLs you"
- cont "have left."
- done
-
-_SafariZoneEntranceText_753c0::
- text "Good Luck!"
- done
-
-_SafariZoneEntranceText_753c5::
- text "Did you get a"
- line "good haul?"
- cont "Come again!"
- done
-
_SafariZoneEntranceText_753e6::
text "Hi! Is it your"
line "first time here?"
@@ -95,3 +97,51 @@ _SafariZoneEntranceText_753f0::
text "Sorry, you're a"
line "regular here!"
done
+
+_SafariZoneLowCostText1::
+ text_start
+
+ para "Oh, all right, pay"
+ line "me what you have."
+ prompt
+
+_SafariZoneLowCostText2::
+ text "But, I can't give"
+ line "you all 30 BALLs."
+ done
+
+_SafariZoneLowCostText3::
+ text_start
+
+ para "You're persistent,"
+ line "aren't you?"
+
+ para "OK, you can go in"
+ line "for free, but"
+ cont "just this once!@"
+ text_end
+
+_SafariZoneLowCostText4::
+ text_start
+ done
+
+_SafariZoneLowCostText5::
+ text "I'm sorry, but you"
+ line "have to pay to"
+ cont "enter."
+ done
+
+_SafariZoneLowCostText6::
+ text "You can't enter"
+ line "without paying!"
+ done
+
+_SafariZoneLowCostText7::
+ text "I said, no money,"
+ line "no entry!"
+ done
+
+_SafariZoneLowCostText8::
+ text "Read my lips, NO!"
+ line "Get it?"
+ done
diff --git a/text/SaffronGates.asm b/text/SaffronGates.asm
index 4f53553a..50e88a01 100644
--- a/text/SaffronGates.asm
+++ b/text/SaffronGates.asm
@@ -3,7 +3,7 @@ _SaffronGateText_1dfe7::
line "Gee, I'm thirsty,"
cont "though!"
- para "Oh wait there,"
+ para "Oh, wait there,"
line "the road's closed."
done
@@ -20,7 +20,7 @@ _SaffronGateText_1dff1::
text_start
para "..."
- line "Glug glug..."
+ line "Glug, glug..."
cont "..."
cont "Gulp..."
cont "If you want to go"
diff --git a/text/SaffronGym.asm b/text/SaffronGym.asm
index 090b951a..eab08aea 100644
--- a/text/SaffronGym.asm
+++ b/text/SaffronGym.asm
@@ -134,8 +134,7 @@ _SaffronGymEndBattleText2::
_SaffronGymAfterBattleText2::
text "Psychic #MON"
- line "fear only ghosts"
- cont "and bugs!"
+ line "fear only bugs!"
done
_SaffronGymBattleText3::
diff --git a/text/SilphCo10F.asm b/text/SilphCo10F.asm
index e916c64a..fd4d4c7c 100644
--- a/text/SilphCo10F.asm
+++ b/text/SilphCo10F.asm
@@ -1,6 +1,6 @@
_SilphCo10Text_5a1d3::
text "Waaaaa!"
- cont "I'm scared!"
+ line "I'm scared!"
done
_SilphCo10Text_5a1d8::
@@ -40,3 +40,29 @@ _SilphCo10AfterBattleText2::
line "with beating me?"
cont "Then go on home!"
done
+
+_SilphCoJessieJamesText1::
+ text "Hold it right"
+ line "there, brat!@"
+ text_end
+
+_SilphCoJessieJamesText2::
+ text "Our BOSS is in a"
+ line "meeting!"
+
+ para "You better not"
+ line "disturb him!"
+ done
+
+_SilphCoJessieJamesText3::
+ text "Like"
+ line "always..."
+ prompt
+
+_SilphCoJessieJamesText4::
+ text "TEAM ROCKET, blast"
+ line "off at the speed"
+ cont "of light!"
+
+ para "Again...@"
+ text_end
diff --git a/text/SilphCo11F.asm b/text/SilphCo11F.asm
index 36adf7d9..51033d72 100644
--- a/text/SilphCo11F.asm
+++ b/text/SilphCo11F.asm
@@ -59,7 +59,7 @@ _SilphCo11Text2::
done
_SilphCo11Text3::
- text "Ah <PLAYER>!"
+ text "Ah, <PLAYER>!"
line "So we meet again!"
para "The PRESIDENT and"
@@ -71,7 +71,7 @@ _SilphCo11Text3::
line "out of grown-up"
cont "matters..."
- para "Or, experience a"
+ para "or, experience a"
line "world of pain!"
done
@@ -97,21 +97,6 @@ _SilphCo10Text_62335::
line "shall return!"
done
-_SilphCo11BattleText1::
- text "Stop right there!"
- line "Don't you move!"
- done
-
-_SilphCo11EndBattleText1::
- text "Don't..."
- line "Please!"
- prompt
-
-_SilphCo11AfterBattleText1::
- text "So, you want to"
- line "see my BOSS?"
- done
-
_SilphCo11BattleText2::
text "Halt! Do you have"
line "an appointment"
@@ -128,8 +113,3 @@ _SilphCo11AfterBattleText2::
line "my BOSS likes his"
cont "#MON tough!"
done
-
-_SilphCo10Text_6237b::
- text "The monitor has"
- line "#MON on it!"
- done
diff --git a/text/SilphCo2F.asm b/text/SilphCo2F.asm
index b0cce269..817b4142 100644
--- a/text/SilphCo2F.asm
+++ b/text/SilphCo2F.asm
@@ -73,7 +73,7 @@ _SilphCo2EndBattleText3::
prompt
_SilphCo2AfterBattleText3::
- text "Diamond shaped"
+ text "Diamond-shaped"
line "tiles are"
cont "teleport blocks!"
diff --git a/text/SilphCo5F.asm b/text/SilphCo5F.asm
index dab42539..9c8bfd41 100644
--- a/text/SilphCo5F.asm
+++ b/text/SilphCo5F.asm
@@ -47,5 +47,61 @@ _SilphCo5AfterBattleText3::
_SilphCo5BattleText4::
text "Whaaat? There"
line "shouldn't be any"
- cont "children here?"
+ cont "children here!"
+ done
+
+_SilphCo5EndBattleText4::
+ text "Oh"
+ line "goodness!"
+ prompt
+
+_SilphCo5AfterBattleText4::
+ text "You're only on 5F."
+ line "It's a long way"
+ cont "to my BOSS!"
+ done
+
+_SilphCo5BattleText5::
+ text "Show TEAM ROCKET"
+ line "a little respect!"
+ done
+
+_SilphCo5EndBattleText5::
+ text "Cough..."
+ line "Cough..."
+ prompt
+
+_SilphCo5AfterBattleText5::
+ text "Which reminds me."
+
+ para "KOFFING evolves"
+ line "into WEEZING!"
+ done
+
+_SilphCo5Text9::
+ text "It's a #MON"
+ line "REPORT!"
+
+ para "#MON LAB"
+ line "created PORYGON,"
+ cont "the first virtual"
+ cont "reality #MON."
+ done
+
+_SilphCo5Text10::
+ text "It's a #MON"
+ line "REPORT!"
+
+ para "Over 160 #MON"
+ line "techniques have"
+ cont "been confirmed."
+ done
+
+_SilphCo5Text11::
+ text "It's a #MON"
+ line "REPORT!"
+
+ para "4 #MON evolve"
+ line "only when traded"
+ cont "by link-cable."
done
diff --git a/text/SilphCo5F_2.asm b/text/SilphCo5F_2.asm
deleted file mode 100644
index 3c1b8ead..00000000
--- a/text/SilphCo5F_2.asm
+++ /dev/null
@@ -1,55 +0,0 @@
-_SilphCo5EndBattleText4::
- text "Oh"
- line "goodness!"
- prompt
-
-_SilphCo5AfterBattleText4::
- text "You're only on 5F."
- line "It's a long way"
- cont "to my BOSS!"
- done
-
-_SilphCo5BattleText5::
- text "Show TEAM ROCKET"
- line "a little respect!"
- done
-
-_SilphCo5EndBattleText5::
- text "Cough..."
- line "Cough..."
- prompt
-
-_SilphCo5AfterBattleText5::
- text "Which reminds me."
-
- para "KOFFING evolves"
- line "into WEEZING!"
- done
-
-_SilphCo5Text9::
- text "It's a #MON"
- line "REPORT!"
-
- para "#MON LAB"
- line "created PORYGON,"
- cont "the first virtual"
- cont "reality #MON."
- done
-
-_SilphCo5Text10::
- text "It's a #MON"
- line "REPORT!"
-
- para "Over 160 #MON"
- line "techniques have"
- cont "been confirmed."
- done
-
-_SilphCo5Text11::
- text "It's a #MON"
- line "REPORT!"
-
- para "4 #MON evolve"
- line "only when traded"
- cont "by link-cable."
- done
diff --git a/text/SilphCo7F.asm b/text/SilphCo7F.asm
index 1cc2bc30..8f7b6ca2 100644
--- a/text/SilphCo7F.asm
+++ b/text/SilphCo7F.asm
@@ -79,7 +79,7 @@ _SilphCo7Text_51e4b::
done
_SilphCo7BattleText1::
- text "Oh ho! I smell a"
+ text "Aha! I smell a"
line "little rat!"
done
@@ -167,7 +167,7 @@ _SilphCo7Text_51ec3::
done
_SilphCo7Text_51ec8::
- text "Oh ho!"
+ text "Oh-oh!"
line "So, you are ready"
cont "for BOSS ROCKET!"
prompt
diff --git a/text/SummerBeachHouse.asm b/text/SummerBeachHouse.asm
new file mode 100644
index 00000000..ed28fe06
--- /dev/null
+++ b/text/SummerBeachHouse.asm
@@ -0,0 +1,107 @@
+_SurfinDudeText1::
+ text "Whoa!"
+
+ para "Your PIKACHU knows"
+ line "how to SURF! So,"
+ cont "I'm not alone..."
+
+ para "Great! You earned"
+ line "the right to SURF"
+ cont "with the DUDE!"
+
+ para "Give it a go?"
+ done
+
+_SurfinDudeText2::
+ text "Come SURF anytime,"
+ line "my friend!"
+ done
+
+_SurfinDudeText3::
+ text "Wanna go SURF?"
+ done
+
+_SurfinDudeText4::
+ text "Dogs and burgers"
+ line "on special today!"
+ done
+
+_SummerBeachHousePikachuText::
+ text "PIKACHU: Pikaa"
+ done
+
+_SummerBeachHouseSign1Text1::
+ text "SURFIN' DUDE's"
+ line "scribbles..."
+
+ para "When I shoot the"
+ line "tube, the tunes"
+ cont "hit the groove!"
+ done
+
+_SummerBeachHouseSign1Text2::
+ text "30 years of waves!"
+ line "SURFIN' DUDE"
+ done
+
+_SummerBeachHouseSign2Text1::
+ text "SURFING TIP 1!"
+
+ para "After flips, line"
+ line "the board up with"
+ cont "a wave for a cool"
+ cont "effect!"
+ done
+
+_SummerBeachHouseSign2Text2::
+ text "SUMMER BEACH HOUSE"
+ line "#MON welcome!"
+ done
+
+_SummerBeachHouseSign3Text1::
+ text "SURFING TIP 2!"
+
+ para "Pulling flips in"
+ line "a jump is totally"
+ cont "rad!"
+ done
+
+_SummerBeachHouseSign3Text2::
+ text "The sea unites"
+ line "all in surfdom!"
+ done
+
+_SummerBeachHousePrinterText1::
+ text "It's some sort of"
+ line "a machine...@"
+ text_end
+
+_SummerBeachHousePrinterText2::
+ text "SUMMER BEACH HOUSE"
+ line "PRINTER, it says.@"
+ text_end
+
+_SummerBeachHousePrinterText3::
+ text "The Hi-Score is"
+ line "shown."
+
+ para "PRINT it out?"
+ done
+
+_SummerBeachHousePrinterText4::
+ text "SUMMER BEACH HOUSE"
+ line "PRINTER, it says."
+
+ para "The Hi-Score is"
+ line "shown."
+
+ para "PRINT it out?"
+ done
+
+_SummerBeachHousePrinterText5::
+ text "PRINT completed.@"
+ text_end
+
+_SummerBeachHousePrinterText6::
+ text "PRINT error!@"
+ text_end
diff --git a/text/VermilionCity.asm b/text/VermilionCity.asm
index 2f60eb97..c65063cc 100644
--- a/text/VermilionCity.asm
+++ b/text/VermilionCity.asm
@@ -71,7 +71,7 @@ _VermilionCityText5::
line "Gogogoh!@"
text_end
-_VermilionCityText14::
+_VermilionCityText15::
text_start
para "A MACHOP is"
line "stomping the land"
@@ -87,13 +87,55 @@ _VermilionCityText6::
line "once a year."
done
-_VermilionCityText7::
+_OfficerJennyText1::
+ text "I just caught a"
+ line "SQUIRTLE that was"
+ cont "always getting"
+ cont "into mischief."
+
+ para "I think it needs a"
+ line "good trainer to"
+ cont "set it straight."
+ done
+
+_OfficerJennyText2::
+ text "You have the"
+ line "THUNDERBADGE!?"
+
+ para "You must be a"
+ line "good trainer!"
+
+ para "I just caught a"
+ line "SQUIRTLE that was"
+ cont "always getting"
+ cont "into mischief."
+
+ para "Would you take"
+ line "good care of it?"
+ done
+
+_OfficerJennyText3::
+ text "OK! Please treat"
+ line "SQUIRTLE right!@"
+ text_end
+
+_OfficerJennyText4::
+ text "Oh... What am I"
+ line "to do now?"
+ done
+
+_OfficerJennyText5::
+ text "How is SQUIRTLE"
+ line "doing?"
+ done
+
+_VermilionCityText8::
text "VERMILION CITY"
line "The Port of"
cont "Exquisite Sunsets"
done
-_VermilionCityText8::
+_VermilionCityText9::
text "NOTICE!"
para "ROUTE 12 may be"
@@ -107,13 +149,13 @@ _VermilionCityText8::
para "VERMILION POLICE"
done
-_VermilionCityText11::
+_VermilionCityText12::
text "#MON FAN CLUB"
line "All #MON fans"
cont "welcome!"
done
-_VermilionCityText12::
+_VermilionCityText13::
text "VERMILION CITY"
line "#MON GYM"
cont "LEADER: LT.SURGE"
@@ -122,6 +164,6 @@ _VermilionCityText12::
line "American!"
done
-_VermilionCityText13::
+_VermilionCityText14::
text "VERMILION HARBOR"
done
diff --git a/text/VermilionGym.asm b/text/VermilionGym.asm
index 14e0bcea..2c6a3dff 100644
--- a/text/VermilionGym.asm
+++ b/text/VermilionGym.asm
@@ -1,21 +1,167 @@
_LTSurgePreBattleText::
- text "Hey, kid! What do"
- line "you think you're"
- cont "doing here?"
+ text "Ten-hut! Welcome"
+ line "to VERMILION GYM!"
- para "You won't live"
- line "long in combat!"
- cont "That's for sure!"
+ para "Will you look at"
+ line "that, a pint-size"
+ cont "challenger!"
- para "I tell you kid,"
- line "electric #MON"
- cont "saved me during"
- cont "the war!"
+ para "Hahaha! You've got"
+ line "big and brassy"
+ cont "nerves to take me"
+ cont "on with your puny"
+ cont "power!"
- para "They zapped my"
- line "enemies into"
- cont "paralysis!"
+ para "A #MON battle"
+ line "is war! I'll show"
+ cont "you, civilian!"
- para "The same as I'll"
- line "do to you!"
+ para "I'll shock you"
+ line "into surrender!"
+ done
+
+_LTSurgePostBattleAdviceText::
+ text "A little word of"
+ line "advice, kid!"
+
+ para "Electricity is"
+ line "sure powerful!"
+
+ para "But, it's useless"
+ line "against ground-"
+ cont "type #MON!"
+ done
+
+_LTSurgeThunderBadgeInfoText::
+ text "The THUNDERBADGE"
+ line "cranks up your"
+ cont "#MON's SPEED!"
+
+ para "It also lets your"
+ line "#MON FLY any-"
+ cont "time, kid!"
+
+ para "You're special,"
+ line "kid! Take this!"
+ done
+
+_ReceivedTM24Text::
+ text "<PLAYER> received "
+ line "@"
+ text_ram wcf4b
+ text "!@"
+ text_end
+
+_TM24ExplanationText::
+ text_start
+
+ para "TM24 contains"
+ line "THUNDERBOLT!"
+
+ para "Teach it to an"
+ line "electric #MON!"
+ done
+
+_TM24NoRoomText::
+ text "Yo kid, make room"
+ line "in your pack!"
+ done
+
+_ReceivedThunderBadgeText::
+ text "Whoa!"
+
+ para "You're the real"
+ line "deal, kid!"
+
+ para "Fine then, take"
+ line "the THUNDERBADGE!"
+ prompt
+
+_VermilionGymBattleText1::
+ text "When I was in the"
+ line "Army, LT.SURGE"
+ cont "was my strict CO!"
+ done
+
+_VermilionGymEndBattleText1::
+ text "Stop!"
+ line "You're very good!"
+ prompt
+
+_VermilionGymAfterBattleText1::
+ text "The door won't"
+ line "open?"
+
+ para "LT.SURGE always"
+ line "was cautious!"
+ done
+
+_VermilionGymBattleText2::
+ text "I'm a lightweight,"
+ line "but I'm good with"
+ cont "electricity!"
+ done
+
+_VermilionGymEndBattleText2::
+ text "Fried!"
+ prompt
+
+_VermilionGymAfterBattleText2::
+ text "OK, I'll talk!"
+
+ para "LT.SURGE said he"
+ line "hid door switches"
+ cont "inside something!"
+ done
+
+_VermilionGymBattleText3::
+ text "This is no place"
+ line "for kids!"
+ done
+
+_VermilionGymEndBattleText3::
+ text "Wow!"
+ line "Surprised me!"
+ prompt
+
+_VermilionGymAfterBattleText3::
+ text "LT.SURGE set up"
+ line "double locks!"
+ cont "Here's a hint!"
+
+ para "When you open the"
+ line "1st lock, the 2nd"
+ cont "lock is right"
+ cont "next to it!"
+ done
+
+_VermilionGymGuidePreBattleText::
+ text "Yo! Champ in"
+ line "making!"
+
+ para "LT.SURGE has a"
+ line "nickname. People"
+ cont "refer to him as"
+ cont "the Lightning"
+ cont "American!"
+
+ para "He's an expert on"
+ line "electric #MON!"
+
+ para "Birds and water"
+ line "#MON are at"
+ cont "risk! Beware of"
+ cont "paralysis too!"
+
+ para "LT.SURGE is very"
+ line "cautious!"
+
+ para "You'll have to"
+ line "break a code to"
+ cont "get to him!"
+ done
+
+_VermilionGymGuidePostBattleText::
+ text "Whew! That match"
+ line "was electric!"
done
diff --git a/text/VermilionGym_2.asm b/text/VermilionGym_2.asm
deleted file mode 100644
index 02af599d..00000000
--- a/text/VermilionGym_2.asm
+++ /dev/null
@@ -1,145 +0,0 @@
-_LTSurgePostBattleAdviceText::
- text "A little word of"
- line "advice, kid!"
-
- para "Electricity is"
- line "sure powerful!"
-
- para "But, it's useless"
- line "against ground-"
- cont "type #MON!"
- done
-
-_LTSurgeThunderBadgeInfoText::
- text "The THUNDERBADGE"
- line "cranks up your"
- cont "#MON's SPEED!"
-
- para "It also lets your"
- line "#MON FLY any"
- cont "time, kid!"
-
- para "You're special,"
- line "kid! Take this!"
- done
-
-_ReceivedTM24Text::
- text "<PLAYER> received "
- line "@"
- text_ram wcf4b
- text "!@"
- text_end
-
-_TM24ExplanationText::
- text_start
-
- para "TM24 contains"
- line "THUNDERBOLT!"
-
- para "Teach it to an"
- line "electric #MON!"
- done
-
-_TM24NoRoomText::
- text "Yo kid, make room"
- line "in your pack!"
- done
-
-_ReceivedThunderBadgeText::
- text "Whoa!"
-
- para "You're the real"
- line "deal, kid!"
-
- para "Fine then, take"
- line "the THUNDERBADGE!"
- prompt
-
-_VermilionGymBattleText1::
- text "When I was in the"
- line "Army, LT.SURGE"
- cont "was my strict CO!"
- done
-
-_VermilionGymEndBattleText1::
- text "Stop!"
- line "You're very good!"
- prompt
-
-_VermilionGymAfterBattleText1::
- text "The door won't"
- line "open?"
-
- para "LT.SURGE always"
- line "was cautious!"
- done
-
-_VermilionGymBattleText2::
- text "I'm a lightweight,"
- line "but I'm good with"
- cont "electricity!"
- done
-
-_VermilionGymEndBattleText2::
- text "Fried!"
- prompt
-
-_VermilionGymAfterBattleText2::
- text "OK, I'll talk!"
-
- para "LT.SURGE said he"
- line "hid door switches"
- cont "inside something!"
- done
-
-_VermilionGymBattleText3::
- text "This is no place"
- line "for kids!"
- done
-
-_VermilionGymEndBattleText3::
- text "Wow!"
- line "Surprised me!"
- prompt
-
-_VermilionGymAfterBattleText3::
- text "LT.SURGE set up"
- line "double locks!"
- cont "Here's a hint!"
-
- para "When you open the"
- line "1st lock, the 2nd"
- cont "lock is right"
- cont "next to it!"
- done
-
-_VermilionGymGuidePreBattleText::
- text "Yo! Champ in"
- line "making!"
-
- para "LT.SURGE has a"
- line "nickname. People"
- cont "refer to him as"
- cont "the Lightning"
- cont "American!"
-
- para "He's an expert on"
- line "electric #MON!"
-
- para "Birds and water"
- line "#MON are at"
- cont "risk! Beware of"
- cont "paralysis too!"
-
- para "LT.SURGE is very"
- line "cautious!"
-
- para "You'll have to"
- line "break a code to"
- cont "get to him!"
- done
-
-_VermilionGymGuidePostBattleText::
- text "Whew! That match"
- line "was electric!"
- done
diff --git a/text/ViridianCity.asm b/text/ViridianCity.asm
index 8ee81348..2ffee596 100644
--- a/text/ViridianCity.asm
+++ b/text/ViridianCity.asm
@@ -1,3 +1,40 @@
+_ViridianCityText_19219::
+ text "First, you need"
+ line "to weaken the"
+ cont "target #MON."
+ done
+
+_ViridianCityText_1920a::
+ text "Ahh, I've had my"
+ line "coffee now and I"
+ cont "feel great!"
+
+ para "Sure, you can go"
+ line "through!"
+
+ para "I'm sorry I was"
+ line "so rude to you!"
+
+ para "I see you're using"
+ line "a #DEX."
+
+ para "I'll show you how"
+ line "to catch #MON"
+ cont "as my apology."
+ done
+
+_OldManTextAfterBattle::
+ text "That didn't work!"
+ line "I must be losing"
+ cont "my touch."
+
+ para "I've run out of"
+ line "# BALLs too."
+
+ para "I have to get some"
+ line "at #MON MART."
+ done
+
_ViridianCityText1::
text "Those # BALLs"
line "at your waist!"
@@ -5,7 +42,7 @@ _ViridianCityText1::
para "It's great that"
line "you can carry and"
- cont "use #MON any"
+ cont "use #MON any-"
cont "time, anywhere!"
done
@@ -98,44 +135,21 @@ _TM42NoRoomText::
line "stuff already."
done
-_ViridianCityText_1920a::
- text "Ahh, I've had my"
- line "coffee now and I"
- cont "feel great!"
-
- para "Sure you can go"
- line "through!"
-
- para "Are you in a"
- line "hurry?"
- done
-
-_ViridianCityText_1920f::
- text "I see you're using"
- line "a #DEX."
-
- para "When you catch a"
- line "#MON, #DEX"
- cont "is automatically"
- cont "updated."
-
- para "What? Don't you"
- line "know how to catch"
- cont "#MON?"
-
- para "I'll show you"
- line "how to then."
+_OldManAgainText1::
+ text "Hmm? You want me"
+ line "to show you how"
+ cont "to catch #MON"
+ cont "again?"
done
-_ViridianCityText_19214::
- text "Time is money..."
- line "Go along then."
+_OldManAgainText2::
+ text "Dandy! Watch what"
+ line "I do closely now!"
done
-_ViridianCityText_19219::
- text "First, you need"
- line "to weaken the"
- cont "target #MON."
+_OldManAgainText3::
+ text "Oh... I'm not good"
+ line "enough for you."
done
_ViridianCityText8::
diff --git a/text/ViridianForest.asm b/text/ViridianForest.asm
index 813b193a..f88a484c 100644
--- a/text/ViridianForest.asm
+++ b/text/ViridianForest.asm
@@ -9,7 +9,7 @@ _ViridianForestText1::
_ViridianForestBattleText1::
text "Hey! You have"
line "#MON! Come on!"
- cont "Let's battle'em!"
+ cont "Let's battle 'em!"
done
_ViridianForestEndBattleText1::
@@ -62,6 +62,40 @@ _ViridianFrstAfterBattleText3::
cont "dropped!"
done
+_ViridianForestBattleTextPikaGirl::
+ text "Hi, do you have a"
+ line "PIKACHU?"
+ done
+
+_ViridianForestEndBattleTextPikaGirl::
+ text "Oh no,"
+ line "really?"
+ prompt
+
+_ViridianForestAfterBattleTextPikaGirl::
+ text "I looked forever,"
+ line "but I never found"
+ cont "a PIKACHU here!"
+ done
+
+_ViridianForestBattleTextSamurai::
+ text "I'm gonna be the"
+ line "best. You just"
+ cont "can't beat me!"
+ done
+
+_ViridianForestEndBattleTextSamurai::
+ text "After"
+ line "all I did..."
+ prompt
+
+_ViridianForestAfterBattleTextSamurai::
+ text "A METAPOD is cool"
+ line "because its"
+ cont "attack is its"
+ cont "defense!"
+ done
+
_ViridianForestText8::
text "I ran out of #"
line "BALLs to catch"
diff --git a/text/ViridianForestSouthGate.asm b/text/ViridianForestSouthGate.asm
index c1a8df22..a5278742 100644
--- a/text/ViridianForestSouthGate.asm
+++ b/text/ViridianForestSouthGate.asm
@@ -6,8 +6,11 @@ _ViridianForestEntranceText1::
done
_ViridianForestEntranceText2::
- text "RATTATA may be"
- line "small, but its"
- cont "bite is wicked!"
- cont "Did you get one?"
+ text "You have to roam"
+ line "far to get new"
+ cont "kinds of #MON."
+
+ para "Look for other"
+ line "types outside of"
+ cont "VIRIDIAN FOREST."
done
diff --git a/text/ViridianGym.asm b/text/ViridianGym.asm
index feac7963..95fe63b3 100644
--- a/text/ViridianGym.asm
+++ b/text/ViridianGym.asm
@@ -39,7 +39,7 @@ _GiovanniPostBattleAdviceText::
cont "of #MON!"
para "Let us meet again"
- line "some day!"
+ line "someday!"
cont "Farewell!@"
text_end
@@ -209,7 +209,7 @@ _ViridianGymEndBattleText8::
prompt
_ViridianGymAfterBattleText8::
- text "You can go onto"
+ text "You can go on to"
line "#MON LEAGUE"
cont "only by defeating"
cont "our GYM LEADER!"
diff --git a/text/ViridianMart.asm b/text/ViridianMart.asm
index 640d7fd1..0152ea4c 100644
--- a/text/ViridianMart.asm
+++ b/text/ViridianMart.asm
@@ -21,11 +21,13 @@ ViridianMartParcelQuestText::
text_end
_ViridianMartText2::
- text "This shop sells"
- line "many ANTIDOTEs."
+ text "This shop sells a"
+ line "lot of PARLYZ"
+ cont "HEALs."
done
_ViridianMartText3::
- text "No! POTIONs are"
- line "all sold out."
+ text "The shop finally"
+ line "has some POTIONs"
+ cont "in stock."
done
diff --git a/text/ViridianSchoolHouse.asm b/text/ViridianSchoolHouse.asm
index f6041e0d..3c5f6379 100644
--- a/text/ViridianSchoolHouse.asm
+++ b/text/ViridianSchoolHouse.asm
@@ -4,6 +4,13 @@ _SchoolText1::
cont "my notes."
done
+_SchoolText3::
+ text "Sis says #MON"
+ line "will become tame"
+ cont "if you treat them"
+ cont "nicely."
+ done
+
_SchoolText2::
text "Okay!"
diff --git a/text/pokedex_ratings.asm b/text/pokedex_ratings.asm
new file mode 100644
index 00000000..ce701f8a
--- /dev/null
+++ b/text/pokedex_ratings.asm
@@ -0,0 +1,117 @@
+_DexCompletionText::
+ text "#DEX comp-"
+ line "letion is:"
+
+ para "@"
+ text_decimal hDexRatingNumMonsSeen, 1, 3
+ text " #MON seen"
+ line "@"
+ text_decimal hDexRatingNumMonsOwned, 1, 3
+ text " #MON owned"
+
+ para "PROF.OAK's"
+ line "Rating:"
+ prompt
+
+_DexRatingText_Own0To9::
+ text "You still have"
+ line "lots to do."
+ cont "Look for #MON"
+ cont "in grassy areas!"
+ done
+
+_DexRatingText_Own10To19::
+ text "You're on the"
+ line "right track! "
+ cont "Get a FLASH HM"
+ cont "from my AIDE!"
+ done
+
+_DexRatingText_Own20To29::
+ text "You still need"
+ line "more #MON!"
+ cont "Try to catch"
+ cont "other species!"
+ done
+
+_DexRatingText_Own30To39::
+ text "Good, you're"
+ line "trying hard!"
+ cont "Get an ITEMFINDER"
+ cont "from my AIDE!"
+ done
+
+_DexRatingText_Own40To49::
+ text "Looking good!"
+ line "Go find my AIDE"
+ cont "when you get 50!"
+ done
+
+_DexRatingText_Own50To59::
+ text "You finally got at"
+ line "least 50 species!"
+ cont "Be sure to get"
+ cont "EXP.ALL from my"
+ cont "AIDE!"
+ done
+
+_DexRatingText_Own60To69::
+ text "Oh! This is get-"
+ line "ting even better!"
+ done
+
+_DexRatingText_Own70To79::
+ text "Very good!"
+ line "Go fish for some"
+ cont "marine #MON!"
+ done
+
+_DexRatingText_Own80To89::
+ text "Wonderful!"
+ line "Do you like to"
+ cont "collect things?"
+ done
+
+_DexRatingText_Own90To99::
+ text "I'm impressed!"
+ line "It must have been"
+ cont "difficult to do!"
+ done
+
+_DexRatingText_Own100To109::
+ text "You finally got at"
+ line "least 100 species!"
+ cont "I can't believe"
+ cont "how good you are!"
+ done
+
+_DexRatingText_Own110To119::
+ text "You even have the"
+ line "evolved forms of"
+ cont "#MON! Super!"
+ done
+
+_DexRatingText_Own120To129::
+ text "Excellent! Trade"
+ line "with friends to"
+ cont "get some more!"
+ done
+
+_DexRatingText_Own130To139::
+ text "Outstanding!"
+ line "You've become a"
+ cont "real pro at this!"
+ done
+
+_DexRatingText_Own140To149::
+ text "I have nothing"
+ line "left to say!"
+ cont "You're the"
+ cont "authority now!"
+ done
+
+_DexRatingText_Own150To151::
+ text "Your #DEX is"
+ line "fully complete!"
+ cont "Congratulations!"
+ done
diff --git a/tools/.gitignore b/tools/.gitignore
index 967af106..cf5f5adb 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,3 +1,4 @@
scan_includes
gfx
pkmncompress
+pcm
diff --git a/tools/Makefile b/tools/Makefile
index 7ab1d146..6bea053d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,7 +3,7 @@
CC := gcc
CFLAGS := -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers
-tools := scan_includes gfx pkmncompress
+tools := scan_includes gfx pkmncompress pcm
all: $(tools)
@:
diff --git a/tools/pcm.c b/tools/pcm.c
new file mode 100644
index 00000000..a14e291d
--- /dev/null
+++ b/tools/pcm.c
@@ -0,0 +1,160 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#define CHUNKID(b1, b2, b3, b4) \
+ (uint32_t)((uint32_t)(b1) | ((uint32_t)(b2) << 8) | \
+ ((uint32_t)(b3) << 16) | ((uint32_t)(b4) << 24))
+
+size_t file_size(FILE *f) {
+ if (fseek(f, 0, SEEK_END) == -1) return 0;
+ long f_size = ftell(f);
+ if (f_size == -1) return 0;
+ if (fseek(f, 0, SEEK_SET) == -1) return 0;
+ return (size_t)f_size;
+}
+
+int32_t get_uint16le(uint8_t *data, size_t size, size_t i) {
+ return i + 2 >= size ? -1 :
+ (int32_t)data[i] | ((int32_t)data[i+1] << 8);
+}
+
+int64_t get_uint32le(uint8_t *data, size_t size, size_t i) {
+ return i + 4 >= size ? -1 :
+ (int64_t)data[i] | ((int64_t)data[i+1] << 8) |
+ ((int64_t)data[i+2] << 16) | ((int64_t)data[i+3] << 24);
+}
+
+uint8_t *wav2pcm(uint8_t *wavdata, size_t wavsize, size_t *pcmsize) {
+ int64_t fourcc = get_uint32le(wavdata, wavsize, 0);
+ if (fourcc != CHUNKID('R', 'I', 'F', 'F')) {
+ fputs("WAV file does not start with 'RIFF'\n", stderr);
+ return NULL;
+ }
+
+ int64_t waveid = get_uint32le(wavdata, wavsize, 8);
+ if (waveid != CHUNKID('W', 'A', 'V', 'E')) {
+ fputs("RIFF chunk does not start with 'WAVE'\n", stderr);
+ return NULL;
+ }
+
+ size_t sample_offset = 0;
+ int64_t num_samples = 0;
+
+ size_t riffsize = (size_t)get_uint32le(wavdata, wavsize, 4) + 8;
+ for (size_t i = 12; i < riffsize;) {
+ int64_t chunkid = get_uint32le(wavdata, wavsize, i);
+ int64_t chunksize = get_uint32le(wavdata, wavsize, i+4);
+ i += 8;
+ if (chunksize == -1) {
+ fputs("failed to read sub-chunk size\n", stderr);
+ return NULL;
+ }
+
+ // require 22050 Hz 8-bit PCM WAV audio
+ if (chunkid == CHUNKID('f', 'm', 't', ' ')) {
+ int32_t audio_format = get_uint16le(wavdata, wavsize, i);
+ if (audio_format != 1) {
+ fputs("WAV data is not PCM format\n", stderr);
+ return NULL;
+ }
+ int32_t num_channels = get_uint16le(wavdata, wavsize, i+2);
+ if (num_channels != 1) {
+ fputs("WAV data is not mono\n", stderr);
+ return NULL;
+ }
+ int64_t sample_rate = get_uint32le(wavdata, wavsize, i+4);
+ if (sample_rate != 22050) {
+ fputs("WAV data is not 22050 Hz\n", stderr);
+ return NULL;
+ }
+ int32_t bits_per_sample = get_uint16le(wavdata, wavsize, i+14);
+ if (bits_per_sample != 8) {
+ fputs("WAV data is not 8-bit\n", stderr);
+ return NULL;
+ }
+ }
+
+ else if (chunkid == CHUNKID('d', 'a', 't', 'a')) {
+ sample_offset = i;
+ num_samples = chunksize;
+ break;
+ }
+
+ i += (size_t)chunksize;
+ }
+
+ if (!num_samples) {
+ fputs("WAV data has no PCM samples\n", stderr);
+ return NULL;
+ }
+
+ // pack 8 WAV samples per PCM byte, clamping each to 0 or 1
+ *pcmsize = (size_t)((num_samples + 7) / 8);
+ uint8_t *pcmdata = malloc(*pcmsize);
+ for (int64_t i = 0; i < num_samples; i += 8) {
+ uint8_t v = 0;
+ for (int64_t j = 0; j < 8 && i + j < num_samples; j++) {
+ v |= (wavdata[sample_offset + i + j] > 0x80) << (7 - j);
+ }
+ pcmdata[i / 8] = v;
+ }
+
+ return pcmdata;
+}
+
+int main(int argc, char *argv[]) {
+ if (argc != 3) {
+ fprintf(stderr, "Usage: %s infile.wav outfile.pcm\n", argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ char *wavname = argv[1];
+ char *pcmname = argv[2];
+
+ FILE *wavfile = fopen(wavname, "rb");
+ if (!wavfile) {
+ fprintf(stderr, "failed to open for reading: '%s'\n", wavname);
+ return EXIT_FAILURE;
+ }
+
+ size_t wavsize = file_size(wavfile);
+ if (!wavsize) {
+ fclose(wavfile);
+ fprintf(stderr, "failed to get file size: '%s'\n", wavname);
+ return EXIT_FAILURE;
+ }
+
+ uint8_t *wavdata = malloc(wavsize);
+ size_t readsize = fread(wavdata, 1, wavsize, wavfile);
+ fclose(wavfile);
+ if (readsize != wavsize) {
+ fprintf(stderr, "failed to read: '%s'\n", wavname);
+ return EXIT_FAILURE;
+ }
+
+ size_t pcmsize;
+ uint8_t *pcmdata = wav2pcm(wavdata, wavsize, &pcmsize);
+ free(wavdata);
+ if (!pcmdata) {
+ fprintf(stderr, "failed to convert: '%s'\n", wavname);
+ return EXIT_FAILURE;
+ }
+
+ FILE *pcmfile = fopen(pcmname, "wb");
+ if (!pcmfile) {
+ fprintf(stderr, "failed to open for writing: '%s'\n", pcmname);
+ return EXIT_FAILURE;
+ }
+
+ size_t writesize = fwrite(pcmdata, 1, pcmsize, pcmfile);
+ free(pcmdata);
+ fclose(pcmfile);
+ if (writesize != pcmsize) {
+ fprintf(stderr, "failed to write: '%s'\n", pcmname);
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/tools/pokemontools/pcm.py b/tools/pokemontools/pcm.py
new file mode 100644
index 00000000..428d5730
--- /dev/null
+++ b/tools/pokemontools/pcm.py
@@ -0,0 +1,156 @@
+# pcm.py
+# Converts between .wav files and 1-bit pcm data. (pcm = pulse-code modulation)
+
+import argparse
+import os
+import struct
+import wave
+
+
+BASE_SAMPLE_RATE = 22050
+
+def convert_to_wav(filenames=[]):
+ """
+ Converts a file containing 1-bit pcm data into a .wav file.
+ """
+ for filename in filenames:
+ with open(filename, 'rb') as pcm_file:
+ # Generate array of on/off pcm values.
+ samples = []
+ byte = pcm_file.read(1)
+ while byte != "":
+ byte = struct.unpack('B', byte)[0]
+ for i in range(8):
+ bit_index = 7 - i
+ value = (byte >> bit_index) & 1
+ samples.append(value)
+ byte = pcm_file.read(1)
+
+ # Write a .wav file using the pcm data.
+ name, extension = os.path.splitext(filename)
+ wav_filename = name + '.wav'
+ wave_file = wave.open(wav_filename, 'w')
+ wave_file.setframerate(BASE_SAMPLE_RATE)
+ wave_file.setnchannels(1)
+ wave_file.setsampwidth(1)
+
+ for value in samples:
+ if value > 0:
+ value = 0xff
+
+ packed_value = struct.pack('B', value)
+ wave_file.writeframesraw(packed_value)
+
+ wave_file.close()
+
+
+def convert_to_pcm(filenames=[]):
+ """
+ Converts a .wav file into 1-bit pcm data.
+ Samples in the .wav file are simply clamped to on/off.
+
+ This currently works correctly on .wav files with the following attributes:
+ 1. Sample Width = 1 or 2 bytes (Some wave files use 3 bytes per sample...)
+ 2. Arbitrary sample sample_rate
+ 3. Mono or Stereo (1 or 2 channels)
+ """
+ for filename in filenames:
+ samples, average_sample = get_wav_samples(filename)
+
+ # Generate a list of clamped samples
+ clamped_samples = []
+ for sample in samples:
+ # Clamp the raw sample to on/off
+ if sample < average_sample:
+ clamped_samples.append(0)
+ else:
+ clamped_samples.append(1)
+
+ # The pcm data must be a multiple of 8, so pad the clamped samples with 0.
+ while len(clamped_samples) % 8 != 0:
+ clamped_samples.append(0)
+
+ # Pack the 1-bit samples together.
+ packed_samples = bytearray()
+ for i in range(0, len(clamped_samples), 8):
+ # Read 8 pcm values to pack one byte.
+ packed_value = 0
+ for j in range(8):
+ packed_value <<= 1
+ packed_value += clamped_samples[i + j]
+ packed_samples.append(packed_value)
+
+ # Open the output .pcm file, and write all 1-bit samples.
+ name, extension = os.path.splitext(filename)
+ pcm_filename = name + '.pcm'
+ with open(pcm_filename, 'wb') as out_file:
+ out_file.write(packed_samples)
+
+
+def get_wav_samples(filename):
+ """
+ Reads the given .wav file and returns a list of its samples after re-sampling
+ to BASE_SAMPLE_RATE.
+ Also returns the average sample amplitude.
+ """
+ wav_file = wave.open(filename, 'r')
+ sample_width = wav_file.getsampwidth()
+ sample_count = wav_file.getnframes()
+ sample_rate = wav_file.getframerate()
+ num_channels = wav_file.getnchannels()
+
+ samples = bytearray(wav_file.readframes(sample_count))
+
+ # Unpack the values based on the sample byte width.
+ unpacked_samples = []
+ for i in range(0, len(samples), sample_width):
+ if sample_width == 1:
+ fmt = 'B'
+ elif sample_width == 2:
+ fmt = 'h'
+ else:
+ # todo: support 3-byte sample width
+ raise (Exception, "Unsupported sample width: " + str(sample_width))
+
+ value = struct.unpack(fmt, samples[i:i + sample_width])[0]
+ unpacked_samples.append(value)
+
+ # Only keep the samples from the first audio channel.
+ unpacked_samples = unpacked_samples[::num_channels]
+
+ # Approximate the BASE_SAMPLE_RATE.
+ # Also find the average amplitude of the samples.
+ resampled_samples = []
+ total_value = 0
+ interval = float(sample_rate) / BASE_SAMPLE_RATE
+ index = 0
+ while index < sample_count:
+ sample = unpacked_samples[int(index)]
+ total_value += sample
+
+ resampled_samples.append(sample)
+ index += interval
+
+ average_sample = float(total_value) / len(resampled_samples)
+
+ return resampled_samples, average_sample
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument('mode')
+ ap.add_argument('filenames', nargs='*')
+ args = ap.parse_args()
+
+ method = {
+ 'wav': convert_to_wav,
+ 'pcm': convert_to_pcm,
+ }.get(args.mode, None)
+
+ if method == None:
+ raise (Exception, "Unknown conversion method!")
+
+ method(args.filenames)
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/unnamed.py b/tools/unnamed.py
index c5544437..d3a8b6bf 100755
--- a/tools/unnamed.py
+++ b/tools/unnamed.py
@@ -40,8 +40,8 @@ objects = None
if args.rootdir:
for line in Popen(["make", "-C", args.rootdir, "-s", "-p", "DEBUG=1"],
stdout=PIPE).stdout.read().decode().split("\n"):
- if line.startswith("pokered_obj := "):
- objects = line[15:].strip().split()
+ if line.startswith("rom_obj := "):
+ objects = line[11:].strip().split()
break
else:
print("Error: Object files not found!", file=stderr)
@@ -63,7 +63,7 @@ for line in args.symfile:
symbols.add(symbol)
# If no object files were provided, just print what we know and exit
-print("Unnamed pokered symbols: %d (%.2f%% complete)" % (len(symbols),
+print("Unnamed pokeyellow symbols: %d (%.2f%% complete)" % (len(symbols),
(symbols_total - len(symbols)) / symbols_total * 100))
if not objects:
for sym in symbols:
diff --git a/wram.asm b/wram.asm
index 5a823f20..57f6b1d0 100644
--- a/wram.asm
+++ b/wram.asm
@@ -81,7 +81,9 @@ wAudioSavedROMBank:: db
wFrequencyModifier:: db
wTempoModifier:: db
- ds 13
+wc0f3:: dw
+
+ ds 11
SECTION "Sprite State Data", WRAM0
@@ -110,9 +112,10 @@ wSpriteStateData1::
; - F
wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1 ; player is struct 0
; wSprite02StateData1 - wSprite15StateData1
-FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
+FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1
wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1
ENDR
+wSpritePikachuStateData1:: spritestatedata1 wSpritePikachuStateData1 ; pikachu is struct 15
; more data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
@@ -136,9 +139,10 @@ wSpriteStateData2::
; - F
wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2 ; player is struct 0
; wSprite02StateData2 - wSprite15StateData2
-FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
+FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS - 1
wSprite{02d:n}StateData2:: spritestatedata2 wSprite{02d:n}StateData2
ENDR
+wSpritePikachuStateData2:: spritestatedata2 wSpritePikachuStateData2 ; pikachu is struct 15
; The high byte of a pointer to anywhere within wSpriteStateData1 can be incremented
; to reach within wSpriteStateData2, and vice-versa for decrementing.
@@ -175,6 +179,83 @@ wSerialPartyMonsPatchList:: ds 200
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
wSerialEnemyMonsPatchList:: ds 200
+
+NEXTU
+; this looks similar to the address structure for Gen 2 OAM animations.
+wAnimatedObjectsData::
+
+wAnimatedObjectStartTileOffsets:: ds 10 * 2
+
+wAnimatedObjectDataStructs::
+; wAnimatedObject0 - wAnimatedObject9
+FOR n, 10
+wAnimatedObject{d:n}:: animated_object wAnimatedObject{d:n}
+ENDR
+
+wNumLoadedAnimatedObjects:: db
+wCurrentAnimatedObjectOAMBufferOffset::
+ ds 3
+wAnimatedObjectSpawnStateDataPointer:: dw
+wAnimatedObjectFramesDataPointer:: dw
+wAnimatedObjectJumptablePointer:: dw
+wAnimatedObjectOAMDataPointer:: dw
+
+wCurAnimatedObjectOAMAttributes:: db
+wCurrentAnimatedObjectVTileOffset:: db
+wCurrentAnimatedObjectXCoord:: db
+wCurrentAnimatedObjectYCoord:: db
+wCurrentAnimatedObjectXOffset:: db
+wCurrentAnimatedObjectYOffset:: db
+wAnimatedObjectGlobalYOffset:: db
+wAnimatedObjectGlobalXOffset:: db
+
+wAnimatedObjectsDataEnd::
+
+; Surfing minigame
+wSurfingMinigameData:: db
+wSurfingMinigameRoutineNumber:: db
+wc5d2:: db
+wSurfingMinigameWaveFunctionNumber:: dw
+wc5d5:: db
+wSurfingMinigamePikachuHP:: dw ; little-endian BCD
+wc5d8:: db ; unused?
+; number of consecutive tricks
+wSurfingMinigameRadnessMeter:: db
+wSurfingMinigameRadnessScore:: dw ; little-endian BCD
+wSurfingMinigameTotalScore:: dw ; little-endian BCD
+wc5de:: db
+wc5df:: db
+wc5e0:: db
+wc5e1:: db
+wc5e2:: db
+wSurfingMinigamePikachuSpeed:: dw ; little-endian
+wc5e5:: ds 3 ; big-endian
+wSurfingMinigameWaveHeightBuffer:: dw
+wSurfingMinigamePikachuObjectHeight:: db
+wc5eb:: db
+wc5ec:: db
+wc5ed:: db
+wc5ee:: db
+wSurfingMinigameBGMapReadBuffer:: ds 1 tiles
+ ds 24
+wSurfingMinigameSCX:: db
+wSurfingMinigameSCX2:: db
+wSurfingMinigameSCXHi:: db
+wSurfingMinigameWaveHeight:: ds SCREEN_WIDTH
+wSurfingMinigameXOffset:: db
+wSurfingMinigameTrickFlags:: db
+wc630:: db
+wc631:: db
+wSurfingMinigameRoutineDelay:: db
+wSurfingMinigameIntroAnimationFinished:: db
+
+; Yellow intro
+wYellowIntroCurrentScene::
+wc634:: db
+wYellowIntroSceneTimer::
+wc635:: db
+wYellowIntroAnimatedObjectStructPointer:: db
+wSurfingMinigameDataEnd::
ENDU
ds 80
@@ -188,6 +269,68 @@ wOverworldMapEnd::
NEXTU
wTempPic:: ds 7 * 7 tiles
+
+NEXTU
+wPrinterData::
+wPrinterSendState:: db
+wPrinterRowIndex:: db
+
+; Printer data header
+wPrinterDataHeader::
+wc6ea:: db
+wc6eb:: db
+wc6ec:: db
+wc6ed:: db
+wPrinterChecksum:: dw
+
+UNION
+wPrinterSerialReceived:: db
+; bit 7: set if error 1 (battery low)
+; bit 6: set if error 4 (too hot or cold)
+; bit 5: set if error 3 (paper jammed or empty)
+; if this and the previous byte are both $ff: error 2 (connection error)
+wPrinterStatusReceived:: db
+
+wc6f2:: db
+wc6f3:: db
+ ds 12
+wLYOverrides:: ds $100
+wLYOverridesEnd::
+wLYOverridesBuffer:: ds $100
+wLYOverridesBufferEnd::
+
+NEXTU
+wPrinterSendDataSource1:: ds 20 tiles
+wPrinterSendDataSource2:: ds 20 tiles
+ENDU
+
+wPrinterSendDataSource1End::
+
+wPrinterHandshake:: db
+wPrinterStatusFlags:: db
+wHandshakeFrameDelay:: db
+wPrinterSerialFrameDelay:: db
+wPrinterSendByteOffset:: dw
+wPrinterDataSize:: dw
+wPrinterTileBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH
+wPrinterStatusIndicator:: dw
+wcae2:: db
+wPrinterSettingsTempCopy:: db
+ ds 16
+wPrinterQueueLength:: db
+wPrinterDataEnd::
+
+wPrinterPokedexEntryTextPointer:: dw
+ ds 2
+wPrinterPokedexMonIsOwned:: db
+ ds 226
+UNION
+wcbdc:: ds 1 tiles
+NEXTU
+ ds 14
+wcbea:: dw
+ENDU
+wcbec:: ds 1 tiles
ENDU
@@ -510,6 +653,33 @@ wEnemyNumHits:: ; db
wEnemyBideAccumulatedDamage:: dw
ds 8
+
+NEXTU
+ ds 2
+wTrainerCardBadgeAttributes:: ds 6 * 9 + 1
+
+NEXTU
+wPikaPicUsedGFXCount:: db
+
+wPikaPicUsedGFX:: ds 8 * 2
+wPikaPicUsedGFXEnd::
+
+ ds 43
+
+wPikaPicAnimObjectDataBufferSize:: db
+
+wPikaPicAnimObjectDataBuffer::
+; 4 structs each of length 8
+; 0: buffer index
+; 1: script index
+; 2: frame index
+; 3: frame timer
+; 4: vtile offset
+; 5: x offset
+; 6: y offset
+; 7: unused
+ ds 4 * 8
+wPikaPicAnimObjectDataBufferEnd::
ENDU
; This union spans 39 bytes.
@@ -840,7 +1010,12 @@ wSwappedMenuItem::
; 1 = bite
; 2 = no fish on map
wRodResponse::
+wOptionsCursorLocation::
db
+
+NEXTU
+wTitleScreenScene:: db
+wTitleScreenTimer:: db
ENDU
; 0 = neither
@@ -1017,8 +1192,6 @@ wScriptedNPCWalkCounter:: db
ds 1
-wGBC:: db
-
; if running on SGB, it's 1, else it's 0
wOnSGB:: db
@@ -1062,6 +1235,10 @@ NEXTU
; the total amount of exp a mon gained
wExpAmountGained:: dw
wGainBoostedExp:: db
+
+NEXTU
+ ds 9
+wPartyHPBarAttributes:: ds PARTY_LENGTH
ENDU
wGymCityName:: ds 17
@@ -1605,7 +1782,7 @@ wEvolutionOccurred:: db
wVBlankSavedROMBank:: db
- ds 1
+wFarCopyDataSavedROMBank:: db
wIsKeyItem:: db
@@ -1839,7 +2016,84 @@ wWarpEntries:: ds 32 * 4 ; Y, X, warp ID, map ID
; if $ff, the player's coordinates are not updated when entering the map
wDestinationWarpID:: db
- ds 128
+wPikachuOverworldStateFlags:: db
+wPikachuSpawnState:: db
+wd432:: db
+wd433:: db
+wd434:: db
+wd435:: db
+wd436:: db
+wPikachuFollowCommandBufferSize:: db
+wPikachuFollowCommandBuffer:: ds 16
+
+wExpressionNumber:: db
+wPikaPicAnimNumber:: db
+
+wPikachuMovementScriptBank:: db
+wPikachuMovementScriptAddress:: dw
+; bit 6 - spawn shadow
+; bit 7 - signal end of command
+wPikachuMovementFlags:: db
+
+UNION
+wCurPikaMovementData::
+wCurPikaMovementParam1:: db
+wCurPikaMovementFunc1:: db
+wCurPikaMovementParam2:: db
+wCurPikaMovementFunc2:: db
+wd451:: db
+wCurPikaMovementSpriteImageIdx:: db
+wPikaSpriteX:: db
+wPikaSpriteY:: db
+wPikachuMovementXOffset:: db
+wPikachuMovementYOffset:: db
+wPikachuStepTimer:: db
+wPikachuStepSubtimer:: db
+ ds 5
+wCurPikaMovementDataEnd::
+
+NEXTU
+wPikaPicAnimPointer:: dw
+wPikaPicAnimPointerSetupFinished:: db
+wPikaPicAnimCurGraphicID:: db
+wPikaPicAnimTimer:: dw
+wPikaPicAnimDelay:: db
+wPikaPicPikaDrawStartX:: db
+wPikaPicPikaDrawStartY:: db
+
+wCurPikaPicAnimObject::
+wCurPikaPicAnimObjectVTileOffset:: db
+wCurPikaPicAnimObjectXOffset:: db
+wCurPikaPicAnimObjectYOffset:: db
+wCurPikaPicAnimObjectScriptIdx:: db
+wCurPikaPicAnimObjectFrameIdx:: db
+wCurPikaPicAnimObjectFrameTimer:: db
+ ds 1
+wCurPikaPicAnimObjectEnd::
+
+ ds 18
+ENDU
+
+wPikachuHappiness:: db
+wPikachuMood:: db
+wd472:: db
+wd473:: db
+ ds 1
+wd475:: db
+ ds 4
+wd47a:: db
+ ds 24
+wd492:: db
+ ds 1
+wSurfingMinigameHiScore:: dw ; little-endian BCD
+ ds 1
+wPrinterSettings:: db
+wUnknownSerialFlag_d499:: db
+wPrinterConnectionOpen:: db
+wPrinterOpcode:: db
+wd49c:: db
+
+ ds 19
; number of signs in the current map (up to 16)
wNumSigns:: db
@@ -1940,7 +2194,7 @@ wViridianCityCurScript:: db
wPewterCityCurScript:: db
wRoute3CurScript:: db
wRoute4CurScript:: db
- ds 1
+wFanClubCurScript:: db
wViridianGymCurScript:: db
wPewterGymCurScript:: db
wCeruleanGymCurScript:: db
@@ -2005,7 +2259,7 @@ wPokemonMansion3FCurScript:: db
wPokemonMansionB1FCurScript:: db
wVictoryRoad2FCurScript:: db
wVictoryRoad3FCurScript:: db
- ds 1
+wCeladonCityCurScript:: db
wFightingDojoCurScript:: db
wSilphCo2FCurScript:: db
wSilphCo3FCurScript:: db
@@ -2079,7 +2333,12 @@ wPlayerJumpingYScreenCoordsIndex:: db
wRivalStarter:: db
+IF DEF(_DEBUG)
+; this byte gets set to NUM_POKEMON by DebugStart
+wUnknownDebugByte:: db
+ELSE
ds 1
+ENDC
wPlayerStarter:: db
@@ -2332,10 +2591,21 @@ wBoxMonNicksEnd::
wBoxDataEnd::
+SECTION "GBC Palette Data", WRAM0
+
+wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2
+wGBCPal:: ds PALETTE_SIZE
+wLastBGP:: db
+wLastOBP0:: db
+wLastOBP1:: db
+wdef5:: db
+wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE
+
+
SECTION "Stack", WRAM0
; the stack grows downward
- ds $100 - 1
+ ds $eb - 1
wStack:: db